CS Reflector#

Channel Sounding (CS) Reflector role implementation for all BLE Channel Sounding apps.

Modules#

connection_ctx_t

cs_event_data_t

Functions#

typedef(struct { int8_t max_tx_power_dbm;}) cs_reflector_config_t
bool
cs_reflector_identify(uint8_t conn_handle)
sl_status_t
cs_reflector_create(uint8_t conn_handle, cs_reflector_config_t *reflector_config)
sl_status_t
cs_reflector_delete(uint8_t conn_handle)
bool
cs_reflector_on_bt_event(sl_bt_msg_t *evt)
cs_rcm_get_connection_ctx(const uint8_t conn_handle)
sl_status_t
cs_rcm_add_new_initiator_connection(const uint8_t conn_handle)
void
cs_rcm_remove_initiator_connection(const uint8_t conn_handle)
void
cs_reflector_event_buf_purge_data(const uint8_t conn_handle)
cs_reflector_event_buf_find(const uint8_t conn_handle, const uint16_t procedure_index, const uint16_t subevent_index)

Function Documentation#

typedef#

typedef (struct { int8_t max_tx_power_dbm;} )
Parameters
N/A

Definition at line 44 of file common/cs_reflector/cs_reflector.h

cs_reflector_identify#

bool cs_reflector_identify (uint8_t conn_handle)
Parameters
[in]conn_handle

the connection handle to identify

Determine whether a connection handle has a reflector associated to it

Returns

  • true if the handle has an associated reflector instance, false otherwise


Definition at line 56 of file common/cs_reflector/cs_reflector.h

cs_reflector_create#

sl_status_t cs_reflector_create (uint8_t conn_handle, cs_reflector_config_t * reflector_config)
Parameters
[in]conn_handle

the connection handle for which to create the reflector

[in]reflector_config

reflector configuration parameters

Create a reflector for the given connection handle

Returns

  • status of the operation


Definition at line 66 of file common/cs_reflector/cs_reflector.h

cs_reflector_get_active_instance_count#

uint8_t cs_reflector_get_active_instance_count (void )
Parameters
N/A

Get the number of active reflector instances

Returns

  • the number of active reflector instances


Definition at line 74 of file common/cs_reflector/cs_reflector.h

cs_reflector_delete#

sl_status_t cs_reflector_delete (uint8_t conn_handle)
Parameters
[in]conn_handle

the connection handle for which to delete the reflector

Delete the reflector associated with the given connection handle

Returns

  • status of the operation


Definition at line 83 of file common/cs_reflector/cs_reflector.h

cs_reflector_on_bt_event#

bool cs_reflector_on_bt_event (sl_bt_msg_t * evt)
Parameters
[in]evt

the Bluetooth stack event to handle

Handle a Bluetooth stack event

Returns

  • true to forward the message to the host in NCP case


Definition at line 92 of file common/cs_reflector/cs_reflector.h

cs_rcm_get_connection_ctx#

connection_ctx_t * cs_rcm_get_connection_ctx (const uint8_t conn_handle)
Parameters
[in]conn_handle

the connection handle to search for

Find the pointer to a connection context which belongs to the provided connection handle.

Returns

  • the pointer of the context corresponding to the provided connection handle, NULL if not found


Definition at line 63 of file common/cs_reflector/cs_reflector_connmanager.h

cs_rcm_add_new_initiator_connection#

sl_status_t cs_rcm_add_new_initiator_connection (const uint8_t conn_handle)
Parameters
[in]conn_handle

the connection handle to register

Register a new initiator connection with the provided handle.

Returns

  • status of the operation


Definition at line 72 of file common/cs_reflector/cs_reflector_connmanager.h

cs_rcm_remove_initiator_connection#

void cs_rcm_remove_initiator_connection (const uint8_t conn_handle)
Parameters
[in]conn_handle

the connection handle to remove

Remove an initiator connection with the provided handle.


Definition at line 79 of file common/cs_reflector/cs_reflector_connmanager.h

cs_rcm_can_accept_new_connection#

bool cs_rcm_can_accept_new_connection (void )
Parameters
N/A

Tell whether an additional connection can be accepted.

Returns

  • true if an additional connection can be accepted, false otherwise


Definition at line 86 of file common/cs_reflector/cs_reflector_connmanager.h

cs_rcm_get_number_of_connections#

uint8_t cs_rcm_get_number_of_connections (void )
Parameters
N/A

Show the number of active connections.

Returns

  • the number of active connections


Definition at line 93 of file common/cs_reflector/cs_reflector_connmanager.h

cs_reflector_event_buf_clear#

