Skip to content

TypeError: string argument without an encoding #3

@dev-tommy

Description

@dev-tommy

Hi, i got encode error in line:

self.ble.gap_advertise(100, bytearray('\x02\x01\x02') + bytearray((len(name) + 1, 0x09)) + name)

so i add UTF-8 and fixed it

self.ble.gap_advertise(100, bytearray('\x02\x01\x02', 'UTF-8') + bytearray((len(name) + 1, 0x09)) + name)

image

Thx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions