-
Juan David González Cobas authored
Dealing with mixed integers and strings (or bytes() when pyserial decides to do so) is a PITA that plagues all the code with ord() conversions and makes it error-prone and hard to debug. It is even more so if the python version (2.7 or 3.x) is not known in advance. To play safe - the firmware file is converted at read time into a bytearray, which is what it is - all data flow that is supposed to come from/to the serial line is cast into integer values as soon/later as possible; given that pyserial gives back str/bytes somehow at will, ord() calls at the .recv() method level are the safest way to ensure we get-a-byte, get-a-byte, get-a-byte, byte, byte.
c117db54