Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RSSI offset for pre-msg RSSI notification #4

Merged
merged 2 commits into from
Oct 23, 2019

Conversation

TheBlueMatt
Copy link
Contributor

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.

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.
@TheBlueMatt
Copy link
Contributor Author

TheBlueMatt commented Sep 26, 2019

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)

@markqvist markqvist merged commit 454de10 into markqvist:master Oct 23, 2019
@markqvist
Copy link
Owner

Thanks for fixing that! It's merged now :)

@markqvist
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants