OBPFrame class

OverNode Binary Protocol (OBP) Frame

Frame structure (16-byte header + payload): ┌─────────────────────────────────────────────────────────────┐ │ Magic (4 bytes) │ Version (1) │ Type (1) │ Flags (1) │ Res(1)│ ├─────────────────────────────────────────────────────────────┤ │ Length (4 bytes, big-endian) │ ├─────────────────────────────────────────────────────────────┤ │ Stream ID (4 bytes) │ ├─────────────────────────────────────────────────────────────┤ │ Payload (Length bytes) │ └─────────────────────────────────────────────────────────────┘

Constructors

OBPFrame({int version = VERSION, required OBPMessageType type, OBPFlags flags = OBPFlags.none, required int streamId, required Uint8List payload})
const
OBPFrame.empty({int version = VERSION, required OBPMessageType type, OBPFlags flags = OBPFlags.none, required int streamId})
Create frame with empty payload

Properties

flags → OBPFlags
final
hashCode → int
The hash code for this object.
no setteroverride
length → int
Get payload length
no setter
payload → Uint8List
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
streamId → int
final
type → OBPMessageType
final
version → int
final

Methods

encode() → Uint8List
Encode frame to bytes
hasFlag(OBPFlags flag) → bool
Check if frame has specific flag
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override
withFlag(OBPFlags flag) → OBPFrame
Create frame with additional flag

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

decode(Uint8List data) → OBPFrame
Decode frame from bytes

Constants

HEADER_SIZE → const int
Frame header size in bytes
MAGIC → const int
Protocol magic number: "OVND" in ASCII
MAX_PAYLOAD_SIZE → const int
Maximum payload size (10MB)
VERSION → const int
Current protocol version