Commit Graph

152 Commits

Author SHA1 Message Date
Lu Jia 83d3c9933c cs : Add cs_set_config command to set RAS supported configuration and fix compilation warnings.
bug: v/87425

Signed-off-by: jialu <jialu@xiaomi.com>
2026-04-27 23:14:55 +08:00
zhangyuan20 a8fa3ba64d CS: add cs socket server and client.
bug: v/80281

Rootcause: Add a socket server and client to enable communication between the user and Bluetooth.

Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2026-04-27 23:14:55 +08:00
chengkai 1309b694c3 bluetooth: add spp insecure feature
bug: v/13885

Signed-off-by: chengkai <chengkai@xiaomi.com>
2026-04-27 23:14:54 +08:00
liuxiang18 2244e388f7 aync adv/scan: fix build error
bug: v/83666

The callback macro `CALLBACK_REMOTE` currently used in gatts/gattc employs the member variable `callbacks`. For enhanced versatility, the callback member variables in adv and scan have been modified from `callback` to `callbacks`.

Signed-off-by: liuxiang18 <liuxiang18@xiaomi.com>
2026-04-27 23:14:54 +08:00
liuxiang18 9f1317ecb0 adv/scan: rename member variables callback as callbacks
bug: v/83666

The callback macro `CALLBACK_REMOTE` currently used in gatts/gattc employs the member variable `callbacks`. For enhanced versatility, the callback member variables in adv and scan have been modified from `callback` to `callbacks`.

Signed-off-by: liuxiang18 <liuxiang18@xiaomi.com>
2026-04-27 23:14:54 +08:00
chengkai d7a276c5a7 bluetooth: add gatts_connect_bear api [1/2]
bug: v/51103

Signed-off-by: chengkai <chengkai@xiaomi.com>
2026-04-27 23:14:53 +08:00
YuhengLi 2e7c5c3fda Android-Vela:add cind interface for android
bug: v/59050

Rootcause:When reconnect to the headset during a call, the headset will obtain the call status through the cind command. Since Vela does not have modem, the status will be error. So, get cind from Android.

Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2026-04-27 23:14:53 +08:00
Lu Jia e0699b4797 bluetooth: Before releasing the IPC pending_queue, invoke the asynchronous callbacks for all messages contained within it.
bug: v/77564

When deleting the Bluetooth asynchronous instance, the IPC cached messages are directly released, and their asynchronous callbacks will not be invoked. This could lead to memory leaks if resources are released within the callbacks.

Signed-off-by: jialu <jialu@xiaomi.com>
2026-04-27 23:14:52 +08:00
Lu Jia 6ab8107575 ipc: gattc async api
bug: v/62106

Signed-off-by: jialu <jialu@xiaomi.com>
2026-04-27 23:14:52 +08:00
liuxiang18 54f9f99502 PTS: add pts property for dynamic control disconnect or not when pair failed.
bug: v/71321

Signed-off-by: liuxiang18 <liuxiang18@xiaomi.com>
2026-04-27 23:14:52 +08:00
liuxiang18 35619721a7 bluetooth: implement bt_device_set_bondable_le API to change bond mode.
bug: v/67335

Signed-off-by: liuxiang18 <liuxiang18@xiaomi.com>
2026-04-27 23:14:52 +08:00
liuxiang18 9d7ddc49be bluetooth: implement bt_device_set_security_level API to change bond security level.
bug: v/67009

Signed-off-by: liuxiang18 <liuxiang18@xiaomi.com>
2026-04-27 23:14:52 +08:00
zhangyuan20 914526bf60 zephyr-pts: add send passthrough cmd for avrcp ct
bug: v/58789

Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2026-04-27 23:14:51 +08:00
liuxiang18 7fcbecc5cd IPC: fix build error conversion from 'int' to 'bt_message_type_t'.
bug: v/52485

Signed-off-by: liuxiang18 <liuxiang18@xiaomi.com>
2026-04-27 23:14:51 +08:00
zhangyuan20 92594c2d26 Android-Vela: add clcc interface and callback
bug: v/60610

Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2026-04-27 23:14:51 +08:00
fangzhenwei d61b5cf1be ipc: socket ipc support async call
bug: v/46316

1.add api bt_socket_client_send_with_reply

Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-27 23:14:51 +08:00
chengkai 0f09cd64e9 bluetooth: adapt spp socket api
bug: v/47179

