Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: add LIBOCPP_ prefix to library-own options #301

Closed
wants to merge 6 commits into from
Closed
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
7 changes: 7 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
* @pietfried @hikinggrass @marcemmers @maaikez

/config/v16/ @pietfried @hikinggrass
/include/ocpp/v16/ @pietfried @hikinggrass
/lib/ocpp/v16/ @pietfried @hikinggrass

/.github/ @pietfried @hikinggrass
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Bug Report
description: Thanks for taking the time to fill out this bug report!

body:
- type: dropdown
id: affected-ocpp-version
attributes:
label: OCPP Version
description: Which OCPP is affected? Mark both if applicable.
options:
- OCPP1.6
- OCPP2.0.1
multiple: true
validations:
required: true

- type: textarea
id: description
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is. If applicable, add screenshots or logfiles to help explain your problem.
validations:
required: true

- type: textarea
id: reproduction
attributes:
label: To Reproduce
description: |
If applicable describe the steps to and additional information to reproduce the behavior like message communication between CSMS, used configuration(s), compile options and your system information

- type: textarea
id: other
attributes:
label: Anything else?
placeholder: Add any other context about the bug report here.
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Feature Request
description: Thanks for taking the time to fill out this feature request!

body:
- type: dropdown
id: affected-ocpp-version
attributes:
label: OCPP Version
description: For which OCPP do you suggest this feature? Mark both if applicable.
options:
- OCPP1.6
- OCPP2.0.1
multiple: true
validations:
required: true

- type: textarea
id: description
attributes:
label: Describe the problem
description: What problem is your feature request targeting and why is it a problem? Please describe.
placeholder: |
A clear and concise description of what the problem is.
validations:
required: true

- type: textarea
id: solution
attributes:
label: Describe your solution
description: Describe the solution you'd like
placeholder: |
A clear and concise description of what you want to happen.

- type: textarea
id: other
attributes:
label: Additional context
placeholder: Add any other context about the feature request here.
9 changes: 9 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Describe your changes

Check notice on line 1 in .github/pull_request_template.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/pull_request_template.md#L1

Expected: [None]; Actual: ## Describe your changes

Check notice on line 1 in .github/pull_request_template.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/pull_request_template.md#L1

First line in a file should be a top-level heading

## Issue ticket number and link

## Checklist before requesting a review

Check notice on line 5 in .github/pull_request_template.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/pull_request_template.md#L5

Expected: 1; Actual: 0; Below
- [ ] I have performed a self-review of my code

Check notice on line 6 in .github/pull_request_template.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/pull_request_template.md#L6

Lists should be surrounded by blank lines
- [ ] I have made corresponding changes to the documentation
- [ ] I read the [contribution documentation](https://github.com/EVerest/EVerest/blob/main/CONTRIBUTING.md) and made sure that my changes meet its requirements

Check notice on line 8 in .github/pull_request_template.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/pull_request_template.md#L8

Expected: 80; Actual: 159

21 changes: 14 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.14)

project(ocpp
VERSION 0.9.7
VERSION 0.9.8
DESCRIPTION "A C++ implementation of the Open Charge Point Protocol"
LANGUAGES CXX
)
Expand All @@ -11,10 +11,16 @@ find_package(everest-cmake 0.1 REQUIRED
)

# options
option(BUILD_TESTING "Run unit tests" OFF)

option(CMAKE_RUN_CLANG_TIDY "Run clang-tidy" OFF)
option(LIBOCPP_BUILD_EXAMPLES "Build charge_point and central_system binaries." OFF)
option(OCPP_INSTALL "Install the library (shared data might be installed anyway)" ${EVC_MAIN_PROJECT})
option(${PROJECT_NAME}_BUILD_EXAMPLES "Build charge_point and central_system binaries." OFF)
option(${PROJECT_NAME}_INSTALL "Install the library (shared data might be installed anyway)" ${EVC_MAIN_PROJECT})
option(${PROJECT_NAME}_BUILD_TESTING "Build unit tests, used if included as dependency" OFF)
option(BUILD_TESTING "Build unit tests, used if standalone project" OFF)

if((${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME} OR ${PROJECT_NAME}_BUILD_TESTING) AND BUILD_TESTING)
set(LIBOCPP_BUILD_TESTING ON)
endif()

