Edouard@2020: /**************************************************************************
Edouard@2020: *
Edouard@2020: * Copyright (C) 2006 Steve Karg <skarg@users.sourceforge.net>
Edouard@2020: * Copyright (C) 2011 Krzysztof Malorny <malornykrzysztof@gmail.com>
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 AO_H
Edouard@2020: #define AO_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 "wp.h"
Edouard@2020: #include "rp.h"
Edouard@2020: 
Edouard@2020: #ifdef __cplusplus
Edouard@2020: extern "C" {
Edouard@2020: #endif /* __cplusplus */
Edouard@2020: 
Edouard@2020:     typedef struct Analog_Output_descr {
Edouard@2020:         /* pointer to IEC 61131-3 located variable that is mapped onto this BACnet object */
Edouard@2020:         float   *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:         uint16_t Units;
Edouard@2020:       
Edouard@2020:         /* stores the current value */
Edouard@2020:         /* one entry per priority value */
Edouard@2020:         float Present_Value[BACNET_MAX_PRIORITY];
Edouard@2020:         unsigned Event_State:3;
Edouard@2020:         bool Out_Of_Service;
Edouard@2020:     } ANALOG_OUTPUT_DESCR;
Edouard@2020: 
Edouard@2020: 
Edouard@2020:     void Analog_Output_Property_Lists(
Edouard@2020:         const int **pRequired,
Edouard@2020:         const int **pOptional,
Edouard@2020:         const int **pProprietary);
Edouard@2020:     bool Analog_Output_Valid_Instance(
Edouard@2020:         uint32_t object_instance);
Edouard@2020:     unsigned Analog_Output_Count(
Edouard@2020:         void);
Edouard@2020:     uint32_t Analog_Output_Index_To_Instance(
Edouard@2020:         unsigned index);
Edouard@2020:     unsigned Analog_Output_Instance_To_Index(
Edouard@2020:         uint32_t object_instance);
Edouard@2020: 
Edouard@2020:     bool Analog_Output_Object_Name(
Edouard@2020:         uint32_t object_instance,
Edouard@2020:         BACNET_CHARACTER_STRING * object_name);
Edouard@2020: 
Edouard@2020:     int Analog_Output_Read_Property(
Edouard@2020:         BACNET_READ_PROPERTY_DATA * rpdata);
Edouard@2020: 
Edouard@2020:     bool Analog_Output_Write_Property(
Edouard@2020:         BACNET_WRITE_PROPERTY_DATA * wp_data);
Edouard@2020: 
Edouard@2020:     bool Analog_Output_Present_Value_Set(
Edouard@2020:         uint32_t object_instance,
Edouard@2020:         float value,
Edouard@2020:         uint8_t priority);
Edouard@2020:     float Analog_Output_Present_Value(
Edouard@2020:         uint32_t object_instance);
Edouard@2020: 
Edouard@2020:     char *Analog_Output_Description(
Edouard@2020:         uint32_t instance);
Edouard@2020: 
Edouard@2020:     uint16_t Analog_Output_Units(
Edouard@2020:         uint32_t instance);
Edouard@2020: 
Edouard@2020:     bool Analog_Output_Out_Of_Service(
Edouard@2020:         uint32_t instance);
Edouard@2020:     void Analog_Output_Out_Of_Service_Set(
Edouard@2020:         uint32_t instance,
Edouard@2020:         bool oos_flag);
Edouard@2020: 
Edouard@2020:     void Analog_Output_Init(
Edouard@2020:         void);
Edouard@2020: 
Edouard@2020: 
Edouard@2020: #ifdef __cplusplus
Edouard@2020: }
Edouard@2020: #endif /* __cplusplus */
Edouard@2020: #endif