0

I want my app to send a "non-connectable" advertisement?

When I see the startAdvertsing method, it says that only CBAdvertisementDataLocalNameKey and CBAdvertisementDataServiceUUIDsKey are supported.

Does this mean the CBAdvertisementDataIsConnectable cannot be set to NO, to simulate a iBeacon?

If there is some other way to simulate a "non-conectable" peripheral, please let me know.

advertisementData - An optional dictionary containing the data you want to advertise. The possible keys of an advertisementData dictionary are detailed in CBCentralManagerDelegate Protocol Reference. That said, only two of the keys are supported for peripheral manager objects: CBAdvertisementDataLocalNameKey and CBAdvertisementDataServiceUUIDsKey

Bart Platak
  • 4,387
  • 5
  • 27
  • 47
Smart Home
  • 801
  • 7
  • 26

1 Answers1

0

I think the term "connectable" may be leading to some concerns. The "connection" is about the central (i.e. the client) querying the characteristics (i.e. properties) exposed by your service.

As documented, the specific key you mention is unsupported (at this time), but I cant understand why its availability is necessary to you.

If you don't have any characteristics associated with your service, then there will be nothing to connect to. Correct? In fact, if you skip the CBAdvertisementDataServiceUUIDsKey key from advertisement, then the peripheral will appear to have no services, and hence no characteristics to query (via the connection).

vpathak
  • 1,133
  • 12
  • 12
  • Actually, that's not the case. There are several types of advertising packet defined in the Bluetooth specification. ADV_NONCONN_IND is a "non connectable undirected advertising" packet and I think that is what the question is about. – martin_bluetooth_sig Jul 21 '17 at 07:33
  • yes - and it was unsupported (in ios core bluetooth framework) at the time. i havent touched it recently but if supported you could add a code sample – vpathak Jul 24 '17 at 02:02