Hi Dialog Team,
Can i use sample128_val_ind_handler() to handle write of all the characteristic event indication from sample128 profile ? Or do i have to create handler functions for each characteristic?I have four characteristics and i want to control one GPIO pin from each characteristic. How should i implement this?
Keywords:
Device:
Yes, you can use only one handler function. If you want to be efficient, you can only use one characteristic. One byte in characteristic value attribute could indicate the state of IO pin
Hi Vesa,
I want to control 4 GPIO pins. One characteristic for each pin.
How does "One byte in characteristic value attribute could indicate the state of IO pin"?
I am using only one handler function but the output is correct for only the first characteristic. I am able to write in the remaining 3 characteristics but cant control the GPIO pins on this basis. Please help.
Hi Sam123,
there are many ways to do that I suppose. You can hold the state of GPIO pins in one byte, each bit representing one pin. For example 1 could indicate HIGH and 0 is LOW. Then
1101 0000
would mean pins 1, 2 and 4 are HIGH and 3 is LOW. Writing to the characteristics would change the pin states correspondingly.Unfortunately, I think it is not possible to have a separate handler function for gatt read operation for DA14580, if I remember correctly. It might be handy, but you can manage without it too.