Commit Graph

60 Commits

Author SHA1 Message Date
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
Zihao Gao 4ddf4c0ef8 RSSI: update adapter services to update rssi.
bug: v/86588

Rootcase: the rssi is never changed after BR/EDR inquiry scan, and is never assigned a value for LE.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2026-04-27 23:14:54 +08:00
zhongzhijie1 30f781f87f pm: add bt_cm_enable/disable_enhanced_mode for BR/EDR low-latency sniff
bug: v/67000

Add bt_cm_enable_enhanced_mode() and bt_cm_disable_enhanced_mode().
Support EM_BR_SNIFF_LOW_LATENCY and EM_BR_SNIFF_ULTRA_LOW_LATENCY.
They switch to lower sniff intervals for short-term low latency needs.
Disable API restores the default sniff parameters.

Note: idle timeout is not changed in current design. It may be extended in the future.

Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
2026-04-27 23:14:54 +08:00
liuxiang18 4d524866b1 socket: Move the generic macro to the public header file.
bug: v/83666

In the current bt_socket_profile file, all client-side callbacks use the generic macro interface
BREDR & common: CALLBACK_FOREACH
BLE: CALLBACK_REMOTE

Signed-off-by: liuxiang18 <liuxiang18@xiaomi.com>
2026-04-27 23:14:54 +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
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
liuxiang18 3401f08950 Android-vela: bt_client-add bt_socket disconnect handling
bug: v/53721

Fix lost BT connection between android and vela as vela/Android reboot.

Signed-off-by: liuxiang18 <liuxiang18@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
fangzhenwei fa87d5daf5 adapter: service adapte to new sal2.0 api
bug: v/42144

Signed-off-by: fangzhenwei <fangzhenwei@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
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
chejinxian1 e1aa224828 bluetooth: Restrict the scope of use for `bt_oob_data_t`
Rootcause: The current definition of `bt_oob_data_t` conflicts with the Android Bluetooth. In practice, this type definition is restricted to internal service usage and is not currently exposed externally.

Signed-off-by: chejinxian1 <chejinxian1@xiaomi.com>
Signed-off-by: miot-robot <miot-robot@xiaomi.com>
2026-04-20 14:52:40 +08:00
zhongzhijie1 f64747b316 pm: add bt_cm_enable/disable_enhanced_mode for BR/EDR low-latency sniff
Add bt_cm_enable_enhanced_mode() and bt_cm_disable_enhanced_mode().
Support EM_BR_SNIFF_LOW_LATENCY and EM_BR_SNIFF_ULTRA_LOW_LATENCY.
They switch to lower sniff intervals for short-term low latency needs.
Disable API restores the default sniff parameters.

Note: idle timeout is not changed in current design. It may be extended in the future.

Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
2026-04-20 14:52:12 +08:00
jialu d8076dc8f6 HFP: Adding vendor specific AT command process for AG
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-20 14:52:06 +08:00
Lu Jia 1d7a5117e9 bluetooth: Add bluetooth_get_async_instance()
Signed-off-by: jialu <jialu@xiaomi.com>
2026-04-20 14:52:01 +08:00
fangzhenwei 72e41252be adapter: service adapte to new sal2.0 api
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 14:51:32 +08:00
fangzhenwei 1073eb6fda sal: stack adapter layer api version 2.0
1. define controller id type 'bt_controller_id_t'
2. new parameter 'devid' for all api
3. modified some api name and optimization parameters
4. remove useless api

Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 14:51:32 +08:00
fangzhenwei af74910e2d ipc: socket ipc support async call
1.add api bt_socket_client_send_with_reply

Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 14:51:31 +08:00
liuxiang18 0e058cc052 Android-vela: bt_client-add bt_socket disconnect handling
Fix lost BT connection between android and vela as vela/Android reboot.

Signed-off-by: liuxiang18 <liuxiang18@xiaomi.com>
2026-04-20 14:51:31 +08:00
chejinxian1 489bf05c8a Bluetooth: Add API for supplying enhanced mode for application calling.
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>
2026-04-20 14:51:24 +08:00
zhangyuan20 906172734f framework/avrcp: add metadata support for avrcp control in BT Service
Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2026-04-20 14:51:23 +08:00
liuxiang18 88e0c2bc3e Bluetooth: framework/include/bluetooth.h.
Signed-off-by: liuxiang18 <liuxiang18@xiaomi.com>
2026-04-20 14:51:22 +08:00
zhangyuan20 ef35762323 Vela-Android:Add BTIF wrapper for AVRCP-TG (01)
Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2026-04-20 14:51:13 +08:00
chengkai ce15abb1aa blueototh: fix pm device inited with active state
rootcause: device mode would be inited with zero, which corresponds to
active mode, then add unkownin mode.

Signed-off-by: chengkai <chengkai@xiaomi.com>
2026-04-20 14:51:12 +08:00
shenyangsi d3293394b6 gatt: fix use-after-free issue when unregister handle
Signed-off-by: shenyangsi <shenyangsi@xiaomi.com>
2026-04-20 14:51:11 +08:00
Haishen Zhang 7627aa9bef Android-Vela: Rename BTIF_WITH_VELA as ANDROID_LIBBLUETOOTH (2/2)
1. Rename BTIF_WITH_VELA as ANDROID_LIBBLUETOOTH

