nRF_SDK_17.1.0 s140 pca10056 BLE_UART

Hello all,

I am trying to develop an application where the user will input some specific commands i.e hex value of 0x01 via a mobile application and then via bluetooth this command will be passed to the computer using UART.

I have compiled the ble app uart on my nrf52840 but i am struggling to modify the code for my application.

Could someone help me with this ? 

Thanks

Kleanthis

Parents Reply Children
  • kleanthise said:
    Sorry for being so naive but when i try to run the code is giving me an error of 'm_device_state' undeclared (first use in this function)

    No need to apologize! :) Yes, the code I provided was meant more as an example of how you could implement this functionality rather than an actual implementation - so some key parts, like the variable declaration, were not included.
    It could look something like this, someplace towards the top of your main.c file:

    static uint8_t m_device_state = 0;

    You will also need to implement a function or code section that resets this variable to 0 again, since the device probably should not remain activated for perpetuity when you have first activated it.
    You will need to determine what event or happening in your application that should set this to 0. Perhaps the _DISCONNECTED event, or a deactivate command, or both?

    Best regards,
    Karl

Related