This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Cannot add function in main.c

Hi, I would like to ask that, whenever I put my function in main.c, the borad become undiscoverable.

I'm using nRF51 with ble_app_uart_s110_pca10028, and below are my function and main

image description image description

  • what is the results of

    ble_nus_string_send() .. 
    

    which you put into err_code?

    the next line, as is discussed here 50 times a week, is APP_ERROR_CHECK() which will go to the error handler if err_code is not zero. That's the most likely place you've ended up. Use the debugger to find out where you are and how you got there.

  • Sorry for asking a stupid question, but appreciate for your help!!

  • Hi 10Hsin.

    You too seriously transmitting data.

  • Hi caram5555, cause I'm just a beginner, so I just follow the example, is there any better way to transmit data using UART?

  • Hi 10Hsin. In your sample program, it constantly transmitting data between 0 to 9. The most important thing is why? Why you transmitting data 0 to 9 to one-side without any event or case? I mean .. transferring data is communication with your friends. Imagine this situation,

    1. you are designning sensor device(BLE UART) that can communicate with your smartphone(Central).
    2. your smartphone connect to your device and send a command to retrieve sensor value.
    3. your device wait for a command
    4. if your device received a sensing command, then your device write data using ble_nus_stringxxx

    Best regards.

Related