|
@@ -244,18 +244,16 @@ void WRITE_MODBUS_DATA(char* cJSONstring){
|
|
|
uint16_t data;
|
|
|
|
|
|
while(current_device){
|
|
|
- char* device_ID = current_device->deviceID;
|
|
|
+ char* device_ID = (char*)current_device->deviceID;
|
|
|
GATEWAY_WRITE_MODBUS_COMMAND *currentModbusParams = current_device->params->gateway_write_modbus_command;
|
|
|
- int time = 900;//60
|
|
|
if(!strcmp(device_ID,deviceId)){
|
|
|
- OSTimeDlyHMSM(0, 0, 0, time);
|
|
|
+ OSTimeDlyHMSM(0, 0, 0, 60);
|
|
|
OSIntEnter();
|
|
|
if(power){
|
|
|
slaveAddress = currentModbusParams->slaveAddress;
|
|
|
number =currentModbusParams->registerAddress;
|
|
|
data = power->valueint;
|
|
|
mmodbus_writeHoldingRegister16i(slaveAddress, number, data);
|
|
|
- OSTimeDlyHMSM(0, 0, 0, time);
|
|
|
}
|
|
|
if(temp){
|
|
|
currentModbusParams = currentModbusParams->nextParams;
|
|
@@ -263,7 +261,7 @@ void WRITE_MODBUS_DATA(char* cJSONstring){
|
|
|
number =currentModbusParams->registerAddress;
|
|
|
data = temp->valueint;
|
|
|
mmodbus_writeHoldingRegister16i(slaveAddress, number, data);
|
|
|
- OSTimeDlyHMSM(0, 0, 0, time);
|
|
|
+
|
|
|
}
|
|
|
if(mode){
|
|
|
currentModbusParams = currentModbusParams->nextParams;
|
|
@@ -271,7 +269,7 @@ void WRITE_MODBUS_DATA(char* cJSONstring){
|
|
|
number =currentModbusParams->registerAddress;
|
|
|
data = mode->valueint;
|
|
|
mmodbus_writeHoldingRegister16i(slaveAddress, number, data);
|
|
|
- OSTimeDlyHMSM(0, 0, 0, time);
|
|
|
+
|
|
|
}
|
|
|
if(fan){
|
|
|
currentModbusParams = currentModbusParams->nextParams;
|
|
@@ -279,9 +277,9 @@ void WRITE_MODBUS_DATA(char* cJSONstring){
|
|
|
number =currentModbusParams->registerAddress;
|
|
|
data = fan->valueint;
|
|
|
mmodbus_writeHoldingRegister16i(slaveAddress, number, data);
|
|
|
- OSTimeDlyHMSM(0, 0, 0, time);
|
|
|
+
|
|
|
}
|
|
|
- OSIntExit();
|
|
|
+ OSIntExit();
|
|
|
}
|
|
|
current_device = current_device->nextDevice;
|
|
|
}
|