maxBuffer

test 4 will divide the maxBuffer value and send junk data to test a radio or network
This commit is contained in:
SpudGunMan
2024-11-28 16:41:49 -08:00
parent c18e0401e4
commit aa5ef23363
5 changed files with 15 additions and 4 deletions
+1
View File
@@ -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
View File
@@ -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)