SaneCppSerialPort.h is a library implementing cross-platform serial port open/configuration APIs.
Dependencies
Features
| Class | Description |
|---|---|
| SC::SerialDescriptor | SC::SerialDescriptor |
| SC::SerialSettings | SC::SerialSettings |
| SC::SerialOpenOptions | SC::SerialOpenOptions |
Status
MVP The v1 scope focuses on byte-stream descriptors and core serial settings.
Blog
Some relevant blog posts are:
Details
Example
@snippet Tests/Libraries/SerialPort/SerialPortTest.cpp SerialDescriptorSnippet
Optional Windows Real COM Test (com0com)
SerialPortTest includes an optional section named windows com0com open/config/readback.
- Set
SC_TEST_COM0COM_PORT_AandSC_TEST_COM0COM_PORT_Bto enable it. - Accepted values are both
COMxand\\.\COMx. - If both variables are unset, the section prints a skip message and succeeds.
- If only one variable is set (or values are malformed), the section fails with a configuration error.
Example command:
SC.bat build run SCTest Debug vs2022 -- --test "SerialPortTest" --test-section "windows com0com open/config/readback"
Roadmap
Usable
- Validate against more USB-to-serial adapters and edge-case drivers.
Complete Features:
- To be decided
💡 Unplanned Features:
- Port enumeration and hotplug monitoring
Statistics
| Type | Lines Of Code | Comments | Sum |
|---|---|---|---|
| Headers | 52 | 41 | 93 |
| Sources | 591 | 76 | 667 |
| Sum | 643 | 117 | 760 |