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

Can BTLE communication happen without service discovery?

Hi, We have nRF51822 acting as a central and another nRF51822 acting as peripheral. The peripheral advertises at 1 second advertisement interval. The peripheral and central have connection intervals as 7.5msec (minimum) and 20msec (maximum). The idea is the peripheral would be advertising for 12 hours. When a button is pressed in the central, the central would start to scan, find the correct peripheral (uuid match), connect to it, exchange a few security information and then disconnect. We wanted the whole interaction to be as quick as possible. When we broke down the steps, we found that

  • the services discovery (after establishing a connection) takes around 1 to 1.5 seconds. Is this usual? We have 2 primary services (doesnt have any characteristics) and 1 unknown service. There are 2 characteristics under the unknown service.

  • Is it possible to exchange information without doing a service discovery? Both the central and the peripheral know the uuid to write to and read from. If so, do you have any examples that does this?

Thanks.

  • Firstly if you use 7.5ms interval on Central side and your GATT Service Discovery takes still 1-1.5s then you must have hundred of handles on Server side (which is unlikely). So your Service Discovery algorithm looks suspicious;) Discovering the right handle (if you look for one particular Characteristic under one particular Service on a stack with 14 occupied GATT handles) should take less then 100ms.

    Secondly sure GATT Service Discovery is purely matter of Client. If it is confident that it knows where the handles are then it doesn't need to do anything and fire Write/Read command straight after connection is established. You can have either static GATT Server side (so it can be cached/hardcoded on Server side) or you can hint some info through advertisement (if you have space there).

    1. We need a sniffer trace to see what exactly happens and why it takes 1.5s

    2. Yes, it's possible, but you need to know the characteristic handle values, not the UUID. You can find those handle values after service discovery and then can hardcode it in your application. You can also use nRF Connect (on PC) to find the handle values.

Related