From 877d0cf7f8805b82e2d03b28140e7d5411427ca7 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 28 Nov 2024 19:35:18 -0800 Subject: [PATCH] enhance MaxBuffer Test sets the lower limit to 150 --- mesh_bot.py | 2 +- modules/system.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mesh_bot.py b/mesh_bot.py index 39d9321..5d98770 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -173,7 +173,7 @@ def handle_ping(message_from_id, deviceID, message, hop, snr, rssi, isDM, chann if pingCount > 1: multiPingList.append({'message_from_id': message_from_id, 'count': pingCount + 1, 'type': type, 'deviceID': deviceID, 'channel_number': channel_number}) if type == "🎙TEST": - msg = f"🎙Initalizing BufferTest, range {int(maxBuffer / pingCount)} to {maxBuffer} in {pingCount} messages" + msg = f"🎙Initalizing BufferTest, range {int(((maxBuffer - 150 ) / pingCount) + 150)} to {maxBuffer} in {pingCount} messages" else: msg = f"🚦Initalizing {pingCount} auto-ping" diff --git a/modules/system.py b/modules/system.py index b284335..4d7d4af 100644 --- a/modules/system.py +++ b/modules/system.py @@ -610,7 +610,9 @@ 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(maxBuffer / count))) + type = ''.join(random.choice(['0', '1']) for i in range(int((maxBuffer - 150 ) / count))) + # add the 150 back into the string as random data, this was for finer resolution of the count on the upper limit + type = type + ''.join(random.choice(['0', '1']) for i in range(150)) count = len(type + "🔂 ") if count < 99: # why? because the count likes to count, and it counts the count