Hello NXP team,
I am trying to use the directed advertisement so that only authorized central ble will be able to connect to my nxp kwm36 Ble perepheral. I tried the following solution which consist of defining the directedAddress field as the Ble mac address of my phone, I am using nRF Connect. I also, modified also the filterPolicy to be gProcessWhiteListOnly_c, therefore only my phone will be capable of scanning ond connecting to the Ble device. However I found that I am not capable neither to scan the Ble device nor to connect to it, since I know its mac address in advance. Changing the filterPolicy value to gProcessScanAllConnWL_c, I can see that I am able to scan it but not to connect to it. Could any one please guide me with this issue. Thank you in advance.
Best regards,
Souhail
Hello,
Could you please try setting the following advertisement parameters?
gapAdvertisingParameters_t gAdvParams =
{
/* minInterval */ gGapAdvertisingIntervalDefault_c,
/* maxInterval */ gGapAdvertisingIntervalDefault_c,
/* advertisingType */ gAdvDirectedHighDutyCycle_c, //gAdvDirectedLowDutyCycle_c
/* addressType */ gBleAddrTypeRandom_c,
/* directedAddressType */ gBleAddrTypePublic_c,
/* directedAddress */ {0x00, 0x60, 0x37, 0xB0, 0x8A, 0x1B}, //Address for ADV
/* channelMap */ (gapAdvertisingChannelMapFlags_t) (gGapAdvertisingChannelMapDefault_c),
/* filterPolicy */ gProcessAll_c
};
/*! Minimum advertising interval (20 ms) */
#define gGapAdvertisingIntervalRangeMinimum_c 0x0100 //0x0020 @DAdv
/*! Default advertising interval (1.28 s) */
#define gGapAdvertisingIntervalDefault_c 0x0800
/*! Maximum advertising interval (10.24 s) */
#define gGapAdvertisingIntervalRangeMaximum_c 0x0800 //0x4000 @DAdv
/* Setup Advertising and scanning data */
Gap_SetAdvertisingData(NULL,NULL);//(&gAppAdvertisingData,&gAppScanRspData); //@DAdv
Regards
Hello Estephania,
I am sorry for the delayed response since we were on an urgent task. In fact I installed both wireshark and nxp protocol analyzer. I have configured USB-KW41Z to sniff the ble protocol. I have made the same modifications that you have recommended last time to me :
/* Setup Advertising and scanning data */
Gap_SetAdvertisingData(NULL,NULL);//(&gAppAdvertisingData,&gAppScanRspData); //@DAdv
I defined the following filter on wireshark to see only directed adv : btle.advertising_header.pdu_type = = 0x01.
However I cannot see any packet header with the destination address equal to that defined on the struct. You will find attached a screen shot of wireshark
Best ragards,
Souhail