Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
iv::comms::canJ1939::CanJ1939CommunicationController Class Reference

#include <CanJ1939CommunicationController.hpp>

Inheritance diagram for iv::comms::canJ1939::CanJ1939CommunicationController:
[legend]
Collaboration diagram for iv::comms::canJ1939::CanJ1939CommunicationController:
[legend]

Public Member Functions

 CanJ1939CommunicationController ()=delete
 
 CanJ1939CommunicationController (const std::shared_ptr< ICommunicationDriver > &driver, const std::shared_ptr< iv::model::comms::NetworkData > &networkData)
 
 CanJ1939CommunicationController (const CanJ1939CommunicationController &other)=delete
 
 CanJ1939CommunicationController (CanJ1939CommunicationController &&other)=delete
 
 ~CanJ1939CommunicationController () override=default
 
CanJ1939CommunicationControlleroperator= (const CanJ1939CommunicationController &other)=delete
 
CanJ1939CommunicationControlleroperator= (CanJ1939CommunicationController &&other)=delete
 
void pause () const
 
void resume () const
 
iv::types::networkId getNetworkId () const
 
std::shared_ptr< iv::model::comms::NetworkDatagetCommConfig () const
 
std::shared_ptr< iv::comms::ICommunicationDrivergetDriver () const
 
bool hasChannel (const iv::types::channelId &channelId) const
 
bool isEnabled ()
 

Protected Attributes

iv::types::networkId m_networkId
 
std::shared_ptr< bool > m_isEnabled
 
std::shared_ptr< iv::model::comms::NetworkDatam_commConfig
 
std::shared_ptr< iv::comms::ICommunicationProtocolm_protocol
 
std::shared_ptr< iv::comms::ICommunicationDriverm_driver
 
std::map< iv::types::channelId, std::shared_ptr< iv::channels::AbstractChannel > > m_channels
 
std::weak_ptr< iv::channels::AbstractChannelm_errorChannel
 
std::weak_ptr< iv::channels::AbstractChannelm_heartbeatChannel
 
std::weak_ptr< iv::comms::ICommunicationControllerm_fallbackComm
 
std::weak_ptr< iv::diamar::AppFailuresLoggerManagerm_appFailuresLoggerManager
 

Private Member Functions

bool frame () override
 
bool sendFrame ()
 
void receiveFrame ()
 
void trimOnGoingCommunications ()
 discard communications that have been inactive for too long
 
void addChannel (const std::shared_ptr< iv::channels::AbstractChannel > &channel) override
 
void initialize () override
 
void sendMessage (const std::shared_ptr< CMessageCan > &message)
 
void handleSinglePacketMessage (const std::vector< std::byte > &data, const std::pair< iv::types::comms::pgn, iv::types::comms::j1939SourceAddress > &pgnAndAddress)
 
void handleConnectionManagementMessage (const std::shared_ptr< CMessageCan > &message, const std::pair< iv::types::comms::pgn, iv::types::comms::j1939SourceAddress > &pgnAndAddress)
 
void handleDataTransferMessage (const std::shared_ptr< CMessageCan > &message, const std::pair< iv::types::comms::pgn, iv::types::comms::j1939SourceAddress > &pgnAndAddress)
 
void bindToChannel (const std::pair< iv::types::comms::pgn, std::optional< iv::types::comms::j1939SourceAddress > > &pgnAndAddress, const std::vector< std::byte > &data)
 
void handleDm1Packet (std::pair< iv::types::comms::pgn, iv::types::comms::j1939SourceAddress > pgnAndAddress, const std::vector< std::byte > &data)
 
void handleDefaultStateDM1Channels ()
 
void bindDTC (std::optional< iv::types::comms::j1939SourceAddress > address, iv::types::comms::dtc data)
 
void handleBamProtocolConnectionMessage (const std::shared_ptr< CMessageCan > &message, const std::pair< iv::types::comms::pgn, iv::types::comms::j1939SourceAddress > &pgnAndAddress)
 
void handleBamProtocolDataTransferMessage (const std::shared_ptr< CMessageCan > &message, onGoingCanJ1939MultiPacketCommunication &comm)
 

Private Attributes

std::shared_ptr< iv::comms::can::ICanCommunicationProtocolm_canProtocol
 
std::map< std::pair< iv::types::comms::pgn, std::optional< iv::types::comms::j1939SourceAddress > >, std::vector< iv::comms::canJ1939::CanJ1939ChannelBinding > > m_channelsOrderedByPgnAndAddress
 
std::map< std::pair< iv::types::comms::spn, std::optional< iv::types::comms::j1939SourceAddress > >, iv::comms::canJ1939::CanJ1939Dm1ChannelBindingm_dm1ChannelsOrderedBySpnAndAddress
 
std::map< iv::types::comms::j1939SourceAddress, onGoingCanJ1939MultiPacketCommunicationm_onGoingMultiPacketCommunications
 
