From 20a47944cfa974f7ff695f355056c22e62171c95 Mon Sep 17 00:00:00 2001 From: WarningImHack3r <43064022+WarningImHack3r@users.noreply.github.com> Date: Thu, 8 May 2025 13:17:50 +0200 Subject: [PATCH] refactor: rename variables to match docs --- serial_windows.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/serial_windows.go b/serial_windows.go index 54d2a89..5c5a2a4 100644 --- a/serial_windows.go +++ b/serial_windows.go @@ -282,10 +282,10 @@ func (port *windowsPort) SetRTS(rts bool) error { // GetCommModemStatus constants. See https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getcommmodemstatus. const ( - msCTSOn = 0x0010 - msDSROn = 0x0020 - msRingOn = 0x0040 - msRLSDOn = 0x0080 + MS_CTS_ON = 0x0010 + MS_DSR_ON = 0x0020 + MS_RING_ON = 0x0040 + MS_RLSD_ON = 0x0080 ) func (port *windowsPort) GetModemStatusBits() (*ModemStatusBits, error) { @@ -294,10 +294,10 @@ func (port *windowsPort) GetModemStatusBits() (*ModemStatusBits, error) { return nil, &PortError{} } return &ModemStatusBits{ - CTS: (bits & msCTSOn) != 0, - DCD: (bits & msRLSDOn) != 0, - DSR: (bits & msDSROn) != 0, - RI: (bits & msRingOn) != 0, + CTS: (bits & MS_CTS_ON) != 0, + DCD: (bits & MS_RLSD_ON) != 0, + DSR: (bits & MS_DSR_ON) != 0, + RI: (bits & MS_RING_ON) != 0, }, nil }