-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a0313f4
commit 2657113
Showing
3 changed files
with
130 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright 2011 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
// +build windows | ||
|
||
package winapi | ||
|
||
const ( | ||
ONESTOPBIT = 0 | ||
TWOSTOPBITS = 2 | ||
|
||
NOPARITY = 0 | ||
ODDPARITY = 1 | ||
EVENPARITY = 2 | ||
MARKPARITY = 3 | ||
SPACEPARITY = 4 | ||
) | ||
|
||
type DCB struct { | ||
DCBlength uint32 | ||
BaudRate uint32 | ||
Flags uint32 | ||
_ uint16 | ||
XonLim uint16 | ||
XoffLim uint16 | ||
ByteSize byte | ||
Parity byte | ||
StopBits byte | ||
XonChar byte | ||
XoffChar byte | ||
ErrorChar byte | ||
EofChar byte | ||
EvtChar byte | ||
_ uint16 | ||
} | ||
|
||
type COMMTIMEOUTS struct { | ||
ReadIntervalTimeout uint32 | ||
ReadTotalTimeoutMultiplier uint32 | ||
ReadTotalTimeoutConstant uint32 | ||
WriteTotalTimeoutMultiplier uint32 | ||
WriteTotalTimeoutConstant uint32 | ||
} | ||
|
||
//sys GetCommState(handle syscall.Handle, dcb *DCB) (err error) | ||
//sys SetCommState(handle syscall.Handle, dcb *DCB) (err error) | ||
//sys GetCommTimeouts(handle syscall.Handle, timeouts *COMMTIMEOUTS) (err error) | ||
//sys SetCommTimeouts(handle syscall.Handle, timeouts *COMMTIMEOUTS) (err error) | ||
//sys SetupComm(handle syscall.Handle, inqueue uint32, outqueue uint32) (err error) | ||
//sys SetCommMask(handle syscall.Handle, mask uint32) (err error) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters