add-head

gabbapeople/simple-byte-protocol/add-head

Adds a "header" byte to the beginning of the packet
add-head
@/add-head
Adds a "header" byte to the beginning of the packet
IN@/packet
HEADbyte
A "header" byte value
add-head
IN
OUT
HEAD
OUT@/packet
To use the node in your project you should have the gabbapeople/simple-byte-protocol library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

struct State {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    auto _packet = getValue<input_IN>(ctx);

    _packet.buffer[0] = getValue<input_HEAD>(ctx);

    emitValue<output_OUT>(ctx, _packet);
}