Skip to content

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

Description

@yzq

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'

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