Skip to content

Only convert to Uint8Array when sending to the device #1004

@murkle

Description

@murkle

I think you can simplify the code a little by always working with JavaScript Array() and only convert to Uint8Array when sending to the device, eg remove new Uint8Array here and then things like Array.concat() are available

const DISCONNECT = new Uint8Array([0x54]);
const GET_INFO = new Uint8Array([0x55]);
const GET_STATUS = new Uint8Array([0x10]);
const GET_SENSOR_IDS = new Uint8Array([0x51]);
const GET_SENSOR_INFO = new Uint8Array([0x50, 0x00]);
const GET_DEFAULT_SENSORS_MASK = new Uint8Array([0x56]);
``

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