Skip to content

Commit

Permalink
clang format and CamelCase to snake_case
Browse files Browse the repository at this point in the history
Signed-off-by: pietfried <[email protected]>
  • Loading branch information
Pietfried committed Oct 2, 2023
1 parent 5a8b5ac commit 61bbf25
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
27 changes: 9 additions & 18 deletions include/ocpp/common/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ class DateTime : public DateTimeImpl {
};

/// \brief Contains the different connection states of the charge point
enum SessionStartedReason
{
enum SessionStartedReason {
EVConnected,
Authorized
};
Expand Down Expand Up @@ -313,8 +312,7 @@ struct Measurement {
friend std::ostream& operator<<(std::ostream& os, const Measurement& k);
};

enum class CaCertificateType
{
enum class CaCertificateType {
V2G,
MO,
CSMS,
Expand All @@ -337,8 +335,7 @@ CaCertificateType string_to_ca_certificate_type(const std::string& s);
/// \returns an output stream with the CaCertificateType written to
std::ostream& operator<<(std::ostream& os, const CaCertificateType& ca_certificate_type);

enum class InstallCertificateResult
{
enum class InstallCertificateResult {
InvalidSignature,
InvalidCertificateChain,
InvalidFormat,
Expand All @@ -365,8 +362,7 @@ InstallCertificateResult string_to_install_certificate_result(const std::string&
/// InstallCertificateResult written to
std::ostream& operator<<(std::ostream& os, const InstallCertificateResult& install_certificate_result);

enum class DeleteCertificateResult
{
enum class DeleteCertificateResult {
Accepted,
Failed,
NotFound,
Expand All @@ -388,8 +384,7 @@ DeleteCertificateResult string_to_delete_certificate_result(const std::string& s
std::ostream& operator<<(std::ostream& os, const DeleteCertificateResult& delete_certificate_result);

// from: GetInstalledCertificateIdsResponse
enum class HashAlgorithmEnumType
{
enum class HashAlgorithmEnumType {
SHA256,
SHA384,
SHA512,
Expand Down Expand Up @@ -425,8 +420,7 @@ void from_json(const json& j, CertificateHashDataType& k);
/// \returns an output stream with the CertificateHashDataType written to
std::ostream& operator<<(std::ostream& os, const CertificateHashDataType& k);

enum class CertificateType
{
enum class CertificateType {
V2GRootCertificate,
MORootCertificate,
CSMSRootCertificate,
Expand Down Expand Up @@ -463,8 +457,7 @@ void from_json(const json& j, CertificateHashDataChain& k);
/// \returns an output stream with the CertificateHashDataChain written to
std::ostream& operator<<(std::ostream& os, const CertificateHashDataChain& k);

enum class OcppProtocolVersion
{
enum class OcppProtocolVersion {
v16,
v201
};
Expand All @@ -484,8 +477,7 @@ OcppProtocolVersion string_to_ocpp_protocol_version(const std::string& s);
/// OcppProtocolVersion written to
std::ostream& operator<<(std::ostream& os, const OcppProtocolVersion& ocpp_protocol_version);

enum class CertificateSigningUseEnum
{
enum class CertificateSigningUseEnum {
ChargingStationCertificate,
V2GCertificate,
ManufacturerCertificate
Expand Down Expand Up @@ -538,8 +530,7 @@ std::string double_to_string(double d, int precision);
std::string double_to_string(double d);
} // namespace conversions

enum class FirmwareStatusNotification
{
enum class FirmwareStatusNotification {
Downloaded,
DownloadFailed,
Downloading,
Expand Down
8 changes: 4 additions & 4 deletions lib/ocpp/v201/charge_point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1309,11 +1309,11 @@ void ChargePoint::handle_boot_notification_response(CallResult<BootNotificationR
CiString<50>(ocpp::security_events::RESET_OR_REBOOT),
std::optional<CiString<255>>("Charging Station rebooted due to a scheduled reset!"), true, true);
} else {
std::string startupMessage = "Charging Station powered up! Firmware version: ";
startupMessage.append(
std::string startup_message = "Charging Station powered up! Firmware version: ";
startup_message.append(
this->device_model->get_value<std::string>(ControllerComponentVariables::FirmwareVersion));
this->security_event_notification_req(CiString<50>(ocpp::security_events::STARTUP_OF_THE_DEVICE),
std::optional<CiString<255>>(startupMessage), true, true);
std::optional<CiString<255>>(startup_message), true, true);
}
} else {
auto retry_interval = DEFAULT_BOOT_NOTIFICATION_RETRY_INTERVAL;
Expand Down Expand Up @@ -1828,7 +1828,7 @@ void ChargePoint::handle_trigger_message(Call<TriggerMessageRequest> call) {
FirmwareStatusNotificationRequest request;
switch (this->firmware_status) {
case FirmwareStatusEnum::Idle:
case FirmwareStatusEnum::Installed: // L01.FR.25
case FirmwareStatusEnum::Installed: // L01.FR.25
request.status = FirmwareStatusEnum::Idle;
// do not set requestId when idle: L01.FR.20
break;
Expand Down

0 comments on commit 61bbf25

Please sign in to comment.