Closed TheBlueMatt closed 4 years ago
This may also be a good opportunity to Went ahead and now calculate the RSSI using the formulas on the datasheet (ie if SNR <= 0, RSSI = RSSIRegister - 157 + SNRRegister/4, else RSSIRegister*16/15 - 157)
Thanks for fixing that! It's merged now :)
And you're also totally right that the way the RSSI is sent to the host is confusing and weird. I did it like it is now to be able to send it in a single byte as you noticed, the overflow being intentional (it just wraps around). But I'll probably change it to putting the actual calculated packet RSSI in a signed 16-bit int, and sending that over serial as well. It's probably more clean like that.
last_rssi is a large negative number, with rssi_offset being +292, intended to be added to put the value inside the range of a single byte uint. Before sending the data message, a RSSI message is automatically sent, which is quite nice, but the value ends up overflowing the 8-bit uint, giving a bogus value.