Beispiel #1
0
bool
VegaDevice::ParseNMEA(const char *String, NMEAInfo &info)
{
  NMEAInputLine line(String);
  char type[16];
  line.Read(type, 16);

  if (memcmp(type, "$PD", 3) == 0)
    detected = true;

  if (StringIsEqual(type, "$PDSWC"))
    return PDSWC(line, info, volatile_data);
  else if (StringIsEqual(type, "$PDAAV"))
    return PDAAV(line, info);
  else if (StringIsEqual(type, "$PDVSC"))
    return PDVSC(line, info);
  else if (StringIsEqual(type, "$PDVDV"))
    return PDVDV(line, info);
  else if (StringIsEqual(type, "$PDVDS"))
    return PDVDS(line, info);
  else if (StringIsEqual(type, "$PDVVT"))
    return PDVVT(line, info);
  else if (StringIsEqual(type, "$PDVSD")) {
    const auto message = line.Rest();
    StaticString<256> buffer;
    buffer.SetASCII(message.begin(), message.end());
    Message::AddMessage(buffer);
    return true;
  } else if (StringIsEqual(type, "$PDTSM"))
    return PDTSM(line, info);
  else
    return false;
}
Beispiel #2
0
  virtual void LineReceived(const char *_line) {
    if (!VerifyNMEAChecksum(_line))
      return;

    NMEAInputLine line(_line);
    if (line.read_compare("$PDVSC"))
      PDVSC(line);
  }
Beispiel #3
0
bool
VegaDevice::ParseNMEA(const char *String, NMEAInfo &info)
{
  NMEAInputLine line(String);
  char type[16];
  line.read(type, 16);

  if (memcmp(type, "$PD", 3) == 0)
    detected = true;

  if (strcmp(type, "$PDSWC") == 0)
    return PDSWC(line, info);
  else if (strcmp(type, "$PDAAV") == 0)
    return PDAAV(line, info);
  else if (strcmp(type, "$PDVSC") == 0)
    return PDVSC(line, info);
  else if (strcmp(type, "$PDVDV") == 0)
    return PDVDV(line, info);
  else if (strcmp(type, "$PDVDS") == 0)
    return PDVDS(line, info);
  else if (strcmp(type, "$PDVVT") == 0)
    return PDVVT(line, info);
  else if (strcmp(type, "$PDVSD") == 0) {
    const char *message = line.rest();
#ifdef _UNICODE
    TCHAR buffer[strlen(message)];
    if (MultiByteToWideChar(CP_ACP, 0, message, -1,
                            buffer, ARRAY_SIZE(buffer)) <= 0)
      return false;
#else
    const char *buffer = message;
#endif

    Message::AddMessage(buffer);
    return true;
  } else if (strcmp(type, "$PDTSM") == 0)
    return PDTSM(line, info);
  else
    return false;
}