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

Block=(0,0,16) is not support #46

Open yzq opened 1 year ago

yzq commented 1 year ago

When block param is (0, 0, 16), like the following code, response = client.get(path, block2=(0, 0, 16)) The error log is: Traceback (most recent call last): File "coapsrv.py", line 23, in main() File "coapsrv.py", line 16, in main server.listen(10) File "/usr/local/lib64/python3.6/site-packages/coapthon/server/coap.py", line 153, in listen logger.info("receive_datagram - " + str(message)) File "/usr/local/lib64/python3.6/site-packages/coapthon/messages/message.py", line 734, in str return self.line_print File "/usr/local/lib64/python3.6/site-packages/coapthon/messages/message.py", line 719, in line_print msg += "{name}: {value}, ".format(name=opt.name, value=utils.parse_blockwise(opt.value)) File "/usr/local/lib64/python3.6/site-packages/coapthon/utils.py", line 94, in parse_blockwise num = value & 0xFFFFF0 TypeError: unsupported operand type(s) for &: 'NoneType' and 'int'