This commit is contained in:
zhouhuang 2024-12-24 12:14:20 +08:00
parent e8f67c6fb1
commit 8b3d4f1d03
3 changed files with 8 additions and 8 deletions

View File

@ -1390,13 +1390,13 @@ BOOLEAN CRYDevice::processRyADSParam(const Json::Value jsonRoot, int pid)
//ads添加路由的用户名密码
//用户名
if (jsonRoot["adsUser"].isString()) {
config_config.processes[pid].option.ryads.user = atoi(jsonRoot["adsUser"].asCString());
snprintf(config_config.processes[pid].option.ryads.user, sizeof(config_config.processes[pid].option.ryads.user), "%s", jsonRoot["adsUser"].asCString());
} else { //默认存在允许ftp功能
snprintf(config_config.processes[pid].option.ryads.user, sizeof(config_config.processes[pid].option.ryads.user), "%s", "admin");
}
//密码
if (jsonRoot["adsPassword"].isString()) {
config_config.processes[pid].option.ryads.password = atoi(jsonRoot["adsPassword"].asCString());
snprintf(config_config.processes[pid].option.ryads.password, sizeof(config_config.processes[pid].option.ryads.password), "%s", jsonRoot["adsPassword"].asCString());
} else { //默认存在允许ftp功能
snprintf(config_config.processes[pid].option.ryads.password, sizeof(config_config.processes[pid].option.ryads.password), "%s", "admin");
}

View File

@ -883,8 +883,8 @@ BOOLEAN CHostADSBFProcess::OnPreCreate(int id)
//目标端口
m_remotePort = m_nOptions.net.target_port;
m_user = std::string(m_nOptions.user);
m_password = std::string(m_nOptions.password);
m_adsUser = std::string(m_nOptions.user);
m_adsPassword = std::string(m_nOptions.password);
m_bHaveFTP = m_nOptions.bHaveFTP;
calc();
@ -977,8 +977,8 @@ BOOLEAN CHostADSBFProcess::OnTimer(void)
//先添加一条路由
if (m_bRouteAdded == FALSE)
{
long ret = AddRemoteRoute(m_remoteIp, AmsNetId(m_localNetId), m_localIp, std::string("isoftstone"), m_user, m_password);
vLog(LOG_DEBUG, "%s add route(%s to %s) return value is: %d\n", m_pidName.c_str(), m_localIp.c_str(), m_remoteIp.c_str(), ret);
long ret = AddRemoteRoute(m_remoteIp, AmsNetId(m_localNetId), m_localIp, std::string("isoftstone"), m_adsUser, m_adsPassword);
vLog(LOG_DEBUG, "%s add route(%s to %s) with remote user name: %s, and remote password: %s, return value is: %d\n", m_pidName.c_str(), m_localIp.c_str(), m_remoteIp.c_str(), m_adsUser.c_str(), m_adsPassword.c_str(), ret);
if (ret != 0) return TRUE;
}
m_bRouteAdded = TRUE;

View File

@ -43,8 +43,8 @@ private:
std::string m_localNetId; //本机IP地址
std::string m_remoteIp; //PLC设备ip地址
std::string m_remoteNetId;
std::string m_user;
std::string m_password;
std::string m_adsUser;
std::string m_adsPassword;
AdsDevice *m_turbine;
BOOLEAN m_bRouteAdded; //路由是否添加成功