Advertised name BLE

When setting a device into advertising mode, if I scan for BLE devices I will see the following:

I can set local name using advData.appendLocalName("AALP2_3");
Question can the Pseries-049308 be set to something else so the pairing and advertised name can be aligned to a product serial number?

I believe calling .appendLocalName() does change both of the values you see there, but the full name is likely cached on your phone. If you try using a different phone that hasn't scanned the device before, you may see the updated name.

Will your users be using a custom app to interact with the devices or will they be seeing the names through an app like BluefruitConnect? If it's a custom app you can always just interpret any local name as something else to display to a user. Otherwise if your device won't change its name dynamically, the user will see the full and local name correctly the first time.

If you're using a custom app and the device may change its name dynamically, I suggest parsing the local name from the advertising data so that it is always current and to not use the functions that just grab the cached name.

1 Like

I thought that .appendLocalName() changes both however the evidence is that it doesn't and BLE.setDeviceName() is required.

You are right that users won't be using BlufruitConnect. I am more concerned about other devices. As a product I want to hide the Particle serial number. The device name will not be changed dynamically - it may be user set though.

Thanks for your identification of the name length issue.

1 Like

If you're making a product where user will only have one, the last six digits of the serial number in the advertised name probably won't be necessary. But the reason it exists is if you're setting up P2/Argon devices in a classroom or hackathon, without that there is no way to determine which device you are setting up by BLE as it may be one nearby, not the one in front of you.

If you are using provisioning mode, instead of listening mode, the default is to always advertise even in normal operating mode so you can reconfigure a device with no buttons. In this case, if the user ever could have more than one device, you really need a way to differentiate between them.

Also you can change the "Pseries" string in the DCT (configuration flash), still leaving the last six digits of the serial number the same.

1 Like