Skip to content

Commit adbf970

Browse files
tbitcsoz-agent
andcommitted
chore: initial OmniCAN scaffold and architecture
- specsmith import: governance overlay (AGENTS.md, LEDGER.md, REQUIREMENTS.md, ARCHITECTURE.md, CI workflow, branch protection, community files) - scaffold.yml: embedded-hardware, C, Zephyr, Apache-2.0 - Kconfig: top-level OMNICAN menuconfig with per-protocol selects (CANOPEN, CANOPEN_FD, J1939, UDS, OBD2, ISOTP_PATCH) - CMakeLists.txt: module root, dispatches to per-protocol subdirs - zephyr/module.yml: west module descriptor - west.yml: Zephyr v3.7.0 + optional CANopenNode upstream reference - include/omnican/: public API headers - omnican.h: umbrella include - version.h: 0.1.0 - core.h: omnican_node, error codes, frame/protocol types - canopen.h: CANopen (CiA 301) init/start/stop/process API - canopen_fd.h: placeholder for CiA 1301 - j1939.h: address claiming, PGN routing, TP send/recv API - uds.h: ISO 14229 server — SIDs, NRCs, service callback registration - obd2.h: SAE J1979 client — PID request/response API Protocols implemented (stub API, implementations next): Phase 1 — CANopen (port from BitConcepts/CANopenNode fork) Phase 2 — J1939 (address claiming, PGN, TP/ETP) — new Phase 3 — UDS/ISO 14229 — new (over Zephyr ISOTP + #86025 patch) Phase 4 — OBD-II/J1979 — new (over Zephyr ISOTP) Phase 5 — CANopen FD/CiA 1301 — new Co-Authored-By: Oz <oz-agent@warp.dev>
0 parents  commit adbf970

29 files changed

Lines changed: 959 additions & 0 deletions

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
open-pull-requests-limit: 5
8+
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "weekly"
13+
open-pull-requests-limit: 5

.github/workflows/ci.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ci-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
lint:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-python@v6
22+
with:
23+
python-version: "3.12"
24+
cache: pip
25+
- run: pip install -e ".[dev]"
26+
- run: ruff check
27+
- run: ruff format --check .
28+
29+
typecheck:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
- uses: actions/setup-python@v6
34+
with:
35+
python-version: "3.12"
36+
cache: pip
37+
- run: pip install -e ".[dev]"
38+
- run: mypy src/omnican/
39+
40+
test:
41+
needs: [lint, typecheck]
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
os: [ubuntu-latest, windows-latest, macos-latest]
46+
python-version: ["3.10", "3.12", "3.13"]
47+
runs-on: ${{ matrix.os }}
48+
steps:
49+
- uses: actions/checkout@v4
50+
- uses: actions/setup-python@v5
51+
with:
52+
python-version: ${{ matrix.python-version }}
53+
cache: pip
54+
- run: pip install -e ".[dev]"
55+
- run: pytest --cov=omnican --cov-report=term-missing
56+
57+
security:
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/checkout@v4
61+
- uses: actions/setup-python@v6
62+
with:
63+
python-version: "3.12"
64+
cache: pip
65+
- run: pip install -e .
66+
- run: pip install pip-audit
67+
- run: pip-audit

.specsmith/credit-budget.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"monthly_cap_usd": 0.0,
3+
"alert_threshold_pct": 80,
4+
"alert_watermarks_usd": [
5+
5.0,
6+
10.0,
7+
25.0,
8+
50.0
9+
],
10+
"enabled": true,
11+
"enforcement_mode": "soft"
12+
}

AGENTS.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# omnican — Agent Governance
2+
3+
This project was imported by specsmith. The governance files contain detected structure. Review and enrich with your agent.
4+
5+
## Project Summary
6+
- **Languages**: unknown
7+
- **Build system**: not detected
8+
- **Test framework**: not detected
9+
- **Files detected**: 0
10+
- **Modules**: none detected
11+
12+
## Workflow Rules
13+
1. Read AGENTS.md fully before starting any task.
14+
2. Log all changes in LEDGER.md.
15+
3. Map changes to requirements in docs/REQUIREMENTS.md.
16+
4. Verify against docs/TESTS.md.

CMakeLists.txt

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# OmniCAN — Unified multi-protocol CAN stack for Zephyr RTOS
3+
# Copyright (c) 2026 BitConcepts, LLC
4+
5+
cmake_minimum_required(VERSION 3.20)
6+
7+
if(CONFIG_OMNICAN)
8+
9+
zephyr_include_directories(include)
10+
11+
# ---------------------------------------------------------------------------
12+
# Core frame router (always present when any protocol enabled)
13+
# ---------------------------------------------------------------------------
14+
if(CONFIG_OMNICAN_FRAME_ROUTER)
15+
add_subdirectory(src/core)
16+
endif()
17+
18+
# ---------------------------------------------------------------------------
19+
# ISOTP workaround for Zephyr issue #86025
20+
# ---------------------------------------------------------------------------
21+
if(CONFIG_OMNICAN_ISOTP_PATCH)
22+
add_subdirectory(src/isotp_patch)
23+
endif()
24+
25+
# ---------------------------------------------------------------------------
26+
# Protocol modules
27+
# ---------------------------------------------------------------------------
28+
if(CONFIG_OMNICAN_CANOPEN)
29+
add_subdirectory(src/canopen)
30+
endif()
31+
32+
if(CONFIG_OMNICAN_CANOPEN_FD)
33+
add_subdirectory(src/canopen_fd)
34+
endif()
35+
36+
if(CONFIG_OMNICAN_J1939)
37+
add_subdirectory(src/j1939)
38+
endif()
39+
40+
if(CONFIG_OMNICAN_UDS)
41+
add_subdirectory(src/uds)
42+
endif()
43+
44+
if(CONFIG_OMNICAN_OBD2)
45+
add_subdirectory(src/obd2)
46+
endif()
47+
48+
endif() # CONFIG_OMNICAN

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Contributing to omnican
2+
3+
See `AGENTS.md` for governance and `LEDGER.md` for session state.
4+
5+
## Workflow
6+
All changes follow: propose → check → execute → verify → record.

