-
Notifications
You must be signed in to change notification settings - Fork 46
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
lora-phy: add get_rssi() to RadioKind trait #251
base: main
Are you sure you want to change the base?
Conversation
Could you write an example on how you want to use this code? |
What I want is basically the same as this function. With the function, you first check if the RSSI is below a given threshold for a certain duration, and if so, you perform tx(). Otherwise, you try again later. |
This makes sense to me. I would still like some example code at least for one target on how to use this. It helps us with maintaining the code and it works as documentation too. Also it makes it easier for anyone with the hw to test it. |
I added a very simple example for stm32l0 which just keeps logging the current rssi. |
Is this PR still a draft or is it ready for final review? |
I think this is ready for review. |
I need to do carrier sensing using the current RSSI value. The CAD isn't enough because I want to detect waves besides LoRa. So I added
get_rssi()
to theRadioKind
trait and exposed it. I also addedRadioMode::Listen
in which the radio keeps listening to a given frequency so that theRegRssiValue
register is updated continuously. I'm not sure if it's ok to add a new RadioMode though.I don't own sx126x chips, so I implemented
get_rssi()
only for sx127x and tested on sx1276. I'd appreciate it if someone could implement it for sx126x.