@@ -114,6 +114,7 @@ def update(self):
114
114
try :
115
115
sentence = self ._parse_sentence ()
116
116
except UnicodeError :
117
+ print ("UnicodeError" )
117
118
return None
118
119
if sentence is None :
119
120
return False
@@ -122,7 +123,6 @@ def update(self):
122
123
data_type , args = sentence
123
124
data_type = bytes (data_type .upper (), "ascii" )
124
125
#return sentence
125
-
126
126
if data_type == b'GPGLL' : # GLL, Geographic Position – Latitude/Longitude
127
127
self ._parse_gpgll (args )
128
128
elif data_type == b'GPRMC' : # RMC, minimum location info
@@ -210,7 +210,7 @@ def _parse_sentence(self):
210
210
211
211
def _parse_gpgll (self , args ):
212
212
data = args .split (',' )
213
- if data is None or len ( data ) < 11 or data [0 ] is None :
213
+ if data is None or data [0 ] is None :
214
214
return # Unexpected number of params.
215
215
216
216
# Parse latitude and longitude.
@@ -222,8 +222,7 @@ def _parse_gpgll(self, args):
222
222
if self .longitude is not None and \
223
223
data [3 ] is not None and data [3 ].lower () == 'w' :
224
224
self .longitude *= - 1.0
225
-
226
- time_utc = int (_parse_int (data [4 ]))
225
+ time_utc = int (_parse_int (float (data [4 ])))
227
226
if time_utc is not None :
228
227
hours = time_utc // 10000
229
228
mins = (time_utc // 100 ) % 100
0 commit comments