Kconfig

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# OmniCAN — Unified multi-protocol CAN stack for Zephyr RTOS
3+
# Copyright (c) 2026 BitConcepts, LLC
4+
5+
menuconfig OMNICAN
6+
bool "OmniCAN multi-protocol CAN stack"
7+
depends on CAN
8+
select NET_BUF
9+
help
10+
Enable OmniCAN — a unified multi-protocol CAN stack for Zephyr.
11+
Supports CANopen, CANopen FD, SAE J1939, ISO 14229 (UDS),
12+
and SAE J1979 (OBD-II).
13+
14+
if OMNICAN
15+
16+
# ---------------------------------------------------------------------------
17+
# Protocol modules
18+
# ---------------------------------------------------------------------------
19+
20+
config OMNICAN_CANOPEN
21+
bool "CANopen (CiA 301)"
22+
default n
23+
help
24+
Enable the CANopen protocol stack (CiA 301).
25+
Includes NMT, SDO server, PDO, Emergency, Heartbeat.
26+
27+
config OMNICAN_CANOPEN_FD
28+
bool "CANopen FD (CiA 1301)"
29+
depends on OMNICAN_CANOPEN && CAN_FD_MODE
30+
default n
31+
help
32+
Enable CANopen FD extensions (CiA 1301) on top of CANopen.
33+
Requires CAN FD hardware and OMNICAN_CANOPEN.
34+
35+
config OMNICAN_J1939
36+
bool "SAE J1939"
37+
select CAN_ACCEPT_RTR
38+
default n
39+
help
40+
Enable SAE J1939 support: address claiming (J1939/81),
41+
PGN routing (J1939/21), and Transport Protocol (J1939/21 TP/ETP).
42+
Uses 29-bit extended CAN identifiers.
43+
44+
config OMNICAN_UDS
45+
bool "ISO 14229 / UDS (Unified Diagnostic Services)"
46+
depends on ISOTP
47+
default n
48+
help
49+
Enable ISO 14229 UDS server and client.
50+
Core services: 0x10 DiagnosticSessionControl,
51+
0x11 ECUReset, 0x22 ReadDataByIdentifier,
52+
0x27 SecurityAccess, 0x28 CommunicationControl,
53+
0x2E WriteDataByIdentifier, 0x31 RoutineControl,
54+
0x34/0x36/0x37 RequestDownload/TransferData/RequestTransferExit,
55+
0x3E TesterPresent, 0x85 ControlDTCSetting.
56+
Transport: Zephyr ISO-TP (ISO 15765-2).
57+
58+
config OMNICAN_OBD2
59+
bool "SAE J1979 / OBD-II"
60+
depends on ISOTP
61+
default n
62+
help
63+
Enable OBD-II (SAE J1979) PID query/response support.
64+
Supports Mode 0x01..0x09. Transport: Zephyr ISO-TP (ISO 15765-4).
65+
66+
# ---------------------------------------------------------------------------
67+
# Core frame router
68+
# ---------------------------------------------------------------------------
69+
70+
config OMNICAN_FRAME_ROUTER
71+
bool
72+
default y if (OMNICAN_CANOPEN || OMNICAN_J1939 || OMNICAN_UDS || OMNICAN_OBD2)
73+
help
74+
Internal: enable the CAN frame router when any protocol is active.
75+
76+
# ---------------------------------------------------------------------------
77+
# ISOTP patch (Zephyr #86025 workaround)
78+
# ---------------------------------------------------------------------------
79+
80+
config OMNICAN_ISOTP_PATCH
81+
bool "Apply Zephyr ISOTP same-ID bind/send workaround"
82+
depends on ISOTP && (OMNICAN_UDS || OMNICAN_OBD2)
83+
default y if OMNICAN_UDS || OMNICAN_OBD2
84+
help
85+
Enables the OmniCAN workaround for Zephyr ISOTP issue #86025:
86+
cannot bind and transmit on the same CAN ID. Required for
87+
standard UDS physical addressing (e.g. 0x7E0/0x7E8).
88+
89+
# ---------------------------------------------------------------------------
90+
# Logging
91+
# ---------------------------------------------------------------------------
92+
93+
module = OMNICAN
94+
module-str = OmniCAN
95+
source "$(ZEPHYR_BASE)/subsys/logging/Kconfig.template.log_config"
96+
97+
endif # OMNICAN

LEDGER.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Change Ledger
2+
3+
## 2026-05-31 — specsmith import
4+
- Imported project: omnican
5+
- Detected type: cli-python
6+
- Language: unknown
7+
- Build system:

SECURITY.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Security Policy
2+
3+
To report a vulnerability in omnican, please use the repository's private vulnerability reporting feature. Do not open a public issue.

docs/ARCHITECTURE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Architecture — omnican
2+
3+
Architecture auto-generated from project detection.
4+
5+
## Overview
6+
- **Languages**: unknown
7+
- **Build system**: not detected
8+
- **Test framework**: not detected
9+

0 commit comments

Comments
 (0)