Click here to Skip to main content
15,879,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is a lazy man , KISS , Linux question.
Is there a simple command to obtain JUST the address?
For example somethingsimilar to

system("hciconfig name ");

I have no issues extracting required data from temporary files, just curious if somebody has a simpler approach.

What I have tried:

I have used hcitool and hciconfig and then extracted JUST the bluetooth device address from the output (file) or any other data from file.

I am currently trying getaddrinfo, but so far no success.
Posted
Updated 3-Mar-20 13:52pm
v2

You could use grep[^] to isolate the part of output you are interested in.
hciconfig name | grep "(isolating regular expression)"
 
Share this answer
 
v4
Comments
Vaclav_ 2-Mar-20 10:26am    
Perfect solution , beats fiddling with "string".
Using grep still requires C++ code to get JUST the address or name of BT remote device.

The KISS solution is here:
hci_read_remote_name

returns both address and name
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900