:) 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?.
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---