aqhome: Fixed a bug.

This commit is contained in:
Martin Preuss
2023-01-22 17:47:42 +01:00
parent c0fca3bf98
commit 9e31dc2160

View File

@@ -137,11 +137,11 @@ int AQH_Serial_Recv(AQH_SERIAL *sr, uint8_t *buf, int len)
DBG_INFO(NULL, "here (%d)", rv);
return rv;
}
msgLen=buf[1]+1; /* add one byte for XOR checksum */
buf+=2;
msgLen=buf[1];
buf+=2; /* two bytes already read */
/* read message and XOR byte */
rv=_readForced(sr, buf, msgLen);
rv=_readForced(sr, buf, msgLen+1); /* add one byte for XOR checksum */
if (rv<0) {
DBG_INFO(NULL, "here (%d)", rv);
return rv;