@@ -88,62 +88,24 @@ enum bt_le_cs_test_cs_sync_antenna_selection {
8888 BT_LE_CS_TEST_CS_SYNC_ANTENNA_SELECTION_FOUR = BT_HCI_OP_LE_CS_ANTENNA_SEL_FOUR ,
8989};
9090
91- /** CS Test Tone Antennna Config Selection.
92- *
93- * These enum values are indices in the following table, where N_AP is the maximum
94- * number of antenna paths (in the range [1, 4]).
95- *
96- * +--------------+-------------+-------------------+-------------------+--------+
97- * | Config Index | Total Paths | Dev A: # Antennas | Dev B: # Antennas | Config |
98- * +--------------+-------------+-------------------+-------------------+--------+
99- * | 0 | 1 | 1 | 1 | 1:1 |
100- * | 1 | 2 | 2 | 1 | N_AP:1 |
101- * | 2 | 3 | 3 | 1 | N_AP:1 |
102- * | 3 | 4 | 4 | 1 | N_AP:1 |
103- * | 4 | 2 | 1 | 2 | 1:N_AP |
104- * | 5 | 3 | 1 | 3 | 1:N_AP |
105- * | 6 | 4 | 1 | 4 | 1:N_AP |
106- * | 7 | 4 | 2 | 2 | 2:2 |
107- * +--------------+-------------+-------------------+-------------------+--------+
108- *
109- * There are therefore four groups of possible antenna configurations:
110- *
111- * - 1:1 configuration, where both A and B support 1 antenna each
112- * - 1:N_AP configuration, where A supports 1 antenna, B supports N_AP antennas, and
113- * N_AP is a value in the range [2, 4]
114- * - N_AP:1 configuration, where A supports N_AP antennas, B supports 1 antenna, and
115- * N_AP is a value in the range [2, 4]
116- * - 2:2 configuration, where both A and B support 2 antennas and N_AP = 4
117- */
118- enum bt_le_cs_test_tone_antenna_config_selection {
119- BT_LE_CS_TEST_TONE_ANTENNA_CONFIGURATION_INDEX_ONE = BT_HCI_OP_LE_CS_TEST_ACI_0 ,
120- BT_LE_CS_TEST_TONE_ANTENNA_CONFIGURATION_INDEX_TWO = BT_HCI_OP_LE_CS_TEST_ACI_1 ,
121- BT_LE_CS_TEST_TONE_ANTENNA_CONFIGURATION_INDEX_THREE = BT_HCI_OP_LE_CS_TEST_ACI_2 ,
122- BT_LE_CS_TEST_TONE_ANTENNA_CONFIGURATION_INDEX_FOUR = BT_HCI_OP_LE_CS_TEST_ACI_3 ,
123- BT_LE_CS_TEST_TONE_ANTENNA_CONFIGURATION_INDEX_FIVE = BT_HCI_OP_LE_CS_TEST_ACI_4 ,
124- BT_LE_CS_TEST_TONE_ANTENNA_CONFIGURATION_INDEX_SIX = BT_HCI_OP_LE_CS_TEST_ACI_5 ,
125- BT_LE_CS_TEST_TONE_ANTENNA_CONFIGURATION_INDEX_SEVEN = BT_HCI_OP_LE_CS_TEST_ACI_6 ,
126- BT_LE_CS_TEST_TONE_ANTENNA_CONFIGURATION_INDEX_EIGHT = BT_HCI_OP_LE_CS_TEST_ACI_7 ,
127- };
128-
12991/** CS Test Initiator SNR control options */
130- enum bt_le_cs_test_initiator_snr_control {
131- BT_LE_CS_TEST_INITIATOR_SNR_CONTROL_18dB = BT_HCI_OP_LE_CS_TEST_INITIATOR_SNR_18 ,
132- BT_LE_CS_TEST_INITIATOR_SNR_CONTROL_21dB = BT_HCI_OP_LE_CS_TEST_INITIATOR_SNR_21 ,
133- BT_LE_CS_TEST_INITIATOR_SNR_CONTROL_24dB = BT_HCI_OP_LE_CS_TEST_INITIATOR_SNR_24 ,
134- BT_LE_CS_TEST_INITIATOR_SNR_CONTROL_27dB = BT_HCI_OP_LE_CS_TEST_INITIATOR_SNR_27 ,
135- BT_LE_CS_TEST_INITIATOR_SNR_CONTROL_30dB = BT_HCI_OP_LE_CS_TEST_INITIATOR_SNR_30 ,
136- BT_LE_CS_TEST_INITIATOR_SNR_CONTROL_NOT_USED = BT_HCI_OP_LE_CS_TEST_INITIATOR_SNR_NOT_USED ,
92+ enum bt_le_cs_initiator_snr_control {
93+ BT_LE_CS_INITIATOR_SNR_CONTROL_18dB = BT_HCI_OP_LE_CS_INITIATOR_SNR_18 ,
94+ BT_LE_CS_INITIATOR_SNR_CONTROL_21dB = BT_HCI_OP_LE_CS_INITIATOR_SNR_21 ,
95+ BT_LE_CS_INITIATOR_SNR_CONTROL_24dB = BT_HCI_OP_LE_CS_INITIATOR_SNR_24 ,
96+ BT_LE_CS_INITIATOR_SNR_CONTROL_27dB = BT_HCI_OP_LE_CS_INITIATOR_SNR_27 ,
97+ BT_LE_CS_INITIATOR_SNR_CONTROL_30dB = BT_HCI_OP_LE_CS_INITIATOR_SNR_30 ,
98+ BT_LE_CS_INITIATOR_SNR_CONTROL_NOT_USED = BT_HCI_OP_LE_CS_INITIATOR_SNR_NOT_USED ,
13799};
138100
139101/** CS Test Reflector SNR control options */
140- enum bt_le_cs_test_reflector_snr_control {
141- BT_LE_CS_TEST_REFLECTOR_SNR_CONTROL_18dB = BT_HCI_OP_LE_CS_TEST_REFLECTOR_SNR_18 ,
142- BT_LE_CS_TEST_REFLECTOR_SNR_CONTROL_21dB = BT_HCI_OP_LE_CS_TEST_REFLECTOR_SNR_21 ,
143- BT_LE_CS_TEST_REFLECTOR_SNR_CONTROL_24dB = BT_HCI_OP_LE_CS_TEST_REFLECTOR_SNR_24 ,
144- BT_LE_CS_TEST_REFLECTOR_SNR_CONTROL_27dB = BT_HCI_OP_LE_CS_TEST_REFLECTOR_SNR_27 ,
145- BT_LE_CS_TEST_REFLECTOR_SNR_CONTROL_30dB = BT_HCI_OP_LE_CS_TEST_REFLECTOR_SNR_30 ,
146- BT_LE_CS_TEST_REFLECTOR_SNR_CONTROL_NOT_USED = BT_HCI_OP_LE_CS_TEST_REFLECTOR_SNR_NOT_USED ,
102+ enum bt_le_cs_reflector_snr_control {
103+ BT_LE_CS_REFLECTOR_SNR_CONTROL_18dB = BT_HCI_OP_LE_CS_REFLECTOR_SNR_18 ,
104+ BT_LE_CS_REFLECTOR_SNR_CONTROL_21dB = BT_HCI_OP_LE_CS_REFLECTOR_SNR_21 ,
105+ BT_LE_CS_REFLECTOR_SNR_CONTROL_24dB = BT_HCI_OP_LE_CS_REFLECTOR_SNR_24 ,
106+ BT_LE_CS_REFLECTOR_SNR_CONTROL_27dB = BT_HCI_OP_LE_CS_REFLECTOR_SNR_27 ,
107+ BT_LE_CS_REFLECTOR_SNR_CONTROL_30dB = BT_HCI_OP_LE_CS_REFLECTOR_SNR_30 ,
108+ BT_LE_CS_REFLECTOR_SNR_CONTROL_NOT_USED = BT_HCI_OP_LE_CS_REFLECTOR_SNR_NOT_USED ,
147109};
148110
149111/** CS Test Override 3 T_PM Tone Extension */
@@ -400,11 +362,11 @@ struct bt_le_cs_test_param {
400362 /** Antenna Configuration Index used during antenna switching during
401363 * the tone phases of CS steps.
402364 */
403- enum bt_le_cs_test_tone_antenna_config_selection tone_antenna_config_selection ;
365+ enum bt_conn_le_cs_tone_antenna_config_selection tone_antenna_config_selection ;
404366 /** Initiator SNR control options */
405- enum bt_le_cs_test_initiator_snr_control initiator_snr_control ;
367+ enum bt_le_cs_initiator_snr_control initiator_snr_control ;
406368 /** Reflector SNR control options */
407- enum bt_le_cs_test_reflector_snr_control reflector_snr_control ;
369+ enum bt_le_cs_reflector_snr_control reflector_snr_control ;
408370 /** Determines octets 14 and 15 of the initial value of the DRBG nonce. */
409371 uint16_t drbg_nonce ;
410372
@@ -736,6 +698,178 @@ void bt_le_cs_step_data_parse(struct net_buf_simple *step_data_buf,
736698 bool (* func )(struct bt_le_cs_subevent_step * step , void * user_data ),
737699 void * user_data );
738700
701+ /** @brief CS Security Enable
702+ *
703+ * This commmand is used to start or restart the Channel Sounding Security
704+ * Start procedure in the local Controller for the ACL connection identified
705+ * in the conn parameter.
706+ *
707+ * @note To use this API @kconfig{CONFIG_BT_CHANNEL_SOUNDING} must be set.
708+ *
709+ * @param conn Connection Object.
710+ *
711+ * @return Zero on success or (negative) error code on failure.
712+ */
713+ int bt_le_cs_security_enable (struct bt_conn * conn );
714+
715+ struct bt_le_cs_procedure_enable_param {
716+ uint8_t config_id ;
717+ enum bt_conn_le_cs_procedure_enable_state enable ;
718+ };
719+
720+ /** @brief CS Procedure Enable
721+ *
722+ * This command is used to enable or disable the scheduling of CS procedures
723+ * by the local Controller, with the remote device identified in the conn
724+ * parameter.
725+ *
726+ * @note To use this API @kconfig{CONFIG_BT_CHANNEL_SOUNDING} must be set.
727+ *
728+ * @param conn Connection Object.
729+ * @param params Parameters for the CS Procedure Enable command.
730+ *
731+ * @return Zero on success or (negative) error code on failure.
732+ */
733+ int bt_le_cs_procedure_enable (struct bt_conn * conn ,
734+ const struct bt_le_cs_procedure_enable_param * params );
735+
736+ enum bt_le_cs_procedure_phy {
737+ BT_LE_CS_PROCEDURE_PHY_1M = BT_HCI_OP_LE_CS_PROCEDURE_PHY_1M ,
738+ BT_LE_CS_PROCEUDRE_PHY_2M = BT_HCI_OP_LE_CS_PROCEDURE_PHY_2M ,
739+ BT_LE_CS_PROCEDURE_PHY_CODED_S8 = BT_HCI_OP_LE_CS_PROCEDURE_PHY_CODED_S8 ,
740+ BT_LE_CS_PROCEDURE_PHY_CODED_S2 = BT_HCI_OP_LE_CS_PROCEDURE_PHY_CODED_S2 ,
741+ };
742+
743+ #define BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_1 BIT(0)
744+ #define BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_2 BIT(1)
745+ #define BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_3 BIT(2)
746+ #define BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_4 BIT(3)
747+
748+ struct bt_le_cs_set_procedure_parameters_param {
749+ /* The ID associated with the desired configuration (0 to 3) */
750+ uint8_t config_id ;
751+
752+ /* Max. duration for each CS procedure, where T = N * 0.625 ms (0x0001 to 0xFFFF) */
753+ uint16_t max_procedure_len ;
754+
755+ /* Min. number of connection events between consecutive CS procedures (0x0001 to 0xFFFF) */
756+ uint16_t min_procedure_interval ;
757+
758+ /* Max. number of connection events between consecutive CS procedures (0x0001 to 0xFFFF) */
759+ uint16_t max_procedure_interval ;
760+
761+ /* Max. number of procedures to be scheduled (0x0000 for no limit; otherwise 0x0001
762+ * to 0xFFFF)
763+ */
764+ uint16_t max_procedure_count ;
765+
766+ /* Min. suggested duration for each CS subevent in microseconds (1250 us to 4 s) */
767+ uint32_t min_subevent_len ;
768+
769+ /* Max. suggested duration for each CS subevent in microseconds (1250 us to 4 s) */
770+ uint32_t max_subevent_len ;
771+
772+ /* Antenna configuration index */
773+ enum bt_conn_le_cs_tone_antenna_config_selection tone_antenna_config_selection ;
774+
775+ /* Phy */
776+ enum bt_le_cs_procedure_phy phy ;
777+
778+ /* Transmit power delta, in signed dB, to indicate the recommended difference between the
779+ * remote device's power level for the CS tones and RTT packets and the existing power
780+ * level for the Phy indicated by the Phy parameter (0x80 for no recommendation)
781+ */
782+ int8_t tx_power_delta ;
783+
784+ /* Preferred peer antenna (Bitmask of BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_*) */
785+ uint8_t preferred_peer_antenna ;
786+
787+ /* Initiator SNR control adjustment */
788+ enum bt_le_cs_initiator_snr_control snr_control_initiator ;
789+
790+ /* Reflector SNR control adjustment */
791+ enum bt_le_cs_reflector_snr_control snr_control_reflector ;
792+ };
793+
794+ /** @brief CS Set Procedure Parameters
795+ *
796+ * This command is used to set the parameters for the scheduling of one
797+ * or more CS procedures by the local controller.
798+ *
799+ * @note To use this API @kconfig{CONFIG_BT_CHANNEL_SOUNDING} must be set.
800+ *
801+ * @param conn Connection Object.
802+ * @param params Parameters for the CS Set Procedure Parameters command.
803+ *
804+ * @return Zero on success or (negative) error code on failure.
805+ */
806+ int bt_le_cs_set_procedure_parameters (struct bt_conn * conn ,
807+ const struct bt_le_cs_set_procedure_parameters_param * params );
808+
809+ /** @brief CS Set Channel Classification
810+ *
811+ * This command is used to update the channel classification based on
812+ * its local information.
813+ *
814+ * The nth bitfield (in the range 0 to 78) contains the value for the CS
815+ * channel index n. Channel Enabled = 1; Channel Disabled = 0.
816+ *
817+ * Channels n = 0, 1, 23, 24, 25, 77, and 78 shall be reserved for future
818+ * use and shall be set to zero. At least 15 channels shall be enabled.
819+ *
820+ * The most significant bit (bit 79) is reserved for future use.
821+ *
822+ * @note To use this API, @kconfig{CONFIG_BT_CHANNEL_SOUNDING} must be set.
823+ *
824+ * @param channel_classification Bit fields
825+ *
826+ * @return Zero on success or (negative) error code on failure.
827+ */
828+ int bt_le_cs_set_channel_classification (uint8_t channel_classification [10 ]);
829+
830+ /** @brief CS Read Local Supported Capabilities
831+ *
832+ * This command is used to read the CS capabilities that are supported
833+ * by the local Controller.
834+ *
835+ * @note To use this API @kconfig{CONFIG_BT_CHANNEL_SOUNDING} must be set.
836+ *
837+ * @param ret Return values for the CS Procedure Enable command.
838+ *
839+ * @return Zero on success or (negative) error code on failure.
840+ */
841+ int bt_le_cs_read_local_supported_capabilities (struct bt_conn_le_cs_capabilities * ret );
842+
843+ /** @brief CS Write Cached Remote Supported Capabilities
844+ *
845+ * This command is used to write the cached copy of the CS capabilities
846+ * that are supported by the remote Controller for the connection
847+ * identified.
848+ *
849+ * @note To use this API @kconfig{CONFIG_BT_CHANNEL_SOUNDING} must be set.
850+ *
851+ * @param conn Connection Object.
852+ * @param params Parameters for the CS Write Cached Remote Supported Capabilities command.
853+ *
854+ * @return Zero on success or (negative) error code on failure.
855+ */
856+ int bt_le_cs_write_cached_remote_supported_capabilities (
857+ struct bt_conn * conn , const struct bt_conn_le_cs_capabilities * params );
858+
859+ /** @brief CS Write Cached Remote FAE Table
860+ *
861+ * This command is used to write a cached copy of the per-channel mode-0
862+ * Frequency Actuation Error table of the remote device in the local Controller.
863+ *
864+ * @note To use this API @kconfig{CONFIG_BT_CHANNEL_SOUNDING} must be set.
865+ *
866+ * @param conn Connection Object.
867+ * @param remote_fae_table Per-channel mode-0 FAE table of the local Controller
868+ *
869+ * @return Zero on success or (negative) error code on failure.
870+ */
871+ int bt_le_cs_write_cached_remote_fae_table (struct bt_conn * conn , uint8_t remote_fae_table [72 ]);
872+
739873#ifdef __cplusplus
740874}
741875#endif
0 commit comments