-
Notifications
You must be signed in to change notification settings - Fork 226
Closed
Description
Since #187, the values of at least 4 pin status are computed with the wrong mask values:
https://github.com/bugst/go-serial/pull/187/files#diff-47ee85faa4e0440b94978b6193177ae093540d712fcea25742e36b3546357af8L244-L249
-const (
- msCTSOn = 0x0010
- msDSROn = 0x0020
- msRingOn = 0x0040
- msRLSDOn = 0x0080
-)They have been replaced by variables from the go source of x/sys/windows, but these masks represent the value change event for the pin, not their actual values. The bug is at least here: https://github.com/bugst/go-serial/blob/master/serial_windows.go#L288-L293
Following the Microsoft docs, the correct masks to read the values are the following:
-CTS = 0x0008
+CTS = 0x0010
-DSR = 0x0010
+DSR = 0x0020
-RING = 0x0100
+RING = 0x0040
-RLSD = 0x0020
+RLSD = 0x0080@twpayne implemented the events using these docs, which are not for the same purpose.
Values were in fact correct pre-1.6.3, and have been broken since this version.
Metadata
Metadata
Assignees
Labels
No labels