Yes, if you can send me whole is better. :S Thanks for the fast answer.
2009/1/28 Neil.Young <[email protected]> > > :) And here is the checkOK function as well... I'm in a rush. Let me > know, if you need more assistance. It's probably better I send you the > whole .py :) > > > def checkOK(buffer): > sum = 0 > for c in buffer[1:]: > if (c == "*"): > break > sum = sum ^ ord(c) > try: > cs = buffer.split("*") > packet_sum = "0x"+cs[1].lower().rstrip() > return packet_sum == hex(sum) > except: > return False > > > kriko schrieb: > > Looking into the api, it reads NMEA sentence and parse coordinate like > > this: > > 01338.7008,E > > > > ... > > String deg = str.substring(0, 2); // 013 > > String min = str.substring(2); // 38.7008 > > return this.parseCoordinate(deg, min, due, 'E', 'W'); // 013, 38.7008, > > E > > ... > > > > protected float parseCoordinate(String deg, String min, String due, > > char posDue, char negDue) throws GpsException { > > float ret = this.parseInt(deg) + (this.parseFloat(min) / 60); > > due = due.trim(); > > if(due.length() != 1) throw new GpsException("Only one-character > dues > > allowed (" + due + ")"); > > char charDue = Character.toUpperCase(due.charAt(0)); > > if(charDue == posDue){ > > return ret; > > } else if(charDue == negDue){ > > return -ret; > > } else { > > throw new GpsException("Only " + posDue + " or " + negDue + > " dues > > allowed (" + due + ")"); > > } > > } > > > > But I have to convert from NMEA to WGS84 - which is also called UTM?. > > > > > > > > > > > -- O conteúdo desta mensagem electrónica e de todos os ficheiros anexos são confidenciais e podem conter informação privilegiada. Quem dela tomar conhecimento sem autorização do emitente poderá incorrer em ilícito penal. Estão estritamente interditas a publicação, distribuição, uso, impressão, ou cópia não autorizadas da mensagem ou dos seus anexos. Caso tenha recebido esta mensagem por engano, queira por favor devolver-me a mensagem errónea. Obrigado pela sua colaboração. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
