Tanganelli / CoAPthon3

CoAPthon3 is a porting to python3 of my CoAPthon library. CoAPthon3 is a python3 library to the CoAP protocol compliant with the RFC. Branch is available for the Twisted framework.
MIT License
58 stars 50 forks source link

NO_RESPONSE not supported in 1.0.1 #15

Open jknisley opened 5 years ago

jknisley commented 5 years ago

When using CoAPthon3==1.0.1, deserializing messages with the NO_RESPONSE option set throws an error:

Traceback (most recent call last):
  File "main.py", line 12, in <module>
    coap_message = Serializer.deserialize(data, addr)
  File "/tmp/coapthon/serializer.py", line 78, in deserialize
    (opt_critical, _, _) = defines.OptionRegistry.get_option_flags(current_option)
  File "/tmp/coapthon/defines.py", line 166, in get_option_flags
    opt_bytes = array.array('B', '\0\0')
TypeError: cannot use a str to initialize an array with typecode 'B'

It appears that version was published before NO_RESPONSE was added to coapthon.defines.OptionRegistry. Installing from the master branch works fine, but I was just curious if there were any plans to push a new release in the near future?