Controller

Controller is the core RSSI protocol engine. It implements handshake/state transitions, negotiated-parameter management, retransmission behavior, and flow-control decisions while bridging Transport and Application paths. For conceptual guidance, see RSSI Protocol.

Threading and Lifecycle

Controller objects in C++ are referenced by the following shared pointer typedef:

typedef std::shared_ptr<rogue::protocols::rssi::Controller> rogue::protocols::rssi::ControllerPtr
[header]

The class description is shown below:

class Controller : public rogue::EnableSharedFromThis<rogue::protocols::rssi::Controller>
[header]

RSSI protocol controller.

Implements connection state, flow control, retransmission, and parameter negotiation between RSSI application and transport endpoints.

Protocol reference: https://confluence.slac.stanford.edu/x/1IyfD

Class relationship within rogue::protocols::rssi:

  • Client / Server: convenience wrappers that construct and wire the RSSI stack for endpoint role.

  • Transport: stream-facing link side for RSSI frames to/from the lower transport (for example UDP-based links).

  • Application: stream-facing payload side used by upper protocol layers.

  • Header: codec/container for RSSI header fields on stream frames.

  • Controller (this class): central state machine and policy engine connecting Transport and Application.

Operationally, frames received from Transport are decoded and processed for ACK/SYN/state transitions and delivery, while Application frames are segmented/tracked for reliable delivery according to negotiated parameters.

Public Functions

Controller(uint32_t segSize, std::shared_ptr<rogue::protocols::rssi::Transport> tran, std::shared_ptr<rogue::protocols::rssi::Application> app, bool server)
[header] [impl]

Constructs an RSSI controller.

Creator.

This constructor is a low-level C++ allocation path. Prefer create() when shared ownership or Python exposure is required.

Parameters:
  • segSize – Initial local max segment size.

  • tranTransport endpoint used for link traffic.

  • appApplication endpoint used for payload traffic.

  • server – True to run the server-side handshake behavior.

~Controller()
[header] [impl]

Destroys the controller and stops background processing.

Destructor.

void stopQueue()
[header] [impl]

Stops internal queues used by controller worker paths.

Stop queues.

std::shared_ptr<rogue::interfaces::stream::Frame> reqFrame(uint32_t size)
[header] [impl]

Allocates a frame for transport-path transmission.

Transport frame allocation request.

Parameters:

size – Minimum payload size in bytes.

Returns:

Allocated frame.

void transportRx(std::shared_ptr<rogue::interfaces::stream::Frame> frame)
[header] [impl]

Processes a frame received from transport.

Frame received at transport interface.

Parameters:

frame – Input frame from transport endpoint.

std::shared_ptr<rogue::interfaces::stream::Frame> applicationTx()
[header] [impl]

Gets next frame to transmit from the application side.

Frame transmit at application interface.

Returns:

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

void applicationRx(std::shared_ptr<rogue::interfaces::stream::Frame> frame)
[header] [impl]

Processes a frame received from the application side.

Frame received at application interface.

Parameters:

frame – Input frame from application endpoint.

bool getOpen()
[header] [impl]

Returns whether the RSSI link is in open state.

Get state.

Returns:

True when connection state is open.

uint32_t getDownCount()
[header] [impl]

Returns link down transition counter.

Get Down Count.

Returns:

Number of times link entered down/closed state.

uint32_t getDropCount()
[header] [impl]

Returns dropped-frame counter.

Get Drop Count.

Returns:

Number of dropped received frames.

uint32_t getRetranCount()
[header] [impl]

Returns retransmit counter.

Get Retransmit Count.

Returns:

Number of retransmitted frames.

bool getLocBusy()
[header] [impl]

Returns local busy state.

Get locBusy.

Returns:

True when local endpoint is currently busy.

uint32_t getLocBusyCnt()
[header] [impl]

Returns local busy event counter.

Get locBusyCnt.

Returns:

Number of local busy assertions.

bool getRemBusy()
[header] [impl]

Returns remote busy state.

Get remBusy.

Returns:

True when remote endpoint reports busy.

uint32_t getRemBusyCnt()
[header] [impl]

Returns remote busy event counter.

Get remBusyCnt.

Returns:

Number of remote busy indications seen.

void setLocTryPeriod(uint32_t val)
[header] [impl]

Sets local connection retry period.

Parameters:

val – Retry period in microseconds.

uint32_t getLocTryPeriod()
[header] [impl]

Gets local connection retry period.

Returns:

