HT32SX Generic Push Button
Generic Push Button application for HT32SX
Defines the SIGFOX Radio Configurations

Data Structures

struct  sfx_rc_specific_t
 
struct  sfx_rc_t
 

Macros

#define NA   0 /* Used to store Not applicable values in config words or open parameters */
 
#define RC1_OPEN_UPLINK_CENTER_FREQUENCY   (sfx_u32)(868130000) /* Hz */
 
#define RC1_OPEN_DOWNLINK_CENTER_FREQUENCY   (sfx_u32)(869525000) /* Hz */
 
#define RC1_MACRO_CHANNEL_WIDTH   (sfx_u32)(192000) /* Hz */
 
#define RC1_UPLINK_MODULATION   SFX_DBPSK_100BPS
 
#define RC1_UPLINK_SPECTRUM_ACCESS   SFX_DC
 
#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 */
 
#define RC2_OPEN_DOWNLINK_CENTER_FREQUENCY   (sfx_u32)(905200000) /* Hz */
 
#define RC2_MACRO_CHANNEL_WIDTH   (sfx_u32)(192000) /* Hz */
 
#define RC2_UPLINK_MODULATION   SFX_DBPSK_600BPS
 
#define RC2_UPLINK_SPECTRUM_ACCESS   SFX_FH
 
#define RC2_SET_STD_CONFIG_LM_WORD_0   (sfx_u32)0x000001FF /* LM = Long Message */
 
#define RC2_SET_STD_CONFIG_LM_WORD_1   (sfx_u32)0x00000000
 
#define RC2_SET_STD_CONFIG_LM_WORD_2   (sfx_u32)0x00000000
 
#define RC2_SET_STD_TIMER_ENABLE   (sfx_bool)(SFX_TRUE) /* Enable Timer for FH duty cycle*/
 
#define RC2_SET_STD_TIMER_DISABLE   (sfx_bool)(SFX_FALSE) /* Disable timer feature*/
 
#define RC2_SET_STD_CONFIG_SM_WORD_0   (sfx_u32)0x00000001 /* SM = Short message */
 
#define RC2_SET_STD_CONFIG_SM_WORD_1   (sfx_u32)0x00000000
 
#define RC2_SET_STD_CONFIG_SM_WORD_2   (sfx_u32)0x00000000
 
#define RC3A_OPEN_CS_CENTER_FREQUENCY   (sfx_u32)(923200000) /* Hz */
 
#define RC3A_OPEN_CS_BANDWIDTH   (sfx_u32)(200000) /* Hz */
 
#define RC3A_OPEN_UPLINK_CENTER_FREQUENCY   (sfx_u32)(923200000) /* Hz */
 
#define RC3A_OPEN_DOWNLINK_CENTER_FREQUENCY   (sfx_u32)(922200000) /* Hz */
 
#define RC3A_MACRO_CHANNEL_WIDTH   (sfx_u32)(36000) /* Hz */
 
#define RC3A_UPLINK_MODULATION   SFX_DBPSK_100BPS
 
#define RC3A_UPLINK_SPECTRUM_ACCESS   SFX_LBT
 
#define RC3A_CS_THRESHOLD   (sfx_s8)(-80) /* dBm */
 
#define RC3C_OPEN_CS_CENTER_FREQUENCY   (sfx_u32)(923200000) /* Hz */
 
#define RC3C_OPEN_CS_BANDWIDTH   (sfx_u32)(200000) /* Hz */
 
#define RC3C_OPEN_UPLINK_CENTER_FREQUENCY   (sfx_u32)(923200000) /* Hz */
 
#define RC3C_OPEN_DOWNLINK_CENTER_FREQUENCY   (sfx_u32)(922200000) /* Hz */
 
#define RC3C_MACRO_CHANNEL_WIDTH   (sfx_u32)(192000) /* Hz */
 
#define RC3C_UPLINK_MODULATION   SFX_DBPSK_100BPS
 
#define RC3C_UPLINK_SPECTRUM_ACCESS   SFX_LBT
 
#define RC3C_CS_THRESHOLD   (sfx_s8)(-80) /* dBm */
 
#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 */
 
#define RC4_OPEN_DOWNLINK_CENTER_FREQUENCY   (sfx_u32)(922300000) /* Hz */
 
#define RC4_MACRO_CHANNEL_WIDTH   (sfx_u32)(192000) /* Hz */
 
