get-device-count

wayland/ds18b20/get-device-count

Count number of devices on the bus.
get-device-count
@/get-device-count
Count number of devices on the bus.
DEV@/ds18b20-devices
One or more DS18B20 temperature sensors on a single one-wire bus.
UPDpulse
Update.
get-device-count
DEV
UPD
Ndev
Ntemp
DONE
DONEpulse
Pulse when finished counting.
Ntempnumber
Number of DS18B20 temperature sensors on the one-wire bus.
Ndevnumber
Number of devices on the one-wire bus. Includes non-DS18B20 devices.
To use the node in your project you should have the wayland/ds18b20 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

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

        auto sensors = getValue<input_DEV>(ctx);
        emitValue<output_Ndev>(ctx, sensors->getDeviceCount());
        emitValue<output_Ntemp>(ctx, sensors->getDS18Count());
        emitValue<output_DONE>(ctx, 1);
    }
}