Skip to content

binary data problem. #26

Description

@thesamprice

Im trying to send the following binary blob via send_raw.

However my 0xa0 is becoming 0xc2 0xa0. Do i need to convert the byte array to a string via some sort of encoding prior to sending.

send_raw('HW_INT',bytearray(b'\xa0'))

However on the receiving end I am seeing 2 bytes

0xffffffc2
0xffffffa0

Some other characters are causing my problems also.
Unsure how to properly encode/decode a string for this.

The cosmos console only shows this, but im unsure if its taking the length of a unicode object or a byte array.

2022/08/16 10:19:06.163  WARN: Unlogged raw data of 1 bytes being sent to interface HW_INT

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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