AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
isobus::ExtendedTransportProtocolManager::ExtendedTransportProtocolSession Class Reference

A storage object to keep track of session information internally. More...

#include <can_extended_transport_protocol.hpp>

Inheritance diagram for isobus::ExtendedTransportProtocolManager::ExtendedTransportProtocolSession:
[legend]
Collaboration diagram for isobus::ExtendedTransportProtocolManager::ExtendedTransportProtocolSession:
[legend]

Public Member Functions

StateMachineState get_state () const
 < Inherit the base constructor
 
std::uint32_t get_total_bytes_transferred () const override
 Get the number of bytes that have been sent or received in this session.
 
 TransportProtocolSessionBase (TransportProtocolSessionBase::Direction direction, std::unique_ptr< CANMessageData > data, std::uint32_t parameterGroupNumber, std::uint32_t totalMessageSize, std::shared_ptr< ControlFunction > source, std::shared_ptr< ControlFunction > destination, TransmitCompleteCallback sessionCompleteCallback, void *parentPointer)
 The constructor for a session.
 
 TransportProtocolSessionBase (TransportProtocolSessionBase &&other)=default
 The move constructor.
 
- Public Member Functions inherited from isobus::TransportProtocolSessionBase
 TransportProtocolSessionBase (TransportProtocolSessionBase::Direction direction, std::unique_ptr< CANMessageData > data, std::uint32_t parameterGroupNumber, std::uint32_t totalMessageSize, std::shared_ptr< ControlFunction > source, std::shared_ptr< ControlFunction > destination, TransmitCompleteCallback sessionCompleteCallback, void *parentPointer)
 The constructor for a session.
 
 TransportProtocolSessionBase (TransportProtocolSessionBase &&other)=default
 The move constructor.
 
TransportProtocolSessionBaseoperator= (TransportProtocolSessionBase &&other)=default
 The move assignment operator.
 
virtual ~TransportProtocolSessionBase ()=default
 The destructor for a session.
 
Direction get_direction () const
 Get the direction of the session.
 
bool operator== (const TransportProtocolSessionBase &obj) const
 A useful way to compare session objects to each other for equality,.
 
bool matches (std::shared_ptr< ControlFunction > other_source, std::shared_ptr< ControlFunction > other_destination) const
 Checks if the source and destination control functions match the given control functions.
 
CANMessageDataget_data () const
 Get the data buffer for the session.
 
std::uint32_t get_message_length () const
 Get the total number of bytes that will be sent or received in this session.
 
float get_percentage_bytes_transferred () const
 Get the percentage of bytes that have been sent or received in this session.
 
std::shared_ptr< ControlFunctionget_source () const
 Get the control function that is sending the message.
 
std::shared_ptr< ControlFunctionget_destination () const
 Get the control function that is receiving the message.
 
std::uint32_t get_parameter_group_number () const
 Get the parameter group number of the message.
 

Protected Member Functions

void set_state (StateMachineState value)
 Set the state of the session.
 
std::uint8_t get_dpo_number_of_packets_remaining () const
 Get the number of packets to be sent with the current DPO.
 
void set_dpo_number_of_packets (std::uint8_t value)
 Set the number of packets to be sent with the current DPO.
 
std::uint8_t get_dpo_number_of_packets () const
 Get the number of packets that will be sent with the current DPO.
 
std::uint8_t get_cts_number_of_packet_limit () const
 Get the maximum number of packets that can be sent per DPO as indicated by the CTS message.
 
void set_cts_number_of_packet_limit (std::uint8_t value)
 Set the maximum number of packets that can be sent per DPO as indicated by the CTS message.
 
std::uint8_t get_last_sequence_number () const
 Get the last sequence number that was processed.
 
std::uint32_t get_last_packet_number () const
 Get the last packet number that was processed.
 
void set_sequence_number_offset (std::uint32_t value)
 Set the last packet number that was processed.
 
void set_last_sequency_number (std::uint8_t value)
 Set the last sequence number that has be processed.
 
void set_acknowledged_packet_number (std::uint32_t value)
 Set the last acknowledged packet number by the receiver.
 
std::uint32_t get_last_acknowledged_packet_number () const
 Get the last acknowledged packet number by the receiver.
 
std::uint32_t get_number_of_remaining_packets () const
 Get the number of packets that remain to be sent or received in this session.
 
std::uint32_t get_total_number_of_packets () const
 Get the total number of packets that will be sent or received in this session.
 
- Protected Member Functions inherited from isobus::TransportProtocolSessionBase
void update_timestamp ()
 Update the timestamp of the session.
 
std::uint32_t get_time_since_last_update () const
 Get the time that has passed since the last update of the timestamp.
 
void complete (bool success) const
 Complete the session.
 

Private Attributes

StateMachineState state = StateMachineState::None
 The state machine state for this session.
 
std::uint32_t lastAcknowledgedPacketNumber = 0
 The last acknowledged packet number by the receiver.
 
std::uint32_t sequenceNumberOffset = 0
 The offset of the sequence number relative to the packet number.
 
std::uint8_t lastSequenceNumber = 0
 The last processed sequence number for this set of packets.
 
std::uint8_t dataPacketOffsetPacketCount = 0
 The number of packets that will be sent with the current DPO.
 
std::uint8_t clearToSendPacketCountLimit = 0xFF
 The max packets that can be sent per DPO as indicated by the CTS message.
 

Friends

class ExtendedTransportProtocolManager
 Allows the ETP manager full access.
 

Additional Inherited Members

- Public Types inherited from isobus::TransportProtocolSessionBase
enum class  Direction { Transmit , Receive }
 Enumerates the possible session directions. More...
 

Detailed Description

A storage object to keep track of session information internally.

Definition at line 64 of file can_extended_transport_protocol.hpp.

Member Function Documentation

◆ get_cts_number_of_packet_limit()

std::uint8_t isobus::ExtendedTransportProtocolManager::ExtendedTransportProtocolSession::get_cts_number_of_packet_limit ( ) const
protected

Get the maximum number of packets that can be sent per DPO as indicated by the CTS message.

Returns
The maximum number of packets that can be sent per DPO as indicated by the CTS message

Definition at line 63 of file can_extended_transport_protocol.cpp.

◆ get_dpo_number_of_packets()

std::uint8_t isobus::ExtendedTransportProtocolManager::ExtendedTransportProtocolSession::get_dpo_number_of_packets ( ) const
protected

Get the number of packets that will be sent with the current DPO.

Returns
The number of packets that will be sent with the current DPO

Definition at line 58 of file can_extended_transport_protocol.cpp.

◆ get_dpo_number_of_packets_remaining()

std::uint8_t isobus::ExtendedTransportProtocolManager::ExtendedTransportProtocolSession::get_dpo_number_of_packets_remaining ( ) const
protected

Get the number of packets to be sent with the current DPO.

Returns
The number of packets to be sent with the current DPO

Definition at line 46 of file can_extended_transport_protocol.cpp.

◆ get_last_acknowledged_packet_number()

std::uint32_t isobus::ExtendedTransportProtocolManager::ExtendedTransportProtocolSession::get_last_acknowledged_packet_number ( ) const
protected

Get the last acknowledged packet number by the receiver.

Returns
The last acknowledged packet number by the receiver

Definition at line 102 of file can_extended_transport_protocol.cpp.

◆ get_last_packet_number()

std::uint32_t isobus::ExtendedTransportProtocolManager::ExtendedTransportProtocolSession::get_last_packet_number ( ) const
protected

Get the last packet number that was processed.

Returns
The last packet number that was processed

Definition at line 79 of file can_extended_transport_protocol.cpp.

◆ get_last_sequence_number()

std::uint8_t isobus::ExtendedTransportProtocolManager::ExtendedTransportProtocolSession::get_last_sequence_number ( ) const
protected

Get the last sequence number that was processed.

Returns
The last sequence number that was processed

Definition at line 74 of file can_extended_transport_protocol.cpp.

◆ get_number_of_remaining_packets()

std::uint32_t isobus::ExtendedTransportProtocolManager::ExtendedTransportProtocolSession::get_number_of_remaining_packets ( ) const
protected

Get the number of packets that remain to be sent or received in this session.

Returns
The number of packets that remain to be sent or received in this session

Definition at line 107 of file can_extended_transport_protocol.cpp.

◆ get_state()

ExtendedTransportProtocolManager::StateMachineState isobus::ExtendedTransportProtocolManager::ExtendedTransportProtocolSession::get_state ( ) const

< Inherit the base constructor

Get the state of the session

Returns
The state of the session

Definition at line 25 of file can_extended_transport_protocol.cpp.

◆ get_total_bytes_transferred()

std::uint32_t isobus::ExtendedTransportProtocolManager::ExtendedTransportProtocolSession::get_total_bytes_transferred ( ) const
overridevirtual

Get the number of bytes that have been sent or received in this session.

Returns
The number of bytes that have been sent or received

Implements isobus::TransportProtocolSessionBase.

Definition at line 36 of file can_extended_transport_protocol.cpp.

◆ get_total_number_of_packets()

std::uint32_t isobus::ExtendedTransportProtocolManager::ExtendedTransportProtocolSession::get_total_number_of_packets ( ) const
protected

Get the total number of packets that will be sent or received in this session.

Returns
The total number of packets that will be sent or received in this session

Definition at line 112 of file can_extended_transport_protocol.cpp.

◆ set_acknowledged_packet_number()

void isobus::ExtendedTransportProtocolManager::ExtendedTransportProtocolSession::set_acknowledged_packet_number ( std::uint32_t value)
protected

Set the last acknowledged packet number by the receiver.

Parameters
[in]valueThe last acknowledged packet number by the receiver

Definition at line 96 of file can_extended_transport_protocol.cpp.

◆ set_cts_number_of_packet_limit()

void isobus::ExtendedTransportProtocolManager::ExtendedTransportProtocolSession::set_cts_number_of_packet_limit ( std::uint8_t value)
protected

Set the maximum number of packets that can be sent per DPO as indicated by the CTS message.

Parameters
valueThe maximum number of packets that can be sent per DPO as indicated by the CTS message

Definition at line 68 of file can_extended_transport_protocol.cpp.

◆ set_dpo_number_of_packets()

void isobus::ExtendedTransportProtocolManager::ExtendedTransportProtocolSession::set_dpo_number_of_packets ( std::uint8_t value)
protected

Set the number of packets to be sent with the current DPO.

Parameters
[in]valueThe number of packets to be sent with the current DPO

Definition at line 52 of file can_extended_transport_protocol.cpp.

◆ set_last_sequency_number()

void isobus::ExtendedTransportProtocolManager::ExtendedTransportProtocolSession::set_last_sequency_number ( std::uint8_t value)
protected

Set the last sequence number that has be processed.

Parameters
[in]valueThe last sequence number that has be processed

Definition at line 90 of file can_extended_transport_protocol.cpp.

◆ set_sequence_number_offset()

void isobus::ExtendedTransportProtocolManager::ExtendedTransportProtocolSession::set_sequence_number_offset ( std::uint32_t value)
protected

Set the last packet number that was processed.

Parameters
[in]valueThe last packet number that was processed

Definition at line 84 of file can_extended_transport_protocol.cpp.

◆ set_state()

void isobus::ExtendedTransportProtocolManager::ExtendedTransportProtocolSession::set_state ( StateMachineState value)
protected

Set the state of the session.

Parameters
[in]valueThe state to set the session to

Definition at line 30 of file can_extended_transport_protocol.cpp.

◆ TransportProtocolSessionBase() [1/2]

isobus::TransportProtocolSessionBase::TransportProtocolSessionBase ( TransportProtocolSessionBase && other)
default

The move constructor.

Parameters
[in]otherThe object to move

◆ TransportProtocolSessionBase() [2/2]

isobus::TransportProtocolSessionBase::TransportProtocolSessionBase ( TransportProtocolSessionBase::Direction direction,
std::unique_ptr< CANMessageData > data,
std::uint32_t parameterGroupNumber,
std::uint32_t totalMessageSize,
std::shared_ptr< ControlFunction > source,
std::shared_ptr< ControlFunction > destination,
TransmitCompleteCallback sessionCompleteCallback,
void * parentPointer )

The constructor for a session.

Parameters
[in]directionThe direction of the session
[in]dataData buffer (will be moved into the session)
[in]parameterGroupNumberThe PGN of the message
[in]totalMessageSizeThe total size of the message in bytes
[in]sourceThe source control function
[in]destinationThe destination control function
[in]sessionCompleteCallbackA callback for when the session completes
[in]parentPointerA generic context object for the tx complete and chunk callbacks

Definition at line 39 of file can_transport_protocol_base.cpp.

Friends And Related Symbol Documentation

◆ ExtendedTransportProtocolManager

friend class ExtendedTransportProtocolManager
friend

Allows the ETP manager full access.

Definition at line 78 of file can_extended_transport_protocol.hpp.

Member Data Documentation

◆ clearToSendPacketCountLimit

std::uint8_t isobus::ExtendedTransportProtocolManager::ExtendedTransportProtocolSession::clearToSendPacketCountLimit = 0xFF
private

The max packets that can be sent per DPO as indicated by the CTS message.

Definition at line 143 of file can_extended_transport_protocol.hpp.

◆ dataPacketOffsetPacketCount

std::uint8_t isobus::ExtendedTransportProtocolManager::ExtendedTransportProtocolSession::dataPacketOffsetPacketCount = 0
private

The number of packets that will be sent with the current DPO.

Definition at line 142 of file can_extended_transport_protocol.hpp.

◆ lastAcknowledgedPacketNumber

std::uint32_t isobus::ExtendedTransportProtocolManager::ExtendedTransportProtocolSession::lastAcknowledgedPacketNumber = 0
private

The last acknowledged packet number by the receiver.

Definition at line 139 of file can_extended_transport_protocol.hpp.

◆ lastSequenceNumber

std::uint8_t isobus::ExtendedTransportProtocolManager::ExtendedTransportProtocolSession::lastSequenceNumber = 0
private

The last processed sequence number for this set of packets.

Definition at line 141 of file can_extended_transport_protocol.hpp.

◆ sequenceNumberOffset

std::uint32_t isobus::ExtendedTransportProtocolManager::ExtendedTransportProtocolSession::sequenceNumberOffset = 0
private

The offset of the sequence number relative to the packet number.

Definition at line 140 of file can_extended_transport_protocol.hpp.

◆ state

StateMachineState isobus::ExtendedTransportProtocolManager::ExtendedTransportProtocolSession::state = StateMachineState::None
private

The state machine state for this session.

Definition at line 137 of file can_extended_transport_protocol.hpp.


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