'$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47'
Then
segs == ['$GPGGA', '123519', '4807.038', 'N', '01131.000', 'E', '1', '08', '0.9', '545.4', 'M', '46.9', 'M', '', '', '47']
and
seg0 == 'GPGGA'
segx == 'GGA'
After executing
Code: Select all
segs = segs[:-1]
So I think that line is correct. However the original code removed the '$' from segs[0], rather than just from a copy so they got the following as their arg
['GPGGA', '123519', '4807.038', 'N', '01131.000', 'E', '1', '08', '0.9', '545.4', 'M', '46.9', 'M', '', '']
None of the parse routines use element 0, but I guess we should remove the '$' in case anyone has subclassed AS_GPS and implemented their own parse routine. With the following change the parse routines will receive exactly the same input as before the changes:
Code: Select all
segs[0] = segs[0][1:] # discard $
segs = segs[:-1] # and checksum
seg0 = segs[0] # e.g. GPGLL
segx = seg0[2:] # e.g. GLL