chandrawi / LoRaRF-Arduino

Arduino library for basic transmitting and receiving data using LoRa and FSK modulation
MIT License
53 stars 15 forks source link

GetDeviceErrors incorrect read #6

Closed ramonverde closed 1 year ago

ramonverde commented 1 year ago

I'm getting incorrect reads from GetDeviceErrors with LLCC68. The library is sending 0x17 byte, as expected, but it must read 3 bytes from the response, but in sx126x_getDeviceErrors it is only reading 2 of them. This creates an offset on SPI communication, getting erroneous reads from LLCC68 since then (1 byte offset). In sx126x_getDeviceErrors, the line: sx126x_transfer(0x17, buf, 2); must be changed for: sx126x_transfer(0x17, buf, 3); and return buf[2] insetead of buf[1]

chandrawi commented 1 year ago

Yes, it is a mistake. I have checked both SX1261_2 and LLCC68 datasheet and found that GetDeviceErrors command has two bytes data like you said. Can you just create a pull request for this fix?

ramonverde commented 1 year ago

Created pull request #7

ramonverde commented 1 year ago

Fixed with pull request #7