有以下2个问题,请您回复:
- ?BLE的绑定,是由谁发起的?
- ?外围设备解除绑定就是擦除绑定信息吗?
Central例程有下面设置:
? // Setup the GAP Bond Manager
? {
? ? uint32 passkey = DEFAULT_PASSCODE;
? ? uint8 pairMode = DEFAULT_PAIRING_MODE;
? ? uint8 mitm = DEFAULT_MITM_MODE;
? ? uint8 ioCap = DEFAULT_IO_CAPABILI
tiES;
? ? uint8 bonding = DEFAULT_BONDING_MODE;
? ??
? ? GAPBondMgr_SetParameter( GAPBOND_CENT_DEFAULT_PASSCODE, sizeof( uint32 ), &passkey );
? ? GAPBondMgr_SetParameter( GAPBOND_CENT_PAIRING_MODE, sizeof( uint8 ), &pairMode );
? ? GAPBondMgr_SetParameter( GAPBOND_CENT_MITM_PROTECTION, sizeof( uint8 ), &mitm );
? ? GAPBondMgr_SetParameter( GAPBOND_CENT_IO_CAPABILITIES, sizeof( uint8 ), &ioCap );
? ? GAPBondMgr_SetParameter( GAPBOND_CENT_BONDING_ENABLED, sizeof( uint8 ), &bonding );
? }
Peripheral例程有下面设置:
? // Setup the GAP Bond Manager
? {
? ? uint32 passkey = 0; // 0-->passkey "000000",1-->"000001",
? ? uint8 pairMode = GAPBOND_PAIRING_MODE_WAIT_FOR_REQ;
? ? uint8 mitm = TRUE;
? ? uint8 bonding = TRUE;
? ? uint8 ioCap = GAPBOND_IO_CAP_DISPLAY_ONLY;
? ? GAPBondMgr_SetParameter( GAPBOND_PERI_DEFAULT_PASSCODE, sizeof ( uint32 ), &passkey );
? ? GAPBondMgr_SetParameter( GAPBOND_PERI_PAIRING_MODE, sizeof ( uint8 ), &pairMode );
? ? GAPBondMgr_SetParameter( GAPBOND_PERI_MITM_PROTECTION, sizeof ( uint8 ), &mitm );
? ? GAPBondMgr_SetParameter( GAPBOND_PERI_IO_CAPABILITIES, sizeof ( uint8 ), &ioCap );
? ? GAPBondMgr_SetParameter( GAPBOND_PERI_BONDING_ENABLED, sizeof ( uint8 ), &bonding );
? }
0