Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
EtherBone Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
EtherBone Core
Commits
7eda8460
Commit
7eda8460
authored
Mar 04, 2014
by
Wesley W. Terpstra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api: set raw mode for character devices. fixes usb corruption on some computers.
parent
3df829ca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
dev.c
api/transport/dev.c
+8
-0
No files found.
api/transport/dev.c
View file @
7eda8460
...
...
@@ -38,6 +38,7 @@
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <termios.h>
#ifndef O_BINARY
#define O_BINARY 0
...
...
@@ -68,6 +69,7 @@ void eb_dev_close(struct eb_transport* transportp) {
eb_status_t
eb_dev_connect
(
struct
eb_transport
*
transportp
,
struct
eb_link
*
linkp
,
const
char
*
address
,
int
passive
)
{
struct
eb_dev_link
*
link
;
struct
termios
ios
;
const
char
*
devname
;
char
devpath
[
256
];
char
junk
[
256
];
...
...
@@ -91,6 +93,12 @@ eb_status_t eb_dev_connect(struct eb_transport* transportp, struct eb_link* link
link
->
fdes
=
fdes
;
link
->
flags
=
fcntl
(
fdes
,
F_GETFL
,
0
);
tcgetattr
(
fdes
,
&
ios
);
cfmakeraw
(
&
ios
);
cfsetispeed
(
&
ios
,
B115200
);
cfsetospeed
(
&
ios
,
B115200
);
tcsetattr
(
fdes
,
TCSANOW
,
&
ios
);
eb_dev_set_blocking
(
link
,
0
);
/* Discard any data unread by last user */
...
...
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