Skip to content

Commit 8e68f5e

Browse files
committed
DRAFT: tentative fix for DTR/RTS
1 parent d66fcb3 commit 8e68f5e

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

go.mod

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ module github.com/arduino/serial-monitor
22

33
go 1.18
44

5+
replace go.bug.st/serial => github.com/cmaglie/go-serial v0.0.0-20220902154021-3c9f14262a33
6+
57
require (
68
github.com/arduino/pluggable-monitor-protocol-handler v0.9.2
79
go.bug.st/serial v1.3.5

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
github.com/arduino/pluggable-monitor-protocol-handler v0.9.2 h1:vb5AmE3bT9we5Ej4AdBxcC9dJLXasRimVqaComf9L3M=
22
github.com/arduino/pluggable-monitor-protocol-handler v0.9.2/go.mod h1:vMG8tgHyE+hli26oT0JB/M7NxUMzzWoU5wd6cgJQRK4=
3+
github.com/cmaglie/go-serial v0.0.0-20220902154021-3c9f14262a33 h1:+ea5yWncmyELQWP0EbmHoYm23medagt22JE8HrmBAQo=
4+
github.com/cmaglie/go-serial v0.0.0-20220902154021-3c9f14262a33/go.mod h1:z8CesKorE90Qr/oRSJiEuvzYRKol9r/anJZEb5kt304=
35
github.com/creack/goselect v0.1.2 h1:2DNy14+JPjRBgPzAd1thbQp4BSIihxcBf0IXhQXDRa0=
46
github.com/creack/goselect v0.1.2/go.mod h1:a/NhLweNvqIYMuxcMOuWY516Cimucms3DglDzQP3hKY=
57
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
@@ -11,8 +13,6 @@ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+l
1113
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
1214
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1315
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
14-
go.bug.st/serial v1.3.5 h1:k50SqGZCnHZ2MiBQgzccXWG+kd/XpOs1jUljpDDKzaE=
15-
go.bug.st/serial v1.3.5/go.mod h1:z8CesKorE90Qr/oRSJiEuvzYRKol9r/anJZEb5kt304=
1616
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA=
1717
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA=
1818
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k=

main.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,6 @@ func (d *SerialMonitor) Open(boardPort string) (io.ReadWriter, error) {
156156
if err != nil {
157157
return nil, err
158158
}
159-
_ = serialPort.SetDTR(d.getDTR())
160-
_ = serialPort.SetRTS(d.getRTS())
161159
d.openedPort = true
162160
d.serialPort = serialPort
163161
return d.serialPort, nil
@@ -207,6 +205,10 @@ func (d *SerialMonitor) getMode() *serial.Mode {
207205
Parity: parity,
208206
DataBits: dataBits,
209207
StopBits: stopBits,
208+
InitialStatusBits: &serial.ModemOutputBits{
209+
DTR: d.getDTR(),
210+
RTS: d.getRTS(),
211+
},
210212
}
211213
return mode
212214
}

0 commit comments

Comments
 (0)