Add initial project structure with CMake configuration, Clang format …#2
Open
Add initial project structure with CMake configuration, Clang format …#2
Conversation
…and tidy settings, GitHub workflows, and integration tests for Windows serial communication bindings
There was a problem hiding this comment.
Pull request overview
This PR establishes the foundational structure for a Windows serial communication library with CMake build system, comprehensive tooling configuration, and CI/CD pipelines. It implements Windows-specific serial port operations (open, close, read, write) using Win32 APIs with overlapped I/O for asynchronous operations.
- Complete Windows serial communication implementation using Win32 overlapped I/O
- CMake-based build system with GoogleTest integration and git-based versioning
- Comprehensive development tooling (clang-format, clang-tidy) and GitHub Actions CI/CD workflows
- JSR package distribution setup with base64-encoded binary payloads for Deno FFI consumption
Reviewed changes
Copilot reviewed 25 out of 28 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
src/serial_open.cpp |
Implements serial port opening with DCB configuration and overlapped I/O setup |
src/serial_close.cpp |
Handles serial port closing with proper handle validation |
src/serial_read.cpp |
Implements overlapped read operations with timeout and queuing support |
src/serial_write.cpp |
Implements overlapped write operations with FlushFileBuffers for reliability |
src/detail/win32_helpers.hpp |
Provides RAII handle wrapper and Win32 error handling utilities |
tests/test_serial_arduino.cpp |
GoogleTest-based integration tests for Arduino serial communication |
integration_tests/integration_test.ts |
Deno integration tests for FFI library loading |
integration_tests/ffi_bindings.ts |
Deno FFI symbol definitions for serial operations |
CMakeLists.txt |
CMake configuration with CPM package management and GoogleTest setup |
.clang-format |
Microsoft-style code formatting configuration |
.clang-tidy |
Comprehensive static analysis rules configuration |
.github/workflows/cpp-tests.yml |
CI workflow for C++ unit and integration tests |
.github/workflows/deno-tests.yml |
CI workflow for Deno FFI integration tests across versions |
.github/workflows/build-deno-dll.yml |
CI workflow for building and uploading DLL artifacts |
.github/workflows/publish-jsr.yml |
CD workflow for publishing to JSR with base64-encoded binaries |
jsr/scripts/embed_binary.ps1 |
PowerShell script to embed DLL as base64 JSON for JSR |
jsr/scripts/embed_binary.sh |
Shell script for embedding binaries (Linux/Unix, potentially unused) |
jsr/package/jsr.json.in |
JSR package metadata template with version placeholder |
jsr/package/README.md |
Documentation for consuming the JSR package in Deno |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… to return structured error messages in serial_open.cpp and serial_read.cpp.
…ectations in SerialArduinoTest
…noTest to use COM5. This includes installing the com0com driver, creating a virtual COM pair, and starting an echo loop for testing. Adjusted the default serial port in tests to COM5 and improved error handling for port opening.
…handling and improve script execution. Updated paths for locating setupc.exe and com0com.inf, and added a sleep delay after starting the echo loop for stability.
…mprove path handling and error reporting. Updated script to search for setupc.exe and com0com.inf exclusively within the Chocolatey package directory, enhancing efficiency and reliability.
…more efficient and deterministic search for setupc.exe and com0com.inf. Updated error handling to check multiple candidate paths and limit search depth, improving reliability in locating necessary files.
…ake presets for Windows builds, and enhance test source organization. Introduce new tests for serial operations and error handling, including serial_close, serial_open, serial_read, and serial_write. Add error capture utility for improved error reporting in tests.
…or Windows, replacing the previous Deno DLL build and C++ test workflows. Add CMake presets for Visual Studio 2022 and update the JSR package structure to include a new binary export format. Refactor the JSR metadata to improve organization and include additional source files. Remove outdated workflows to streamline the CI process.
…d introducing a new versioning script. Update GitHub workflows to prepare files for JSR publishing, including changes to directory structure and file paths. Add necessary files such as LICENSE, README.md, and jsr.json for improved package organization and usability.
…he target specification for C++ test binaries, simplifying the build command.
…the structure of the package metadata.
…related includes from test files, streamlining the testing setup.
…st std::numeric_limits<int> for improved error handling and robustness.
…eamlining the file for better clarity and focus on essential information.
…mpliance with licensing requirements.
Mqxx
reviewed
Feb 22, 2026
Member
Mqxx
left a comment
There was a problem hiding this comment.
Will check if the windows side works.
…Wide conversion function. Update tests to reflect changes in port type from wchar_t to char, ensuring compatibility with new implementation.
Mqxx
requested changes
Feb 23, 2026
Katze719
commented
Feb 23, 2026
Co-authored-by: Katze719 <38188106+Katze719@users.noreply.github.com>
- Updated artifact names from 'libcpp_bindings_windows' to 'cpp_bindings_windows' for consistency across workflows. - Adjusted file paths in build and publish scripts to reflect the new artifact naming convention.
49c053d to
21309a1
Compare
Mqxx
requested changes
Feb 24, 2026
Member
Author
|
waiting for |
Member
Version |
- Changed cpp_core package version from 'main' to 'v1.1.0' in CMakeLists.txt. - Refactored serial_close, serial_open, serial_read, and serial_write implementations to use new validation and error handling mechanisms. - Removed deprecated status code checks and replaced them with cpp_core's validation functions for better error management. - Improved readability and maintainability of the serial communication functions by utilizing modern C++ practices.
- Introduced a raw_handle variable to capture the result of CreateFileW. - Updated UniqueHandle initialization to handle INVALID_HANDLE_VALUE by normalizing it to nullptr, enhancing error management in serial communication.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…and tidy settings, GitHub workflows, and integration tests for Windows serial communication bindings