Commit Graph

47 Commits

Author SHA1 Message Date
zhangyuan20 49453c7ba7 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-03-02 12:07:54 +08:00
chengkai 0114d1c30a bluetooth: add spp insecure feature
bug: v/13885

Signed-off-by: chengkai <chengkai@xiaomi.com>
2026-02-11 17:27:28 +08:00
liuxiang18 b95024eee5 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-01-22 09:28:28 +08:00
chengkai 6e4d1c3380 bluetooth: add gatts_connect_bear api [1/2]
bug: v/51103

Signed-off-by: chengkai <chengkai@xiaomi.com>
2026-01-14 14:28:28 +08:00
YuhengLi 49a0c0ffce Android-Vela: fix problem that client can not receive cind callback
bug: v/61170

Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2026-01-07 14:11:18 +08:00
YuhengLi 8db9b23dca 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-01-07 14:11:18 +08:00
chejinxian1 977bb0838d L2CAP: Update stop listen function to include transport parameter
bug: v/70057

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>
2025-12-15 10:54:59 +08:00
liuxiang18 e81000ad6e IPC: adapt l2cap new message code
buv: v/52485

Signed-off-by: liuxiang18 <liuxiang18@xiaomi.com>
2025-11-17 22:20:28 +08:00
chejinxian1 64d4df2bca L2CAP: Add function to stop listening on a specific PSM.
bug: v/57319

Signed-off-by: chejinxian1 <chejinxian1@xiaomi.com>
2025-11-17 22:20:28 +08:00
chejinxian1 68ef63520d L2CAP: Refactor L2CAP API to support to multiple application and socket pipe.
bug: v/57319

Refactor L2CAP API to use handles instead of cookies for callback registration and management.

Signed-off-by: chejinxian1 <chejinxian1@xiaomi.com>
2025-11-17 22:20:28 +08:00
Lu Jia d1cc10ef68 bluetooth: Add instance in the handle returned by the callback in scan.
bug: v/62058

Signed-off-by: jialu <jialu@xiaomi.com>
2025-10-15 10:20:50 +08:00
zhongzhijie1 9e14193b3c [bug fix] When bt off is executed, disconnect all acl connections.
bug: v/43852

Originally, only the "adapter_disable" function was executed. An additional step was added before that, which disconnects all ACL connections. A timer was also started to wait for the "disconnect" event for 2 seconds, followed by cleaning up profile resources (by following the normal disable procedure).

Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
2025-09-26 21:42:22 +08:00
liuxiang18 3f7b0c707c PTS: add pts property for dynamic control disconnect or not when pair failed.
bug: v/71321

Signed-off-by: liuxiang18 <liuxiang18@xiaomi.com>
2025-09-25 20:01:14 +08:00
zhongzhijie1 6302f4e2c3 Support the signed write function, which requires BT_SIGNING micro to open.
bug: v/69041

Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
2025-09-25 20:01:14 +08:00
zhongzhijie1 42aeb49c23 Add API for limited Discovery.
bug: v/70809

Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
2025-09-25 20:01:14 +08:00
liuxiang18 140f414f65 bluetooth: implement bt_device_set_bondable_le API to change bond mode.
bug: v/67335

Signed-off-by: liuxiang18 <liuxiang18@xiaomi.com>
2025-09-25 20:01:14 +08:00
liuxiang18 abb204078c bluetooth: implement bt_device_set_security_level API to change bond security level.
bug: v/67009

Signed-off-by: liuxiang18 <liuxiang18@xiaomi.com>
2025-09-25 20:01:14 +08:00
liyuheng f63df58228 Add new interface: hfp_hf_query_current_calls_with_callback.
bug: v/67238

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>
2025-09-17 10:41:29 +08:00
zhangyuan20 0ac0044e05 Android-Vela:add cnum interface for android
bug: v/67447

Rootcause: Adapt the cnum interface to obtain the virtual call mobile phone number.

Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2025-08-28 21:14:05 +08:00
Lu Jia 47fe1432e4 bluetooth: Fix bugs in asynchronous API.
bug: v/62017

Root cause:
1. The application does not pass asynchronous callback when it should directly return an error code. The message should not be sent to the server, and the entire callback list should not be freed.
2. The application registers multiple callbacks, but it should not return the asynchronous callback first and then return the return value of the asynchronous call. This behavior is inconsistent for the application between the first registration of a callback and subsequent registrations. When the application registers multiple callbacks, the message can be sent to the server, and the server will handle duplicate registrations.

Signed-off-by: jialu <jialu@xiaomi.com>
2025-08-08 13:52:12 +08:00
Lu Jia 87fd88b9f2 bluetooth: Fix bugs in asynchronous API.
bug: v/62017

Signed-off-by: jialu <jialu@xiaomi.com>
2025-08-08 13:52:12 +08:00
zhangyuan20 794e8ab6e2 Android-Vela: add clip callback for hf
bug: v/63275

