Skip to content

Commit

Permalink
switch iso1 to cbv2g iso2 and remove openv2g
Browse files Browse the repository at this point in the history
Signed-off-by: Siebren <siebren.w@gmail.com>

remove unnecessary '-1'

Signed-off-by: Siebren Weertman <siebren.weertman@heliox-energy.com>
  • Loading branch information
SiebrenW committed Mar 7, 2024
1 parent ede3d05 commit 25e7afb
Show file tree
Hide file tree
Showing 10 changed files with 438 additions and 543 deletions.
2 changes: 0 additions & 2 deletions .clangd

This file was deleted.

1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ else()
find_package(everest-sunspec REQUIRED)
find_package(everest-modbus REQUIRED)
find_package(everest-ocpp REQUIRED)
find_package(everest-openv2g REQUIRED)
find_package(libcbv2g REQUIRED)

find_package(PalSigslot REQUIRED)
Expand Down
2 changes: 0 additions & 2 deletions modules/EvseV2G/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ target_link_libraries(${MODULE_NAME}
mbedcrypto
mbedtls
mbedx509
everest::openv2g
cb_v2g::DIN
cb_v2g::ISO2
cb_v2g::ISO20
cb_v2g::V2GTP
)

Expand Down
102 changes: 51 additions & 51 deletions modules/EvseV2G/charger/ISO15118_chargerImpl.cpp

Large diffs are not rendered by default.

32 changes: 13 additions & 19 deletions modules/EvseV2G/din_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,31 @@
* @param phy_value_source is the source struct.
*/
void load_din_physical_value(struct din_PhysicalValueType* const phy_value_dest,
struct iso1PhysicalValueType* const phy_value_source) {
struct iso2_PhysicalValueType* const phy_value_source) {
phy_value_dest->Multiplier = phy_value_source->Multiplier;
phy_value_dest->Value = phy_value_source->Value;
phy_value_dest->Unit_isUsed = 1;

switch (phy_value_source->Unit) {
case iso1unitSymbolType_h:
case iso2_unitSymbolType_h:
phy_value_dest->Unit = din_unitSymbolType_h;
break;
case iso1unitSymbolType_m:
case iso2_unitSymbolType_m:
phy_value_dest->Unit = din_unitSymbolType_m;
break;
case iso1unitSymbolType_s:
case iso2_unitSymbolType_s:
phy_value_dest->Unit = din_unitSymbolType_s;
break;
case iso1unitSymbolType_A:
case iso2_unitSymbolType_A:
phy_value_dest->Unit = din_unitSymbolType_A;
break;
case iso1unitSymbolType_V:
case iso2_unitSymbolType_V:
phy_value_dest->Unit = din_unitSymbolType_V;
break;
case iso1unitSymbolType_W:
case iso2_unitSymbolType_W:
phy_value_dest->Unit = din_unitSymbolType_W;
break;
case iso1unitSymbolType_Wh:
case iso2_unitSymbolType_Wh:
phy_value_dest->Unit = din_unitSymbolType_Wh;
break;
default:
Expand Down Expand Up @@ -340,7 +340,7 @@ static enum v2g_event handle_din_session_setup(struct v2g_connection* conn) {
dlog(DLOG_LEVEL_INFO, "Created new session with id 0x%08" PRIu64, conn->ctx->evse_v2g_data.session_id);

res->EVSEID.bytesLen =
std::min((int)conn->ctx->evse_v2g_data.evse_id.bytesLen, iso1SessionSetupResType_EVSEID_CHARACTERS_SIZE);
std::min((int)conn->ctx->evse_v2g_data.evse_id.bytesLen, iso2_EVSEID_CHARACTER_SIZE);
memcpy(res->EVSEID.bytes, conn->ctx->evse_v2g_data.evse_id.bytes, res->EVSEID.bytesLen);

res->DateTimeNow_isUsed = conn->ctx->evse_v2g_data.date_time_now_is_used;
Expand Down Expand Up @@ -374,11 +374,11 @@ static enum v2g_event handle_din_service_discovery(struct v2g_connection* conn)
res->ResponseCode = din_responseCodeType_OK; // [V2G-DC-388]

if ((conn->ctx->evse_v2g_data.charge_service.SupportedEnergyTransferMode.EnergyTransferMode.array[0] !=
iso1EnergyTransferModeType_DC_core) &&
iso2_EnergyTransferModeType_DC_core) &&
(conn->ctx->evse_v2g_data.charge_service.SupportedEnergyTransferMode.EnergyTransferMode.array[0]) !=
iso1EnergyTransferModeType_DC_extended) {
iso2_EnergyTransferModeType_DC_extended) {
conn->ctx->evse_v2g_data.charge_service.SupportedEnergyTransferMode.EnergyTransferMode.array[0] =
iso1EnergyTransferModeType_DC_extended;
iso2_EnergyTransferModeType_DC_extended;
dlog(DLOG_LEVEL_WARNING, "Selected EnergyTransferType is not supported in DIN 70121. Correcting value of field "
"SupportedEnergyTransferType0 to 'DC_extended'");
}
Expand Down Expand Up @@ -501,7 +501,7 @@ static enum v2g_event handle_din_charge_parameter(struct v2g_connection* conn) {
if (((req->EVRequestedEnergyTransferType != din_EVRequestedEnergyTransferType_DC_core) &&
(req->EVRequestedEnergyTransferType != din_EVRequestedEnergyTransferType_DC_extended)) ||
conn->ctx->evse_v2g_data.charge_service.SupportedEnergyTransferMode.EnergyTransferMode.array[0] !=
(iso1EnergyTransferModeType)req->EVRequestedEnergyTransferType) {
(iso2_EnergyTransferModeType)req->EVRequestedEnergyTransferType) {
res->ResponseCode = din_responseCodeType_FAILED_WrongEnergyTransferType; // [V2G-DC-397] Failed reponse code is
// logged at the end of the function
} else {
Expand Down Expand Up @@ -920,12 +920,6 @@ enum v2g_event din_handle_request(v2g_connection* conn) {
struct din_exiDocument* exi_out = conn->exi_out.dinEXIDocument;
enum v2g_event next_v2g_event = V2G_EVENT_TERMINATE_CONNECTION; // ERROR_UNEXPECTED_REQUEST_MESSAGE;

/* check whether we have a valid EXI document embedded within a V2G message */
// if (!exi_in->V2G_Message_isUsed) {
// dlog(DLOG_LEVEL_ERROR, "V2G Message not used. Ignoring msg");
// return V2G_EVENT_IGNORE_MSG;
// }

/* extract session id */
conn->ctx->ev_v2g_data.received_session_id = v2g_session_id_from_exi(false, exi_in);

Expand Down

0 comments on commit 25e7afb

Please sign in to comment.