Skip to content

Commit

Permalink
Bricking the device with long messages
Browse files Browse the repository at this point in the history
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
  • Loading branch information
syspart authored Jul 11, 2019
1 parent 11febb9 commit d643393
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions led-badge-11x44.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,10 @@ def header(lengths, speeds, modes, blink, ants):

# 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:
Expand Down

0 comments on commit d643393

Please sign in to comment.