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

send the data from nRF52832 to phone

The last time, i could wireless communication by pressing a botton. The next time, i wanna send the data to phone if the communication is established. i modified the source code of "main.c" of "void uart_event_handle", but i couldn't send the data. if somebody knew my mistake, please teach me!!

The picture which modified the source code is shown in below. gyazo.com/6d6ac38430d227f238c0e355ba929a91

thank you in advanced.

Parents
  • Hi Kaito.

    I'm afraid your code will not do much.
    In the event handlers, your application will do certain tasks based on what event is returned from the Softdevice.

    In your case, if you want to send the string when the device is connected. You should not send data on the connection event, (unless you are already bonded and HVX is enabled). Please take a look at this thread and run_ar's answer. As Runar said in his answer, you can take a look at how this is handled in the HRS example.

    I would aslo suggest that you take a look at our tutorials here on DevZone. You can find a lot of useful information there. A good place to start could be the Advertising, Service and Characteristic tutorials.

    Hope that helps.
    Best regards,
    Joakim.

Reply
  • Hi Kaito.

    I'm afraid your code will not do much.
    In the event handlers, your application will do certain tasks based on what event is returned from the Softdevice.

    In your case, if you want to send the string when the device is connected. You should not send data on the connection event, (unless you are already bonded and HVX is enabled). Please take a look at this thread and run_ar's answer. As Runar said in his answer, you can take a look at how this is handled in the HRS example.

    I would aslo suggest that you take a look at our tutorials here on DevZone. You can find a lot of useful information there. A good place to start could be the Advertising, Service and Characteristic tutorials.

    Hope that helps.
    Best regards,
    Joakim.

Children
No Data
Related