1. 设置Central Role 参数
GAPCENTRALROLE_IRK
GAPCENTRALROLE_SRK
GAPCENTRALROLE_SIGNCOUNTER
GAPCENTRALROLE_BD_ADDR
<-只读参数:Device address read from controller. This can be set with the HCI_EXT_SetBDADDRCmd().
GAPCENTRALROLE_MAX_SCAN_RES
<-最多扫描回应数量,可以理解:有N个广播事件,那Central最多可以回复多少个
uint8 scanRes = DEFAULT_MAX_SCAN_RES;
GAPCentralRole_SetParameter ( GAPCENTRALROLE_MAX_SCAN_RES, sizeof( uint8 ), &scanRes );
===================================================================
2. 设置GAP,链路相关参数
GAP_SetParamValue( TGAP_GEN_DISC_SCAN, DEFAULT_SCAN_DURATION );
<-通用模式下,扫描时间(ms)
——————————————————————————————————————————————
GAP_SetParamValue( TGAP_LIM_DISC_SCAN, DEFAULT_SCAN_DURATION );
<-有限模式下,扫描时间(ms)
——————————————————————————————————————————————
GGS_SetParameter( GGS_DEVICE_NAME_ATT, GAP_DEVICE_NAME_LEN, (uint8 *) simpleBLEDeviceName );
<-设置ATT NAME,该名字需要建立连接后,才能访问
=======================================================================
3. 设置Bond 参数,建立连接参数,握手过程参数
uint32 passkey = DEFAULT_PASSCODE;
<-匹配密码
——————————————————————————————————————————————
uint8 pairMode = DEFAULT_PAIRING_MODE;
<-主机配对模式 ->GAPBOND_PAIRING_MODE_NO_PAIRING 不允许配对
->GAPBOND_PAIRING_MODE_WAIT_FOR_REQ 等待从机配对请亲
->GAPBOND_PAIRING_MODE_INITIATE 不用等待,直接接收匹配
——————————————————————————————————————————————
uint8 mitm = DEFAULT_MITM_MODE;