Skip to content

Characterstic.write_value sends flags as array instead of dictionary #359

@FormidableArne

Description

@FormidableArne

Characteristic.write_value sends the flags as an array. but the gatt-api demands a dictionary.

ERROR:dbus.connection:Unable to set arguments (b'\x00\x00\x00\x01\x00\x01\x00\x00\xa0', dbus.Array(['type'], signature=None)) according to signature 'aya{sv}': <class 'TypeError'>: list indices must be integers or slices, not str
Traceback (most recent call last):
  File "dfu.py", line 244, in <module>
    asyncio.run(main(deviceAddress, firmwareFilePath))
  File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
    return future.result()
  File "dfu.py", line 216, in main
    images = await listImages(c)
  File "dfu.py", line 129, in listImages
    smpCharacteristic.write_value(payload, flags={ 'type': 'command' }) # type 'command' is write without response.
  File "/usr/local/lib/python3.7/dist-packages/bluezero/GATT.py", line 211, in write_value
    self.characteristic_methods.WriteValue(value, dbus.Array(flags))
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 145, in __call__
    **keywords)
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 641, in call_blocking
    message.append(signature=signature, *args)

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