I am using MCUXpresso v11.0.0 to build QN908x (HID device example code).
QN908x SDK v2.2.0.
I am using HID device Bare Metal example code.
I want to enable "Pairing" in this example code, so in "app_preinclude" header file, I am modified following macro to:
#define gAppUseBonding_d 1 /*! Enable/disable use of bonding capability */
#define gAppUsePairing_d 1 /*! Enable/disable use of pairing procedure */
I build the project successfully without any error and then loaded onto QN9080DK-V1.3.
I am able to see the "NXP_HID" device onto mobile app but when I try to connect, it through an error "Could not pair with NXP_HID device because of incorrect Pin", but strange it has not asked for Pairing Pin.
While debugging, I am able to see setting of Pairing Pin API gets called as well as Pairing Complete event get triggered but I am not able to successfully Pair the device with Mobile.
Pairing setting (app_config.c):
/* SMP Data */
gapPairingParameters_t gPairingParameters = {
.withBonding = TRUE, //gAppUseBonding_d,
.securityModeAndLevel = gSecurityMode_1_Level_4_c,
.maxEncryptionKeySize = mcEncryptionKeySize_c,
.localIoCapabilities = gIoDisplayOnly_c,
.oobAvailable = FALSE,
.centralKeys = (gapSmpKeyFlags_t) (gLtk_c | gIrk_c),
.peripheralKeys = (gapSmpKeyFlags_t) (gLtk_c | gIrk_c),
.leSecureConnectionSupported = TRUE,
.useKeypressNotifications = FALSE,
};
Attached the screenshot while debugging, it goes to HardFault Handler after BLE_Init() function call after trying to connect multiple times
Do please let me know if something I am doing wrong or following some wrong procedure to enable pairing.
Is there any document explaining steps to Enable and setting Pairing.
I have already gone through BLE developer document.