Sub-GHz: Choose RSSI threshold for Hopping mode

This commit is contained in:
Willy-JL
2024-07-10 13:51:25 +01:00
parent 79d8b12c5e
commit 3df6c81947
8 changed files with 71 additions and 17 deletions

View File

@@ -377,7 +377,7 @@ void subghz_txrx_stop(SubGhzTxRx* instance) {
}
}
void subghz_txrx_hopper_update(SubGhzTxRx* instance) {
void subghz_txrx_hopper_update(SubGhzTxRx* instance, float stay_threshold) {
furi_assert(instance);
switch(instance->hopper_state) {
@@ -400,7 +400,7 @@ void subghz_txrx_hopper_update(SubGhzTxRx* instance) {
float rssi = subghz_devices_get_rssi(instance->radio_device);
// Stay if RSSI is high enough
if(rssi > -90.0f) {
if(rssi > stay_threshold) {
instance->hopper_timeout = 10;
instance->hopper_state = SubGhzHopperStateRSSITimeOut;
return;

View File

@@ -141,8 +141,9 @@ void subghz_txrx_sleep(SubGhzTxRx* instance);
* Update frequency CC1101 in automatic mode (hopper)
*
* @param instance Pointer to a SubGhzTxRx
* @param stay_threshold RSSI theshold over which to stay before hopping
*/
void subghz_txrx_hopper_update(SubGhzTxRx* instance);
void subghz_txrx_hopper_update(SubGhzTxRx* instance, float stay_threshold);
/**
* Get state hopper