Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
osie
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
osie
Commits
00a5d1a4
Commit
00a5d1a4
authored
Apr 09, 2024
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Plain Diff
Factorize Analog In.
See merge request
!41
parents
2d6699e8
85c14244
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
217 deletions
+49
-217
coupler/mod_io_opc_ua.h
coupler/mod_io_opc_ua.h
+49
-217
No files found.
coupler/mod_io_opc_ua.h
View file @
00a5d1a4
...
@@ -99,15 +99,15 @@ static void beforeReadTime(UA_Server *server,
...
@@ -99,15 +99,15 @@ static void beforeReadTime(UA_Server *server,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
{
{
// nothing to do as not needed.
}
}
static
void
beforeReadTimeI2C0Ain0
(
UA_Server
*
server
,
const
UA_NodeId
*
sessionId
,
void
*
sessionContext
,
// Analong Inputs
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
static
void
beforeReadTimeAnalongIn
(
int
addr
,
uint8_t
read_addr
,
const
UA_DataValue
*
data
)
{
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
/*
{
* Generic handler for reading from physicall analong input.
int
addr
=
I2C_SLAVE_ADDR_LIST
[
0
];
*/
int
*
data_input
=
0
;
int
*
data_input
=
0
;
uint8_t
read_addr
=
0x30
;
if
(
!
I2C_VIRTUAL_MODE
)
{
if
(
!
I2C_VIRTUAL_MODE
)
{
getAnalogInputStateAIN
(
addr
,
&
data_input
,
read_addr
);
getAnalogInputStateAIN
(
addr
,
&
data_input
,
read_addr
);
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_UINT32
])
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_UINT32
])
...
@@ -117,21 +117,20 @@ static void beforeReadTimeI2C0Ain0(UA_Server *server,
...
@@ -117,21 +117,20 @@ static void beforeReadTimeI2C0Ain0(UA_Server *server,
}
}
}
}
static
void
beforeReadTimeI2C0Ain0
(
UA_Server
*
server
,
const
UA_NodeId
*
sessionId
,
void
*
sessionContext
,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
{
beforeReadTimeAnalongIn
(
I2C_SLAVE_ADDR_LIST
[
0
],
0x30
,
data
);
}
static
void
beforeReadTimeI2C0Ain1
(
UA_Server
*
server
,
static
void
beforeReadTimeI2C0Ain1
(
UA_Server
*
server
,
const
UA_NodeId
*
sessionId
,
void
*
sessionContext
,
const
UA_NodeId
*
sessionId
,
void
*
sessionContext
,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
{
{
int
addr
=
I2C_SLAVE_ADDR_LIST
[
0
];
beforeReadTimeAnalongIn
(
I2C_SLAVE_ADDR_LIST
[
0
],
0x31
,
data
);
int
*
data_input
=
0
;
uint8_t
read_addr
=
0x31
;
if
(
!
I2C_VIRTUAL_MODE
)
{
getAnalogInputStateAIN
(
addr
,
&
data_input
,
read_addr
);
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_UINT32
])
{
*
(
UA_UInt32
*
)
data
->
value
.
data
=
*
data_input
;
}
}
}
}
static
void
beforeReadTimeI2C0Ain2
(
UA_Server
*
server
,
static
void
beforeReadTimeI2C0Ain2
(
UA_Server
*
server
,
...
@@ -139,16 +138,7 @@ static void beforeReadTimeI2C0Ain2(UA_Server *server,
...
@@ -139,16 +138,7 @@ static void beforeReadTimeI2C0Ain2(UA_Server *server,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
{
{
int
addr
=
I2C_SLAVE_ADDR_LIST
[
0
];
beforeReadTimeAnalongIn
(
I2C_SLAVE_ADDR_LIST
[
0
],
0x32
,
data
);
int
*
data_input
=
0
;
uint8_t
read_addr
=
0x32
;
if
(
!
I2C_VIRTUAL_MODE
)
{
getAnalogInputStateAIN
(
addr
,
&
data_input
,
read_addr
);
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_UINT32
])
{
*
(
UA_UInt32
*
)
data
->
value
.
data
=
*
data_input
;
}
}
}
}
static
void
beforeReadTimeI2C0Ain3
(
UA_Server
*
server
,
static
void
beforeReadTimeI2C0Ain3
(
UA_Server
*
server
,
...
@@ -156,32 +146,15 @@ static void beforeReadTimeI2C0Ain3(UA_Server *server,
...
@@ -156,32 +146,15 @@ static void beforeReadTimeI2C0Ain3(UA_Server *server,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
{
{
int
addr
=
I2C_SLAVE_ADDR_LIST
[
0
];
beforeReadTimeAnalongIn
(
I2C_SLAVE_ADDR_LIST
[
0
],
0x33
,
data
);
int
*
data_input
=
0
;
uint8_t
read_addr
=
0x33
;
if
(
!
I2C_VIRTUAL_MODE
)
{
getAnalogInputStateAIN
(
addr
,
&
data_input
,
read_addr
);
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_UINT32
])
{
*
(
UA_UInt32
*
)
data
->
value
.
data
=
*
data_input
;
}
}
}
}
static
void
beforeReadTimeI2C1Ain0
(
UA_Server
*
server
,
static
void
beforeReadTimeI2C1Ain0
(
UA_Server
*
server
,
const
UA_NodeId
*
sessionId
,
void
*
sessionContext
,
const
UA_NodeId
*
sessionId
,
void
*
sessionContext
,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
{
{
int
addr
=
I2C_SLAVE_ADDR_LIST
[
1
];
beforeReadTimeAnalongIn
(
I2C_SLAVE_ADDR_LIST
[
1
],
0x30
,
data
);
int
*
data_input
=
0
;
uint8_t
read_addr
=
0x30
;
if
(
!
I2C_VIRTUAL_MODE
)
{
getAnalogInputStateAIN
(
addr
,
&
data_input
,
read_addr
);
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_UINT32
])
{
*
(
UA_UInt32
*
)
data
->
value
.
data
=
*
data_input
;
}
}
}
}
static
void
beforeReadTimeI2C1Ain1
(
UA_Server
*
server
,
static
void
beforeReadTimeI2C1Ain1
(
UA_Server
*
server
,
...
@@ -189,16 +162,7 @@ static void beforeReadTimeI2C1Ain1(UA_Server *server,
...
@@ -189,16 +162,7 @@ static void beforeReadTimeI2C1Ain1(UA_Server *server,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
{
{
int
addr
=
I2C_SLAVE_ADDR_LIST
[
1
];
beforeReadTimeAnalongIn
(
I2C_SLAVE_ADDR_LIST
[
1
],
0x31
,
data
);
int
*
data_input
=
0
;
uint8_t
read_addr
=
0x31
;
if
(
!
I2C_VIRTUAL_MODE
)
{
getAnalogInputStateAIN
(
addr
,
&
data_input
,
read_addr
);
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_UINT32
])
{
*
(
UA_UInt32
*
)
data
->
value
.
data
=
*
data_input
;
}
}
}
}
static
void
beforeReadTimeI2C1Ain2
(
UA_Server
*
server
,
static
void
beforeReadTimeI2C1Ain2
(
UA_Server
*
server
,
...
@@ -206,16 +170,7 @@ static void beforeReadTimeI2C1Ain2(UA_Server *server,
...
@@ -206,16 +170,7 @@ static void beforeReadTimeI2C1Ain2(UA_Server *server,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
{
{
int
addr
=
I2C_SLAVE_ADDR_LIST
[
1
];
beforeReadTimeAnalongIn
(
I2C_SLAVE_ADDR_LIST
[
1
],
0x32
,
data
);
int
*
data_input
=
0
;
uint8_t
read_addr
=
0x32
;
if
(
!
I2C_VIRTUAL_MODE
)
{
getAnalogInputStateAIN
(
addr
,
&
data_input
,
read_addr
);
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_UINT32
])
{
*
(
UA_UInt32
*
)
data
->
value
.
data
=
*
data_input
;
}
}
}
}
static
void
beforeReadTimeI2C1Ain3
(
UA_Server
*
server
,
static
void
beforeReadTimeI2C1Ain3
(
UA_Server
*
server
,
...
@@ -223,28 +178,20 @@ static void beforeReadTimeI2C1Ain3(UA_Server *server,
...
@@ -223,28 +178,20 @@ static void beforeReadTimeI2C1Ain3(UA_Server *server,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
{
{
int
addr
=
I2C_SLAVE_ADDR_LIST
[
1
];
beforeReadTimeAnalongIn
(
I2C_SLAVE_ADDR_LIST
[
1
],
0x33
,
data
);
int
*
data_input
=
0
;
uint8_t
read_addr
=
0x33
;
if
(
!
I2C_VIRTUAL_MODE
)
{
getAnalogInputStateAIN
(
addr
,
&
data_input
,
read_addr
);
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_UINT32
])
{
*
(
UA_UInt32
*
)
data
->
value
.
data
=
*
data_input
;
}
}
}
}
static
void
beforeReadTimeI2C0In0
(
UA_Server
*
server
,
// Digital Inputs
const
UA_NodeId
*
sessionId
,
void
*
sessionContext
,
static
void
beforeReadTimeDigitalIn
(
int
addr
,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
int
input_number
,
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
const
UA_DataValue
*
data
){
{
/*
int
addr
=
I2C_SLAVE_ADDR_LIST
[
0
];
* Generic handler for reading and updating a Digital In.
*/
char
*
data_input
=
0
;
char
*
data_input
=
0
;
if
(
!
I2C_VIRTUAL_MODE
)
{
if
(
!
I2C_VIRTUAL_MODE
)
{
getDigitalInputState
(
addr
,
&
data_input
);
getDigitalInputState
(
addr
,
&
data_input
);
if
((
*
data_input
)
&
(
1UL
<<
0
))
if
((
*
data_input
)
&
(
1UL
<<
input_number
))
{
{
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_BOOLEAN
])
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_BOOLEAN
])
{
{
...
@@ -261,30 +208,20 @@ static void beforeReadTimeI2C0In0(UA_Server *server,
...
@@ -261,30 +208,20 @@ static void beforeReadTimeI2C0In0(UA_Server *server,
}
}
}
}
static
void
beforeReadTimeI2C0In0
(
UA_Server
*
server
,
const
UA_NodeId
*
sessionId
,
void
*
sessionContext
,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
{
beforeReadTimeDigitalIn
(
I2C_SLAVE_ADDR_LIST
[
0
],
0
,
data
);
}
static
void
beforeReadTimeI2C0In1
(
UA_Server
*
server
,
static
void
beforeReadTimeI2C0In1
(
UA_Server
*
server
,
const
UA_NodeId
*
sessionId
,
void
*
sessionContext
,
const
UA_NodeId
*
sessionId
,
void
*
sessionContext
,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
{
{
int
addr
=
I2C_SLAVE_ADDR_LIST
[
0
];
beforeReadTimeDigitalIn
(
I2C_SLAVE_ADDR_LIST
[
0
],
1
,
data
);
char
*
data_input
=
0
;
if
(
!
I2C_VIRTUAL_MODE
)
{
getDigitalInputState
(
addr
,
&
data_input
);
if
((
*
data_input
)
&
(
1UL
<<
1
))
{
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_BOOLEAN
])
{
*
(
UA_Boolean
*
)
data
->
value
.
data
=
true
;
}
}
else
{
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_BOOLEAN
])
{
*
(
UA_Boolean
*
)
data
->
value
.
data
=
false
;
}
}
}
}
}
static
void
beforeReadTimeI2C0In2
(
UA_Server
*
server
,
static
void
beforeReadTimeI2C0In2
(
UA_Server
*
server
,
...
@@ -292,25 +229,7 @@ static void beforeReadTimeI2C0In2(UA_Server *server,
...
@@ -292,25 +229,7 @@ static void beforeReadTimeI2C0In2(UA_Server *server,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
{
{
int
addr
=
I2C_SLAVE_ADDR_LIST
[
0
];
beforeReadTimeDigitalIn
(
I2C_SLAVE_ADDR_LIST
[
0
],
2
,
data
);
char
*
data_input
=
0
;
if
(
!
I2C_VIRTUAL_MODE
)
{
getDigitalInputState
(
addr
,
&
data_input
);
if
((
*
data_input
)
&
(
1UL
<<
2
))
{
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_BOOLEAN
])
{
*
(
UA_Boolean
*
)
data
->
value
.
data
=
true
;
}
}
else
{
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_BOOLEAN
])
{
*
(
UA_Boolean
*
)
data
->
value
.
data
=
false
;
}
}
}
}
}
static
void
beforeReadTimeI2C0In3
(
UA_Server
*
server
,
static
void
beforeReadTimeI2C0In3
(
UA_Server
*
server
,
...
@@ -318,50 +237,16 @@ static void beforeReadTimeI2C0In3(UA_Server *server,
...
@@ -318,50 +237,16 @@ static void beforeReadTimeI2C0In3(UA_Server *server,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
{
{
int
addr
=
I2C_SLAVE_ADDR_LIST
[
0
];
beforeReadTimeDigitalIn
(
I2C_SLAVE_ADDR_LIST
[
0
],
3
,
data
);
char
*
data_input
=
0
;
if
(
!
I2C_VIRTUAL_MODE
)
{
getDigitalInputState
(
addr
,
&
data_input
);
if
((
*
data_input
)
&
(
1UL
<<
3
))
{
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_BOOLEAN
])
{
*
(
UA_Boolean
*
)
data
->
value
.
data
=
true
;
}
}
else
{
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_BOOLEAN
])
{
*
(
UA_Boolean
*
)
data
->
value
.
data
=
false
;
}
}
}
}
}
static
void
beforeReadTimeI2C1In0
(
UA_Server
*
server
,
static
void
beforeReadTimeI2C1In0
(
UA_Server
*
server
,
const
UA_NodeId
*
sessionId
,
void
*
sessionContext
,
const
UA_NodeId
*
sessionId
,
void
*
sessionContext
,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
{
{
int
addr
=
I2C_SLAVE_ADDR_LIST
[
1
];
beforeReadTimeDigitalIn
(
I2C_SLAVE_ADDR_LIST
[
1
],
0
,
data
);
char
*
data_input
=
0
;
if
(
!
I2C_VIRTUAL_MODE
)
{
getDigitalInputState
(
addr
,
&
data_input
);
if
((
*
data_input
)
&
(
1UL
<<
0
))
{
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_BOOLEAN
])
{
*
(
UA_Boolean
*
)
data
->
value
.
data
=
true
;
}
}
else
{
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_BOOLEAN
])
{
*
(
UA_Boolean
*
)
data
->
value
.
data
=
false
;
}
}
}
}
}
static
void
beforeReadTimeI2C1In1
(
UA_Server
*
server
,
static
void
beforeReadTimeI2C1In1
(
UA_Server
*
server
,
...
@@ -369,25 +254,7 @@ static void beforeReadTimeI2C1In1(UA_Server *server,
...
@@ -369,25 +254,7 @@ static void beforeReadTimeI2C1In1(UA_Server *server,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
{
{
int
addr
=
I2C_SLAVE_ADDR_LIST
[
1
];
beforeReadTimeDigitalIn
(
I2C_SLAVE_ADDR_LIST
[
1
],
1
,
data
);
char
*
data_input
=
0
;
if
(
!
I2C_VIRTUAL_MODE
)
{
getDigitalInputState
(
addr
,
&
data_input
);
if
((
*
data_input
)
&
(
1UL
<<
1
))
{
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_BOOLEAN
])
{
*
(
UA_Boolean
*
)
data
->
value
.
data
=
true
;
}
}
else
{
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_BOOLEAN
])
{
*
(
UA_Boolean
*
)
data
->
value
.
data
=
false
;
}
}
}
}
}
static
void
beforeReadTimeI2C1In2
(
UA_Server
*
server
,
static
void
beforeReadTimeI2C1In2
(
UA_Server
*
server
,
...
@@ -395,25 +262,7 @@ static void beforeReadTimeI2C1In2(UA_Server *server,
...
@@ -395,25 +262,7 @@ static void beforeReadTimeI2C1In2(UA_Server *server,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
{
{
int
addr
=
I2C_SLAVE_ADDR_LIST
[
1
];
beforeReadTimeDigitalIn
(
I2C_SLAVE_ADDR_LIST
[
1
],
2
,
data
);
char
*
data_input
=
0
;
if
(
!
I2C_VIRTUAL_MODE
)
{
getDigitalInputState
(
addr
,
&
data_input
);
if
((
*
data_input
)
&
(
1UL
<<
2
))
{
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_BOOLEAN
])
{
*
(
UA_Boolean
*
)
data
->
value
.
data
=
true
;
}
}
else
{
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_BOOLEAN
])
{
*
(
UA_Boolean
*
)
data
->
value
.
data
=
false
;
}
}
}
}
}
static
void
beforeReadTimeI2C1In3
(
UA_Server
*
server
,
static
void
beforeReadTimeI2C1In3
(
UA_Server
*
server
,
...
@@ -421,27 +270,10 @@ static void beforeReadTimeI2C1In3(UA_Server *server,
...
@@ -421,27 +270,10 @@ static void beforeReadTimeI2C1In3(UA_Server *server,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NodeId
*
nodeid
,
void
*
nodeContext
,
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
const
UA_NumericRange
*
range
,
const
UA_DataValue
*
data
)
{
{
int
addr
=
I2C_SLAVE_ADDR_LIST
[
1
];
beforeReadTimeDigitalIn
(
I2C_SLAVE_ADDR_LIST
[
1
],
3
,
data
);
char
*
data_input
=
0
;
if
(
!
I2C_VIRTUAL_MODE
)
{
getDigitalInputState
(
addr
,
&
data_input
);
if
((
*
data_input
)
&
(
1UL
<<
3
))
{
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_BOOLEAN
])
{
*
(
UA_Boolean
*
)
data
->
value
.
data
=
true
;
}
}
else
{
if
(
data
->
value
.
type
==
&
UA_TYPES
[
UA_TYPES_BOOLEAN
])
{
*
(
UA_Boolean
*
)
data
->
value
.
data
=
false
;
}
}
}
}
}
// Relays
static
void
afterWriteTime
(
UA_Server
*
server
,
static
void
afterWriteTime
(
UA_Server
*
server
,
const
UA_NodeId
*
sessionId
,
void
*
sessionContext
,
const
UA_NodeId
*
sessionId
,
void
*
sessionContext
,
const
UA_NodeId
*
nodeId
,
void
*
nodeContext
,
const
UA_NodeId
*
nodeId
,
void
*
nodeContext
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment