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
88bfe839
Commit
88bfe839
authored
2 months ago
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Plain Diff
Fix error
See merge request
!61
parents
e2f98090
5a8d2ce6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
coupler/mod_io_i2c.h
coupler/mod_io_i2c.h
+5
-0
coupler/server.c
coupler/server.c
+5
-4
No files found.
coupler/mod_io_i2c.h
View file @
88bfe839
...
...
@@ -113,6 +113,7 @@ static int setRelayState(int command, int i2c_addr)
{
/* ERROR HANDLING: i2c transaction failed */
printf
(
"Error writing to i2c slave (0x%x).
\n
"
,
i2c_addr
);
exit
(
1
);
}
close
(
file
);
return
0
;
...
...
@@ -156,11 +157,13 @@ static int getDigitalInputState(int i2c_addr, char **digital_input)
{
/* ERROR HANDLING: i2c transaction failed */
printf
(
"Error writing to i2c slave (0x%x).
\n
"
,
i2c_addr
);
exit
(
1
);
}
if
(
read
(
file
,
read_buf
,
1
)
!=
1
)
{
/* ERROR HANDLING: i2c transaction failed */
printf
(
"Error reading digital input from i2c slave (0x%x).
\n
"
,
i2c_addr
);
exit
(
1
);
}
else
{
...
...
@@ -208,11 +211,13 @@ static int getAnalogInputStateAIN(int i2c_addr, int **analog_input, uint8_t read
{
/* ERROR HANDLING: i2c transaction failed */
printf
(
"Error writing to i2c slave (0x%x).
\n
"
,
i2c_addr
);
exit
(
1
);
}
if
(
read
(
file
,
read_buf
,
2
)
!=
2
)
{
/* ERROR HANDLING: i2c transaction failed */
printf
(
"Error reading analog input from i2c slave (0x%x).
\n
"
,
i2c_addr
);
exit
(
1
);
}
else
{
...
...
This diff is collapsed.
Click to expand it.
coupler/server.c
View file @
88bfe839
...
...
@@ -48,8 +48,6 @@
#include <signal.h>
#include <argp.h>
#include <string.h>
#include "common.h"
#include "mod_io_i2c.h"
#include <time.h>
#include <open62541/plugin/log_stdout.h>
#include <open62541/server.h>
...
...
@@ -57,6 +55,10 @@
#include <open62541/plugin/accesscontrol_default.h>
#include <open62541/plugin/pubsub_ethernet.h>
#include <open62541/plugin/pubsub_udp.h>
#include "common.h"
// variable indicating if OPC UA server is running or not
static
volatile
UA_Boolean
running
=
true
;
// global ID of coupler
static
int
COUPLER_ID
=
0
;
...
...
@@ -92,6 +94,7 @@ char *PASSWORD;
char
*
X509_KEY_FILENAME
;
char
*
X509_CERTIFICATE_FILENAME
;
#include "mod_io_i2c.h"
#include "gpio.h"
#include "keep_alive.h"
#include "keep_alive_publisher.h"
...
...
@@ -99,8 +102,6 @@ char *X509_CERTIFICATE_FILENAME;
#include "cli.h"
#include "mod_io_opc_ua.h"
static
volatile
UA_Boolean
running
=
true
;
static
void
stopHandler
(
int
sign
)
{
UA_LOG_INFO
(
UA_Log_Stdout
,
UA_LOGCATEGORY_SERVER
,
"received ctrl-c"
);
...
...
This diff is collapsed.
Click to expand it.
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