semuconsulting / pyubx2

Python library for parsing and generating UBX GPS/GNSS protocol messages.
BSD 3-Clause "New" or "Revised" License
165 stars 65 forks source link

Add socket support #71

Closed semuadmin closed 2 years ago

semuadmin commented 2 years ago

pyubx2 Pull Request Template

Description

Add capability in UBXReader to read from socket as well as serial or file datastream. Implements new SocketStream utility class which wraps socket and provides basic stream-like read(bytes) and readline() methods. This allows all three datastream types to use the same parsing algorithms, reducing code duplication.

Fixes #67

Testing

Please test all changes, however trivial, against the supplied unittest suite tests/test_*.py e.g. by executing the tests/testsuite.py module or using your IDE's native Python unittest integration facilities. Please describe any test cases you have amended or added to this suite to maintain >= 99% code coverage.

Checklist: