Fix ClearGlass CGG1 and CGP1W sensors recognition#849
Fix ClearGlass CGG1 and CGP1W sensors recognition#8491technophile merged 5 commits into1technophile:developmentfrom
Conversation
1technophile
left a comment
There was a problem hiding this comment.
Thanks for the PR,
Would it be possible to merge also these 2 blocks:
Log.trace(F("Is it a CGG1" CR));
if (strstr(service_data, "080774") != NULL) {
Log.trace(F("CGG1 method 2" CR));
BLEdata.set("model", "CGG1");
if (device->sensorModel == -1)
createOrUpdateDevice(mac, device_flags_init, CGG1);
return process_cleargrass(BLEdata, false);
}
Log.trace(F("Is it a CGG1" CR));
if (strncmp(service_data, "8816", 4) == 0) {
Log.trace(F("CGG1 method 3" CR));
BLEdata.set("model", "CGG1");
if (device->sensorModel == -1)
createOrUpdateDevice(mac, device_flags_init, CGG1);
return process_cleargrass(BLEdata, false);
}and use
(strncmp(service_data, "080774", 6) == 0)
I will do it... I found in old code in your repo, that 080774 seqience taked from this service data: 0807743e10342d580104c3002c0202012a. Third byte 74 is the last byte of the MAC-address of the sensor 743e10342d58. So I think, it not needed in comparision. |
|
Also, I found this information about another Advertising packet for the CGG1 device: I will refactor all three checks... |
Good catch, thanks for the PR |
* Fix ClearGlass CGG1 and CGP1W sensors recognition * CGG1 parsing refactoring
Fix #845 issue