rogue
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
rogue::protocols::packetizer::Controller Class Reference

Packetizer base controller. More...

#include <Controller.h>

Inheritance diagram for rogue::protocols::packetizer::Controller:
rogue::protocols::packetizer::ControllerV1 rogue::protocols::packetizer::ControllerV2

Public Member Functions

 Controller (std::shared_ptr< rogue::protocols::packetizer::Transport > tran, std::shared_ptr< rogue::protocols::packetizer::Application > *app, uint32_t headSize, uint32_t tailSize, uint32_t alignSize, bool enSsi)
 Constructs a packetizer controller base.
 
 ~Controller ()
 Destroys the packetizer controller base.
 
std::shared_ptr< rogue::interfaces::stream::FramereqFrame (uint32_t size)
 Allocates a transport-path frame.
 
virtual void transportRx (std::shared_ptr< rogue::interfaces::stream::Frame > frame)
 Processes a frame received from transport.
 
void stopQueue ()
 Stops the internal transmit queue.
 
void stop ()
 Stops controller processing.
 
std::shared_ptr< rogue::interfaces::stream::FrametransportTx ()
 Returns the next frame for transport transmission.
 
virtual void applicationRx (std::shared_ptr< rogue::interfaces::stream::Frame > frame, uint8_t id)
 Processes a frame received from an application endpoint.
 
uint32_t getDropCount ()
 Returns dropped-frame counter.
 
void setTimeout (uint32_t timeout)
 Sets timeout in microseconds for frame transmits.
 

Protected Attributes

bool enSsi_
 
uint32_t appIndex_
 
uint32_t tranIndex_
 
bool transSof_ [256]
 
uint32_t tranCount_ [256]
 
uint32_t crc_ [256]
 
uint8_t tranDest_
 
uint32_t dropCount_
 
uint32_t headSize_
 
uint32_t tailSize_
 
uint32_t alignSize_
 
struct timeval timeout_
 
std::shared_ptr< rogue::Logginglog_
 
std::shared_ptr< rogue::interfaces::stream::FrametranFrame_ [256]
 
std::mutex appMtx_
 
std::mutex tranMtx_
 
std::shared_ptr< rogue::protocols::packetizer::Transporttran_
 
std::shared_ptr< rogue::protocols::packetizer::Application > * app_
 
rogue::Queue< std::shared_ptr< rogue::interfaces::stream::Frame > > tranQueue_
 

Detailed Description

Packetizer base controller.

Shared controller logic for packetizer variants that route data between one transport endpoint and multiple application endpoints.

Definition at line 45 of file Controller.h.

Constructor & Destructor Documentation

◆ Controller()

rogue::protocols::packetizer::Controller::Controller ( std::shared_ptr< rogue::protocols::packetizer::Transport tran,
std::shared_ptr< rogue::protocols::packetizer::Application > *  app,
uint32_t  headSize,
uint32_t  tailSize,
uint32_t  alignSize,
bool  enSsi 
)

Constructs a packetizer controller base.

Creator.

Parameters
tranTransport endpoint associated with this controller.
appPointer to application endpoint array indexed by destination.
headSizeHeader bytes inserted per packet.
tailSizeTrailer bytes inserted per packet.
alignSizePayload alignment requirement in bytes.
enSsiEnable SSI framing behavior.

Company : SLAC National Accelerator Laboratory

Description:

Packetizer Controller

This file is part of the rogue software platform. It is subject to the license terms in the LICENSE.txt file found in the top-level directory of this distribution and at: https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. No part of the rogue software platform, including this file, may be copied, modified, propagated, or distributed except according to the terms

contained in the LICENSE.txt file.

Definition at line 37 of file Controller.cpp.

◆ ~Controller()

rogue::protocols::packetizer::Controller::~Controller ( )

Destroys the packetizer controller base.

Destructor.

Definition at line 69 of file Controller.cpp.

Member Function Documentation

◆ applicationRx()

void rogue::protocols::packetizer::Controller::applicationRx ( std::shared_ptr< rogue::interfaces::stream::Frame frame,
uint8_t  id 
)
virtual

Processes a frame received from an application endpoint.

Frame received at application interface.

Parameters
frameInput application frame.
idApplication destination identifier.

Reimplemented in rogue::protocols::packetizer::ControllerV1, and rogue::protocols::packetizer::ControllerV2.

Definition at line 138 of file Controller.cpp.

◆ getDropCount()

uint32_t rogue::protocols::packetizer::Controller::getDropCount ( )

Returns dropped-frame counter.

Get drop count.

Returns
Number of dropped frames.

Definition at line 141 of file Controller.cpp.

◆ reqFrame()

