sandeepmistry / arduino-BLEPeripheral

An Arduino library for creating custom BLE peripherals with Nordic Semiconductor's nRF8001 or nR51822.
MIT License
462 stars 179 forks source link

local name is not broadcast when device is not connectable #157

Closed floe closed 7 years ago

floe commented 7 years ago

In BLEPeripheral.c, the local name is put into the scan response data block: https://github.com/sandeepmistry/arduino-BLEPeripheral/blob/master/src/BLEPeripheral.cpp#L121-L132

However, when the device is not connectable, the advertisements will have data type ADV_NONCONN_IND. That basically means that the device doesn't ever listen for incoming data, so the central will also never request a scan response, and the local name will never be broadcast.

In this case, it would be better to use ADV_SCAN_IND instead; I've already verified that the name is shown again in this case.