Ejemplo n.º 1
0
void Analog_Value_Init(
    void)
{
    unsigned i, j;

    for (i = 0; i < MAX_ANALOG_VALUES; i++) {
        memset(&AV_Descr[i], 0x00, sizeof(ANALOG_VALUE_DESCR));
        AV_Descr[i].Present_Value = 0.0;
        AV_Descr[i].Units = UNITS_NO_UNITS;
#if defined(INTRINSIC_REPORTING)
        AV_Descr[i].Event_State = EVENT_STATE_NORMAL;
        /* notification class not connected */
        AV_Descr[i].Notification_Class = BACNET_MAX_INSTANCE;
        /* initialize Event time stamps using wildcards
           and set Acked_transitions */
        for (j = 0; j < MAX_BACNET_EVENT_TRANSITION; j++) {
            datetime_wildcard_set(&AV_Descr[i].Event_Time_Stamps[j]);
            AV_Descr[i].Acked_Transitions[j].bIsAcked = true;
        }

        /* Set handler for GetEventInformation function */
        handler_get_event_information_set(OBJECT_ANALOG_VALUE,
            Analog_Value_Event_Information);
        /* Set handler for AcknowledgeAlarm function */
        handler_alarm_ack_set(OBJECT_ANALOG_VALUE, Analog_Value_Alarm_Ack);
        /* Set handler for GetAlarmSummary Service */
        handler_get_alarm_summary_set(OBJECT_ANALOG_VALUE,
            Analog_Value_Alarm_Summary);
#endif
    }
}
Ejemplo n.º 2
0
void testBACnetDateTimeWildcard(
    Test * pTest)
{
    BACNET_DATE_TIME bdatetime;
    bool status = false;

    datetime_set_values(&bdatetime, 1900, 1, 1, 0, 0, 0, 0);
    status = datetime_wildcard(&bdatetime);
    ct_test(pTest, status == false);

    datetime_wildcard_set(&bdatetime);
    status = datetime_wildcard(&bdatetime);
    ct_test(pTest, status == true);
}
Ejemplo n.º 3
0
static void testWildcardDateTime(
    Test * pTest)
{
    BACNET_DATE_TIME bdatetime1, bdatetime2;
    BACNET_DATE bdate;
    BACNET_TIME btime;
    int diff = 0;

    datetime_wildcard_set(&bdatetime1);
    ct_test(pTest, datetime_wildcard(&bdatetime1));
    ct_test(pTest, datetime_wildcard_present(&bdatetime1));
    datetime_copy(&bdatetime2, &bdatetime1);
    diff = datetime_wildcard_compare(&bdatetime1, &bdatetime2);
    ct_test(pTest, diff == 0);
    datetime_time_wildcard_set(&btime);
    datetime_date_wildcard_set(&bdate);
    datetime_set(&bdatetime1, &bdate, &btime);
    diff = datetime_wildcard_compare(&bdatetime1, &bdatetime2);
    ct_test(pTest, diff == 0);

    return;
}