我计划用ch571f/ch573f来做蓝牙遥控器,使用主机模式时出现问题
搜索蓝牙正常串口打出,不返回 GAP_DEVICE_DISCOVERY_EVENT ,无法进行蓝牙对比 主板已加32.768K晶振。
﨏H57x_BLE_LIB_V1.80
Discovering...
Device 1 - Addr 11 37 37 9d 30 7f
Device 2 - Addr 22 ff 48 e7 cc 71
Device 3 - Addr f3 31 80 4c 32 ec
Device 4 - Addr e7 56 e4 5c 8c f9
Device 5 - Addr 3a c9 eb fe 55 50
无法执行蓝牙对比处
case GAP_DEVICE_DISCOVERY_EVENT:
{
PRINT("go to here...\n"); 无法运行到此处。
uint8_t i;
// See if peer device has been discovered
for(i = 0; i < centralScanRes; i++)
{
if(tmos_memcmp(PeerAddrDef, centralDevList[i].addr, B_ADDR_LEN))
break;
}
// Peer device not found
if(i == centralScanRes)
{
PRINT("Device not found...\n");
centralScanRes = 0;
GAPRole_CentralStartDiscovery(DEFAULT_DISCOVERY_MODE,
DEFAULT_DISCOVERY_ACTIVE_SCAN,
DEFAULT_DISCOVERY_WHITE_LIST);
PRINT("Discovering...\n");
}
// Peer device found
else
{
PRINT("Device found...\n");
GAPRole_CentralEstablishLink(DEFAULT_LINK_HIGH_DUTY_CYCLE,
DEFAULT_LINK_WHITE_LIST,
centralDevList[i].addrType,
centralDevList[i].addr);
// Start establish link timeout event
tmos_start_task(centralTaskId, ESTABLISH_LINK_TIMEOUT_EVT, ESTABLISH_LINK_TIMEOUT);
PRINT("Connecting...\n");
}
}