@@ -177,13 +177,19 @@ def _parse_GPRMC(self, args):
177
177
if data is None or len (data ) < 11 :
178
178
return # Unexpected number of params.
179
179
# Parse fix time.
180
- self .fix_time_utc = _parse_float (data [0 ])
181
- if self .fix_time_utc is not None :
182
- # Set time to a friendly python time struct if available.
183
- hours = self .fix_time_utc // 10000
184
- mins = int ((self .fix_time_utc // 100 ) % 100 )
185
- secs = self .fix_time_utc % 100
186
- self .fix_time_utc = time .struct_time ((0 , 0 , 0 , hours , mins , secs , 0 , 0 , - 1 ))
180
+ time_utc = _parse_float (data [0 ])
181
+ if time_utc is not None :
182
+ hours = time_utc // 10000
183
+ mins = int ((time_utc // 100 ) % 100 )
184
+ secs = time_utc % 100
185
+ # Set or update time to a friendly python time struct.
186
+ if self .timestamp_utc is not None :
187
+ self .timestamp_utc = time .struct_time ((
188
+ self .timestamp_utc .tm_year , self .timestamp_utc .tm_mon ,
189
+ self .timestamp_utc .tm_mday , hours , mins , secs , 0 , 0 , - 1 ))
190
+ else :
191
+ self .timestamp_utc = time .struct_time ((0 , 0 , 0 , hours , mins ,
192
+ secs , 0 , 0 , - 1 ))
187
193
# Parse status (active/fixed or void).
188
194
status = data [1 ]
189
195
self .fix_quality = 0
0 commit comments