BLE advertising

Hi,

I'm using an ESP32, I'm interested to know if it's possible to advertise in BLE the name and another field (serial number) that always shows even without a connection.

I'm using:
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEServer.h>
#include <BLE2902.h>

One quick way would be to pack the name and serial in the init call

  BLEDevice::init("myname,mySerial");

then it's directly visible without connecting

I thot about that but it's for a project that needs to have the name of the device separate from the serial. So you could change the name but not the serial from the Bluetooth settings.

Thank you anyway.

if you want to be able to edit attributes, then you need to be able to connect and need a writable characteristic and you won't see the details of the characteristic unless you connect

You could still do both, get name + Serial for the init and if you detect the name has been changed you change reset how the device is initialized and combine the new name and serial

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.