Skip to content

Conversation

@Katze719
Copy link
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
@Katze719 Katze719 self-assigned this Dec 20, 2025
Copy link

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 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));
Copy link

Copilot AI Dec 21, 2025

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.

Suggested change
const bytes = new TextEncoder().encode(atob(blob.data));
const bytes = Deno.base64Decode(blob.data);

Copilot uses AI. Check for mistakes.
… 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.
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.

2 participants