怎么引用 if(!expected_ble) /* Don't consider ble complete until CL_SM_BLE_SIMPLE_PAIRING_COMPLETE_IND */ { /* Send confirmation to main task */ pairing_Complete(thePairing, pairingSuccess, &cfm->bd_addr, TRUE); /* Allow ble connections only with paired device after br/edr pairing. */ thePairing->ble_permission = pairingBleOnlyPairedDevices; MessageSendLater(&thePairing->task, PAIRING_INTERNAL_LE_PAIR_TIMEOUT, NULL, D_SEC(appConfigLePairingDisableTimeout())); } }
时间: 2024-01-12 20:02:43 浏览: 266
这段代码是一个条件语句,如果`expected_ble`为假,则不认为蓝牙连接已经完成,直到收到`CL_SM_BLE_SIMPLE_PAIRING_COMPLETE_IND`事件。然后会发送确认给主任务,并设置`ble_permission`为仅允许与已配对设备建立蓝牙连接。最后会启动一个定时器,在一定时间后禁用LE配对功能。
你可以在你的代码中使用类似下面的方式引用这段代码:
```
if(!expected_ble) {
pairing_Complete(thePairing, pairingSuccess, &cfm->bd_addr, TRUE);
thePairing->ble_permission = pairingBleOnlyPairedDevices;
MessageSendLater(&thePairing->task, PAIRING_INTERNAL_LE_PAIR_TIMEOUT, NULL, D_SEC(appConfigLePairingDisableTimeout()));
}
```
阅读全文