Rootcause: The application wants to get the name of the hf call by clip. The order is clip first, then clcc, but clip can only be called back after clcc, resulting in the application not being able to get the name. A separate callback needs to be added to clip.

Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2025-06-19 13:59:48 +08:00
Zihao Gao b78c45b51e Bluetooth: defer LE scan results if IPC blocked.
bug: v/57341

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2025-06-17 23:25:06 +08:00
zhongzhijie1 676764447c Fix build warning: -Werror=int-to-pointer-cast.
bug: v/58186

Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
2025-06-17 23:25:06 +08:00
zhongzhijie1 219d6c1547 Reduce MAX_SCAN_RESULTS_PER_PACKET from 15 to 13 for compatible with bt_message_packet_t union size.
bug: v/58186

Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
2025-06-17 23:25:06 +08:00
zhongzhijie1 64768a4d6a Redefine new ipc callback code BT_LE_ON_BATCH_SCAN_RESULT.
bug: v/52485

Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
2025-06-17 23:25:06 +08:00
zhongzhijie1 1316e86843 Support batch scan result report.
bug: v/58186

Detail:
- Implemented batch reporting for BLE scan results via 1024-byte pipe buffer.
  Supports up to 15 scan packets per batch.
- Added 150ms flush timeout to ensure timely reporting in low-traffic environments.

Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
2025-06-17 23:25:06 +08:00
zhangyuan20 c726342078 zephyr-pts: add register notification interface for avrcp ct
bug: v/58789

Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2025-06-12 10:45:11 +08:00
zhangyuan20 e52900eb16 zephyr-pts: add get playback state interface for avrcp ct
bug: v/58789

Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2025-06-12 10:45:11 +08:00
zhangyuan20 ad343e7331 zephyr-pts: add get subunit info interface for avrcp ct
bug: v/58789

Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2025-06-12 10:45:11 +08:00
zhangyuan20 114f7d188c zephyr-pts: add get unit info interface for avrcp ct
bug: v/58789

Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2025-06-12 10:45:11 +08:00
zhangyuan20 8c3353e282 zephyr-pts: add send passthrough cmd for avrcp ct
bug: v/58789

Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2025-06-12 10:45:11 +08:00
liuxiang18 684d6932da IPC: fix build error conversion from 'int' to 'bt_message_type_t'.
bug: v/52485

Signed-off-by: liuxiang18 <liuxiang18@xiaomi.com>
2025-06-05 13:36:49 +08:00
Haishen Zhang 1921f5a056 Redefine IPC message/callback code
bug: v/52485

1. Add extended IPC message/callback code
2. Update bt_socket_client_callback_process()
3. Update bt_socket_server_receive()

Signed-off-by: Haishen Zhang <zhanghaishen@xiaomi.com>
2025-06-05 13:36:49 +08:00
zhangyuan20 a555fb1198 Android-Vela: add clcc interface and callback
bug: v/60610

Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2025-05-13 17:13:40 +08:00
liuxiang18 72143ef6bd bluetooth:connect/disconnect profile API
bug: v/50798

Signed-off-by: liuxiang18 <liuxiang18@xiaomi.com>
2025-05-12 19:58:51 +08:00
Zihao Gao 6b28b88fdf Adapter: allow to check local support profiles via uuid.
bug: v/59759

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2025-05-09 20:03:04 +08:00
chejinxian1 cee7569f30 API: Add a new callback interface to obtain bond states.
bug: v/54141

Rootcause: The new interface will inform the upper-layer application of the previous bond state, thus distinguishing the different scenarios that may occur during the bonding process.

Signed-off-by: chejinxian1 <chejinxian1@xiaomi.com>
2025-03-26 11:09:41 +08:00
fangzhenwei 97982aedca 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>
2025-02-18 18:21:13 +08:00
duqunbo e9d4f928ca BTsnoop: add btsnoop API
bug: v/42717

Signed-off-by: duqunbo <duqunbo@xiaomi.com>
2025-02-10 22:30:28 +08:00
chengkai 155a501a1e bluetooth: adapt spp socket api
bug: v/47179

Signed-off-by: chengkai <chengkai@xiaomi.com>
2025-02-10 17:56:41 +08:00
zhangyuan20 2f9ed21f73 Vela-Android: save bredr remote uuids
bug: v/45250

Rootcause: vela does not save remote uuids, causing android UI to display errors

Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2025-02-07 13:55:03 +08:00
jialu 741a829251 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>
2025-01-16 23:03:41 +08:00
zhangyuan20 090d7d3034 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>
2025-01-03 18:07:52 +08:00
shenyangsi d1d133e78c GATT: fix type mismatch for cookie of socket ipc
bug: v/45006

Rootcause: The 32-bit pointer stored by the Vela socket server may truncate the 64-bit pointer from Android client

Signed-off-by: shenyangsi <shenyangsi@xiaomi.com>
2025-01-02 22:46:44 +08:00
chejinxian1 dac351422b Bluetooth: Add API for supplying enhanced mode for application calling.
bug: v/43848

Rootcause: Due to the diversity of application scenarios, the API for invoking the Connection Enhanced Mode is provided for applications to call. Applications can enable or disable specific enhanced modes according to their own needs.

Signed-off-by: chejinxian1 <chejinxian1@xiaomi.com>
2024-12-23 00:07:54 +08:00
openvela-robot cf07bea530 Merge commit
Change-Id: If26995eebd18a82ac4cd827e6801458e57a6ead3
2024-11-25 17:34:53 +08:00