Skip to content

support 921600 baudrate #176

Open
Open

Description

@alonarbel

Hi,
We are using the library in our application and have encountered an issue. Our devices operate at a baud rate of 921600, but it seems that the maximum baud rate supported by the library is 256000.
When we attempt to send long commands at 921600 baud, the commands are being truncated. We suspect this might be due to a buffer overflow.
Could you please confirm if this is the case and let us know if it's possible to address this issue? Your assistance would be greatly appreciated.
Thank you!

Edit: as mentioned in #177 this issue as reported occurs on Windows.

Activity

  1. hiddenalpha commented on Nov 28, 2024

    @hiddenalpha

    Having a look into jssc code, to me it seems that the underlying implementations already support 921600 (see the two jssc.cpp files). There is just no constant defined on java side for it.

    Maybe it's worth a try to pass the baud rate as a naked int. But make sure to check the returned value for errors. Maybe this could give us a hint. Disclaimer: I did not try this myself ever. So I do not know if this works.

    boolean ok;
    ok = serialNativeInterface.setParams(
        handle, 921600, dataBits, stopBits, parity, setRTS, setDTR, flags);
    if( !ok ){
        whops();
    }

    I don't know about the described truncation issue.

  2. tresf commented on Dec 1, 2024

    @tresf

    Maybe it's worth a try to pass the baud rate as a naked int. But make sure to check the returned value for errors. Maybe this could give us a hint. Disclaimer: I did not try this myself ever. So I do not know if this works.

    Just updating this thread with information gathered from #177, quoting:

    ... we [do] use [the] setParam function and provide any baud rate parameter they choose, not just the predefined ones in [this] library.

    However, we've encountered an issue when users send very long commands (via the writeBytes function) at 921600 baud. The commands are being truncated even if they use rts/cts flow control.(when the command are with regular size the command are sent fine, for example a command that truncated has 980 characters).
    Our OS is windows.

  3. hiddenalpha commented on Aug 1, 2025

    @hiddenalpha

    Could this issue maybe relate to #129 ? (and therefore, indirectly to #195?)

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