582F配对成功后,每次重新启动发送的都是定向广播,这部分功能没有问题。
uint16_t bonding = 0;
gapBondRec_t bond_info;
uint8_t advEvType = GAP_ADTYPE_ADV_LDC_DIRECT_IND;
uint8_t Adv_Direct_Addr[B_ADDR_LEN];
uint8_t Adv_Direct_Type = ADDRTYPE_PUBLIC;
// GAPBondMgr_SetParameter(GAPBOND_ERASE_SINGLEBOND, 6 + 1, BUF);
// GAPBondMgr_SetParameter( GAPBOND_ERASE_ALLBONDS, 0, NULL ); // Erase bonding info
GAPBondMgr_GetParameter(GAPBOND_BOND_COUNT, &bonding);
if ((bonding != 0)&&(Peripheral_Status != Peripheral_Pairing))
{
tmos_snv_read(mainRecordNvID(0), sizeof(gapBondRec_t), &bond_info);
tmos_memcpy(Adv_Direct_Addr, bond_info.publicAddr, 6);
GAPRole_SetParameter(GAPROLE_ADV_DIRECT_ADDR, B_ADDR_LEN, &Adv_Direct_Addr);
GAPRole_SetParameter( GAPROLE_ADV_DIRECT_TYPE, sizeof(Adv_Direct_Type), &Adv_Direct_Type);
GAPRole_SetParameter(GAPROLE_ADV_EVENT_TYPE, sizeof(uint8_t), &advEvType);
IsBonding = TRUE;
}
但我删除当前配对后,希望有非定向广播,可实际上却是非定向但不可连接广播。
uint8_t advEvType = GAP_ADTYPE_ADV_IND;
GAPRole_SetParameter(GAPROLE_ADV_EVENT_TYPE, sizeof(uint8_t), &advEvType);
uint8_t initial_advertising_enable = TRUE;
GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t), &initial_advertising_enable);
请问一下应该如何实现?
目前我应变方法是复位。