Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ This implementation is based on the following libraries :

As of this version :

* All the messages defined in the OCPP 1.6 edition 2 protocol have been implemented except GetCompositeSchedule for Charge Point role
* All the messages defined in the OCPP 1.6 edition 2 protocol have been implemented
* All the configuration keys defined in the OCPP 1.6 edition 2 protocol have been implemented for the Charge Point role
* All the messages defined in the OCPP 1.6 security whitepaper edition 2 have been implemented
* All the messages defined in the Using ISO 15118 Plug & Charge with OCPP 1.6 Application Note v1.0 have been implemented
Expand Down Expand Up @@ -93,7 +93,7 @@ The standard OCPP configuration persistency has to be handled by the user applic
| Firmware Management | Support for firmware update management and diagnostic log file download | Actual file download/upload as well as firmware installation must be handled by the user application in the callbacks provided by **Open OCPP** |
| Local Auth List Management | Features to manage the local authorization list in Charge Points | None |
| Reservation | Support for reservation of a Charge Point. | None |
| Smart Charging | Support for basic Smart Charging, for instance using control pilot | GetCompositeSchedule is not supported for now in Charge Point role |
| Smart Charging | Support for basic Smart Charging, for instance using control pilot | GetCompositeSchedule is not supported for connector 0 in Charge Point role |
| Remote Trigger | Support for remote triggering of Charge Point initiated messages | None |

### Supported OCPP configuration keys
Expand Down
10 changes: 10 additions & 0 deletions examples/common/DefaultChargePointEventsHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,16 @@ void DefaultChargePointEventsHandler::transactionDeAuthorized(unsigned int conne
cout << "Transaction deauthorized on connector : " << connector_id << endl;
}

/** @copydoc bool IChargePointEventsHandler::getLocalLimitationsSchedule(unsigned int, ocpp::types::ChargingSchedule&) */
bool DefaultChargePointEventsHandler::getLocalLimitationsSchedule(unsigned int connector_id,
unsigned int duration,
ocpp::types::ChargingSchedule& schedule)
{
(void)schedule;
cout << "Local limitations schedule requested : " << connector_id << " - " << duration << endl;
return false;
}

/** @copydoc bool IChargePointEventsHandler::resetRequested(ocpp::types::ResetType) */
bool DefaultChargePointEventsHandler::resetRequested(ocpp::types::ResetType reset_type)
{
Expand Down
3 changes: 3 additions & 0 deletions examples/common/DefaultChargePointEventsHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ class DefaultChargePointEventsHandler : public ocpp::chargepoint::IChargePointEv
/** @copydoc void IChargePointEventsHandler::transactionDeAuthorized(unsigned int) */
void transactionDeAuthorized(unsigned int connector_id) override;

/** @copydoc bool IChargePointEventsHandler::getLocalLimitationsSchedule(unsigned int, unsigned int, ocpp::types::ChargingSchedule&) */
bool getLocalLimitationsSchedule(unsigned int connector_id, unsigned int duration, ocpp::types::ChargingSchedule& schedule) override;

/** @copydoc bool IChargePointEventsHandler::resetRequested(ocpp::types::ResetType) */
bool resetRequested(ocpp::types::ResetType reset_type) override;

Expand Down
1 change: 1 addition & 0 deletions src/chargepoint/ChargePoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ bool ChargePoint::start()
m_smart_charging_manager = std::make_unique<SmartChargingManager>(m_stack_config,
m_ocpp_config,
m_database,
m_events_handler,
*m_timer_pool,
*m_worker_pool,
m_connectors,
Expand Down
10 changes: 10 additions & 0 deletions src/chargepoint/interface/IChargePointEventsHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ along with OpenOCPP. If not, see <http://www.gnu.org/licenses/>.
#define OPENOCPP_ICHARGEPOINTEVENTSHANDLER_H

#include "Certificate.h"
#include "ChargingSchedule.h"
#include "DateTime.h"
#include "Enums.h"
#include "MeterValue.h"
Expand Down Expand Up @@ -137,6 +138,15 @@ class IChargePointEventsHandler
*/
virtual void transactionDeAuthorized(unsigned int connector_id) = 0;

/**
* @brief Called on reception of a GetCompositeSchedule request
* @param connector_id Id of the concerned connector
* @param duration Duration in seconds of the schedule
* @param schedule Schedule containing the local limitations for the requested duration
* @return true if a schedule has been defined, false if there are no local limitations for the requested duration
*/
virtual bool getLocalLimitationsSchedule(unsigned int connector_id, unsigned int duration, ocpp::types::ChargingSchedule& schedule) = 0;

/**
* @brief Called on a reset request from the Central System
* @param reset_type Type of reset
Expand Down
4 changes: 2 additions & 2 deletions src/chargepoint/smartcharging/ProfileDatabase.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ class ProfileDatabase

/** @brief Stores a profile alongside its target connector */
typedef std::pair<unsigned int, ocpp::types::ChargingProfile> ChargingProfileInfo;
/** @brief Allow sorting of profiles by stack level */
/** @brief Allow sorting of profiles by stack level and connector id*/
struct ChargingProfileInfoLess
{
bool operator()(const ChargingProfileInfo& lhs, const ChargingProfileInfo& rhs) const
{
return (lhs.second.stackLevel > rhs.second.stackLevel);
return ((lhs.second.stackLevel > rhs.second.stackLevel) || (lhs.first > rhs.first));
}
};
/** @brief List of charging profiles stored by stack level */
Expand Down
Loading