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

Bug/729 add remove variables and components from schema for device model #822

Merged
Show file tree
Hide file tree
Changes from 3 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
24 changes: 7 additions & 17 deletions modules/OCPP201/OCPP201.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,21 +283,12 @@ void OCPP201::ready() {
}
}();

const auto device_model_schema_path = [&]() {
const auto config_device_model_schema_path = fs::path(this->config.DeviceModelSchemaPath);
if (config_device_model_schema_path.is_relative()) {
return this->ocpp_share_path / config_device_model_schema_path;
const auto device_model_config_path = [&]() {
const auto config_device_model_config_path = fs::path(this->config.DeviceModelConfigPath);
if (config_device_model_config_path.is_relative()) {
return this->ocpp_share_path / config_device_model_config_path;
} else {
return config_device_model_schema_path;
}
}();

const auto config_file_path = [&]() {
const auto config_config_file_path = fs::path(this->config.ConfigFilePath);
if (config_config_file_path.is_relative()) {
return this->ocpp_share_path / config_config_file_path;
} else {
return config_config_file_path;
return config_device_model_config_path;
}
}();

Expand Down Expand Up @@ -534,9 +525,8 @@ void OCPP201::ready() {
std::map<int32_t, int32_t> evse_connector_structure = this->get_connector_structure();
this->charge_point = std::make_unique<ocpp::v201::ChargePoint>(
evse_connector_structure, device_model_database_path, true, device_model_database_migration_path,
device_model_schema_path, config_file_path, this->ocpp_share_path.string(), this->config.CoreDatabasePath,
sql_init_path.string(), this->config.MessageLogPath, std::make_shared<EvseSecurity>(*this->r_security),
callbacks);
device_model_config_path, this->ocpp_share_path.string(), this->config.CoreDatabasePath, sql_init_path.string(),
this->config.MessageLogPath, std::make_shared<EvseSecurity>(*this->r_security), callbacks);

const auto ev_connection_timeout_request_value_response = this->charge_point->request_value<int32_t>(
ocpp::v201::Component{"TxCtrlr"}, ocpp::v201::Variable{"EVConnectionTimeOut"},
Expand Down
3 changes: 1 addition & 2 deletions modules/OCPP201/OCPP201.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ struct Conf {
std::string CoreDatabasePath;
std::string DeviceModelDatabasePath;
std::string DeviceModelDatabaseMigrationPath;
std::string DeviceModelSchemaPath;
std::string ConfigFilePath;
std::string DeviceModelConfigPath;
bool EnableExternalWebsocketControl;
int MessageQueueResumeDelay;
};
Expand Down
10 changes: 3 additions & 7 deletions modules/OCPP201/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@ config:
description: Path to the migration files for the device model
type: string
default: device_model_migrations
DeviceModelSchemaPath:
description: Path to the device model component schema directory
DeviceModelConfigPath:
description: Path to the device model component config directory
type: string
default: component_schemas
ConfigFilePath:
description: Path to the configuration file of libocpp
type: string
default: config.json
default: component_config
EnableExternalWebsocketControl:
description: If true websocket can be disconnected and connected externally
type: boolean
Expand Down
Loading