bacnet/runtime/ao.h
changeset 2020 6dddf3070806
equal deleted inserted replaced
2019:92f02bb17c7e 2020:6dddf3070806
       
     1 /**************************************************************************
       
     2 *
       
     3 * Copyright (C) 2006 Steve Karg <skarg@users.sourceforge.net>
       
     4 * Copyright (C) 2011 Krzysztof Malorny <malornykrzysztof@gmail.com>
       
     5 * Copyright (C) 2017 Mario de Sousa <msousa@fe.up.pt>
       
     6 *
       
     7 * Permission is hereby granted, free of charge, to any person obtaining
       
     8 * a copy of this software and associated documentation files (the
       
     9 * "Software"), to deal in the Software without restriction, including
       
    10 * without limitation the rights to use, copy, modify, merge, publish,
       
    11 * distribute, sublicense, and/or sell copies of the Software, and to
       
    12 * permit persons to whom the Software is furnished to do so, subject to
       
    13 * the following conditions:
       
    14 *
       
    15 * The above copyright notice and this permission notice shall be included
       
    16 * in all copies or substantial portions of the Software.
       
    17 *
       
    18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
       
    19 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
       
    20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
       
    21 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
       
    22 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
       
    23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
       
    24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
       
    25 *
       
    26 *********************************************************************/
       
    27 #ifndef AO_H
       
    28 #define AO_H
       
    29 
       
    30 #include <stdbool.h>
       
    31 #include <stdint.h>
       
    32 #include "bacdef.h"
       
    33 #include "bacerror.h"
       
    34 #include "wp.h"
       
    35 #include "rp.h"
       
    36 
       
    37 #ifdef __cplusplus
       
    38 extern "C" {
       
    39 #endif /* __cplusplus */
       
    40 
       
    41     typedef struct Analog_Output_descr {
       
    42         /* pointer to IEC 61131-3 located variable that is mapped onto this BACnet object */
       
    43         float   *Located_Var_ptr;
       
    44         uint32_t Object_Identifier;  /* called object 'Instance' in the source code! */
       
    45         char    *Object_Name;   
       
    46         char    *Description;
       
    47         uint16_t Units;
       
    48       
       
    49         /* stores the current value */
       
    50         /* one entry per priority value */
       
    51         float Present_Value[BACNET_MAX_PRIORITY];
       
    52         unsigned Event_State:3;
       
    53         bool Out_Of_Service;
       
    54     } ANALOG_OUTPUT_DESCR;
       
    55 
       
    56 
       
    57     void Analog_Output_Property_Lists(
       
    58         const int **pRequired,
       
    59         const int **pOptional,
       
    60         const int **pProprietary);
       
    61     bool Analog_Output_Valid_Instance(
       
    62         uint32_t object_instance);
       
    63     unsigned Analog_Output_Count(
       
    64         void);
       
    65     uint32_t Analog_Output_Index_To_Instance(
       
    66         unsigned index);
       
    67     unsigned Analog_Output_Instance_To_Index(
       
    68         uint32_t object_instance);
       
    69 
       
    70     bool Analog_Output_Object_Name(
       
    71         uint32_t object_instance,
       
    72         BACNET_CHARACTER_STRING * object_name);
       
    73 
       
    74     int Analog_Output_Read_Property(
       
    75         BACNET_READ_PROPERTY_DATA * rpdata);
       
    76 
       
    77     bool Analog_Output_Write_Property(
       
    78         BACNET_WRITE_PROPERTY_DATA * wp_data);
       
    79 
       
    80     bool Analog_Output_Present_Value_Set(
       
    81         uint32_t object_instance,
       
    82         float value,
       
    83         uint8_t priority);
       
    84     float Analog_Output_Present_Value(
       
    85         uint32_t object_instance);
       
    86 
       
    87     char *Analog_Output_Description(
       
    88         uint32_t instance);
       
    89 
       
    90     uint16_t Analog_Output_Units(
       
    91         uint32_t instance);
       
    92 
       
    93     bool Analog_Output_Out_Of_Service(
       
    94         uint32_t instance);
       
    95     void Analog_Output_Out_Of_Service_Set(
       
    96         uint32_t instance,
       
    97         bool oos_flag);
       
    98 
       
    99     void Analog_Output_Init(
       
   100         void);
       
   101 
       
   102 
       
   103 #ifdef __cplusplus
       
   104 }
       
   105 #endif /* __cplusplus */
       
   106 #endif