Checks if there is any incoming data to be read with `read-byte`
has-available-byte
@/has-available-byte
Checks if there is any incoming data to be read with `read-byte`
Npulse
Pulses if there is no incoming data
Ypulse
Pulses if there is at least one byte
{{#global}}
#include <SPI.h>
#include <Ethernet2.h>
{{/global}}
struct State {
};
{{ GENERATED_CODE }}
void evaluate(Context ctx) {
if (!isInputDirty<input_CHK>(ctx))
return;
auto client = EthernetClient(getValue<input_SOCK>(ctx));
if (client.available()) {
emitValue<output_Y>(ctx, 1);
} else {
emitValue<output_N>(ctx, 1);
}
}