HT32SX Generic Push Button
Generic Push Button application for HT32SX
sigfox_monarch_api.h
Go to the documentation of this file.
1 
31 #ifndef SIGFOX_MONARCH_API_H
32 #define SIGFOX_MONARCH_API_H
33 
34 #include "sigfox_types.h"
35 
36 /********************************
37  * \enum sfx_timer_unit_enum_t
38  * \brief value used to identify the unit of the timer
39  *******************************/
40 typedef enum
41 {
42  SFX_TIME_MS = 0,
47 
48 /********************************
49  * \enum sfx_bitfield_rc_enum_t
50  * \brief value used to identify the RC supported by the device
51  * or the RC found after the monarch scan.
52  *******************************/
53 typedef enum
54 {
63  /* Keep the below line still at the end */
67 
68 /********************************
69  * \enum sfx_pattern_enum_t
70  * \brief This enum describes all the
71  * patterns that can be part of the
72  * Sigfox beacon, in first or second
73  * position of the beacon.
74  *******************************/
75 typedef enum
76 {
77  NO_MONARCH_PATTERN = 0,
78  MONARCH_DELTA_F1 = 1,
82  /* Keep this line at the end */
85 
86 #define MAX_MONARCH_PATTERN_PER_FREQUENCY_SEARCH 2 /* On 1 frequency, we can at the maximum ask for the research of 2 different patterns */
87 
88 /********************************
89  * \struct sfx_monarch_pattern_search_t
90  * \brief This structure describes
91  * for a single frequency, the patterns
92  * that need to be searched
93  *******************************/
94 typedef struct
95 {
96  sfx_u32 freq;
97  sfx_pattern_enum_t patterns[MAX_MONARCH_PATTERN_PER_FREQUENCY_SEARCH];
99 
100 /********************************
101  * \enum sfx_monarch_listening_mode_t
102  * \brief value used to define the monarch
103  * listening modes.
104  *******************************/
105 typedef enum
106 {
116 
117 /*!******************************************************************
118  * \fn sfx_error_t sfx_error_t SIGFOX_MONARCH_API_execute_rc_scan (sfx_u8 rc_capabilities_bit_mask, sfx_u16 timer, sfx_timer_unit_enum_t unit, sfx_u8 (* app_callback_handler ) ( sfx_u8 rc_bit_mask, sfx_s16 rssi ) )
119  * \brief This function executes a scan of the air to detect a Sigfox Beacon.
120  * It will return the RC enum value corresponding to the beacon found and its RSSI level.
121  * The scan is executed during the specific timer / unit time
122  *
123  * NOTE : there is no need to open the sigfox Library to run this function.
124  *
125  * \param[in] sfx_u8 rc_capabilities_bit_mask Bit Mask (format below ) of the RCx on which the scan has to be executed :
126  *
127  * ---------------------------------------------------------
128  * | Bit7 | Bit6 | Bit5 | Bit4 | Bit3 | Bit2 | Bit1 | Bit0 |
129  * ---------------------------------------------------------
130  * | - | RC7 | RC6 | RC5 | RC4 | RC3 | RC2 | RC1 |
131  * ---------------------------------------------------------
132  *
133  * \param[in] sfx_u16 timer Scan duration value ( with the unit parameter information )
134  * \param[in] sfx_timer_unit_enum_t unit Unit to be considered for the scan time computation
135  * \param[in] app_callback_handler This is the function that will be called by the Sigfox Library when the scan is completed.
136  * ( either when RC Found or when Timeout )
137  * parameter of this callback are :
138  * \param[out] sfx_u8 rc Value of the RC found. There could be only 1 RC or 0 ( not found )
139  * \param[out] rssi RSSI value of the RC found. if rc = 0, rssi is not valid ( is set to 0 too )
140  *
141  * MSB_____________________________________________LSB
142  * 15 8|7 0
143  * | | |
144  * | MANUF_ERROR_CODE | SIGFOX_ERROR_CODE |
145  * |_______________________|______________________|
146  *
147  * SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE or SFX_ERR_MONARCH_API_xx
148  *
149  *******************************************************************/
150 sfx_error_t SIGFOX_MONARCH_API_execute_rc_scan(sfx_u8 rc_capabilities_bit_mask, sfx_u16 timer, sfx_timer_unit_enum_t unit, sfx_u8 (* app_callback_handler)(sfx_u8 rc_bit_mask, sfx_s16 rssi));
151 
152 /*!******************************************************************
153  * \fn sfx_error_t SIGFOX_MONARCH_API_stop_rc_scan ( void )
154  * \brief This function stops a RC scan which is on going
155  *
156  * NOTE : there is no need to open the sigfox Library to run this function.
157  *
158  * MSB_____________________________________________LSB
159  * 15 8|7 0
160  * | | |
161  * | MANUF_ERROR_CODE | SIGFOX_ERROR_CODE |
162  * |_______________________|______________________|
163  *
164  * SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE or SFX_ERR_MONARCH_API_xx
165  *
166  *******************************************************************/
167 sfx_error_t SIGFOX_MONARCH_API_stop_rc_scan(void);
168 
169 #endif
SFX_BITFIELD_SHIFT_RC2
Definition: sigfox_monarch_api.h:57
sfx_monarch_pattern_search_t
Definition: sigfox_monarch_api.h:90
SFX_BITFIELD_SHIFT_RC7
Definition: sigfox_monarch_api.h:62
SFX_MAX_SIGFOX_RC
Definition: sigfox_monarch_api.h:65
SFX_BITFIELD_SHIFT_RC1
Definition: sigfox_monarch_api.h:56
MONARCH_DELTA_F3
Definition: sigfox_monarch_api.h:82
sfx_bitfield_rc_enum_t
sfx_bitfield_rc_enum_t
Definition: sigfox_monarch_api.h:51
SFX_TIME_S
Definition: sigfox_monarch_api.h:44
MONARCH_LISTENING_WINDOW
Definition: sigfox_monarch_api.h:110
sfx_pattern_enum_t
sfx_pattern_enum_t
Definition: sigfox_monarch_api.h:72
SFX_TIME_H
Definition: sigfox_monarch_api.h:46
SFX_BITFIELD_SHIFT_RC6
Definition: sigfox_monarch_api.h:61
SFX_BITFIELD_SHIFT_RC3
Definition: sigfox_monarch_api.h:58
SIGFOX_MONARCH_API_stop_rc_scan
sfx_error_t SIGFOX_MONARCH_API_stop_rc_scan(void)
This function stops a RC scan which is on going.
SFX_BITFIELD_SHIFT_RC4
Definition: sigfox_monarch_api.h:59
sfx_monarch_listening_mode_t
sfx_monarch_listening_mode_t
Definition: sigfox_monarch_api.h:100
MONARCH_DELTA_F2
Definition: sigfox_monarch_api.h:81
MONARCH_LISTENING_SWEEP
Definition: sigfox_monarch_api.h:105
sfx_timer_unit_enum_t
sfx_timer_unit_enum_t
Definition: sigfox_monarch_api.h:39
NO_MONARCH_PATTERN
Definition: sigfox_monarch_api.h:79
SFX_BITFIELD_SHIFT_RC5
Definition: sigfox_monarch_api.h:60
SIGFOX_MONARCH_API_execute_rc_scan
sfx_error_t SIGFOX_MONARCH_API_execute_rc_scan(sfx_u8 rc_capabilities_bit_mask, sfx_u16 timer, sfx_timer_unit_enum_t unit, sfx_u8(*app_callback_handler)(sfx_u8 rc_bit_mask, sfx_s16 rssi))
This function executes a scan of the air to detect a Sigfox Beacon. It will return the RC enum value ...
sigfox_types.h
Sigfox types definition.
MONARCH_DELTA_F1
Definition: sigfox_monarch_api.h:80
LAST_MONARCH_PATTERN
Definition: sigfox_monarch_api.h:85
SFX_TIME_M
Definition: sigfox_monarch_api.h:45
SFX_TIME_MS
Definition: sigfox_monarch_api.h:43