Retry period in microseconds.

void setLocMaxBuffers(uint8_t val)
[header] [impl]

Sets local max outstanding buffers parameter.

Parameters:

val – Maximum outstanding buffers.

uint8_t getLocMaxBuffers()
[header] [impl]

Gets local max outstanding buffers parameter.

Returns:

Maximum outstanding buffers.

void setLocMaxSegment(uint16_t val)
[header] [impl]

Sets local max segment size.

Parameters:

val – Segment size in bytes.

uint16_t getLocMaxSegment()
[header] [impl]

Gets local max segment size.

Returns:

Segment size in bytes.

void setLocCumAckTout(uint16_t val)
[header] [impl]

Sets local cumulative ACK timeout.

Parameters:

val – Timeout in protocol time units.

uint16_t getLocCumAckTout()
[header] [impl]

Gets local cumulative ACK timeout.

Returns:

Timeout in protocol time units.

void setLocRetranTout(uint16_t val)
[header] [impl]

Sets local retransmit timeout.

Parameters:

val – Timeout in protocol time units.

uint16_t getLocRetranTout()
[header] [impl]

Gets local retransmit timeout.

Returns:

Timeout in protocol time units.

void setLocNullTout(uint16_t val)
[header] [impl]

Sets local null-segment timeout.

Parameters:

val – Timeout in protocol time units.

uint16_t getLocNullTout()
[header] [impl]

Gets local null-segment timeout.

Returns:

Timeout in protocol time units.

void setLocMaxRetran(uint8_t val)
[header] [impl]

Sets local max retransmit count.

Parameters:

val – Maximum retransmit attempts.

uint8_t getLocMaxRetran()
[header] [impl]

Gets local max retransmit count.

Returns:

Maximum retransmit attempts.

void setLocMaxCumAck(uint8_t val)
[header] [impl]

Sets local max cumulative ACK interval.

Parameters:

val – Maximum number of packets before cumulative ACK.

uint8_t getLocMaxCumAck()
[header] [impl]

Gets local max cumulative ACK interval.

Returns:

Maximum number of packets before cumulative ACK.

uint8_t curMaxBuffers()
[header] [impl]

Gets negotiated max outstanding buffers.

Returns:

Negotiated max outstanding buffers.

uint16_t curMaxSegment()
[header] [impl]

Gets negotiated max segment size.

Returns:

Negotiated segment size in bytes.

uint16_t curCumAckTout()
[header] [impl]

Gets negotiated cumulative ACK timeout.

Returns:

Negotiated timeout in protocol time units.

uint16_t curRetranTout()
[header] [impl]

Gets negotiated retransmit timeout.

Returns:

Negotiated timeout in protocol time units.

uint16_t curNullTout()
[header] [impl]

Gets negotiated null-segment timeout.

Returns:

Negotiated timeout in protocol time units.

uint8_t curMaxRetran()
[header] [impl]

Gets negotiated max retransmit count.

Returns:

Negotiated max retransmit attempts.

uint8_t curMaxCumAck()
[header] [impl]

Gets negotiated max cumulative ACK interval.

Returns:

Negotiated packets between cumulative ACKs.

void resetCounters()
[header] [impl]

Resets runtime counters.

void setTimeout(uint32_t timeout)
[header] [impl]

Sets timeout in microseconds for frame transmits.

Set timeout for frame transmits in microseconds.

Parameters:

timeout – Timeout in microseconds.

void stop()
[header] [impl]

Stops the RSSI connection and worker thread.

Close.

void start()
[header] [impl]

Starts or restarts RSSI connection establishment.

Start.

Public Static Functions

static std::shared_ptr<rogue::protocols::rssi::Controller> create(uint32_t segSize, std::shared_ptr<rogue::protocols::rssi::Transport> tran, std::shared_ptr<rogue::protocols::rssi::Application> app, bool server)
[header] [impl]

Factory method to create an RSSI controller.

Class creation.

Parameter semantics are identical to the constructor; see Controller() for endpoint wiring details. This static factory is the preferred construction path when the object is shared across Rogue graph connections or exposed to Python. It returns std::shared_ptr ownership compatible with Rogue pointer typedefs.

Company : SLAC National Accelerator Laboratory

Description: RSSI

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.

Parameters:
  • segSize – Initial local maximum segment size.

  • tranTransport endpoint used for link traffic.

  • appApplication endpoint used for payload traffic.

  • server – True to run server-side handshake behavior.

Returns:

Shared pointer to the created controller.