Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
semuadmin committed May 7, 2024
1 parent 1533db3 commit 3908b36
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ Example - Serial input:
```python
from serial import Serial
from pyrtcm import RTCMReader
stream = Serial('/dev/tty.usbmodem14101', 9600, timeout=3)
rtr = RTCMReader(stream)
(raw_data, parsed_data) = rtr.read()
print(parsed_data)
with Serial('/dev/tty.usbmodem14101', 9600, timeout=3) as stream:
rtr = RTCMReader(stream)
raw_data, parsed_data = rtr.read()
print(parsed_data)
```
```
<RTCM(1077, DF002=1077, DF003=0, GNSSEpoch=204137001, DF393=1, DF409=0, DF001_7=0, DF411=0, DF412=0, DF417=0, DF418=0, DF394=760738918298550272, NSat=10, DF395=1073807360, NSig=2, DF396=1044459, DF397_01(005)=75, DF397_02(007)=75, DF397_03(009)=81, ..., DF404_19(030,1C)=0.0, DF404_20(030,2L)=0.0)>,
Expand All @@ -111,21 +111,21 @@ print(parsed_data)
Example - File input (using iterator).
```python
from pyrtcm import RTCMReader
stream = open('rtcmdata.log', 'rb')
rtr = RTCMReader(stream)
for (raw_data, parsed_data) in rtr:
print(parsed_data)
with open('rtcmdata.log', 'rb') as stream:
rtr = RTCMReader(stream)
for raw_data, parsed_data in rtr:
print(parsed_data)
```

Example - Socket input (using iterator):
```python
import socket
from pyrtcm import RTCMReader
stream = socket.socket(socket.AF_INET, socket.SOCK_STREAM):
stream.connect(("localhost", 50007))
rtr = RTCMReader(stream)
for (raw_data, parsed_data) in rtr:
print(parsed_data)
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as stream:
stream.connect(("localhost", 50007))
rtr = RTCMReader(stream)
for raw_data, parsed_data in rtr:
print(parsed_data)
```

---
Expand Down

0 comments on commit 3908b36

Please sign in to comment.