read-byte

xod/w5500/read-byte

Read a single byte of the response from an opened connection
read-byte
@/read-byte
Read a single byte of the response from an opened connection
SOCKxod/net/socket
A socket
READpulse
Read the byte
read-byte
SOCK
READ
B
DONE
DONEpulse
Pulses when the byte is read
Bbyte
The last read byte

C++ implementation

{{#global}}
#include <SPI.h>
#include <Ethernet2.h>
{{/global}}

struct State {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    if (!isInputDirty<input_READ>(ctx))
        return;

    auto client = EthernetClient(getValue<input_SOCK>(ctx));
    uint8_t b = client.read();

    emitValue<output_B>(ctx, b);
    emitValue<output_DONE>(ctx, 1);
}