get-time

wayland/gps/get-time

Read time.
get-time
@/get-time
Read time.
GPS@/gps-device
A gps-device.
UPDpulse
Update.
get-time
GPS
UPD
Hour
Min
Sec
Done
Donepulse
Pulse on successful read. Will only pulse if time valid.
Secnumber
Second (0-59).
Minnumber
Minute (0-59).
Hournumber
Hour (0-23).
To use the node in your project you should have the wayland/gps 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

#pragma XOD evaluate_on_pin disable
#pragma XOD evaluate_on_pin enable input_UPD

node {

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

        auto gps = getValue<input_GPS>(ctx);

        if (gps->time.isValid()){
            emitValue<output_Hour>(ctx, gps->time.hour());
            emitValue<output_Min>(ctx, gps->time.minute());
            emitValue<output_Sec>(ctx, gps->time.second());
            emitValue<output_Done>(ctx, 1);
        }
    }
}