iv::containers::CircularQueue< std::shared_ptr< CMessageCan >, 1000 > m_sendQueue
 
iv::types::timestamp m_lastHeartbeatTime
 
iv::types::timestamp m_lastTimestampReceived
 
std::mutex m_eraseCommsMutex
 

Friends

class CanJ1939CommunicationControllerFrame
 

Constructor & Destructor Documentation

◆ CanJ1939CommunicationController() [1/4]

iv::comms::canJ1939::CanJ1939CommunicationController::CanJ1939CommunicationController ( )
delete

◆ CanJ1939CommunicationController() [2/4]

iv::comms::canJ1939::CanJ1939CommunicationController::CanJ1939CommunicationController ( const std::shared_ptr< ICommunicationDriver > & driver,
const std::shared_ptr< iv::model::comms::NetworkData > & networkData )
explicit

◆ CanJ1939CommunicationController() [3/4]

iv::comms::canJ1939::CanJ1939CommunicationController::CanJ1939CommunicationController ( const CanJ1939CommunicationController & other)
delete

◆ CanJ1939CommunicationController() [4/4]

iv::comms::canJ1939::CanJ1939CommunicationController::CanJ1939CommunicationController ( CanJ1939CommunicationController && other)
delete

◆ ~CanJ1939CommunicationController()

iv::comms::canJ1939::CanJ1939CommunicationController::~CanJ1939CommunicationController ( )
overridedefault

Member Function Documentation

◆ addChannel()

void iv::comms::canJ1939::CanJ1939CommunicationController::addChannel ( const std::shared_ptr< iv::channels::AbstractChannel > & channel)
overrideprivatevirtual

◆ bindDTC()

void iv::comms::canJ1939::CanJ1939CommunicationController::bindDTC ( std::optional< iv::types::comms::j1939SourceAddress > address,
iv::types::comms::dtc data )
private

◆ bindToChannel()

void iv::comms::canJ1939::CanJ1939CommunicationController::bindToChannel ( const std::pair< iv::types::comms::pgn, std::optional< iv::types::comms::j1939SourceAddress > > & pgnAndAddress,
const std::vector< std::byte > & data )
private

◆ frame()

bool iv::comms::canJ1939::CanJ1939CommunicationController::frame ( )
overrideprivatevirtual

◆ getCommConfig()

std::shared_ptr< iv::model::comms::NetworkData > iv::comms::ICommunicationController::getCommConfig ( ) const
inlinenodiscardinherited

◆ getDriver()

std::shared_ptr< iv::comms::ICommunicationDriver > iv::comms::ICommunicationController::getDriver ( ) const
inlinenodiscardinherited

◆ getNetworkId()

iv::types::networkId iv::comms::ICommunicationController::getNetworkId ( ) const
inlinenodiscardinherited

◆ handleBamProtocolConnectionMessage()

void iv::comms::canJ1939::CanJ1939CommunicationController::handleBamProtocolConnectionMessage ( const std::shared_ptr< CMessageCan > & message,
const std::pair< iv::types::comms::pgn, iv::types::comms::j1939SourceAddress > & pgnAndAddress )
private

◆ handleBamProtocolDataTransferMessage()

void iv::comms::canJ1939::CanJ1939CommunicationController::handleBamProtocolDataTransferMessage ( const std::shared_ptr< CMessageCan > & message,
onGoingCanJ1939MultiPacketCommunication & comm )
private

◆ handleConnectionManagementMessage()

void iv::comms::canJ1939::CanJ1939CommunicationController::handleConnectionManagementMessage ( const std::shared_ptr< CMessageCan > & message,
const std::pair< iv::types::comms::pgn, iv::types::comms::j1939SourceAddress > & pgnAndAddress )
private

◆ handleDataTransferMessage()

void iv::comms::canJ1939::CanJ1939CommunicationController::handleDataTransferMessage ( const std::shared_ptr< CMessageCan > & message,
const std::pair< iv::types::comms::pgn, iv::types::comms::j1939SourceAddress > & pgnAndAddress )
private

◆ handleDefaultStateDM1Channels()

void iv::comms::canJ1939::CanJ1939CommunicationController::handleDefaultStateDM1Channels ( )
private

◆ handleDm1Packet()

void iv::comms::canJ1939::CanJ1939CommunicationController::handleDm1Packet ( std::pair< iv::types::comms::pgn, iv::types::comms::j1939SourceAddress > pgnAndAddress,
const std::vector< std::byte > & data )
private

◆ handleSinglePacketMessage()

void iv::comms::canJ1939::CanJ1939CommunicationController::handleSinglePacketMessage ( const std::vector< std::byte > & data,
const std::pair< iv::types::comms::pgn, iv::types::comms::j1939SourceAddress > & pgnAndAddress )
private

◆ hasChannel()

bool iv::comms::ICommunicationController::hasChannel ( const iv::types::channelId & channelId) const
inlinenodiscardinherited

◆ initialize()

