Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions micropython/lora/lora-sx126x/lora/sx126x.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,9 @@ def _read_packet(self, rx_packet, flags):
pkt_status = self._cmd("B", _CMD_GET_PACKET_STATUS, n_read=4)

rx_packet.ticks_ms = ticks_ms
rx_packet.snr = pkt_status[2] # SNR, units: dB *4
rx_packet.rssi = 0 - pkt_status[1] // 2 # RSSI, units: dBm
# SNR units are dB * 4 (signed)
rx_packet.rssi, rx_packet.snr = struct.unpack("xBbx", pkt_status)
rx_packet.rssi //= -2 # RSSI, units: dBm
rx_packet.crc_error = (flags & _IRQ_CRC_ERR) != 0

return rx_packet
Expand Down
2 changes: 1 addition & 1 deletion micropython/lora/lora-sx126x/manifest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
metadata(version="0.1.4")
metadata(version="0.1.5")
require("lora")
package("lora")
Loading