AllJoyn/Samples/BACnetAdapter/bacnet-stack-0.8.2/demo/object/bi.c
bool Binary_Input_Encode_Value_List(
    uint32_t object_instance,
    BACNET_PROPERTY_VALUE * value_list)
{
    bool status = false;

    if (value_list) {
        value_list->propertyIdentifier = PROP_PRESENT_VALUE;
        value_list->propertyArrayIndex = BACNET_ARRAY_ALL;
        value_list->value.context_specific = false;
        value_list->value.tag = BACNET_APPLICATION_TAG_ENUMERATED;
        value_list->value.next = NULL;			/* 2014.09.03 - edward@bac-test.com - added this, lack was causing exceptions under MSVC emulation */
        value_list->value.type.Enumerated =
            Binary_Input_Present_Value(object_instance);
        value_list->priority = BACNET_NO_PRIORITY;
        value_list = value_list->next;
    }
    if (value_list) {
        value_list->propertyIdentifier = PROP_STATUS_FLAGS;
        value_list->propertyArrayIndex = BACNET_ARRAY_ALL;
        value_list->value.context_specific = false;
        value_list->value.tag = BACNET_APPLICATION_TAG_BIT_STRING;
        value_list->value.next = NULL;			/* 2014.09.03 - edward@bac-test.com - added this, lack was causing exceptions under MSVC emulation */
        bitstring_init(&value_list->value.type.Bit_String);
        bitstring_set_bit(&value_list->value.type.Bit_String,
            STATUS_FLAG_IN_ALARM, false);
        bitstring_set_bit(&value_list->value.type.Bit_String,
            STATUS_FLAG_FAULT, false);
        bitstring_set_bit(&value_list->value.type.Bit_String,
            STATUS_FLAG_OVERRIDDEN, false);
        if (Binary_Input_Out_Of_Service(object_instance)) {
            bitstring_set_bit(&value_list->value.type.Bit_String,
                STATUS_FLAG_OUT_OF_SERVICE, true);
        } else {
            bitstring_set_bit(&value_list->value.type.Bit_String,
                STATUS_FLAG_OUT_OF_SERVICE, false);
        }
        value_list->priority = BACNET_NO_PRIORITY;
        value_list->next = NULL;   /* 2014.09.03 - edward@bac-test.com - added this, lack was causing exceptions under MSVC emulation */
    }
    status = Binary_Input_Change_Of_Value(object_instance);

    return status;
}
/* returns true if value has changed */
returns true if value has changed
returns true if value has changed
bool Binary_Input_Encode_Value_List(
    uint32_t object_instance,
    BACNET_PROPERTY_VALUE * value_list)
{
    bool status = false;
    if (value_list) {
        value_list->propertyIdentifier = PROP_PRESENT_VALUE;
        value_list->propertyArrayIndex = BACNET_ARRAY_ALL;
        value_list->value.context_specific = false;
        value_list->value.tag = BACNET_APPLICATION_TAG_ENUMERATED;
        value_list->value.next = NULL;			
        value_list->value.type.Enumerated =
            Binary_Input_Present_Value(object_instance);
        value_list->priority = BACNET_NO_PRIORITY;
        value_list = value_list->next;
    }
    if (value_list) {
        value_list->propertyIdentifier = PROP_STATUS_FLAGS;
        value_list->propertyArrayIndex = BACNET_ARRAY_ALL;
        value_list->value.context_specific = false;
        value_list->value.tag = BACNET_APPLICATION_TAG_BIT_STRING;
        value_list->value.next = NULL;			
        bitstring_init(&value_list->value.type.Bit_String);
        bitstring_set_bit(&value_list->value.type.Bit_String,
            STATUS_FLAG_IN_ALARM, false);
        bitstring_set_bit(&value_list->value.type.Bit_String,
            STATUS_FLAG_FAULT, false);
        bitstring_set_bit(&value_list->value.type.Bit_String,
            STATUS_FLAG_OVERRIDDEN, false);
        if (Binary_Input_Out_Of_Service(object_instance)) {
            bitstring_set_bit(&value_list->value.type.Bit_String,
                STATUS_FLAG_OUT_OF_SERVICE, true);
        } else {
            bitstring_set_bit(&value_list->value.type.Bit_String,
                STATUS_FLAG_OUT_OF_SERVICE, false);
        }
        value_list->priority = BACNET_NO_PRIORITY;
        value_list->next = NULL;   
    }
    status = Binary_Input_Change_Of_Value(object_instance);
    return status;
}
bool Binary_Input_Encode_Value_List ( uint32_t object_instance , BACNET_PROPERTY_VALUE * value_list ) { bool status = false ; if ( value_list ) { value_list -> propertyIdentifier = PROP_PRESENT_VALUE ; value_list -> propertyArrayIndex = BACNET_ARRAY_ALL ; value_list -> value . context_specific = false ; value_list -> value . tag = BACNET_APPLICATION_TAG_ENUMERATED ; value_list -> value . next = NULL ; value_list -> value . type . Enumerated = Binary_Input_Present_Value ( object_instance ) ; value_list -> priority = BACNET_NO_PRIORITY ; value_list = value_list -> next ; } if ( value_list ) { value_list -> propertyIdentifier = PROP_STATUS_FLAGS ; value_list -> propertyArrayIndex = BACNET_ARRAY_ALL ; value_list -> value . context_specific = false ; value_list -> value . tag = BACNET_APPLICATION_TAG_BIT_STRING ; value_list -> value . next = NULL ; bitstring_init ( & value_list -> value . type . Bit_String ) ; bitstring_set_bit ( & value_list -> value . type . Bit_String , STATUS_FLAG_IN_ALARM , false ) ; bitstring_set_bit ( & value_list -> value . type . Bit_String , STATUS_FLAG_FAULT , false ) ; bitstring_set_bit ( & value_list -> value . type . Bit_String , STATUS_FLAG_OVERRIDDEN , false ) ; if ( Binary_Input_Out_Of_Service ( object_instance ) ) { bitstring_set_bit ( & value_list -> value . type . Bit_String , STATUS_FLAG_OUT_OF_SERVICE , true ) ; } else { bitstring_set_bit ( & value_list -> value . type . Bit_String , STATUS_FLAG_OUT_OF_SERVICE , false ) ; } value_list -> priority = BACNET_NO_PRIORITY ; value_list -> next = NULL ; } status = Binary_Input_Change_Of_Value ( object_instance ) ; return status ; }
returns true if value has changed
returns true if value has changed
/* 2014.09.03 - edward@bac-test.com - added this, lack was causing exceptions under MSVC emulation */ /* 2014.09.03 - edward@bac-test.com - added this, lack was causing exceptions under MSVC emulation */ /* 2014.09.03 - edward@bac-test.com - added this, lack was causing exceptions under MSVC emulation */