Edouard@2020: /**************************************************************************
Edouard@2020: *
Edouard@2020: * Copyright (C) 2006 Steve Karg <skarg@users.sourceforge.net>
Edouard@2020: * Copyright (C) 2017 Mario de Sousa <msousa@fe.up.pt>
Edouard@2020: *
Edouard@2020: * Permission is hereby granted, free of charge, to any person obtaining
Edouard@2020: * a copy of this software and associated documentation files (the
Edouard@2020: * "Software"), to deal in the Software without restriction, including
Edouard@2020: * without limitation the rights to use, copy, modify, merge, publish,
Edouard@2020: * distribute, sublicense, and/or sell copies of the Software, and to
Edouard@2020: * permit persons to whom the Software is furnished to do so, subject to
Edouard@2020: * the following conditions:
Edouard@2020: *
Edouard@2020: * The above copyright notice and this permission notice shall be included
Edouard@2020: * in all copies or substantial portions of the Software.
Edouard@2020: *
Edouard@2020: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
Edouard@2020: * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Edouard@2020: * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
Edouard@2020: * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
Edouard@2020: * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
Edouard@2020: * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
Edouard@2020: * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Edouard@2020: *
Edouard@2020: *********************************************************************/
Edouard@2020: #ifndef BV_H
Edouard@2020: #define BV_H
Edouard@2020: 
Edouard@2020: #include <stdbool.h>
Edouard@2020: #include <stdint.h>
Edouard@2020: #include "bacdef.h"
Edouard@2020: #include "bacerror.h"
Edouard@2020: #include "rp.h"
Edouard@2020: #include "wp.h"
Edouard@2020: 
Edouard@2020: #ifdef __cplusplus
Edouard@2020: extern "C" {
Edouard@2020: #endif /* __cplusplus */
Edouard@2020: 
Edouard@2020:     typedef struct binary_value_descr {
Edouard@2020:         /* pointer to IEC 61131-3 located variable that is mapped onto this BACnet object */
Edouard@2020:         uint8_t *Located_Var_ptr;
Edouard@2020:         uint32_t Object_Identifier;  /* called object 'Instance' in the source code! */
Edouard@2020:         char    *Object_Name;   
Edouard@2020:         char    *Description;
Edouard@2020:         /* stores the current value */
Edouard@2020:         /* one entry per priority value */
Edouard@2020:         BACNET_BINARY_PV Present_Value[BACNET_MAX_PRIORITY];
Edouard@2020:         /* Writable out-of-service allows others to play with our Present Value */
Edouard@2020:         /* without changing the physical output */
Edouard@2020:         bool Out_Of_Service;
Edouard@2020:     } BINARY_VALUE_DESCR;
Edouard@2020: 
Edouard@2020: 
Edouard@2020:     void Binary_Value_Property_Lists(
Edouard@2020:         const int **pRequired,
Edouard@2020:         const int **pOptional,
Edouard@2020:         const int **pProprietary);
Edouard@2020:     bool Binary_Value_Valid_Instance(
Edouard@2020:         uint32_t object_instance);
Edouard@2020:     unsigned Binary_Value_Count(
Edouard@2020:         void);
Edouard@2020:     uint32_t Binary_Value_Index_To_Instance(
Edouard@2020:         unsigned index);
Edouard@2020:     unsigned Binary_Value_Instance_To_Index(
Edouard@2020:         uint32_t object_instance);
Edouard@2020: 
Edouard@2020:     bool Binary_Value_Object_Name(
Edouard@2020:         uint32_t object_instance,
Edouard@2020:         BACNET_CHARACTER_STRING * object_name);
Edouard@2020: 
Edouard@2020:     char *Binary_Value_Description(
Edouard@2020:         uint32_t instance);
Edouard@2020: 
Edouard@2020:     BACNET_BINARY_PV Binary_Value_Present_Value(
Edouard@2020:         uint32_t instance);
Edouard@2020:     bool Binary_Value_Present_Value_Set(
Edouard@2020:         uint32_t instance,
Edouard@2020:         BACNET_BINARY_PV value);
Edouard@2020: 
Edouard@2020:     bool Binary_Value_Out_Of_Service(
Edouard@2020:         uint32_t instance);
Edouard@2020:     void Binary_Value_Out_Of_Service_Set(
Edouard@2020:         uint32_t instance,
Edouard@2020:         bool value);
Edouard@2020: 
Edouard@2020:     char *Binary_Value_Description(
Edouard@2020:         uint32_t instance);
Edouard@2020: 
Edouard@2020:     int Binary_Value_Read_Property(
Edouard@2020:         BACNET_READ_PROPERTY_DATA * rpdata);
Edouard@2020: 
Edouard@2020:     bool Binary_Value_Write_Property(
Edouard@2020:         BACNET_WRITE_PROPERTY_DATA * wp_data);
Edouard@2020: 
Edouard@2020:     void Binary_Value_Init(
Edouard@2020:         void);
Edouard@2020: 
Edouard@2020: 
Edouard@2020: 
Edouard@2020: #ifdef __cplusplus
Edouard@2020: }
Edouard@2020: #endif /* __cplusplus */
Edouard@2020: #endif