]> cvs.zerfleddert.de Git - hmcfgusb/blobdiff - hmuartlgw.c
hmuartlgw: simplify crc check
[hmcfgusb] / hmuartlgw.c
index 2e6757a4720ed68ee34ab9cc4de2f06590b83033..4c274cf93e85ea558c0995684c29363dbc112cb7 100644 (file)
@@ -413,10 +413,8 @@ int hmuartlgw_poll(struct hmuartlgw_dev *dev, int timeout)
                return -1;
        }
 
-       crc = crc16(dev->buf, dev->pos - 2);
-       if ((((crc >> 8) & 0xff) == dev->buf[dev->pos - 2]) &&
-                       ((crc & 0xff) == dev->buf[dev->pos - 1])) {
-
+       crc = crc16(dev->buf, dev->pos);
+       if (crc == 0x0000) {
                if (debug)
                        hexdump(dev->buf, dev->pos, "UARTLGW > ");
 
Impressum, Datenschutz