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
  • Dear Karl,

    I have solved all the issues. I have one final question though.

    whenever i pass the command activation i am starting an app_timer that does certain functions and sends some outputs via notifications in a new custom characteristic.

    however whenever this loop finishes the timer stops.

    If the user now reenters the command activation, i can see with NRF_LOG_INFO("p_data = %d", p_evt->params.rx_data.p_data[0]); that it receives the command however it does not restart the app_timer_handle

    Shall i add something else in my nus_data_handle ?

     

    Kind regards,
    Kleanthis

Reply
  • Dear Karl,

    I have solved all the issues. I have one final question though.

    whenever i pass the command activation i am starting an app_timer that does certain functions and sends some outputs via notifications in a new custom characteristic.

    however whenever this loop finishes the timer stops.

    If the user now reenters the command activation, i can see with NRF_LOG_INFO("p_data = %d", p_evt->params.rx_data.p_data[0]); that it receives the command however it does not restart the app_timer_handle

    Shall i add something else in my nus_data_handle ?

     

    Kind regards,
    Kleanthis

Children
  • Hello Kleanthis,

    kleanthise said:
    I have solved all the issues.

    I am glad to hear that you have managed to solve all the issues - great!

    kleanthise said:
    If the user now reenters the command activation, i can see with NRF_LOG_INFO("p_data = %d", p_evt->params.rx_data.p_data[0]); that it receives the command however it does not restart the app_timer_handle

    It is hard to say exactly what you need to do in order to fix this - did you perhaps attach the wrong picture at the end? Without having seen the code, I can only offer general advice, but it sounds to me that you should make sure that the activate command properly reactivates the device following a deactivation, and then follow that configuration to see how the execution might be different for a re-activation compared to a first-time activation.
    Could it be that you use the active state in a function that is only called upon connection, and so if the connection is kept while the state is deactivated and reactivated, the device never goes through the section of code it should at the start of a activation, or similar?

    Best regards,
    Karl

  • Thanks a lot for the speedy response.

    I have added the two lines below err_code = (app_art_put(p_evt->params.rx.data.p_data[i])

    counter = 0;
    err_code = app_timer_start(m_notification_timer_id, COUNTER_INTERVAL, NULL);

    and now whenever i enter the activation command it goes through the function in the timer and at anytime if reenter the activation command it resets from start. that is exactly what i wanted it to do.

    Thank you very much for everything case closed :)

  • kleanthise said:
    Thanks a lot for the speedy response.
    kleanthise said:
    Thank you very much for everything

    It is no problem at all, Kleanthis - I am happy to help, and glad to hear that you have resolved your issues! :)

    kleanthise said:

    I have added the two lines below err_code = (app_art_put(p_evt->params.rx.data.p_data[i])

    counter = 0;
    err_code = app_timer_start(m_notification_timer_id, COUNTER_INTERVAL, NULL);

    and now whenever i enter the activation command it goes through the function in the timer and at anytime if reenter the activation command it resets from start. that is exactly what i wanted it to do.

    I do not have a entirely clear picture of the fix you describe here, since I have not seen it in the context of the rest of the code, but if you have verified it to work for your application that is all that matters. It looks to me that you were able to pinpoint that the activation configuration was not being called upon re-activation, and to fix this issue.

    kleanthise said:
    case closed :)

    Alright - great! :) 

    Please do not hesitate to open another ticket if you should encounter any other issues or questions in the future.

    Good luck with your development!

    Best regards,
    Karl

Related