Signed-off-by: Haishen Zhang <zhanghaishen@xiaomi.com>
2026-04-20 14:51:08 +08:00
Haishen Zhang 16d487e829 Vela-Android: Add BTIF wrapper for ON/OFF/Inquiry/Pairing (2/5)
dependson:4078095 4115005

1. Update Android.bp
2. Redefine enum and macro that conflict with Android definition
3. Fix a bug about socket to report all UUID array from Bluelet to APP clients

Signed-off-by: Haishen Zhang <zhanghaishen@xiaomi.com>
2026-04-20 14:51:07 +08:00
liujinye 62b16633ff Revert "PBAP: preparation for PCE services."
This reverts commit 586123c56a.

Reason for revert: Need package test does not merge

Signed-off-by: liujinye <liujinye@xiaomi.com>
2026-04-20 14:51:04 +08:00
gaozihao cb6a4d1e54 PBAP: preparation for PCE services.
dependson:odm_596995 odm_596985

Signed-off-by: gaozihao <gaozihao@xiaomi.com>
2026-04-20 14:51:04 +08:00
duqunbo ececc512cb IPC: Locks sending until a message is processed
Signed-off-by: duqunbo <duqunbo@xiaomi.com>
2026-04-20 14:51:03 +08:00
Haishen Zhang 2b61b670a2 Vela-Android: porting bttool over socket(AF_INET) (1/2)
dependson:4036148

1. Enable Socket(AF_INET) first on Android
2. Fix the improper definition of Struct over Socekt between 64 bits and 32 bits system.
3. Modify the bttool to let it work similar to Vela

Signed-off-by: Haishen Zhang <zhanghaishen@xiaomi.com>
2026-04-20 14:51:01 +08:00
Haishen Zhang 6ed1e5e080 Vela-Android: Porting Vela Bluetooth Framework Socket Client to Android x86_64
1. Port Vela Bluetooth Framework Socket Client onto Android.
2. For Socket Server, Service, SAL, we didn't port them onto Android.
3. For bttool, the function is not ready yet.
4. With this libbt-framework-client.so, we can start working on BTIF wrapper over Vela BT Framework Socket Client API.
5. And, we can also start working on bttool over Vela BT Framework Socket Client API later.

Signed-off-by: Haishen Zhang <zhanghaishen@xiaomi.com>
2026-04-20 14:51:00 +08:00
Haishen Zhang 19bc307ac2 Clang-format: Update format of all files based on new .clang-format
1. Update format of all files based on new .clang-format

Signed-off-by: Haishen Zhang <zhanghaishen@xiaomi.com>
2026-04-20 14:50:50 +08:00
duqunbo e6a32e3554 Create a callback object for each feature instance
Signed-off-by: duqunbo <duqunbo@xiaomi.com>
2026-04-20 14:50:41 +08:00
duqunbo e4ed2ec2d9 Modify the incorrect api description and add an api that is the same as the original description
Signed-off-by: duqunbo <duqunbo@xiaomi.com>
2026-04-20 14:50:41 +08:00
shenyangsi 1e8cbe5e73 l2cap: support l2cap dynamic channel
dependson:3628610 3926195

Signed-off-by: shenyangsi <shenyangsi@xiaomi.com>
2026-04-20 14:50:40 +08:00
gaozihao c7314ca8ac bluetooth: correct the usage of uv_cond_wait
Signed-off-by: gaozihao <gaozihao@xiaomi.com>
2026-04-20 14:50:39 +08:00
fangzhenwei 8942bceb4c Merge dev-bt and rel-4.0 --> dev
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 14:50:36 +08:00
fangzhenwei 6e6e279ab1 bluetooth framework re-implement adv & scan
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 14:50:23 +08:00
fangzhenwei 24ac7f15c0 bluetooth framework re-implement base
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 14:50:23 +08:00
gaozihao 5ab4dc6f8c Bluetooth: Code formatted without head file sorted.
Signed-off-by: gaozihao <gaozihao@xiaomi.com>
2026-04-20 14:50:21 +08:00
chengkai 333f6fd987 bluetooth: add a2dp source offload feature
Signed-off-by: chengkai <chengkai@xiaomi.com>
2026-04-20 14:50:14 +08:00
fangzhenwei 7f21067aae use msg queue cache async message
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 14:50:10 +08:00
fangzhenwei 467af2ca17 add set scan params/afh/auto sniff api
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 14:50:09 +08:00
fangzhenwei a19f663a52 ipc: fix memory leak
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 14:50:07 +08:00
fangzhenwei dafa1ebb58 replace client side default loop
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 14:50:07 +08:00
fangzhenwei 96937e9aff ipc: support async callback to external loop
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 14:50:06 +08:00
chao an e469afe27b service/socket: cache send buffer to avoid fail
Signed-off-by: chao an <anchao@xiaomi.com>
2026-04-20 14:50:06 +08:00
shenyangsi 9005e8ccf1 ipc: hidd socket ipc impl
Signed-off-by: shenyangsi <shenyangsi@xiaomi.com>
2026-04-20 14:50:06 +08:00