- Main
- Tutorials
- Library
- Samples

- File List
- Globals

mx_node_node_def.h
Go to the documentation of this file.
1 /* Copyright (C) 2019 Moxa Inc. All rights reserved. */
2 /* SPDX-License-Identifier: Apache-2.0 */
12 #ifndef __MX_NODE_NODE_DEFINE__
13 #define __MX_NODE_NODE_DEFINE__
14
15 #include <stdint.h>
16 #include <stdbool.h>
17
33 #define MAX_NODE_NAME_LEN 30
34 #define MAX_NODE_DESC_LEN 256
35
39 typedef enum _MX_NODE_NODE_TYPE
40 {
41 MX_NODE_NODE_TYPE_UNKNOWN = -1,
42 MX_NODE_NODE_TYPE_FOLDER = 0,
43 MX_NODE_NODE_TYPE_OBJECT = 1,
44 MX_NODE_NODE_TYPE_VARIABLE = 2,
45 MX_NODE_NODE_TYPE_PROPERTY = 3
46 } MX_NODE_NODE_TYPE;
47
51 typedef struct _MX_NODE_FOLDER
52 {
53 } MX_NODE_FOLDER;
54
58 typedef struct _MX_NODE_OBJECT
59 {
60 } MX_NODE_OBJECT;
61
65 typedef enum _MX_NODE_VALUE_TYPE
66 {
67 MX_NODE_VALUE_TYPE_UNKNOWN = -1,
68 MX_NODE_VALUE_TYPE_BOOLEAN = 0,
69 MX_NODE_VALUE_TYPE_SBYTE = 1,
70 MX_NODE_VALUE_TYPE_INT16 = 2,
71 MX_NODE_VALUE_TYPE_INT32 = 3,
72 MX_NODE_VALUE_TYPE_INT64 = 4,
73 MX_NODE_VALUE_TYPE_BYTE = 5,
74 MX_NODE_VALUE_TYPE_UINT16 = 6,
75 MX_NODE_VALUE_TYPE_UINT32 = 7,
76 MX_NODE_VALUE_TYPE_UINT64 = 8,
77 MX_NODE_VALUE_TYPE_FLOAT = 9,
78 MX_NODE_VALUE_TYPE_DOUBLE = 10,
79 MX_NODE_VALUE_TYPE_STRING = 11
80 } MX_NODE_VALUE_TYPE;
81
85 typedef enum _MX_NODE_ACCESS_RIGHT
86 {
87 MX_NODE_ACCESS_RIGHT_NONE = 0,
88 MX_NODE_ACCESS_RIGHT_READONLY = 1,
89 MX_NODE_ACCESS_RIGHT_WRITEONLY = 2,
90 MX_NODE_ACCESS_RIGHT_READWRITE = 3
91 } MX_NODE_ACCESS_RIGHT;
92
97 typedef struct _MX_NODE_VARIANT
98 {
99 MX_NODE_VALUE_TYPE type;
100 union
101 {
102 bool b;
103 int8_t i8;
104 int16_t i16;
105 int32_t i32;
106 int64_t i64;
107 uint8_t u8;
108 uint16_t u16;
109 uint32_t u32;
110 uint64_t u64;
111 float f;
112 double d;
113 char* s;
114 void* other;
115 } value;
116 } MX_NODE_VARIANT;
117
121 typedef struct _MX_NODE_VARIABLE
122 {
123 MX_NODE_VARIANT value;
124 MX_NODE_ACCESS_RIGHT access_right;
125 } MX_NODE_VARIABLE;
126
130 typedef struct _MX_NODE_PROPERTY
131 {
132 MX_NODE_VARIANT value;
133 MX_NODE_ACCESS_RIGHT access_right;
134 } MX_NODE_PROPERTY;
135
139 typedef struct _MX_NODE_NODE
140 {
141 char node_name[MAX_NODE_NAME_LEN];
142 char description[MAX_NODE_DESC_LEN];
143 MX_NODE_NODE_TYPE node_type;
144 union
145 {
146 MX_NODE_FOLDER folder;
147 MX_NODE_OBJECT object;
148 MX_NODE_VARIABLE variable;
149 MX_NODE_PROPERTY property;
150 };
151 } MX_NODE_NODE;
152
156 typedef enum _MX_NODE_RESULT
157 {
158 MX_NODE_RESULT_GOOD,
159 MX_NODE_RESULT_BAD
160 } MX_NODE_RESULT;
161
163
165
167
168 #endif
MX_NODE_VALUE_TYPE_UNKNOWN
Definition: mx_node_node_def.h:67
_MX_NODE_VARIABLE::value
MX_NODE_VARIANT value
Definition: mx_node_node_def.h:123
_MX_NODE_VARIANT::u8
uint8_t u8
Definition: mx_node_node_def.h:107
_MX_NODE_VARIANT::u16
uint16_t u16
Definition: mx_node_node_def.h:108
_MX_NODE_VARIANT
A variant structure is used to store different type&#39;s data.
Definition: mx_node_node_def.h:97
MX_NODE_VALUE_TYPE_BOOLEAN
Definition: mx_node_node_def.h:68
MX_NODE_ACCESS_RIGHT_READWRITE
Definition: mx_node_node_def.h:90
_MX_NODE_VALUE_TYPE
_MX_NODE_VALUE_TYPE
Variable node&#39;s data type.
Definition: mx_node_node_def.h:65
MX_NODE_FOLDER
struct _MX_NODE_FOLDER MX_NODE_FOLDER
Folder node&#39;s attributes, it is an empty sturcture.
MX_NODE_NODE_TYPE_VARIABLE
Definition: mx_node_node_def.h:44
_MX_NODE_VARIANT::i16
int16_t i16
Definition: mx_node_node_def.h:104
_MX_NODE_RESULT
_MX_NODE_RESULT
A result enumeration represents success or not.
Definition: mx_node_node_def.h:156
_MX_NODE_NODE::variable
MX_NODE_VARIABLE variable
Definition: mx_node_node_def.h:148
_MX_NODE_OBJECT
Object node&#39;s attributes, it is an empty sturcture.
Definition: mx_node_node_def.h:58
MX_NODE_RESULT
enum _MX_NODE_RESULT MX_NODE_RESULT
A result enumeration represents success or not.
MAX_NODE_NAME_LEN
#define MAX_NODE_NAME_LEN
Definition: mx_node_node_def.h:33
_MX_NODE_NODE::folder
MX_NODE_FOLDER folder
Definition: mx_node_node_def.h:146
MX_NODE_ACCESS_RIGHT_READONLY
Definition: mx_node_node_def.h:88
MX_NODE_NODE_TYPE
enum _MX_NODE_NODE_TYPE MX_NODE_NODE_TYPE
Type of OPC UA node.
MX_NODE_VALUE_TYPE_FLOAT
Definition: mx_node_node_def.h:77
_MX_NODE_ACCESS_RIGHT
_MX_NODE_ACCESS_RIGHT
Variable node&#39;s access right.
Definition: mx_node_node_def.h:85
MX_NODE_ACCESS_RIGHT_WRITEONLY
Definition: mx_node_node_def.h:89
_MX_NODE_NODE
A node&#39;s sturcture contain name, description, node type and attribute.
Definition: mx_node_node_def.h:139
MX_NODE_ACCESS_RIGHT_NONE
Definition: mx_node_node_def.h:87
MAX_NODE_DESC_LEN
#define MAX_NODE_DESC_LEN
Definition: mx_node_node_def.h:34
MX_NODE_ACCESS_RIGHT
enum _MX_NODE_ACCESS_RIGHT MX_NODE_ACCESS_RIGHT
Variable node&#39;s access right.
MX_NODE_VALUE_TYPE_BYTE
Definition: mx_node_node_def.h:73
_MX_NODE_PROPERTY
Property node&#39;s attributes.
Definition: mx_node_node_def.h:130
_MX_NODE_VARIANT::b
bool b
Definition: mx_node_node_def.h:102
_MX_NODE_VARIANT::i32
int32_t i32
Definition: mx_node_node_def.h:105
MX_NODE_NODE_TYPE_PROPERTY
Definition: mx_node_node_def.h:45
_MX_NODE_VARIANT::u32
uint32_t u32
Definition: mx_node_node_def.h:109
MX_NODE_NODE_TYPE_UNKNOWN
Definition: mx_node_node_def.h:41
_MX_NODE_VARIABLE::access_right
MX_NODE_ACCESS_RIGHT access_right
Definition: mx_node_node_def.h:124
MX_NODE_VALUE_TYPE_UINT16
Definition: mx_node_node_def.h:74
MX_NODE_RESULT_GOOD
Definition: mx_node_node_def.h:158
MX_NODE_NODE_TYPE_OBJECT
Definition: mx_node_node_def.h:43
_MX_NODE_VARIANT::i64
int64_t i64
Definition: mx_node_node_def.h:106
_MX_NODE_VARIANT::u64
uint64_t u64
Definition: mx_node_node_def.h:110
_MX_NODE_VARIANT::d
double d
Definition: mx_node_node_def.h:112
MX_NODE_VALUE_TYPE_INT32
Definition: mx_node_node_def.h:71
_MX_NODE_VARIABLE
Variable node&#39;s attributes.
Definition: mx_node_node_def.h:121
MX_NODE_VARIANT
struct _MX_NODE_VARIANT MX_NODE_VARIANT
A variant structure is used to store different type&#39;s data.
MX_NODE_OBJECT
struct _MX_NODE_OBJECT MX_NODE_OBJECT
Object node&#39;s attributes, it is an empty sturcture.
MX_NODE_VALUE_TYPE_SBYTE
Definition: mx_node_node_def.h:69
MX_NODE_VALUE_TYPE_INT16
Definition: mx_node_node_def.h:70
_MX_NODE_PROPERTY::access_right
MX_NODE_ACCESS_RIGHT access_right
Definition: mx_node_node_def.h:133
MX_NODE_VALUE_TYPE_INT64
Definition: mx_node_node_def.h:72
_MX_NODE_NODE::property
MX_NODE_PROPERTY property
Definition: mx_node_node_def.h:149
MX_NODE_NODE
struct _MX_NODE_NODE MX_NODE_NODE
A node&#39;s sturcture contain name, description, node type and attribute.
MX_NODE_VALUE_TYPE_UINT32
Definition: mx_node_node_def.h:75
_MX_NODE_FOLDER
Folder node&#39;s attributes, it is an empty sturcture.
Definition: mx_node_node_def.h:51
MX_NODE_VALUE_TYPE_DOUBLE
Definition: mx_node_node_def.h:78
MX_NODE_PROPERTY
struct _MX_NODE_PROPERTY MX_NODE_PROPERTY
Property node&#39;s attributes.
_MX_NODE_VARIANT::type
MX_NODE_VALUE_TYPE type
Definition: mx_node_node_def.h:99
MX_NODE_NODE_TYPE_FOLDER
Definition: mx_node_node_def.h:42
MX_NODE_VALUE_TYPE_STRING
Definition: mx_node_node_def.h:79
_MX_NODE_NODE::object
MX_NODE_OBJECT object
Definition: mx_node_node_def.h:147
_MX_NODE_VARIANT::i8
int8_t i8
Definition: mx_node_node_def.h:103
_MX_NODE_VARIANT::f
float f
Definition: mx_node_node_def.h:111
_MX_NODE_PROPERTY::value
MX_NODE_VARIANT value
Definition: mx_node_node_def.h:132
MX_NODE_RESULT_BAD
Definition: mx_node_node_def.h:159
_MX_NODE_VARIANT::s
char * s
Definition: mx_node_node_def.h:113
MX_NODE_VARIABLE
struct _MX_NODE_VARIABLE MX_NODE_VARIABLE
Variable node&#39;s attributes.
MX_NODE_VALUE_TYPE_UINT64
Definition: mx_node_node_def.h:76
_MX_NODE_NODE::node_type
MX_NODE_NODE_TYPE node_type
Definition: mx_node_node_def.h:143
_MX_NODE_NODE_TYPE
_MX_NODE_NODE_TYPE
Type of OPC UA node.
Definition: mx_node_node_def.h:39
_MX_NODE_VARIANT::other
void * other
Definition: mx_node_node_def.h:114
MX_NODE_VALUE_TYPE
enum _MX_NODE_VALUE_TYPE MX_NODE_VALUE_TYPE
Variable node&#39;s data type.