ocpp 0.24.1
A C++ implementation of the Open Charge Point Protocol
Public Member Functions | List of all members
ocpp::v2::EvseInterface Class Referenceabstract
Inheritance diagram for ocpp::v2::EvseInterface:
ocpp::v2::Evse

Public Member Functions

virtual int32_t get_id () const =0
 Return the evse_id of this EVSE. More...
 
virtual uint32_t get_number_of_connectors () const =0
 Returns the number of connectors of this EVSE. More...
 
virtual bool does_connector_exist (ConnectorEnum connector_type) const =0
 Check if the given connector type exists on this evse. More...
 
virtual std::optional< ConnectorStatusEnum > get_connector_status (std::optional< ConnectorEnum > connector_type)=0
 Get connector status. More...
 
virtual void open_transaction (const std::string &transaction_id, const int32_t connector_id, const DateTime &timestamp, const MeterValue &meter_start, const std::optional< IdToken > &id_token, const std::optional< IdToken > &group_id_token, const std::optional< int32_t > reservation_id, const ChargingStateEnum charging_state)=0
 Opens a new transaction. More...
 
virtual void close_transaction (const DateTime &timestamp, const MeterValue &meter_stop, const ReasonEnum &reason)=0
 Closes the transaction on this evse by adding the given timestamp meter_stop and reason . More...
 
virtual void start_checking_max_energy_on_invalid_id ()=0
 Start checking if the max energy on invalid id has exceeded. Will call pause_charging_callback when that happens. More...
 
virtual bool has_active_transaction () const =0
 Indicates if a transaction is active at this evse. More...
 
virtual bool has_active_transaction (const int32_t connector_id) const =0
 Indicates if a transaction is active at this evse at the given connector_id. More...
 
virtual void release_transaction ()=0
 Releases the reference of the transaction on this evse. More...
 
virtual std::unique_ptr< EnhancedTransaction > & get_transaction ()=0
 Returns a pointer to the EnhancedTransaction of this evse. More...
 
virtual void submit_event (const int32_t connector_id, ConnectorEvent event)=0
 Submits the given event to the state machine controller of the connector with the given connector_id. More...
 
virtual void on_meter_value (const MeterValue &meter_value)=0
 Event handler that should be called when a new meter_value for this evse is present. More...
 
virtual MeterValue get_meter_value ()=0
 Returns the last present meter value for this evse. More...
 
virtual MeterValue get_idle_meter_value ()=0
 Return the idle meter values for this evse. More...
 
virtual void clear_idle_meter_values ()=0
 Clear the idle meter values for this evse. More...
 
virtual Connectorget_connector (int32_t connector_id) const =0
 Returns a pointer to the connector with ID. More...
 
virtual OperationalStatusEnum get_effective_operational_status ()=0
 Gets the effective Operative/Inoperative status of this EVSE. More...
 
virtual void set_evse_operative_status (OperationalStatusEnum new_status, bool persist)=0
 Switches the operative status of the EVSE. More...
 
virtual void set_connector_operative_status (int32_t connector_id, OperationalStatusEnum new_status, bool persist)=0
 Switches the operative status of a connector within this EVSE. More...
 
virtual void restore_connector_operative_status (int32_t connector_id)=0
 Restores the operative status of a connector within this EVSE to the persisted status and recomputes its effective status. More...
 
virtual OperationalStatusEnum get_connector_effective_operational_status (const int32_t connector_id)=0
 Get the operational status of a connector within this evse. More...
 
virtual CurrentPhaseType get_current_phase_type ()=0
 Returns the phase type for the EVSE based on its SupplyPhases. It can be AC, DC, or Unknown. More...
 
virtual void set_meter_value_pricing_triggers (std::optional< double > trigger_metervalue_on_power_kw, std::optional< double > trigger_metervalue_on_energy_kwh, std::optional< DateTime > trigger_metervalue_at_time, std::function< void(const std::vector< MeterValue > &meter_values)> send_metervalue_function, boost::asio::io_service &io_service)=0
 Set metervalue triggers for California Pricing. More...
 

Member Function Documentation

◆ clear_idle_meter_values()

virtual void ocpp::v2::EvseInterface::clear_idle_meter_values ( )
pure virtual

Clear the idle meter values for this evse.

