mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
moved randbytes to np.random.bytes for python3.7 compatibility
This commit is contained in:
parent
ce69f2c34d
commit
37c69031da
1 changed files with 6 additions and 4 deletions
|
@ -13,7 +13,7 @@ import threading
|
||||||
import time
|
import time
|
||||||
import uuid
|
import uuid
|
||||||
import zlib
|
import zlib
|
||||||
from random import randrange, randbytes
|
from random import randrange# , randbytes
|
||||||
|
|
||||||
import codec2
|
import codec2
|
||||||
import helpers
|
import helpers
|
||||||
|
@ -361,7 +361,7 @@ class DATA:
|
||||||
|
|
||||||
def enqueue_frame_for_tx(
|
def enqueue_frame_for_tx(
|
||||||
self,
|
self,
|
||||||
frame_to_tx: list[bytearray],
|
frame_to_tx,# : list[bytearray], # this causes a crash on python 3.7
|
||||||
c2_mode=FREEDV_MODE.datac0.value,
|
c2_mode=FREEDV_MODE.datac0.value,
|
||||||
copies=1,
|
copies=1,
|
||||||
repeat_delay=0,
|
repeat_delay=0,
|
||||||
|
@ -1323,7 +1323,8 @@ class DATA:
|
||||||
static.ARQ_SESSION_STATE = "connecting"
|
static.ARQ_SESSION_STATE = "connecting"
|
||||||
|
|
||||||
# create a random session id
|
# create a random session id
|
||||||
self.session_id = randbytes(1)
|
# self.session_id = randbytes(1)
|
||||||
|
self.session_id = np.random.bytes(1)
|
||||||
print(self.session_id)
|
print(self.session_id)
|
||||||
|
|
||||||
connection_frame = bytearray(self.length_sig0_frame)
|
connection_frame = bytearray(self.length_sig0_frame)
|
||||||
|
@ -1615,7 +1616,8 @@ class DATA:
|
||||||
|
|
||||||
# init a new random session id if we are not in an arq session
|
# init a new random session id if we are not in an arq session
|
||||||
if not static.ARQ_SESSION:
|
if not static.ARQ_SESSION:
|
||||||
self.session_id = randbytes(1)
|
# self.session_id = randbytes(1)
|
||||||
|
self.session_id = np.random.bytes(1)
|
||||||
print(self.session_id)
|
print(self.session_id)
|
||||||
|
|
||||||
# Update data_channel timestamp
|
# Update data_channel timestamp
|
||||||
|
|
Loading…
Reference in a new issue