Numeric Comparison Method Implementation Issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Numeric Comparison Method Implementation Issue

9,014 Views
Javad_Baig
Contributor II

Hello,

I am trying to Implement Number Comparison bluetooth method with MITM protection, as per the Numeric comparison method when pairing is initiated 6digit key should appear at the both end(mobile and device end) which is generated by RNG, when I am trying to connect I am not getting the 6 digit key and also pairing is not happening below are the changes which I had made in the wireless_uart code(BM) for pairing parameter

Javad_Baig_0-1640614451952.png

 

I have enabled the bonding and pairing info like below

Javad_Baig_1-1640614568183.png 

Note :- I am using KW38 Controller and wireless uart BM example code

Kindly let me know what other changes are required which I have missed here, and also is it possible to get the bonded paired information. Kindly revert back the earliest

Thanks 

 

 

0 Kudos
Reply
17 Replies

8,897 Views
xing_chang
NXP Employee
NXP Employee

Hi,

On my side, gIoDisplayYesNo_C and gIoKeyboardDisplay_C both work fine, maybe it's the phone causes the different behavior.

0 Kudos
Reply

8,975 Views
xing_chang
NXP Employee
NXP Employee

Hi @Javad_Baig ,

please change the IO capabilities to displayYesNo,

gPairingParameters.localIoCapabilities = gIoDisplayYesNo_c;

 

You can use Gap_LoadKeys() to read bonded info.

0 Kudos
Reply

8,967 Views
Javad_Baig
Contributor II

Hello @xing_chang,

Thank you for your response, I changed the localIoCapabilites parameter to 

gPairingParameters.localIoCapabilities = gIoDisplayYesNo_c;

again when I try to connect with Device it is showing "pair" option without displaying 6digit key generated from RNG, and also I tried looking for the variable which stores the key generated by RNG in the device end I couldn't able to find it. 

Please again look in to the configuration which I shared in the previous post and let me know if any further changes are required for Numeric Comparison Method

 

I have attached a screenshot for the same, her I have changed the device name to 012345, when I try to connect with this device directly it is asking for pairing option without displaying 6-digit number

 

 

 

 

 

0 Kudos
Reply

8,937 Views
xing_chang
NXP Employee
NXP Employee

Hi @Javad_Baig 

You need to press "PAIR" first, then the 6digit key is shown. 

 

e8e5fc2d8fcec2dabd0581552bc652c.jpg

4c0f644ed021f4158f5f3ad274bc58d.jpg

0 Kudos
Reply

8,928 Views
Javad_Baig
Contributor II

Hello @xing_chang,

Thanks for the reply, for me after click on "Pair", status is showing as connected, I am not getting that 6digits 

Connected_Status.jpg

Pair_IoT Toolbox.jpg

 

0 Kudos
Reply

8,910 Views
xing_chang
NXP Employee
NXP Employee

This is my test environment:

SDK: SDK_2_6_14_FRDM-KW38

Phone: Huawei Mate40E

Attach the modified files.

0 Kudos
Reply

8,884 Views
Javad_Baig
Contributor II

Hello, @xing_chang 

 

I compared your file and did the same changes as yours, still it is the same. When I click on "Pair" it will get connected automatically without displaying 6 digits.

 I am using Samsung A30s Phone.

and also can you tell me which variable holds the 6digit key in the software end so that I can debug and check.

 

Thanks

0 Kudos
Reply

8,871 Views
xing_chang
NXP Employee
NXP Employee

Hi @Javad_Baig ,

In the Core spec 5.0, there is a table as follows, the phone as initiator with KeyboardDisplay, and KW38 as responder with DisplayYesNo or KeyboardDisplay, it should be Passkey Entry or Numeric Comparison, I don't why it is Just Works on your side. Could you capture some air log?

xing_chang_0-1640771178644.png

 

xing_chang_1-1640771217960.png

 

0 Kudos
Reply

8,868 Views
Javad_Baig
Contributor II

Hi, @xing_chang 

 

Can you please tell me how to capture the airlog, since I am not aware of it and also can you please tell me the variable which holds 6 digit key so that I can put that in watch window

Thanks

0 Kudos
Reply

8,862 Views
xing_chang
NXP Employee
NXP Employee

You need a sniffer to capture the log, like this Ellisys - Bluetooth Tracker - Bluetooth Low Energy and WiFI Protocol Analyzer

In the event below, you can print the Numeric value.

case gConnEvtLeScDisplayNumericValue_c:
{
(void)Serial_Print(gAppSerMgrIf, "gConnEvtLeScDisplayNumericValue_c: ", gAllowToBlock_d);
(void)Serial_PrintDec(gAppSerMgrIf, pConnectionEvent->eventData.numericValueForDisplay);
(void)Serial_Print(gAppSerMgrIf, "\n\r", gAllowToBlock_d);
}
break;

0 Kudos
Reply

8,858 Views
Javad_Baig
Contributor II

Hello, @xing_chang 

 

I dont have a sniffer tool to capture the log. Is there any alternative way to resolve this issue?

0 Kudos
Reply

8,843 Views
xing_chang
NXP Employee
NXP Employee

if gIoKeyboardDisplay_C is ok, you can use this configuration.

 

0 Kudos
Reply

8,813 Views
Javad_Baig
Contributor II

Hello, @xing_chang 

 

Thanks alot now I am getting the passkey in the Application.

since the confirmation of the value also need to be verify from the Software(not in Application) end to make the pairing happen. Is there any way to automatically simulate this confirmation in the software end ? or how to confirm it in the MCUXpresso(Software) side?

0 Kudos
Reply

8,806 Views
xing_chang
NXP Employee
NXP Employee

Sorry, I don't understand, what is Software? what is Application?

0 Kudos
Reply

8,802 Views
Javad_Baig
Contributor II

Application - IoT ToolBox

Software - MCUXpresso (Like we need to verify the key from the Device(Frdm-kw38) end also right) , I belive we do this verification in the IDE itself

0 Kudos
Reply

8,791 Views
xing_chang
NXP Employee
NXP Employee

Hi @Javad_Baig ,

You can add some code here to display numbers and wait for keyboard to confirm.

        case gConnEvtLeScDisplayNumericValue_c:
        {
            (void) pConnectionEvent->eventData.numericValueForDisplay;
            /* Display on a screen for user confirmation then validate/invalidate based on value. */
            (void)Gap_LeScValidateNumericValue(peerDeviceId, TRUE);
        }
        break;

 

0 Kudos
Reply

8,779 Views
Javad_Baig
Contributor II

Hello,@xing_chang

Okay will do the changes and check, Thanks for the your support. Advance Happy New Year 2022

0 Kudos
Reply