Compare commits

..

1 Commits

Author SHA1 Message Date
huangyulong3 d09c172758 zblue: fix compilation errors
Fix compilation errors in bluetooth classic headers and port layer:
- Add missing declarations in a2dp.h and sdp.h
- Add missing includes in avdtp_internal.h
- Fix defines.c port section issues

Signed-off-by: openvela <openvela@xiaomi.com>
2026-05-08 09:44:38 +08:00
3 changed files with 16 additions and 27 deletions

View File

@ -168,7 +168,6 @@ source "$APPSDIR/external/zblue/zblue/subsys/bluetooth/audio/Kconfig"
config BT_HOST_CRYPTO
bool "Use crypto functionality implemented in the Bluetooth host"
default y if !BT_CTLR_CRYPTO
select CRYPTO_MBEDTLS if !BUILD_WITH_TFM
select MBEDTLS if !BUILD_WITH_TFM
select MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM
select PSA_WANT_KEY_TYPE_AES

View File

@ -3362,9 +3362,7 @@ static void bt_att_connected(struct bt_l2cap_chan *chan)
conn = br_chan->chan.conn;
/* ATT over BR negotiates MTU via L2CAP configuration. */
#if defined(CONFIG_BT_GATT_CLIENT)
atomic_set_bit(chan->conn->flags, BT_CONN_ATT_MTU_EXCHANGED);
#endif
SYS_SLIST_FOR_EACH_CONTAINER(&chan->conn->hdev->att_ctx->conn_cbs, callback, _node) {
if (callback->connected) {

View File

@ -1154,7 +1154,7 @@ static int process_register_notification_rsp(struct bt_avrcp *avrcp, uint8_t tid
return BT_AVRCP_STATUS_INVALID_PARAMETER;
}
break;
case BT_AVRCP_EVT_TRACK_CHANGED: {
case BT_AVRCP_EVT_TRACK_CHANGED:
if (buf->len < sizeof(event_data->identifier)) {
LOG_ERR("Invalid TRACK_CHANGED response length");
return BT_AVRCP_STATUS_INVALID_PARAMETER;
@ -1163,7 +1163,6 @@ static int process_register_notification_rsp(struct bt_avrcp *avrcp, uint8_t tid
memcpy(event_data->identifier, &identifier, sizeof(uint64_t));
break;
}
case BT_AVRCP_EVT_PLAYBACK_POS_CHANGED:
if (buf->len < sizeof(event_data->playback_pos)) {
LOG_ERR("Invalid PLAYBACK_POS_CHANGED response length");
@ -1269,29 +1268,23 @@ static int process_register_notification_rsp(struct bt_avrcp *avrcp, uint8_t tid
}
return BT_AVRCP_STATUS_OPERATION_COMPLETED;
notify_callback:
/* Find the event registered with this TID and clear ONLY that one.
* The braces here form a compound statement so the label is followed
* by a statement (C forbids a declaration directly after a label).
*/
{
uint8_t failed_evt = 0;
bool found = false;
/* Find the event registered with this TID and clear ONLY that one */
uint8_t failed_evt = 0;
bool found = false;
ARRAY_FOR_EACH(ct->ct_notify, i) {
if (ct->ct_notify[i].tid == tid && ct->ct_notify[i].cb != NULL) {
failed_evt = i;
ct->ct_notify[i].cb = NULL;
ct->ct_notify[i].interim_received = 0;
found = true;
break;
}
ARRAY_FOR_EACH(ct->ct_notify, i) {
if (ct->ct_notify[i].tid == tid && ct->ct_notify[i].cb != NULL) {
failed_evt = i;
ct->ct_notify[i].cb = NULL;
ct->ct_notify[i].interim_received = 0;
found = true;
break;
}
avrcp_ct_cb->notification(get_avrcp_ct(avrcp), tid, status,
found ? failed_evt : 0, NULL);
return BT_AVRCP_STATUS_OPERATION_COMPLETED;
}
avrcp_ct_cb->notification(get_avrcp_ct(avrcp), tid, status, found ? failed_evt : 0, NULL);
return BT_AVRCP_STATUS_OPERATION_COMPLETED;
}
static int process_set_absolute_volume_rsp(struct bt_avrcp *avrcp, uint8_t tid,
@ -4338,12 +4331,11 @@ static int build_notification_rsp_data(uint8_t event_id, struct bt_avrcp_event_d
}
net_buf_add_u8(buf, data->play_status);
break;
case BT_AVRCP_EVT_TRACK_CHANGED: {
case BT_AVRCP_EVT_TRACK_CHANGED:
uint64_t identifier = sys_get_be64(data->identifier);
net_buf_add_be64(buf, identifier);
break;
}
case BT_AVRCP_EVT_PLAYBACK_POS_CHANGED:
net_buf_add_be32(buf, data->playback_pos);
break;