#define RC4_UPLINK_MODULATION   SFX_DBPSK_600BPS
 
#define RC4_UPLINK_SPECTRUM_ACCESS   SFX_FH
 
#define RC4_SET_STD_CONFIG_LM_WORD_0   (sfx_u32)0x00000000 /* LM = Long Message */
 
#define RC4_SET_STD_CONFIG_LM_WORD_1   (sfx_u32)0xF0000000
 
#define RC4_SET_STD_CONFIG_LM_WORD_2   (sfx_u32)0x0000001F
 
#define RC4_SET_STD_TIMER_ENABLE   (sfx_bool)(SFX_TRUE) /* Enable Timer for FH duty cycle*/
 
#define RC4_SET_STD_TIMER_DISABLE   (sfx_bool)(SFX_FALSE) /* Disable timer feature*/
 
#define RC4_SET_STD_CONFIG_SM_WORD_0   (sfx_u32)0x00000000 /* SM = Short message */
 
#define RC4_SET_STD_CONFIG_SM_WORD_1   (sfx_u32)0x40000000
 
#define RC4_SET_STD_CONFIG_SM_WORD_2   (sfx_u32)0x00000000
 
#define RC5_OPEN_CS_CENTER_FREQUENCY   (sfx_u32)(923300000) /* Hz */
 
#define RC5_OPEN_CS_BANDWIDTH   (sfx_u32)(200000) /* Hz */
 
#define RC5_OPEN_UPLINK_CENTER_FREQUENCY   (sfx_u32)(923300000) /* Hz */
 
#define RC5_OPEN_DOWNLINK_CENTER_FREQUENCY   (sfx_u32)(922300000) /* Hz */
 
#define RC5_MACRO_CHANNEL_WIDTH   (sfx_u32)(192000) /* Hz */
 
#define RC5_UPLINK_MODULATION   SFX_DBPSK_100BPS
 
#define RC5_UPLINK_SPECTRUM_ACCESS   SFX_LBT
 
#define RC5_CS_THRESHOLD   (sfx_s8)(-65) /* dBm */
 
#define RC6_OPEN_UPLINK_CENTER_FREQUENCY   (sfx_u32)(865200000) /* Hz */
 
#define RC6_OPEN_DOWNLINK_CENTER_FREQUENCY   (sfx_u32)(866300000) /* Hz */
 
#define RC6_MACRO_CHANNEL_WIDTH   (sfx_u32)(192000) /* Hz */
 
#define RC6_UPLINK_MODULATION   SFX_DBPSK_100BPS
 
#define RC6_UPLINK_SPECTRUM_ACCESS   SFX_DC
 
#define RC7_OPEN_UPLINK_CENTER_FREQUENCY   (sfx_u32)(868800000) /* Hz */
 
#define RC7_OPEN_DOWNLINK_CENTER_FREQUENCY   (sfx_u32)(869100000) /* Hz */
 
#define RC7_MACRO_CHANNEL_WIDTH   (sfx_u32)(192000) /* Hz */
 
#define RC7_UPLINK_MODULATION   SFX_DBPSK_100BPS
 
#define RC7_UPLINK_SPECTRUM_ACCESS   SFX_DC
 
#define RC101_OPEN_UPLINK_CENTER_FREQUENCY   (sfx_u32)(68862500) /* Hz */
 
#define RC101_OPEN_DOWNLINK_CENTER_FREQUENCY   (sfx_u32)(72912500) /* Hz */
 
#define RC101_MACRO_CHANNEL_WIDTH   (sfx_u32)(12500) /* Hz */
 
#define RC101_UPLINK_MODULATION   SFX_DBPSK_100BPS
 
#define RC101_UPLINK_SPECTRUM_ACCESS   SFX_DC
 
#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}}
 
#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}}
 
#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}}
 
#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}}
 
#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}}
 
#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}}
 
#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}}
 
#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}}
 
#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}}
 
#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}
 
#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}
 
#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}
 
#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}
 
#define RC3A_CONFIG   {0x00000003,0x00001388,0x00000000}
 
#define RC3C_CONFIG   {0x00000003,0x00001388,0x00000000}
 
#define RC5_CONFIG   {0x00000003,0x00001388,0x00000000}
 
#define ID_LENGTH   (sfx_u8)(4) /* Size of device identifier */
 
#define PAC_LENGTH   (sfx_u8)(8) /* Size of device initial PAC */
 

Typedefs

