![]() |
HT32SX Generic Push Button
Generic Push Button application for HT32SX
|
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 |
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 |
#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
#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
#define RC3A_CONFIG {0x00000003,0x00001388,0x00000000} |
Config word default value: 3 retries before 1st frame , 0x1288=5000ms max time between each frame>
#define RC3C_CONFIG {0x00000003,0x00001388,0x00000000} |
Config word default value: 3 retries before 1st frame , 0x1288=5000ms max time between each frame>
#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
#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
#define RC5_CONFIG {0x00000003,0x00001388,0x00000000} |
Config word default value: 3 retries before 1st frame , 0x1288=5000ms max time between each frame>
enum sfx_delay_t |
enum sfx_nvmem_t |
enum sfx_rf_mode_t |
enum sfx_state_t |
enum sfx_version_type_t |
sfx_error_t SIGFOX_API_close | ( | void | ) |
This function closes the library (Free the allocated memory of SIGFOX_API_open and close RF)
The | sfx_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
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.
[in] | none | |
[out] | sfx_u8* | dev_id Pointer where to write the device ID |
The | sfx_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
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.
[out] | sfx_u8* | returned_info Returned value by library |
The | sfx_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
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.
[in] | none | |
[out] | sfx_u8* | initial_pac Pointer to initial PAC |
The | sfx_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
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 )
[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_t | type Type of the version ( MCU, RF, ... ) |
The | sfx_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
sfx_error_t SIGFOX_API_open | ( | sfx_rc_t * | rc | ) |
This function initialises library (mandatory). The SIGFOX_API_open function will :
[in] | sfx_rc_t | *rc Pointer on the Radio Configuration Zone: it is mandatory to use already existing RCx define. |
The | sfx_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
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.
[in] | sfx_u32 | frequency Frequency at which the wave is generated |
[in] | sfx_authentication_mode_t | Mode ( AUTHENTICATION_ON or AUTHENTICATION_OFF) |
[in/out] | buffer Depends of the Authentication mode :
| |
[in] | sfx_u8 | timeout 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
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] | sfx_bool | bit_value Bit state (SFX_TRUE or SFX_FALSE) |
[out] | sfx_u8 | *customer_response Returned 8 Bytes data in case of downlink |
[in] | sfx_u8 | tx_mode tx_mode shall be set to 2. |
[in] | sfx_bool | initiate_downlink_flag Flag to initiate a downlink response |
The | sfx_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
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] | sfx_u8 | *customer_data Data to transmit |
[in] | sfx_u8 | customer_data_length Data length in Bytes |
[out] | sfx_u8 | *customer_response Returned 8 Bytes data in case of downlink |
[in] | sfx_u8 | tx_mode tx_mode shall be set to 2. |
[in] | sfx_bool | initiate_downlink_flag Flag to initiate a downlink response |
The | sfx_error_t is composed of the following : |
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
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).
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.
[in] | sfx_oob_enum_t | oob_type Type of the OOB frame to send |
The | sfx_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
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
[in] | sfx_u32 | frequency Frequency at which the wave is generated |
[in] | sfx_u8 | *customer_data Data to transmit |
[in] | sfx_u8 | customer_data_length Data length in Bytes |
[in] | sfx_bool | initiate_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
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.
[in] | sfx_u16 | rollover_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
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.
[in] | sfx_u32 | config_words[3] Meaning depends on the standard (as explained above) |
[in] | sfx_bool | timer_enable Enable timer feature for FH |
The | sfx_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
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.
[in] | sfx_u32 | frequency Frequency at which the signal has to be generated |
[in] | sfx_modulation_type_t | type Type of modulation to use in continuous mode. |
The | sfx_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
sfx_error_t SIGFOX_API_stop_continuous_transmission | ( | void | ) |
Stop the current continuous transmission.
The | sfx_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
sfx_error_t SIGFOX_API_switch_public_key | ( | sfx_bool | use_public_key | ) |
Switch device on public or private key.
[in] | sfx_bool | use_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
sfx_s8 cs_threshold |
LBT threshold defined in the standards related to the RC
sfx_u32 macro_channel_width |
Macro channel = SIGFOX Operational radio band
sfx_modulation_type_t modulation |
Uplink modulation and baudrate
sfx_u32 open_cs_bandwidth |
carrier sense bandwidth to apply carrier sensing
sfx_u32 open_cs_frequency |
carrier sense center frequency : can be equal to uplink center frequency
sfx_u32 open_rx_frequency |
Downlink frequency (Hz) used to open the library
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
sfx_rc_specific_t specific_rc |
Specific radio conf for LBT feature
sfx_spectrum_access_t spectrum_access |
Spectrum access : can be Duty Cycle, Frequency Hopping or Listen Before Talk