Obtaining BLE Central device name from a BLE Peripheral

Hi Nordic team,

I'm using nRF52832, S132 with nRF5_SDK_17.1.0_ddde560 SDK. My app configures as BLE Peripheral. Now I want to keep track of the device names of connected peers. From a few searches on this forum, I learned that a device can only read the connected device if it has BLE Central capability. Is this true? If yes, can you please show me some information or example code that does this? I prefer to only use BLE Peripheral if possible to keep flash usage small so if there is a way to do it in BLE Peripheral, I would love to hear it first.

Thank you very much for your help.

Best regards,

Xander

Parents
  • I learned that a device can only read the connected device if it has BLE Central capability. Is this true? If yes

    Both peers (Peipheral and Central) should be able to read each other services, but before the connection is established only the scanner (only available in device configured as central) can read the advertising packets.

    There is a thread with similar question here, please check that. It looks to me that it might be useful to you.

Reply
  • I learned that a device can only read the connected device if it has BLE Central capability. Is this true? If yes

    Both peers (Peipheral and Central) should be able to read each other services, but before the connection is established only the scanner (only available in device configured as central) can read the advertising packets.

    There is a thread with similar question here, please check that. It looks to me that it might be useful to you.

Children
  • Hi Susheel,

    I want to get the device name after it is connected. The link you sent was for BLE Central. How can I do peer name finding from BLE Peripheral after connection is established?

    Best regards,

    Xander

  • Unfortunately, In Bluetooth Low Energy (BLE), the central device typically does not advertise its name or other identifiers like a peripheral device does. However, it is possible to define a name or other identifier on the central side and read it on the peripheral side after establishing a connection. This would require adding support for it in your software.
    The Device Information Service (DIS) server can be used in the central device, but you would need to create a DIS client implementation on the peripheral side. This client would be responsible for reading the central device's name or other identifiers after a connection has been established. While the device name is not typically part of the DIS, you could potentially add a custom characteristic to the DIS on the central device to hold the device name. The peripheral could then read this characteristic to get the central device's name. Unfortunately we do not have a sample to demonstrate that.
    As mentioned, it is possible but there is no support for it and no example of that in the SDK, so you will have to add support for it yourself. To be clear, the existing DIS server can be used in the central, but you will have to make a DIS client implementation yourself that you can use on the peripheral
  • Hi Susheel,

    The peers will be smartphones, which can serve as both BLE Central and BLE Peripheral. I wonder is there any drawback in power consumption if I add the BLE Central role to my current BLE Peripheral firmware? 

    Best regards,

    Xander

Related