Skip to content
3 changes: 1 addition & 2 deletions serial_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
rs485RTSOnSend = 1 << 1
rs485RTSAfterSend = 1 << 2
rs485RXDuringTX = 1 << 4
rs485Tiocs = 0x542f
)

// rs485_ioctl_opts is used to configure RS485 options in the driver
Expand Down Expand Up @@ -511,5 +510,5 @@
rs485.flags |= rs485RXDuringTX
}

return unix.IoctlSetInt(port.handle, rs485Tiocs, int(uintptr(unsafe.Pointer(&rs485))))
return unix.IoctlSetInt(port.handle, unix.TIOCSRS485, int(uintptr(unsafe.Pointer(&rs485))))

Check failure on line 513 in serial_unix.go

View workflow job for this annotation

GitHub Actions / cross-os-build (freebsd amd64)

undefined: unix.TIOCSRS485

Check failure on line 513 in serial_unix.go

View workflow job for this annotation

GitHub Actions / native-os-build (macOS-latest)

undefined: unix.TIOCSRS485

Check failure on line 513 in serial_unix.go

View workflow job for this annotation

GitHub Actions / cross-os-build (openbsd arm)

undefined: unix.TIOCSRS485

Check failure on line 513 in serial_unix.go

View workflow job for this annotation

GitHub Actions / cross-os-build (openbsd amd64)

undefined: unix.TIOCSRS485

Check failure on line 513 in serial_unix.go

View workflow job for this annotation

GitHub Actions / cross-os-build (openbsd 386)

undefined: unix.TIOCSRS485
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tragically not though - it causes build issues on other platforms. The constant is only defined for Linux builds. Possibly that's an argument (since we're doing a Linux ioctl here) for moving this code out of serial_unix.go and into serial_linux.go?

}
Loading