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>
When deleting a GATTC instance, the Advanced API identifies clients based on their device address. If an application creates two GATTC instances with the same device address, and attempts to delete the second instance before the server has returned the asynchronous callback for the first deletion, both deletion operations will effectively target the same underlying GATTC instance due to the identical device address.
Signed-off-by: jialu <jialu@xiaomi.com>
Signed-off-by: miot-robot <miot-robot@xiaomi.com>
When deleting the instance, ins->context is set to NULL. During asynchronous callback execution, ins->context may already be NULL.
Signed-off-by: jialu <jialu@xiaomi.com>
Report one service per discovery event. Data caching is required in this feature module. If the application exits during the discovery process, releasing the cached services becomes highly complex.
Signed-off-by: jialu <jialu@xiaomi.com>
Root cause: The function advertiser_data_new() may return NULL. It is used without checking if the pointer is empty after calling the function.
Signed-off-by: jialu <jialu@xiaomi.com>
Root cause: The state of the scanner is only cleared when the scan is stopped or closed. When Bluetooth is turned off while scanning is in progress, the state of the scanner is not cleared. This leads to the failure to start scanning when Bluetooth is turned back on.
Signed-off-by: jialu <jialu@xiaomi.com>
Root cause: The request for connection status was directly denied before starting the scan, it should return STATE_NON_SCAN.
Signed-off-by: jialu <jialu@xiaomi.com>
the feature now only access in adapter_disable_safe(), when using normal enable and disable, will not affect disable_safe.
Signed-off-by: zhongzhijie1 <zhongzhijie1@xiaomi.com>
Root Cause: An advertiser can only keep track of one handle for a adv. If an application calls start advertising multiple times, it may result in some broadcasts not being able to be turned off.
Signed-off-by: jialu <jialu@xiaomi.com>
Root cause: Multiple start adv operations were performed, and the feature called the Bluetooth interface to send broadcasts. However, the feature only recorded the first broadcast and only stopped the broadcast once when stopping it, causing the second broadcast to not stop.
Signed-off-by: jialu <jialu@xiaomi.com>
rootcause:With the exception of the post API, all feature framework apis are not thread-safe and should not be accessed from own thread
Signed-off-by: duqunbo <duqunbo@xiaomi.com>