rogue::interfaces::stream::FramePtr rogue::protocols::packetizer::Controller::reqFrame ( uint32_t  size)

Allocates a transport-path frame.

Transport frame allocation request.

Parameters
sizeMinimum payload size in bytes.
Returns
Allocated frame.

Definition at line 81 of file Controller.cpp.

◆ setTimeout()

void rogue::protocols::packetizer::Controller::setTimeout ( uint32_t  timeout)

Sets timeout in microseconds for frame transmits.

Set timeout for frame transmits in microseconds.

Parameters
timeoutTimeout value in microseconds.

Definition at line 146 of file Controller.cpp.

◆ stop()

void rogue::protocols::packetizer::Controller::stop ( )

Stops controller processing.

◆ stopQueue()

void rogue::protocols::packetizer::Controller::stopQueue ( )

Stops the internal transmit queue.

Stop TX.

Definition at line 74 of file Controller.cpp.

◆ transportRx()

void rogue::protocols::packetizer::Controller::transportRx ( std::shared_ptr< rogue::interfaces::stream::Frame frame)
virtual

Processes a frame received from transport.

Frame received at transport interface.

Parameters
frameInput transport frame.

Reimplemented in rogue::protocols::packetizer::ControllerV1, and rogue::protocols::packetizer::ControllerV2.

Definition at line 127 of file Controller.cpp.

◆ transportTx()

rogue::interfaces::stream::FramePtr rogue::protocols::packetizer::Controller::transportTx ( )

Returns the next frame for transport transmission.

Frame transmit at transport interface.

Returns
Frame ready for transport transmit, or null when none is available.

Definition at line 131 of file Controller.cpp.

Member Data Documentation

◆ alignSize_

uint32_t rogue::protocols::packetizer::Controller::alignSize_
protected

Definition at line 58 of file Controller.h.

◆ app_

std::shared_ptr<rogue::protocols::packetizer::Application>* rogue::protocols::packetizer::Controller::app_
protected

Definition at line 70 of file Controller.h.

◆ appIndex_

uint32_t rogue::protocols::packetizer::Controller::appIndex_
protected

Definition at line 49 of file Controller.h.

◆ appMtx_

std::mutex rogue::protocols::packetizer::Controller::appMtx_
protected

Definition at line 66 of file Controller.h.

◆ crc_

uint32_t rogue::protocols::packetizer::Controller::crc_[256]
protected

Definition at line 53 of file Controller.h.

◆ dropCount_

uint32_t rogue::protocols::packetizer::Controller::dropCount_
protected

Definition at line 55 of file Controller.h.

◆ enSsi_

bool rogue::protocols::packetizer::Controller::enSsi_
protected

Definition at line 48 of file Controller.h.

◆ headSize_

uint32_t rogue::protocols::packetizer::Controller::headSize_
protected

Definition at line 56 of file Controller.h.

◆ log_

std::shared_ptr<rogue::Logging> rogue::protocols::packetizer::Controller::log_
protected

Definition at line 62 of file Controller.h.

◆ tailSize_

uint32_t rogue::protocols::packetizer::Controller::tailSize_
protected

Definition at line 57 of file Controller.h.

◆ timeout_

struct timeval rogue::protocols::packetizer::Controller::timeout_
protected

Definition at line 60 of file Controller.h.

◆ tran_

std::shared_ptr<rogue::protocols::packetizer::Transport> rogue::protocols::packetizer::Controller::tran_
protected

Definition at line 69 of file Controller.h.

◆ tranCount_

uint32_t rogue::protocols::packetizer::Controller::tranCount_[256]
protected

Definition at line 52 of file Controller.h.

◆ tranDest_

uint8_t rogue::protocols::packetizer::Controller::tranDest_
protected

Definition at line 54 of file Controller.h.

◆ tranFrame_

std::shared_ptr<rogue::interfaces::stream::Frame> rogue::protocols::packetizer::Controller::tranFrame_[256]
protected

Definition at line 64 of file Controller.h.

◆ tranIndex_

uint32_t rogue::protocols::packetizer::Controller::tranIndex_
protected

Definition at line 50 of file Controller.h.

◆ tranMtx_

std::mutex rogue::protocols::packetizer::Controller::tranMtx_
protected

Definition at line 67 of file Controller.h.

◆ tranQueue_

rogue::Queue<std::shared_ptr<rogue::interfaces::stream::Frame> > rogue::protocols::packetizer::Controller::tranQueue_
protected

Definition at line 72 of file Controller.h.

◆ transSof_

bool rogue::protocols::packetizer::Controller::transSof_[256]
protected

Definition at line 51 of file Controller.h.


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