Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
openlcb::StreamReceiveRequest Struct Reference
Inheritance diagram for openlcb::StreamReceiveRequest:
CallableFlowRequestBase

Public Types

enum  { OPERATION_PENDING = 0x20000 , ERROR_CANCELED = Defs::ERROR_OUT_OF_ORDER | 1 }
 

Public Member Functions

void reset ()
 Gets a local stream ID.
 
void reset (ByteSink *target, Node *dst, NodeHandle src, uint8_t src_stream_id=StreamDefs::INVALID_STREAM_ID, uint8_t dst_stream_id=StreamDefs::INVALID_STREAM_ID, uint16_t max_window=0)
 Starts the stream receiver and prepares for an announced stream.
 
- Public Member Functions inherited from CallableFlowRequestBase
void reset_base ()
 Call this from all instances of reset(...).
 

Public Attributes

ByteSinktarget_ {nullptr}
 Where to send the incoming stream data.
 
NodeHandle src_ {0, 0}
 Remote node that will send us the stream.
 
Nodedst_ {nullptr}
 Local node for receiving the stream.
 
uint8_t srcStreamId_ {StreamDefs::INVALID_STREAM_ID}
 Source (remote) stream ID. May be INVALID_STREAM_ID.
 
uint8_t localStreamId_ {StreamDefs::INVALID_STREAM_ID}
 Local (target) stream ID. Must be valid.
 
uint16_t streamWindowSize_ {0}
 if non-zero, limits the maximum window size by the local side.
 
- Public Attributes inherited from CallableFlowRequestBase
int resultCode
 If high bits are zero, this is a 16-bit OpenLCB result code.
 
BarrierNotifiable done
 Used internally by the invoke_subflow mechanism of StateFlow to notify the calling flow upon completion.
 

Detailed Description

Definition at line 53 of file StreamReceiverInterface.hxx.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
OPERATION_PENDING 

This bit in the resultCode is cleared when done is called.

ERROR_CANCELED 

The operation was canceled by the caller using cancel_request()

Definition at line 55 of file StreamReceiverInterface.hxx.

Member Function Documentation

◆ reset() [1/2]

void openlcb::StreamReceiveRequest::reset ( )
inline

Gets a local stream ID.

This will be returning the assigned local stream ID from the stream receiver object.

Definition at line 65 of file StreamReceiverInterface.hxx.

◆ reset() [2/2]

void openlcb::StreamReceiveRequest::reset ( ByteSink target,
Node dst,
NodeHandle  src,
uint8_t  src_stream_id = StreamDefs::INVALID_STREAM_ID,
uint8_t  dst_stream_id = StreamDefs::INVALID_STREAM_ID,
uint16_t  max_window = 0 
)
inline

Starts the stream receiver and prepares for an announced stream.

This is generally invoked by a handler of a higher level protocol where the stream connection is arranged, such as the Memory Config Protocol.

This call is processed synchronously. It is expected that shortly after this call a stream init message will arrive to the local interface, originating from the stream source node.

Parameters
srcnode handle of the source node that announced the stream.
src_stream_idstream ID on the source node side. It is possible that this is not yet known at the time of this call, in which case INVALID_STREAM_ID may be passed in.
dst_stream_idallocated stream ID at the local node. If it is INVALID_STREAM_ID, then the assigned local ID is used by the stream receiver.
max_windowif non-zero, limits the maximum window size by the local side. If zero, the default max window size will be taken from a linker-time constant.

Definition at line 91 of file StreamReceiverInterface.hxx.

Member Data Documentation

◆ dst_

Node* openlcb::StreamReceiveRequest::dst_ {nullptr}

Local node for receiving the stream.

Definition at line 112 of file StreamReceiverInterface.hxx.

◆ localStreamId_

uint8_t openlcb::StreamReceiveRequest::localStreamId_ {StreamDefs::INVALID_STREAM_ID}

Local (target) stream ID. Must be valid.

Definition at line 116 of file StreamReceiverInterface.hxx.

◆ src_

NodeHandle openlcb::StreamReceiveRequest::src_ {0, 0}

Remote node that will send us the stream.

Definition at line 110 of file StreamReceiverInterface.hxx.

◆ srcStreamId_

uint8_t openlcb::StreamReceiveRequest::srcStreamId_ {StreamDefs::INVALID_STREAM_ID}

Source (remote) stream ID. May be INVALID_STREAM_ID.

Definition at line 114 of file StreamReceiverInterface.hxx.

◆ streamWindowSize_

uint16_t openlcb::StreamReceiveRequest::streamWindowSize_ {0}

if non-zero, limits the maximum window size by the local side.

If zero, the default max window size will be taken from a linker-time constant.

Definition at line 120 of file StreamReceiverInterface.hxx.

◆ target_

ByteSink* openlcb::StreamReceiveRequest::target_ {nullptr}

Where to send the incoming stream data.

Definition at line 108 of file StreamReceiverInterface.hxx.


The documentation for this struct was generated from the following file: