fix: replace broken quick-start snippet with real API (packet listener with RSSI/SNR)

This commit is contained in:
swaits committed 2026-04-08 14:14:12 -06:00
1 parent 2cdce808f7
commit 1e2b34c367
1 file changed
+9 -4
+9 -4
View File
@@ -175,13 +175,18 @@ your code ──► client library ──┘</pre>
<li class="flex gap-4">
<span class="font-mono text-accent font-bold text-lg shrink-0">3.</span>
<div>
<p class="font-medium text-text">Send your first packet</p>
<p class="font-medium text-text">Listen for packets</p>
<pre
class="font-mono text-sm text-accent bg-bg-card border border-border px-4 py-3 rounded mt-2 overflow-x-auto"
>from donglora import DongLoRa
>import donglora as dl
radio = DongLoRa()
radio.send(b"hello lora")</pre>
ser = dl.connect()
dl.send(ser, "SetConfig", config=dl.DEFAULT_CONFIG)
dl.send(ser, "StartRx")
while pkt := dl.recv(ser):
p = pkt["payload"]
print(f'{pkt["rssi"]:4d}dBm {pkt["snr"]:3d}dB {p.hex()}')</pre>
</div>
</li>
</ol>