Skip to content

Commit f3169fe

Browse files
committed
Usage_tips.md - 'Device Local Name' information to help guide setting the GATT Device Name or Advertising name.
1 parent 6f0b9dd commit f3169fe

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

docs/Usage_tips.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,30 @@ or nullptr such as when calling `NimBLEClient::getService`. The latter being a
3232
Most of the functions in this library return something that should be checked before proceeding.
3333
<br/>
3434

35+
## Device 'Local Name'
36+
37+
'Local name' refers to how the device is seen and displayed.
38+
39+
A devices 'Local name' can be thought of as coming from two places, the <i>Advertising "Local name"</i> and the <i>the GATT Device Name</i>.
40+
41+
### Advertising "Local name"
42+
43+
Field found in the advertising data payload. Value is set via NimBLEAdvertising::setName().
44+
45+
### GATT Device Name
46+
47+
Characteristic UUID 0x2A00 in the Generic Access service. Set via NimBLEDevice::init() or NimBLEDevice::setDeviceName().
48+
49+
This characteristic is read <b>after</b> connecting to the device.
50+
51+
### Important considerations
52+
53+
* OSes cache the <i>'GATT Device Name'</i>.
54+
* OSes update the device name based on the <i>'GATT Device Name'</i> after connecting to a device. This means that if you set the <i>Advertising 'Local name'</i> to "ABCD" but the <i>'GATT Device Name'</i> to "12345", the device will be seen as "ABCD" until connecting to the device, at which time the devices name will change to "12345".
55+
* If no <i>'Advertising "Local name"'</i> is set, OSes, such as iOS, may display the devices name as 'Unnamed' until the device is connected to, at which time the <i>'GATT Device Name'</i> is read and used instead.
56+
57+
It is recommended that both <i>'Advertising "Local name"'</i> <b>and</> <i>'GATT Device Name'</i> be set appropriately, after considering the above described behavior.
58+
3559
## There will be bugs - please report them
3660

3761
No code is bug free and unit testing will not find them all on it's own. If you encounter a bug, please report it along with any logs and decoded backtrace if applicable.

0 commit comments

Comments
 (0)