|
ocpp 0.24.1
A C++ implementation of the Open Charge Point Protocol
|
Contains all transaction related data, such as the ID and power meter values. More...
#include <transaction.hpp>
Public Member Functions | |
| Transaction (const int32_t transaction_id, const int32_t &connector, const std::string &session_id, const CiString< 20 > &id_token, const double meter_start, std::optional< int32_t > reservation_id, const ocpp::DateTime ×tamp, std::unique_ptr< Everest::SteadyTimer > meter_values_sample_timer) | |
Creates a new Transaction object, taking ownership of the provided meter_values_sample_timer on the provided connector. | |
| std::shared_ptr< StampedEnergyWh > | get_start_energy_wh () |
| Provides the energy in Wh at the start of the transaction. More... | |
| void | add_stop_energy_wh (std::shared_ptr< StampedEnergyWh > stop_energy_wh) |
Adds the energy in Wh stop_energy_wh to the transaction. This also stops the collection of further meter values. | |
| std::shared_ptr< StampedEnergyWh > | get_stop_energy_wh () |
| Provides the energy in Wh at the end of the transaction. More... | |
| std::optional< int32_t > | get_reservation_id () |
| Provides the reservation id of the transaction if present. More... | |
| int32_t | get_connector () |
| Provides the connector of this transaction. More... | |
| CiString< 20 > | get_id_tag () |
| Provides the authorized id tag of this Transaction. More... | |
| void | add_meter_value (MeterValue meter_value) |
Adds the provided meter_value to a chronological list of powermeter values. | |
| std::vector< MeterValue > | get_meter_values () |
| Provides all recorded powermeter values. More... | |
| bool | change_meter_values_sample_interval (int32_t interval) |
Changes the sample interval of the powermeter values sampling timer. More... | |
| void | add_clock_aligned_meter_value (MeterValue meter_value) |
Adds the provided meter_value to a chronological list of clock aligned powermeter values. | |
| std::optional< int32_t > | get_transaction_id () |
| Provides the id of this transaction. More... | |
| int32_t | get_internal_transaction_id () |
| Returns the internal transaction id. | |
| std::string | get_session_id () |
| Provides the id of this session. More... | |
| void | set_start_transaction_message_id (const std::string &message_id) |
Sets the start transaction message id using the provides message_id. | |
| std::string | get_start_transaction_message_id () |
| Provides the start transaction message id. | |
| void | set_stop_transaction_message_id (const std::string &message_id) |
Sets the stop transaction message id using the provides message_id. | |
| std::string | get_stop_transaction_message_id () |
| Provides the stop transaction message id. | |
| void | set_transaction_id (int32_t transaction_id) |
| Sets the transaction id. | |
| std::vector< TransactionData > | get_transaction_data () |
| Provides all recorded sampled and clock aligned powermeter values. More... | |
| void | stop () |
| Marks the transaction as stopped/inactive. | |
| bool | is_active () |
| Indicates if the transaction is active. Active means that the transaction for this session is not null and no StopTransaction.req has been pushed to the message queue yet. | |
| bool | is_finished () |
| Indicates if a StopTransaction.req for this transaction has already been pushed to the message queue. | |
| void | set_finished () |
| Sets the finished flag for this transaction. This is done when a StopTransaction.req has been pushed to the message queue. | |
| void | set_has_signed_meter_values () |
Sets the has_signed_meter_value flag for this transaction, this function is called from on_transaction_started and on_transaction_stopped. | |
| bool | get_has_signed_meter_values () |
Indicates if this transaction has signed meter values or not, this function is called from on_transaction_started and on_transaction_stopped. More... | |
Contains all transaction related data, such as the ID and power meter values.
| bool ocpp::v16::Transaction::change_meter_values_sample_interval | ( | int32_t | interval | ) |
Changes the sample interval of the powermeter values sampling timer.
| int32_t ocpp::v16::Transaction::get_connector | ( | ) |
Provides the connector of this transaction.
| bool ocpp::v16::Transaction::get_has_signed_meter_values | ( | ) |
Indicates if this transaction has signed meter values or not, this function is called from on_transaction_started and on_transaction_stopped.
| CiString< 20 > ocpp::v16::Transaction::get_id_tag | ( | ) |
Provides the authorized id tag of this Transaction.
| std::vector< MeterValue > ocpp::v16::Transaction::get_meter_values | ( | ) |
Provides all recorded powermeter values.
| std::optional< int32_t > ocpp::v16::Transaction::get_reservation_id | ( | ) |
Provides the reservation id of the transaction if present.
| std::string ocpp::v16::Transaction::get_session_id | ( | ) |
Provides the id of this session.
| std::shared_ptr< StampedEnergyWh > ocpp::v16::Transaction::get_start_energy_wh | ( | ) |
Provides the energy in Wh at the start of the transaction.
| std::shared_ptr< StampedEnergyWh > ocpp::v16::Transaction::get_stop_energy_wh | ( | ) |
Provides the energy in Wh at the end of the transaction.
| std::vector< TransactionData > ocpp::v16::Transaction::get_transaction_data | ( | ) |
Provides all recorded sampled and clock aligned powermeter values.
| std::optional< int32_t > ocpp::v16::Transaction::get_transaction_id | ( | ) |
Provides the id of this transaction.