CTE Receiver (cte_receiver)

Commands and events in this class manage Constant Tone Extension (CTE) receiving.

CTE feature is only supported by specific devices. Commands from this class will return bg_err_not_supported on devices that do not support CTE.

cte_receiver commands

cte_receiver_clear_dtm_parameters

Clear CTE-related parameters that were previously set for LE receiver test. Default values will be restored for these parameters.

C API

/* Function */
struct gecko_msg_cte_receiver_clear_dtm_parameters_rsp_t *gecko_cmd_cte_receiver_clear_dtm_parameters();

/* Response id */
gecko_rsp_cte_receiver_clear_dtm_parameters_id

/* Response structure */
struct gecko_msg_cte_receiver_clear_dtm_parameters_rsp_t
{
  uint16 result;
}

Command does not have parameters (for BGAPI headers refer to link)

Response Parameters (for BGAPI headers refer to link)

Type Name Description
uint16 result Result code
  • 0: success
  • Non-zero: an error has occurred
For other values see Error codes

cte_receiver_set_dtm_parameters

Set CTE-related parameters of LE receiver test.

C API

/* Function */
struct gecko_msg_cte_receiver_set_dtm_parameters_rsp_t *gecko_cmd_cte_receiver_set_dtm_parameters(uint8 cte_length, uint8 cte_type, uint8 slot_durations, uint8 switching_pattern_len, const uint8 *switching_pattern_data);

/* Response id */
gecko_rsp_cte_receiver_set_dtm_parameters_id

/* Response structure */
struct gecko_msg_cte_receiver_set_dtm_parameters_rsp_t
{
  uint16 result;
}

Command Parameters (for BGAPI headers refer to link)

Type Name Description
uint8 cte_length Expected CTE length in 8 us units
  • 0: No CTE
  • 0x02 to 0x14: Expected CTE length
Default: 0 (no CTE)
uint8 cte_type Expected CTE type
  • 0: Expect AoA CTE
  • 1: Expect AoD CTE with 1 us slots
  • 2: Expect AoD CTE with 2 us slots
Default: 0
uint8 slot_durations Slot durations
  • 1: Switching and sampling slots are 1 us each
  • 2: Switching and sampling slots are 2 us each
Default: 1
uint8 switching_pattern_len Array length.
uint8array switching_pattern_data Antenna switching pattern. Antennas will be switched in this order with the antenna switch pins during CTE. If the CTE is longer than the switching pattern, the pattern starts over. Default: empty array

Response Parameters (for BGAPI headers refer to link)

Type Name Description
uint16 result Result code
  • 0: success
  • Non-zero: an error has occurred
For other values see Error codes

cte_receiver_start_iq_sampling

Start IQ samplings on a connection. A CTE requests will be initiated periodically on the given connection and IQ sampling will be made on the received CTE responses.

C API

/* Function */
struct gecko_msg_cte_receiver_start_iq_sampling_rsp_t *gecko_cmd_cte_receiver_start_iq_sampling(uint8 connection, uint16 interval, uint8 cte_length, uint8 cte_type, uint8 slot_durations, uint8 switching_pattern_len, const uint8 *switching_pattern_data);

/* Response id */
gecko_rsp_cte_receiver_start_iq_sampling_id

/* Response structure */
struct gecko_msg_cte_receiver_start_iq_sampling_rsp_t
{
  uint16 result;
}

Command Parameters (for BGAPI headers refer to link)

Type Name Description
uint8 connection Connection handle
uint16 interval Measurement interval
  • 0: No interval. The request is initiated only once.
  • Other values N: Initiate the request every N-th connection events
uint8 cte_length Minimum CTE length requested in 8 us units.
  • Range: 0x02 to 0x14
  • Time Range: 16 us to 160 us
uint8 cte_type Requested CTE type
  • 0: AoA CTE
  • 1: AoD CTE with 1 us slots
  • 2: AoD CTE with 2 us slots
uint8 slot_durations Slot durations
  • 1: Switching and sampling slots are 1 us each
  • 2: Switching and sampling slots are 2 us each
uint8 switching_pattern_len Array length.
uint8array switching_pattern_data Antenna switching pattern. Antennas will be switched in this order with the antenna switch pins during CTE. If the CTE is longer than the switching pattern, the pattern starts over.

Response Parameters (for BGAPI headers refer to link)

Type Name Description
uint16 result Result code
  • 0: success
  • Non-zero: an error has occurred
For other values see Error codes

Events generated

Event Description
cte_receiver_iq_report Triggered when IQ samples have been received.

cte_receiver_stop_iq_sampling

Stop the IQ sampling on a connection. CTEs will not be requested on the given connection.

C API

/* Function */
struct gecko_msg_cte_receiver_stop_iq_sampling_rsp_t *gecko_cmd_cte_receiver_stop_iq_sampling(uint8 connection);

/* Response id */
gecko_rsp_cte_receiver_stop_iq_sampling_id

/* Response structure */
struct gecko_msg_cte_receiver_stop_iq_sampling_rsp_t
{
  uint16 result;
}

Command Parameters (for BGAPI headers refer to link)

Type Name Description
uint8 connection Connection handle

Response Parameters (for BGAPI headers refer to link)

Type Name Description
uint16 result Result code
  • 0: success
  • Non-zero: an error has occurred
For other values see Error codes

cte_receiver events

cte_receiver_iq_report

IQ samples report from connection or connectionless CTE packets.

C API

/* event id*/
gecko_evt_cte_receiver_iq_report_id

/* event structure*/
struct gecko_msg_cte_receiver_iq_report_evt_t
{
  uint16 status;
  uint8 packet_type;
  uint8 handle;
  uint8 phy;
  uint8 channel;
  int8 rssi;
  uint8 rssi_antenna_id;
  uint8 cte_type;
  uint8 slot_durations;
  uint16 event_counter;
  uint8 completeness;
  uint8array samples;
}

Event Parameters (for BGAPI headers refer to link)

Type Name Description
uint16 status Status of CTE IQ sampling
uint8 packet_type CTE packet type
  • 0: Connection. The sampled CTE was requested through a connection.
  • 1: Connectionless. The sampled CTE was part of a periodic advertisement.
  • 2: DTM. This value is possible only in some testing circumstances
uint8 handle Connection handle or periodic advertising synchronization handle
uint8 phy The PHY on which the packet is received on a connection. Ingore this field for connectionless IQ reports.
  • 1: 1M PHY
  • 2: 2M PHY
uint8 channel The channel on which the CTE packet was received
int8 rssi RSSI in the received CTE packet. Unit: dBm
uint8 rssi_antenna_id The ID of the antenna on which RSSI was measured
uint8 cte_type The CTE type
  • 0: AoA CTE response
  • 1: AoD CTE response with 1us slots
  • 2: AoD CTE response with 2us slots
uint8 slot_durations Slot durations
  • 1: Switching and sampling slots are 1 us each
  • 2: Switching and sampling slots are 2 us each
uint16 event_counter The event counter of the periodic advertising train or the connection
uint8 completeness The sample data completeness status
  • 0: Complete
  • 1: Incomplete, more sample data to come in next events
uint8array samples IQ samples of the received CTE packet. I and Q samples follow each other alternately (I, Q, I, Q , ...)