- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
i want to get the local bd address, and i use the library function (void wiced_bt_dev_read_local_addr(wiced_bt_device_address_t bd_addr)).
I print the bd_addr ,but it is an array of two bytes which are not equal to six in the sample code. I want to know the reason and if i can use the function
to get local bd address.
Jane.Xia
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I inserted the api into the hello sensor app so that you can view the read-back of the bd address in the 1s-timer loop via teraterm.
void hello_sensor_timeout( uint32_t count )
{
wiced_bt_device_address_t bda = { 0 };
hello_sensor_state.timer_count++;
WICED_BT_TRACE("hello_sensor_timeout: %d\n", hello_sensor_state.timer_count);
wiced_bt_dev_read_local_addr(bda);
WICED_BT_TRACE("Local Bluetooth Address: [%B]\n", bda);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can check the implementation under the apps/demo/hci_serial_gatt_service/hci_control.c
void hci_control_handle_read_local_bda( void )
{
wiced_bt_device_address_t bda = { 0 };
wiced_bt_dev_read_local_addr(bda);
WICED_BT_TRACE("Local Bluetooth Address: [%B]\n", bda);
wiced_transport_send_data( HCI_CONTROL_EVENT_READ_LOCAL_BDA, (uint8_t*)bda , 6 );
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I inserted the api into the hello sensor app so that you can view the read-back of the bd address in the 1s-timer loop via teraterm.
void hello_sensor_timeout( uint32_t count )
{
wiced_bt_device_address_t bda = { 0 };
hello_sensor_state.timer_count++;
WICED_BT_TRACE("hello_sensor_timeout: %d\n", hello_sensor_state.timer_count);
wiced_bt_dev_read_local_addr(bda);
WICED_BT_TRACE("Local Bluetooth Address: [%B]\n", bda);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I do this as follows.
And i get the results like this:
Can you help me analyse the two results? Thanks.
Jane.Xia
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm not too sure what you are asking me to analyse. You have got it right in your bd addr callback although you did not turn on the code as shown above. Anyhow, use the api as you deemed appropriate in your development.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think you are worried about the "OK+LELADD: pj ". Since you are copying a uint8 string into a character string and printing the character string, the values are being displayed as ASCII when you are printing.
20 = Space
70=p
6a=j
20=space
fb and a8 not defined in the ASCII table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think you are right, and thank you for solving the puzzle.