Open lunamera opened 1 year ago
Yeah, it is a bug. It should be left shift instead right shift. Your suggestion is correct. Another solution to write correct code in one line is like the follow
*nbPktReceived = (uint16_t) buf[1] << 8 + buf[2];
You are welcome to create a pull request for this fix.
Hi,
the getStatus method isn't working due to wrong shift operation.
"(buf[x] >> 8)" always equals to zero and it's maybe also in the wrong direction.
Should be like: nbPktReceived = buf[1]; nbPktReceived <<= 8; *nbPktReceived += buf[2];