typedef struct sfx_rc_specific_t sfx_rc_specific_t
 
typedef struct sfx_rc_t sfx_rc_t
 

Enumerations

enum  sfx_spectrum_access_t { SFX_FH = 1, SFX_LBT = 2, SFX_DC = 4 }
 
enum  sfx_version_type_t { VERSION_SIGFOX = 0, VERSION_MCU = 1, VERSION_RF = 2, VERSION_MONARCH = 5 }
 
enum  sfx_authentication_mode_t { AUTHENTICATION_OFF = 0, AUTHENTICATION_ON = 1 }
 
enum  sfx_rx_state_enum_t { DL_TIMEOUT = 0, DL_PASSED = 1 }
 
enum  sfx_oob_enum_t { SFX_OOB_SERVICE = 0, SFX_OOB_RC_SYNC, SFX_MAX_OOB_LIST_SIZE }
 
enum  sfx_state_t {
  SFX_STATE_IDLE = 0, SFX_STATE_NOT_CONFIGURED = 1, SFX_STATE_READY = 2, SFX_STATE_UPLINK = 3,
  SFX_STATE_DOWNLINK = 4, SFX_STATE_MONARCH_LISTENING_SWEEP = 6, SFX_STATE_MONARCH_LISTENING_WINDOW = 7
}
 
enum  sfx_modulation_type_t { SFX_NO_MODULATION = 0, SFX_DBPSK_100BPS = 1, SFX_DBPSK_600BPS = 2 }
 
enum  sfx_nvmem_t {
  SFX_NVMEM_PN = 0, SFX_NVMEM_SEQ_NUM = 2, SFX_NVMEM_FH = 4, SFX_NVMEM_RL = 6,
  SFX_NVMEM_BLOCK_SIZE = 7
}
 
enum  sfx_rf_mode_t {
  SFX_RF_MODE_TX = 0, SFX_RF_MODE_RX = 1, SFX_RF_MODE_CS200K_RX = 2, SFX_RF_MODE_CS300K_RX = 3,
  SFX_RF_MODE_MONARCH = 4
}
 
enum  sfx_delay_t { SFX_DLY_INTER_FRAME_TRX = 0, SFX_DLY_INTER_FRAME_TX = 1, SFX_DLY_OOB_ACK = 2, SFX_DLY_CS_SLEEP = 3 }
 
enum  sfx_credentials_use_key_t { CREDENTIALS_PRIVATE_KEY = 0, CREDENTIALS_KEY_IN_ARGUMENT }
 

Functions

sfx_error_t SIGFOX_API_open (sfx_rc_t *rc)
 This function initialises library (mandatory). The SIGFOX_API_open function will : More...
 
sfx_error_t SIGFOX_API_close (void)
 This function closes the library (Free the allocated memory of SIGFOX_API_open and close RF) More...
 
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.
More...
 
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 library can generate. Data is contained on 1 sfx_bool. More...
 
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.
Data is composed of information about the chip itself (Voltage, Temperature).
More...
 
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 function after SIGFOX_API_open() for FH and LBT. More...
 
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_transmission has to be called to stop the continuous transmission. More...
 
sfx_error_t SIGFOX_API_stop_continuous_transmission (void)
 Stop the current continuous transmission. More...
 
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 this function ONLY with Certification ID ( 0xFEDCBA98 ) otherwise an issue occurs. More...
 
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 data received. Use this function ONLY with Certification ID ( 0xFEDCBA98 ) otherwise an issue occurs. More...
 
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 ( depending on the type ) More...
 
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 : returned_info is always 0.
In LBT : returned_info = bit[7-3]: Carrier Sense attempts and bit[2-0]: Number of frames sent. More...
 
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 bytes length and is in binary format. More...
 
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 the first time on the backend. More...
 
sfx_error_t SIGFOX_API_switch_public_key (sfx_bool use_public_key)
 Switch device on public or private key. More...
 
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, a RC Sync frame is transmitted by the device every 4096 messages transmissions (ie. when the sequence number loops to 0) to 're-synchronize' the device with the backend (from a payload encryption point of view). This transmission period could be reduced through this function. Then, a RC Sync frame will be transmitted every 'rc_sync_period' transmissions of a 'normal' frame. The value 0 corresponds to the default behavior, ie a RC Sync frame transmitted every 4096 messages transmissions. As sequence number is on 12 bits, setting a rc_sync_period with a value more than (4095 - 1) will return an error. More...
 

