Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sensapex_motion_control
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HaissLab
Setups Code
sensapex_motion_control
Commits
8d2d51b4
Commit
8d2d51b4
authored
1 year ago
by
Timothe Jost
Browse files
Options
Downloads
Patches
Plain Diff
improvement in proxyInit and openSerialPort
parent
b299a2ad
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sources/src/functions.c
+5
-4
5 additions, 4 deletions
sources/src/functions.c
with
5 additions
and
4 deletions
sources/src/functions.c
+
5
−
4
View file @
8d2d51b4
...
@@ -101,6 +101,7 @@ static int openSerialPort(const char *serial_port)
...
@@ -101,6 +101,7 @@ static int openSerialPort(const char *serial_port)
printf
(
"Input Serial Port Baud Rate: %d
\n
"
,
input_baud
);
printf
(
"Input Serial Port Baud Rate: %d
\n
"
,
input_baud
);
printf
(
"Output Serial Port Baud Rate: %d
\n
"
,
output_baud
);
printf
(
"Output Serial Port Baud Rate: %d
\n
"
,
output_baud
);
printf
(
"serial_fd value: %d
\n
"
,
fd
);
return
fd
;
return
fd
;
}
}
...
@@ -122,14 +123,14 @@ void proxyInit(unsigned int udp_port, char *serial_device, const char *udp_addre
...
@@ -122,14 +123,14 @@ void proxyInit(unsigned int udp_port, char *serial_device, const char *udp_addre
for
(
int
i
=
0
;
i
<
MAX_SERIAL_PORTS
;
i
++
)
for
(
int
i
=
0
;
i
<
MAX_SERIAL_PORTS
;
i
++
)
{
{
serial_fd
=
openSerialPort
(
serial_ports
[
i
]);
serial_fd
=
openSerialPort
(
serial_ports
[
i
]);
if
(
serial_fd
)
if
(
serial_fd
<
0
)
{
{
printf
(
"Successfully opened serial port: %s
\n
"
,
serial_ports
[
i
]);
printf
(
"Failed to open serial port: %s
\n
"
,
serial_ports
[
i
]);
break
;
}
}
else
else
{
{
printf
(
"Failed to open serial port: %s
\n
"
,
serial_ports
[
i
]);
printf
(
"Successfully opened serial port: %s
\n
"
,
serial_ports
[
i
]);
break
;
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment