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

Feeding data into the BDS example

I've recently been playing around with Bluetooth Developer Studio, and I can see it's potential despite it having a few annoying bugs.

I've set up a custom service by re-purposing the Battery Service for now (For some reason I couldn't get an exact copy of the battery service to actually send any sort of data value despite my best efforts). Now I'm trying to figure out how to actually pass data from read from the TWI into these characteristics and have them update.

I can't seem to understand where I should be putting data to make this happen. Am I missing something obvious here?

Parents
  • What problems did you have with the battery service? In the generated code you can set the battery level with ble_bas_battery_level_set(), which is defined in ble_bas.c. I just tested by adding the battery service (unmodified) to a design with the heart rate profile, and what I set with ble_bas_battery_level_set() is what I read as the attribute value in Master Control Panel.

  • Thanks for your reply Einar.

    The battery service and characteristic itself work completely fine. Where I noticed an issue was when I set up a customer service and characteristic, that looked identical to the BAS in everything but the UUID. In this case getting the characteristic field values through the master control panel did not send back a value for the 'custom' copy of the characteristic.

    Perhaps there's something under the surface that I'm not able to add manually, but I made sure I had the correct descriptors present as well as the field. What I'm seeing now is a plugin error when I try to rebuild this from scratch, however.

    Also, thanks for the tip on the value setting function. I have noticed my custom characteristics based on the BAS generate a function like this also. I'm having trouble implementing it in main.c however. is this the wrong place to invoke the function?

Reply
  • Thanks for your reply Einar.

    The battery service and characteristic itself work completely fine. Where I noticed an issue was when I set up a customer service and characteristic, that looked identical to the BAS in everything but the UUID. In this case getting the characteristic field values through the master control panel did not send back a value for the 'custom' copy of the characteristic.

    Perhaps there's something under the surface that I'm not able to add manually, but I made sure I had the correct descriptors present as well as the field. What I'm seeing now is a plugin error when I try to rebuild this from scratch, however.

    Also, thanks for the tip on the value setting function. I have noticed my custom characteristics based on the BAS generate a function like this also. I'm having trouble implementing it in main.c however. is this the wrong place to invoke the function?

Children
No Data
Related