Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/arduino-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Arduino Library Publish

on:
push:
tags:
- 'v*'

jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install PlatformIO
run: pip install platformio

- name: Verify library version matches tag
run: |
TAG_VERSION=${GITHUB_REF#refs/tags/v}
LIB_VERSION=$(grep "^version=" library.properties | cut -d= -f2)
if [ "$TAG_VERSION" != "$LIB_VERSION" ]; then
echo "Error: Tag version ($TAG_VERSION) does not match library.properties version ($LIB_VERSION)"
exit 1
fi
echo "Library version verified: $LIB_VERSION"

- name: Run tests
run: platformio test -e test -v

- name: Build all target platforms
run: |
for env in arduino_uno arduino_nano arduino_mega esp8266 esp32 stm32f103 attiny85; do
echo "=== Building $env ==="
pio run -e $env || exit 1
done

release:
needs: verify
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- name: Extract version and changelog
id: version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
# Extract changelog section for this version
awk '/^## \['$VERSION'\]/{found=1} found{print} /^## \[/{if(found)exit}' CHANGELOG.md > release_notes.md || true
if [ ! -s release_notes.md ]; then
echo "No changelog section found for $VERSION" > release_notes.md
fi

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body_path: release_notes.md
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48 changes: 48 additions & 0 deletions .github/workflows/platformio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: PlatformIO CI

on:
push:
branches: [main, dev, feature/*]
pull_request:
branches: [main, dev]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install PlatformIO
run: pip install platformio

- name: Install lcov
run: sudo apt-get update -qq && sudo apt-get install -y -qq lcov

- name: Run tests with coverage
run: platformio test -e test -v

- name: Generate coverage report
run: |
mkdir -p coverage
# Collect coverage from .pio/build/test into lcov format
lcov --capture --directory .pio/build/test \
--output-file coverage/lcov.info \
--ignore-errors inconsistent
# Exclude Unity framework and system headers
lcov --remove coverage/lcov.info \
'*/libdeps/*' '*/Unity/*' '*/unity/*' \
--output-file coverage/lcov.info \
--ignore-errors inconsistent,unused

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: coverage/lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
verbose: true
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,10 @@ __pycache__/
# Temporal
*.tmp
test_output.txt
BUGS.md

# Coverage
coverage/
*.gcov
*.gcda
*.gcno
30 changes: 29 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,33 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.0.0] - 2026-05-17

### Changed
- **Breaking**: Wire format v3.0.0 — removed TYPE and ID fields, added layer chain payload
- **Breaking**: `llp_build_frame()` signature changed: removed type, id, version parameters
- Byte stuffing now covers LEN, PAYLOAD, and CRC fields (every 0xAA → 0xAA 0x00)
- 0xAA 0x55 inside a frame now triggers resync (replaces old TYPE/ID-based design)
- Layer chain format replaces flat payload: FinalNode, Passthrough, Transform layers
- Extended META_LEN encoding: 0xFF prefix for meta lengths ≥ 255

### Added
- `llp_build_final_payload()` helper to wrap raw data with FinalNode
- `llp_find_layer()` to search for specific layers in the chain
- `llp_get_final_payload()` to extract raw application data from the chain
- `LLP_LAYER_IS_PASSTHROUGH()`, `LLP_LAYER_IS_TRANSFORM()`, `LLP_LAYER_IS_FINAL()` macros
- `LLP_ERR_TRANSFORM_LAYER` and `LLP_ERR_MALFORMED_LAYER` error codes
- Parser statistics: `frames_ok`, `frames_error`, `timeouts`
- `llp_get_stats()` and `llp_reset_stats()` functions

### Fixed
- Optimistic resync on timeout: 0xAA byte after timeout immediately enters WAIT_MAGIC2
- CRC now covers MAGIC bytes (0xAA, 0x55) in addition to LEN and PAYLOAD

### Removed
- TYPE, ID, VERSION fields from wire format
- `llp_build_frame()` old signature with type/id/version parameters

## [1.0.0] - 2026-03-30

### Added
Expand All @@ -31,4 +58,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- LoRa integration example
- Advanced retransmission patterns
- Fragmentation support for large payloads
- Hardware CRC acceleration (STM32, etc)
- Hardware CRC acceleration (STM32, etc.)
- Fix: timeout handling should update last_byte_time for correct subsequent behavior
Loading
Loading