0

What is the best way to automate bluetooth connection?

mithunmathew1990 gravatar image

asked 2017-08-12 12:04:37 +0200

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.

edit retag flag offensive close delete report spam

1 answer

Sort by ยป oldest newest most voted
2
run_ar gravatar image

answered 2017-08-15 09:47:42 +0200

updated 2017-08-16 09:32:29 +0200

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.

edit flag offensive delete publish link more

Comments

I am planning to go with fake uuid method, as it is the easiest one to implement. Thank you for responding.

Mithun Mathew ( 2017-08-15 13:09:50 +0200 )editconvert to answer

@run_ar

There seems to be conflicting information from Nordic in regards to what can be in the advertising packet as a whole and also the manufacturer data specifically

e.g. see the answers from Nordic to this question

https://devzone.nordicsemi.com/questi...

Has an example showing that the whole advertising packet can be taken up with 2 bytes of header and 29 bytes of

"// now fill the 29 bytes with whatever you want"

Roger Clark ( 2017-08-15 13:14:06 +0200 )editconvert to answer

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.

run_ar ( 2017-08-16 09:22:59 +0200 )editconvert to answer

I'll wait for your update! Thank you.

Mithun Mathew ( 2017-08-16 11:00:16 +0200 )editconvert to answer

@run_ar

I'm not sure is this matters unless @Mithun Mathew wants to sell a product that is listed as Bluetooth compliant.

I'm also wondering how any open source devices could use manufacturer data, as these would not have a manufacturer ID, as there is no manufacturer.

Roger Clark ( 2017-08-16 11:40:07 +0200 )editconvert to answer

@roger Clark, I am still learning about the declaration & qualification procedures of SIG, so please correct me if I am wrong. From what I know, to be able to legally sell any product that uses bluetooth, it has to be qualified by SIG first & to get qualified, the product has to be bluetooth compliant.

Mithun Mathew ( 2017-08-16 17:04:41 +0200 )editconvert to answer

Edit. Removed my comment, as I miss understood your question in this regard

Roger Clark ( 2017-08-17 00:48:52 +0200 )editconvert to answer

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer. Do not ask a new question or reply to an answer here.

[hide preview]

Question Tools

1 follower

Stats

Asked: 2017-08-12 12:04:37 +0200

Seen: 103 times

Last updated: 16 hours ago