Variables

sfx_u32 open_cs_frequency
 
sfx_u32 open_cs_bandwidth
 
sfx_s8 cs_threshold
 
sfx_u32 open_tx_frequency
 
sfx_u32 open_rx_frequency
 
sfx_u32 macro_channel_width
 
sfx_modulation_type_t modulation
 
sfx_spectrum_access_t spectrum_access
 
sfx_rc_specific_t specific_rc
 

Detailed Description

Macro Definition Documentation

◆ RC2_LM_CONFIG

#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}

Config for full RC2 hopping

◆ RC2_SM_CONFIG

#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}

Config for normal RC2 operations

◆ RC3A_CONFIG

#define RC3A_CONFIG   {0x00000003,0x00001388,0x00000000}

Config word default value: 3 retries before 1st frame , 0x1288=5000ms max time between each frame>

◆ RC3C_CONFIG

#define RC3C_CONFIG   {0x00000003,0x00001388,0x00000000}

Config word default value: 3 retries before 1st frame , 0x1288=5000ms max time between each frame>

◆ RC4_LM_CONFIG

#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}

Config for full RC4 hopping

◆ RC4_SM_CONFIG

#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}

Config for normal RC4 operations

◆ RC5_CONFIG

#define RC5_CONFIG   {0x00000003,0x00001388,0x00000000}

Config word default value: 3 retries before 1st frame , 0x1288=5000ms max time between each frame>

Enumeration Type Documentation

◆ sfx_authentication_mode_t

Enumerator
AUTHENTICATION_OFF 

No authentication of the Received frame, but check a specific pattern

AUTHENTICATION_ON 

Authentication of the Received frame

◆ sfx_credentials_use_key_t

Enumerator
CREDENTIALS_PRIVATE_KEY 

NAK (Network Access Key)

CREDENTIALS_KEY_IN_ARGUMENT 

Use the key in argument

◆ sfx_delay_t

Enumerator
SFX_DLY_INTER_FRAME_TRX 

Delay inter frames in TX/RX (send frame with initiate_downlink_flag = SFX_TRUE) + FH Uplink : (500ms)

SFX_DLY_INTER_FRAME_TX 

Delay inter frames in TX only (0-2000ms)

SFX_DLY_OOB_ACK 

Delay between frame reception and send followed out of band message (1400ms-4000ms)

SFX_DLY_CS_SLEEP 

Delay between attempts of carrier sense for the first frame

◆ sfx_modulation_type_t

Enumerator
SFX_NO_MODULATION 

Do not set the modulation : signal is a pure carrier

SFX_DBPSK_100BPS 

Set DBPSK Modulation with 100 bps baudrate

SFX_DBPSK_600BPS 

Set DBPSK Modulation with 600 bps baudrate

◆ sfx_nvmem_t

Enumerator
SFX_NVMEM_PN 

Index of nv memory for PN

SFX_NVMEM_SEQ_NUM 

Index of nv memory for Sequence Number

SFX_NVMEM_FH 

Index of nv memory for dedicated FH information

SFX_NVMEM_RL 

Index of nv memory for rollover counter

◆ sfx_rf_mode_t

Enumerator
SFX_RF_MODE_TX 

Set RF chip as transmitter

SFX_RF_MODE_RX 

Set RF chip as receiver

SFX_RF_MODE_CS200K_RX 

Set RF chip as receiver for Carrier Sense on 200KHz

SFX_RF_MODE_CS300K_RX 

Set RF chip as receiver for Carrier Sense on 300KHz

SFX_RF_MODE_MONARCH 

Set RF chip as Monarch Configuration

◆ sfx_spectrum_access_t

Enumerator
SFX_FH 

Index of Frequency Hopping

SFX_LBT 

Index of Listen Before Talk

SFX_DC 

Index of Duty Cycle

◆ sfx_state_t

Enumerator
SFX_STATE_IDLE 

Uninitialized

SFX_STATE_NOT_CONFIGURED 

Not Configured

SFX_STATE_READY 

Initialized

SFX_STATE_UPLINK 

Uplink preparation on going

SFX_STATE_DOWNLINK 

Downlink preparation on going

SFX_STATE_MONARCH_LISTENING_SWEEP 

Monarch Listening Sweep on going

SFX_STATE_MONARCH_LISTENING_WINDOW 

Monarch Listening Window on going

