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

Include Service Changed characteristic with custom behavior

I'd like to know, it there a way to include the service changed characteristic, but not have it indicate that services were changed unless I tell it to? Here is my situation, we can't use bonded devices for various reasons, and we need fast connections. With the service changed characteristic disabled, connections take about half a second. With service changed enabled, connections take about 2 1/2 seconds. But we need to be able to also support changing characteristics, as iOS won't let us invalidate the bluetooth cache, and we don't want to require users to cycle bluetooth power or restart their device to trigger a fresh service scan. Does anyone know of a way to achieve what we are looking for? It seems if we include the service changed characteristic at all, all service scans are slow, regardless if we don't actually send a handle range to the characteristic.

Parents
  • Just to make things clear, the time it takes make a connection is the same right? But when the Service Changed characteristic is included iOS performs service discovery on every connection, and this takes 2 extra seconds?

    The way to get around this is to use bonding, which you say you can't use, so I'm not sure what to suggest. The specification clearly states that:

    Clients without a trusted relationship must perform service discovery on each connection if the server supports the Service Changed characteristic.

    For more information see Bluetooth Core specification v4.2, Vol. 3, Part G, Section 2.5.2.

Reply
  • Just to make things clear, the time it takes make a connection is the same right? But when the Service Changed characteristic is included iOS performs service discovery on every connection, and this takes 2 extra seconds?

    The way to get around this is to use bonding, which you say you can't use, so I'm not sure what to suggest. The specification clearly states that:

    Clients without a trusted relationship must perform service discovery on each connection if the server supports the Service Changed characteristic.

    For more information see Bluetooth Core specification v4.2, Vol. 3, Part G, Section 2.5.2.

Children
No Data
Related