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.

setting direct advertisement with cc2640

Other Parts Discussed in Thread: CC2650

Hi

 

My tested project information is follows

 

Device: Cc2650 dk

Sample app: HIDEmuKbd(ble_cc26xx_2_01_00_44423)

 

I want to develop multi-paring function.

Please refer the below link(in 49sec dual paring)

https://www.youtube.com/watch?v=-BOmdKWrBrs

 

I want to connect to specific device with hid connection.

So I tested function Direct Advertisement and White list.

If Peer device(Phone) is public address device, It is ok.

But If Peer device(Phone) is random address device, we don’t control to connect.

 

How can I connect to random addressing device(HID connection)?

Android-L version phones supports random addressing device.

 

----Direct adressing code

================================================================

void HidDev_DirectAdvertising(void)

{

uint8_t param;

//uint8_t bdAddress1[B_ADDR_LEN]={0xE8,0x15,0xB3,0x86,0x44,0xBC};

param=GAP_ADTYPE_ADV_HDC_DIRECT_IND;

VOID GAPRole_SetParameter(GAPROLE_ADV_EVENT_TYPE,sizeof(uint8_t), &param );

 

 

VOID GAPRole_SetParameter(GAPROLE_ADV_DIRECT_TYPE,sizeof(uint8_t), &peerDevice_type);

VOID GAPRole_SetParameter(GAPROLE_ADV_DIRECT_ADDR,B_ADDR_LEN, &peerDeviceAddr);

 

VOID GAP_SetParamValue(TGAP_LIM_DISC_ADV_INT_MIN, HID_HIGH_ADV_INT_MIN);

VOID GAP_SetParamValue(TGAP_LIM_DISC_ADV_INT_MAX, HID_HIGH_ADV_INT_MAX);

VOID GAP_SetParamValue(TGAP_LIM_ADV_TIMEOUT, HID_HIGH_ADV_TIMEOUT);

 

// Setup advertising filter policy first.

param = HID_AUTO_SYNC_WL ? GAP_FILTER_POLICY_WHITE : GAP_FILTER_POLICY_ALL;

VOID GAPRole_SetParameter(GAPROLE_ADV_FILTER_POLICY, sizeof(uint8_t), &param);

 

param = TRUE;

GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t), &param);

}

 

---White list adressing code

 ===============================================================================

void HidDev_pairngAdvertising(void)

{

uint8_t param;

 

param=GAP_ADTYPE_ADV_IND;

   VOID GAPRole_SetParameter(GAPROLE_ADV_EVENT_TYPE,sizeof(uint8_t), &param );

 

VOID GAP_SetParamValue(TGAP_LIM_DISC_ADV_INT_MIN, HID_HIGH_ADV_INT_MIN);

VOID GAP_SetParamValue(TGAP_LIM_DISC_ADV_INT_MAX, HID_HIGH_ADV_INT_MAX);

VOID GAP_SetParamValue(TGAP_LIM_ADV_TIMEOUT, HID_HIGH_ADV_TIMEOUT);

 

   HCI_LE_AddWhiteListCmd(peer_addrType,&peer_device);

 

 

// Setup advertising filter policy first.

param = GAP_FILTER_POLICY_WHITE ;

VOID GAPRole_SetParameter(GAPROLE_ADV_FILTER_POLICY, sizeof(uint8_t), &param);

 

param = TRUE;

GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t), &param);

}

==============================================================