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.

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

typedef std::shared_ptr<rogue::protocols::rssi::Controller> rogue::protocols::rssi::ControllerPtr

The class description is shown below:

class Controller : public rogue::EnableSharedFromThis<rogue::protocols::rssi::Controller>

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)

Constructs an RSSI controller.

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()

Destroys the controller and stops background processing.

void stopQueue()

Stops internal queues used by controller worker paths.

std::shared_ptr<rogue::interfaces::stream::Frame> reqFrame(uint32_t size)

Allocates a frame for transport-path transmission.

Parameters:

size – Minimum payload size in bytes.

Returns:

Allocated frame.

void transportRx(std::shared_ptr<rogue::interfaces::stream::Frame> frame)

Processes a frame received from transport.

Parameters:

frame – Input frame from transport endpoint.

std::shared_ptr<rogue::interfaces::stream::Frame> applicationTx()

Gets next frame to transmit from the application side.

Returns:

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

void applicationRx(std::shared_ptr<rogue::interfaces::stream::Frame> frame)

Processes a frame received from the application side.

Parameters:

frame – Input frame from application endpoint.

bool getOpen()

Returns whether the RSSI link is in open state.

Returns:

True when connection state is open.

uint32_t getDownCount()

Returns link down transition counter.

Returns:

Number of times link entered down/closed state.

uint32_t getDropCount()

Returns dropped-frame counter.

Returns:

Number of dropped received frames.

uint32_t getRetranCount()

Returns retransmit counter.

Returns:

Number of retransmitted frames.

bool getLocBusy()

Returns local busy state.

Returns:

True when local endpoint is currently busy.

uint32_t getLocBusyCnt()

Returns local busy event counter.

Returns:

Number of local busy assertions.

bool getRemBusy()

Returns remote busy state.

Returns:

True when remote endpoint reports busy.

uint32_t getRemBusyCnt()

Returns remote busy event counter.

Returns:

Number of remote busy indications seen.

void setLocTryPeriod(uint32_t val)

Sets local connection retry period.

Parameters:

val – Retry period in microseconds.

uint32_t getLocTryPeriod()

Gets local connection retry period.

Returns:

Retry period in microseconds.

void setLocMaxBuffers(uint8_t val)

Sets local max outstanding buffers parameter.

Parameters:

val – Maximum outstanding buffers.

uint8_t getLocMaxBuffers()

Gets local max outstanding buffers parameter.

Returns:

Maximum outstanding buffers.

void setLocMaxSegment(uint16_t val)

Sets local max segment size.

Parameters:

val – Segment size in bytes.

uint16_t getLocMaxSegment()

Gets local max segment size.

Returns:

Segment size in bytes.

void setLocCumAckTout(uint16_t val)

Sets local cumulative ACK timeout.

Parameters:

val – Timeout in protocol time units.

uint16_t getLocCumAckTout()

Gets local cumulative ACK timeout.

Returns:

Timeout in protocol time units.

void setLocRetranTout(uint16_t val)

Sets local retransmit timeout.

Parameters:

val – Timeout in protocol time units.

uint16_t getLocRetranTout()

Gets local retransmit timeout.

Returns:

Timeout in protocol time units.

void setLocNullTout(uint16_t val)

Sets local null-segment timeout.

Parameters:

val – Timeout in protocol time units.

uint16_t getLocNullTout()

Gets local null-segment timeout.

Returns:

Timeout in protocol time units.

void setLocMaxRetran(uint8_t val)

Sets local max retransmit count.

Parameters:

val – Maximum retransmit attempts.

uint8_t getLocMaxRetran()

Gets local max retransmit count.

Returns:

Maximum retransmit attempts.

void setLocMaxCumAck(uint8_t val)

Sets local max cumulative ACK interval.

Parameters:

val – Maximum number of packets before cumulative ACK.

uint8_t getLocMaxCumAck()

Gets local max cumulative ACK interval.

Returns:

Maximum number of packets before cumulative ACK.

uint8_t curMaxBuffers()

Gets negotiated max outstanding buffers.

Returns:

Negotiated max outstanding buffers.

uint16_t curMaxSegment()

Gets negotiated max segment size.

Returns:

Negotiated segment size in bytes.

uint16_t curCumAckTout()

Gets negotiated cumulative ACK timeout.

Returns:

Negotiated timeout in protocol time units.

uint16_t curRetranTout()

Gets negotiated retransmit timeout.

Returns:

Negotiated timeout in protocol time units.

uint16_t curNullTout()

Gets negotiated null-segment timeout.

Returns:

Negotiated timeout in protocol time units.

uint8_t curMaxRetran()

Gets negotiated max retransmit count.

Returns:

Negotiated max retransmit attempts.

uint8_t curMaxCumAck()

Gets negotiated max cumulative ACK interval.

Returns:

Negotiated packets between cumulative ACKs.

void resetCounters()

Resets runtime counters.

void setTimeout(uint32_t timeout)

Sets timeout in microseconds for frame transmits.

Parameters:

timeout – Timeout in microseconds.

void stop()

Stops the RSSI connection and worker thread.

void start()

Starts or restarts RSSI connection establishment.

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)

Factory method to create an RSSI controller.

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.

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.