shokai / arduino_firmata

Arduino Firmata protocol implementation on Ruby
http://shokai.github.io/arduino_firmata
MIT License
104 stars 23 forks source link

Removed EOFError #30

Closed threez closed 11 years ago

threez commented 11 years ago

When the data can't be read an error is raised and an EOFError is returned as value. When i generate sysex on my arduino i get this then:

sysex 54 ("2\x000\x006\x004\x00")
sysex 69 ("OFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFError62\x000\x006\x004\x00")
sysex 54 ("EOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFErrorEOFError2\x000\x006\x004\x00")
sysex 54 ("2\x000\x006\x004\x00")

(It seems also to generate a strange sysex (sysex 69))

In order to get the correct result i had to remove the EOFError. Im not sure what it is used for. Because it is simply converted into a string. But really i want to wait until the rest of data is available. So when i remove the EOFError the sysex works properly:

sysex 54 ("2\x000\x006\x004\x00")
sysex 54 ("2\x000\x006\x004\x00")
sysex 54 ("2\x000\x006\x004\x00")
sysex 54 ("2\x000\x006\x004\x00")
sysex 54 ("2\x000\x006\x004\x00")
sysex 54 ("2\x000\x006\x004\x00")
shokai commented 11 years ago

@threez thank you for report the bug! I'll push to rubygems.org tonight.

threez commented 11 years ago

welcome

shokai commented 11 years ago

I've shipped v0.3.3 now https://rubygems.org/gems/arduino_firmata