-
• #2
Name is not relevant when connection is made. The device that is initiating the connection does not tell its name and may not have one.
If you have the address you may try to scan for nearby devices and see if some name has same address but most likely it won't be visible.
-
• #3
Thank you, @fanoush.
I'm using a couple of different laptops for updating firmware or apps and programming for my watch and normally my watch is connected to my iPhone. Sometimes, even though I thought I had disconnected one device to connect to the other, it's still connected to the previous device. So I thought it would be useful to show which device my watch is connected to. It works fine with theNRF.getSecurityStatus().connected_addr
for my laptops, but because of the security feature on the iPhone, BLE address randomization, which I can't disable it, my watch shows random looking BLE addresses. That's why I wanted to find out whether there is any way to get the device name instead of the address.
I will look into other options.
Thanks. -
• #4
The address you are currently seeing is a random privat resolvable address. Espruino will be able to resolve it using the
NRF.resolveAddress(private_addr)
method, once you have bonded the two devices, e.g. viaNRF.startBonding(forceRepair)
.As shown in the docs, you can resolve a private address already in the NRF
connect
callback.
Happy New Year, everyone!
I wanted to show a device name that’s connected to my watch. I can get the address using
NRF.getSecurityStatus().connected_addr
, but I wanted the name of the device.
Is there any way to get the connected device name instead of the address?
Thanks.