Skip to content

Minor updates to library to support msvc and XON/XOFF#53

Merged
AndreRenaud merged 6 commits into
AndreRenaud:masterfrom
dontech:master
Nov 4, 2025
Merged

Minor updates to library to support msvc and XON/XOFF#53
AndreRenaud merged 6 commits into
AndreRenaud:masterfrom
dontech:master

Conversation

@dontech

@dontech dontech commented Oct 28, 2025

Copy link
Copy Markdown
Contributor

Hello Andre,

Here is a small update to the library:

  1. Support MSVC without warnings
  2. Support XON/XOFF, as needed for 2 wire communication on some devices
  3. Disable DTR by default, as some USB adapters set this, making libary unusable
  4. Add missing PATH_MAX on MSVC
  5. Dont use vasprintf, not available on all platforms

@dontech

dontech commented Oct 28, 2025

Copy link
Copy Markdown
Contributor Author

Please review and merge if applicable

@AndreRenaud

Copy link
Copy Markdown
Owner

Any chance you could sneak in the change to the non-windows code, with something like:

    // clear software flow control
    options.c_iflag &= (tcflag_t) ~(IXON | IXOFF | IXANY);
    if (HAS_OPTION('X'))
        options.c_iflag |= IXON | IXOFF;

Comment thread simple_uart.c Outdated

va_start(ap, logfile);
len = vasprintf(&buffer, logfile, ap);
len = vsprintf(buffer, logfile, ap);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Probably should be vsnprintf(buffer, sizeof(buffer)...?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that would be more safe. I will fix this.

@AndreRenaud

AndreRenaud commented Oct 28, 2025

Copy link
Copy Markdown
Owner

Thanks for submitting this. Looks reasonable enough.

@dontech

dontech commented Oct 28, 2025

Copy link
Copy Markdown
Contributor Author

Yeah sure, i will fix it up and resubmit

@dontech

dontech commented Oct 28, 2025

Copy link
Copy Markdown
Contributor Author

Any chance you could sneak in the change to the non-windows code, with something like:

    // clear software flow control
    options.c_iflag &= (tcflag_t) ~(IXON | IXOFF | IXANY);
    if (HAS_OPTION('X'))
        options.c_iflag |= IXON | IXOFF;

Yeah sure, i will fix it up

simple_uart: fix using of vsprintf
simple_uart: support flow control on linux
@dontech

dontech commented Nov 4, 2025

Copy link
Copy Markdown
Contributor Author

Hi Andre, i fixed up all the things you pointed out. Please review/merge

@AndreRenaud AndreRenaud merged commit e471b0b into AndreRenaud:master Nov 4, 2025
3 checks passed
@AndreRenaud

Copy link
Copy Markdown
Owner

Thanks for this!

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.

2 participants