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

BLE communication function

hi, im using ble_app_uart and im trying to do a simple communication and data transfer over bluetooth with my iOS.i want to send from the Bluefruit app a byte (0x55 for example) , reiceve it with the nRF , toggle a pin , and transmit a byte (0xAA for example). im using to transmit ble_nus_string_send, but i cant find the function that receives the data (so i can breakpoint and se the value).

Parents
  • Hi yk9,

      The easiest solution for you would be to just turn on logging through RTT.

    in sdk_config.h:

    //==========================================================
    // <e> NRF_LOG_BACKEND_RTT_ENABLED - nrf_log_backend_rtt - Log RTT backend
    //==========================================================
    #ifndef NRF_LOG_BACKEND_RTT_ENABLED
    #define NRF_LOG_BACKEND_RTT_ENABLED 1
    #endif

    And switch default severity level to 4:

    // <o> NRF_LOG_DEFAULT_LEVEL  - Default Severity level
     
    // <0=> Off 
    // <1=> Error 
    // <2=> Warning 
    // <3=> Info 
    // <4=> Debug 
    
    #ifndef NRF_LOG_DEFAULT_LEVEL
    #define NRF_LOG_DEFAULT_LEVEL 4
    #endif
    

     

    Use J-link RTT viewer with these settings:

    and you should be able to see what gets sent back and forth.

Reply
  • Hi yk9,

      The easiest solution for you would be to just turn on logging through RTT.

    in sdk_config.h:

    //==========================================================
    // <e> NRF_LOG_BACKEND_RTT_ENABLED - nrf_log_backend_rtt - Log RTT backend
    //==========================================================
    #ifndef NRF_LOG_BACKEND_RTT_ENABLED
    #define NRF_LOG_BACKEND_RTT_ENABLED 1
    #endif

    And switch default severity level to 4:

    // <o> NRF_LOG_DEFAULT_LEVEL  - Default Severity level
     
    // <0=> Off 
    // <1=> Error 
    // <2=> Warning 
    // <3=> Info 
    // <4=> Debug 
    
    #ifndef NRF_LOG_DEFAULT_LEVEL
    #define NRF_LOG_DEFAULT_LEVEL 4
    #endif
    

     

    Use J-link RTT viewer with these settings:

    and you should be able to see what gets sent back and forth.

Children
  • thanks,

    my question is much simpler, i want 2 functions, transmit and receive. i want to communicate, via bluetooth, between my chip (on feather) and an app on my iPhone (Bluefruit for example).
    I want my main() to  wait to receive 1 byte from the app and transmit 1 byte (acknowledge) back to the app .
    can you help me find the easiest way to do that?

    also , how can i debug (breakpoint?) it ?

Related