Skip to content

'signals' event? #200

Open
Open

Description

@codembed

I am wondering if a SerialPort 'signals' event was ever considered - to complement getSignals. To detect changes on RI, DCD and DSR (and CTS), the application needs to continually poll by invoking getSignals. I guess one can just poll with getSignals() every 100-500ms or so, but it seems to diverge from good asynchronous programming.

Was a SerialPort 'signals' or 'signalschange' event overlooked, or intentionally omitted for simplicity?

Activity

  1. reillyeon commented on Mar 19, 2024

    @reillyeon
    Collaborator

    I considered it but if I recall correctly Windows provides an API to listen for changes to these signals but POSIX (Linux and macOS) does not.

  2. sn4kebite commented on May 2, 2024

    @sn4kebite

    On Linux at least there's the TIOCMIWAIT operation for ioctl that accomplishes this.

  3. reillyeon commented on May 2, 2024

    @reillyeon
    Collaborator

    On Linux at least there's the TIOCMIWAIT operation for ioctl that accomplishes this.

    If you spawn a thread exclusively for the purpose of waiting for signals. POSIX has frustratingly poor support for asynchronous I/O.

  4. kvnloo commented on Oct 1, 2026

    @kvnloo

    From a latency perspective, polling getSignals() every 100–500 ms imposes an artificial detection floor even on platforms that can report changes immediately.

    It may be useful to specify signalschange as best-effort/event-driven: platforms with native notification use it directly; implementations without it may internally poll.

    That keeps the cross-platform API consistent without requiring every OS backend to expose the same primitive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions