Create new characteristic in custom_data_service


#1

Hi Everyone!
I am trying to create new characteristic in predefined service(custom_data_service). I want to read the particular pin say D6 when I am writing data on bluz. For creating new characteristic, should I need to change the firmware or it can be done on application part only.

Please guide me :slight_smile:


#2

For now, it is not available in the system firmware. So you must change that if you want to add new characteristics.

This is on the list to add to the user part, don’t have a date yet


#3

Hi,

Can you please help me, in creating a new characteristics for reading a particular pin with the help of an example.

(I am very new to bluz, so sorry if I am asking something silly. :sweat:)

Thanks


#4

You may not need to make a new characteristic. What are you trying to do exactly?

If you just want to use local communication, then it would probably just be easiest to just use the basic local communication example here: http://docs.bluz.io/tutorials/local_communication/


#5

In my project the status of D5 pin is sometimes HIGH and sometimes it is LOW, and I want to know that status via my app. so, I want to read the status of my D5 pin, for that I am trying to make a new characteristic which can allow me to do so.

Is there any other way also to do the same? Please let me know about that.

Thanks


#6

Yes, you can simply use the characteristics already available from bluz, you don’t need to create a new one.

You can look into our open source app to see how you can do this.


#7

Yes I have seen the examples and the characteristics but I want to read the status of D5 pin locally(No particle connection) and for that, If I’m not wrong then there is only one example for local communication custom_data_service but in that example, I saw at the read, write and notification characteristics but I I don’t know that In firmware where these characteristics are specified?
I hope you will help me.
Sorry to drag this much!


#8

You don’t need to specify the characteristics on the bluz DK side. All you need to do is call BLE.sendData() and the data will be written to the characteristic for you. Then your app can read the data, using our app as a blueprint.

This doesn’t require the Particle connection.

You can look into the system firmware to see where and how we use those characteristics, but it really isn’t necessary: https://github.com/bluzDK/bluzDK-firmware/blob/develop/platform/MCU/NRF51/SPARK_Firmware_Driver/src/ble_scs.c