whaleygeek / bitio

A micro:bit I/O device library for Python
Other
92 stars 31 forks source link

databits should be bytesize #13

Open whaleygeek opened 7 years ago

whaleygeek commented 7 years ago

The get_serial() inside bitio/__init__.py uses s.databits as a configuration property.

pyserial has no missing attribute protection in it's class, so this just sets an attribute on the class that is never used internally.

pyserial uses bytesize internally, and this defaults to 8 bits (which is what we assume, and what the majority of all UART configurations use these days). micro:bit also always uses 8 bits.

However, for completeness, this should be fixed.

s.databits = serial.EIGHTBITS

should be:

s.bytesize = serial.EIGHTBITS