◆ sfx_version_type_t

Enumerator
VERSION_SIGFOX 

Sigfox Version

VERSION_MCU 

MCU Version

VERSION_RF 

RF Version

VERSION_MONARCH 

MONARCH Version

Function Documentation

◆ 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)


Return values
Thesfx_error_t is composed of the following :

MSB_____________________________________________LSB

15 8 7 0
MANUF_ERROR_CODE SIGFOX_ERROR_CODE
_______________________ ______________________

SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE and SFX_ERR_API_CLOSE_xx

◆ 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 bytes length and is in binary format.


Parameters
[in]none
[out]sfx_u8*dev_id Pointer where to write the device ID
Return values
Thesfx_error_t is composed of the following :

MSB_____________________________________________LSB

15 8 7 0
MANUF_ERROR_CODE SIGFOX_ERROR_CODE
_______________________ ______________________

SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE or SFX_ERR_API_GET_DEVICE_ID_xx

◆ 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 : returned_info is always 0.
In LBT : returned_info = bit[7-3]: Carrier Sense attempts and bit[2-0]: Number of frames sent.


Parameters
[out]sfx_u8*returned_info Returned value by library
Return values
Thesfx_error_t is composed of the following :

MSB_____________________________________________LSB

15 8 7 0
MANUF_ERROR_CODE SIGFOX_ERROR_CODE
_______________________ ______________________

SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE

◆ 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 the first time on the backend.


Parameters
[in]none
[out]sfx_u8*initial_pac Pointer to initial PAC
Return values
Thesfx_error_t is composed of the following :

MSB_____________________________________________LSB

15 8 7 0
MANUF_ERROR_CODE SIGFOX_ERROR_CODE
_______________________ ______________________

SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE or SFX_ERR_API_GET_INITIAL_PAC_xx

◆ 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 ( depending on the type )


Parameters
[out]sfx_u8**version Pointer to Byte array (ASCII format) containing library version
[out]sfx_u8*size Size of the byte array pointed by *version
[in]sfx_version_type_ttype Type of the version ( MCU, RF, ... )
Return values
Thesfx_error_t is composed of the following :

MSB_____________________________________________LSB

15 8 7 0
MANUF_ERROR_CODE SIGFOX_ERROR_CODE
_______________________ ______________________

SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE and SFX_ERR_API_GET_VERSION_xx

◆ SIGFOX_API_open()

sfx_error_t SIGFOX_API_open ( sfx_rc_t rc)

