X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fzketech-ebd-usb%2Fprotocol.c;fp=src%2Fhardware%2Fzketech-ebd-usb%2Fprotocol.c;h=fe86145226051e3d4c1a45039eeb1a9fa4aef452;hb=ec4806dcf5d21d159a81a21aaee3af1b086211f2;hp=926a43149b379c77192662af5521f9f109509cd2;hpb=9890fb1f08ff399c5ea6cf0e99226f23dddcaf8c;p=libsigrok.git diff --git a/src/hardware/zketech-ebd-usb/protocol.c b/src/hardware/zketech-ebd-usb/protocol.c index 926a4314..fe861452 100644 --- a/src/hardware/zketech-ebd-usb/protocol.c +++ b/src/hardware/zketech-ebd-usb/protocol.c @@ -187,11 +187,11 @@ SR_PRIV int zketech_ebd_usb_receive_data(int fd, int revents, void *cb_data) serial = sdi->conn; - uint8_t reply[MSGLEN]; - int ret = zketech_ebd_usb_read_chars(serial, MSGLEN, reply); + uint8_t reply[MSG_LEN]; + int ret = zketech_ebd_usb_read_chars(serial, MSG_LEN, reply); /* Tests for correct message. */ - if (ret != MSGLEN) { + if (ret != MSG_LEN) { sr_err("Message invalid [Len]."); return (ret < 0) ? ret : SR_ERR; } @@ -201,9 +201,9 @@ SR_PRIV int zketech_ebd_usb_receive_data(int fd, int revents, void *cb_data) reply[9] ^ reply[10] ^ reply[11] ^ reply[12] ^ \ reply[13] ^ reply[14] ^ reply[15] ^ reply[16]; - if (reply[MSGFRAMEBEGINPOS] != MSGFRAMEBEGIN || \ - reply[MSGFRAMEENDPOS] != MSGFRAMEEND || \ - xor != reply[MSGCHECKSUMPOS]) { + if (reply[MSG_FRAME_BEGIN_POS] != MSG_FRAME_BEGIN || \ + reply[MSG_FRAME_END_POS] != MSG_FRAME_END || \ + xor != reply[MSG_CHECKSUM_POS]) { sr_err("Message invalid [XOR, BEGIN/END]."); return SR_ERR; }