Skip to content

SerialConnection cannot write arbitrary byte sequences #100

@ryosukecooltanaka

Description

@ryosukecooltanaka

The write() method of SerialConnection class takes string as an argument and convert them into bytes with the encode() method of the python string (with utf-8), but this can be inconvenient as no strings can be encoded into values between 128~255 (UTF-8 encoding table).

This string encoding can be easily bypassed by directly passing the desired byte sequence to SerialConnection.conn.write(), but conceivably changes can be made such that SerialConnection.write() decides whether or not to encode according to input types.

Not a big deal but just noting here as I wasted 1 hour figuring this out...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions