HT32SX Monarch Scan
Monarch Scan application for HT32SX
addon_sigfox_rf_protocol_api.h File Reference

Sigfox RF and Protocol test application functions. More...

#include "sigfox_types.h"

Go to the source code of this file.

Macros

#define SFX_RF_PROTOCOL_ERR_API_TIMER_START   (sfx_u8)(0xC0)
 
#define SFX_RF_PROTOCOL_ERR_API_REPORT_TEST   (sfx_u8)(0xC1)
 
#define SFX_RF_PROTOCOL_ERR_API_SLEEP_SEND_BIT_1   (sfx_u8)(0xC2)
 
#define SFX_RF_PROTOCOL_ERR_API_SLEEP_SEND_BIT_2   (sfx_u8)(0xC3)
 
#define SFX_RF_PROTOCOL_ERR_API_SLEEP_SEND_OUTOFBAND   (sfx_u8)(0xC4)
 
#define SFX_RF_PROTOCOL_ERR_API_SLEEP_SEND_REPEATER_STATUS   (sfx_u8)(0xC5)
 
#define SFX_RF_PROTOCOL_ERR_API_SLEEP_SEND_FRAME   (sfx_u8)(0xC6)
 
#define SFX_RF_PROTOCOL_ERR_API_TX_DBPSK   (sfx_u8)(0xC7)
 
#define SFX_RF_PROTOCOL_ERR_API_DELAY_SENSI   (sfx_u8)(0xC8)
 
#define SFX_RF_PROTOCOL_ERR_API_DELAY_TX_SYNTH   (sfx_u8)(0xC9)
 
#define SFX_RF_PROTOCOL_ERR_API_WRONG_RC_ENUM   (sfx_u8)(0xCA)
 
#define SFX_RF_PROTOCOL_ERR_API_GET_PAYLOAD_ENCRYPTION_FLAG   (sfx_u8)(0xCB)
 
#define SFX_RF_PROTOCOL_ERR_API_TEST_MODE_UNKNOWN   (sfx_u8)(0xCC)
 
#define SFX_RF_PROTOCOL_ERR_API_SLEEP_SEND_RC_SYNC   (sfx_u8)(0xCD)
 
#define SFX_RF_PROTOCOL_ERR_API_MONARCH   (sfx_u8)(0xCE)
 
#define SFX_RF_PROTOCOL_ERR_API_NOT_A_MONARCH_TEST_MODE   (sfx_u8)(0xCF)
 
#define SFX_RF_PROTOCOL_ERR_API_NVM   (sfx_u8)(0xD0)
 

Enumerations

enum  sfx_rc_enum_t {
  SFX_RC1 = 0, SFX_RC2 = 1, SFX_RC3A = 2, SFX_RC3C = 3,
  SFX_RC4 = 4, SFX_RC5 = 5, SFX_RC6 = 6, SFX_RC101 = 7,
  SFX_RC_LIST_MAX_SIZE
}
 
enum  sfx_test_mode_t {
  SFX_TEST_MODE_TX_BPSK = 0, SFX_TEST_MODE_TX_PROTOCOL = 1, SFX_TEST_MODE_RX_PROTOCOL = 2, SFX_TEST_MODE_RX_GFSK = 3,
  SFX_TEST_MODE_RX_SENSI = 4, SFX_TEST_MODE_TX_SYNTH = 5, SFX_TEST_MODE_TX_FREQ_DISTRIBUTION = 6, SFX_TEST_MODE_RX_MONARCH_PATTERN_LISTENING_SWEEP = 7,
  SFX_TEST_MODE_RX_MONARCH_PATTERN_LISTENING_WINDOW = 8, SFX_TEST_MODE_RX_MONARCH_BEACON = 9, SFX_TEST_MODE_RX_MONARCH_SENSI = 10, SFX_TEST_MODE_TX_BIT = 11,
  SFX_TEST_MODE_PUBLIC_KEY = 12, SFX_TEST_MODE_NVM = 13
}
 

Functions

sfx_error_t ADDON_SIGFOX_RF_PROTOCOL_API_get_version (sfx_u8 **version, sfx_u8 *size)
 This function allows to get the version of the Addon. More...
 
sfx_error_t ADDON_SIGFOX_RF_PROTOCOL_API_test_mode (sfx_rc_enum_t rc_enum, sfx_test_mode_t test_mode)
 This function executes the test modes needed for the Sigfox RF and Protocol Tests. More...
 
sfx_error_t ADDON_SIGFOX_RF_PROTOCOL_API_monarch_test_mode (sfx_rc_enum_t rc_enum, sfx_test_mode_t test_mode, sfx_u8 rc_capabilities)
 This function executes the MONARCH test modes needed for the Sigfox RF and Protocol Tests. More...
 

Detailed Description

Sigfox RF and Protocol test application functions.

\if SIGFOX PATTERN


/ ___/ | | / ___| | ___| / _ \ \ \ / /
| |___ | | | | | |__ | | | | \ \/ /
___ \ | | | | _ | __| | | | | } {
___| | | | | |_| | | | | |_| | / /\ \ /_____/ |_| _____/ |_| _____/ /_/ _\


!!!! DO NOT MODIFY THIS FILE !!!!


 \endif

Author
Version
Date

This file includes the Sigfox RF and Protocol test modes functions to be used for the Sigfox RF and Protocol application

Enumeration Type Documentation

◆ sfx_rc_enum_t

Enumerator
SFX_RC1 

Radio Configuration 1

SFX_RC2 

Radio Configuration 2

SFX_RC3A 

Radio Configuration 3A

SFX_RC3C 

Radio Configuration 3C

SFX_RC4 

Radio Configuration 4

SFX_RC5 

Radio Configuration 5

SFX_RC6 

Radio Configuration 6

SFX_RC101 

Radio Configuration 101

SFX_RC_LIST_MAX_SIZE 

Max Radio Configuration size

◆ sfx_test_mode_t

Enumerator
SFX_TEST_MODE_TX_BPSK 

Only BPSK with Synchro Bit + Synchro frame + PN sequence : no hopping centered on the TX_frequency

SFX_TEST_MODE_TX_PROTOCOL 

with full protocol with AES key defined at SIGFOX_API_open call: send all SIGFOX protocol frames available with hopping

SFX_TEST_MODE_RX_PROTOCOL 

with full protocol with AES key defined at SIGFOX_API_open call: send SIGFOX protocol frames w/ initiate_downlink_flag = SFX_TRUE

SFX_TEST_MODE_RX_GFSK 

with known pattern with SB + SF + Pattern on RX_Frequency defined at SIGFOX_API_open function : od internaly compare re ceived frame <=> known pattern and call sfx_test_report()

SFX_TEST_MODE_RX_SENSI 

Do uplink + downlink frame with AES key defined at SIGFOX_API_open call but specific shorter timings

SFX_TEST_MODE_TX_SYNTH 

Do 9 uplink frames to measure frequency synthesis step

SFX_TEST_MODE_TX_FREQ_DISTRIBUTION 

Call all Sigfox frames of all types and size on all the Sigfox Band

SFX_TEST_MODE_RX_MONARCH_PATTERN_LISTENING_SWEEP 

Scan all supported RC-pattern@freq and return the detected pattern with its RSSI

SFX_TEST_MODE_RX_MONARCH_PATTERN_LISTENING_WINDOW 

Scan 1 RC-pattern@freq during a specific time and return the detected pattern with its RSSI

SFX_TEST_MODE_RX_MONARCH_BEACON 

Keep listening on the RC beacon

SFX_TEST_MODE_RX_MONARCH_SENSI 

Execute Uplink frame (with counter) and scan for all supported RC-pattern@freq, return the result and loop again

SFX_TEST_MODE_TX_BIT 

Call twice the Sigfox frames (payload 1 bit only)

SFX_TEST_MODE_PUBLIC_KEY 

Execute the public key test - all the frames of the protocol needs to be sent

SFX_TEST_MODE_NVM 

Execute the nvm test

Function Documentation

◆ ADDON_SIGFOX_RF_PROTOCOL_API_get_version()

sfx_error_t ADDON_SIGFOX_RF_PROTOCOL_API_get_version ( sfx_u8 **  version,
sfx_u8 *  size 
)

This function allows to get the version of the Addon.


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
Return values
Thesfx_error_t is composed of the following :
*    MSB_____________________________________________LSB
*     |                       |                      |
*     |   MANUF_ERROR_CODE    |  SIGFOX_ERROR_CODE   |
*     |_______________________|______________________|
* 

◆ ADDON_SIGFOX_RF_PROTOCOL_API_monarch_test_mode()

sfx_error_t ADDON_SIGFOX_RF_PROTOCOL_API_monarch_test_mode ( sfx_rc_enum_t  rc_enum,
sfx_test_mode_t  test_mode,
sfx_u8  rc_capabilities 
)

This function executes the MONARCH test modes needed for the Sigfox RF and Protocol Tests.



  • MONARCH FEATURE ONLY If test_mode = SFX_TEST_MODE_RX_MONARCH_PATTERN_LISTENING_SWEEP (TEST_MODE 7).
    This test consists in setting the device in pattern scan for 30s in LISTENING_SWEEP mode and report status TRUE or FALSE depending on the pattern found vs expected pattern.

  • MONARCH FEATURE ONLY If test_mode = SFX_TEST_MODE_RX_MONARCH_PATTERN_LISTENING_WINDOW (TEST_MODE 8).
    This test consists in setting the device in pattern scan for 30s in LISTENING_WINDOW mode and report status TRUE or FALSE depending on the pattern found vs expected pattern.

  • MONARCH FEATURE ONLY If test_mode = SFX_TEST_MODE_RX_MONARCH_BEACON (TEST_MODE 9).
    This test is specific to SIGFOX's test equipments & softwares.
    This test execute a kind of "ping-pong" loop that starts with a frame sent by the device to the equipment. At the reception of the frame, the equipment sends the beacon that will be received by the device. The addon computes the RC found counters which are reported in the Uplink Sigfox Frame to the equipment. This test is executed for 1000 loops ( 1000 beacons sent )

  • MONARCH FEATURE ONLY If test_mode = SFX_TEST_MODE_RX_MONARCH_SENSI (TEST_MODE 10).
    This test is specific to SIGFOX's test equipments & softwares.
    This test execute a kind of "ping-pong" loop that starts with a frame sent by the device to the equipment. At the reception of the frame, the equipment sends the beacon that will be received by the device. The addon computes the RC found counters which are reported in the Uplink Sigfox Frame to the equipment. This test is executed for 10 loops ( 10 beacons sent )

Parameters
[in]sfx_rc_tRadio Configuration pointer
[in]sfx_test_mode_ttest_mode Test mode to be executed
[in]sfx_u8rc_capabilities Radio Capabilities in bitmask format as defined in SIGFOX_MONARCH_API_executed_rc_scan
Return values
Thesfx_error_t is composed of the following :
*    MSB_____________________________________________LSB
*     |                       |                      |
*     |   MANUF_ERROR_CODE    |  SIGFOX_ERROR_CODE   |
*     |_______________________|______________________|
* 

◆ ADDON_SIGFOX_RF_PROTOCOL_API_test_mode()

sfx_error_t ADDON_SIGFOX_RF_PROTOCOL_API_test_mode ( sfx_rc_enum_t  rc_enum,
sfx_test_mode_t  test_mode 
)

This function executes the test modes needed for the Sigfox RF and Protocol Tests.



  • If test_mode = SFX_TEST_MODE_TX_BPSK (TEST_MODE 0).
    This test consists in sending 3 Sigfox Frames of 26 bytes with specific data @ central frequency.

  • If test_mode = SFX_TEST_MODE_TX_PROTOCOL (TEST_MODE 1).
    This test consists in calling SIGFOX_API_send_xxx functions to test the complete protocol in Uplink only. for all size of frames w/ Data = 0x40 to 0x4B

  • If test_mode = SFX_TEST_MODE_RX_PROTOCOL (TEST_MODE 2).
    This test consists in calling SIGFOX_API_send_xxx functions to test the complete protocol in Downlink only, w/ Uplink Data = 0x40 to 0x4B At the end of the test, a send bit message is sent to indicate if the downlink payload decoded by the device matches with the payload sent by the test tool.

  • If test_mode = SFX_TEST_MODE_RX_GFSK (TEST_MODE 3).
    This test consists in receiving constant GFSK frames @ constant frequency.
    The pattern used for test is : AA AA B2 27 1F 20 41 84 32 68 C5 BA 53 AE 79 E7 F6 DD 9B with AA AA B2 27 configured in RF chip
    . The test is executed during 30s.

  • If test_mode = SFX_TEST_MODE_RX_SENSI (TEST_MODE 4).
    This test is specific to SIGFOX's test equipments & softwares.
    It is mandatory to measure the real sensitivity of device.
    This test execute a kind of "ping-pong" loop that starts with a frame sent by the device and then a response sent by the equipment ( downlink frame ) that has to be received by the device. Internal counters are incremented to count the number of received frames. Report of the current status ( received or not ) is done through the MCU_API_report_test_result function

  • If test_mode = SFX_TEST_MODE_TX_SYNTH (TEST_MODE 5).
    This test consists in sending 9 SIGFOX frames with 4Bytes payload ( containing the programmed frequency ) starting with the central frequency and then spaced with 100 Hz.

  • If test_mode = SFX_TEST_MODE_TX_FREQ_DISTRIBUTION (TEST_MODE 6).
    This test consists in calling SIGFOX_API_send_xxx functions to test the complete protocol in Uplink only, w/ Uplink Data = 0x40 to 0x4B
    . There are several occurences of the loop to ensure the full Sigfox band is covered

  • If test_mode = SFX_TEST_MODE_TX_BIT (TEST_MODE 11).
    This test consists in calling SIGFOX_API_send_bit function twice to test part of the protocol in Uplink only and LBT .

  • If test_mode = SFX_TEST_MODE_PUBLIC_KEY (TEST_MODE 12).
    This test consists in calling SIGFOX_API_send_frame function with the PUBLIC KEY activated
    . The device returns to PRIVATE KEY at the end of this test.

  • If test_mode = SFX_TEST_MODE_NVM (TEST_MODE 13).
    This test consists in calling SIGFOX_API_send_frame functions once with the PN of the NVM data as the payload.

Parameters
[in]sfx_rc_tRadio Configuration pointer
[in]sfx_test_mode_ttest_mode Test mode to be executed
Return values
Thesfx_error_t is composed of the following :
*    MSB_____________________________________________LSB
*     |                       |                      |
*     |   MANUF_ERROR_CODE    |  SIGFOX_ERROR_CODE   |
*     |_______________________|______________________|
*