|
@@ -34,10 +34,10 @@ uint8_t PongMsg[] = "PONG\0";
|
|
|
tRadioDriver *Radio=NULL;
|
|
|
/*
|
|
|
*********************************************************************************************************
|
|
|
-* 函 数 名: void data_task(void *pdata)
|
|
|
-* 功能说明: 主要是data_task处理线程,优先级高。其运行逻辑是将nandflash中的数据解析出来轮询发送数据
|
|
|
-* 形 参:无
|
|
|
-* 返 回 值: 无
|
|
|
+* 锟斤拷 锟斤拷 锟斤拷: void data_task(void *pdata)
|
|
|
+* 锟斤拷锟斤拷说锟斤拷: 锟斤拷要锟斤拷data_task锟斤拷锟斤拷锟竭程o拷锟斤拷锟饺硷拷锟竭★拷锟斤拷锟斤拷锟斤拷锟竭硷拷锟角斤拷nandflash锟叫碉拷锟斤拷锟捷斤拷锟斤拷锟斤拷锟斤拷锟斤拷询锟斤拷锟斤拷锟斤拷锟斤拷
|
|
|
+* 锟斤拷 锟轿o拷锟斤拷
|
|
|
+* 锟斤拷 锟斤拷 值: 锟斤拷
|
|
|
*********************************************************************************************************
|
|
|
*/
|
|
|
|
|
@@ -88,7 +88,7 @@ void data_task(void *pdata)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- #if 0 //测试代码不经过转发直接进行相应的解析
|
|
|
+ #if 0 //锟斤拷锟皆达拷锟诫不锟斤拷锟斤拷转锟斤拷直锟接斤拷锟斤拷锟斤拷应锟侥斤拷锟斤拷
|
|
|
SlaveProtocolAnalysis(string,bufferLength);
|
|
|
data_acquisition();
|
|
|
uint8_t node_string[256];
|
|
@@ -99,10 +99,10 @@ void data_task(void *pdata)
|
|
|
|
|
|
/*
|
|
|
*********************************************************************************************************
|
|
|
-* 函 数 名: int READ_MODBUS_DATA(DEVICE_PARAMS *device)
|
|
|
-* 功能说明: 读取当前节点上的modbus数据
|
|
|
-* 形 参:DEVICE_PARAMS *device 当前设备
|
|
|
-* 返 回 值: 1 :成功 0:失败
|
|
|
+* 锟斤拷 锟斤拷 锟斤拷: int READ_MODBUS_DATA(DEVICE_PARAMS *device)
|
|
|
+* 锟斤拷锟斤拷说锟斤拷: 锟斤拷取锟斤拷前锟节碉拷锟较碉拷modbus锟斤拷锟斤拷
|
|
|
+* 锟斤拷 锟轿o拷DEVICE_PARAMS *device 锟斤拷前锟借备
|
|
|
+* 锟斤拷 锟斤拷 值: 1 锟斤拷锟缴癸拷 0锟斤拷失锟斤拷
|
|
|
*********************************************************************************************************
|
|
|
*/
|
|
|
|
|
@@ -116,7 +116,7 @@ int READ_MODBUS_DATA(DEVICE_PARAMS *device)
|
|
|
if (current_device->protocol == MODBUS_READ)
|
|
|
{
|
|
|
protocol_485=1;
|
|
|
- uint16_t data[currentModbusParams->registerByteNum /2]; // modbus寄存器长度
|
|
|
+ uint16_t data[currentModbusParams->registerByteNum /2]; // modbus锟侥达拷锟斤拷锟斤拷锟斤拷
|
|
|
mmodbus_set16bitOrder(current_device->MDBbigLittleFormat);
|
|
|
if (currentModbusParams->functionCode == 0x03 | currentModbusParams->functionCode == 0x01)
|
|
|
{
|
|
@@ -217,14 +217,12 @@ int READ_MODBUS_DATA(DEVICE_PARAMS *device)
|
|
|
}
|
|
|
/*
|
|
|
*********************************************************************************************************
|
|
|
-* 函 数 名:void WRITE_MODBUS_DATA(char* cJSONstring)
|
|
|
-* 功能说明: 接收mqtt数据并写入modbus寄存器
|
|
|
-* 形 参:char* cJSONstring mqtt接收到的数据
|
|
|
-* 返 回 值: 无
|
|
|
+* 锟斤拷 锟斤拷 锟斤拷:void WRITE_MODBUS_DATA(char* cJSONstring)
|
|
|
+* 锟斤拷锟斤拷说锟斤拷: 锟斤拷锟斤拷mqtt锟斤拷锟捷诧拷写锟斤拷modbus锟侥达拷锟斤拷
|
|
|
+* 锟斤拷 锟轿o拷char* cJSONstring mqtt锟斤拷锟秸碉拷锟斤拷锟斤拷锟斤拷
|
|
|
+* 锟斤拷 锟斤拷 值: 锟斤拷
|
|
|
*********************************************************************************************************
|
|
|
*/
|
|
|
-
|
|
|
-value data = {0};
|
|
|
void WRITE_MODBUS_DATA(char* cJSONstring){
|
|
|
GATEWAY_PARAMS* get;
|
|
|
get = get_gateway_config_params();
|
|
@@ -243,7 +241,8 @@ void WRITE_MODBUS_DATA(char* cJSONstring){
|
|
|
uint16_t number;
|
|
|
uint16_t data;
|
|
|
|
|
|
- while(current_device){
|
|
|
+ while(current_device)
|
|
|
+ {
|
|
|
char* device_ID = (char*)current_device->deviceID;
|
|
|
GATEWAY_WRITE_MODBUS_COMMAND *currentModbusParams = current_device->params->gateway_write_modbus_command;
|
|
|
if(!strcmp(device_ID,deviceId)){
|