|
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 BO_H |
|
27 #define BO_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_Output_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 /* one entry per priority value */ |
|
48 BACNET_BINARY_PV Present_Value[BACNET_MAX_PRIORITY]; |
|
49 /* Writable out-of-service allows others to play with our Present Value */ |
|
50 /* without changing the physical output */ |
|
51 bool Out_Of_Service; |
|
52 BACNET_POLARITY Polarity; |
|
53 } BINARY_OUTPUT_DESCR; |
|
54 |
|
55 |
|
56 void Binary_Output_Property_Lists( |
|
57 const int **pRequired, |
|
58 const int **pOptional, |
|
59 const int **pProprietary); |
|
60 bool Binary_Output_Valid_Instance( |
|
61 uint32_t object_instance); |
|
62 unsigned Binary_Output_Count( |
|
63 void); |
|
64 uint32_t Binary_Output_Index_To_Instance( |
|
65 unsigned index); |
|
66 unsigned Binary_Output_Instance_To_Index( |
|
67 uint32_t object_instance); |
|
68 |
|
69 bool Binary_Output_Object_Name( |
|
70 uint32_t object_instance, |
|
71 BACNET_CHARACTER_STRING * object_name); |
|
72 |
|
73 char *Binary_Output_Description( |
|
74 uint32_t instance); |
|
75 |
|
76 BACNET_BINARY_PV Binary_Output_Present_Value( |
|
77 uint32_t instance); |
|
78 bool Binary_Output_Present_Value_Set( |
|
79 uint32_t instance, |
|
80 BACNET_BINARY_PV value); |
|
81 |
|
82 bool Binary_Output_Out_Of_Service( |
|
83 uint32_t instance); |
|
84 void Binary_Output_Out_Of_Service_Set( |
|
85 uint32_t instance, |
|
86 bool value); |
|
87 |
|
88 char *Binary_Output_Description( |
|
89 uint32_t instance); |
|
90 |
|
91 int Binary_Output_Read_Property( |
|
92 BACNET_READ_PROPERTY_DATA * rpdata); |
|
93 |
|
94 bool Binary_Output_Write_Property( |
|
95 BACNET_WRITE_PROPERTY_DATA * wp_data); |
|
96 |
|
97 void Binary_Output_Init( |
|
98 void); |
|
99 |
|
100 |
|
101 |
|
102 #ifdef __cplusplus |
|
103 } |
|
104 #endif /* __cplusplus */ |
|
105 #endif |