gpsdata

ivanmason/gps-receiver/gpsdata

No description
gpsdata
@/gpsdata
DEV@/neo6mv2-device
UARTxod/uart/uart
UPDpulse
gpsdata
DEV
UART
UPD
DONE
DONEpulse
To use the node in your project you should have the ivanmason/gps-receiver 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

struct State {
};

{{ GENERATED_CODE }}

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

    auto uart = getValue<input_UART>(ctx);
    auto gps = getValue<input_DEV>(ctx);
    
    uint8_t byte = 0x00;
    unsigned long start = millis();
    
    do 
    {
      while (uart->available()){
          uart->readByte(&byte);
          gps->encode(byte);
        }
    } while (millis() - start < 1000);

    emitValue<output_DONE>(ctx, 1);
}