@@ -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 */
@@ -351,11 +313,11 @@ struct bt_le_cs_test_param {
351313 /** Antenna Configuration Index used during antenna switching during
352314 * the tone phases of CS steps.
353315 */
354- enum bt_le_cs_test_tone_antenna_config_selection tone_antenna_config_selection ;
316+ enum bt_conn_le_cs_tone_antenna_config_selection tone_antenna_config_selection ;
355317 /** Initiator SNR control options */
356- enum bt_le_cs_test_initiator_snr_control initiator_snr_control ;
318+ enum bt_le_cs_initiator_snr_control initiator_snr_control ;
357319 /** Reflector SNR control options */
358- enum bt_le_cs_test_reflector_snr_control reflector_snr_control ;
320+ enum bt_le_cs_reflector_snr_control reflector_snr_control ;
359321 /** Determines octets 14 and 15 of the initial value of the DRBG nonce. */
360322 uint16_t drbg_nonce ;
361323
@@ -687,6 +649,178 @@ void bt_le_cs_step_data_parse(struct net_buf_simple *step_data_buf,
687649 bool (* func )(struct bt_le_cs_subevent_step * step , void * user_data ),
688650 void * user_data );
689651
652+ /** @brief CS Security Enable
653+ *
654+ * This commmand is used to start or restart the Channel Sounding Security
655+ * Start procedure in the local Controller for the ACL connection identified
656+ * in the conn parameter.
657+ *
658+ * @note To use this API @kconfig{CONFIG_BT_CHANNEL_SOUNDING} must be set.
659+ *
660+ * @param conn Connection Object.
661+ *
662+ * @return Zero on success or (negative) error code on failure.
663+ */
664+ int bt_le_cs_security_enable (struct bt_conn * conn );
665+
666+ struct bt_le_cs_procedure_enable_param {
667+ uint8_t config_id ;
668+ enum bt_conn_le_cs_procedure_enable_state enable ;
669+ };
670+
671+ /** @brief CS Procedure Enable
672+ *
673+ * This command is used to enable or disable the scheduling of CS procedures
674+ * by the local Controller, with the remote device identified in the conn
675+ * parameter.
676+ *
677+ * @note To use this API @kconfig{CONFIG_BT_CHANNEL_SOUNDING} must be set.
678+ *
679+ * @param conn Connection Object.
680+ * @param params Parameters for the CS Procedure Enable command.
681+ *
682+ * @return Zero on success or (negative) error code on failure.
683+ */
684+ int bt_le_cs_procedure_enable (struct bt_conn * conn ,
685+ const struct bt_le_cs_procedure_enable_param * params );
686+
687+ enum bt_le_cs_procedure_phy {
688+ BT_LE_CS_PROCEDURE_PHY_1M = BT_HCI_OP_LE_CS_PROCEDURE_PHY_1M ,
689+ BT_LE_CS_PROCEUDRE_PHY_2M = BT_HCI_OP_LE_CS_PROCEDURE_PHY_2M ,
690+ BT_LE_CS_PROCEDURE_PHY_CODED_S8 = BT_HCI_OP_LE_CS_PROCEDURE_PHY_CODED_S8 ,
691+ BT_LE_CS_PROCEDURE_PHY_CODED_S2 = BT_HCI_OP_LE_CS_PROCEDURE_PHY_CODED_S2 ,
692+ };
693+
694+ #define BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_1 BIT(0)
695+ #define BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_2 BIT(1)
696+ #define BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_3 BIT(2)
697+ #define BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_4 BIT(3)
698+
699+ struct bt_le_cs_set_procedure_parameters_param {
700+ /* The ID associated with the desired configuration (0 to 3) */
701+ uint8_t config_id ;
702+
703+ /* Max. duration for each CS procedure, where T = N * 0.625 ms (0x0001 to 0xFFFF) */
704+ uint16_t max_procedure_len ;
705+
706+ /* Min. number of connection events between consecutive CS procedures (0x0001 to 0xFFFF) */
707+ uint16_t min_procedure_interval ;
708+
709+ /* Max. number of connection events between consecutive CS procedures (0x0001 to 0xFFFF) */
710+ uint16_t max_procedure_interval ;
711+
712+ /* Max. number of procedures to be scheduled (0x0000 for no limit; otherwise 0x0001
713+ * to 0xFFFF)
714+ */
715+ uint16_t max_procedure_count ;
716+
717+ /* Min. suggested duration for each CS subevent in microseconds (1250 us to 4 s) */
718+ uint32_t min_subevent_len ;
719+
720+ /* Max. suggested duration for each CS subevent in microseconds (1250 us to 4 s) */
721+ uint32_t max_subevent_len ;
722+
723+ /* Antenna configuration index */
724+ enum bt_conn_le_cs_tone_antenna_config_selection tone_antenna_config_selection ;
725+
726+ /* Phy */
727+ enum bt_le_cs_procedure_phy phy ;
728+
729+ /* Transmit power delta, in signed dB, to indicate the recommended difference between the
730+ * remote device's power level for the CS tones and RTT packets and the existing power
731+ * level for the Phy indicated by the Phy parameter (0x80 for no recommendation)
732+ */
733+ int8_t tx_power_delta ;
734+
735+ /* Preferred peer antenna (Bitmask of BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_*) */
736+ uint8_t preferred_peer_antenna ;
737+
738+ /* Initiator SNR control adjustment */
739+ enum bt_le_cs_initiator_snr_control snr_control_initiator ;
740+
741+ /* Reflector SNR control adjustment */
742+ enum bt_le_cs_reflector_snr_control snr_control_reflector ;
743+ };
744+
745+ /** @brief CS Set Procedure Parameters
746+ *
747+ * This command is used to set the parameters for the scheduling of one
748+ * or more CS procedures by the local controller.
749+ *
750+ * @note To use this API @kconfig{CONFIG_BT_CHANNEL_SOUNDING} must be set.
751+ *
752+ * @param conn Connection Object.
753+ * @param params Parameters for the CS Set Procedure Parameters command.
754+ *
755+ * @return Zero on success or (negative) error code on failure.
756+ */
757+ int bt_le_cs_set_procedure_parameters (struct bt_conn * conn ,
758+ const struct bt_le_cs_set_procedure_parameters_param * params );
759+
760+ /** @brief CS Set Channel Classification
761+ *
762+ * This command is used to update the channel classification based on
763+ * its local information.
764+ *
765+ * The nth bitfield (in the range 0 to 78) contains the value for the CS
766+ * channel index n. Channel Enabled = 1; Channel Disabled = 0.
767+ *
768+ * Channels n = 0, 1, 23, 24, 25, 77, and 78 shall be reserved for future
769+ * use and shall be set to zero. At least 15 channels shall be enabled.
770+ *
771+ * The most significant bit (bit 79) is reserved for future use.
772+ *
773+ * @note To use this API, @kconfig{CONFIG_BT_CHANNEL_SOUNDING} must be set.
774+ *
775+ * @param channel_classification Bit fields
776+ *
777+ * @return Zero on success or (negative) error code on failure.
778+ */
779+ int bt_le_cs_set_channel_classification (uint8_t channel_classification [10 ]);
780+
781+ /** @brief CS Read Local Supported Capabilities
782+ *
783+ * This command is used to read the CS capabilities that are supported
784+ * by the local Controller.
785+ *
786+ * @note To use this API @kconfig{CONFIG_BT_CHANNEL_SOUNDING} must be set.
787+ *
788+ * @param ret Return values for the CS Procedure Enable command.
789+ *
790+ * @return Zero on success or (negative) error code on failure.
791+ */
792+ int bt_le_cs_read_local_supported_capabilities (struct bt_conn_le_cs_capabilities * ret );
793+
794+ /** @brief CS Write Cached Remote Supported Capabilities
795+ *
796+ * This command is used to write the cached copy of the CS capabilities
797+ * that are supported by the remote Controller for the connection
798+ * identified.
799+ *
800+ * @note To use this API @kconfig{CONFIG_BT_CHANNEL_SOUNDING} must be set.
801+ *
802+ * @param conn Connection Object.
803+ * @param params Parameters for the CS Write Cached Remote Supported Capabilities command.
804+ *
805+ * @return Zero on success or (negative) error code on failure.
806+ */
807+ int bt_le_cs_write_cached_remote_supported_capabilities (
808+ struct bt_conn * conn , const struct bt_conn_le_cs_capabilities * params );
809+
810+ /** @brief CS Write Cached Remote FAE Table
811+ *
812+ * This command is used to write a cached copy of the per-channel mode-0
813+ * Frequency Actuation Error table of the remote device in the local Controller.
814+ *
815+ * @note To use this API @kconfig{CONFIG_BT_CHANNEL_SOUNDING} must be set.
816+ *
817+ * @param conn Connection Object.
818+ * @param remote_fae_table Per-channel mode-0 FAE table of the local Controller
819+ *
820+ * @return Zero on success or (negative) error code on failure.
821+ */
822+ int bt_le_cs_write_cached_remote_fae_table (struct bt_conn * conn , uint8_t remote_fae_table [72 ]);
823+
690824#ifdef __cplusplus
691825}
692826#endif
0 commit comments