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

how to send data from nRF52832 to phone

now i use nRF52832 and my using paccage is SDK14.0.0 i could send data from phone to nRF52832. next i wanna send data from nRF52832 to phone. but i don't know where to change in the source code. What should i do?

thank you in advanced

Parents
  • Hi Kaito!

    There is several ways to do this. You can send some data to your phone after a keypress, at a certain event or set up a timer and send data at a fixed interval etc. I also don't know what type of data you want to send.
    There are several examples in the SDK that can send data to your phone. But you can take a look at the ble_app_uart example, and the way it is done there.

    Just as a simple example, you can add this to the bsp_event_handler in the ble_app_uart example:

    case BSP_EVENT_KEY_1:
    {			
    uint8_t data[6] = "Hello!";
    uint16_t length = 6; 
    ble_nus_string_send(&m_nus, data, &length);
    }
    

    This will make your application send the string "Hello!" each time you press button 2, if you connect your phone via UART in the nRF Toolbox app.

    Best regards,
    Joakim.

Reply
  • Hi Kaito!

    There is several ways to do this. You can send some data to your phone after a keypress, at a certain event or set up a timer and send data at a fixed interval etc. I also don't know what type of data you want to send.
    There are several examples in the SDK that can send data to your phone. But you can take a look at the ble_app_uart example, and the way it is done there.

    Just as a simple example, you can add this to the bsp_event_handler in the ble_app_uart example:

    case BSP_EVENT_KEY_1:
    {			
    uint8_t data[6] = "Hello!";
    uint16_t length = 6; 
    ble_nus_string_send(&m_nus, data, &length);
    }
    

    This will make your application send the string "Hello!" each time you press button 2, if you connect your phone via UART in the nRF Toolbox app.

    Best regards,
    Joakim.

Children
No Data
Related