Implemented in ocpp::v2::Evse.

◆ close_transaction()

virtual void ocpp::v2::EvseInterface::close_transaction ( const DateTime timestamp,
const MeterValue meter_stop,
const ReasonEnum &  reason 
)
pure virtual

Closes the transaction on this evse by adding the given timestamp meter_stop and reason .

Parameters
timestamp
meter_stop
reason

Implemented in ocpp::v2::Evse.

◆ does_connector_exist()

virtual bool ocpp::v2::EvseInterface::does_connector_exist ( ConnectorEnum  connector_type) const
pure virtual

Check if the given connector type exists on this evse.

Parameters
connector_typeThe connector type to check.
Returns
True if connector type is unknown or this evse has the given connector type.

Implemented in ocpp::v2::Evse.

◆ get_connector()

virtual Connector * ocpp::v2::EvseInterface::get_connector ( int32_t  connector_id) const
pure virtual

Returns a pointer to the connector with ID.

Parameters
connector_idin this EVSE.

Implemented in ocpp::v2::Evse.

◆ get_connector_effective_operational_status()

virtual OperationalStatusEnum ocpp::v2::EvseInterface::get_connector_effective_operational_status ( const int32_t  connector_id)
pure virtual

Get the operational status of a connector within this evse.

Parameters
connector_idThe id of the connector.
Returns
The operational status.

Implemented in ocpp::v2::Evse.

◆ get_connector_status()

virtual std::optional< ConnectorStatusEnum > ocpp::v2::EvseInterface::get_connector_status ( std::optional< ConnectorEnum >  connector_type)
pure virtual

Get connector status.

This will search if there is a connector on this evse with status 'Available'. It will search through all connectors, optionally filtering by connector type, and return on the first connector that is 'Available'. If there is no 'Available' connector, it will return the status of the last found connector with the given connector type.

Parameters
connector_typeThe connector type to filter on (optional).
Returns
Connector status. If connector type is given and does not exist, std::nullopt.

Implemented in ocpp::v2::Evse.

◆ get_current_phase_type()

virtual CurrentPhaseType ocpp::v2::EvseInterface::get_current_phase_type ( )
pure virtual

Returns the phase type for the EVSE based on its SupplyPhases. It can be AC, DC, or Unknown.

Implemented in ocpp::v2::Evse.

◆ get_effective_operational_status()

virtual OperationalStatusEnum ocpp::v2::EvseInterface::get_effective_operational_status ( )
pure virtual

Gets the effective Operative/Inoperative status of this EVSE.

Implemented in ocpp::v2::Evse.

◆ get_id()

virtual int32_t ocpp::v2::EvseInterface::get_id ( ) const
pure virtual

Return the evse_id of this EVSE.

Returns

Implemented in ocpp::v2::Evse.

◆ get_idle_meter_value()

virtual MeterValue ocpp::v2::EvseInterface::get_idle_meter_value ( )
pure virtual

Return the idle meter values for this evse.

Returns
MeterValue type

Implemented in ocpp::v2::Evse.

◆ get_meter_value()

virtual MeterValue ocpp::v2::EvseInterface::get_meter_value ( )
pure virtual

Returns the last present meter value for this evse.

Returns

Implemented in ocpp::v2::Evse.

◆ get_number_of_connectors()

virtual uint32_t ocpp::v2::EvseInterface::get_number_of_connectors ( ) const
pure virtual

Returns the number of connectors of this EVSE.

Returns

Implemented in ocpp::v2::Evse.

◆ get_transaction()

virtual std::unique_ptr< EnhancedTransaction > & ocpp::v2::EvseInterface::get_transaction ( )
pure virtual

Returns a pointer to the EnhancedTransaction of this evse.

Returns
pointer to transaction (nullptr if no transaction is active)

Implemented in ocpp::v2::Evse.

◆ has_active_transaction() [1/2]

virtual bool ocpp::v2::EvseInterface::has_active_transaction ( ) const
pure virtual

Indicates if a transaction is active at this evse.

Returns

Implemented in ocpp::v2::Evse.

◆ has_active_transaction() [2/2]

virtual bool ocpp::v2::EvseInterface::has_active_transaction ( const int32_t  connector_id) const
pure virtual

