get-date

wayland/gps/get-date

Read date.
get-date
@/get-date
Read date.
GPS@/gps-device
A gps-device.
UPDpulse
Update.
get-date
GPS
UPD
Year
Month
Day
Done
Donepulse
Pulse on successful read. Will only pulse if date valid.
Daynumber
Day (1-31).
Monthnumber
Month (1-12).
Yearnumber
Year
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->date.isValid()){
            emitValue<output_Day>(ctx, gps->date.day());
            emitValue<output_Month>(ctx, gps->date.month());
            emitValue<output_Year>(ctx, gps->date.year());
            emitValue<output_Done>(ctx, 1);
        }
    }
}