Added Break implementation for windows
This commit is contained in:
@@ -382,7 +382,17 @@ func (port *windowsPort) SetReadTimeout(timeout time.Duration) error {
|
||||
}
|
||||
|
||||
func (port *windowsPort) Break(d time.Duration) error {
|
||||
return &PortError{code: FunctionNotImplemented}
|
||||
if err := setCommBreak(port.handle); err != nil {
|
||||
return &PortError{causedBy: err}
|
||||
}
|
||||
|
||||
time.Sleep(d)
|
||||
|
||||
if err := clearCommBreak(port.handle); err != nil {
|
||||
return &PortError{causedBy: err}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func createOverlappedEvent() (*syscall.Overlapped, error) {
|
||||
|
||||
Reference in New Issue
Block a user