Indicates if a transaction is active at this evse at the given connector_id.

Parameters
connector_idid of the connector of the evse
Returns

Implemented in ocpp::v2::Evse.

◆ on_meter_value()

virtual void ocpp::v2::EvseInterface::on_meter_value ( const MeterValue meter_value)
pure virtual

Event handler that should be called when a new meter_value for this evse is present.

Parameters
meter_value

Implemented in ocpp::v2::Evse.

◆ open_transaction()

virtual void ocpp::v2::EvseInterface::open_transaction ( const std::string &  transaction_id,
const int32_t  connector_id,
const DateTime timestamp,
const MeterValue meter_start,
const std::optional< IdToken > &  id_token,
const std::optional< IdToken > &  group_id_token,
const std::optional< int32_t >  reservation_id,
const ChargingStateEnum  charging_state 
)
pure virtual

Opens a new transaction.

Parameters
transaction_idid of the transaction
connector_idid of the connector
timestamptimestamp of the start of the transaction
meter_startstart meter value of the transaction
id_tokenid_token with which the transaction was authorized / started
group_id_tokenoptional group id_token
reservationoptional reservation_id if evse was reserved
sampled_data_tx_updated_intervalInterval between sampling of metering (or other) data, intended to be transmitted via TransactionEventRequest (eventType = Updated) messages

Implemented in ocpp::v2::Evse.

◆ release_transaction()

virtual void ocpp::v2::EvseInterface::release_transaction ( )
pure virtual

Releases the reference of the transaction on this evse.

Implemented in ocpp::v2::Evse.

◆ restore_connector_operative_status()

virtual void ocpp::v2::EvseInterface::restore_connector_operative_status ( int32_t  connector_id)
pure virtual

Restores the operative status of a connector within this EVSE to the persisted status and recomputes its effective status.

Parameters
connector_idThe ID of the connector

Implemented in ocpp::v2::Evse.

◆ set_connector_operative_status()

virtual void ocpp::v2::EvseInterface::set_connector_operative_status ( int32_t  connector_id,
OperationalStatusEnum  new_status,
bool  persist 
)
pure virtual

Switches the operative status of a connector within this EVSE.

Parameters
connector_idThe ID of the connector
new_statusThe operative status to switch to
persistTrue the updated operative state should be persisted

Implemented in ocpp::v2::Evse.

◆ set_evse_operative_status()

virtual void ocpp::v2::EvseInterface::set_evse_operative_status ( OperationalStatusEnum  new_status,
bool  persist 
)
pure virtual

Switches the operative status of the EVSE.

Parameters
new_statusThe operative status to switch to
persistTrue the updated operative state should be persisted

Implemented in ocpp::v2::Evse.

◆ set_meter_value_pricing_triggers()

virtual void ocpp::v2::EvseInterface::set_meter_value_pricing_triggers ( std::optional< double >  trigger_metervalue_on_power_kw,
std::optional< double >  trigger_metervalue_on_energy_kwh,
std::optional< DateTime trigger_metervalue_at_time,
std::function< void(const std::vector< MeterValue > &meter_values)>  send_metervalue_function,
boost::asio::io_service &  io_service 
)
pure virtual

Set metervalue triggers for California Pricing.

Parameters
trigger_metervalue_on_power_kwSend metervalues on this amount of kw (with hysteresis).
trigger_metervalue_on_energy_kwhSend metervalues when this kwh is reached.
trigger_metervalue_at_timeSend metervalues at a specific time.
send_metervalue_functionFunction used to send the metervalues.
io_serviceio service for the timers.

Implemented in ocpp::v2::Evse.

◆ start_checking_max_energy_on_invalid_id()

virtual void ocpp::v2::EvseInterface::start_checking_max_energy_on_invalid_id ( )
pure virtual

Start checking if the max energy on invalid id has exceeded. Will call pause_charging_callback when that happens.

Implemented in ocpp::v2::Evse.

◆ submit_event()

virtual void ocpp::v2::EvseInterface::submit_event ( const int32_t  connector_id,
ConnectorEvent  event 
)
pure virtual

Submits the given event to the state machine controller of the connector with the given connector_id.

Parameters
connector_idid of the connector of the evse
event

Implemented in ocpp::v2::Evse.


The documentation for this class was generated from the following files: