mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-05-10 07:14:28 +02:00
maxBuffer
test 4 will divide the maxBuffer value and send junk data to test a radio or network
This commit is contained in:
@@ -186,6 +186,7 @@ try:
|
||||
splitDelay = config['messagingSettings'].getfloat('splitDelay', 0) # default 0
|
||||
MESSAGE_CHUNK_SIZE = config['messagingSettings'].getint('MESSAGE_CHUNK_SIZE', 160) # default 160
|
||||
wantAck = config['messagingSettings'].getboolean('wantAck', False) # default False
|
||||
maxBuffer = config['messagingSettings'].getint('maxBuffer', 220) # default 220
|
||||
|
||||
except KeyError as e:
|
||||
print(f"System: Error reading config file: {e}")
|
||||
|
||||
+5
-2
@@ -610,8 +610,11 @@ def handleMultiPing(nodeID=0, deviceID=1):
|
||||
|
||||
if type == '🎙TEST':
|
||||
# use the type for a string of random data divided by MAXBUFFER and count for the length of the string
|
||||
type = ''.join(random.choice(['0', '1']) for i in range(int(MESSAGE_CHUNK_SIZE / count)))
|
||||
count = len(type)
|
||||
type = ''.join(random.choice(['0', '1']) for i in range(int(maxBuffer / count)))
|
||||
count = len(type + f"🔂 ")
|
||||
if count < 99:
|
||||
# why? because the count likes to count
|
||||
count = count - 1
|
||||
|
||||
send_message(f"🔂{count} {type}", channel_number, message_id_from, deviceID, bypassChuncking=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user