1 parent 5d4cf31 commit 47850a8Copy full SHA for 47850a8
1 file changed
killerbee/dev_cc253x.py
@@ -241,6 +241,12 @@ def pnext(self, timeout=100):
241
# in last two bytes of framedata. Note that we remove these before return of the frame.
242
243
# RSSI is signed value, offset by 73 (see CC2530 data sheet for offset)
244
+ # Possible fix for incorrect rssi calculation
245
+ rssi = struct.unpack('b', framedata[-2:-1])[0] - 73
246
+ if rssi > 127 or rssi < -128:
247
+ print(f"Rssi = {rssi}, out of range, setting to 127")
248
+ rssi = 127
249
+
250
rssi = framedata[-2] - 73
251
# Dirty hack to compensate for possible RSSI overflow
252
if rssi > 255:
0 commit comments