This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

What is the best way to automate bluetooth connection?

The product that is in development could be used by the 100s at the same venue, if we let customers picks their device from a list there will be a lot of wrong connections and as such we decided to automate the connection process by making each device uniquely identifiable (by using NRFs 64bit manufacturing id as the unique key).

Assume that a device we picked out at random, has nrf manufacturing id as 0x12FAAACDFADE3478. We would have this unique key printed on it's boxing as a QR code which the app will scan.

We currently came up with these two ways to implement the app side automation,

  1. Append nrf's manufacturing id to device name so that, it will advertise as say 'KOI_12FAAACDFADE3478' and we scan and connect to a device with this name [problem, there is no 'scan with name' API in iOS and it needs to be implemented via code]

  2. Advertise a fake 128bit uuid like '00000000-0000-0000-12FA-AACDFADE3478', and then have the app scan and connect to a device advertising with this fake uuid [this is the preferred method as both iOS and android has a 'scan with uuid' API and time taken to connect to the device with the 'scan with uuid' API in iOS lower than the 'scan with name' code implementation]

Questions Is both methods allowed? Will the product qualify bluetooth SIG qualification if we implement either of them? specifically step 2?

Is there a better way than this?

PS: For step 2, we only add that fake uuid in advertising packet, there won't be any actual service with that uuid.

Parents
  • Both ways are allowed. But I would recommend that you advertise using manufacturer specific data for the unique id. That is ad type 0xFF Manufacturer Specific Data. However to use this you need a company identifier.

    Edit: Thinking about it I'm not 100% sure about option 2 above so I will have to check. At least you can use the name, Manufacturer specific data or service data for custom information. From CSS "If a device has no Service UUIDs of a certain size, 16-, 32-, or 128-bit, the corresponding field in the extended inquiry response or advertising data packet shall be marked as complete with no Service UUIDs." Not sure how or if this is enforced in any way.

  • Yes, the 2 bytes of header is needed. Length and ad type. This means you should use one of the specified ad types.

    As for Manufacturer specific data. I'm afraid that is misleading. You should look at the supplement to Bluetooth core specification, CSS v7: The Manufacturer Specific data type is used for manufacturer specific data. The first two data octets shall contain a company identifier code from the Assigned Numbers - Company Identifiers document. The interpretation of any other octets within the data shall be defined by the manufacturer specified by the company identifier.

Reply
  • Yes, the 2 bytes of header is needed. Length and ad type. This means you should use one of the specified ad types.

    As for Manufacturer specific data. I'm afraid that is misleading. You should look at the supplement to Bluetooth core specification, CSS v7: The Manufacturer Specific data type is used for manufacturer specific data. The first two data octets shall contain a company identifier code from the Assigned Numbers - Company Identifiers document. The interpretation of any other octets within the data shall be defined by the manufacturer specified by the company identifier.

Children
No Data
Related