X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fdmm%2Fbm86x.c;h=ea260d8f97180869cfa6441696be549a476323da;hb=81ceb6a51dd666987fb5c67b83c5ba14d105b301;hp=b38c3123d3d55a616c21616ddc2e72443523f1fa;hpb=0fb45121254b159e1dabf8fd3f3bbd84e4aa693d;p=libsigrok.git diff --git a/src/dmm/bm86x.c b/src/dmm/bm86x.c index b38c3123..ea260d8f 100644 --- a/src/dmm/bm86x.c +++ b/src/dmm/bm86x.c @@ -59,6 +59,22 @@ SR_PRIV gboolean sr_brymen_bm86x_packet_valid(const uint8_t *buf) if (buf[19] != 0x86) return FALSE; + /* + * 2021-05 update: The devices that we have seen in the field do + * provide four bytes which we can synchronize to. Which happens + * to match the bm52x and bm82x devices' protocol. This condition + * is not documented by the vendor, but improves reliability of + * the re-synchronization for slight offsets, which were seen + * in the field, and which would have kept failing in an earlier + * implementation. + */ + if (buf[16] != 0x86) + return FALSE; + if (buf[17] != 0x86) + return FALSE; + if (buf[18] != 0x86) + return FALSE; + return TRUE; }