Skip to content

Commit

Permalink
sniffle_hw: use randrange for random bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
sultanqasim committed Sep 1, 2024
1 parent 8d0e797 commit 6beee94
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python_cli/sniffle/sniffle_hw.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 6beee94

Please sign in to comment.