There is a small bug in the bluetooth code when setting a random address. Line 4470 of bta_dm_act.c needs to be changed to UINT8 len = sizeof(p_data->set_addr.address); . It was previously UINT8 len = sizeof(p_data->set_addr); .
Thanks!
Need to Change line 4470 in bta_dm_act.c
Re: Need to Change line 4470 in bta_dm_act.c
thanksjesseb wrote:There is a small bug in the bluetooth code when setting a random address. Line 4470 of bta_dm_act.c needs to be changed to UINT8 len = sizeof(p_data->set_addr.address); . It was previously UINT8 len = sizeof(p_data->set_addr); .
Thanks!
you mean this line in code`?
Code: Select all
/*******************************************************************************
**
** Function bta_dm_ble_set_rand_address
**
** Description This function set the LE random address for the device.
**
** Parameters: rand_addr:the random address whitch should be setting
** Explanation: This function added by Yulong at 2016/9/9
*******************************************************************************/
void bta_dm_ble_set_rand_address(tBTA_DM_MSG *p_data)
{
UINT8 len = sizeof(p_data->set_addr);
if (len != BD_ADDR_LEN) {
APPL_TRACE_ERROR("Invalid random adress");
return;
}
if (p_data->set_addr.addr_type != BLE_ADDR_RANDOM) {
APPL_TRACE_ERROR("Invalid random adress type = %d\n", p_data->set_addr.addr_type);
return;
}
//send the setting random address to BTM layer
BTM_BleSetRandAddress(p_data->set_addr.address);
}
best wishes
rudi
edit: recursively
BD_ADDR_LEN = 6
BD_ADDR_LEN = 6
p_data->set_addr
BD_ADDR address
BD_ADDR
Code: Select all
#define BD_ADDR_LEN 6 /* Device address length */
typedef UINT8 BD_ADDR[BD_ADDR_LEN]; /* Device address */
typedef UINT8 *BD_ADDR_PTR; /* Pointer to Device Address */
edit: PR
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
Re: Need to Change line 4470 in bta_dm_act.c
Yep, that's it. Thanks again!
Who is online
Users browsing this forum: Majestic-12 [Bot], Venky555 and 89 guests