|
发表于 2018-11-16 17:19:43
|
显示全部楼层
不用那么大吧,我用的简单的拼凑。
2、查询设备设置的全部电话号码
平台发送:
system_alarm
{
"ReqType":"GWS1N",
"Status":"1", (主机当前状态。解释:1表示布防,2表示撤防,3表示在家布防,4表示报警)
"Numbering":"123456#", (用户可以修改见后面附件默认123123)
"Cmd":"21#", (解释:命令,查询设备设置的全部电话号码)
}
设备返回:
warn/system_alarm
{"dto":{
"ReqType":"GWS1N",
"Status":"1", (主机当前状态。解释:1表示布防,2表示撤防,3表示在家布防,4表示报警)
"Numbering":"123456#", (用户可以修改见后面附件默认123123)
"Cmd":"21*", (解释:命令)
"PhoneNum1":"13100000000*",(第1个电话号码。)
"PhoneNum2":"13200000000*",(第2个电话号码。)
"PhoneNum3":"13300000000*",(第3个电话号码。)
"PhoneNum4":"*",(无号码为空。)
"PhoneNum5":"13100000000#",(第5个电话号码。)
}}
case SMSTYPE_InquireAlarmPhone://²éѯ±¨¾¯µç»°ºÅÂë
{
strcat((char *)GPRS_Buftemp, "\"Cmd\":\"21*\",");
strcat((char *)GPRS_Buftemp, "\"PhoneNum1\":\"");
memcpy(Password, &PARA_UserPhone(ZERO, ONE), PARA_UserPhone(ZERO, ZERO));
strcat((char *)GPRS_Buftemp, (char *)Password);
strcat((char *)GPRS_Buftemp,"*\","); //1×éµç»°ºÅÂë
memset(Password, '\0', sizeof(Password));
strcat((char *)GPRS_Buftemp, "\"PhoneNum2\":\"");
memcpy(Password, &PARA_UserPhone(ONE, ONE), PARA_UserPhone(ONE, ZERO));
strcat((char *)GPRS_Buftemp, (char *)Password);
strcat((char *)GPRS_Buftemp,"*\","); //2×éµç»°ºÅÂë
//
memset(Password, '\0', sizeof(Password));
strcat((char *)GPRS_Buftemp, "\"PhoneNum3\":\"");
memcpy(Password, &PARA_UserPhone(TWO, ONE), PARA_UserPhone(TWO, ZERO));
strcat((char *)GPRS_Buftemp, (char *)Password);
strcat((char *)GPRS_Buftemp,"*\","); //3×éµç»°ºÅÂë
//
memset(Password, '\0', sizeof(Password));
strcat((char *)GPRS_Buftemp, "\"PhoneNum4\":\"");
memcpy(Password, &PARA_UserPhone(THREE, ONE), PARA_UserPhone(THREE, ZERO));
strcat((char *)GPRS_Buftemp, (char *)Password);
strcat((char *)GPRS_Buftemp,"*\","); //4×éµç»°ºÅÂë
//
memset(Password, '\0', sizeof(Password));
strcat((char *)GPRS_Buftemp, "\"PhoneNum5\":\"");
memcpy(Password, &PARA_UserPhone(FOUR, ONE), PARA_UserPhone(FOUR, ZERO));
strcat((char *)GPRS_Buftemp, (char *)Password);
strcat((char *)GPRS_Buftemp,"#\"}"); //5×éºÅÂëÈ«²¿Íê³É
///////////////////////
}
break; |
|