NUS_C and NRF_ERROR_INVALID_STATE

Hello Nordic Engineer,

I used SDK17.1.0 and examples \ ble_central_and_peripheral \ experimental \ ble_app_multirole_lesc

In the example above, I deleted HRS and added NUS and NUS_C

There are two devices, A and B, both running on the multirole program. The current connection situation is: the phone is connected to A, and A is connected to B. A can receive data from the phone, but when I try to send data through 'ble_nus_c_string_send,' it fails

Is this issue related to CCCD enabling? If so, could you please tell me specifically what needs to be done? Is it the central part that needs modification, or the peripheral part?

Thanks

  • Hello,

    Is this issue related to CCCD enabling? If so, could you please tell me specifically what needs to be done? Is it the central part that needs modification, or the peripheral part?

    Your central device will need to enable CCCD on the characteristic in the peripheral, so that the peripheral is permitted to update the central when there is a change in the characteristics value. Please make sure that your central device sets the CCCD following the NUS service discovery.

    However, the INVALID_STATE error is usually returned when you attempt to write to a connection handle that does not have an active link.
    Are you certain that the connection is live when this happens?
    Could you provide the logs from your device when this issue occurs?
    Please make sure to have DEBUG defined in your preprocessor defines like shown in the included image, so that your logger will output a detailed error message whenever a non-NRF_SUCCESS error code is passed to an APP_ERROR_CHECK:



    Best regards,
    Karl

  • Hi Ylvisaker,

    I have already solved it.

    ble_nus_c_on_db_disc_evt(&m_ble_nus_c, p_evt); 
    
    

    No one answered questions during the Easter holiday(cry...).

  • Hello,

    I am glad to read that you have already resolved the issue! 

    tony55723 said:
    No one answered questions during the Easter holiday(cry...).

    Yes, DevZone operates with reduced staff during easter and other public holidays in Norway - apologies for the inconvenience! :)

    Best regards,
    Karl

Related