1、位移监测传感器上传参数修改
2、CatOneTask兼容新版4G模块 3、完善传感器类型SensorType_m结构
This commit is contained in:
Submodule Project/GateWay/source/Module/GateWay_Debug updated: 28b612dd28...7e55f4cb1b
@@ -28,7 +28,6 @@ typedef enum {
|
||||
DEBUG_CH_RS485_2,
|
||||
}DebugChannel_m;
|
||||
|
||||
|
||||
typedef enum {
|
||||
DEV_TYPE_BROADCAST,
|
||||
DEV_TYPE_INC_COMMUNIT = 0x8001,
|
||||
@@ -128,9 +127,11 @@ typedef struct {
|
||||
}__attribute__((packed))LaserTracingType_T;
|
||||
|
||||
typedef struct {//0x0020 位移计
|
||||
MasterDev_T MasterDev;
|
||||
int16_t PitchAngle; //俯仰角偏斜(范围±900)单位0.1°
|
||||
int16_t RollAngle; //横滚角偏斜(范围±900)单位0.1°
|
||||
int16_t YawAngle; //偏航角偏斜(范围0~3600)单位0.1°
|
||||
float Temp; //温度
|
||||
float Altitude; //海拔()单位cm
|
||||
int16_t Distance; //1轴应力值转位移(范围±300,单位0.1mm)
|
||||
}__attribute__ ((packed))Displacement_T,*DisplacementDp;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#define SOFTWARE_VERSION 12
|
||||
#define HARDWARE_VERSION 12
|
||||
|
||||
#define MAC_ADDR_TYPE 4//0为测试服务器
|
||||
#define MAC_ADDR_TYPE 9//0为测试服务器
|
||||
|
||||
extern bool MainDispEn;
|
||||
#define MAIN_DBG_LOG(...) { if(MainDispEn) Debug_Printf(__VA_ARGS__);}
|
||||
|
||||
@@ -28,6 +28,26 @@ static uint16_t CatSendErrCnt = 0;
|
||||
|
||||
#define CATONE_RESET_DELAY_TIME_MAX (5 * 60 * 1000)
|
||||
|
||||
//const char *CatOneATCmdStr[16] = {
|
||||
// "NULL",
|
||||
// "AT\r\n", //开机检测
|
||||
// "ATE0\r\n", //关回显
|
||||
// "AT+CPIN?\r\n", //识卡
|
||||
//// "AT+CIMI\r\n", //IMEI
|
||||
// "AT+CGSN=1\r\n",
|
||||
// "AT+LCCID\r\n", //读卡号
|
||||
// "AT+CEREG?\r\n", //查询注册状态
|
||||
// "AT+CGPADDR=1\r\n", //查询IP地址
|
||||
// "AT+CSQ\r\n", //查询信号强度
|
||||
// "AT+LDNSGIP=gxjt.cui635.cn\r\n",
|
||||
// "AT+LBS=0\r\n", //获取基站定位信息
|
||||
// "AT+LIPOPEN=", //设置TCP服务器地址和端口,AT+LIPOPEN="TCP","114.55.52.96",6803
|
||||
// "AT+LIPSEND=", //发送数据, AT+LIPSEND=0,1,20,"31313131313131323232323232"
|
||||
// "AT+LIPCLOSE=0\r\n",//断开连接
|
||||
// "AT+LBSPARA=http://locator-aep.xiot.senthink.com:80/locator/v0.1/locate,B84E427D95B1DF4A3F49B18DDF714C72\r\n",
|
||||
// "AT+CCLK?\r\n", //获取时间
|
||||
//};
|
||||
|
||||
const char *CatOneATCmdStr[16] = {
|
||||
"NULL",
|
||||
"AT\r\n", //开机检测
|
||||
@@ -35,17 +55,18 @@ const char *CatOneATCmdStr[16] = {
|
||||
"AT+CPIN?\r\n", //识卡
|
||||
// "AT+CIMI\r\n", //IMEI
|
||||
"AT+CGSN=1\r\n",
|
||||
"AT+LCCID\r\n", //读卡号
|
||||
"AT+QCCID\r\n", //读卡号
|
||||
"AT+CEREG?\r\n", //查询注册状态
|
||||
"AT+CGPADDR=1\r\n", //查询IP地址
|
||||
"AT+CSQ\r\n", //查询信号强度
|
||||
"AT+LDNSGIP=gxjt.cui635.cn\r\n",
|
||||
"AT+LBS=0\r\n", //获取基站定位信息
|
||||
"AT+LIPOPEN=", //设置TCP服务器地址和端口,AT+LIPOPEN="TCP","114.55.52.96",6803
|
||||
"AT+LIPSEND=", //发送数据, AT+LIPSEND=0,1,20,"31313131313131323232323232"
|
||||
"AT+LIPCLOSE=0\r\n",//断开连接
|
||||
"AT+LBSPARA=http://locator-aep.xiot.senthink.com:80/locator/v0.1/locate,B84E427D95B1DF4A3F49B18DDF714C72\r\n",
|
||||
"AT+CCLK?\r\n", //获取时间
|
||||
"AT+QLBS\r\n", //获取基站定位信息
|
||||
"AT+QIOPEN=", //设置TCP服务器地址和端口,AT+LIPOPEN="TCP","114.55.52.96",6803
|
||||
"AT+QISEND=", //发送数据, AT+LIPSEND=0,1,20,"31313131313131323232323232"
|
||||
"AT+QICLOSE=0\r\n",//断开连接
|
||||
"AT+QLBSCFG=\"server\",http://locator-aep.xiot.senthink.com:80/locator/v0.1/locate\r\n",
|
||||
"AT+QLBSCFG=\"token\",45B516D3078467E84DD2CFBF3532A4CB\r\n",
|
||||
"AT+CCLK?\r\n", //获取时间
|
||||
};
|
||||
|
||||
void Cat1DBGOnOff(bool OnOff)
|
||||
@@ -213,22 +234,22 @@ void CatOneAtCmdAnalyze(char *RxBuff)
|
||||
if(strstr(RxBuff, "OK") == NULL) {
|
||||
CatOne.ATCmdRet = CAT_ONE_RET_ERR;
|
||||
}
|
||||
p = strstr(RxBuff, "+LCCID");
|
||||
p = strstr(RxBuff, "+QCCID");
|
||||
if(p == NULL) {
|
||||
CatOne.ATCmdRet = CAT_ONE_RET_ERR;
|
||||
}
|
||||
memset(CatOne.SIM, 0, 32);
|
||||
ret = sscanf(p, "+LCCID: %s\r\n", CatOne.SIM);
|
||||
ret = sscanf(p, "+QCCID: %s\r\n", CatOne.SIM);
|
||||
if(ret != 1) {
|
||||
memset(CatOne.SIM, 0, 32);
|
||||
}
|
||||
break;
|
||||
|
||||
case CAT_ONE_LBS:
|
||||
p = strstr(RxBuff, "+LBS");
|
||||
p = strstr(RxBuff, "+QLBS");
|
||||
if(p != NULL) {
|
||||
double Longitude, Latitude;
|
||||
int ret = sscanf(p, "+LBS: %lf,%lf\r\n", &Longitude, &Latitude);
|
||||
int ret = sscanf(p, "+QLBS: %lf,%lf\r\n", &Longitude, &Latitude);
|
||||
if(ret == 2) {
|
||||
CatOne.LBSFlag = true;
|
||||
CatOne.Longitude = Longitude * 100000;
|
||||
|
||||
@@ -8,23 +8,39 @@
|
||||
|
||||
//传感器对应的数据长度
|
||||
const uint8_t SensorTypeDataLen[] = {
|
||||
0, //0x0000-保留
|
||||
0, //0x0000-保留
|
||||
30, //0x0001-应力场检测单元
|
||||
12, //0x0002-渗透压检测单元
|
||||
14, //0x0003-弹性波导检测单元
|
||||
10, //0x0004-介电质普检测单元
|
||||
6, //0x0005-微振动
|
||||
6, //0x0006-三维连续变形检测单元
|
||||
6, //0x0006-三维连续变形检测单元
|
||||
3, //0x0007-通讯单元
|
||||
18, //0x0008-三维应力检测单元
|
||||
18, //0x0008-三维应力检测单元
|
||||
9, //0x0009-激光示踪(主设备)
|
||||
12, //0x000A-水位计
|
||||
12, //0x000A-水位计
|
||||
0, //0x000B-保留
|
||||
0, //0x000C-保留
|
||||
14, //0x000D-二维应力场检测单元
|
||||
14, //0x000D-二维应力场检测单元
|
||||
9, //0x000E-裂缝检测单元
|
||||
0, //0x000F-预留
|
||||
8, //0x0010-姿态检测单元
|
||||
4, //0x0011-激光位移检测单元
|
||||
4, //0x0012-表面应力传感器
|
||||
4, //0x0013-压力传感器
|
||||
4, //0x0014-微波测距传感器
|
||||
0, //0x0015-表贴式结冰传感器
|
||||
0, //0x0016-埋入式结冰传感器
|
||||
4, //0x0017-单通道钢筋应力传感器
|
||||
4, //0x0018-单通道锚杆轴力传感器
|
||||
32, //0x0019-8通道钢筋拉压力传感器
|
||||
32, //0x001A-8通道锚杆轴力传感器
|
||||
0, //0x001B-16通道钢筋应力传感器
|
||||
0, //0x001C-16通道锚杆轴力传感器
|
||||
0, //0x001D-爆炸冲击传感器
|
||||
0, //0x001E-随行支架传感器
|
||||
0, //0x001F-冻融循环传感器
|
||||
19, //0x0020-位移计
|
||||
};
|
||||
|
||||
/*****************************************************************************************
|
||||
@@ -441,8 +457,8 @@ void DebugDisplaySensorData(int SensorIdx, uint16_t SensorType, uint8_t *SensorD
|
||||
case DISPLACEMENT: {
|
||||
Displacement_T Sensor;
|
||||
memcpy((uint8_t *)&Sensor, SensorData, sizeof(Displacement_T));
|
||||
MAIN_DBG_LOG("Sensor%d Type %04x: PitchAngle=%04d, RollAngle=%04d, YawAngle=%04d, Altitude=%06f, Distance=%04d\r\n",
|
||||
SensorIdx, SensorType, Sensor.PitchAngle, Sensor.RollAngle, Sensor.YawAngle, Sensor.Altitude, Sensor.Distance);
|
||||
MAIN_DBG_LOG("Sensor%d Type %04x: PitchAngle=%04d, RollAngle=%04d, YawAngle=%04d, Temp=%06f, Altitude=%06f, Distance=%04d\r\n",
|
||||
SensorIdx, SensorType, Sensor.PitchAngle, Sensor.RollAngle, Sensor.YawAngle, Sensor.Temp, Sensor.Altitude, Sensor.Distance);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -168,7 +168,12 @@ void GateWayInit(void)
|
||||
|
||||
#if MAC_ADDR_TYPE == 0
|
||||
memcpy(GateWay.ConfigPara.GwMac, GateWayMac_Test, 6);
|
||||
GateWay.ConfigPara.DebugChannel = DEBUG_CH_DBG;
|
||||
GateWay.ConfigPara.DebugChannel = DEBUG_CH_RS485_1;
|
||||
GateWay.ConfigPara.SvrAddr[0] = 39;
|
||||
GateWay.ConfigPara.SvrAddr[1] = 106;
|
||||
GateWay.ConfigPara.SvrAddr[2] = 103;
|
||||
GateWay.ConfigPara.SvrAddr[3] = 147;
|
||||
GateWay.ConfigPara.SvrPort = 8080;
|
||||
#elif MAC_ADDR_TYPE == 1
|
||||
memcpy(GateWay.ConfigPara.GwMac, GateWayMac_BL1, 6);
|
||||
GateWay.ConfigPara.DebugChannel = DEBUG_CH_RS485_1;
|
||||
|
||||
Reference in New Issue
Block a user