_read now throws away any buffers too small to be messages. This eliminates processing of many empty and incomplete buffers. Also removed the Try loop since it was not being checked against anything. Much faster now.
_read_message now more efficiently handles output from _read. It is designed to fail early instead of processing every buffer. It also processes all sentences in the buffer which was missing; only the first sentence was being processed.
It checks to see if the messagetype exists in the buffer
It then splits the buffer into segments and find the one containing the messagetype
Then it validates the full message is present from $ to *##.
If that all checks out we decode the message.
_read_message_raw No longer needed and was removed
NOTE: This does not make first fix faster from fullcoldstart. But I can now more often get 1 second L76 initialization times. Not always of course. And after initial fix, can get faster gps_message responses as well.
get_fix didn't work because _read_message could not handle a tuple of messagetypes. Changed _read_message so it always uses tuples
when the correct segment is found and we're checking messagetypes there were ocassionally extra loops. Added breaks to prevent this when messagefound is True
Reordered the message types in get_fix so more common types are first in the tuple to search. With this and the breaks I now can get sub .2s fixes on a hot L76.
This will prolly be my last contribution. I'm going to switch to CircuitPython boards because PyCom never puts out any fixes or updates and Adafruit's ecosystem is vibrant and awesome.
NOTE: This does not make first fix faster from fullcoldstart. But I can now more often get 1 second L76 initialization times. Not always of course. And after initial fix, can get faster gps_message responses as well.
get_fix
didn't work because_read_message
could not handle a tuple of messagetypes. Changed_read_message
so it always uses tuplesget_fix
so more common types are first in the tuple to search. With this and the breaks I now can get sub .2s fixes on a hot L76.