-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- moved ChargePointConnectionState back to 1.6 - improved ws connection and bootnotification handling - implemented functional block Provisioning profile as draft (B01 - B08) - renamed common ChargePoint to ChargingStationBase - renamed ChargePointConfiguration to DeviceModelManager - added method documentation - implemented draft for state machine within connector class instead of using libfsm Signed-off-by: pietfried <[email protected]>
- Loading branch information
Showing
24 changed files
with
1,108 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Copyright 2020 - 2023 Pionix GmbH and Contributors to EVerest | ||
|
||
#include <functional> | ||
#include <mutex> | ||
|
||
#include <ocpp/v201/enums.hpp> | ||
|
||
namespace ocpp { | ||
namespace v201 { | ||
|
||
/// \brief Enum for ConnectorEvents | ||
enum class ConnectorEvent { | ||
PlugIn, | ||
PlugOut, | ||
Reserve, | ||
Error, | ||
Unavailable, | ||
ReservationFinished, | ||
PlugInAndTokenValid, | ||
ErrorCleared, | ||
ErrorCleardOnOccupied, | ||
ErrorCleardOnReserved, | ||
UnavailableToAvailable, | ||
UnavailableToOccupied, | ||
UnavailableToReserved, | ||
UnavailableFaulted | ||
}; | ||
|
||
/// \brief Represents a Connector, thus electrical outlet on a Charging Station. Single physical Connector. | ||
class Connector { | ||
private: | ||
int32_t connector_id; | ||
ConnectorStatusEnum state; | ||
std::mutex state_mutex; | ||
|
||
std::function<void(const ConnectorStatusEnum& status)> status_notification_callback; | ||
|
||
public: | ||
/// \brief Construct a new Connector object | ||
/// \param connector_id id of the connector | ||
/// \param status_notification_callback callback executed when the state of the connector changes | ||
Connector(const int32_t connector_id, | ||
const std::function<void(const ConnectorStatusEnum& status)>& status_notification_callback); | ||
|
||
/// \brief Get the state object | ||
/// \return ConnectorStatusEnum | ||
ConnectorStatusEnum get_state(); | ||
|
||
/// \brief Submits the given \p event to the state machine controller | ||
/// \param event | ||
void submit_event(ConnectorEvent event); | ||
}; | ||
|
||
} // namespace v201 | ||
} // namespace ocpp |
Oops, something went wrong.