Commit Graph

121 Commits

Author SHA1 Message Date
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
Kai Cheng 83de1cb8dd bluetooth: fix bt_adapter_set_debug_mode warning
Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
2026-04-20 14:52:51 +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
Kai Cheng 4d1a30d7fe blueototh: add connection mgr config
add BLUETOOTH_CONNECTION_MANAGER config.openvela:
b042d370fa

Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
2026-04-20 14:52:42 +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
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
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 69334cb53e ipc: le scan async api
Signed-off-by: jialu <jialu@xiaomi.com>
2026-04-20 14:52:08 +08:00
Lu Jia 295db704ae bluetooth: Fix compilation errors when calling Bluetooth in C++ files.
Root Cause: When a C++ file references a Bluetooth file, compilation errors occur due to the Bluetooth file using C++ keywords.

Signed-off-by: jialu <jialu@xiaomi.com>
2026-04-20 14:52:07 +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
zhongzhijie1 2ed8f967d8 [bug fix] When bt off is executed, disconnect all acl connections.
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>
2026-04-20 14:52:04 +08:00
liuxiang18 26713e976d bluetooth:connect/disconnect profile API
Signed-off-by: liuxiang18 <liuxiang18@xiaomi.com>
2026-04-20 14:51:35 +08:00
chengkai 1655ec8ee9 bluetooth: add gatts_connect_bear api [1/2]
Signed-off-by: chengkai <chengkai@xiaomi.com>
2026-04-20 14:51:28 +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 e4cdf81dc2 Android-Vela: add clcc interface and callback
Signed-off-by: zhangyuan20 <zhangyuan20@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
chengkai 2f0b5ef837 bluetooth: adapt spp socket api
Signed-off-by: chengkai <chengkai@xiaomi.com>
2026-04-20 14:51:20 +08:00
duqunbo 76378a6404 BTsnoop: add btsnoop API
Signed-off-by: duqunbo <duqunbo@xiaomi.com>
2026-04-20 14:51:18 +08:00
fangzhenwei 4bb2f5ead5 spp: new api 'bt_spp_register_app_ext' with configurable port type parameter
Reason: usually spp uses pty as a cross-process serial data transmission channel on velaos, in the case of cross-core,
in order to maintain the universality of the solution and dynamic port support, we use rpmsgfs_mount to resolve this problem,
run this command 'mount -t rpmsgfs -o cpu=cp,fs=/dev/pts /dev/cp/pts' in rc.sysinit.ap, mount cp core's 'dev/pts' folder to
ap core's 'dev/cp/pts' folder, access 'dev/pts/x' device on ap core directly to resolve pty cross-core communication.

This solution power is abnormal on some device, pty dev as a device type on cp, but pty's property changed after mounting,
access pty as fsnode on ap core, standard fs don't support 'poll', poll pty fd will cause busyloop on ap core, because fs not support
poll and rpmsg poll is not implemented, kernel just poll_notify POLL_IN to user-process, ap core can't enter lowpower mode.

Fix: use rpmsg_uart replace rpmsgfs way on cross-core case, add new spp api bt_spp_register_app_ext and new type SPP_PORT_TYPE_RPMSG_UART,
user need tell spp server which port type, rpmsg_uart type is fixed at present and don't support dynamic port.

Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 14:51:16 +08:00
chejinxian1 901f11ef41 Bluetooth: Remove API about getting ACL handle.
Rootcause: Application does not need to know the Bluetooth ACL handle. Therefore, the corresponding API needs to be removed.

Signed-off-by: chejinxian1 <chejinxian1@xiaomi.com>
2026-04-20 14:51:14 +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 791c938f55 bluetooth: add le scan filter feature
rootcause: add le scan feature, which support uuid filter, other filters would
be added later

Signed-off-by: chengkai <chengkai@xiaomi.com>
2026-04-20 14:51:11 +08:00
shenyangsi 42ee9e1179 HFP: add volume control interface & callback of HF in framework
dependson:4094772 4112025

Signed-off-by: shenyangsi <shenyangsi@xiaomi.com>
2026-04-20 14:51:07 +08:00
shenyangsi 489b24ea94 HFP: supplement some interfaces & callbacks of AG in framework
Signed-off-by: shenyangsi <shenyangsi@xiaomi.com>
2026-04-20 14:51:07 +08:00
zhangyuan20 ca33c55fbf bluetooth:fix build warning in sim/m64
Signed-off-by: zhangyuan20 <zhangyuan20@xiaomi.com>
2026-04-20 14:51:06 +08:00
chengkai ab0982fcd5 bluetooth: add hf connection policy feature
Signed-off-by: chengkai <chengkai@xiaomi.com>
2026-04-20 14:51:06 +08:00
gaozihao 48f367a1a9 HFP: add interfaces for virtual call.
Signed-off-by: gaozihao <gaozihao@xiaomi.com>
2026-04-20 14:51:06 +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
chengkai 2fe24e4d53 bluetooth: cleanup autosniff codes
dependson:odm_591330 odm_591301 odm_591299 odm_591292 odm_591291 odm_591289

Signed-off-by: chengkai <chengkai@xiaomi.com>
2026-04-20 14:51:03 +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
shenyangsi 6720de665c BLE: support LE OOB pairing
Signed-off-by: shenyangsi <shenyangsi@xiaomi.com>
2026-04-20 14:50:59 +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
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
shenyangsi 8ee5a246a2 gattc: support setting ccc_value for gattc_subscribe
dependson:3923736

Signed-off-by: shenyangsi <shenyangsi@xiaomi.com>
Signed-off-by: gaozihao <gaozihao@xiaomi.com>
2026-04-20 14:50:40 +08:00
chengkai 9014f5ab4b bluetooth: fix strncpy stringop-truncation warnnings
rootacuse: fix warning: 'strncpy' specified bound XX equals destination
size [-Wstringop-truncation].

Signed-off-by: chengkai <chengkai@xiaomi.com>
Signed-off-by: gaozihao <gaozihao@xiaomi.com>
2026-04-20 14:50:38 +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