Skip to content

refactor: move LinuxCSerialStruct definition to a shared file#5

Merged
gkuga merged 1 commit intomasterfrom
chore/setserial
Sep 7, 2025
Merged

refactor: move LinuxCSerialStruct definition to a shared file#5
gkuga merged 1 commit intomasterfrom
chore/setserial

Conversation

@gkuga
Copy link

@gkuga gkuga commented Sep 7, 2025

Issue: #2

move LinuxCSerialStruct definition to a shared file make setserial API methods OS-specific

  • Move LinuxCSerialStruct struct definition to serial_setserial_unix.go for cross-arch clarity.
  • Change IOMapBase type to uint for architecture-dependent binary compatibility with C's unsigned long.
  • Refactor GetSerialStruct and SetSerialPortMode to be unixPort methods, removing device open/close logic.
  • Add OS stubs for unsupported platforms (darwin, freebsd, openbsd) to return clear errors.

…e setserial API methods OS-specific

- Move LinuxCSerialStruct struct definition to serial_setserial_unix.go for cross-arch clarity.
- Change IOMapBase type to uint for architecture-dependent binary compatibility with C's unsigned long.
- Refactor GetSerialStruct and SetSerialPortMode to be unixPort methods, removing device open/close logic.
- Add OS stubs for unsupported platforms (darwin, freebsd, openbsd) to return clear errors.
@gkuga gkuga merged commit 3f2cd1c into master Sep 7, 2025
2 checks passed
@gkuga gkuga deleted the chore/setserial branch September 7, 2025 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant