From 6beee943a29c301105b040dabd90c9cf178cee15 Mon Sep 17 00:00:00 2001 From: Sultan Qasim Khan Date: Sun, 1 Sep 2024 14:26:17 -0400 Subject: [PATCH] sniffle_hw: use randrange for random bytes --- python_cli/sniffle/sniffle_hw.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python_cli/sniffle/sniffle_hw.py b/python_cli/sniffle/sniffle_hw.py index 8b1e372..448e578 100644 --- a/python_cli/sniffle/sniffle_hw.py +++ b/python_cli/sniffle/sniffle_hw.py @@ -437,7 +437,7 @@ def probe_fw_version(self): # Generate a random static address and set it def random_addr(self): - addr = [randint(0, 255) for i in range(6)] + addr = [randrange(0x100) for i in range(6)] addr[5] |= 0xC0 # make it static self.cmd_setaddr(bytes(addr)) @@ -513,10 +513,10 @@ def initiate_conn(self, peerAddr, is_random=True, interval=24, latency=1): llData = [] # access address - llData.extend([randint(0, 255) for i in range(4)]) + llData.extend([randrange(0x100) for i in range(4)]) # initial CRC - llData.extend([randint(0, 255) for i in range(3)]) + llData.extend([randrange(0x100) for i in range(3)]) # WinSize, WinOffset, Interval, Latency, Timeout llData.append(3)