Skip to content

Commit f5a00fc

Browse files
v5.0 alpha (#258)
v5 is a major rework based on the experience gained from extensive production use of the previous revisions. The API has been redesigned from scratch and as such there is no migration guide available; please refer to the examples and read the new `canard.h` to see how to use the library -- the new API is much more ergonomic than the old one. Main changes: - Support for new protocols alongside Cyphal v1.0: - Cyphal/CAN v1.1, which adds support for 16-bit subject-IDs (like in UAVCAN v0) via a new CAN ID layout format. - UAVCAN v0 aka DroneCAN, a legacy predecessor to Cyphal v1.0 that is still widely used. - Anonymous messages can no longer be transmitted, but they can still be received. - A new passive node-ID autoconfiguration based on a simple occupancy observer. This method is decentralized and is compatible with old nodes. A node-ID can still be assigned manually if needed. - Automatic CAN acceptance filter configuration based on the current subscription set. The configuration is refreshed whenever the subscription set is modified or the local node-ID is changed. - New TX pipeline using per-transfer queue granularity with efficient CAN frame deduplication across redundant interfaces, which resulted in a major reduction of heap memory footprint (typ. x2+ reduction). - New RX pipeline supporting priority level preemption without transfer loss and reduced memory consumption. The old revision was susceptible to transfer loss when the remote initiated a higher-priority multi-frame transfer while a lower-priority multi-frame transfer was in flight. The v5 revision maintains concurrent reassemblers per priority level, enabling arbitrary priority nesting. Closes #184 Closes #223 Closes #247 --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e91cd66 commit f5a00fc

52 files changed

Lines changed: 18145 additions & 25118 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-format

Lines changed: 16 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,20 @@
1-
---
21
Language: Cpp
3-
# BasedOnStyle: LLVM
4-
AccessModifierOffset: -4
5-
AlignAfterOpenBracket: Align
2+
BasedOnStyle: Mozilla
3+
IndentWidth: 4
4+
ColumnLimit: 120
5+
Standard: c++20
6+
IndentExternBlock: NoIndent
7+
AlwaysBreakAfterDefinitionReturnType: None
8+
BreakAfterReturnType: None
9+
AllowShortFunctionsOnASingleLine: All
610
AlignConsecutiveAssignments: true
11+
AlignConsecutiveBitFields: true
712
AlignConsecutiveDeclarations: true
8-
AlignEscapedNewlines: Left
9-
AlignOperands: true
13+
AlignConsecutiveMacros: true
14+
AlignConsecutiveShortCaseStatements: { Enabled: true }
15+
AlignEscapedNewlines: LeftWithLastLine
1016
AlignTrailingComments: true
11-
AllowAllParametersOfDeclarationOnNextLine: false
12-
AllowShortBlocksOnASingleLine: Never
13-
AllowShortCaseLabelsOnASingleLine: false
14-
AllowShortFunctionsOnASingleLine: Inline
15-
AllowShortIfStatementsOnASingleLine: Never
16-
AllowShortLoopsOnASingleLine: false
17-
AlwaysBreakAfterDefinitionReturnType: None
18-
AlwaysBreakAfterReturnType: None
19-
AlwaysBreakBeforeMultilineStrings: false
20-
AlwaysBreakTemplateDeclarations: Yes
21-
BinPackArguments: false
22-
BinPackParameters: false
23-
BraceWrapping:
24-
AfterCaseLabel: true
25-
AfterClass: true
26-
AfterControlStatement: true
27-
AfterEnum: true
28-
AfterFunction: true
29-
AfterNamespace: true
30-
AfterStruct: true
31-
AfterUnion: true
32-
BeforeCatch: true
33-
BeforeElse: true
34-
IndentBraces: false
35-
SplitEmptyFunction: false
36-
SplitEmptyRecord: false
37-
SplitEmptyNamespace: false
38-
AfterExternBlock: false # Keeps the contents un-indented.
39-
BreakBeforeBinaryOperators: None
40-
BreakBeforeBraces: Custom
41-
BreakBeforeTernaryOperators: true
42-
BreakConstructorInitializers: AfterColon
43-
# BreakInheritanceList: AfterColon
44-
BreakStringLiterals: true
45-
ColumnLimit: 120
46-
CommentPragmas: '^ (coverity|pragma:)'
47-
CompactNamespaces: false
48-
ConstructorInitializerAllOnOneLineOrOnePerLine: true
49-
ConstructorInitializerIndentWidth: 4
50-
ContinuationIndentWidth: 4
51-
Cpp11BracedListStyle: true
52-
DerivePointerAlignment: false
53-
DisableFormat: false
54-
ExperimentalAutoDetectBinPacking: false
55-
FixNamespaceComments: true
56-
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
57-
IncludeBlocks: Preserve
58-
IndentCaseLabels: false
59-
IndentPPDirectives: AfterHash
60-
IndentWidth: 4
61-
IndentWrappedFunctionNames: false
62-
KeepEmptyLinesAtTheStartOfBlocks: false
63-
MacroBlockBegin: ''
64-
MacroBlockEnd: ''
65-
MaxEmptyLinesToKeep: 1
66-
NamespaceIndentation: None
67-
PenaltyBreakAssignment: 2
68-
PenaltyBreakBeforeFirstCallParameter: 10000 # Raised intentionally; prefer breaking all
69-
PenaltyBreakComment: 300
70-
PenaltyBreakFirstLessLess: 120
71-
PenaltyBreakString: 1000
72-
PenaltyExcessCharacter: 1000000
73-
PenaltyReturnTypeOnItsOwnLine: 10000 # Raised intentionally because it hurts readability
74-
PointerAlignment: Left
75-
ReflowComments: true
76-
SortIncludes: Never
77-
SortUsingDeclarations: false
78-
SpaceAfterCStyleCast: true
79-
SpaceAfterTemplateKeyword: true
80-
SpaceBeforeAssignmentOperators: true
81-
SpaceBeforeCpp11BracedList: false
82-
SpaceBeforeInheritanceColon: true
83-
SpaceBeforeParens: ControlStatements
84-
SpaceBeforeCtorInitializerColon: true
85-
SpaceBeforeRangeBasedForLoopColon: true
86-
SpaceInEmptyParentheses: false
87-
SpacesBeforeTrailingComments: 2
88-
SpacesInAngles: false
89-
SpacesInCStyleCastParentheses: false
90-
SpacesInContainerLiterals: false
91-
SpacesInParentheses: false
92-
SpacesInSquareBrackets: false
93-
Standard: c++14
94-
TabWidth: 8
95-
UseTab: Never
96-
...
17+
SortIncludes: false
18+
ForEachMacros:
19+
- FOREACH_IFACE
20+
- FOREACH_PRIO
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,24 @@ Checks: >-
1919
-bugprone-easily-swappable-parameters,
2020
-llvm-header-guard,
2121
-cert-dcl03-c,
22+
-boost-use-ranges,
2223
-hicpp-static-assert,
2324
-misc-static-assert,
2425
-*-macro-to-enum,
26+
-*-macro-usage,
27+
-*-enum-size,
28+
-*-use-using,
29+
-*-casting-through-void,
2530
-misc-include-cleaner,
31+
-cppcoreguidelines-avoid-do-while,
32+
-*-magic-numbers,
33+
-*-use-enum-class,
34+
-*-use-trailing-return-type,
35+
-*-deprecated-headers,
36+
-*-avoid-c-arrays,
37+
-*-nested-conditional-operator,
38+
-*DeprecatedOrUnsafeBufferHandling,
39+
-*-implicit-bool-conversion,
2640
CheckOptions:
2741
- key: readability-function-cognitive-complexity.Threshold
2842
value: '99'

.github/workflows/esp_dry_run.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
upload_component:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v4
13+
- uses: actions/checkout@v6
1414
with:
1515
submodules: "recursive"
1616

.github/workflows/esp_publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
upload_component:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v4
13+
- uses: actions/checkout@v6
1414
with:
1515
submodules: "recursive"
1616

0 commit comments

Comments
 (0)