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

I have a service, what code should I add a writeable characteristic? I want to use Nordic’s Android App to detect the NRF51 and recognize this characteristic. Then write a value to it(i.e. 0xcc) which the running app handles and goes into DFU mode.

Code_Replace_MainDotC.docx

Please look at the attachment of my code. Go to \nRF51_SDK_9.0.0_2e23562\examples\ble_peripheral\ble_app_template\pca10028\s130\arm5_no_packs in the SDK download and copy and paste the code that I have (after deleting the preexisting code).

I want to know the following:

  1. What should I add for adding a characteristic that is writeable?

  2. How do I add a handler for that characteristic, when it is written to?

  3. In that handler function, or interrupt, how exactly do I switch to dfu mode. (I am specifically having trouble with definition of the BLE_DFU_APP_SUPPORT value. Because in order for the DFU code to work I think the BLE_DFU_APP_SUPPORT has to be defined as a preprocessor directive "#define ... " but it is not defined in the code( at least, I do not think).

Related