-
Notifications
You must be signed in to change notification settings - Fork 2.1k
ieee802154: add helpers for RSSI and dBm conversion #15629
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
Conversation
9115c73
to
a081c6e
Compare
I was going to say: this should also fix the wrong rssi output in
with With
might be a driver issue though |
hmmm weird, I will check what's going on |
well... the original nrf802154 driver ( /* Calculate RSSI by subtracting the offset from the datasheet.
* Intentionally using a different calculation than the one from
* figure 122 of the v1.1 product specification. This appears to
* match real world performance better */
radio_info->rssi = (int16_t)hwlqi + ED_RSSIOFFS; The datasheet says:
I really think we should use the one from the datasheet |
But isn't it weird that in @benpicco test results we get rssi's of |
Actually doesn't it also need the corrections in #15616? |
Pinging between two
|
I do get the same wrong results if only testing this PR though. Maybe we should merge that one before. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK. If you agree with the style nit, squash in right away.
Also: As this is a dependency for a bug fix PR, I think this should go in despite soft feature freeze. (And this PR isn't scary either, especially due to proper unit testing.)
done! I will need a re-ACK I guess :) |
a081c6e
to
51b6ce8
Compare
No need, the change is only cosmetic. |
@jia200x you will need to rebase to master there is a missing file that is causing the fail in |
done! |
51b6ce8
to
728b84d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-ACK ;-) (But I agree with @fjmolinas, that no re-ACK was need ;-))
I thought GH would block merging since the code changed in between |
thanks for the review! |
Contribution description
As IEEE 802.15.4 2020 defines, the RSSI is an unsigned octet that maps to real RF power values. For RIOT we have been using RSSI as dBm but they don't represent the same thing.
Some stacks and netdev require RSSI in dBm instead of the definition of the standard, so this PR adds some helpers to translate both. It also uses RSSI in dBm for
netdev_ieee802154_submac
in order to be compliant with netdev.Testing procedure
Issues/PRs references
This could be helpful for #15616