Commit Graph

28 Commits

Author SHA1 Message Date
huangyulong3 0cf1898d83 bluetooth: fix compilation errors
Fix various compilation errors across bluetooth framework, service,
and stack layers including:
- Add missing function declarations and header includes
- Fix type mismatches and implicit function declarations
- Add missing macro definitions in dfx headers
- Add stub implementation for hid device interface
- Fix list utility inline function issues

Signed-off-by: openvela <openvela@xiaomi.com>
2026-05-08 09:52:38 +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
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
zhongzhijie1 3fa65f3169 Add API for limited Discovery.
Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
2026-04-20 14:52:42 +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 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
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
duqunbo 41dc9560be The callback list is released asynchronously.
rootcause:Releasing the callback list synchronously will cause the
zeroing of the callback list to be blocked, resulting in the problem of
the callback list pointer being used after the release.

Signed-off-by: duqunbo <duqunbo@xiaomi.com>
2026-04-20 14:51:16 +08:00
duqunbo 9b62886c8e Handles cllbacks free work in the client thread.
rootcause: The callbacks list itself is not Locked protection and concurrent access
is incorrect, so releasing it must be done in the client thread.

Signed-off-by: duqunbo <duqunbo@xiaomi.com>
2026-04-20 14:51:14 +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 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
fangzhenwei e5fe04b625 fix coverity CHECKED_RETURN warning
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 14:50:23 +08:00
gaozihao 41546100bb Bluetooth: set pointer to NULL after free.
Signed-off-by: gaozihao <gaozihao@xiaomi.com>
2026-04-20 14:50:21 +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
fangzhenwei c31216be11 fix coverity buffer_size_warning
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 14:50:17 +08:00
fangzhenwei 1db4b91dd5 add ipc instance check
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 14:50:15 +08:00
fangzhenwei 5a08c3e9b4 support repeat callbacks register on client
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 14:50:11 +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 42a6df672a fix built error
error: too few arguments to function 'allocator'
  562 |       *addr = allocator(sizeof(bt_address_t) * *num);

Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 14:50:08 +08:00
fangzhenwei 348cb134dd Interface optimization
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 14:50:08 +08:00
fangzhenwei d4e67e2059 fix crash && memory leak && build issue
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 14:50:07 +08:00
fangzhenwei a19f663a52 ipc: fix memory leak
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 14:50:07 +08:00
duqunbo ee74d64d75 Fix some bugs in IPC interface implementation in device\adapter
Signed-off-by: duqunbo <duqunbo@xiaomi.com>
2026-04-20 14:50:06 +08:00
chao an 08eef4e8fe service/socket: add lightweight socket ipc layer
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
Signed-off-by: chao an <anchao@xiaomi.com>
2026-04-20 14:50:05 +08:00