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

After I change the nus uuid, the smartphone cannot receive data.

Hi,

I am using 

  • nRF52840
  • SDK 15.3.0
  • Keil IDE
  • The soft device is S140 
  • JLinkRTTViewer for debug

Question 1)

I program based on peripheral\app_uart

1) Connection with nRFConnect is successful

     Nordic UART service is displayed

2) When nrfconnect writes data while connected, the static void nus_data_handler(ble_nus_evt_t * p_evt) function of nrf52840 receives the data.

3) When sending data using "ble_nus_data_send(&m_nus, (uint8_t*)nus_tx_buffer, &l, m_conn_handle);" of nrf52840 while connected,

   it return 0x08(err_code)

is it correct ?

Parents
  • Hello,

    is it correct ?

    That depends, did you change the nus UUID of only the TX service?
    If you change the UUID of only one service, or if you did not change it accordingly in the central, then this will not work. I am guessing that the ble_nus_data_send function fails because the central did not recognize the new uuid and therefore did not enable notifications on the characteristic. When the nRF52840 then went to sent a notification, it will generate an error.
    Could you please elaborate on exactly where you changed the UUID, and why you made the change?

    Could you also verify that you have DEBUG defined in your preprocessor defines?
    It should look like the included image:

    With DEBUG defined in the preprocessor defines the generated error and which function returned the error will be written to the log.

    Best regards,
    Karl

Reply
  • Hello,

    is it correct ?

    That depends, did you change the nus UUID of only the TX service?
    If you change the UUID of only one service, or if you did not change it accordingly in the central, then this will not work. I am guessing that the ble_nus_data_send function fails because the central did not recognize the new uuid and therefore did not enable notifications on the characteristic. When the nRF52840 then went to sent a notification, it will generate an error.
    Could you please elaborate on exactly where you changed the UUID, and why you made the change?

    Could you also verify that you have DEBUG defined in your preprocessor defines?
    It should look like the included image:

    With DEBUG defined in the preprocessor defines the generated error and which function returned the error will be written to the log.

    Best regards,
    Karl

Children
No Data
Related