|
Open Model Railroad Network (OpenMRN)
|
Static constants and helper functions for the OpenLCB streaming protocol. More...
#include <StreamDefs.hxx>
Public Types | |
| enum | Flags { FLAG_CARRIES_ID = 0x01 , FLAG_REJECT_OUT_OF_ORDER = 0x02 , FLAG_PERMANENT_ERROR = 0x10 , FLAG_TEMPORARY_ERROR = 0x20 , FLAG_ACCEPT = 0x80 } |
| enum | AdditionalFlags { REJECT_INFO_LOGGED = 0x01 , REJECT_PERMANENT_INVALID_REQUEST = 0x20 , REJECT_PERMANENT_SRC_NOT_PERMITTED = 0x40 , REJECT_PERMANENT_STREAMS_NOT_ACCEPTED = 0x80 , REJECT_TEMPORARY_BUFFER_FULL = 0x20 , REJECT_TEMPORARY_OUT_OF_ORDER = 0x40 } |
Static Public Member Functions | |
| static Payload | create_initiate_request (uint16_t max_buffer_size, bool has_ident, uint8_t src_stream_id, uint8_t dst_stream_id=INVALID_STREAM_ID) |
| Creates a Stream Initiate Request message payload. | |
| static Payload | create_initiate_response (uint16_t max_buffer_size, uint8_t src_stream_id, uint8_t dst_stream_id, uint16_t error_code=STREAM_ACCEPT) |
| Creates a Stream Initiate Reply message payload. | |
| static Payload | create_data_proceed (uint8_t src_stream_id, uint8_t dst_stream_id) |
| Creates a Stream Data Proceed message payload. | |
| static Payload | create_close_request (uint8_t src_stream_id, uint8_t dst_stream_id, uint32_t total_bytes=INVALID_TOTAL_BYTE_COUNT) |
| Creates the payload for a stream close message. | |
Static Public Attributes | |
| static constexpr uint16_t | MAX_PAYLOAD = 0xffff |
| Maximum window size for stream send. | |
| static constexpr uint8_t | INVALID_STREAM_ID = 0xff |
| This value is invalid as a source or destination stream ID. | |
| static constexpr uint32_t | INVALID_TOTAL_BYTE_COUNT = 0xffffffff |
| Supply this value to the total byte count in stream close to mark it as invalid. | |
| static constexpr uint16_t | STREAM_ACCEPT = ((uint16_t)FLAG_ACCEPT) << 8 |
| This code is sent back in the error code field in the stream initiate reply if the stream is accepted. | |
| static constexpr uint16_t | STREAM_ERROR_INVALID_ARGS |
| This code is sent back in the error code field in the stream initiate reply if the stream is rejected with invalid arguments. | |
Static constants and helper functions for the OpenLCB streaming protocol.
Definition at line 43 of file StreamDefs.hxx.
| enum openlcb::StreamDefs::AdditionalFlags |
Definition at line 64 of file StreamDefs.hxx.
| Enumerator | |
|---|---|
| FLAG_PERMANENT_ERROR |
|
Definition at line 53 of file StreamDefs.hxx.
|
inlinestatic |
Creates the payload for a stream close message.
| src_stream_id | 1-byte SID stream identifier at the source side |
| dst_stream_id | 1-byte SID stream identifier at the dst side |
| total_bytes | if nonzero, specifies how many bytes were transferred in the stream in total. |
Definition at line 156 of file StreamDefs.hxx.
|
inlinestatic |
Creates a Stream Data Proceed message payload.
| src_stream_id | stream ID on the source side |
| dst_stream_id | stream ID on the destination side |
Definition at line 138 of file StreamDefs.hxx.
|
inlinestatic |
Creates a Stream Initiate Request message payload.
| max_buffer_size | value to propose as stream window size. |
| has_ident | if true, sets the flag for carrying a source stream ID. |
| src_stream_id | source stream ID value. |
Definition at line 93 of file StreamDefs.hxx.
|
inlinestatic |
Creates a Stream Initiate Reply message payload.
| max_buffer_size | the definite window size of the stream |
| src_stream_id | stream ID on the source side. |
| dst_stream_id | stream ID on the dst side. |
| error_code | error code if the stream is rejected, otherwise STREAM_ACCEPT if it is accepted. |
Definition at line 117 of file StreamDefs.hxx.
|
staticconstexpr |
This value is invalid as a source or destination stream ID.
Definition at line 48 of file StreamDefs.hxx.
|
staticconstexpr |
Supply this value to the total byte count in stream close to mark it as invalid.
Definition at line 51 of file StreamDefs.hxx.
|
staticconstexpr |
Maximum window size for stream send.
Definition at line 46 of file StreamDefs.hxx.
|
staticconstexpr |
This code is sent back in the error code field in the stream initiate reply if the stream is accepted.
Definition at line 76 of file StreamDefs.hxx.
|
staticconstexpr |
This code is sent back in the error code field in the stream initiate reply if the stream is rejected with invalid arguments.
Definition at line 80 of file StreamDefs.hxx.