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

What is the most efficient way to transfer data over BLE ?

Hi everyone,

 I've just started to develop software for NRF51822 - Bluetooth Low Energy on the Evaluation Kit. I managed to connect the development dongle and evaluation kit successfully; but I want development dongle to send a data to the Eval. kit and according to that information, LED0 or LED1 will be on. I couldn't manage the data transfer part. What is the easiest and efficient way to provide data transfer 

by using BLE?

I'll be very grateful for your help. Thanks.

Parents
  • All data in BLE are transferred through what is called characteristics, contained in services. A service can either be an official service, ratified by Bluetooth SIG, like the ones listed here, or it can be a custom one that you build yourself for your own application. To transfer data over a BLE link, you therefore have to either choose an appropriate official one or build your own.

    If you want to build your own, I'd recommend you to take a look on the battery service, as contained in the nRF51 SDK (ble_bas.h, ble_bas.c). This is one of the most basic services, and should be a very useful starting point. For testing and developing, using the Master Emulator firmware on the PCA10000, combined with the Master Control Panel should be useful.

    For a general overview of applications built on the S110, I'd recommend you to take a look on the Introduction to the S110 document that is contained in the latest SDK's Documentation folder. When you have added a service and a characteristic with sd_ble_gatts_service_add() and sd_ble_gatts_characteristic_add(), a write to a characteristic will trigger a BLE_GATTS_EVT_WRITE, passed to your application thorough the softdevice event handling. If you need to pass data from the Peripheral to the Central, you should as Adam notes above take a look at the concept of notifications. Such packets can be send by using the sd_ble_gatts_hvx() function call.

  • Just for anyone stumbling across this, nAN-36 is now out, which should be useful to get started with custom services: https://www.nordicsemi.com/eng/content/download/34055/573345/file/nAN-36.zip

Reply Children
No Data
Related