Bluetooth Specification questions

Hi Dauden,

Yes it is.
But please be aware that if you have HomeKit enabled (only on Smart Lock 2.0 or 3.0) there is also the HomeKit specific advertisement going on in between according to Apple Specs.

best,
Marc

Thanks for the answer!
So, in your original post you talked about the rssi but i guess you were talking about the TX power in the manufacturer data.
In the v2 I can see the tx values 0xC4 and 0xC5, but with the v3 i see a baffling 0xC8 :thinking:

Still digging it.

Hi Dauden,

Yes, I’ve been talking about the TX power within the iBeacon.

You’re right about the Smart Lock 3.0, sorry.
The values did change there to 0xC8 and 0xC9.
But it is not the value itself that matters its the lowest bit of it.

It’s best to look at it’s binary representation:
0xC4 is 11000100 and
0xC5 is 11000101

0xC8 is 11001000 and
0xC9 is 11001001

So for best compatibility look at the lowest bit instead of the value directly.

best,
Marc

Perfect, thanks for the clarification!

Hi @marc

Found this topic and it really helped implementing our event handler.

I have an additional question, we have a BLE scanning window and too make sure we do not miss an advertisement I would like to know what the interval is ( or the different intervals are as I guess you can set this with the “advertising mode” in the config)

Thx,
Jeroen

Hi Jeroen,

Yes you’re right, the intervals are dependent of the setting within the config.
They are between ~400ms and ~1s.
The exact values have been chosen for best compatibility with the scan windows of iOS and Android smartphones (see rf - BLE Scan interval and window - Electrical Engineering Stack Exchange).

In order to not miss an advertisement we recommend a scan window of 40ms, a scan interval of 40ms and a total scan duration of at least 3 seconds.

Btw. once you establish a connection to the Smart Lock we recommend using a connection interval of 15ms.

best,
Marc

1 Like

Thx Marc, this really helps! I will set these values as defaults in the library.

What do you mean with “connection interval”?
What we do now is that before we send a message to the lock we connect to the Nuki (this causes scanning to stop) and what I see happening is that when the exchange of messages stops the lock disconnects after ~60 seconds. If we need to send another message we reconnect.

Should we keep the connection alive?

(we have to figure out if and how we can both scan for advertisements and be connected at the same time…)

The “connection interval” is one of the parameters the master device chooses when establishing the connection.
See e.g. Understand BLE connection intervals and events in 5 minutes | Novel Bits

clear, found the settings, but have to set a minimum and maximum.

Any recommendations for these for the smart lock?

uint16_t minInterval
uint16_t maxInterval
uint16_t latency
uint16_t timeout

and an additional question, does the lock continue with sending advertisements when it is connected?

You can set both min and max to 15ms.
Latency to 0 and the supervision timeout to 2 seconds.

Smart Lock 1.0 only supports one connection so after a connection is established, the advertisements stop.
Newer generations of the Smart Lock support multiple connections so advertising continues on that devices.