Signed-off-by: chengkai <chengkai@xiaomi.com>
2026-04-27 23:14:51 +08:00
jialu 1838bc72e8 HFP: Adding vendor specific AT command process for AG
bug: v/17775

In order to implement the PTT function of headphone control, it is necessary to add the process of AG send and receive vendor specific AT commands.

Signed-off-by: jialu <jialu@xiaomi.com>
2026-04-27 23:14:51 +08:00
zhangyuan20 60072ab342 framework/avrcp: add metadata support for avrcp control in BT Service
bug: v/42362

Rootcause: Avrcp control lacks metadata interface, add get metadata interface and callback for avrcp control

Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2026-04-27 23:14:50 +08:00
openvela-robot 9d0c825cbb Merge commit
Change-Id: If26995eebd18a82ac4cd827e6801458e57a6ead3
2026-04-27 23:14:50 +08:00
Lu Jia f5965d1303 bluetooth: Add initialization for local variables.
When passed to bt_socket_client_send_with_reply , it may contain undefined values, leading to unpredictable behavior. Initialize packet explicitly before using it.

Signed-off-by: jialu <jialu@xiaomi.com>
Signed-off-by: miot-robot <miot-robot@xiaomi.com>
2026-04-20 14:53:21 +08:00
Lu Jia 05614c8747 bluetooth: Add initialization for local variables.
When passed to bt_socket_client_send_with_reply , it may contain undefined values, leading to unpredictable behavior. Initialize packet explicitly  before using it.

Signed-off-by: jialu <jialu@xiaomi.com>
Signed-off-by: miot-robot <miot-robot@xiaomi.com>
2026-04-20 14:53:21 +08:00
zhangyuan20 155520406c fix problem that pair pin command do not send accept
Rootcause: Pair pin command do not send accept, The default value is 0, thus rejecting the pair process, So add accept when send to socket.

Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2026-04-20 14:53:05 +08:00
chejinxian1 65275b274c L2CAP: Update stop listen function to include transport parameter
Rootcause: The PSM employed by L2CAP in LE and BR/EDR contexts are not identical concepts. The LE scenario utilises a simplified PSM, whereas the BR/EDR scenario employs the standard PSM. These differ fundamentally in their allocation methods and are not interoperable.

Consequently, the current implementation of listen and stop listen operations requires distinguishing between connection types. Add a new API `bt_l2cap_stop_listen_with_transport` to support stop listen on BR/EDR PSM. This modification will rectify the error where `bt_l2cap_stop_listen` fails to recognise connection types, whilst filtering operations specific to the BR/EDR type.

Signed-off-by: chejinxian1 <chejinxian1@xiaomi.com>
2026-04-20 14:52:53 +08:00
zhangyuan20 bdc7984fd2 zephyr-pts: add register notification interface for avrcp ct
Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2026-04-20 14:52:48 +08:00
zhangyuan20 a86c6bb43c zephyr-pts: add get playback state interface for avrcp ct
Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2026-04-20 14:52:48 +08:00
zhangyuan20 4c52e8b14b zephyr-pts: add get subunit info interface for avrcp ct
Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2026-04-20 14:52:48 +08:00
zhangyuan20 8fbbd82849 zephyr-pts: add get unit info interface for avrcp ct
Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2026-04-20 14:52:48 +08:00
zhangyuan20 0a2f1a9344 zephyr-pts: add send passthrough cmd for avrcp ct
Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2026-04-20 14:52:48 +08:00
chejinxian1 2ca1ce1c6a L2CAP: Add function to stop listening on a specific PSM.
Signed-off-by: chejinxian1 <chejinxian1@xiaomi.com>
2026-04-20 14:52:46 +08:00
chejinxian1 0706a8491f L2CAP: Refactor L2CAP API to support to multiple application and socket pipe.
Refactor L2CAP API to use handles instead of cookies for callback registration and management.

