HT32SX Monarch Scan
Monarch Scan application for HT32SX
monarch_app.h
Go to the documentation of this file.
1 /*
2  _ _
3  _| |__ _| |_
4  |_ _ \|_ _|
5  | | | |_| |
6  _ __ |_| \_____|
7  | \/ |_ ____ ___ ___ _ __
8  | |\/| | |/ ___) _ \ / _ \| '_ \
9  | | | | | (___| /( (_) | | | |
10  |_| |_|_|\____|_|_\ \___/|_| |_|
11  ========== Advanced R&D =========
12 
13 */
14 
26 #ifndef MONARCH_APP_H
27 #define MONARCH_APP_H
28 
29 #include "main.h"
30 
31 /*!******************************************************************
32  * \fn void configRegion(void)
33  * \brief Configures the device using the RCZ found after Monarch Scan.
34  * Call the functions St_Sigfox_Open_RCZ, to execute these
35  * configurations and sendFrameRCZ.
36  *
37  * \param[in] none
38  * \param[out] none
39  *******************************************************************/
40 void configRegion(void);
41 
42 /*!******************************************************************
43  * \fn void closeSigfoxLib(void)
44  * \brief This function closes the library (Free the allocated
45  * memory of SIGFOX_API_open and close RF).
46  *
47  * \param[in] none
48  * \param[out] none
49  *******************************************************************/
50 void closeSigfoxLib(void);
51 
52 /*!******************************************************************
53  * \fn void sendFrameRCZ(rc_mask RCZ)
54  * \brief Send a frame to the Sigfox network using the RCZ found
55  * after Monarch Scan.
56  *
57  * \param[in] rc_mask RCZ Radio zone
58  * \param[out] none
59  *******************************************************************/
60  void sendFrameRCZ(rc_mask RCZ);
61 
62  /*!***********************************************************************************************************
63  * \fn void monarchScan(sfx_u8 rc_capabilities_bit_mask, sfx_u16 timer, sfx_timer_unit_enum_t unit)
64  * \brief Executes a scan of the air to detect a Sigfox Beacon.
65  * It will return 0, if success and the RC enum value corresponding to
66  * the beacon found and its RSSI level. The scan is executed during the
67  * specific timer/unit time.
68  *
69  * \param[in] sfx_u8 rc_capabilities_bit_mask Bit Mask of the RCx on which the scan has to be executed.
70  *
71  *
72  * | Bit7 | Bit6 | Bit5 | Bit4 | Bit3 | Bit2 | Bit1 | Bit0 |
73  * |------|:----:|:----:|:----:|:----:|:----:|:----:|-----:|
74  * | - | - | RC6 | RC5 | RC4 | RC3 | RC2 | RC1 |
75  *
76  * \param[in] sfx_u16 timer Scan duration value (with the unit parameter information).
77  * \param[in] sfx_timer_unit_enum_t unit Unit to be considered for the scan time computation
78  * \param[out] none
79  *
80  *
81  *************************************************************************************************************/
82 void monarchScan(sfx_u8 rc_capabilities_bit_mask, sfx_u16 timer, sfx_timer_unit_enum_t unit);
83 
84  /*!***********************************************************************************************************
85  * \fn sfx_u8 callback(sfx_u8 rc_bit_mask, sfx_s16 rssi)
86  * \brief Monarch callback called after finding a Monarch Beacon.
87  *
88  *
89  *
90  *
91  * \param[in] sfx_u8 rc_bit_mask Bit Mask of the RCx on which the scan has to be executed.
92  *
93  *
94  * | Bit7 | Bit6 | Bit5 | Bit4 | Bit3 | Bit2 | Bit1 | Bit0 |
95  * |------|:----:|:----:|:----:|:----:|:----:|:----:|-----:|
96  * | - | - | RC6 | RC5 | RC4 | RC3 | RC2 | RC1 |
97  *
98  * \param[in] rssi Signal rssi.
99  *
100  * \param[out] none
101  *
102  * \retval SFX_ERR_NONE: No error
103  * \retval MCU_ERR_API_FREE: Verify sigfox_api.h for more info
104  *
105  *************************************************************************************************************/
106 sfx_u8 callback(sfx_u8 rc_bit_mask, sfx_s16 rssi);
107 
108 /*!******************************************************************
109  * \fn uint8_t getScanStatus(void)
110  * \brief Get the Monarch Scan status (running or not running).
111  *
112  * \param[in] none
113  * \param[out] none
114  *
115  * \retval Scan status (1 if it's running, 0 if it's not running)
116  *******************************************************************/
117 extern uint8_t getScanStatus(void);
118 
119 /*!******************************************************************
120  * \fn void setScanStatus(uint8_t scanStatus);
121  * \brief Set Monarch Scan status.
122  *
123  * \param[in] scanStatus Scan status
124  * \param[out] none
125  *
126  * \retval none
127  *******************************************************************/
128 extern void setScanStatus(uint8_t scanStatus);
129 
130 #endif
131 
closeSigfoxLib
void closeSigfoxLib(void)
This function closes the library (Free the allocated memory of SIGFOX_API_open and close RF).
Definition: monarch_app.c:102
callback
sfx_u8 callback(sfx_u8 rc_bit_mask, sfx_s16 rssi)
Monarch callback called after finding a Monarch Beacon.
Definition: monarch_app.c:128
sendFrameRCZ
void sendFrameRCZ(rc_mask RCZ)
Send a frame to the Sigfox network using the RCZ found after Monarch Scan.
Definition: monarch_app.c:109
configRegion
void configRegion(void)
Configures the device using the RCZ found after Monarch Scan. Call the functions St_Sigfox_Open_RCZ,...
Definition: monarch_app.c:16
sfx_timer_unit_enum_t
sfx_timer_unit_enum_t
Definition: sigfox_monarch_api.h:39
getScanStatus
uint8_t getScanStatus(void)
Get the Monarch Scan status (running or not running).
Definition: monarch_app.c:180
main.h
: Header for main.c file. This file contains the common defines of the application.
setScanStatus
void setScanStatus(uint8_t scanStatus)
Set Monarch Scan status.
Definition: monarch_app.c:184
monarchScan
void monarchScan(sfx_u8 rc_capabilities_bit_mask, sfx_u16 timer, sfx_timer_unit_enum_t unit)
Executes a scan of the air to detect a Sigfox Beacon. It will return 0, if success and the RC enum va...
Definition: monarch_app.c:121