Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Skyward Boardcore
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
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Avionics
Software Development
Skyward Boardcore
Wiki
Serial Communication
Changes
Page history
New page
Templates
Clone repository
Updated Serial Communication (markdown)
authored
6 years ago
by
Alvise de'Faveri
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Serial-Communication.md
+3
-3
3 additions, 3 deletions
Serial-Communication.md
with
3 additions
and
3 deletions
Serial-Communication.md
View page @
72ef9501
...
...
@@ -24,12 +24,12 @@ Other serial ports can be used as follows, but they have to be configured first.
```
cpp
#include
<fcntl.h>
//...
fd
=
open
(
"/dev/auxtty"
,
O_RDWR
);
//open serial port named auxtty
int
fd
=
open
(
"/dev/auxtty"
,
O_RDWR
);
//open serial port named auxtty
if
(
fd
<
0
)
printf
(
"Cannot open /dev/auxtty"
);
char
buffer
[
11
];
//Buffer is 10 chars + '\0'
read
(
fd
,
10
,
buffer
);
//Read 10 chars
write
(
fd
,
10
,
buffer
);
//Write 10 chars
read
(
fd
,
buffer
,
10
);
//Read 10 chars
write
(
fd
,
buffer
,
10
);
//Write 10 chars
```
Pay attention to the baudrate at which the used port is set!
...
...
This diff is collapsed.
Click to expand it.