I'm developing an app that connects to a TI cc2540 (the keyfob, actually) and it is intended to send a "start" flag, that could very well be a simple short, whenever the user presses a button on the android interface to trigger a certain function. ( a GPIO rise in this case )
Now, i'm having trouble writing from android to the cc2540. For what i understand, i should declare a new service in the cc2540, give it write permissions and try and discover that with the android app.
If that's the way to go, how do you check within the cc2540 if the value has changed? Should it receive a callback when a value has changed? or is there a more appropriate way to do so.
I have tried to use the " static void performPerdicTask(void){...} " on the chip to check if the value has changed, but polling for a value just seems stupid.
Please note that this is the opposite of asking the BLE device to give you a notice when a sensor value in itself changes.. This time, it is the android device giving the value change update.
I have written code to connect and discover services, but it is not important in this case.
Has anybody done something like this?