Need to Change line 4470 in bta_dm_act.c

jesseb
Posts: 29
Joined: Tue Jan 10, 2017 5:36 pm

Need to Change line 4470 in bta_dm_act.c

Postby jesseb » Wed Mar 29, 2017 3:02 pm

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!

User avatar
rudi ;-)
Posts: 1727
Joined: Fri Nov 13, 2015 3:25 pm

Re: Need to Change line 4470 in bta_dm_act.c

Postby rudi ;-) » Wed Mar 29, 2017 3:12 pm

jesseb 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!
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 */
good catch!

edit: PR
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

jesseb
Posts: 29
Joined: Tue Jan 10, 2017 5:36 pm

Re: Need to Change line 4470 in bta_dm_act.c

Postby jesseb » Thu Mar 30, 2017 2:18 pm

Yep, that's it. Thanks again!

Who is online

Users browsing this forum: Majestic-12 [Bot], Venky555 and 89 guests