Skip to content

Add initial project structure with CMake configuration, Clang format … - #2

Merged
Katze719 merged 35 commits into
mainfrom
revamp-project
Mar 9, 2026
Merged

Add initial project structure with CMake configuration, Clang format …#2
Katze719 merged 35 commits into
mainfrom
revamp-project

Conversation

@Katze719

Copy link
Copy Markdown
Member

…and tidy settings, GitHub workflows, and integration tests for Windows serial communication bindings

…and tidy settings, GitHub workflows, and integration tests for Windows serial communication bindings
@Katze719Katze719 self-assigned this Dec 20, 2025

CopilotAI left a comment

Copy link
Copy Markdown

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 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
FileDescription
src/serial_open.cppImplements serial port opening with DCB configuration and overlapped I/O setup
src/serial_close.cppHandles serial port closing with proper handle validation
src/serial_read.cppImplements overlapped read operations with timeout and queuing support
src/serial_write.cppImplements overlapped write operations with FlushFileBuffers for reliability
src/detail/win32_helpers.hppProvides RAII handle wrapper and Win32 error handling utilities
tests/test_serial_arduino.cppGoogleTest-based integration tests for Arduino serial communication
integration_tests/integration_test.tsDeno integration tests for FFI library loading
integration_tests/ffi_bindings.tsDeno FFI symbol definitions for serial operations
CMakeLists.txtCMake configuration with CPM package management and GoogleTest setup
.clang-formatMicrosoft-style code formatting configuration
.clang-tidyComprehensive static analysis rules configuration
.github/workflows/cpp-tests.ymlCI workflow for C++ unit and integration tests
.github/workflows/deno-tests.ymlCI workflow for Deno FFI integration tests across versions
.github/workflows/build-deno-dll.ymlCI workflow for building and uploading DLL artifacts
.github/workflows/publish-jsr.ymlCD workflow for publishing to JSR with base64-encoded binaries
jsr/scripts/embed_binary.ps1PowerShell script to embed DLL as base64 JSON for JSR
jsr/scripts/embed_binary.shShell script for embedding binaries (Linux/Unix, potentially unused)
jsr/package/jsr.json.inJSR package metadata template with version placeholder
jsr/package/README.mdDocumentation for consuming the JSR package in Deno

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

Comment threadsrc/serial_open.cpp Outdated
Comment threadtests/test_serial_arduino.cpp Outdated
Comment threadjsr/package/README.md Outdated
Comment threadjsr/scripts/embed_binary.sh Outdated
Comment threadjsr/scripts/embed_binary.sh Outdated
Comment threadtests/serial_arduino.test.cpp
Comment thread.clang-tidy
Comment thread.clang-tidy
Comment threadCMakeLists.txt Outdated
Comment threadCMakeLists.txt
… to return structured error messages in serial_open.cpp and serial_read.cpp.
…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.
…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.
@Katze719
Katze719 requested a review from MqxxFebruary 21, 2026 16:11
@Katze719
Katze719 marked this pull request as ready for review February 21, 2026 16:11

@MqxxMqxx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.
@Katze719
Katze719 requested a review from MqxxFebruary 22, 2026 17:29
Comment thread.github/workflows/build_binary.yml Outdated
Comment thread.github/workflows/publish_jsr.yml Outdated
Comment threadjsr/scripts/embed_binary.ps1 Outdated
Comment thread.github/workflows/build_binary.yml Outdated
Mqxxand others added 2 commits February 23, 2026 12:09
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.
Comment threadsrc/detail/win32_helpers.hpp
Comment threadsrc/serial_open.cpp
Comment threadsrc/serial_read.cpp
@Katze719Katze719 added the blocked Progress is blocked by another issue or dependency label Feb 24, 2026
@Katze719

Copy link
Copy Markdown
MemberAuthor

waiting for cpp-core v1.1.0 release

@Mqxx

Mqxx commented Feb 26, 2026

Copy link
Copy Markdown
Member

waiting for cpp-core v1.1.0 release

Version 1.1.0 was merged 👍

- 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.
@Katze719Katze719 removed the blocked Progress is blocked by another issue or dependency label Feb 26, 2026
- 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.
Comment threadsrc/serial_open.cpp
Comment threadsrc/serial_open.cpp
Comment threadsrc/serial_read.cpp
Comment threadsrc/serial_write.cpp
@Mqxx
Mqxx self-requested a review March 9, 2026 08:59
Mqxx
Mqxx approved these changes Mar 9, 2026
@Katze719
Katze719 merged commit 1bf5ce8 into mainMar 9, 2026
7 checks passed
@Katze719
Katze719 deleted the revamp-project branch March 9, 2026 09:03
Sign up for freeto 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

@Katze719@Mqxx