Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
865 commits
Select commit Hold shift + click to select a range
11f0714
Merge remote-tracking branch 'EIPStackGroup_OpENer/master'
micsat May 20, 2021
c33de59
Merge branch 'GetAttributeList'
micsat May 20, 2021
202f16d
Identity Object: GetAttributeList service added
micsat May 20, 2021
0d2541b
stc file update
micsat May 20, 2021
e9eefb1
Widens return type to check for unreasonable length values
MartinMelikMerkumians May 26, 2021
8994b05
Merge remote-tracking branch 'EIPStackGroup_OpENer/master'
micsat Jun 8, 2021
3fcf256
ciptypes.c added, function GetCipDataTypeLength added
micsat Jun 17, 2021
95f503b
Service SetAttributeList added
micsat Jun 17, 2021
e4bb898
SetAttributeList added to Identity object
micsat Jun 17, 2021
c371870
return data type changed (GetCipDataTypeLength)
micsat Jun 21, 2021
e7cfda9
EncodeEPath update due to different path_size data types
micsat Jul 2, 2021
cc36bac
Merge pull request #342 from micsat/master
MartinMelikMerkumians Jul 15, 2021
f29d80e
Formatting update
MartinMelikMerkumians Jul 20, 2021
fbc60ab
Fixes failed merge and adds compiler flag fcommon
MartinMelikMerkumians Jul 20, 2021
e7111a6
Fixes #343 - binds UDP only to one interface
MartinMelikMerkumians Jul 20, 2021
214af90
Merge remote-tracking branch 'EIPStackGroup_OpENer/master'
micsat Jul 21, 2021
4f6b752
Adds CipStringI helper functions
MartinMelikMerkumians Sep 15, 2021
d0946f8
Removes unreachable breaks
MartinMelikMerkumians Sep 15, 2021
b1a34f1
Merge remote-tracking branch 'EIPStackGroup/master'
micsat Nov 3, 2021
79aabf4
Common service create added,
micsat Nov 29, 2021
7d1003d
fixup! Common service "Create" added, CipCallback added in class struct
micsat Nov 30, 2021
de3c86e
Attribute "max_instance" added to CipClass struct
micsat Nov 30, 2021
1006ed2
Fix possible access to not created new instance in "Create" service
Nov 30, 2021
bd8c03a
Common service "Delete" added, Callbacks added in CipClass struct
micsat Dec 2, 2021
8a1ffd4
Add automatic handling of includes for additional CIP objects
Dec 7, 2021
72ac203
Common service "Reset" added, Callbacks added in CipClass struct
micsat Dec 13, 2021
a287591
Identity object use common service"Reset" update
micsat Dec 14, 2021
6100c85
Merge branch 'CommonServices'
micsat Jan 14, 2022
e3a56a1
Create doxygen bibliography with CIP spec documents.
jvalenzuela Jan 19, 2022
9bb93ee
requested changes for pull request #355
micsat Jan 21, 2022
367b519
Merge pull request #357 from jvalenzuela/doxygenbib
MartinMelikMerkumians Jan 26, 2022
606dec8
Merge pull request #355 from micsat/master
MartinMelikMerkumians Mar 1, 2022
784788e
Merge remote-tracking branch 'EIPStackGroup/master'
micsat Mar 2, 2022
d3288ba
Warn on open connection failures
bvanhauwaert Mar 13, 2022
3aa4993
Merge pull request #365 from BartVanhauwaert/warnopenfailure
MartinMelikMerkumians Mar 18, 2022
9339a3d
CipStringIDecodeFromMessage added
micsat Mar 24, 2022
66def2b
Merge remote-tracking branch 'EIPStackGroup/master'
micsat Mar 24, 2022
af50119
Merge branch 'master' into CommonServices
micsat Mar 30, 2022
2df9a49
Fixes #370 extern needs to be in header
MartinMelikMerkumians Apr 11, 2022
a31907d
Merge pull request #371 from EIPStackGroup/develop
MartinMelikMerkumians Apr 11, 2022
5792aab
pointer for instance_data added
micsat Apr 12, 2022
d733370
Cip Delete Service update
micsat Apr 12, 2022
7301ced
CipStringICompare added
micsat Apr 13, 2022
fabb7ac
CipStringICompare updated
micsat Apr 19, 2022
9fde782
Merge remote-tracking branch 'EIPStackGroup/master'
micsat Apr 19, 2022
c1d5c2f
Merge branch 'master' into CommonServices
micsat Apr 19, 2022
4c354f6
comments removed
micsat Apr 19, 2022
5310eaf
AddCipInstances next free instance number update
micsat Apr 20, 2022
7532e33
uncrustify update
micsat May 2, 2022
97d0d1a
pull request review changes - AddCipInstances updated
micsat May 4, 2022
bcfee8e
pull request review changes - CipStringICompare updated
micsat May 11, 2022
f4e281e
uncrustify update
micsat May 11, 2022
9357143
Merge pull request #372 from micsat/CommonServices
MartinMelikMerkumians May 13, 2022
62c51cc
Implement assertion checking in unit tests.
jvalenzuela Feb 2, 2022
bbaafeb
Do not build sample app executable when building unit tests.
jvalenzuela Feb 4, 2022
95b98aa
Fix string content length for CIP string unit tests.
jvalenzuela Feb 6, 2022
d48ac8f
Free mock strings allocated for unit tests.
jvalenzuela Feb 7, 2022
2a66468
Create mock callback functions for unit testing.
jvalenzuela Feb 7, 2022
a05f099
Fix build with shared libraries, regression from 35953b2
troglobit Jun 15, 2022
020c538
Rename OPENER_BUILD_SHARED_LIBS -> BUILD_SHARED_LIBS
troglobit Jun 15, 2022
e2e658f
Separate install-as-lib and building of shared libs
troglobit Jun 20, 2022
5ee2269
.gitignore update
micsat Jul 13, 2022
f72aef8
cipcommon max_instance BUGFIX
micsat Jul 22, 2022
02f8770
uncrustify update
micsat Jul 22, 2022
af74d6a
cip: new API GetCstrFromCipShortString()
troglobit Jun 27, 2022
68cc347
Drop unused define
troglobit Jun 27, 2022
ee47746
cip: support for setting ProductName and VendorId at runtime
troglobit Jun 27, 2022
6aed3d4
cip: support for setting product's CIP Revision at runtime
troglobit Jun 27, 2022
c12af07
cip: support for setting Device Type and Product Code at runtime
troglobit Jun 27, 2022
bc7e931
cip: use C style character pointer for external API
troglobit Jun 27, 2022
ea10d0f
APIs for setting Run/Idle header on O->T and T->O frames
troglobit Jun 22, 2022
fd49ff3
Configurable size of the Ethernet message buffer
troglobit Jun 15, 2022
8a4db1e
cip: fix #387, TriggerConnections() never terminate if conn exists
troglobit Aug 25, 2022
77adedb
cip: accept the first consumed sequence number unconditionally
ch-perry Aug 10, 2022
75b831d
cipioconnection: add the AllocateSocketAddressInfoItem function
ch-perry Aug 9, 2022
044abc0
Seed PRNG before calling rand()
troglobit Aug 27, 2022
72b2b5d
Fix #348: support multiple input-only and listen-only connections
troglobit Aug 9, 2022
df6be0f
Add support for random connection IDs also for lower 16-bits
troglobit Sep 1, 2022
e6f98fb
Drop error code & msg from trace when recv() returns zero
troglobit Aug 31, 2022
3b3eeff
Log closing of TCP and UDP sockets
troglobit Aug 31, 2022
82494c9
Fix #393: transfer multicast I/O connections also on timeout
troglobit Aug 31, 2022
39806f0
Fix #393: ensure proper reuse of existing multicast T->O connection
troglobit Aug 31, 2022
3a10406
Check that socket is valid before attempting to close it
troglobit Aug 31, 2022
ac620ad
Merge branch 'bugfix/malformed-sendrr-response' of https://github.com…
MartinMelikMerkumians Oct 3, 2022
2eccf18
Merge branch 'cperrysfl-bugfix/malformed-sendrr-response'
MartinMelikMerkumians Oct 3, 2022
7b04394
Rebase fixes
MartinMelikMerkumians Oct 3, 2022
f3d5ee5
Merge branch 'PeterChristen577-Without-raw'
MartinMelikMerkumians Oct 3, 2022
1849a68
Fixes #351 - Major and minor version configurable via CMake
MartinMelikMerkumians Oct 4, 2022
1713d62
Closes #353 - Adds description to run multiple OpENers
MartinMelikMerkumians Oct 4, 2022
60bafef
Reduce compiler warning level for WIN32 builds.
jvalenzuela Mar 24, 2020
5d9564e
Changed constant data types to match their usage.
jvalenzuela Feb 11, 2020
f3dc94f
Removed unused parameter from HandleReceivedListIdentityCommandUdp().
jvalenzuela Feb 11, 2020
6a0ed36
timeout checker functions handling added (#399)
micsat Oct 14, 2022
8e21efd
Add const qualifiers so function declarations match definitions.
jvalenzuela Jul 5, 2019
a849012
Removed redundant socket timer pointer initializations.
jvalenzuela Mar 3, 2020
67597ed
Changed variable names to avoid masking variables with the same name.
jvalenzuela Dec 25, 2021
6d4b0c8
Add statements to suppress unused parameter warnings.
jvalenzuela Mar 4, 2020
a7eff20
Fixes #408 vulnerability against malformed LFO
MartinMelikMerkumians Dec 12, 2022
8cbf896
Fixes #409 vulnerability on get_attribute_list
MartinMelikMerkumians Dec 12, 2022
a4711a3
Use ints as for loop interators.
jvalenzuela Mar 5, 2020
7e75aaf
Adds warnings for conversions on suggestion from jvalenzuela
MartinMelikMerkumians Feb 23, 2023
3c5bfa3
Closes #419 Moves warning flag to source CMakeLists
MartinMelikMerkumians Feb 24, 2023
77fb6dd
Create cmake.yml (#420)
MartinMelikMerkumians Feb 24, 2023
098e7c1
Add SonarCloud (#421)
MartinMelikMerkumians Feb 24, 2023
73ce3c6
Add parenthesis around #pragma message.
jvalenzuela Mar 8, 2020
0c94e99
Update to new bound SonarCloud project
MartinMelikMerkumians Feb 27, 2023
cd1aad7
[Sonar] Adds NULL check before calling memcmp
MartinMelikMerkumians Feb 27, 2023
abf2407
Changes connection_receive_data to EipStatus
MartinMelikMerkumians Feb 27, 2023
fe17ab1
Update README.md
MartinMelikMerkumians Feb 27, 2023
75b5a39
Change invalid connection object instance type constant.
jvalenzuela Mar 14, 2020
e1bf9e6
Use fixed-width integer for UDP port.
jvalenzuela Mar 30, 2020
4f3f1e8
Adds InitializeEmpty test
MartinMelikMerkumians Nov 4, 2020
9ae17c7
Updates tests
MartinMelikMerkumians Nov 4, 2020
8af8154
Adds tests for CIP Connection Object
MartinMelikMerkumians Nov 16, 2020
66c83ff
More CipConnectionObject tests
MartinMelikMerkumians Nov 17, 2020
0e17783
Fix parameter types for WIN32 CipCalloc().
jvalenzuela Jan 13, 2022
93a04fe
Remove local inttypes header.
jvalenzuela Sep 13, 2020
9fcef66
Select different pragma statements for GCC/MSVC.
jvalenzuela Jan 12, 2022
8426801
Define a constant for assembly object instance data attribute ID.
jvalenzuela Apr 4, 2020
6b3a39a
Fix parameter differences between definitions and declarations.
jvalenzuela Mar 8, 2020
bccd994
Use same const qualifiers for insert @ head and @ tail.
jvalenzuela Jul 7, 2019
5d2f2f5
Change length parameter type for CreateEncapsulationStructure().
jvalenzuela Feb 11, 2020
ceac21c
Change constant data type to match its usage.
jvalenzuela Mar 21, 2020
0b7f709
Remove unreachable return statements.
jvalenzuela Jan 5, 2022
a427bf5
Update README.md
MartinMelikMerkumians Apr 4, 2023
46ec20f
Make class name string dynamically-allocated.
jvalenzuela Jan 14, 2022
271ca68
Update return type of OpenConnectionFunction based on d9799a0.
jvalenzuela Jan 7, 2022
66f1165
Add restrict qualifier to close connection functions.
jvalenzuela Apr 9, 2020
a210225
Add conditional unused parameter suppression for tracing parameters.
jvalenzuela Mar 13, 2022
b0a1fa5
Add pragma statements to suppress fopen/fscanf depreciation warnings.
jvalenzuela Mar 15, 2022
114a376
Trying to fix vulnerability reported in #445
MartinMelikMerkumians Apr 19, 2023
f83bfe2
uncrustify
MartinMelikMerkumians Apr 21, 2023
3748460
Merge branch 'master' of github.com:EIPStackGroup/OpENer
MartinMelikMerkumians Apr 21, 2023
c6f81e2
uncrustify
MartinMelikMerkumians Apr 21, 2023
f42ab80
DecodeCipString, DecodeCipShortString update + tests added
micsat Apr 20, 2023
ad82a5d
const qualifiers removed due to compiler warnings
micsat Apr 20, 2023
826d817
some errors in test files fixed
micsat Apr 20, 2023
fc7d237
CMake update - TargetLinkLibraries could not find an executable while…
micsat Apr 20, 2023
f3c7d2a
Add newline at the end of CMakeLists.txt
MartinMelikMerkumians Apr 21, 2023
ca5fe1d
uncrustify
MartinMelikMerkumians Apr 21, 2023
64106f8
uncrustify
MartinMelikMerkumians Apr 21, 2023
ad7db4b
Use unsigned type for number of connectable objects constant.
jvalenzuela Mar 19, 2022
ce8462c
Remove const qualifier from attribute decode function request parameter.
jvalenzuela Mar 13, 2022
393bcb5
Change local variable types to size_t, matching intended usage.
jvalenzuela Mar 18, 2020
960fdd2
Remove unnecessary local data pointer variables.
jvalenzuela Jan 12, 2022
e208082
Cast or remove unused local variables.
jvalenzuela Jan 14, 2022
a4bd87b
Add const to IdentityObjectPreResetCallback parameter.
jvalenzuela Mar 5, 2022
8b0577b
Do not define fuzz function if fuzzing is not enabled.
jvalenzuela Mar 12, 2022
2c7001b
Add cast to rand() return value.
jvalenzuela Mar 8, 2022
1df0d45
Fix data type for CPF address item count.
jvalenzuela Mar 10, 2022
a5d181f
Create custom data type for object instance numbers.
jvalenzuela Mar 5, 2022
490893a
Replace path word size constants with sizeof().
jvalenzuela Mar 19, 2022
ed1e552
Use correct constant when evaluating OpenProducingPointToPointConnect…
jvalenzuela Jan 13, 2022
c68f0cd
Bump CMake requirements to Debian bullseye
MartinMelikMerkumians Sep 26, 2023
8ec88ac
Use void pointer for attribute encoding data parameters.
jvalenzuela Mar 10, 2022
e5b096b
Change data types for DSCP configuration parameters.
jvalenzuela Oct 9, 2023
0dc3053
Add appcontype header to WIN32 sample application.
jvalenzuela Jan 17, 2022
91732d6
Fixes #483 - Changes attribute_if back to instance_id
MartinMelikMerkumians Oct 18, 2023
a529b67
Remove const from request parameter of decoding functions.
jvalenzuela Jan 8, 2022
ea4e060
Remove const qualifier from EstablishClass3Connection() parameter.
jvalenzuela Mar 14, 2022
4fe3ef3
STM32 Port
PeterChristen577 Apr 28, 2023
4ab6f50
Makefiles removed
PeterChristen577 Apr 29, 2023
682c95d
Documentation
PeterChristen577 May 14, 2023
7b07d2a
Update OpENer STM32 Port.pdf
PeterChristen577 Dec 31, 2023
207ff93
POSIX: Add a install target entry
Dec 30, 2023
dcc8194
Adds libraries for coverage and tests
MartinMelikMerkumians Feb 27, 2023
76799ab
Fixes broken tests
MartinMelikMerkumians Feb 27, 2023
961a100
Update YML for tests
MartinMelikMerkumians Feb 27, 2023
b6c5beb
Update to checkout v4
MartinMelikMerkumians Jan 8, 2024
32412a6
Fix that if BINDIR is empty CMake does not fail
MartinMelikMerkumians Jan 8, 2024
fedc684
Change SonarCloud wrapper
MartinMelikMerkumians Jan 8, 2024
0bdcd6b
Add coverage exclusions
MartinMelikMerkumians Jan 8, 2024
3280753
Set properties for C
MartinMelikMerkumians Jan 8, 2024
c427926
Adds Python version for Sonar
MartinMelikMerkumians Jan 8, 2024
d29a751
Create data type to ensure uniform session handle data types.
jvalenzuela Jan 4, 2022
f2df0ac
Fix data parameter for attribute decoding functions.
jvalenzuela Jan 5, 2022
cccf5ed
Add assertions and casts to implicit integer demotions.
jvalenzuela Mar 18, 2020
9d272ec
Add documentation for using assertions.
jvalenzuela Mar 30, 2024
f7eddfd
Add parameters to functions to conform to CipServiceFunction signature.
jvalenzuela Jan 9, 2022
ec2be32
Change NotifyAssemblyConnectedDataReceived length parameter to size_t.
jvalenzuela Mar 26, 2020
a44c30d
Adds dependabot for github actions
MartinMelikMerkumians Apr 18, 2024
8695401
Bump actions/setup-python from 4 to 5
dependabot[bot] Apr 18, 2024
37ca5d2
Remove shallow chekout from cmake.yml
MartinMelikMerkumians Apr 29, 2024
5dc8a82
Bump SonarSource/sonarcloud-github-c-cpp from 2 to 3
dependabot[bot] Jul 1, 2024
bbb9922
Change msg router request data size to size_t.
jvalenzuela Apr 18, 2024
9063f27
Commented not fully implemented CipEpathEncodeConnectionEpath
azoitl Nov 20, 2024
4507d2c
Fixed double pointer generation in CIP QOS attribute handling
Nov 20, 2024
c047f4a
Fix the issue 524: memory leak
Mar 19, 2025
bc3aeb6
move error_message further down.
SupermanOfHeiLinPu May 22, 2025
1e0309e
Fix compile error
SupermanOfHeiLinPu May 22, 2025
3451965
Bump actions/setup-python from 5 to 6
dependabot[bot] Sep 8, 2025
4167b0b
Bump actions/checkout from 4 to 5
dependabot[bot] Aug 25, 2025
0dd2373
Bump actions/checkout from 5 to 6
dependabot[bot] Nov 24, 2025
70d44c1
change action version numbers to shas
MartinMelikMerkumians Nov 25, 2025
223dd9d
add new build workflow
MartinMelikMerkumians Nov 25, 2025
ec001e9
unpin gcovr
MartinMelikMerkumians Nov 25, 2025
71e820f
switch to flavour c_cpp
MartinMelikMerkumians Nov 25, 2025
2a495e4
Enable all linters
MartinMelikMerkumians Nov 25, 2025
a7dd45c
remove legacy CI/CD files
MartinMelikMerkumians Nov 25, 2025
01d64b1
Remove legacy settings and configs
MartinMelikMerkumians Nov 25, 2025
cd092d5
fix clang settings and yml linter issues
MartinMelikMerkumians Nov 25, 2025
ae5fe14
change ML workflow to apply fixes
MartinMelikMerkumians Nov 25, 2025
47128ad
Fix double quotes for shell vars
MartinMelikMerkumians Nov 26, 2025
9c51177
another try to fix the linter issue
MartinMelikMerkumians Nov 26, 2025
91d6edb
Add megalinter reports to gitignore
MartinMelikMerkumians Nov 26, 2025
b3600d4
Megalinter fixes
MartinMelikMerkumians Nov 26, 2025
6c40365
Fix markdown linter issues
MartinMelikMerkumians Nov 28, 2025
2b7c30a
Change formatting to better supported clang-format
MartinMelikMerkumians Nov 28, 2025
8590708
fix mem leak in test helper
MartinMelikMerkumians Nov 28, 2025
33afbe3
Fix some linter issues
MartinMelikMerkumians Dec 1, 2025
0807712
add necessary permissions for build, test and coverage steps
MartinMelikMerkumians Dec 1, 2025
a0300ad
change action versions to hashes
MartinMelikMerkumians Dec 1, 2025
1d06017
Fix cppcheck non-/exhaustive checks
MartinMelikMerkumians Dec 3, 2025
29d957f
update workflows and configs
MartinMelikMerkumians Dec 3, 2025
36fc38a
update megalinter config
MartinMelikMerkumians Dec 3, 2025
26107a3
fix cppcheck info as errors in CI
MartinMelikMerkumians Dec 3, 2025
c926c9d
add supression of checklevelmaxbranches
MartinMelikMerkumians Dec 3, 2025
87502d3
Fix env argument in exhaustive check job
MartinMelikMerkumians Dec 3, 2025
dd9b3d9
update settings
MartinMelikMerkumians Dec 3, 2025
28f1695
Fix lychee error
MartinMelikMerkumians Dec 3, 2025
b894cd3
update settings
MartinMelikMerkumians Dec 4, 2025
28b8585
Add C17 requirements for compiler
MartinMelikMerkumians Dec 5, 2025
4841b93
Fix undefined cast behavior and cpplint violations in cipconnectionob…
MartinMelikMerkumians Dec 5, 2025
2520356
Fixing structure and linter errors partially
MartinMelikMerkumians Dec 13, 2025
f54ad32
Update code style
MartinMelikMerkumians Dec 13, 2025
fbc52b6
Update cpplint config
MartinMelikMerkumians Dec 13, 2025
7abcb49
Fix cpplint issues
MartinMelikMerkumians Dec 19, 2025
74525aa
Fix cpplint issues
MartinMelikMerkumians Dec 20, 2025
76c103e
Fix cpplint issues
MartinMelikMerkumians Dec 21, 2025
cbc5387
Fix cpplint issues
MartinMelikMerkumians Dec 21, 2025
47ecb3d
Fix cpplint issues
MartinMelikMerkumians Dec 21, 2025
a8118f2
Fix cpplint issues
MartinMelikMerkumians Dec 22, 2025
da2dbcf
Fix cpplint issues
MartinMelikMerkumians Dec 22, 2025
9ace601
Fix cpplint issues
MartinMelikMerkumians Dec 22, 2025
8924540
Fix wrong include for test builds
MartinMelikMerkumians Dec 22, 2025
4bd0c01
Add sanitizers
MartinMelikMerkumians Dec 22, 2025
bc8859b
Fix no traces when testing is enabled
MartinMelikMerkumians Dec 22, 2025
372bce9
Fix license file to UTF-8
MartinMelikMerkumians Dec 26, 2025
ff072ac
Fix platform includes for linting
MartinMelikMerkumians Dec 26, 2025
d9d2fa6
Add tests fr encapsulation inactivity timer
MartinMelikMerkumians Dec 27, 2025
a04fc51
Add tests for encapsulation inactivity timer
MartinMelikMerkumians Dec 27, 2025
8e0722d
Simplify CheckEncapsulationInactivity
MartinMelikMerkumians Dec 27, 2025
1402739
Add sanitizer buid
MartinMelikMerkumians Dec 29, 2025
6787829
Change XorRandomShift to reentrant Random-compliant
MartinMelikMerkumians Dec 31, 2025
1fb81d0
Update copyright
MartinMelikMerkumians Dec 31, 2025
af7ac04
Update copyright
MartinMelikMerkumians Dec 31, 2025
f896f89
Split RandomNew to create an init function
MartinMelikMerkumians Jan 3, 2026
2129f44
fix cpplint C errors
MartinMelikMerkumians Jan 3, 2026
a07f052
chore: ignore actionlint binary
MartinMelikMerkumians Jan 3, 2026
d4166b7
Fix last C cpplint issues
MartinMelikMerkumians Jan 5, 2026
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
127 changes: 75 additions & 52 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,57 +1,80 @@
---
Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -1
ConstructorInitializerIndentWidth: 4
AlignEscapedNewlinesLeft: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: true
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BinPackParameters: true
ColumnLimit: 80
ConstructorInitializerAllOnOneLineOrOnePerLine: true
DerivePointerAlignment: true
ExperimentalAutoDetectBinPacking: false
# Based on the Google C++ Style Guide, with user-specific overrides
# derived from Uncrustify rules (e.g., alignment, block enforcement).
BasedOnStyle: Google

# --- 1. Indentation & Width ---

# Uncrustify: indent_columns=2
IndentWidth: 2

# Set continuation indent to match base indent
ContinuationIndentWidth: 2

# Uncrustify: indent_with_tabs=0
UseTab: Never

# Uncrustify: code_width=80
ColumnLimit: 80

# Uncrustify: indent_switch_case=2 (Enforce indentation for case labels)
IndentCaseLabels: true
IndentWrappedFunctionNames: false
IndentFunctionDeclarationAfterType: false
MaxEmptyLinesToKeep: 1
KeepEmptyLinesAtTheStartOfBlocks: false
NamespaceIndentation: None
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakString: 1000
PenaltyBreakFirstLessLess: 120
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200

# --- 2. Spacing & Pointers ---

# Uncrustify: sp_func_def_paren=remove
# Changed to ControlStatements to add space before parens in if/for/while
# but not in function calls/declarations
SpaceBeforeParens: ControlStatements

# Uncrustify: sp_arith=add, sp_assign=add, sp_enum_assign=add
# Note: SpaceBeforeAssignment is not a valid option in clang-format
# Spacing around operators is controlled by SpacesAroundConditions and others

# Pointer Alignment: Google default is 'Left', matching the typical style
# (int* foo). We keep this unless explicitly overridden by Uncrustify.
PointerAlignment: Left
SpacesBeforeTrailingComments: 2
Cpp11BracedListStyle: true
Standard: Auto
IndentWidth: 2
TabWidth: 8
UseTab: Never

# --- 3. Alignment (Key Overrides) ---

# Uncrustify: indent_align_assign=true (Aligning consecutive assignment operators)
AlignConsecutiveAssignments: Consecutive

# Uncrustify: align_left_shift=true (Aligning binary operators like <<)
AlignOperands: Align

# --- 4. Newlines & Block Enforcement ---

# Uncrustify: nl_func_def_args=add (One argument per line)
BinPackArguments: false
BinPackParameters: false

# Uncrustify: mod_full_brace_if=add, mod_full_brace_for=add, mod_full_brace_while=add
# Goal: Do NOT allow short statements on a single line.

AllowShortBlocksOnASingleLine: Never
AllowShortIfStatementsOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false

# Uncrustify: ls_func_split_full=true (Functions)
# 'Empty' means short functions can only be one line if their body is empty.
AllowShortFunctionsOnASingleLine: Empty

# Braces: Google default is 'Attach' (e.g., 'if (x) {'), matching
# Uncrustify's nl_class_brace=remove and nl_fdef_brace=remove intent.
BreakBeforeBraces: Attach
SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
CommentPragmas: '^ IWYU pragma:'
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
SpaceBeforeParens: ControlStatements
DisableFormat: false
...

# --- 5. Miscellaneous ---

# Keep opening brace on same line for initializer lists
Cpp11BracedListStyle: false

# Uncrustify: mod_remove_extra_semicolon=true
# Note: RemoveSemicolon is not a standard option, clang-format handles this differently

# Uncrustify: indent_class=true
# Note: IndentAccessModifiers controls the indentation of public/private/protected
IndentAccessModifiers: false
AccessModifierOffset: -1

DisableFormat: false
29 changes: 29 additions & 0 deletions .cppcheck-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# cppcheck configuration for OpENer
#
# This file documents the cppcheck settings used in the project.
# cppcheck does not have a native config file format, but these settings
# are applied via command-line arguments in:
# - .pre-commit-config.yaml (for pre-commit hook)
# - .mega-linter.yml (for CI/CD)
#
# Settings:
# --------
# Standard Analysis:
# --enable=all Enable all checks
# --inconclusive Include inconclusive warnings
# --force Force checking of all configurations
# --inline-suppr Enable inline suppressions (// cppcheck-suppress)
# --suppress=missingIncludeSystem Suppress system header warnings
# --suppress=normalCheckLevelMaxBranches Suppress informational messages
#
# Exhaustive Analysis (CI only):
# --check-level=exhaustive Enable all checks
# --enable=warning,style,performance,portability
# --std=c99 Use C99 standard
# --platform=unix64 Target 64-bit POSIX platform
#
# References:
# - Pre-commit hook: .pre-commit-config.yaml (lines 28-36)
# - CI standard checks: .github/workflows/ci.yml (line 41)
# - CI exhaustive checks: .github/workflows/exhaustive-analysis.yml (lines 50-54)
# - MegaLinter config: .mega-linter.yml (line 13)
20 changes: 16 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
*.c filter=uncrustify
*.cpp filter=uncrustify
*.h filter=uncrustify
*.hpp filter=uncrustify
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.c text
*.h text

# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=crlf
*.stc text eol=crlf
*.eds text eol=crlf

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
181 changes: 181 additions & 0 deletions .github/workflows/WORKFLOWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
# OpENer CI/CD Workflows

This document describes the continuous integration and analysis workflows for the OpENer project.

## Overview

The CI/CD pipeline is split into two workflows optimized for different purposes:

### 1. **CI Workflow** (`ci.yml`)
- **Purpose**: Fast feedback for daily development
- **Triggers**: Every push to `master`, every pull request
- **Duration**: ~5-10 minutes
- **Analysis Level**: Standard (fast) static analysis

### 2. **Exhaustive Analysis** (`exhaustive-analysis.yml`)
- **Purpose**: Thorough validation for releases
- **Triggers**:
- Release branches (`release/**`)
- Version tags (`v*`)
- Nightly at 3 AM UTC
- Manual workflow dispatch
- **Duration**: ~30-60 minutes
- **Analysis Level**: Exhaustive static analysis

## Workflow Details

### CI Workflow (Fast)

**Jobs:**
1. **lint** - Quick code quality checks
- MegaLinter with standard cppcheck
- Auto-applies formatting fixes on PRs
- Suppresses `normalCheckLevelMaxBranches` info message

2. **build-test** - Build and test
- Compiles with optimizations enabled
- Runs full test suite with parallel execution
- Generates code coverage reports
- Posts coverage summary on PRs

**Best Practices Applied:**
- ✅ Parallel builds (`-j$(nproc)`)
- ✅ Parallel test execution
- ✅ Action version pinning with SHA (security)
- ✅ Automatic linter fixes
- ✅ Coverage reporting on PRs

### Exhaustive Analysis (Thorough)

**Jobs:**
1. **exhaustive-lint** - Deep static analysis
- Full branch analysis with `--check-level=exhaustive`
- Enables all cppcheck warnings (style, performance, portability)
- Creates GitHub issue on nightly failures
- Retains reports for 30 days

2. **build-release** - Release configuration testing
- Strict compiler warnings (`-Wall -Wextra -Werror`)
- Full optimization testing
- Separate coverage report for releases

## Configuration Files

### `.mega-linter.yml`
Central MegaLinter configuration with:
- Linter inclusions/exclusions
- File filtering rules
- Report settings
- Parallel processing enabled

### When Does Each Workflow Run?

| Event | CI (Fast) | Exhaustive |
|-------|-----------|------------|
| Push to `master` | ✅ | ❌ |
| Pull request | ✅ | ❌ |
| Push to `release/*` | ❌ | ✅ |
| Version tag (`v*`) | ❌ | ✅ |
| Nightly (3 AM UTC) | ❌ | ✅ |
| Manual trigger | ❌ | ✅ |

## Benefits of This Approach

### For Developers
- ⚡ **Fast feedback** on PRs (5-10 min)
- 🔧 **Auto-fixes** for formatting issues
- 📊 **Immediate coverage** reports
- 🎯 **No waiting** for exhaustive checks during development

### For Releases
- 🔍 **Thorough validation** before releases
- 🛡️ **Deep branch analysis** finds edge cases
- 📈 **Long-term tracking** with nightly runs
- 🚨 **Automatic alerts** for regressions

### For Industrial/Safety Context
- ✅ OpENer is used in **manufacturing and automation**
- ✅ Exhaustive checks catch **subtle issues** in critical paths
- ✅ **Nightly monitoring** ensures code health
- ✅ **Release validation** provides confidence for production deployments

## Maintenance

### Updating Dependencies
All action versions are pinned to specific commits for security. To update:

```bash
# Check for updates
gh workflow view ci.yml

# Update specific action
# Replace SHA in workflows with new version
```

### Adjusting Analysis Depth

**To make standard checks more thorough:**
```yaml
# In ci.yml
CPPCHECK_ARGUMENTS: --inline-suppr --enable=warning
```

**To reduce exhaustive analysis:**
```yaml
# In exhaustive-analysis.yml
CPPCHECK_ARGUMENTS: --check-level=exhaustive --inline-suppr
# Remove: --enable=warning,style,performance,portability
```

### Troubleshooting

**If CI is too slow:**
- Reduce parallel jobs: `cmake --build ... -j2`
- Skip tests on draft PRs
- Reduce validation scope

**If exhaustive analysis fails nightly:**
- Check created GitHub issues
- Download artifacts for detailed reports
- Review cppcheck output for false positives

**If linter fixes cause conflicts:**
- Add `skip fix` to commit message
- Adjust `.mega-linter.yml` rules
- Disable specific fixers

## Migration from Old Workflow

The new structure maintains all functionality from `build.yml`:

| Old Feature | New Location | Changes |
|------------|--------------|---------|
| MegaLinter | `ci.yml` → lint | Split into standard/exhaustive |
| Build & Test | `ci.yml` → build-test | Added parallel execution |
| Coverage | `ci.yml` → build-test | Enhanced reporting |
| Auto-fixes | `ci.yml` → lint | Simplified logic |
| Release validation | NEW: `exhaustive-analysis.yml` | Added thorough checks |

## Manual Workflow Execution

```bash
# Trigger exhaustive analysis manually
gh workflow run exhaustive-analysis.yml

# View recent runs
gh run list --workflow=ci.yml

# Download artifacts
gh run download <run-id>
```

## Questions?

- **Why two workflows?** Balance between speed (dev) and thoroughness (release)
- **Why nightly exhaustive?** Catches regressions without slowing daily work
- **Can I run exhaustive on my PR?** Yes, via workflow dispatch, but not recommended for regular PRs
- **What if exhaustive finds issues?** Fix in a follow-up PR; doesn't block daily development

---

*Last updated: December 2025*
Loading