@@ -78,12 +78,12 @@ ChargePoint::ChargePoint(const std::map<int32_t, int32_t>& evse_connector_struct
78
78
}
79
79
80
80
ChargePoint::ChargePoint (const std::map<int32_t , int32_t >& evse_connector_structure,
81
- std::unique_ptr<DeviceModelStorage> device_model_storage, const std::string& ocpp_main_path ,
82
- const std::string& core_database_path , const std::string& sql_init_path ,
83
- const std::string& message_log_path , const std::shared_ptr<EvseSecurity> evse_security ,
84
- const Callbacks& callbacks) :
81
+ std::unique_ptr<DeviceModelStorageInterface> device_model_storage_interface ,
82
+ const std::string& ocpp_main_path , const std::string& core_database_path ,
83
+ const std::string& sql_init_path , const std::string& message_log_path ,
84
+ const std::shared_ptr<EvseSecurity> evse_security, const Callbacks& callbacks) :
85
85
ChargePoint (
86
- evse_connector_structure, std::make_shared<DeviceModel>(std::move(device_model_storage )),
86
+ evse_connector_structure, std::make_shared<DeviceModel>(std::move(device_model_storage_interface )),
87
87
std::make_shared<DatabaseHandler>(
88
88
std::make_unique<common::DatabaseConnection>(fs::path(core_database_path) / " cp.db" ), sql_init_path),
89
89
nullptr /* message_queue initialized in this constructor */ , message_log_path, evse_security, callbacks) {
@@ -2661,8 +2661,7 @@ void ChargePoint::handle_set_network_profile_req(Call<SetNetworkProfileRequest>
2661
2661
ControllerComponentVariables::NetworkConnectionProfiles.variable .value (),
2662
2662
AttributeEnum::Actual, network_connection_profiles.dump (),
2663
2663
VARIABLE_ATTRIBUTE_VALUE_SOURCE_INTERNAL) != SetVariableStatusEnum::Accepted) {
2664
- EVLOG_warning
2665
- << " CSMS attempted to set a network profile that could not be written to the device model storage" ;
2664
+ EVLOG_warning << " CSMS attempted to set a network profile that could not be written to the device model" ;
2666
2665
response.status = SetNetworkProfileStatusEnum::Rejected;
2667
2666
ocpp::CallResult<SetNetworkProfileResponse> call_result (response, call.uniqueId );
2668
2667
this ->send <SetNetworkProfileResponse>(call_result);
@@ -3712,7 +3711,7 @@ void ChargePoint::handle_set_monitoring_base_req(Call<SetMonitoringBaseRequest>
3712
3711
msg.monitoringBase == MonitoringBaseEnum::FactoryDefault) {
3713
3712
try {
3714
3713
this ->device_model ->clear_custom_monitors ();
3715
- } catch (const DeviceModelStorageError & e) {
3714
+ } catch (const DeviceModelError & e) {
3716
3715
EVLOG_warning << " Could not clear custom monitors from DB: " << e.what ();
3717
3716
response.status = GenericDeviceModelStatusEnum::Rejected;
3718
3717
}
@@ -3772,7 +3771,7 @@ void ChargePoint::handle_set_variable_monitoring_req(const EnhancedMessage<v201:
3772
3771
3773
3772
try {
3774
3773
response.setMonitoringResult = this ->device_model ->set_monitors (msg.setMonitoringData );
3775
- } catch (const DeviceModelStorageError & e) {
3774
+ } catch (const DeviceModelError & e) {
3776
3775
EVLOG_error << " Set monitors failed:" << e.what ();
3777
3776
}
3778
3777
@@ -3852,7 +3851,7 @@ void ChargePoint::handle_get_monitoring_report_req(Call<GetMonitoringReportReque
3852
3851
} else {
3853
3852
response.status = GenericDeviceModelStatusEnum::EmptyResultSet;
3854
3853
}
3855
- } catch (const DeviceModelStorageError & e) {
3854
+ } catch (const DeviceModelError & e) {
3856
3855
EVLOG_error << " Get variable monitoring failed:" << e.what ();
3857
3856
response.status = GenericDeviceModelStatusEnum::Rejected;
3858
3857
}
@@ -3872,7 +3871,7 @@ void ChargePoint::handle_clear_variable_monitoring_req(Call<ClearVariableMonitor
3872
3871
3873
3872
try {
3874
3873
response.clearMonitoringResult = this ->device_model ->clear_monitors (msg.id );
3875
- } catch (const DeviceModelStorageError & e) {
3874
+ } catch (const DeviceModelError & e) {
3876
3875
EVLOG_error << " Clear variable monitoring failed:" << e.what ();
3877
3876
}
3878
3877
@@ -4143,7 +4142,7 @@ void ChargePoint::handle_send_local_authorization_list_req(Call<SendLocalListReq
4143
4142
this ->device_model ->set_read_only_value (local_entries.component , local_entries.variable .value (),
4144
4143
AttributeEnum::Actual, std::to_string (entries),
4145
4144
VARIABLE_ATTRIBUTE_VALUE_SOURCE_INTERNAL);
4146
- } catch (const DeviceModelStorageError & e) {
4145
+ } catch (const DeviceModelError & e) {
4147
4146
EVLOG_warning << " Could not get local list count from database:" << e.what ();
4148
4147
} catch (const DatabaseException& e) {
4149
4148
EVLOG_warning << " Could not get local list count from database: " << e.what ();
0 commit comments