Commit Graph

15 Commits

Author SHA1 Message Date
Zihao Gao ea27e37547 bt_uuid: define BT_UUID_STR_LENGTH macro and update usages
Bug: v/87379

Define BT_UUID_STR_LENGTH macro (40) in bt_uuid.h to replace hardcoded
magic numbers for UUID string buffer size. Use LENGTH suffix to avoid
conflict with Zephyr's BT_UUID_STR_LEN definition.

Update all usages across the codebase to use the new macro.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2026-04-27 23:14:55 +08:00
v-chenghuijin 498bbed959 SPP: Fix race condition crash by unifying thread context for resource cleanup
bug: v/80850

Rootcause: uv_loop_close() marks internal data structures as invalid, but
pending callbacks in the queue still reference these invalidated
structures. When uv_run() is called later, it processes the queue using
corrupted pointers, leading to segmentation faults and crashes.

Solution:To address the issues described above, the solution removes
uv_loop_t from the bttool_t struct and changes it to dynamic allocation,
introducing a global pointer g_bttool_loop to centrally manage its
lifecycle. Specific modifications include: dynamically allocating and
initializing the uv_loop_t instance within the bttool_thread function and
assigning it to the global pointer; modifying the bttool_command_uvloop_run
function to operate using the global g_bttool_loop pointer; and adjusting
the asynchronous API initialization logic in async/gap.c to ensure it
uses the global pointer instead of a local pointer. Furthermore, the
solution enhances error handling, ensuring proper resource cleanup if
memory allocation fails, and optimizes the bt_tool_uninit_cb function to
prevent premature clearing of the global pointer, which could lead to
access exceptions.

Signed-off-by: v-chenghuijin <v-chenghuijin@xiaomi.com>
2026-04-27 23:14:54 +08:00
Lu Jia 1aa0a59c97 ipc: trace async api
bug: v/62087

Signed-off-by: jialu <jialu@xiaomi.com>
2026-04-27 23:14:52 +08:00
Lu Jia 6ab8107575 ipc: gattc async api
bug: v/62106

Signed-off-by: jialu <jialu@xiaomi.com>
2026-04-27 23:14:52 +08:00
Kai Cheng 89d1a7df7a bluetooth: add gatt client and server config
bug: v/51584

add gatt client and server config

Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
2026-04-27 23:14:52 +08:00
Kai Cheng adc08df0a4 blueotooth: add log config
bug: v/51584

add CONFIG_BLUETOOTH_LOG config

Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
2026-04-27 23:14:52 +08:00
Kai Cheng ef7747f1c2 bluetooth: add gatt client and server config
add gatt client and server config.openvela:
35ed1ce372

Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
2026-04-20 14:52:43 +08:00
Kai Cheng 654a99c319 blueotooth: add log config
add CONFIG_BLUETOOTH_LOG config.openvela:
c293a113f0

Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
2026-04-20 14:52:43 +08:00
Lu Jia 263ed83a15 bluetooth: Fix the memory leak issue in gattc.
Signed-off-by: jialu <jialu@xiaomi.com>
2026-04-20 14:52:13 +08:00
Lu Jia 0cca14cced ipc: trace async api
Signed-off-by: jialu <jialu@xiaomi.com>
2026-04-20 14:52:09 +08:00
Lu Jia cf1f9b4220 ipc: gattc async api
Signed-off-by: jialu <jialu@xiaomi.com>
2026-04-20 14:52:08 +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 9f3c83bf6b bluetooth: Modify the printing of asynchronous API.
Signed-off-by: jialu <jialu@xiaomi.com>
2026-04-20 14:52:01 +08:00
Lu Jia 0e070754c0 ipc: le advertiser async api
Signed-off-by: jialu <jialu@xiaomi.com>
2026-04-20 14:52:00 +08:00
fangzhenwei 13bc9e7774 bttool: add adapter async api test cmd
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 14:51:32 +08:00