-
Notifications
You must be signed in to change notification settings - Fork 0
Add initial project structure with CMake configuration, Clang format … #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…and tidy settings, GitHub workflows, and integration tests for Windows serial communication bindings
There was a problem hiding this 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 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.
| type: "json", | ||
| }; | ||
|
|
||
| const bytes = new TextEncoder().encode(atob(blob.data)); |
Copilot
AI
Dec 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The atob function used here is a browser API that doesn't exist in Deno. The code should use Deno's base64 decoding API instead. Replace with: const bytes = Deno.base64Decode(blob.data) or use the proper Deno.decode API.
| const bytes = new TextEncoder().encode(atob(blob.data)); | |
| const bytes = Deno.base64Decode(blob.data); |
… 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.
…and tidy settings, GitHub workflows, and integration tests for Windows serial communication bindings