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?
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()?
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.