This function initialises library (mandatory). The SIGFOX_API_open function will :


  • Allocate memory for library
  • Save the input parameters once (Can't be changed till SIGFOX_API_close call)
  • Read the non volatile memory content
  • Set the global state to SFX_STATE_READY
Parameters
[in]sfx_rc_t*rc Pointer on the Radio Configuration Zone: it is mandatory to use already existing RCx define.
Return values
Thesfx_error_t is composed of the following :

MSB_____________________________________________LSB

15 8 7 0
MANUF_ERROR_CODE SIGFOX_ERROR_CODE
_______________________ ______________________

SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE and SFX_ERR_API_OPEN_xx

◆ 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 data received. Use this function ONLY with Certification ID ( 0xFEDCBA98 ) otherwise an issue occurs.


Parameters
[in]sfx_u32frequency Frequency at which the wave is generated
[in]sfx_authentication_mode_tMode ( AUTHENTICATION_ON or AUTHENTICATION_OFF)
[in/out]buffer Depends of the Authentication mode :
  • if AUTHENTICATION_OFF : buffer is used as input to check the bit stream of the received frame
  • if AUTHENTICATION_ON : buffer is used as output to get the received Payload
[in]sfx_u8timeout Timeout for the reception of a valid downlink frame
[in]sfx_s16* rssi RSSI of the received frame ( only valid for AUTHENTICATION_ON as in AUTHENTICATION_OFF, the rssi of the frames received are returned through the MCU_API_report_test_result function)

MSB_____________________________________________LSB

15 8 7 0
MANUF_ERROR_CODE SIGFOX_ERROR_CODE
_______________________ ______________________

SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE and SFX_ERR_API_RECEIVE_TEST_FRAME_xx

◆ 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 library can generate. Data is contained on 1 sfx_bool.


  • In downlink :
    • Send uplink frames
    • Receive downlink frame
    • Send out of band frame (Voltage, temperature and RSSI)
  • In uplink :
    • Send uplink frames
Parameters
[in]sfx_boolbit_value Bit state (SFX_TRUE or SFX_FALSE)
[out]sfx_u8*customer_response Returned 8 Bytes data in case of downlink
[in]sfx_u8tx_mode tx_mode shall be set to 2.
[in]sfx_boolinitiate_downlink_flag Flag to initiate a downlink response
Return values
Thesfx_error_t is composed of the following :

MSB_____________________________________________LSB

15 8 7 0
MANUF_ERROR_CODE SIGFOX_ERROR_CODE
_______________________ ______________________

SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE and SFX_ERR_API_SEND_BIT_xx or SFX_ERR_INT_xx

◆ 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.


  • In downlink :
    • Send uplink frames
    • Receive downlink frame
    • Send out of band frame (Voltage, temperature and RSSI)
  • In uplink :
    • Send uplink frames
    Parameters
    [in]sfx_u8*customer_data Data to transmit
    [in]sfx_u8customer_data_length Data length in Bytes
    [out]sfx_u8*customer_response Returned 8 Bytes data in case of downlink
    [in]sfx_u8tx_mode tx_mode shall be set to 2.
    [in]sfx_boolinitiate_downlink_flag Flag to initiate a downlink response
    Return values
    Thesfx_error_t is composed of the following :
    MSB_____________________________________________LSB
    15 8 7 0
    MANUF_ERROR_CODE SIGFOX_ERROR_CODE
    _______________________ ______________________

SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE and SFX_ERR_API_SEND_FRAME_xx or SFX_ERR_INT_xx

◆ 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.
Data is composed of information about the chip itself (Voltage, Temperature).


  • In uplink :
    • Send uplink frames (3)

This function must be called by application every 24 hours maximum or never if application has some energy critical constraints with the SFX_OOB_SERVICE enum value

If Payload encryption is supported and activated, the user can synchronize the device and the backend with sending SFX_OOB_RC_SYNC

In case REPEATER feature is present, the enum SFX_OOB_REPEATER_STATUS can be sent. This frame contains the counters related to the repeater operations. The counters are part of a shared memory between the Application and the Sigfox Library.

Parameters
[in]sfx_oob_enum_toob_type Type of the OOB frame to send
Return values
Thesfx_error_t is composed of the following :

MSB_____________________________________________LSB

15 8 7 0
MANUF_ERROR_CODE SIGFOX_ERROR_CODE
_______________________ ______________________

SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE and SFX_ERR_INT_xx

◆ 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 this function ONLY with Certification ID ( 0xFEDCBA98 ) otherwise an issue occurs.


Send only 1 repetition

Parameters
[in]sfx_u32frequency Frequency at which the wave is generated
[in]sfx_u8*customer_data Data to transmit
[in]sfx_u8customer_data_length Data length in Bytes
[in]sfx_boolinitiate_downlink_flag Flag to initiate a downlink response

MSB_____________________________________________LSB

15 8 7 0
MANUF_ERROR_CODE SIGFOX_ERROR_CODE
_______________________ ______________________

SIGFOX_ERROR_CODE for this function : SFX_ERR_API_SEND_TEST_FRAME_xx

◆ 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, a RC Sync frame is transmitted by the device every 4096 messages transmissions (ie. when the sequence number loops to 0) to 're-synchronize' the device with the backend (from a payload encryption point of view). This transmission period could be reduced through this function. Then, a RC Sync frame will be transmitted every 'rc_sync_period' transmissions of a 'normal' frame. The value 0 corresponds to the default behavior, ie a RC Sync frame transmitted every 4096 messages transmissions. As sequence number is on 12 bits, setting a rc_sync_period with a value more than (4095 - 1) will return an error.


Parameters
[in]sfx_u16rollover_counter_period Transmission period of the RC Sync frame (in number of 'normal' frames)

MSB_____________________________________________LSB

15 8 7 0
MANUF_ERROR_CODE SIGFOX_ERROR_CODE
_______________________ ______________________

SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE or SFX_ERR_API_SET_RC_SYNC_PERIOD_xx

◆ 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 function after SIGFOX_API_open() for FH and LBT.


FH (Frequency Hopping ): config words to enable/disable 192KHz macro channels authorized for transmission.
Each macro channel is separated from another of 300 kHz
At least 9 macro channel must be enabled to ensure the minimum of 50 FCC channels (9*6 = 54).
WARNING : This function should be called each time you open the library or your FCC configuration will not be applied

Use the RC defined above to configure the macro channels

The example below shows you the Long Message configuration Example : To enable Macro channel 1 to 9, that is to say 902.2MHz to 904.6MHz with 902.2MHz as main Macro channel, you must set :
config_words[0] = [0x000001FF]
config_words[1] = [0x00000000]
config_words[2] = [0x00000000]

* 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 |
* 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   |
* 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   |
*
* 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 |
* 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   |
* 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   |
*
* 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 |
* 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   |
* 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   |
* 

DC (Duty Cycle): This function has no effect in DC spectrum access ( used for the ETSI standard ).

LBT (Listen Before Talk) : Carrier Sense feature for the First frame can be configured.

  • config_word[0] : number of attempts to send the first frame [ has to be greater or equal to 1]
  • config_word[1] : maximum carrier sense sliding window (in ms) [ has to be greater than 6 ms ( CS_MIN_DURATION_IN_MS + 1 ) ]
  • config_word[2] : . bit 8 : set the value to 1 to indicate that the device will use the full operationnal radio band.( 192kHz ) . bit 7-3 : number of Carrier Sense attempts. . bit 2-0 : number of frames sent.
  • timer_enable : unused

    The delay between several attempts of Carrier Sense for the first frame is set by SFX_DLY_CS_SLEEP
Parameters
[in]sfx_u32config_words[3] Meaning depends on the standard (as explained above)
[in]sfx_booltimer_enable Enable timer feature for FH
Return values
Thesfx_error_t is composed of the following :

MSB_____________________________________________LSB

15 8 7 0
MANUF_ERROR_CODE SIGFOX_ERROR_CODE
_______________________ ______________________

SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE and SFX_ERR_API_SET_CONFIG_xx

◆ 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_transmission has to be called to stop the continuous transmission.


Parameters
[in]sfx_u32frequency Frequency at which the signal has to be generated
[in]sfx_modulation_type_ttype Type of modulation to use in continuous mode.
Return values
Thesfx_error_t is composed of the following :

MSB_____________________________________________LSB

15 8 7 0
MANUF_ERROR_CODE SIGFOX_ERROR_CODE
_______________________ ______________________

SIGFOX_ERROR_CODE for this function : SFX_ERR_API_START_CONTINUOUS_TRANSMISSION_xx

◆ SIGFOX_API_stop_continuous_transmission()

sfx_error_t SIGFOX_API_stop_continuous_transmission ( void  )

Stop the current continuous transmission.


Return values
Thesfx_error_t is composed of the following :

MSB_____________________________________________LSB

15 8 7 0
MANUF_ERROR_CODE SIGFOX_ERROR_CODE
_______________________ ______________________

SIGFOX_ERROR_CODE for this function : SFX_ERR_API_STOP_CONTINUOUS_TRANSMISSION_xx

◆ 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.


Parameters
[in]sfx_booluse_public_key Switch to public key if SFX_TRUE, private key else

MSB_____________________________________________LSB

15 8 7 0
MANUF_ERROR_CODE SIGFOX_ERROR_CODE
_______________________ ______________________

SIGFOX_ERROR_CODE for this function : SFX_ERR_NONE or SFX_ERR_API_SWITCH_PUBLIC_KEY_xx

Variable Documentation

◆ cs_threshold

sfx_s8 cs_threshold

LBT threshold defined in the standards related to the RC

◆ macro_channel_width

sfx_u32 macro_channel_width

Macro channel = SIGFOX Operational radio band

◆ modulation

Uplink modulation and baudrate

◆ open_cs_bandwidth

sfx_u32 open_cs_bandwidth

carrier sense bandwidth to apply carrier sensing

◆ open_cs_frequency

sfx_u32 open_cs_frequency

carrier sense center frequency : can be equal to uplink center frequency

◆ open_rx_frequency

sfx_u32 open_rx_frequency

Downlink frequency (Hz) used to open the library

◆ open_tx_frequency

sfx_u32 open_tx_frequency

Uplink frequency (Hz) used to open the library This is not necessary the Transmitter center frequency in Hz as it may depends on the values set in Config Words

◆ specific_rc

sfx_rc_specific_t specific_rc

Specific radio conf for LBT feature

◆ spectrum_access

sfx_spectrum_access_t spectrum_access

Spectrum access : can be Duty Cycle, Frequency Hopping or Listen Before Talk