# dependencies
find_package(Boost COMPONENTS program_options regex system thread REQUIRED)
Expand All @@ -25,7 +31,7 @@ if(NOT DISABLE_EDM)
evc_setup_edm()

# In EDM mode, we can't install exports (because the dependencies usually do not install their exports)
set(OCPP_INSTALL OFF)
set(${PROJECT_NAME}_INSTALL OFF)

# FIXME (aw): websocketpp doesn't play well with EDM/CPM
add_library(websocketpp::websocketpp INTERFACE IMPORTED)
Expand All @@ -51,7 +57,7 @@ add_subdirectory(config)


# packaging
if (OCPP_INSTALL)
if (${PROJECT_NAME}_INSTALL)
install(
TARGETS ocpp
EXPORT ocpp-targets
Expand Down Expand Up @@ -103,8 +109,9 @@ if(CMAKE_RUN_CLANG_TIDY)
-export-fixes=clang-tidy-fixes.yaml)
endif()

if(BUILD_TESTING)
if(LIBOCPP_BUILD_TESTING)
include(CTest)
enable_testing()
add_subdirectory(tests)
endif()

Expand Down
28 changes: 23 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
# C++ implementation of OCPP
![Github Actions](https://github.com/EVerest/libocpp/actions/workflows/build_and_test.yaml/badge.svg)

This is a C++ library implementation of OCPP for version 1.6 (https://www.openchargealliance.org/protocols/ocpp-16/) and 2.0.1 (https://www.openchargealliance.org/protocols/ocpp-201/). It enables charging stations to communicate with cloud backends for remote control, monitoring and billing of charging processes.
This is a C++ library implementation of OCPP for version 1.6 and 2.0.1
(see [OCPP protocols at OCA website](https://openchargealliance.org/protocols/open-charge-point-protocol/)).

It enables charging stations to communicate with cloud backends for remote
control, monitoring and billing of charging processes.

Libocpp can be used for the communication of one charging station and multiple EVSE using a single websocket connection.

Libocpp provides a complete implementation of OCPP 1.6. The implementation of OCPP 2.0.1 is currently under development.

## Get Involved

See the [COMMUNITY.md](https://github.com/EVerest/EVerest/blob/main/COMMUNITY.md) and [CONTRIBUTING.md](https://github.com/EVerest/EVerest/blob/main/CONTRIBUTING.md) of the EVerest project to get involved.

Check notice on line 16 in README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

README.md#L16

Expected: 80; Actual: 205

## Table of contents
- [C++ implementation of OCPP](#c-implementation-of-ocpp)
- [Table of contents](#table-of-contents)
Expand Down Expand Up @@ -523,10 +531,20 @@

## Unit testing

GTest is required for building the test cases target.
To build the target and run the tests you can reference the script `.ci/build-kit/install_and_test.sh`.
The script allows the GitHub Actions runner to execute.
Local testing is still in progress.
If you want to run the unit tests in the tests subdirectory: install the needed dependencies.
For Debian GNU/Linux 11 you can install it like this:

```bash
sudo apt install libgtest-dev lcov
python3 -m pip install gcovr
```

Run the unit tests

```bash
cmake .. -DBUILD_TESTING=ON
make test
```

## Building with FetchContent instead of EDM
In [doc/build-with-fetchcontent](doc/build-with-fetchcontent) you can find an example how to build libocpp with FetchContent instead of EDM.
Expand Down
2 changes: 1 addition & 1 deletion config/v201/component_schemas/custom/Connector_1_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
],
"description": "Component exists",
"type": "boolean",
"default": "0"
"default": false
},
"ChargeProtocol": {
"variable_name": "ChargeProtocol",
Expand Down
2 changes: 1 addition & 1 deletion config/v201/component_schemas/custom/Connector_2_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
],
"description": "Component exists",
"type": "boolean",
"default": "0"
"default": false
},
"ChargeProtocol": {
"variable_name": "ChargeProtocol",
Expand Down
2 changes: 1 addition & 1 deletion config/v201/component_schemas/custom/EVSE_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
],
"description": "Component exists",
"type": "boolean",
"default": "0"
"default": false
},
"EvseId": {
"variable_name": "EvseId",
Expand Down
2 changes: 1 addition & 1 deletion config/v201/component_schemas/custom/EVSE_2.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
],
"description": "Component exists",
"type": "boolean",
"default": "0"
"default": false
},
"EvseId": {
"variable_name": "EvseId",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"mutability": "ReadWrite"
}
],
"default": "1",
"default": true,
"type": "boolean"
},
"AlignedDataCtrlrAvailable": {
Expand All @@ -32,7 +32,7 @@
}
],
"description": "If this variable reports a value of true, Clock-Aligned Data is supported.",
"default": "1",
"default": true,
"type": "boolean"
},
"AlignedDataInterval": {
Expand Down Expand Up @@ -97,7 +97,7 @@
}
],
"description": "If set to true, the Charging Station SHALL include signed meter values in the SampledValueType in the MeterValuesRequest to the CSMS.",
"default": "0",
"default": false,
"type": "boolean"
},
"AlignedDataTxEndedInterval": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
],
"description": "Authorization caching is available, but not necessarily enabled.",
"default": "1",
"default": true,
"type": "boolean"
},
"AuthCacheCtrlrEnabled": {
Expand All @@ -33,7 +33,7 @@
}
],
"description": "If set to true, Authorization caching is enabled.",
"default": "1",
"default": true,
"type": "boolean"
},
"AuthCacheLifeTime": {
Expand Down
10 changes: 5 additions & 5 deletions config/v201/component_schemas/standardized/AuthCtrlr.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"mutability": "ReadWrite"
}
],
"default": "1",
"default": true,
"type": "boolean"
},
"AdditionalInfoItemsPerMessage": {
Expand Down Expand Up @@ -47,7 +47,7 @@
}
],
"description": "Whether a remote request to start a transaction in the form of RequestStartTransactionRequest message should be authorized beforehand like a local action to start a transaction.",
"default": "1",
"default": true,
"type": "boolean"
},
"LocalAuthorizeOffline": {
Expand All @@ -63,7 +63,7 @@
}
],
"description": "Whether the Charging Station, when Offline, will start a transaction for locally-authorized identifiers,",
"default": "1",
"default": true,
"type": "boolean"
},
"LocalPreAuthorize": {
Expand All @@ -79,7 +79,7 @@
}
],
"description": "Whether the Charging Station, when online, will start a transaction for locally-authorized identifiers without waiting for or requesting an AuthorizeResponse from the CSMS.",
"default": "1",
"default": true,
"type": "boolean"
},
"MasterPassGroupId": {
Expand Down Expand Up @@ -110,7 +110,7 @@
}
],
"description": "Support for unknown offline transactions.",
"default": "1",
"default": true,
"type": "boolean"
},
"DisableRemoteAuthorization": {
Expand Down
26 changes: 21 additions & 5 deletions config/v201/component_schemas/standardized/InternalCtrlr.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"mutability": "ReadWrite"
}
],
"default": "1",
"default": true,
"type": "boolean"
},
"ChargePointId": {
Expand Down Expand Up @@ -240,7 +240,7 @@
"mutability": "ReadOnly"
}
],
"default": "1",
"default": true,
"type": "boolean"
},
"LogMessages": {
Expand All @@ -255,7 +255,7 @@
"mutability": "ReadOnly"
}
],
"default": "1",
"default": true,
"type": "boolean"
},
"LogMessagesFormat": {
Expand Down Expand Up @@ -338,7 +338,7 @@
}
],
"description": "Use default verify paths for validating CSMS server certificate",
"default": "1",
"default": true,
"type": "boolean"
},
"OcspRequestInterval": {
Expand Down Expand Up @@ -483,7 +483,7 @@
"mutability": "ReadOnly"
}
],
"default": "0",
"default": false,
"type": "boolean"
},
"MessageQueueSizeThreshold": {
Expand Down Expand Up @@ -537,6 +537,22 @@
"description": "List of criteria supported for a get custom report. Enabled,Active,Problem,Available",
"default": "Enabled,Active,Problem,Available",
"type": "string"
},
"RoundClockAlignedTimestamps": {
"variable_name": "RoundClockAlignedTimestamps",
"characteristics": {
"supportsMonitoring": false,
"dataType": "boolean"
},
"attributes": [
{
"type": "Actual",
"mutability": "ReadOnly"
}
],
"description": "If enabled the metervalues configured with the AlignedDataCtrlr will be rounded to the exact time intervals",
"default": false,
"type": "boolean"
}
},
"required": [
Expand Down
Loading