bacnet/runtime/bi.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) 2017 Mario de Sousa <msousa@fe.up.pt>
       
     5 *
       
     6 * Permission is hereby granted, free of charge, to any person obtaining
       
     7 * a copy of this software and associated documentation files (the
       
     8 * "Software"), to deal in the Software without restriction, including
       
     9 * without limitation the rights to use, copy, modify, merge, publish,
       
    10 * distribute, sublicense, and/or sell copies of the Software, and to
       
    11 * permit persons to whom the Software is furnished to do so, subject to
       
    12 * the following conditions:
       
    13 *
       
    14 * The above copyright notice and this permission notice shall be included
       
    15 * in all copies or substantial portions of the Software.
       
    16 *
       
    17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
       
    18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
       
    19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
       
    20 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
       
    21 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
       
    22 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
       
    23 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
       
    24 *
       
    25 *********************************************************************/
       
    26 #ifndef BI_H
       
    27 #define BI_H
       
    28 
       
    29 #include <stdbool.h>
       
    30 #include <stdint.h>
       
    31 #include "bacdef.h"
       
    32 #include "bacerror.h"
       
    33 #include "rp.h"
       
    34 #include "wp.h"
       
    35 
       
    36 #ifdef __cplusplus
       
    37 extern "C" {
       
    38 #endif /* __cplusplus */
       
    39 
       
    40     typedef struct Binary_Input_descr {
       
    41         /* pointer to IEC 61131-3 located variable that is mapped onto this BACnet object */
       
    42         uint8_t *Located_Var_ptr;
       
    43         uint32_t Object_Identifier;  /* called object 'Instance' in the source code! */
       
    44         char    *Object_Name;   
       
    45         char    *Description;
       
    46         /* stores the current value */
       
    47         BACNET_BINARY_PV Present_Value;
       
    48         /* Writable out-of-service allows others to play with our Present Value */
       
    49         /* without changing the physical output */
       
    50         bool             Out_Of_Service;
       
    51         BACNET_POLARITY  Polarity;
       
    52     } BINARY_INPUT_DESCR;
       
    53 
       
    54 
       
    55     void Binary_Input_Property_Lists(
       
    56         const int **pRequired,
       
    57         const int **pOptional,
       
    58         const int **pProprietary);
       
    59     bool Binary_Input_Valid_Instance(
       
    60         uint32_t object_instance);
       
    61     unsigned Binary_Input_Count(
       
    62         void);
       
    63     uint32_t Binary_Input_Index_To_Instance(
       
    64         unsigned index);
       
    65     unsigned Binary_Input_Instance_To_Index(
       
    66         uint32_t object_instance);
       
    67 
       
    68     bool Binary_Input_Object_Name(
       
    69         uint32_t object_instance,
       
    70         BACNET_CHARACTER_STRING * object_name);
       
    71 
       
    72     char *Binary_Input_Description(
       
    73         uint32_t instance);
       
    74 
       
    75     BACNET_BINARY_PV Binary_Input_Present_Value(
       
    76         uint32_t instance);
       
    77     bool Binary_Input_Present_Value_Set(
       
    78         uint32_t instance,
       
    79         BACNET_BINARY_PV value);
       
    80 
       
    81     bool Binary_Input_Out_Of_Service(
       
    82         uint32_t instance);
       
    83     void Binary_Input_Out_Of_Service_Set(
       
    84         uint32_t instance,
       
    85         bool value);
       
    86 
       
    87     char *Binary_Input_Description(
       
    88         uint32_t instance);
       
    89 
       
    90     int Binary_Input_Read_Property(
       
    91         BACNET_READ_PROPERTY_DATA * rpdata);
       
    92 
       
    93     bool Binary_Input_Write_Property(
       
    94         BACNET_WRITE_PROPERTY_DATA * wp_data);
       
    95 
       
    96     void Binary_Input_Init(
       
    97         void);
       
    98 
       
    99 
       
   100 
       
   101 #ifdef __cplusplus
       
   102 }
       
   103 #endif /* __cplusplus */
       
   104 #endif