Commit Graph

17 Commits

Author SHA1 Message Date
liuxiang18 1b6e6215fe 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-01-22 09:28:28 +08:00
Lu Jia cbea408ece bluetooth: Add initialization for local variables.
bug: v/80616

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>
2025-12-20 12:56:06 +08:00
Lu Jia 373a30ccc0 bluetooth: Add initialization for local variables.
bug: v/80617

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>
2025-12-20 12:56:06 +08:00
Lu Jia 4cb36ccf47 bluetooth: Using macros to reduce boilerplate code in asynchronous callbacks.
bug: v/77564

Some processing logic in asynchronous callbacks is identical; extract this common code into a macro.

Signed-off-by: jialu <jialu@xiaomi.com>
2025-11-20 18:14:35 +08:00
Lu Jia dc9897fb67 bluetooth: Release resources within the callback during deletion of the GATTC asynchronous instance.
bug: v/77564

Signed-off-by: jialu <jialu@xiaomi.com>
2025-11-20 18:14:35 +08:00
Lu Jia 4baa9477e4 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>
2025-11-20 18:14:35 +08:00
Lu Jia 92e9a77eb2 ipc: trace async api
bug: v/62087

Signed-off-by: jialu <jialu@xiaomi.com>
2025-10-15 10:20:50 +08:00
Lu Jia 7d68d3fe06 ipc: gattc async api
bug: v/62106

Signed-off-by: jialu <jialu@xiaomi.com>
2025-10-15 10:20:50 +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
Lu Jia 474067591a ipc: le scan async api
bug: v/62058

Signed-off-by: jialu <jialu@xiaomi.com>
2025-10-15 10:20:50 +08:00
Lu Jia 1b53740d2a bluetooth: Add instance in the handle returned by the callback in adv.
bug: v/67404

Root cause: The interface handle and other information of the feature exist on the instance of Bluetooth. If the callback does not have instance information, it cannot obtain feature-related information, resulting in the JavaScript application not receiving the callback.

Signed-off-by: jialu <jialu@xiaomi.com>
2025-10-15 10:20:50 +08:00
Lu Jia 4b3f987d31 ipc: le advertiser async api
bug: v/62058

Signed-off-by: jialu <jialu@xiaomi.com>
2025-08-08 13:52:12 +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 979b66f3bf bluetooth: Fix compilation errors when calling Bluetooth in C++ files.
bug: v/67883

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>
2025-08-07 15:57:53 +08:00
zhangyuan20 c932ccd18e fix problem that pair pin command do not send accept
bug: v/60422

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>
2025-06-12 15:03:22 +08:00
fangzhenwei be87c6a634 ipc: device async api
bug: v/44888

Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2025-02-18 18:21:13 +08:00
fangzhenwei 902b19394c ipc: adapter async api
bug: v/44888

Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2025-02-18 18:21:13 +08:00