From d643393f5545177bb35722c85fbcf6ee9659bbb0 Mon Sep 17 00:00:00 2001 From: syspart <52237906+syspart@users.noreply.github.com> Date: Thu, 11 Jul 2019 19:48:46 +0200 Subject: [PATCH] Bricking the device with long messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hello Jürgen, I had a problem with long text messages. When sending more than 8192 bytes, the message(s) will be displayed, but after turning of it never starts again. So I lost 4 badges. Greetings Klaus --- led-badge-11x44.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/led-badge-11x44.py b/led-badge-11x44.py index 4cf6b5a..1c27b9f 100755 --- a/led-badge-11x44.py +++ b/led-badge-11x44.py @@ -463,6 +463,10 @@ if needpadding: # print(buf) # array('B', [119, 97, 110, 103, 0, 0, 0, 0, 48, 48, 48, 48, 48, 48, 48, 48, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 126, 255, 255, 255, 255, 126, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) +if len(buf) > 8192: + print ("Writing more than 8192 bytes damages the display!") + sys.exit(1) + if have_pyhidapi: pyhidapi.hid_write(dev, buf) else: