谢谢各位
Alvin Chen:
// End of discovery reportcase GAP_DEVICE_DISCOVERY_EVENT:{uint8_t i;
// Discovery completescanningStarted = FALSE;
// If devices were foundif (pEvent->discCmpl.numDevs > 0){// Update menutbm_setItemStatus(&mrMenuMain, TBM_ITEM_1, TBM_ITEM_NONE);// Loop through discovered devices to store in static device listfor (i = 0; i < pEvent->discCmpl.numDevs; i++){// Store address typedevList[i].addrType = pEvent->discCmpl.pDevList[i].addrType;
// Store event type (adv / scan response)devList[i].eventType = pEvent->discCmpl.pDevList[i].eventType;
// Store addressmemcpy(devList[i].addr, pEvent->discCmpl.pDevList[i].addr, B_ADDR_LEN);
// Convert address to stringuint8_t *pAddr = (uint8_t*)Util_convertBdAddr2Str(devList[i].addr);
// Copy converted string to static device listmemcpy(devList[i].strAddr, pAddr, B_STR_ADDR_LEN);
Alvin Chen:
回复 user5758795:
后面不是有注释了。
你扫描回应包对应的就是peripheral 里面的扫描回应包的格式。addrtype:
/** @} End GAP_Discovery *//** @defgroup GAP_Addr_Types Address Types* @{*/
#define ADDRTYPE_PUBLIC0x00//!< Public Device Address
#define ADDRTYPE_RANDOM0x01//!< Random Device Address
#define ADDRTYPE_PUBLIC_ID0x02//!< Public Identity Address (corresponds to peer's RPA)
#define ADDRTYPE_RANDOM_ID0x03//!< Random (static) Identity Address (corresponds to peer's RPA