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

how to C program to send data by GATT service characteristic value

Dear Sir/Madam,

I have a sensor prototype board using nRF51822 for Bluetooth communication and I am now working on its firmware. I have installed MDK version 5.16 and using Seggar JLink.  I have downloaded SoftDevice S110 and installed it on the system. 

The task of firmware is very simple: send the sensor data every 10ms through the updates of GATT characteristic value. 

I am a newbie to Nordic SoC and Bluetooth but I guess my firmware should be very simple as following:

main()

{

UUID_Service   uuid_svc;

UUID_Charactristic   uuid_char;

long  sensor_data;

//step1: initialize bluetooth

//step2: advertise itself

//step3:  accepts connection

    while(true){

           //step 4:  samples the sensor and updates sensor_data to the service/characteristic of the defined UUIDs

    }

I am not sure whether my above description is correct or not. If I am wrong please correct me.

My problem is that I don't know what functions should be called at each step. Could you give me some advice on it? 

Any suggestion will be welcomed. I do appreciate your help!  

Jun

Parents Reply Children
No Data
Related