<commit_before>/* @file
 * @brief Internal APIs for ASCS handling

 * Copyright (c) 2020 Intel Corporation
 * Copyright (c) 2022 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: Apache-2.0
 */

/* Response Status Code */
#define BT_ASCS_RSP_SUCCESS              0x00
#define BT_ASCS_RSP_NOT_SUPPORTED        0x01
#define BT_ASCS_RSP_TRUNCATED            0x02
#define BT_ASCS_RSP_INVALID_ASE          0x03
#define BT_ASCS_RSP_INVALID_ASE_STATE    0x04
#define BT_ASCS_RSP_INVALID_DIR          0x05
#define BT_ASCS_RSP_CAP_UNSUPPORTED      0x06
#define BT_ASCS_RSP_CONF_UNSUPPORTED     0x07
#define BT_ASCS_RSP_CONF_REJECTED        0x08
#define BT_ASCS_RSP_CONF_INVALID         0x09
#define BT_ASCS_RSP_METADATA_UNSUPPORTED 0x0a
#define BT_ASCS_RSP_METADATA_REJECTED    0x0b
#define BT_ASCS_RSP_METADATA_INVALID     0x0c
#define BT_ASCS_RSP_NO_MEM               0x0d
#define BT_ASCS_RSP_UNSPECIFIED          0x0e

/* Response Reasons */
#define BT_ASCS_REASON_NONE              0x00
#define BT_ASCS_REASON_CODEC             0x01
#define BT_ASCS_REASON_CODEC_DATA        0x02
#define BT_ASCS_REASON_INTERVAL          0x03
#define BT_ASCS_REASON_FRAMING           0x04
#define BT_ASCS_REASON_PHY               0x05
#define BT_ASCS_REASON_SDU               0x06
#define BT_ASCS_REASON_RTN               0x07
#define BT_ASCS_REASON_LATENCY           0x08
#define BT_ASCS_REASON_PD                0x09
#define BT_ASCS_REASON_CIS               0x0a

/* Transport QoS Packing */
#define BT_ASCS_QOS_PACKING_SEQ          0x00
#define BT_ASCS_QOS_PACKING_INT          0x01

/* Transport QoS Framing */
#define BT_ASCS_QOS_FRAMING_UNFRAMED     0x00
#define BT_ASCS_QOS_FRAMING_FRAMED       0x01

/* Format of the ASE characteristic, defined in Table 4.6 */
struct bt_ascs_ase_status {
	uint8_t  id;
	uint8_t  state;
	uint8_t  params[0];
} __packed;

struct bt_ascs_codec_config {
	uint8_t len;
	uint8_t type;
	uint8_t data[0];
} __packed;

struct bt_ascs_codec {
	uint8_t  id;
	uint16_t cid;
	uint16_t vid;
} __packed;

#define BT_ASCS_PD_NO_PREF 0x00000000

/* ASE_State = 0x01 (Codec Configured), defined in Table 4.7. */
struct bt_ascs_ase_status_config {
	uint8_t  framing;
	uint8_t  phy;
	uint8_t  rtn;
	uint16_t latency;
	uint8_t  pd_min[3];
	uint8_t  pd_max[3];
	uint8_t  prefer_pd_min[3];
	uint8_t  prefer_pd_max[3];
	struct bt_ascs_codec codec;
	uint8_t  cc_len;
	/* LTV-formatted Codec-Specific Configuration */
	struct bt_ascs_codec_config cc[0];
} __packed;

/* ASE_State = 0x02 (QoS Configured), defined in Table 4.8. */
struct bt_ascs_ase_status_qos {
	uint8_t  cig_id;
	uint8_t  cis_id;
	uint8_t  interval[3];
	uint8_t  framing;
	uint8_t  phy;
	uint16_t sdu;
	uint8_t  rtn;
	uint16_t latency;
	uint8_t  pd[3];
} __packed;

/* ASE_Status = 0x03 (Enabling) defined in Table 4.9.
 */
struct bt_ascs_ase_status_enable {
	uint8_t  cig_id;
	uint8_t  cis_id;
	uint8_t  metadata_len;
	uint8_t  metadata[0];
} __packed;

/* ASE_Status =  0x04 (Streaming) defined in Table 4.9.
 */
struct bt_ascs_ase_status_stream {
	uint8_t  cig_id;
	uint8_t  cis_id;
	uint8_t  metadata_len;
	uint8_t  metadata[0];
} __packed;

/* ASE_Status = 0x05 (Disabling) as defined in Table 4.9.
 */
