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;
}