AllJoyn/Samples/BACnetAdapter/bacnet-stack-0.8.2/demo/handler/h_cov.c
static void cov_address_remove_unused(
    void)
{
    unsigned index = 0;
    unsigned cov_index = 0;
    bool found = false;

    for (cov_index = 0; cov_index < MAX_COV_ADDRESSES; cov_index++) {
        if (COV_Addresses[cov_index].valid) {
            found = false;
            for (index = 0; index < MAX_COV_SUBCRIPTIONS; index++) {
                if ((COV_Subscriptions[index].flag.valid) &&
                    (COV_Subscriptions[index].dest_index == cov_index)) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                COV_Addresses[cov_index].valid = false;
            }
        }
    }
}
/**
 * Removes the address from the list of COV addresses, if it is not
 * used by other COV subscriptions
 */
Removes the address from the list of COV addresses, if it is not
used by other COV subscriptions
Removes the address from the list of COV addresses if it is not used by other COV subscriptions
static void cov_address_remove_unused(
    void)
{
    unsigned index = 0;
    unsigned cov_index = 0;
    bool found = false;
    for (cov_index = 0; cov_index < MAX_COV_ADDRESSES; cov_index++) {
        if (COV_Addresses[cov_index].valid) {
            found = false;
            for (index = 0; index < MAX_COV_SUBCRIPTIONS; index++) {
                if ((COV_Subscriptions[index].flag.valid) &&
                    (COV_Subscriptions[index].dest_index == cov_index)) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                COV_Addresses[cov_index].valid = false;
            }
        }
    }
}
static void cov_address_remove_unused ( void ) { unsigned index = 0 ; unsigned cov_index = 0 ; bool found = false ; for ( cov_index = 0 ; cov_index < MAX_COV_ADDRESSES ; cov_index ++ ) { if ( COV_Addresses [ cov_index ] . valid ) { found = false ; for ( index = 0 ; index < MAX_COV_SUBCRIPTIONS ; index ++ ) { if ( ( COV_Subscriptions [ index ] . flag . valid ) && ( COV_Subscriptions [ index ] . dest_index == cov_index ) ) { found = true ; break ; } } if ( ! found ) { COV_Addresses [ cov_index ] . valid = false ; } } } }
Removes the address from the list of COV addresses, if it is not
 used by other COV subscriptions
Removes the address from the list of COV addresses if it is not used by other COV subscriptions