struct bt_ascs_ase_status_disable {
	uint8_t  cig_id;
	uint8_t  cis_id;
	uint8_t  metadata_len;
	uint8_t  metadata[0];<commit_msg>Bluetooth: host: ASCS: Correction code comments<commit_after>/* @file
 * @brief Internal APIs for ASCS handling

 * Copyright (c) 2020 Intel Corporation
 * Copyright (c) 2022 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: Apache-2.0
 */

/* Response Status Code */
#define BT_ASCS_RSP_SUCCESS              0x00
#define BT_ASCS_RSP_NOT_SUPPORTED        0x01
#define BT_ASCS_RSP_TRUNCATED            0x02
#define BT_ASCS_RSP_INVALID_ASE          0x03
#define BT_ASCS_RSP_INVALID_ASE_STATE    0x04
#define BT_ASCS_RSP_INVALID_DIR          0x05
#define BT_ASCS_RSP_CAP_UNSUPPORTED      0x06
#define BT_ASCS_RSP_CONF_UNSUPPORTED     0x07
#define BT_ASCS_RSP_CONF_REJECTED        0x08
#define BT_ASCS_RSP_CONF_INVALID         0x09
#define BT_ASCS_RSP_METADATA_UNSUPPORTED 0x0a
#define BT_ASCS_RSP_METADATA_REJECTED    0x0b
#define BT_ASCS_RSP_METADATA_INVALID     0x0c
#define BT_ASCS_RSP_NO_MEM               0x0d
#define BT_ASCS_RSP_UNSPECIFIED          0x0e

/* Response Reasons */
#define BT_ASCS_REASON_NONE              0x00
#define BT_ASCS_REASON_CODEC             0x01
#define BT_ASCS_REASON_CODEC_DATA        0x02
#define BT_ASCS_REASON_INTERVAL          0x03
#define BT_ASCS_REASON_FRAMING           0x04
#define BT_ASCS_REASON_PHY               0x05
#define BT_ASCS_REASON_SDU               0x06
#define BT_ASCS_REASON_RTN               0x07
#define BT_ASCS_REASON_LATENCY           0x08
#define BT_ASCS_REASON_PD                0x09
#define BT_ASCS_REASON_CIS               0x0a

/* Transport QoS Packing */
#define BT_ASCS_QOS_PACKING_SEQ          0x00
#define BT_ASCS_QOS_PACKING_INT          0x01

/* Transport QoS Framing */
#define BT_ASCS_QOS_FRAMING_UNFRAMED     0x00
#define BT_ASCS_QOS_FRAMING_FRAMED       0x01

/* Format of the ASE characteristic, defined in Table 4.2 */
struct bt_ascs_ase_status {
	uint8_t  id;
	uint8_t  state;
	uint8_t  params[0];
} __packed;

struct bt_ascs_codec_config {
	uint8_t len;
	uint8_t type;
	uint8_t data[0];
} __packed;

struct bt_ascs_codec {
	uint8_t  id;
	uint16_t cid;
	uint16_t vid;
} __packed;

#define BT_ASCS_PD_NO_PREF 0x00000000

/* ASE_State = 0x01 (Codec Configured), defined in Table 4.3. */
struct bt_ascs_ase_status_config {
	uint8_t  framing;
	uint8_t  phy;
	uint8_t  rtn;
	uint16_t latency;
	uint8_t  pd_min[3];
	uint8_t  pd_max[3];
	uint8_t  prefer_pd_min[3];
	uint8_t  prefer_pd_max[3];
	struct bt_ascs_codec codec;
	uint8_t  cc_len;
	/* LTV-formatted Codec-Specific Configuration */
	struct bt_ascs_codec_config cc[0];
} __packed;

/* ASE_State = 0x02 (QoS Configured), defined in Table 4.4. */
struct bt_ascs_ase_status_qos {
	uint8_t  cig_id;
	uint8_t  cis_id;
	uint8_t  interval[3];
	uint8_t  framing;
	uint8_t  phy;
	uint16_t sdu;
	uint8_t  rtn;
	uint16_t latency;
	uint8_t  pd[3];
} __packed;

/* ASE_Status = 0x03 (Enabling) defined in Table 4.5.
 */
struct bt_ascs_ase_status_enable {
	uint8_t  cig_id;
	uint8_t  cis_id;
	uint8_t  metadata_len;
	uint8_t  metadata[0];
} __packed;

/* ASE_Status =  0x04 (Streaming) defined in Table 4.5.
 */
struct bt_ascs_ase_status_stream {
	uint8_t  cig_id;
	uint8_t  cis_id;
	uint8_t  metadata_len;
	uint8_t  metadata[0];
} __packed;

/* ASE_Status = 0x05 (Disabling) as defined in Table 4.5.
 */
struct bt_ascs_ase_status_disable {
	uint8_t  cig_id;
	uint8_t  cis_id;
	uint8_t  metadata_len;
	uint8_t  metadata[0];
{'fraction_non_alphanumeric': 0.06547260686333534, 'fraction_numerical': 0.055990367248645395, 'mean_word_length': 3.514266304347826, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5381048', 'n_tokens_mistral': 3005, 'n_tokens_neox': 2806, 'n_words': 568}