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

Support OCPP 2.1 variables #988

Merged
15 changes: 14 additions & 1 deletion doc/v201/ocpp_201_device_model_initialization.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# OCPP 2.0.1: Device model initialization and inserting of config values
# OCPP 2.0.1 and 2.1: Device model initialization and inserting of config values

If there is no custom database used for the device model, and 'initialize_device_model' is set to true in the
constructor of ChargePoint, the device model will be created or updated when ChargePoint is created. This document will
Expand Down Expand Up @@ -43,3 +43,16 @@
Note: OCPP requires EVSE and Connector numbering starting from 1 counting upwards.

Note: There should be no duplicate components or variables in the component config files.


## Required variables

There are some required Variables, which can be found in the OCPP spec.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
There are some required Variables, which can be found in the OCPP spec.
There are Variables that are defined as **required** in the OCPP specification.

Some `Variables` are only required if the `Component` is `Available`, for example `Reservation` and `Smart Charging`.

Check notice on line 51 in doc/v201/ocpp_201_device_model_initialization.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

doc/v201/ocpp_201_device_model_initialization.md#L51

Expected: 0 or 2; Actual: 1

Check notice on line 51 in doc/v201/ocpp_201_device_model_initialization.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

doc/v201/ocpp_201_device_model_initialization.md#L51

Expected: 80; Actual: 118
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Some `Variables` are only required if the `Component` is `Available`, for example `Reservation` and `Smart Charging`.
Some `Variables` are only required if the `Available` variable of the respective `Component` is present and configured to true. Examples for this are the `ReservationCtrlr` and the `SmartChargingCtrlr`.

There are some Components that are always required because that is how libocpp works: `AlignedDataCtrlr` and

Check notice on line 52 in doc/v201/ocpp_201_device_model_initialization.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

doc/v201/ocpp_201_device_model_initialization.md#L52

Expected: 0 or 2; Actual: 1

Check notice on line 52 in doc/v201/ocpp_201_device_model_initialization.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

doc/v201/ocpp_201_device_model_initialization.md#L52

Expected: 80; Actual: 110
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
There are some Components that are always required because that is how libocpp works: `AlignedDataCtrlr` and
There are some Components that are always required because they are required by libocpp: `AlignedDataCtrlr` and

`SampledDataCtrlr`.
When libocpp is started and initialized, all required Variables will be checked and an DeviceModelError is thrown if

Check notice on line 54 in doc/v201/ocpp_201_device_model_initialization.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

doc/v201/ocpp_201_device_model_initialization.md#L54

Expected: 0 or 2; Actual: 1

Check notice on line 54 in doc/v201/ocpp_201_device_model_initialization.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

doc/v201/ocpp_201_device_model_initialization.md#L54

Expected: 80; Actual: 117
one of the required Variables is not there.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
one of the required Variables is not there.
one of the required Variables is not present.


This also implies, that if you write code that needs a required `Variable`, when trying to get that variable with

Check notice on line 57 in doc/v201/ocpp_201_device_model_initialization.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

doc/v201/ocpp_201_device_model_initialization.md#L57

Expected: 0 or 2; Actual: 1

Check notice on line 57 in doc/v201/ocpp_201_device_model_initialization.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

doc/v201/ocpp_201_device_model_initialization.md#L57

Expected: 80; Actual: 114
`DeviceModel::get_value(...)`, you should first check if the Component that Variable belongs to is `Available`.

Check notice on line 58 in doc/v201/ocpp_201_device_model_initialization.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

doc/v201/ocpp_201_device_model_initialization.md#L58

Expected: 80; Actual: 111
Loading