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

BLE Advertising - Appearance

I'm working my way through BLE Advertising, a beginner's tutorial and getting a SDK error 4001 when trying to use

advdata.include_appearance = true;

Can anyone point me in the right direction as to resolving this?

  • Hi. That's pretty strange. So it worked before, but not after adding appearance? Nothing else was changed? What SDK to you use? Error 4001 is:

    #define NRF_FAULT_ID_SDK_ERROR       NRF_FAULT_ID_SDK_RANGE_START + 1 /**< An error stemming from a call to @ref APP_ERROR_CHECK ....
    

    Have you tried stepping through your code with a debugger trying to find this particular APP_ERROR_CHECK()?

  • @Martin After stepping through the debugger, I was able to pinpoint the error from name_encode function which was returning NRF_ERROR_DATA_SIZE. The issue was that I had set advdata.short_name_len to 6. When I changed it to 3, it worked.

  • After stepping through the debugger, I was able to pinpoint the error from

    name_encode()

    function which was returning NRF_ERROR_DATA_SIZE. The issue was that I had set

    advdata.short_name_len = 6;

    per the tutorial. When I changed it to 3 (as was shown later in the tutorial), it worked.

Related