support for hm17 (v110) and hm10 (V609)

This commit is contained in:
gemu2015 2019-12-29 16:49:36 +01:00
parent df944ed058
commit 858103e082
1 changed files with 28 additions and 9 deletions

View File

@ -27,7 +27,11 @@
#define HM17_BAUDRATE 9600
//#define IBEACON_DEBUG
#define IBEACON_DEBUG
// use this for Version 110
#define HM17_V110
// keyfob expires after N seconds
#define IB_TIMEOUT_INTERVAL 30
@ -322,6 +326,14 @@ void hm17_decode(void) {
hm17_result=1;
#ifdef IBEACON_DEBUG
if (hm17_debug) AddLog_P2(LOG_LEVEL_INFO, PSTR("DISCS OK"));
#endif
break;
}
if (!strncmp(hm17_sbuffer,"OK+DISIS",8)) {
hm17_sbclr();
hm17_result=1;
#ifdef IBEACON_DEBUG
if (hm17_debug) AddLog_P2(LOG_LEVEL_INFO, PSTR("DISIS OK"));
#endif
break;
}
@ -348,6 +360,11 @@ void hm17_decode(void) {
break;
}
if (!strncmp(hm17_sbuffer,"OK+DIS0:",8)) {
if (hm17_cmd==HM17_DISI) {
#ifdef HM17_V110
goto hm17_v110;
#endif
} else {
if (hm17_sindex==20) {
hm17_result=HM17_SUCESS;
#ifdef IBEACON_DEBUG
@ -358,9 +375,11 @@ void hm17_decode(void) {
#endif
hm17_sbclr();
}
}
break;
}
if (!strncmp(hm17_sbuffer,"OK+DISC:",8)) {
hm17_v110:
if (hm17_cmd==HM17_DISI) {
if (hm17_sindex==78) {
#ifdef IBEACON_DEBUG