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