Skip to content

Add modem control and configuration interfaces#16

Merged
Katze719 merged 4 commits intomainfrom
feature/serial-interface-headers
Mar 18, 2026
Merged

Add modem control and configuration interfaces#16
Katze719 merged 4 commits intomainfrom
feature/serial-interface-headers

Conversation

@Katze719
Copy link
Member

  • Introduced new headers for modem line control, including functions for setting DTR, RTS, and querying CTS, DSR, DCD, and RI states.
  • Added extended configuration options with functions for flow control, sending break conditions, updating baud rate, and retrieving port configuration.
  • Implemented error handling codes for new functionalities in status_codes.h and updated the corresponding message retrieval in status_codes.hpp.
  • Enhanced strong_types.hpp with a new FlowControl enum for better type safety in flow control settings.
  • Updated serial.h to include new interface headers for improved modularity and organization.

- Introduced new headers for modem line control, including functions for setting DTR, RTS, and querying CTS, DSR, DCD, and RI states.
- Added extended configuration options with functions for flow control, sending break conditions, updating baud rate, and retrieving port configuration.
- Implemented error handling codes for new functionalities in status_codes.h and updated the corresponding message retrieval in status_codes.hpp.
- Enhanced strong_types.hpp with a new FlowControl enum for better type safety in flow control settings.
- Updated serial.h to include new interface headers for improved modularity and organization.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds modem line control, extended configuration, and port discovery interfaces to a serial communication library. The new FlowControl enum and associated error codes support these additions.

Changes:

  • Added 11 new C interface headers for modem control (DTR, RTS, CTS, DSR, DCD, RI), extended configuration (flow control, break, baud rate update, config query), and port monitoring.
  • Added 8 new error codes in status_codes.h with corresponding string representations in status_codes.hpp.
  • Added FlowControl enum to strong_types.hpp for type-safe flow control settings.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
include/cpp_core/strong_types.hpp Added FlowControl enum (None, RTS/CTS, XON/XOFF)
include/cpp_core/status_codes.h Added 8 new negative error codes for new functionalities
include/cpp_core/status_codes.hpp Added string representations for the 8 new error codes
include/cpp_core/serial.h Includes for all 11 new interface headers
include/cpp_core/interface/serial_set_dtr.h DTR modem line control interface
include/cpp_core/interface/serial_set_rts.h RTS modem line control interface
include/cpp_core/interface/serial_get_cts.h CTS line state query interface
include/cpp_core/interface/serial_get_dsr.h DSR line state query interface
include/cpp_core/interface/serial_get_dcd.h DCD line state query interface
include/cpp_core/interface/serial_get_ri.h RI line state query interface
include/cpp_core/interface/serial_set_flow_control.h Flow control configuration interface
include/cpp_core/interface/serial_send_break.h Break condition sending interface
include/cpp_core/interface/serial_update_baudrate.h Runtime baud rate update interface
include/cpp_core/interface/serial_get_config.h Port configuration query interface
include/cpp_core/interface/serial_monitor_ports.h Hot-plug port monitoring interface

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Katze719 Katze719 marked this pull request as ready for review March 14, 2026 15:41
@Katze719 Katze719 requested a review from Mqxx March 14, 2026 15:41
- Introduced new headers for getting and setting baud rate, data bits, parity, stop bits, and flow control in the serial interface.
- Removed deprecated configuration retrieval header to streamline the API.
- Updated status codes to reflect new error handling for setting line parameters.
- Enhanced documentation for new functions to improve clarity and usability.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds modem control and configuration interfaces to a C/C++ serial port library. It introduces new header files for controlling modem lines (DTR, RTS) and querying their states (CTS, DSR, DCD, RI), as well as getters/setters for line settings (baud rate, data bits, parity, stop bits, flow control), a break condition sender, and a port hot-plug monitor.

Changes:

  • Added 17 new interface header files for modem line control, line-setting getters/setters, break sending, and port monitoring, all following the existing extern "C" API pattern.
  • Extended StatusCodes enum with 10 new error codes and corresponding message strings in status_codes.hpp.
  • Added a FlowControl enum to strong_types.hpp for type-safe flow control mode representation.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
include/cpp_core/status_codes.h Added 10 new error codes for the new interfaces
include/cpp_core/status_codes.hpp Added string representations for the new error codes
include/cpp_core/strong_types.hpp Added FlowControl enum (None, RtsCts, XonXoff)
include/cpp_core/serial.h Added #include directives for all new interface headers
include/cpp_core/interface/serial_set_dtr.h DTR control interface
include/cpp_core/interface/serial_set_rts.h RTS control interface
include/cpp_core/interface/serial_get_cts.h CTS query interface
include/cpp_core/interface/serial_get_dsr.h DSR query interface
include/cpp_core/interface/serial_get_dcd.h DCD query interface
include/cpp_core/interface/serial_get_ri.h RI query interface
include/cpp_core/interface/serial_get_baudrate.h Baud rate getter
include/cpp_core/interface/serial_get_data_bits.h Data bits getter
include/cpp_core/interface/serial_get_parity.h Parity getter
include/cpp_core/interface/serial_get_stop_bits.h Stop bits getter
include/cpp_core/interface/serial_get_flow_control.h Flow control getter
include/cpp_core/interface/serial_set_baudrate.h Baud rate setter
include/cpp_core/interface/serial_set_data_bits.h Data bits setter
include/cpp_core/interface/serial_set_parity.h Parity setter
include/cpp_core/interface/serial_set_stop_bits.h Stop bits setter
include/cpp_core/interface/serial_set_flow_control.h Flow control setter
include/cpp_core/interface/serial_send_break.h Break condition sender
include/cpp_core/interface/serial_monitor_ports.h Port hot-plug monitor

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…itorError and maintain consistency in error handling definitions.
@Katze719 Katze719 requested a review from Mqxx March 16, 2026 17:51
Moved to a dedicated feature/serial-monitor-ports branch for a
separate PR.
@Katze719 Katze719 merged commit 62b5b39 into main Mar 18, 2026
1 check passed
@Katze719 Katze719 deleted the feature/serial-interface-headers branch March 18, 2026 08:21
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.

3 participants