Lines Matching refs:rsp
130 static void ascs_app_rsp_warn_valid(const struct bt_bap_ascs_rsp *rsp) in ascs_app_rsp_warn_valid() argument
133 switch (rsp->code) { in ascs_app_rsp_warn_valid()
144 LOG_WRN("Invalid application error code: %u", rsp->code); in ascs_app_rsp_warn_valid()
149 switch (rsp->code) { in ascs_app_rsp_warn_valid()
154 if (rsp->reason != BT_BAP_ASCS_REASON_NONE) { in ascs_app_rsp_warn_valid()
155 LOG_WRN("Invalid reason %u for code %u", rsp->reason, rsp->code); in ascs_app_rsp_warn_valid()
160 if (!IN_RANGE(rsp->reason, BT_BAP_ASCS_REASON_NONE, BT_BAP_ASCS_REASON_CIS)) { in ascs_app_rsp_warn_valid()
161 LOG_WRN("Invalid reason %u for code %u", rsp->reason, rsp->code); in ascs_app_rsp_warn_valid()
166 if (!BT_AUDIO_METADATA_TYPE_IS_KNOWN(rsp->metadata_type)) { in ascs_app_rsp_warn_valid()
167 LOG_WRN("Invalid metadata type %u for code %u", rsp->metadata_type, in ascs_app_rsp_warn_valid()
168 rsp->code); in ascs_app_rsp_warn_valid()
1130 struct bt_ascs_cp_rsp *rsp; in ascs_cp_rsp_init() local
1134 rsp = net_buf_simple_add(&cp_rsp_buf, sizeof(*rsp)); in ascs_cp_rsp_init()
1135 rsp->op = op; in ascs_cp_rsp_init()
1136 rsp->num_ase = 0; in ascs_cp_rsp_init()
1142 struct bt_ascs_cp_rsp *rsp = (void *)cp_rsp_buf.__buf; in ascs_cp_rsp_add() local
1148 if (rsp->num_ase == BT_ASCS_UNSUPP_OR_LENGTH_ERR_NUM_ASE) { in ascs_cp_rsp_add()
1158 rsp->num_ase = BT_ASCS_UNSUPP_OR_LENGTH_ERR_NUM_ASE; in ascs_cp_rsp_add()
1161 rsp->num_ase++; in ascs_cp_rsp_add()
1176 static int ase_release(struct bt_ascs_ase *ase, uint8_t reason, struct bt_bap_ascs_rsp *rsp) in ase_release() argument
1183 *rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_INVALID_ASE_STATE, in ase_release()
1189 *rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_UNSPECIFIED, in ase_release()
1194 err = unicast_server_cb->release(ase->ep.stream, rsp); in ase_release()
1196 if (rsp->code == BT_BAP_ASCS_RSP_CODE_SUCCESS) { in ase_release()
1197 *rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_UNSPECIFIED, in ase_release()
1201 LOG_ERR("Release failed: err %d, code %u, reason %u", err, rsp->code, rsp->reason); in ase_release()
1210 *rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_SUCCESS, BT_BAP_ASCS_REASON_NONE); in ase_release()
1227 static int ase_disable(struct bt_ascs_ase *ase, uint8_t reason, struct bt_bap_ascs_rsp *rsp) in ase_disable() argument
1245 *rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_INVALID_ASE_STATE, in ase_disable()
1253 *rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_UNSPECIFIED, BT_BAP_ASCS_REASON_NONE); in ase_disable()
1257 err = unicast_server_cb->disable(stream, rsp); in ase_disable()
1259 if (rsp->code == BT_BAP_ASCS_RSP_CODE_SUCCESS) { in ase_disable()
1260 *rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_UNSPECIFIED, in ase_disable()
1264 LOG_ERR("Disable failed: err %d, code %u, reason %u", err, rsp->code, rsp->reason); in ase_disable()
1280 *rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_SUCCESS, BT_BAP_ASCS_REASON_NONE); in ase_disable()
1513 uint8_t *cc, uint8_t len, struct bt_bap_ascs_rsp *rsp) in ascs_ep_set_codec() argument
1523 *rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_CONF_INVALID, in ascs_ep_set_codec()
1539 *rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_CONF_INVALID, in ascs_ep_set_codec()
1551 *rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_SUCCESS, BT_BAP_ASCS_REASON_NONE); in ascs_ep_set_codec()
1560 struct bt_bap_ascs_rsp rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_SUCCESS, in ase_config() local
1614 &rsp); in ase_config()
1616 ascs_app_rsp_warn_valid(&rsp); in ase_config()
1618 ascs_cp_rsp_add(ASE_ID(ase), rsp.code, rsp.reason); in ase_config()
1627 &rsp); in ase_config()
1630 rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_UNSPECIFIED, in ase_config()
1645 ascs_app_rsp_warn_valid(&rsp); in ase_config()
1647 if (rsp.code == BT_BAP_ASCS_RSP_CODE_SUCCESS) { in ase_config()
1648 rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_UNSPECIFIED, in ase_config()
1653 err, rsp.code, rsp.reason); in ase_config()
1656 ascs_cp_rsp_add(ASE_ID(ase), rsp.code, rsp.reason); in ase_config()
1668 &ase->ep.qos_pref, &rsp); in ase_config()
1671 rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_UNSPECIFIED, in ase_config()
1686 ascs_app_rsp_warn_valid(&rsp); in ase_config()
1688 if (rsp.code == BT_BAP_ASCS_RSP_CODE_SUCCESS) { in ase_config()
1689 rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_UNSPECIFIED, in ase_config()
1694 err, stream, rsp.code, rsp.reason); in ase_config()
1697 ascs_cp_rsp_add(ASE_ID(ase), rsp.code, rsp.reason); in ase_config()
1937 struct bt_bap_qos_cfg *qos, struct bt_bap_ascs_rsp *rsp) in ase_qos() argument
1954 *rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_INVALID_ASE_STATE, in ase_qos()
1962 *rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_UNSPECIFIED, BT_BAP_ASCS_REASON_NONE); in ase_qos()
1968 *rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_UNSPECIFIED, BT_BAP_ASCS_REASON_NONE); in ase_qos()
1972 rsp->reason = bt_audio_verify_qos(qos); in ase_qos()
1973 if (rsp->reason != BT_BAP_ASCS_REASON_NONE) { in ase_qos()
1974 rsp->code = BT_BAP_ASCS_RSP_CODE_CONF_INVALID; in ase_qos()
1978 rsp->reason = bt_bap_stream_verify_qos(stream, qos); in ase_qos()
1979 if (rsp->reason != BT_BAP_ASCS_REASON_NONE) { in ase_qos()
1980 rsp->code = BT_BAP_ASCS_RSP_CODE_CONF_INVALID; in ase_qos()
1985 int err = unicast_server_cb->qos(stream, qos, rsp); in ase_qos()
1988 if (rsp->code == BT_BAP_ASCS_RSP_CODE_SUCCESS) { in ase_qos()
1989 *rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_UNSPECIFIED, in ase_qos()
1994 err, rsp->code, rsp->reason); in ase_qos()
2010 *rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_NO_MEM, in ase_qos()
2019 *rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_CONF_INVALID, in ase_qos()
2043 *rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_SUCCESS, BT_BAP_ASCS_REASON_NONE); in ase_qos()
2095 struct bt_bap_ascs_rsp rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_UNSPECIFIED, in ascs_qos() local
2128 ase_qos(ase, qos->cig, qos->cis, &cqos, &rsp); in ascs_qos()
2129 ascs_cp_rsp_add(qos->ase, rsp.code, rsp.reason); in ascs_qos()
2138 struct bt_bap_ascs_rsp *rsp; member
2169 *result->rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_METADATA_INVALID, in ascs_parse_metadata()
2177 *result->rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_METADATA_INVALID, in ascs_parse_metadata()
2188 *result->rsp = BT_BAP_ASCS_RSP( in ascs_parse_metadata()
2199 *result->rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_METADATA_INVALID, in ascs_parse_metadata()
2232 *result->rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_METADATA_INVALID, in ascs_parse_metadata()
2243 *result->rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_METADATA_INVALID, in ascs_parse_metadata()
2254 *result->rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_METADATA_INVALID, in ascs_parse_metadata()
2269 struct bt_bap_ascs_rsp *rsp) in ascs_verify_metadata() argument
2274 .rsp = rsp, in ascs_verify_metadata()
2283 *rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_NO_MEM, BT_BAP_ASCS_REASON_NONE); in ascs_verify_metadata()
2295 *rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_METADATA_INVALID, in ascs_verify_metadata()
2308 struct bt_bap_ascs_rsp rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_SUCCESS, in ase_metadata() local
2333 err = ascs_verify_metadata(ep, meta, &rsp); in ase_metadata()
2339 err = unicast_server_cb->metadata(stream, meta->data, meta->len, &rsp); in ase_metadata()
2342 rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_UNSPECIFIED, in ase_metadata()
2347 ascs_app_rsp_warn_valid(&rsp); in ase_metadata()
2349 if (rsp.code == BT_BAP_ASCS_RSP_CODE_SUCCESS) { in ase_metadata()
2350 rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_UNSPECIFIED, in ase_metadata()
2354 LOG_ERR("Metadata failed: err %d, code %u, reason %u", err, rsp.code, rsp.reason); in ase_metadata()
2355 ascs_cp_rsp_add(ASE_ID(ase), rsp.code, rsp.reason); in ase_metadata()
2371 struct bt_bap_ascs_rsp rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_SUCCESS, in ase_enable() local
2390 err = ascs_verify_metadata(ep, meta, &rsp); in ase_enable()
2396 err = unicast_server_cb->enable(stream, meta->data, meta->len, &rsp); in ase_enable()
2399 rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_UNSPECIFIED, in ase_enable()
2404 ascs_app_rsp_warn_valid(&rsp); in ase_enable()
2406 if (rsp.code == BT_BAP_ASCS_RSP_CODE_SUCCESS) { in ase_enable()
2407 rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_UNSPECIFIED, in ase_enable()
2411 LOG_ERR("Enable rejected: err %d, code %u, reason %u", err, rsp.code, rsp.reason); in ase_enable()
2412 ascs_cp_rsp_add(ASE_ID(ase), rsp.code, rsp.reason); in ase_enable()
2515 struct bt_bap_ascs_rsp rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_SUCCESS, in ase_start() local
2543 err = unicast_server_cb->start(ep->stream, &rsp); in ase_start()
2546 rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_UNSPECIFIED, in ase_start()
2551 ascs_app_rsp_warn_valid(&rsp); in ase_start()
2553 if (rsp.code == BT_BAP_ASCS_RSP_CODE_SUCCESS) { in ase_start()
2554 rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_UNSPECIFIED, in ase_start()
2558 LOG_ERR("Start failed: err %d, code %u, reason %u", err, rsp.code, rsp.reason); in ase_start()
2559 ascs_cp_rsp_add(ASE_ID(ase), rsp.code, rsp.reason); in ase_start()
2693 struct bt_bap_ascs_rsp rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_UNSPECIFIED, in ascs_disable() local
2717 ase_disable(ase, BT_HCI_ERR_REMOTE_USER_TERM_CONN, &rsp); in ascs_disable()
2718 ascs_cp_rsp_add(id, rsp.code, rsp.reason); in ascs_disable()
2728 struct bt_bap_ascs_rsp rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_SUCCESS, in ase_stop() local
2745 err = unicast_server_cb->stop(stream, &rsp); in ase_stop()
2748 rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_UNSPECIFIED, in ase_stop()
2753 ascs_app_rsp_warn_valid(&rsp); in ase_stop()
2755 if (rsp.code == BT_BAP_ASCS_RSP_CODE_SUCCESS) { in ase_stop()
2756 rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_UNSPECIFIED, in ase_stop()
2760 LOG_ERR("Stop failed: err %d, code %u, reason %u", err, rsp.code, rsp.reason); in ase_stop()
2761 ascs_cp_rsp_add(ASE_ID(ase), rsp.code, rsp.reason); in ase_stop()
2999 struct bt_bap_ascs_rsp rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_UNSPECIFIED, in ascs_release() local
3023 ase_release(ase, BT_HCI_ERR_REMOTE_USER_TERM_CONN, &rsp); in ascs_release()
3024 ascs_cp_rsp_add(id, rsp.code, rsp.reason); in ascs_release()