I can retrieve local device name using these functions:
sock = hci_open_dev(dev_id );
result = hci_read_local_name(sock,sizeof(name),name,0);
- Why do I have to use
socketinstead justdev_id? - How do I retrieve same local device address?
This is my TEST code, and it compiles and runs, but fails to get the address:
bdaddr_t *bdaddr_1={0};
result = hci_devba(sock, bdaddr_1);
if(result == 0)
{
text = "SUCCESs local device address ";
//CONVERT char to string
ba2str(bdaddr_1, addr);
text = addr;
}
else
{
text = "FAILED to get local device address (socket) ";
}
qDebug()<< text;