2023-05-05 23:00:26 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <furi.h>
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
float rssi; /**< Current RSSI */
|
|
|
|
bool is_above; /**< Exceeded threshold level */
|
|
|
|
} SubGhzThresholdRssiData;
|
|
|
|
|
|
|
|
typedef struct SubGhzThresholdRssi SubGhzThresholdRssi;
|
|
|
|
|
|
|
|
/** Allocate SubGhzThresholdRssi
|
|
|
|
*
|
|
|
|
* @return SubGhzThresholdRssi*
|
|
|
|
*/
|
|
|
|
SubGhzThresholdRssi* subghz_threshold_rssi_alloc(void);
|
|
|
|
|
|
|
|
/** Free SubGhzThresholdRssi
|
|
|
|
*
|
|
|
|
* @param instance Pointer to a SubGhzThresholdRssi
|
|
|
|
*/
|
|
|
|
void subghz_threshold_rssi_free(SubGhzThresholdRssi* instance);
|
|
|
|
|
|
|
|
/** Set threshold
|
|
|
|
*
|
|
|
|
* @param instance Pointer to a SubGhzThresholdRssi
|
|
|
|
* @param rssi RSSI threshold
|
|
|
|
*/
|
|
|
|
void subghz_threshold_rssi_set(SubGhzThresholdRssi* instance, float rssi);
|
|
|
|
|
|
|
|
/** Get threshold
|
|
|
|
*
|
|
|
|
* @param instance Pointer to a SubGhzThresholdRssi
|
|
|
|
* @return float RSSI threshold
|
|
|
|
*/
|
|
|
|
float subghz_threshold_rssi_get(SubGhzThresholdRssi* instance);
|
|
|
|
|
|
|
|
/** Check threshold
|
|
|
|
*
|
|
|
|
* @param instance Pointer to a SubGhzThresholdRssi
|
2023-06-18 17:25:40 +00:00
|
|
|
* @param rssi Current RSSI
|
2023-05-05 23:00:26 +00:00
|
|
|
* @return SubGhzThresholdRssiData
|
|
|
|
*/
|
2023-06-18 17:25:40 +00:00
|
|
|
SubGhzThresholdRssiData subghz_threshold_get_rssi_data(SubGhzThresholdRssi* instance, float rssi);
|