void iv::comms::canJ1939::CanJ1939CommunicationController::initialize ( )
overrideprivatevirtual

◆ isEnabled()

bool iv::comms::ICommunicationController::isEnabled ( )
inlinenodiscardinherited

◆ operator=() [1/2]

CanJ1939CommunicationController & iv::comms::canJ1939::CanJ1939CommunicationController::operator= ( CanJ1939CommunicationController && other)
delete

◆ operator=() [2/2]

CanJ1939CommunicationController & iv::comms::canJ1939::CanJ1939CommunicationController::operator= ( const CanJ1939CommunicationController & other)
delete

◆ pause()

void iv::comms::ICommunicationController::pause ( ) const
inlineinherited

◆ receiveFrame()

void iv::comms::canJ1939::CanJ1939CommunicationController::receiveFrame ( )
private

◆ resume()

void iv::comms::ICommunicationController::resume ( ) const
inlineinherited

◆ sendFrame()

bool iv::comms::canJ1939::CanJ1939CommunicationController::sendFrame ( )
private

◆ sendMessage()

void iv::comms::canJ1939::CanJ1939CommunicationController::sendMessage ( const std::shared_ptr< CMessageCan > & message)
private

◆ trimOnGoingCommunications()

void iv::comms::canJ1939::CanJ1939CommunicationController::trimOnGoingCommunications ( )
private

discard communications that have been inactive for too long

Friends And Related Symbol Documentation

◆ CanJ1939CommunicationControllerFrame

Member Data Documentation

◆ m_appFailuresLoggerManager

std::weak_ptr<iv::diamar::AppFailuresLoggerManager> iv::comms::ICommunicationController::m_appFailuresLoggerManager
protectedinherited

◆ m_canProtocol

std::shared_ptr<iv::comms::can::ICanCommunicationProtocol> iv::comms::canJ1939::CanJ1939CommunicationController::m_canProtocol
private

◆ m_channels

std::map<iv::types::channelId, std::shared_ptr<iv::channels::AbstractChannel> > iv::comms::ICommunicationController::m_channels
protectedinherited

◆ m_channelsOrderedByPgnAndAddress

std::map<std::pair<iv::types::comms::pgn, std::optional<iv::types::comms::j1939SourceAddress> >, std::vector<iv::comms::canJ1939::CanJ1939ChannelBinding> > iv::comms::canJ1939::CanJ1939CommunicationController::m_channelsOrderedByPgnAndAddress
private

◆ m_commConfig

std::shared_ptr<iv::model::comms::NetworkData> iv::comms::ICommunicationController::m_commConfig
protectedinherited

◆ m_dm1ChannelsOrderedBySpnAndAddress

std::map<std::pair<iv::types::comms::spn, std::optional<iv::types::comms::j1939SourceAddress> >, iv::comms::canJ1939::CanJ1939Dm1ChannelBinding> iv::comms::canJ1939::CanJ1939CommunicationController::m_dm1ChannelsOrderedBySpnAndAddress
private

◆ m_driver

std::shared_ptr<iv::comms::ICommunicationDriver> iv::comms::ICommunicationController::m_driver
protectedinherited

◆ m_eraseCommsMutex

std::mutex iv::comms::canJ1939::CanJ1939CommunicationController::m_eraseCommsMutex
private

◆ m_errorChannel

std::weak_ptr<iv::channels::AbstractChannel> iv::comms::ICommunicationController::m_errorChannel
protectedinherited

◆ m_fallbackComm

std::weak_ptr<iv::comms::ICommunicationController> iv::comms::ICommunicationController::m_fallbackComm
protectedinherited

◆ m_heartbeatChannel

std::weak_ptr<iv::channels::AbstractChannel> iv::comms::ICommunicationController::m_heartbeatChannel
protectedinherited

◆ m_isEnabled

std::shared_ptr<bool> iv::comms::ICommunicationController::m_isEnabled
protectedinherited

◆ m_lastHeartbeatTime

iv::types::timestamp iv::comms::canJ1939::CanJ1939CommunicationController::m_lastHeartbeatTime
private

◆ m_lastTimestampReceived

iv::types::timestamp iv::comms::canJ1939::CanJ1939CommunicationController::m_lastTimestampReceived
private

◆ m_networkId

iv::types::networkId iv::comms::ICommunicationController::m_networkId
protectedinherited

◆ m_onGoingMultiPacketCommunications

std::map<iv::types::comms::j1939SourceAddress, onGoingCanJ1939MultiPacketCommunication> iv::comms::canJ1939::CanJ1939CommunicationController::m_onGoingMultiPacketCommunications
private

◆ m_protocol

std::shared_ptr<iv::comms::ICommunicationProtocol> iv::comms::ICommunicationController::m_protocol
protectedinherited

◆ m_sendQueue

iv::containers::CircularQueue<std::shared_ptr<CMessageCan>, 1000> iv::comms::canJ1939::CanJ1939CommunicationController::m_sendQueue
private

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