This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Strange behavior with PIN validation

I'm using Bluetopia Release v1.5 R2 (4.0.1.10) SDK and SSPLEDemo as a template to develop my code and I'm facing a strange behavior with PIN validation flow.

At PINCodeResponse(&Params) function a verification like below is being done:

 ASSIGN_PIN_CODE(PINCode, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);

 BTPS_MemCopy(&PINCode, TempParam->Params[0].strParam, BTPS_StringLength(TempParam->Params[0].strParam));

 /* Populate the response structure.                         */
 GAP_Authentication_Information.GAP_Authentication_Type      = atPINCode;
 GAP_Authentication_Information.Authentication_Data_Length   = (Byte_t)(BTPS_StringLength(TempParam->Params[0].strParam));
 GAP_Authentication_Information.Authentication_Data.PIN_Code = PINCode;

 /* Submit the Authentication Response.                      */
 Result = GAP_Authentication_Response(BluetoothStackID, CurrentCBRemoteBD_ADDR, &GAP_Authentication_Information);

The problem is that even when I entered a wrong PIN GAP_Authentication_Response is returning 0.

Link is not created and device not paired when PIN is wrong but the strange think is GAP_Authentication_Response returning 0 all the time.

How can I solved this issue?

Thanks and regards,

Felipe Castro