void cs_reflector_event_buf_clear (void )
Parameters
N/A

Clear all data from the CS event buffer.


Definition at line 58 of file common/cs_reflector/cs_reflector_event_buf.h

cs_reflector_event_buf_get_free_space#

uint32_t cs_reflector_event_buf_get_free_space (void )
Parameters
N/A

Tell the number of free slots available in the CS event buffer.

Returns

  • the number of free slots available in the CS event buffer


Definition at line 65 of file common/cs_reflector/cs_reflector_event_buf.h

cs_reflector_event_buf_purge_data#

void cs_reflector_event_buf_purge_data (const uint8_t conn_handle)
Parameters
[in]conn_handle

the connection handle to erase all data for

Purge any data from the CS event buffer associated with a connection. Useful when an initiator disconnects and we don't want any leftover measurement data in the buffer.


Definition at line 74 of file common/cs_reflector/cs_reflector_event_buf.h

cs_reflector_event_buf_get_element_for_write#

cs_event_data_t * cs_reflector_event_buf_get_element_for_write (void )
Parameters
N/A

Find a pointer to a buffer element which is free to write, yields NULL if no writable elements are available.

Returns

  • pointer to a free buffer element, NULL if none available


Definition at line 82 of file common/cs_reflector/cs_reflector_event_buf.h

cs_reflector_event_buf_get_next_element#

cs_event_data_t * cs_reflector_event_buf_get_next_element (const uint8_t conn_handle)
Parameters
[in]conn_handle

the connection handle for which the data is requested

Provide a pointer to the next available data for a given connection, yields NULL if no next data is available.

Returns

  • pointer to the next available data, NULL if none available


Definition at line 92 of file common/cs_reflector/cs_reflector_event_buf.h

cs_reflector_event_buf_find#

cs_event_data_t * cs_reflector_event_buf_find (const uint8_t conn_handle, const uint16_t procedure_index, const uint16_t subevent_index)
Parameters
[in]conn_handle

the connection handle for which the data is requested

[in]procedure_index

procedure index of requested the result

[in]subevent_index

subevent index of requested the result

Find and return an exact result from the CS event buffer.

Returns

  • pointer to the result if available, NULL if not found


Definition at line 103 of file common/cs_reflector/cs_reflector_event_buf.h

cs_reflector_event_buf_get_next_unindicated#

cs_event_data_t * cs_reflector_event_buf_get_next_unindicated (const uint8_t conn_handle)
Parameters
[in]conn_handle

the connection handle for which the data is requested

Find a pointer to the next available data which we haven't sent an indication about for a given connection.

Returns

  • pointer to the result if available, NULL if none available


Definition at line 115 of file common/cs_reflector/cs_reflector_event_buf.h

Macro Definition Documentation#

CS_REFLECTOR_MAX_CONNECTIONS#

#define CS_REFLECTOR_MAX_CONNECTIONS
Value:
SL_BT_CONFIG_MAX_CONNECTIONS

Definition at line 41 of file common/cs_reflector/config/cs_reflector_config.h

CS_REFLECTOR_CS_EVENT_BUF_SIZE#

#define CS_REFLECTOR_CS_EVENT_BUF_SIZE
Value:
(16)

Definition at line 50 of file common/cs_reflector/config/cs_reflector_config.h

CS_REFLECTOR_MIN_TX_POWER_DBM#

#define CS_REFLECTOR_MIN_TX_POWER_DBM
Value:
(-3)

Definition at line 55 of file common/cs_reflector/config/cs_reflector_config.h

CS_REFLECTOR_MAX_TX_POWER_DBM#

#define CS_REFLECTOR_MAX_TX_POWER_DBM
Value:
(20)

Definition at line 60 of file common/cs_reflector/config/cs_reflector_config.h

CS_REFLECTOR_ANTENNA_OFFSET#

#define CS_REFLECTOR_ANTENNA_OFFSET
Value:
0

Definition at line 66 of file common/cs_reflector/config/cs_reflector_config.h

CS_REFLECTOR_LOG#

#define CS_REFLECTOR_LOG
Value:
1

Definition at line 71 of file common/cs_reflector/config/cs_reflector_config.h

CS_REFLECTOR_LOG_PREFIX#

#define CS_REFLECTOR_LOG_PREFIX
Value:
"[Reflector]"

Definition at line 76 of file common/cs_reflector/config/cs_reflector_config.h

CS_EVENT_BUF_DATA_MAX_LEN#

#define CS_EVENT_BUF_DATA_MAX_LEN
Value:
256

Definition at line 43 of file common/cs_reflector/cs_reflector_event_buf.h