HT32SX Monarch Scan
Monarch Scan application for HT32SX
sigfox_api.h
Go to the documentation of this file.
1 
32 /* ################################## VERSION INFORMATION ################################## */
33 /* This library supports FH, DC and LBT spectrum access to be compliant with ETSI, FCC and ARIB standards. */
34 
35 
36 /* Warning : this library supports the Monarch feature */
37 
38 /* This library implements the payload encryption feature. */
39 
40 /* ######################################################################################### */
41 
42 
49 /* -------------------------------------------------------------------------------------------------------------------------------------
50  IMPORTANT NOTE on ERROR CODES
51  -------------------------------------------------------------------------------------------------------------------------------------
52 
53  ALL SIGFOX_API_xxx or SIGFOX_REPEATER_API_xxx functions returns an error type sfx_error_t
54 
55  The sfx_error_t is composed of the following :
56 
57  MSB_____________________________________________LSB
58  15 8|7 0
59  | | |
60  | MANUF_ERROR_CODE | SIGFOX_ERROR_CODE |
61  |_______________________|______________________|
62 
63 
64  MANUF_ERROR_CODE :
65  - Represents the error codes for MCU_API_xx, RF_API_xx, SE_API_xx, REPEATER_API_xx
66  - All MCU_API_xx, RF_API_xx, SE_API_xx, REPEATER_API_xx have to return SFX_ERR_NONE when no error
67  - Minimum set of error codes are defined into the mcu_api.h, rf_api.h, se_api.h and repeater_api.h : Manufacturer can define more error codes !
68 
69  SIGFOX_ERROR_CODE :
70  - Represents the error codes of the SIGFOX API or internal functions
71  - All the error codes can be found in this file ( sigfox_api.h )
72 
73  ------------------------------------------------------------------------------------------------------------------------------------- */
74 #ifndef SIGFOX_API_H
75 #define SIGFOX_API_H
76 
77 #include "sigfox_types.h"
78 
79 #define SFX_ERR_NONE (sfx_u8)(0x00)
81 //#include "sigfox_types.h"
82 /* ---------------------------------------------------------------- */
83 /* Bytes reserved for SIGFOX ERROR CODES : From 0x10 to 0xBF */
84 /* ---------------------------------------------------------------- */
85 
86 #define SFX_ERR_API_OPEN (sfx_u8)(0x10)
87 #define SFX_ERR_API_OPEN_STATE (sfx_u8)(0x11)
88 #define SFX_ERR_API_OPEN_GET_NVMEM_MEMORY_OVERLAP (sfx_u8)(0x12)
89 #define SFX_ERR_API_OPEN_RC_PTR (sfx_u8)(0x13)
90 #define SFX_ERR_API_OPEN_MACRO_CHANNEL_WIDTH (sfx_u8)(0x14)
92 #define SFX_ERR_API_CLOSE_FREE (sfx_u8)(0x20)
93 #define SFX_ERR_API_CLOSE_STATE (sfx_u8)(0x21)
95 #define SFX_ERR_API_SEND_FRAME_DATA_LENGTH (sfx_u8)(0x30)
96 #define SFX_ERR_API_SEND_FRAME_RESPONSE_PTR (sfx_u8)(0x31)
97 #define SFX_ERR_API_SEND_FRAME_DELAY_OOB_ACK (sfx_u8)(0x32)
98 #define SFX_ERR_API_SEND_FRAME_DATA_PTR (sfx_u8)(0x33)
100 #define SFX_ERR_API_SEND_BIT_RESPONSE_PTR (sfx_u8)(0x34)
101 #define SFX_ERR_API_SEND_OOB_TYPE (sfx_u8)(0x35)
104 #define SFX_ERR_API_SET_STD_CONFIG_CARRIER_SENSE_CONFIG (sfx_u8)(0x40)
105 #define SFX_ERR_API_SET_STD_CONFIG_FH_CHANNELS (sfx_u8)(0x41)
107 #define SFX_ERR_API_SEND_TEST_FRAME_DEVICE_ID (sfx_u8)(0x50)
108 #define SFX_ERR_API_SEND_TEST_FRAME_STATE (sfx_u8)(0x51)
109 #define SFX_ERR_API_SEND_TEST_FRAME_DATA_LENGTH (sfx_u8)(0x52)
110 #define SFX_ERR_API_SEND_TEST_FRAME_DATA_PTR (sfx_u8)(0x53)
111 #define SFX_ERR_API_SEND_TEST_STORE_NVM (sfx_u8)(0x54)
113 #define SFX_ERR_API_RECEIVE_TEST_FRAME_DEVICE_ID (sfx_u8)(0x55)
114 #define SFX_ERR_API_RECEIVE_TEST_FRAME_STATE (sfx_u8)(0x56)
116 #define SFX_ERR_API_START_CONTINUOUS_TRANSMISSION (sfx_u8)(0x57)
117 #define SFX_ERR_API_START_CONTINUOUS_TRANSMISSION_STATE (sfx_u8)(0x58)
118 #define SFX_ERR_API_STOP_CONTINUOUS_TRANSMISSION (sfx_u8)(0x59)
119 #define SFX_ERR_API_STOP_CONTINUOUS_TRANSMISSION_STATE (sfx_u8)(0x5A)
121 #define SFX_ERR_API_GET_INITIAL_PAC (sfx_u8)(0x5B)
122 #define SFX_ERR_API_GET_VERSION (sfx_u8)(0x5C)
123 #define SFX_ERR_API_GET_VERSION_WRONG_TYPE (sfx_u8)(0x5D)
124 #define SFX_ERR_API_SWITCH_PUBLIC_KEY (sfx_u8)(0x5E)
126 #define SFX_ERR_INT_EXECUTE_COM_SEQUENCE_STATE (sfx_u8)(0x60)
127 #define SFX_ERR_INT_EXECUTE_COM_SEQUENCE_NVM_STORAGE_MESSAGE (sfx_u8)(0x61)
128 #define SFX_ERR_INT_EXECUTE_COM_SEQUENCE_NVM_STORAGE_ACK (sfx_u8)(0x62)
129 #define SFX_ERR_INT_EXECUTE_COM_SEQUENCE_NVM_STORAGE_RCSYNC (sfx_u8)(0x63)
130 #define SFX_ERR_INT_EXECUTE_COM_SEQUENCE_DELAY_OOB_ACK (sfx_u8)(0x64)
132 #define SFX_ERR_INT_PROCESS_UPLINK_START_TIMER_FH_IN_DL (sfx_u8)(0x70)
133 #define SFX_ERR_INT_PROCESS_UPLINK_WAIT_FOR_END_TIMER_FH_IN_DL (sfx_u8)(0x71)
134 #define SFX_ERR_INT_PROCESS_UPLINK_TIMER_FH (sfx_u8)(0x72)
135 #define SFX_ERR_INT_PROCESS_UPLINK_WAIT_FOR_END_TIMER_FH (sfx_u8)(0x73)
136 #define SFX_ERR_INT_PROCESS_UPLINK_DELAY_INTERFRAME (sfx_u8)(0x74)
137 #define SFX_ERR_INT_PROCESS_UPLINK_TIMER_DOWNLINK (sfx_u8)(0x75)
138 #define SFX_ERR_INT_PROCESS_UPLINK_CS_RETRY (sfx_u8)(0x76)
139 #define SFX_ERR_INT_PROCESS_UPLINK_CS_RETRY_START_TIMER (sfx_u8)(0x77)
140 #define SFX_ERR_INT_PROCESS_UPLINK_CS_RETRY_STOP_TIMER (sfx_u8)(0x78)
141 #define SFX_ERR_INT_PROCESS_UPLINK_CS_RETRY_DELAY_ATTEMPT (sfx_u8)(0x79)
142 #define SFX_ERR_INT_PROCESS_UPLINK_CS_REPETITION (sfx_u8)(0x7A)
143 #define SFX_ERR_INT_PROCESS_UPLINK_CS_REPETITION_START_TIMER (sfx_u8)(0x7B)
144 #define SFX_ERR_INT_PROCESS_UPLINK_CS_REPETITION_STOP_TIMER (sfx_u8)(0x7C)
145 #define SFX_ERR_INT_PROCESS_UPLINK_CS_REPETITION_STOP_TIMER_2 (sfx_u8)(0x7D)
146 #define SFX_ERR_INT_PROCESS_UPLINK_CS_TIMEOUT (sfx_u8)(0x7E)
148 #define SFX_ERR_INT_BUILD_FRAME_SE (sfx_u8)(0x90)
149 #define SFX_ERR_INT_BUILD_FRAME (sfx_u8)(0x91)
150 #define SFX_ERR_INT_BUILD_FRAME_OOB_SERVICE (sfx_u8)(0x92)
151 #define SFX_ERR_INT_BUILD_FRAME_OOB_DOWNLINK_ACK (sfx_u8)(0x93)
152 #define SFX_ERR_INT_BUILD_FRAME_OOB_REPEATER_STATUS (sfx_u8)(0x94)
153 #define SFX_ERR_INT_BUILD_FRAME_OOB_RC_SYNC (sfx_u8)(0x95)
154 #define SFX_ERR_INT_BUILD_FRAME_PAYLOAD_CRYPTED (sfx_u8)(0x96)
156 #define SFX_ERR_INT_SEND_SINGLE_FRAME (sfx_u8)(0x97)
157 #define SFX_ERR_INT_PROCESS_DOWNLINK (sfx_u8)(0x98)
159 #define SFX_ERR_INT_GET_DEVICE_ID (sfx_u8)(0x99)
160 #define SFX_ERR_INT_GET_RECEIVED_FRAMES (sfx_u8)(0x9A)
161 #define SFX_ERR_INT_GET_RECEIVED_FRAMES_TIMEOUT (sfx_u8)(0x9B)
162 #define SFX_ERR_INT_GET_RECEIVED_FRAMES_WAIT_NOT_EXECUTED (sfx_u8)(0x9C)
164 #define SFX_ERR_INT_GET_DEVICE_INFO (sfx_u8)(0x9D)
165 #define SFX_ERR_INT_GET_DEVICE_INFO_CRC (sfx_u8)(0x9E)
166 #define SFX_ERR_INT_GET_DEVICE_INFO_CERTIFICATE (sfx_u8)(0x9F)
169 #define SFX_ERR_API_SET_RC_SYNC_PERIOD (sfx_u8)(0xB0)
170 #define SFX_ERR_API_SET_RC_SYNC_PERIOD_VALUE (sfx_u8)(0xB1)
172 #define SFX_ERR_MONARCH_API_EXECUTE_RC_SCAN_STATE (sfx_u8)(0xB2)
173 #define SFX_ERR_MONARCH_API_EXECUTE_RC_SCAN (sfx_u8)(0xB3)
174 #define SFX_ERR_MONARCH_API_EXECUTE_RC_SCAN_NULL_CALLBACK (sfx_u8)(0xB4)
175 #define SFX_ERR_MONARCH_API_STOP_RC_SCAN_STATE (sfx_u8)(0xB5)
176 #define SFX_ERR_MONARCH_API_STOP_RC_SCAN (sfx_u8)(0xB6)
177 #define SFX_ERR_CALLBACK_MONARCH_SCAN_TIMEOUT_CB_STATE (sfx_u8)(0xB7)
178 #define SFX_ERR_CALLBACK_MONARCH_SCAN_TIMEOUT (sfx_u8)(0xB8)
179 #define SFX_ERR_CALLBACK_MONARCH_PATTERN_FREQUENCY_RESULT_STATE (sfx_u8)(0xB9)
180 #define SFX_ERR_CALLBACK_MONARCH_PATTERN_FREQUENCY_RESULT (sfx_u8)(0xBA)
181 #define SFX_ERR_CALLBACK_MONARCH_PATTERN_FREQUENCY_RESULT_WRONG_PATTERN (sfx_u8)(0xBB)
182 #define SFX_ERR_CALLBACK_MONARCH_PATTERN_FREQUENCY_RESULT_WRONG_FREQ (sfx_u8)(0xBC)
184 /* ----------------------------------------------------------------------------- */
185 /* Bytes reserved for SIGFOX ADDONS ERROR CODES : From 0xC0 to 0xDF */
186 /* ----------------------------------------------------------------------------- */
187 
188 
189 #define SFX_ERR_INT_DOWNLINK_CONFIGURATION (sfx_u8)(0xE0)
201 /* Define Radio Configuration */
202 #define NA 0 /* Used to store Not applicable values in config words or open parameters */
203 
204 #define RC1_OPEN_UPLINK_CENTER_FREQUENCY (sfx_u32)(868130000) /* Hz */
205 #define RC1_OPEN_DOWNLINK_CENTER_FREQUENCY (sfx_u32)(869525000) /* Hz */
206 #define RC1_MACRO_CHANNEL_WIDTH (sfx_u32)(192000) /* Hz */
207 #define RC1_UPLINK_MODULATION SFX_DBPSK_100BPS
208 #define RC1_UPLINK_SPECTRUM_ACCESS SFX_DC
209 
210 #define RC2_OPEN_UPLINK_START_OF_TABLE (sfx_u32)(902200000) /* Hz, The center frequency of RC2 is defined by the activated channels in config words */
211 #define RC2_OPEN_DOWNLINK_CENTER_FREQUENCY (sfx_u32)(905200000) /* Hz */
212 #define RC2_MACRO_CHANNEL_WIDTH (sfx_u32)(192000) /* Hz */
213 #define RC2_UPLINK_MODULATION SFX_DBPSK_600BPS
214 #define RC2_UPLINK_SPECTRUM_ACCESS SFX_FH
215 #define RC2_SET_STD_CONFIG_LM_WORD_0 (sfx_u32)0x000001FF /* LM = Long Message */
216 #define RC2_SET_STD_CONFIG_LM_WORD_1 (sfx_u32)0x00000000
217 #define RC2_SET_STD_CONFIG_LM_WORD_2 (sfx_u32)0x00000000
218 #define RC2_SET_STD_TIMER_ENABLE (sfx_bool)(SFX_TRUE) /* Enable Timer for FH duty cycle*/
219 #define RC2_SET_STD_TIMER_DISABLE (sfx_bool)(SFX_FALSE)/* Disable timer feature*/
220 #define RC2_SET_STD_CONFIG_SM_WORD_0 (sfx_u32)0x00000001 /* SM = Short message */
221 #define RC2_SET_STD_CONFIG_SM_WORD_1 (sfx_u32)0x00000000
222 #define RC2_SET_STD_CONFIG_SM_WORD_2 (sfx_u32)0x00000000
223 
224 #define RC3A_OPEN_CS_CENTER_FREQUENCY (sfx_u32)(923200000) /* Hz */
225 #define RC3A_OPEN_CS_BANDWIDTH (sfx_u32)(200000) /* Hz */
226 #define RC3A_OPEN_UPLINK_CENTER_FREQUENCY (sfx_u32)(923200000) /* Hz */
227 #define RC3A_OPEN_DOWNLINK_CENTER_FREQUENCY (sfx_u32)(922200000) /* Hz */
228 #define RC3A_MACRO_CHANNEL_WIDTH (sfx_u32)(36000) /* Hz */
229 #define RC3A_UPLINK_MODULATION SFX_DBPSK_100BPS
230 #define RC3A_UPLINK_SPECTRUM_ACCESS SFX_LBT
231 #define RC3A_CS_THRESHOLD (sfx_s8)(-80) /* dBm */
232 
233 #define RC3C_OPEN_CS_CENTER_FREQUENCY (sfx_u32)(923200000) /* Hz */
234 #define RC3C_OPEN_CS_BANDWIDTH (sfx_u32)(200000) /* Hz */
235 #define RC3C_OPEN_UPLINK_CENTER_FREQUENCY (sfx_u32)(923200000) /* Hz */
236 #define RC3C_OPEN_DOWNLINK_CENTER_FREQUENCY (sfx_u32)(922200000) /* Hz */
237 #define RC3C_MACRO_CHANNEL_WIDTH (sfx_u32)(192000) /* Hz */
238 #define RC3C_UPLINK_MODULATION SFX_DBPSK_100BPS
239 #define RC3C_UPLINK_SPECTRUM_ACCESS SFX_LBT
240 #define RC3C_CS_THRESHOLD (sfx_s8)(-80) /* dBm */
241 
242 #define RC4_OPEN_UPLINK_START_OF_TABLE (sfx_u32)(902200000) /* Hz, The center frequency of RC4 is defined by the activated channels in config words */
243 #define RC4_OPEN_DOWNLINK_CENTER_FREQUENCY (sfx_u32)(922300000) /* Hz */
244 #define RC4_MACRO_CHANNEL_WIDTH (sfx_u32)(192000) /* Hz */
245 #define RC4_UPLINK_MODULATION SFX_DBPSK_600BPS
246 #define RC4_UPLINK_SPECTRUM_ACCESS SFX_FH
247 #define RC4_SET_STD_CONFIG_LM_WORD_0 (sfx_u32)0x00000000 /* LM = Long Message */
248 #define RC4_SET_STD_CONFIG_LM_WORD_1 (sfx_u32)0xF0000000
249 #define RC4_SET_STD_CONFIG_LM_WORD_2 (sfx_u32)0x0000001F
250 #define RC4_SET_STD_TIMER_ENABLE (sfx_bool)(SFX_TRUE) /* Enable Timer for FH duty cycle*/
251 #define RC4_SET_STD_TIMER_DISABLE (sfx_bool)(SFX_FALSE)/* Disable timer feature*/
252 #define RC4_SET_STD_CONFIG_SM_WORD_0 (sfx_u32)0x00000000 /* SM = Short message */
253 #define RC4_SET_STD_CONFIG_SM_WORD_1 (sfx_u32)0x40000000
254 #define RC4_SET_STD_CONFIG_SM_WORD_2 (sfx_u32)0x00000000
255 
256 #define RC5_OPEN_CS_CENTER_FREQUENCY (sfx_u32)(923300000) /* Hz */
257 #define RC5_OPEN_CS_BANDWIDTH (sfx_u32)(200000) /* Hz */
258 #define RC5_OPEN_UPLINK_CENTER_FREQUENCY (sfx_u32)(923300000) /* Hz */
259 #define RC5_OPEN_DOWNLINK_CENTER_FREQUENCY (sfx_u32)(922300000) /* Hz */
260 #define RC5_MACRO_CHANNEL_WIDTH (sfx_u32)(192000) /* Hz */
261 #define RC5_UPLINK_MODULATION SFX_DBPSK_100BPS
262 #define RC5_UPLINK_SPECTRUM_ACCESS SFX_LBT
263 #define RC5_CS_THRESHOLD (sfx_s8)(-65) /* dBm */
264 
265 #define RC6_OPEN_UPLINK_CENTER_FREQUENCY (sfx_u32)(865200000) /* Hz */
266 #define RC6_OPEN_DOWNLINK_CENTER_FREQUENCY (sfx_u32)(866300000) /* Hz */
267 #define RC6_MACRO_CHANNEL_WIDTH (sfx_u32)(192000) /* Hz */
268 #define RC6_UPLINK_MODULATION SFX_DBPSK_100BPS
269 #define RC6_UPLINK_SPECTRUM_ACCESS SFX_DC
270 
271 #define RC101_OPEN_UPLINK_CENTER_FREQUENCY (sfx_u32)(68862500) /* Hz */
272 #define RC101_OPEN_DOWNLINK_CENTER_FREQUENCY (sfx_u32)(72912500) /* Hz */
273 #define RC101_MACRO_CHANNEL_WIDTH (sfx_u32)(12500) /* Hz */
274 #define RC101_UPLINK_MODULATION SFX_DBPSK_100BPS
275 #define RC101_UPLINK_SPECTRUM_ACCESS SFX_DC
276 
277 
278 /* ----------------------------------------------
279  IMPORTANT INFORMATION :
280  ----------------------------------------------
281  The SIGFOX Library needs to be opened with
282  one of the below configurations.
283  ----------------------------------------------
284 */
285 #define RC1 { RC1_OPEN_UPLINK_CENTER_FREQUENCY, RC1_OPEN_DOWNLINK_CENTER_FREQUENCY, RC1_MACRO_CHANNEL_WIDTH, RC1_UPLINK_MODULATION, RC1_UPLINK_SPECTRUM_ACCESS, {NA,NA,NA} }
286 #define RC2 { RC2_OPEN_UPLINK_START_OF_TABLE, RC2_OPEN_DOWNLINK_CENTER_FREQUENCY, RC2_MACRO_CHANNEL_WIDTH, RC2_UPLINK_MODULATION, RC2_UPLINK_SPECTRUM_ACCESS, {NA,NA,NA} }
287 #define RC3A { RC3A_OPEN_UPLINK_CENTER_FREQUENCY, RC3A_OPEN_DOWNLINK_CENTER_FREQUENCY, RC3A_MACRO_CHANNEL_WIDTH, RC3A_UPLINK_MODULATION, RC3A_UPLINK_SPECTRUM_ACCESS, {RC3A_OPEN_CS_CENTER_FREQUENCY,RC3A_OPEN_CS_BANDWIDTH, RC3A_CS_THRESHOLD} }
288 #define RC3C { RC3C_OPEN_UPLINK_CENTER_FREQUENCY, RC3C_OPEN_DOWNLINK_CENTER_FREQUENCY, RC3C_MACRO_CHANNEL_WIDTH, RC3C_UPLINK_MODULATION, RC3C_UPLINK_SPECTRUM_ACCESS, {RC3C_OPEN_CS_CENTER_FREQUENCY,RC3C_OPEN_CS_BANDWIDTH, RC3C_CS_THRESHOLD} }
289 
290 #define RC4 { RC4_OPEN_UPLINK_START_OF_TABLE, RC4_OPEN_DOWNLINK_CENTER_FREQUENCY, RC4_MACRO_CHANNEL_WIDTH, RC4_UPLINK_MODULATION, RC4_UPLINK_SPECTRUM_ACCESS, {NA,NA,NA} }
291 #define RC5 { RC5_OPEN_UPLINK_CENTER_FREQUENCY, RC5_OPEN_DOWNLINK_CENTER_FREQUENCY, RC5_MACRO_CHANNEL_WIDTH, RC5_UPLINK_MODULATION, RC5_UPLINK_SPECTRUM_ACCESS, {RC5_OPEN_CS_CENTER_FREQUENCY,RC5_OPEN_CS_BANDWIDTH, RC5_CS_THRESHOLD} }
292 #define RC6 { RC6_OPEN_UPLINK_CENTER_FREQUENCY, RC6_OPEN_DOWNLINK_CENTER_FREQUENCY, RC6_MACRO_CHANNEL_WIDTH, RC6_UPLINK_MODULATION, RC6_UPLINK_SPECTRUM_ACCESS, {NA,NA,NA} }
293 
294 #define RC101 { RC101_OPEN_UPLINK_CENTER_FREQUENCY, RC101_OPEN_DOWNLINK_CENTER_FREQUENCY, RC101_MACRO_CHANNEL_WIDTH, RC101_UPLINK_MODULATION, RC101_UPLINK_SPECTRUM_ACCESS, {NA,NA,NA} }
295 
296 #define RC2_LM_CONFIG { RC2_SET_STD_CONFIG_LM_WORD_0, RC2_SET_STD_CONFIG_LM_WORD_1, RC2_SET_STD_CONFIG_LM_WORD_2 }
297 #define RC4_LM_CONFIG { RC4_SET_STD_CONFIG_LM_WORD_0, RC4_SET_STD_CONFIG_LM_WORD_1, RC4_SET_STD_CONFIG_LM_WORD_2 }
299 #define RC2_SM_CONFIG { RC2_SET_STD_CONFIG_SM_WORD_0, RC2_SET_STD_CONFIG_SM_WORD_1, RC2_SET_STD_CONFIG_SM_WORD_2 }
300 #define RC4_SM_CONFIG { RC4_SET_STD_CONFIG_SM_WORD_0, RC4_SET_STD_CONFIG_SM_WORD_1, RC4_SET_STD_CONFIG_SM_WORD_2 }
302 #define RC3A_CONFIG {0x00000003,0x00001388,0x00000000}
303 #define RC3C_CONFIG {0x00000003,0x00001388,0x00000000}
304 #define RC5_CONFIG {0x00000003,0x00001388,0x00000000}
307 #define ID_LENGTH (sfx_u8)(4) /* Size of device identifier */
308 #define PAC_LENGTH (sfx_u8)(8) /* Size of device initial PAC */
309 
310 /********************************
311  * \enum sfx_spectrum_access_t
312  * \brief Data type for Spectrum Access
313  * Define as bit mask value so that we can combine
314  * them if needed (not yet implemented)
315  *******************************/
316 typedef enum
317 {
318  SFX_FH = 1,
319  SFX_LBT = 2,
320  SFX_DC = 4,
322 
323 /********************************
324  * \enum sfx_version_type_t
325  * \brief Enum to be used in SIGFOX_API_get_version
326  *******************************/
327 typedef enum
328 {
335 
336 typedef enum
337 {
338  AUTHENTICATION_OFF = 0,
339  AUTHENTICATION_ON = 1,
341 
342 typedef enum
343 {
344  DL_TIMEOUT = 0,
345  DL_PASSED = 1,
346 } sfx_rx_state_enum_t;
347 
348 /********************************
349  * \enum sfx_oob_enum_t
350  * \brief This enum contains all the OOB frame types
351  * that can be send by the user application
352  *******************************/
353 typedef enum
354 {
355  SFX_OOB_SERVICE = 0,
356  SFX_OOB_RC_SYNC,
357  SFX_MAX_OOB_LIST_SIZE,
358 } sfx_oob_enum_t;
359 
360 /********************************
361  * \enum sfx_state_t
362  * \brief State Machine constants
363  * The state machine will never
364  * returns automatically to SFX_STATE_READY
365  * if an error has occured during
366  * frame transmissions
367  *******************************/
368 typedef enum
369 {
370  SFX_STATE_IDLE = 0,
378 
379 /********************************
380  * \enum sfx_modulation_type_t
381  * \brief Uplink Modulation type with baudrate
382  *******************************/
383 typedef enum
384 {
385  SFX_NO_MODULATION = 0,
386  SFX_DBPSK_100BPS = 1,
387  SFX_DBPSK_600BPS = 2,
389 
390 /********************************
391  * \enum sfx_nvmem_t
392  * \brief Data type for Nv memory access
393  * Saving PN and Sequence are mandatory
394  * for backend compatibility
395  *******************************/
396 /* FH information required, seq_num stored in nv_mem */
397 typedef enum
398 {
401  SFX_NVMEM_FH = 4,
402  SFX_NVMEM_RL = 6,
403  SFX_NVMEM_BLOCK_SIZE = 7,
405 
406 
407 /********************************
408  * \enum sfx_rf_mode_t
409  * \brief Functionnal mode for RF chip
410  *******************************/
411 typedef enum
412 {
413  SFX_RF_MODE_TX = 0,
414  SFX_RF_MODE_RX = 1,
417  SFX_RF_MODE_MONARCH = 4,
418 } sfx_rf_mode_t;
419 
420 /********************************
421  * \enum sfx_delay_t
422  * \brief Delay type
423  *******************************/
424 typedef enum
425 {
428  SFX_DLY_OOB_ACK = 2,
429  SFX_DLY_CS_SLEEP = 3,
430 } sfx_delay_t;
431 
432 /********************************
433  * \enum sfx_credentials_use_key_t
434  * \brief Key to use for MANUF_API_aes_128_cbc_encrypt()
435  *******************************/
436 typedef enum
437 {
438  CREDENTIALS_PRIVATE_KEY = 0,
439  CREDENTIALS_KEY_IN_ARGUMENT,
440 } sfx_credentials_use_key_t;
441 
442 /********************************
443  * \struct sfx_rc_specific_t
444  * \brief Radio configuration substruture for specific radio configuration
445  * All parameters requested to define
446  * radio configuration subsctructure.
447  *******************************/
448 typedef struct sfx_rc_specific_t
449 {
451  sfx_u32 open_cs_bandwidth;
452  sfx_s8 cs_threshold;
454 
455 /********************************
456  * \struct sfx_rc_t
457  * \brief Radio configuration structure
458  * All parameters requested to define
459  * radio configuration.
460  *******************************/
461 typedef struct sfx_rc_t
462 {
467  sfx_u32 open_rx_frequency;
468  sfx_u32 macro_channel_width;
472 } sfx_rc_t;
473 
474 /****************************************/
475 /* Sigfox Library API */
476 /****************************************/
477 
478 /*!******************************************************************
479  * \fn sfx_error_t SIGFOX_API_open(sfx_rc_t *rc)
480  * \brief This function initialises library (mandatory). The SIGFOX_API_open function will :
481  * - Allocate memory for library
482  * - Save the input parameters once (Can't be changed till SIGFOX_API_close call)
483  * - Read the non volatile memory content
484  * - Set the global state to SFX_STATE_READY
485  *
486  * \param[in] sfx_rc_t *rc Pointer on the Radio Configuration Zone: it is mandatory
487  * to use already existing RCx define.
488  *
489  * \retval The sfx_error_t is composed of the following :
490  *
491  * MSB_____________________________________________LSB
492  * 15 8|7 0
493  * | | |
494  * | MANUF_ERROR_CODE | SIGFOX_ERROR_CODE |
495  * |_______________________|______________________|
496  *
497  * SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE and SFX_ERR_API_OPEN_xx
498  *
499  *******************************************************************/
500 sfx_error_t SIGFOX_API_open(sfx_rc_t *rc);
501 
502 /*!******************************************************************
503  * \fn sfx_error_t SIGFOX_API_close(void)
504  * \brief This function closes the library (Free the allocated memory
505  * of SIGFOX_API_open and close RF)
506  *
507  * \retval The sfx_error_t is composed of the following :
508  *
509  * MSB_____________________________________________LSB
510  * 15 8|7 0
511  * | | |
512  * | MANUF_ERROR_CODE | SIGFOX_ERROR_CODE |
513  * |_______________________|______________________|
514  *
515  * SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE and SFX_ERR_API_CLOSE_xx
516  *
517  *******************************************************************/
518 sfx_error_t SIGFOX_API_close(void);
519 
520 /*!******************************************************************
521  * \fn sfx_error_t SIGFOX_API_send_frame(sfx_u8 *customer_data, sfx_u8 customer_data_length, sfx_u8 *customer_response, sfx_u8 tx_mode, sfx_bool initiate_downlink_flag)
522  * \brief Send a standard SIGFOX frame with customer payload. Customer
523  * payload cannot exceed 12 Bytes.<BR>
524  * - In downlink :
525  * * Send uplink frames
526  * * Receive downlink frame
527  * * Send out of band frame (Voltage, temperature and RSSI)
528  * .
529  * - In uplink :
530  * * Send uplink frames
531  * .
532  * \param[in] sfx_u8 *customer_data Data to transmit
533  * \param[in] sfx_u8 customer_data_length Data length in Bytes
534  * \param[out] sfx_u8 *customer_response Returned 8 Bytes data in case of downlink
535  * \param[in] sfx_u8 tx_mode tx_mode shall be set to 2.
536  * \param[in] sfx_bool initiate_downlink_flag Flag to initiate a downlink response
537  *
538  * \retval The sfx_error_t is composed of the following :
539  *
540  * MSB_____________________________________________LSB
541  * 15 8|7 0
542  * | | |
543  * | MANUF_ERROR_CODE | SIGFOX_ERROR_CODE |
544  * |_______________________|______________________|
545  *
546  * SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE and SFX_ERR_API_SEND_FRAME_xx or SFX_ERR_INT_xx
547  *
548  *******************************************************************/
549 sfx_error_t SIGFOX_API_send_frame(sfx_u8 *customer_data,
550  sfx_u8 customer_data_length,
551  sfx_u8 *customer_response,
552  sfx_u8 tx_mode,
553  sfx_bool initiate_downlink_flag);
554 
555 /*!******************************************************************
556  * \fn sfx_error_t SIGFOX_API_send_bit(sfx_bool bit_value, sfx_u8 *customer_response, sfx_u8 tx_mode, sfx_bool initiate_downlink_flag)
557  * \brief Send a standard SIGFOX frame with null customer payload.
558  * This frame is the shortest that SIGFOX library can generate.
559  * Data is contained on 1 sfx_bool
560  * - In downlink :
561  * * Send uplink frames
562  * * Receive downlink frame
563  * * Send out of band frame (Voltage, temperature and RSSI)
564  * .
565  * - In uplink :
566  * * Send uplink frames
567  * .
568  * .
569  *
570  * \param[in] sfx_bool bit_value Bit state (SFX_TRUE or SFX_FALSE)
571  * \param[out] sfx_u8 *customer_response Returned 8 Bytes data in case of downlink
572  * \param[in] sfx_u8 tx_mode tx_mode shall be set to 2.
573  * \param[in] sfx_bool initiate_downlink_flag Flag to initiate a downlink response
574  *
575  * \retval The sfx_error_t is composed of the following :
576  *
577  * MSB_____________________________________________LSB
578  * 15 8|7 0
579  * | | |
580  * | MANUF_ERROR_CODE | SIGFOX_ERROR_CODE |
581  * |_______________________|______________________|
582  *
583  * SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE and SFX_ERR_API_SEND_BIT_xx or SFX_ERR_INT_xx
584  *
585  *******************************************************************/
586 sfx_error_t SIGFOX_API_send_bit(sfx_bool bit_value,
587  sfx_u8 *customer_response,
588  sfx_u8 tx_mode,
589  sfx_bool initiate_downlink_flag);
590 
591 /*!******************************************************************
592  * \fn sfx_error_t SIGFOX_API_send_outofband(sfx_oob_enum_t oob_type)
593  * \brief Send an out of band SIGFOX frame which the type is passed as parameter
594  * of the function.<BR>
595  * Data is composed of information about the chip itself (Voltage,
596  * Temperature).<BR>
597  * - In uplink :
598  * * Send uplink frames (3)
599  * .
600  * This function must be called by application every 24 hours maximum
601  * or never if application has some energy critical constraints with
602  * the SFX_OOB_SERVICE enum value
603  *
604  * If Payload encryption is supported and activated, the user can
605  * synchronize the device and the backend with sending SFX_OOB_RC_SYNC
606  *
607  * In case REPEATER feature is present, the enum SFX_OOB_REPEATER_STATUS
608  * can be sent. This frame contains the counters related to the repeater operations.
609  * The counters are part of a shared memory between the Application
610  * and the Sigfox Library.
611  *.
612  *
613  * \param[in] sfx_oob_enum_t oob_type Type of the OOB frame to send
614  *
615  * \retval The sfx_error_t is composed of the following :
616  *
617  * MSB_____________________________________________LSB
618  * 15 8|7 0
619  * | | |
620  * | MANUF_ERROR_CODE | SIGFOX_ERROR_CODE |
621  * |_______________________|______________________|
622  *
623  * SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE and SFX_ERR_INT_xx
624  *
625  *******************************************************************/
626 sfx_error_t SIGFOX_API_send_outofband(sfx_oob_enum_t oob_type);
627 
628 /*!******************************************************************
629  * \fn sfx_error_t SIGFOX_API_set_std_config(sfx_u32 config_words[3], sfx_bool timer_enable)
630  * \brief This function must be used to configure specific variables for standard.
631  * It is mandatory to call this function after SIGFOX_API_open() for FH and LBT.
632  *
633  * <B> FH (Frequency Hopping )</B>: config words to enable/disable 192KHz macro channels authorized for
634  * transmission.<BR>Each macro channel is separated from another of 300 kHz<BR>
635  * At least 9 macro channel must be enabled to ensure the
636  * minimum of 50 FCC channels (9*6 = 54).<BR>
637  * <B>WARNING : This function should be called each time you open the library
638  * or your FCC configuration will not be applied</B><BR>
639  *
640  * Use the RC defined above to configure the macro channels
641  *
642  * <B>The example below shows you the Long Message configuration
643  * <B>Example :</B> To enable Macro channel 1 to 9, that is to say 902.2MHz
644  * to 904.6MHz with 902.2MHz as main Macro channel, you must set :<BR>
645  * <B>config_words[0]</B> = [0x000001FF]<BR>
646  * <B>config_words[1]</B> = [0x00000000]<BR>
647  * <B>config_words[2]</B> = [0x00000000]<BR>
648  *
649  * \verbatim
650  Macro Channel Value MHz : | 902.2MHz | 902.5MHz | 902.8MHz | 903.1MHz | 903.4MHz | 903.7MHz | 904.0MHz | 904.3MHz | 904.6MHz | 904.9MHz | 905.2MHz | ... ... | 911.5MHz |
651  Macro Channel Value : | Chn 1 | Chn 2 | Chn 3 | Chn 4 | Chn 5 | Chn 6 | Chn 7 | Chn 8 | Chn 9 | Chn 10 | Chn 11 | ... ... | Chn 32 |
652  config_words[0] bit : | bit 0 | bit 1 | bit 2 | bit 3 | bit 4 | bit 5 | bit 6 | bit 7 | bit 8 | bit 9 | bit 10 | ... ... | bit 31 |
653 
654  Macro Channel Value MHz : | 911.8MHz | 912.1MHz | 912.4MHz | 912.7MHz | 913.0MHz | 913.3MHz | 913.6MHz | 913.9MHz | 914.2MHz | 914.5MHz | 914.8MHz | ... ... | 921.1MHz |
655  Macro Channel Value : | Chn 33 | Chn 34 | Chn 35 | Chn 36 | Chn 37 | Chn 38 | Chn 39 | Chn 40 | Chn 41 | Chn 42 | Chn 43 | ... ... | Chn 64 |
656  config_words[1] bit : | bit 0 | bit 1 | bit 2 | bit 3 | bit 4 | bit 5 | bit 6 | bit 7 | bit 8 | bit 9 | bit 10 | ... ... | bit 31 |
657 
658  Macro Channel Value MHz : | 921.4MHz | 921.7MHz | 922.0MHz | 922.3MHz | 922.6MHz | 922.9MHz | 923.2MHz | 923.5MHz | 923.8MHz | 924.1MHz | 924.4MHz | ... | 927.7MHz |
659  Macro Channel Value : | Chn 65 | Chn 66 | Chn 67 | Chn 68 | Chn 69 | Chn 70 | Chn 71 | Chn 72 | Chn 73 | Chn 74 | Chn 75 | ... | Chn 86 |
660  config_words[2] bit : | bit 0 | bit 1 | bit 2 | bit 3 | bit 4 | bit 5 | bit 6 | bit 7 | bit 8 | bit 9 | bit 10 | ... | bit 21 |
661  \endverbatim
662  *
663  * <B>DC (Duty Cycle)</B>: This function has no effect in DC spectrum access ( used for the ETSI standard ).</B><BR>
664  *
665  * <B>LBT (Listen Before Talk)</B> : Carrier Sense feature for the First frame can be configured.
666  * - config_word[0] : number of attempts to send the first frame [ has to be greater or equal to 1]
667  * - config_word[1] : maximum carrier sense sliding window (in ms) [ has to be greater than 6 ms ( CS_MIN_DURATION_IN_MS + 1 ) ]
668  * - config_word[2] :
669  * . bit 8 : set the value to 1 to indicate that the device will use the full operationnal radio band.( 192kHz )
670  * . bit 7-3 : number of Carrier Sense attempts.
671  * . bit 2-0 : number of frames sent.
672  * - timer_enable : unused
673  * <BR><BR>
674  * The delay between several attempts of Carrier Sense for the first frame is set by SFX_DLY_CS_SLEEP
675  *
676  * \param[in] sfx_u32 config_words[3] Meaning depends on the standard (as explained above)
677  * \param[in] sfx_bool timer_enable Enable timer feature for FH
678  *
679  * \retval The sfx_error_t is composed of the following :
680  *
681  * MSB_____________________________________________LSB
682  * 15 8|7 0
683  * | | |
684  * | MANUF_ERROR_CODE | SIGFOX_ERROR_CODE |
685  * |_______________________|______________________|
686  *
687  * SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE and SFX_ERR_API_SET_CONFIG_xx
688  *
689  *******************************************************************/
690 sfx_error_t SIGFOX_API_set_std_config(sfx_u32 config_words[3],
691  sfx_bool timer_enable);
692 
693 /*!******************************************************************
694  * \fn sfx_error_t SIGFOX_API_start_continuous_transmission(sfx_u32 frequency, sfx_modulation_type_t type);
695  * \brief Executes a continuous wave or modulation depending on the parameter type
696  * SIGFOX_API_stop_continuous_transmission has to be called to stop the continuous transmission.
697  *
698  * \param[in] sfx_u32 frequency Frequency at which the signal has to be generated
699  * \param[in] sfx_modulation_type_t type Type of modulation to use in continuous mode.
700  *
701  * \retval The sfx_error_t is composed of the following :
702  *
703  * MSB_____________________________________________LSB
704  * 15 8|7 0
705  * | | |
706  * | MANUF_ERROR_CODE | SIGFOX_ERROR_CODE |
707  * |_______________________|______________________|
708  *
709  * SIGFOX_ERROR_CODE for this function : SFX_ERR_API_START_CONTINUOUS_TRANSMISSION_xx
710  *******************************************************************/
711 sfx_error_t SIGFOX_API_start_continuous_transmission ( sfx_u32 frequency, sfx_modulation_type_t type);
712 
713 /*!******************************************************************
714  * \fn sfx_error_t SIGFOX_API_stop_continuous_transmission(void);
715  * \brief Stop the current continuous transmission
716  *
717  * \retval The sfx_error_t is composed of the following :
718  *
719  * MSB_____________________________________________LSB
720  * 15 8|7 0
721  * | | |
722  * | MANUF_ERROR_CODE | SIGFOX_ERROR_CODE |
723  * |_______________________|______________________|
724  *
725  * SIGFOX_ERROR_CODE for this function : SFX_ERR_API_STOP_CONTINUOUS_TRANSMISSION_xx
726  *******************************************************************/
727 sfx_error_t SIGFOX_API_stop_continuous_transmission (void);
728 
729 /*!******************************************************************
730  * \fn sfx_error_t SIGFOX_API_send_test_frame(sfx_u32 frequency, sfx_u8 * customer_data, sfx_u8 customer_data_length, sfx_bool initiate_downlink_flag )
731  * Send only 1 repetition
732  *
733  * \brief This function builds a Sigfox Frame with the customer payload and send it at a specific frequency
734  * Use this function ONLY with Certification ID ( 0xFEDCBA98 ) otherwise an issue occurs.
735  *
736  *
737  * \param[in] sfx_u32 frequency Frequency at which the wave is generated
738  * \param[in] sfx_u8 *customer_data Data to transmit
739  * \param[in] sfx_u8 customer_data_length Data length in Bytes
740  * \param[in] sfx_bool initiate_downlink_flag Flag to initiate a downlink response
741  *
742  * MSB_____________________________________________LSB
743  * 15 8|7 0
744  * | | |
745  * | MANUF_ERROR_CODE | SIGFOX_ERROR_CODE |
746  * |_______________________|______________________|
747  *
748  * SIGFOX_ERROR_CODE for this function : SFX_ERR_API_SEND_TEST_FRAME_xx
749  *******************************************************************/
750 sfx_error_t SIGFOX_API_send_test_frame(sfx_u32 frequency, sfx_u8 *customer_data, sfx_u8 customer_data_length, sfx_bool initiate_downlink_flag);
751 
752 /*!******************************************************************
753  * \fn sfx_error_t SIGFOX_API_receive_test_frame( sfx_u32 frequency, sfx_authentication_mode_t mode, sfx_u8 * buffer, sfx_u8 timeout, sfx_s16 * rssi );
754 
755  * \brief This function waits for a valid downlink frame during timeout time and return in customer_data the data received.
756  * Use this function ONLY with Certification ID ( 0xFEDCBA98 ) otherwise an issue occurs.
757  *
758  *
759  * \param[in] sfx_u32 frequency Frequency at which the wave is generated
760  * \param[in] sfx_authentication_mode_t Mode ( AUTHENTICATION_ON or AUTHENTICATION_OFF)
761  * \param[in/out] buffer Depends of the Authentication mode :
762  * - if AUTHENTICATION_OFF : buffer is used as input to check the bit stream of the received frame
763  * - if AUTHENTICATION_ON : buffer is used as output to get the received Payload
764  * \param[in] sfx_u8 timeout Timeout for the reception of a valid downlink frame
765  * \param[in] sfx_s16 * rssi RSSI of the received frame ( only valid for AUTHENTICATION_ON as in AUTHENTICATION_OFF, the rssi of the frames received
766  * are returned through the MCU_API_report_test_result function)
767  *
768  * MSB_____________________________________________LSB
769  * 15 8|7 0
770  * | | |
771  * | MANUF_ERROR_CODE | SIGFOX_ERROR_CODE |
772  * |_______________________|______________________|
773  *
774  * SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE and SFX_ERR_API_RECEIVE_TEST_FRAME_xx
775  *******************************************************************/
776 sfx_error_t SIGFOX_API_receive_test_frame( sfx_u32 frequency, sfx_authentication_mode_t mode, sfx_u8 * buffer, sfx_u8 timeout, sfx_s16 * rssi );
777 
778 /*!******************************************************************
779  * \fn sfx_error_t SIGFOX_API_get_version(sfx_u8 **version, sfx_u8 *size, sfx_version_type_t type)
780  * \brief Returns current SIGFOX library version, or RF Version, or MCU version etc ..., in ASCII format ( depending on the type )
781  *
782  * \param[out] sfx_u8 **version Pointer to Byte array (ASCII format) containing library version
783  * \param[out] sfx_u8 *size Size of the byte array pointed by *version
784  * \param[in] sfx_version_type_t type Type of the version ( MCU, RF, ... )
785  *
786  * \retval The sfx_error_t is composed of the following :
787  *
788  * MSB_____________________________________________LSB
789  * 15 8|7 0
790  * | | |
791  * | MANUF_ERROR_CODE | SIGFOX_ERROR_CODE |
792  * |_______________________|______________________|
793  *
794  * SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE and SFX_ERR_API_GET_VERSION_xx
795  *******************************************************************/
796 sfx_error_t SIGFOX_API_get_version(sfx_u8 **version, sfx_u8 *size, sfx_version_type_t type);
797 
798 /*!******************************************************************
799  * \fn sfx_error_t SIGFOX_API_get_info(sfx_u8* returned_info);
800  * \brief This function is to return info on send frame depending on
801  * the mode you're using.<BR>
802  * <B> In DC :</B> returned_info is always 0.<BR>
803  * <B> In FH :</B> returned_info[bit 3 - 0] = 1 when the current FCC marco channel
804  * is NOT the default_sigfox_channel set in SIGFOX_API_set_std_conf.<BR>
805  * returned_info[bit 7 - 4] = number of free micro channel in current FCC
806  * macro channel.<BR>
807  * <B> In LBT :</B> returned_info = bit[7-3]: Carrier Sense attempts
808  * and bit[2-0]: Number of frames sent
809  *
810  * \param[out] sfx_u8* returned_info Returned value by library
811  *
812  * \retval The sfx_error_t is composed of the following :
813  *
814  * MSB_____________________________________________LSB
815  * 15 8|7 0
816  * | | |
817  * | MANUF_ERROR_CODE | SIGFOX_ERROR_CODE |
818  * |_______________________|______________________|
819  *
820  * SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE
821  *
822  *******************************************************************/
823 sfx_error_t SIGFOX_API_get_info(sfx_u8* returned_info);
824 
825 /*!******************************************************************
826  * \fn sfx_error_t SIGFOX_API_get_device_id(sfx_u8 *dev_id)
827  * \brief This function copies the ID of the device to the pointer given in parameter.
828  * The ID is \link ID_LENGTH \endlink bytes length and is in binary format.
829  *
830  * \param[in] none
831  * \param[out] sfx_u8* dev_id Pointer where to write the device ID
832  *
833  * \retval The sfx_error_t is composed of the following :
834  *
835  * MSB_____________________________________________LSB
836  * 15 8|7 0
837  * | | |
838  * | MANUF_ERROR_CODE | SIGFOX_ERROR_CODE |
839  * |_______________________|______________________|
840  *
841  * SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE or SFX_ERR_API_GET_DEVICE_ID_xx
842  *
843  *******************************************************************/
844 sfx_error_t SIGFOX_API_get_device_id(sfx_u8 *dev_id);
845 
846 /*!******************************************************************
847  * \fn sfx_error_t SIGFOX_API_get_initial_pac(sfx_u8 *initial_pac);
848  * \brief Get the value of the PAC stored in the device. This value is
849  * used when the device is registered for the first time on the backend.
850  *
851  * \param[in] none
852  * \param[out] sfx_u8* initial_pac Pointer to initial PAC
853  *
854  * \retval The sfx_error_t is composed of the following :
855  *
856  * MSB_____________________________________________LSB
857  * 15 8|7 0
858  * | | |
859  * | MANUF_ERROR_CODE | SIGFOX_ERROR_CODE |
860  * |_______________________|______________________|
861  *
862  * SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE or SFX_ERR_API_GET_INITIAL_PAC_xx
863  *
864  *******************************************************************/
865 sfx_error_t SIGFOX_API_get_initial_pac(sfx_u8 *initial_pac);
866 
867 /*!******************************************************************
868  * \fn sfx_error_t SIGFOX_API_switch_public_key(sfx_bool use_public_key)
869  * \brief Switch device on public or private key.
870  *
871  * \param[in] sfx_bool use_public_key Switch to public key if SFX_TRUE, private key else
872  *
873  * MSB_____________________________________________LSB
874  * 15 8|7 0
875  * | | |
876  * | MANUF_ERROR_CODE | SIGFOX_ERROR_CODE |
877  * |_______________________|______________________|
878  *
879  * SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE or SFX_ERR_API_SWITCH_PUBLIC_KEY_xx
880  *
881  *******************************************************************/
882 sfx_error_t SIGFOX_API_switch_public_key(sfx_bool use_public_key);
883 
884 /*!******************************************************************
885  * \fn sfx_error_t SIGFOX_API_set_rc_sync_period(sfx_u16 rc_sync_period)
886  * \brief Set the period for transmission of RC Sync frame
887  * By default, when payload is encrypted, a RC Sync frame is transmitted by the device
888  * every 4096 messages transmissions (ie. when the sequence number loops to 0) to
889  * 're-synchronize' the device with the backend (from a payload encryption point of view).
890  * This transmission period could be reduced through this function. Then, a RC Sync frame
891  * will be transmitted every 'rc_sync_period' transmissions of a 'normal' frame.
892  * The value 0 corresponds to the default behavior, ie a RC Sync frame transmitted every
893  * 4096 messages transmissions.
894  * As sequence number is on 12 bits, setting a rc_sync_period with a value more than (4095 - 1)
895  * will return an error.
896  *
897  * \param[in] sfx_u16 rollover_counter_period Transmission period of the RC Sync frame (in number of 'normal' frames)
898  *
899  * MSB_____________________________________________LSB
900  * 15 8|7 0
901  * | | |
902  * | MANUF_ERROR_CODE | SIGFOX_ERROR_CODE |
903  * |_______________________|______________________|
904  *
905  * SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE or SFX_ERR_API_SET_RC_SYNC_PERIOD_xx
906  *
907  *******************************************************************/
908 sfx_error_t SIGFOX_API_set_rc_sync_period(sfx_u16 rc_sync_period);
909 
910 #endif
SFX_NVMEM_PN
Definition: sigfox_api.h:397
sfx_rc_specific_t::open_cs_bandwidth
sfx_u32 open_cs_bandwidth
Definition: sigfox_api.h:445
SFX_NO_MODULATION
Definition: sigfox_api.h:382
sfx_state_t
sfx_state_t
Definition: sigfox_api.h:364
SIGFOX_API_close
sfx_error_t SIGFOX_API_close(void)
This function closes the library (Free the allocated memory of SIGFOX_API_open and close RF)
SIGFOX_API_set_rc_sync_period
sfx_error_t SIGFOX_API_set_rc_sync_period(sfx_u16 rc_sync_period)
Set the period for transmission of RC Sync frame By default, when payload is encrypted,...
SFX_LBT
Definition: sigfox_api.h:322
SIGFOX_API_send_bit
sfx_error_t SIGFOX_API_send_bit(sfx_bool bit_value, sfx_u8 *customer_response, sfx_u8 tx_mode, sfx_bool initiate_downlink_flag)
Send a standard SIGFOX frame with null customer payload. This frame is the shortest that SIGFOX libra...
VERSION_MCU
Definition: sigfox_api.h:330
SFX_STATE_UPLINK
Definition: sigfox_api.h:375
SIGFOX_API_send_test_frame
sfx_error_t SIGFOX_API_send_test_frame(sfx_u32 frequency, sfx_u8 *customer_data, sfx_u8 customer_data_length, sfx_bool initiate_downlink_flag)
This function builds a Sigfox Frame with the customer payload and send it at a specific frequency Use...
SIGFOX_API_start_continuous_transmission
sfx_error_t SIGFOX_API_start_continuous_transmission(sfx_u32 frequency, sfx_modulation_type_t type)
Executes a continuous wave or modulation depending on the parameter type SIGFOX_API_stop_continuous_t...
sfx_rc_specific_t::open_cs_frequency
sfx_u32 open_cs_frequency
Definition: sigfox_api.h:444
SFX_DLY_INTER_FRAME_TX
Definition: sigfox_api.h:421
SFX_RF_MODE_CS200K_RX
Definition: sigfox_api.h:410
VERSION_MONARCH
Definition: sigfox_api.h:332
SFX_STATE_DOWNLINK
Definition: sigfox_api.h:376
sfx_rc_t::open_rx_frequency
sfx_u32 open_rx_frequency
Definition: sigfox_api.h:460
SFX_DC
Definition: sigfox_api.h:323
sfx_authentication_mode_t
sfx_authentication_mode_t
Definition: sigfox_api.h:334
sfx_modulation_type_t
sfx_modulation_type_t
Definition: sigfox_api.h:378
AUTHENTICATION_OFF
Definition: sigfox_api.h:336
SFX_RF_MODE_TX
Definition: sigfox_api.h:408
SIGFOX_API_set_std_config
sfx_error_t SIGFOX_API_set_std_config(sfx_u32 config_words[3], sfx_bool timer_enable)
This function must be used to configure specific variables for standard. It is mandatory to call this...
SFX_RF_MODE_MONARCH
Definition: sigfox_api.h:412
sfx_version_type_t
sfx_version_type_t
Definition: sigfox_api.h:325
SIGFOX_API_switch_public_key
sfx_error_t SIGFOX_API_switch_public_key(sfx_bool use_public_key)
Switch device on public or private key.
SFX_NVMEM_SEQ_NUM
Definition: sigfox_api.h:398
SIGFOX_API_send_frame
sfx_error_t SIGFOX_API_send_frame(sfx_u8 *customer_data, sfx_u8 customer_data_length, sfx_u8 *customer_response, sfx_u8 tx_mode, sfx_bool initiate_downlink_flag)
Send a standard SIGFOX frame with customer payload. Customer payload cannot exceed 12 Bytes.
SFX_RF_MODE_RX
Definition: sigfox_api.h:409
sfx_rc_t::macro_channel_width
sfx_u32 macro_channel_width
Definition: sigfox_api.h:461
SFX_STATE_READY
Definition: sigfox_api.h:374
sfx_rc_t::specific_rc
sfx_rc_specific_t specific_rc
Definition: sigfox_api.h:464
sfx_delay_t
sfx_delay_t
Definition: sigfox_api.h:416
SIGFOX_API_stop_continuous_transmission
sfx_error_t SIGFOX_API_stop_continuous_transmission(void)
Stop the current continuous transmission.
SFX_STATE_MONARCH_LISTENING_WINDOW
Definition: sigfox_api.h:378
SFX_NVMEM_RL
Definition: sigfox_api.h:400
SIGFOX_API_send_outofband
sfx_error_t SIGFOX_API_send_outofband(sfx_oob_enum_t oob_type)
Send an out of band SIGFOX frame which the type is passed as parameter of the function....
SFX_STATE_IDLE
Definition: sigfox_api.h:372
VERSION_RF
Definition: sigfox_api.h:331
SFX_STATE_NOT_CONFIGURED
Definition: sigfox_api.h:373
SFX_STATE_MONARCH_LISTENING_SWEEP
Definition: sigfox_api.h:377
SFX_NVMEM_FH
Definition: sigfox_api.h:399
sfx_rc_t::spectrum_access
sfx_spectrum_access_t spectrum_access
Definition: sigfox_api.h:463
SIGFOX_API_receive_test_frame
sfx_error_t SIGFOX_API_receive_test_frame(sfx_u32 frequency, sfx_authentication_mode_t mode, sfx_u8 *buffer, sfx_u8 timeout, sfx_s16 *rssi)
This function waits for a valid downlink frame during timeout time and return in customer_data the da...
sfx_nvmem_t
sfx_nvmem_t
Definition: sigfox_api.h:391
SFX_DBPSK_100BPS
Definition: sigfox_api.h:383
sfx_spectrum_access_t
sfx_spectrum_access_t
Definition: sigfox_api.h:315
sfx_rc_t::modulation
sfx_modulation_type_t modulation
Definition: sigfox_api.h:462
VERSION_SIGFOX
Definition: sigfox_api.h:329
AUTHENTICATION_ON
Definition: sigfox_api.h:337
SFX_RF_MODE_CS300K_RX
Definition: sigfox_api.h:411
SIGFOX_API_get_initial_pac
sfx_error_t SIGFOX_API_get_initial_pac(sfx_u8 *initial_pac)
Get the value of the PAC stored in the device. This value is used when the device is registered for t...
sfx_rf_mode_t
sfx_rf_mode_t
Definition: sigfox_api.h:404
sfx_rc_t::open_tx_frequency
sfx_u32 open_tx_frequency
Definition: sigfox_api.h:456
SIGFOX_API_get_version
sfx_error_t SIGFOX_API_get_version(sfx_u8 **version, sfx_u8 *size, sfx_version_type_t type)
Returns current SIGFOX library version, or RF Version, or MCU version etc ..., in ASCII format ( depe...
sigfox_types.h
Sigfox types definition.
sfx_rc_specific_t
Definition: sigfox_api.h:438
SFX_DLY_INTER_FRAME_TRX
Definition: sigfox_api.h:420
sfx_rc_specific_t::cs_threshold
sfx_s8 cs_threshold
Definition: sigfox_api.h:446
SFX_DLY_CS_SLEEP
Definition: sigfox_api.h:423
SFX_DLY_OOB_ACK
Definition: sigfox_api.h:422
SIGFOX_API_get_info
sfx_error_t SIGFOX_API_get_info(sfx_u8 *returned_info)
This function is to return info on send frame depending on the mode you're using. In DC : returned_...
SIGFOX_API_get_device_id
sfx_error_t SIGFOX_API_get_device_id(sfx_u8 *dev_id)
This function copies the ID of the device to the pointer given in parameter. The ID is ID_LENGTH byte...
SIGFOX_API_open
sfx_error_t SIGFOX_API_open(sfx_rc_t *rc)
This function initialises library (mandatory). The SIGFOX_API_open function will :
sfx_rc_t
Definition: sigfox_api.h:450
SFX_FH
Definition: sigfox_api.h:321
SFX_DBPSK_600BPS
Definition: sigfox_api.h:384