Update xsns_52_ibeacon.ino

This commit is contained in:
gemu2015 2019-08-24 15:56:28 +02:00
parent 3b30ba8810
commit f6503ca01d
1 changed files with 7 additions and 7 deletions

View File

@ -472,7 +472,7 @@ bool xsns52_cmd(void) {
char *cp=XdrvMailbox.data; char *cp=XdrvMailbox.data;
if (*cp>='0' && *cp<='8') { if (*cp>='0' && *cp<='8') {
hm17_sendcmd(*cp&7); hm17_sendcmd(*cp&7);
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_IBEACON, XSNS_52,"hm17cmd",*cp&7); Response_P(S_JSON_IBEACON, XSNS_52,"hm17cmd",*cp&7);
} else if (*cp=='s') { } else if (*cp=='s') {
cp++; cp++;
len--; len--;
@ -482,24 +482,24 @@ bool xsns52_cmd(void) {
} }
IBEACON_Serial->write((uint8_t*)cp,len); IBEACON_Serial->write((uint8_t*)cp,len);
hm17_cmd=99; hm17_cmd=99;
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_IBEACON1, XSNS_52,"hm17cmd",cp); Response_P(S_JSON_IBEACON1, XSNS_52,"hm17cmd",cp);
} else if (*cp=='u') { } else if (*cp=='u') {
cp++; cp++;
if (*cp) IB_UPDATE_TIME=atoi(cp); if (*cp) IB_UPDATE_TIME=atoi(cp);
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_IBEACON, XSNS_52,"uintv",IB_UPDATE_TIME); Response_P(S_JSON_IBEACON, XSNS_52,"uintv",IB_UPDATE_TIME);
} else if (*cp=='t') { } else if (*cp=='t') {
cp++; cp++;
if (*cp) IB_TIMEOUT_TIME=atoi(cp); if (*cp) IB_TIMEOUT_TIME=atoi(cp);
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_IBEACON, XSNS_52,"lintv",IB_TIMEOUT_TIME); Response_P(S_JSON_IBEACON, XSNS_52,"lintv",IB_TIMEOUT_TIME);
} else if (*cp=='c') { } else if (*cp=='c') {
for (uint32_t cnt=0;cnt<MAX_IBEACONS;cnt++) ibeacons[cnt].FLAGS=0; for (uint32_t cnt=0;cnt<MAX_IBEACONS;cnt++) ibeacons[cnt].FLAGS=0;
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_IBEACON1, XSNS_52,"clr list",""); Response_P(S_JSON_IBEACON1, XSNS_52,"clr list","");
} }
#ifdef IBEACON_DEBUG #ifdef IBEACON_DEBUG
else if (*cp=='d') { else if (*cp=='d') {
cp++; cp++;
if (*cp) hm17_debug=atoi(cp); if (*cp) hm17_debug=atoi(cp);
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_IBEACON, XSNS_52,"debug",hm17_debug); Response_P(S_JSON_IBEACON, XSNS_52,"debug",hm17_debug);
} }
#endif #endif
} else { } else {
@ -528,7 +528,7 @@ bool ibeacon_cmd(void) {
ib_sendbeep(); ib_sendbeep();
} }
} }
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_IBEACON,ib_mac,rssi); Response_P(S_JSON_IBEACON,ib_mac,rssi);
return true; return true;
} }
return false; return false;