コード例 #1
0
void BleServiceDbUnloadRecord(void)
{
    if (BleDbCtx(loadCount) == 1)
    {
        BT_GattUnregisterConnectedEvent(&BleDbCtx(gattHandler));
        ATTDB_UnRegisterBondStatus(&BleDbCtx(bondingHandler));

        while (!IsListEmpty(&BleDbCtx(servicedbList)))
        {
            free_ctrl_buffer(RemoveHeadList(&BleDbCtx(servicedbList)));
        }
    }
    BleDbCtx(loadCount)--;
}
コード例 #2
0
BtStatus FMP_Deregister(FmpServiceTypeFlag service_flag)
{
    BtStatus status = BT_STATUS_SUCCESS;

    OS_LockStack();

    if (FMP(service_flag) == 0)
    {
        /* It is actually invalid deregistration, return directly */
        return status;
    }

    if ((service_flag & FMP_SERVICE_TYPE_LOCATOR_FLAG) &&
	(FMP(service_flag) & FMP_SERVICE_TYPE_LOCATOR_FLAG))
    {
        FMP(service_flag) &= ~FMP_SERVICE_TYPE_LOCATOR_FLAG;
    }
	
    if ((service_flag & FMP_SERVICE_TYPE_TARGET_FLAG) &&
	(FMP(service_flag) & FMP_SERVICE_TYPE_TARGET_FLAG))
    {
        FmpAttDB_Deregistration();
        FMP(service_flag) &= ~FMP_SERVICE_TYPE_TARGET_FLAG;
    }

	
    if (FMP(service_flag) == 0)
    {
        BT_GattUnregisterConnectedEvent(&FMP(gatt_handler));
        ATTDB_UnRegisterBondStatus(&FMP(bond_handler));        
        FMP(fmp_callback) = NULL;
    }

    OS_UnlockStack();
    return status;	
}