Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Main
Synchronet
Commits
a4f0515a
Commit
a4f0515a
authored
Jul 06, 2009
by
rswindell
Browse files
Have comOpen() force the port to N-8-1 as some com devices apparently default
to E-7-1.
parent
e6d45b5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
src/comio/comio_win32.c
src/comio/comio_win32.c
+10
-1
No files found.
src/comio/comio_win32.c
View file @
a4f0515a
...
...
@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 200
7
Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 200
9
Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
...
...
@@ -52,6 +52,7 @@ COM_HANDLE comOpen(const char* device)
{
COM_HANDLE
handle
;
COMMTIMEOUTS
timeouts
;
DCB
dcb
;
if
((
handle
=
CreateFile
(
device
,
GENERIC_READ
|
GENERIC_WRITE
/* Access */
...
...
@@ -73,6 +74,14 @@ COM_HANDLE comOpen(const char* device)
SetCommTimeouts
(
handle
,
&
timeouts
);
}
/* Force N-8-1 mode: */
if
(
GetCommState
(
handle
,
&
dcb
)
==
TRUE
)
{
dcb
.
ByteSize
=
8
;
dcb
.
Parity
=
NOPARITY
;
dcb
.
StopBits
=
ONESTOPBIT
;
SetCommState
(
handle
,
&
dcb
);
}
return
handle
;
}
...
...
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