My device is advertising and some central devices can connect with. Now i need to read central device name which connect with me, how to do this ?
My device is advertising and some central devices can connect with. Now i need to read central device name which connect with me, how to do this ?
Hi,
Normally in BLE, a peripheral device will have a name in its advertisement packet with the intention of allowing the central device to present the user with the name in a list of connectable devices. For central devices, there is no advertisement packet, so the same concept doesn't really exist.
If the goal is to have a unique name for each device which the user may change, you will probably need to add a service with a name characteristic. If the purpose is just to inform the user that "An OWN product of this model" has connected, you should just use the device information service to establish what you have connected to. Also in this last case, you could use the custom service suggested first.
Best regards,
Rune Holmgren
Hi,
Normally in BLE, a peripheral device will have a name in its advertisement packet with the intention of allowing the central device to present the user with the name in a list of connectable devices. For central devices, there is no advertisement packet, so the same concept doesn't really exist.
If the goal is to have a unique name for each device which the user may change, you will probably need to add a service with a name characteristic. If the purpose is just to inform the user that "An OWN product of this model" has connected, you should just use the device information service to establish what you have connected to. Also in this last case, you could use the custom service suggested first.
Best regards,
Rune Holmgren