Signed-off-by: chejinxian1 <chejinxian1@xiaomi.com>
2026-04-20 14:52:46 +08:00
liuxiang18 bb834bba1e PTS: add pts property for dynamic control disconnect or not when pair failed.
Signed-off-by: liuxiang18 <liuxiang18@xiaomi.com>
2026-04-20 14:52:42 +08:00
zhongzhijie1 09c3c75c61 Support the signed write function, which requires BT_SIGNING micro to open.
Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
2026-04-20 14:52:42 +08:00
zhongzhijie1 3fa65f3169 Add API for limited Discovery.
Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
2026-04-20 14:52:42 +08:00
liuxiang18 4baa13a8d1 bluetooth: implement bt_device_set_bondable_le API to change bond mode.
Signed-off-by: liuxiang18 <liuxiang18@xiaomi.com>
2026-04-20 14:52:41 +08:00
liuxiang18 55147e63ba bluetooth: implement bt_device_set_security_level API to change bond security level.
Signed-off-by: liuxiang18 <liuxiang18@xiaomi.com>
2026-04-20 14:52:40 +08:00
liyuheng 45b7e64e16 Add new interface: hfp_hf_query_current_calls_with_callback.
Rootcause: Currently, when the bt_hfp_hf_query_current_calls interface receives a request, it retrieves the result from the state machine cache and returns it immediately. However, since the cache may not be updated in a timely manner, the returned data may not be the latest.

Signed-off-by: liyuheng <liyuheng@xiaomi.com>
2026-04-20 14:52:40 +08:00
chejinxian1 3b35c54322 IPC: Update the include for RPMSG
Rootcause: Within the Android build system, the RPMSG service is inaccessible. Consequently, the corresponding library path has been added to Android.bp, and the include header file for the source file utilising RPMSG has been updated.

Signed-off-by: chejinxian1 <chejinxian1@xiaomi.com>
Signed-off-by: miot-robot <miot-robot@xiaomi.com>
2026-04-20 14:52:40 +08:00
zhangyuan20 2ecaa0d81e Android-Vela:add cind interface for android
Rootcause:When reconnect to the headset during a call, the headset will obtain the call status through the cind command. Since Vela does not have modem, the status will be error. So, get cind from Android.

Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2026-04-20 14:52:39 +08:00
zhangyuan20 2a46cb1ffa Android-Vela:add cnum interface for android
Rootcause: Adapt the cnum interface to obtain the virtual call mobile phone number.

Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2026-04-20 14:52:39 +08:00
Lu Jia 08b110ac5c bluetooth: Using macros to reduce boilerplate code in asynchronous callbacks.
Some processing logic in asynchronous callbacks is identical; extract this common code into a macro.

Signed-off-by: jialu <jialu@xiaomi.com>
2026-04-20 14:52:34 +08:00
Lu Jia 7818c54bb0 bluetooth: Release resources within the callback during deletion of the GATTC asynchronous instance.
Signed-off-by: jialu <jialu@xiaomi.com>
2026-04-20 14:52:33 +08:00
Lu Jia 4b66d260fd bluetooth: Before releasing the IPC pending_queue, invoke the asynchronous callbacks for all messages contained within it.
When deleting the Bluetooth asynchronous instance, the IPC cached messages are directly released, and their asynchronous callbacks will not be invoked. This could lead to memory leaks if resources are released within the callbacks.

Signed-off-by: jialu <jialu@xiaomi.com>
2026-04-20 14:52:33 +08:00
liuxiang18 752901fd8d Vela-Android: fix add service failure when db_elements over 10 in serivce.
Signed-off-by: liuxiang18 <liuxiang18@xiaomi.com>
2026-04-20 14:52:28 +08:00
Lu Jia 778c625e42 bluetooth: Fix compilation errors
Signed-off-by: jialu <jialu@xiaomi.com>
2026-04-20 14:52:13 +08:00
chengkai 70c6e72aff bluetooth: add spp insecure feature
Signed-off-by: chengkai <chengkai@xiaomi.com>
2026-04-20 14:52:12 +08:00
zhongzhijie1 05a15ee027 bluetooth: add whitelist with type API to support specific BLE address type.
Whitelist with type API allows adding a BLE address with a specified address type to the whitelist. Note that each address can only have one address type, and the stack will auto handle merging of address type operations.

New API:
    bt_status_t BTSYMBOLS(bt_adapter_le_add_whitelist_with_type)(bt_instance_t* ins, bt_address_t* addr, ble_addr_type_t type);

Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
2026-04-20 14:52:11 +08:00
Lu Jia 0cca14cced ipc: trace async api
Signed-off-by: jialu <jialu@xiaomi.com>
2026-04-20 14:52:09 +08:00
Lu Jia cf1f9b4220 ipc: gattc async api
Signed-off-by: jialu <jialu@xiaomi.com>
2026-04-20 14:52:08 +08:00
Lu Jia 7af64278ec bluetooth: Add instance in the handle returned by the callback in scan.
Signed-off-by: jialu <jialu@xiaomi.com>
2026-04-20 14:52:08 +08:00