AllJoyn/Samples/BACnetAdapter/bacnet-stack-0.8.2/demo/handler/h_cov.c
void handler_cov_timer_seconds(
    uint32_t elapsed_seconds)
{
    unsigned index = 0;
    uint32_t lifetime_seconds = 0;

    if (elapsed_seconds) {
        /* handle the subscription timeouts */
        for (index = 0; index < MAX_COV_SUBCRIPTIONS; index++) {
            if (COV_Subscriptions[index].flag.valid) {
                lifetime_seconds = COV_Subscriptions[index].lifetime;
                if (lifetime_seconds) {
                    /* only expire COV with definite lifetimes */
                    cov_lifetime_expiration_handler(index, elapsed_seconds,
                        lifetime_seconds);
                }
            }
        }
    }
}
/** Handler to check the list of subscribed objects for any that have changed
 *  and so need to have notifications sent.
 * @ingroup DSCOV
 * This handler will be invoked by the main program every second or so.
 * This example only handles Binary Inputs, but can be easily extended to
 * support other types.
 * For each subscribed object,
 *  - See if the subscription has timed out
 *    - Remove it if it has timed out.
 *  - See if the subscribed object instance has changed
 *    (eg, check with Binary_Input_Change_Of_Value() )
 *  - If changed,
 *    - Clear the COV (eg, Binary_Input_Change_Of_Value_Clear() )
 *    - Send the notice with cov_send_request()
 *      - Will be confirmed or unconfirmed, as per the subscription.
 *
 * @note worst case tasking: MS/TP with the ability to send only
 *        one notification per task cycle.
 *
 * @param elapsed_seconds [in] How many seconds have elapsed since last called.
 */
Handler to check the list of subscribed objects for any that have changed
and so need to have notifications sent.
@ingroup DSCOV
This handler will be invoked by the main program every second or so.
This example only handles Binary Inputs, but can be easily extended to
support other types.
For each subscribed object,
- See if the subscription has timed out
- Remove it if it has timed out.

@note worst case tasking: MS/TP with the ability to send only
one notification per task cycle.

@param elapsed_seconds [in] How many seconds have elapsed since last called.
Handler to check the list of subscribed objects for any that have changed and so need to have notifications sent . @ingroup DSCOV This handler will be invoked by the main program every second or so . This example only handles Binary Inputs but can be easily extended to support other types . For each subscribed object - See if the subscription has timed out - Remove it if it has timed out . @note worst case tasking : MS / TP with the ability to send only one notification per task cycle . @param elapsed_seconds [ in ] How many seconds have elapsed since last called .
void handler_cov_timer_seconds(
    uint32_t elapsed_seconds)
{
    unsigned index = 0;
    uint32_t lifetime_seconds = 0;
    if (elapsed_seconds) {
        for (index = 0; index < MAX_COV_SUBCRIPTIONS; index++) {
            if (COV_Subscriptions[index].flag.valid) {
                lifetime_seconds = COV_Subscriptions[index].lifetime;
                if (lifetime_seconds) {
                    cov_lifetime_expiration_handler(index, elapsed_seconds,
                        lifetime_seconds);
                }
            }
        }
    }
}
void handler_cov_timer_seconds ( uint32_t elapsed_seconds ) { unsigned index = 0 ; uint32_t lifetime_seconds = 0 ; if ( elapsed_seconds ) { for ( index = 0 ; index < MAX_COV_SUBCRIPTIONS ; index ++ ) { if ( COV_Subscriptions [ index ] . flag . valid ) { lifetime_seconds = COV_Subscriptions [ index ] . lifetime ; if ( lifetime_seconds ) { cov_lifetime_expiration_handler ( index , elapsed_seconds , lifetime_seconds ) ; } } } } }
Handler to check the list of subscribed objects for any that have changed
  and so need to have notifications sent.
Handler to check the list of subscribed objects for any that have changed and so need to have notifications sent .
/* handle the subscription timeouts */ /* only expire COV with definite lifetimes */