CTE Receiver (cte_receiver)

Commands and events in this class can be used to 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

This command can be used to clear CTE related parameters that were previously set for LE receiver test. Default values will be restored for these parameters.

Command

Byte Type Name Description
0 0x20 hilen Message type: Command
1 0x00 lolen Minimum payload length
2 0x45 class Message class:CTE Receiver
3 0x06 method Message ID

Response

Byte Type Name Description
0 0x20 hilen Message type: Response
1 0x02 lolen Minimum payload length
2 0x45 class Message class:CTE Receiver
3 0x06 method Message ID
4-5 uint16 result Result code
  • 0: success
  • Non-zero: an error occurred
For other values refer to the Error codes

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
}

cte_receiver_set_dtm_parameters

This command can be used to set CTE related parameters of LE receiver test.

Command

Byte Type Name Description
0 0x20 hilen Message type: Command
1 0x04 lolen Minimum payload length
2 0x45 class Message class:CTE Receiver
3 0x05 method Message ID
4 uint8 cte_length Expected length of the Constant Tone Extension in 8 us units
5 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
6 uint8 slot_durations Slot durations
  • 1: Switching and sampling slots are 1 us each
  • 2: Switching and sampling slots are 2 us each
7 uint8array switching_pattern Antenna switching pattern

Response

Byte Type Name Description
0 0x20 hilen Message type: Response
1 0x02 lolen Minimum payload length
2 0x45 class Message class:CTE Receiver
3 0x05 method Message ID
4-5 uint16 result Result code
  • 0: success
  • Non-zero: an error occurred
For other values refer to the Error codes

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
}

cte_receiver_start_iq_sampling

This command can be used to start IQ samplings on a connection.

Command

Byte Type Name Description
0 0x20 hilen Message type: Command
1 0x07 lolen Minimum payload length
2 0x45 class Message class:CTE Receiver
3 0x01 method Message ID
4 uint8 connection Connection handle
5-6 uint16 interval Measurement interval
  • 0: No interval. The request is initiated only once.
  • Other values N: Initiate the request every N-th connection events
7 uint8 cte_length Minimum length of the CTE being requested in 8 us units
8 uint8 cte_type Requested CTE type
  • 0: AoA CTE
  • 1: AoD CTE with 1 us slots
  • 2: AoD CTE with 2 us slots
9 uint8 slot_durations Slot durations
  • 1: Switching and sampling slots are 1 us each
  • 2: Switching and sampling slots are 2 us each
10 uint8array switching_pattern Antenna switching pattern

Response

Byte Type Name Description
0 0x20 hilen Message type: Response
1 0x02 lolen Minimum payload length
2 0x45 class Message class:CTE Receiver
3 0x01 method Message ID
4-5 uint16 result Result code
  • 0: success
  • Non-zero: an error occurred
For other values refer to the Error codes

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
}

Events generated

Event Description
cte_receiver_iq_report Triggered when IQ samples have been received.

cte_receiver_stop_iq_sampling

This command can be used to stop the IQ sampling on a connection.

Command

Byte Type Name Description
0 0x20 hilen Message type: Command
1 0x01 lolen Minimum payload length
2 0x45 class Message class:CTE Receiver
3 0x02 method Message ID
4 uint8 connection Connection handle

Response

Byte Type Name Description
0 0x20 hilen Message type: Response
1 0x02 lolen Minimum payload length
2 0x45 class Message class:CTE Receiver
3 0x02 method Message ID
4-5 uint16 result Result code
  • 0: success
  • Non-zero: an error occurred
For other values refer to the Error codes

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
}

cte_receiver events

cte_receiver_iq_report

IQ samples report from connection or connectionless CTE packets.

Event

Byte Type Name Description
0 0xa0 hilen Message type: Event
1 0x0d lolen Minimum payload length
2 0x45 class Message class:CTE Receiver
3 0x00 method Message ID
4-5 uint16 status Status of CTE IQ sampling
6 uint8 packet_type CTE packet type
  • 0: Connection
  • 1: Connectionless
  • 2: DTM. This value is possible only in some testing circumstances
7 uint8 handle Connection handle or periodic advertising synchronization handle
8 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
9 uint8 channel The channel on which the CTE packet was received
10 int8 rssi RSSI in the received CTE packet. Unit: dBm
11 uint8 rssi_antenna_id The ID of the antenna on which RSSI was measured
12 uint8 cte_type The CTE type
  • 0: AoA CTE response
  • 1: AoD CTE response with 1us slots
  • 2: AoD CTE response with 2us slots
13 uint8 slot_durations Slot durations
  • 1: Switching and sampling slots are 1 us each
  • 2: Switching and sampling slots are 2 us each
14-15 uint16 event_counter The event counter of the periodic advertising train or the connection
16 uint8array samples IQ samples in received CTE packet

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,
  uint8array samples
}