Skip to content

Missing to send last block2 package #26

@danielkilbo

Description

@danielkilbo

When the server uses less size on the coap messages than the device is set up with.
The coap double buffer will get filled with more data than able to send with a block2 (opaque).

In case of transfers of large opaques the object callback will finish the coap buffer filling before last request comes in from the server. The rest of the read request(s) from the server the opaque callback will not be called. Which is correct.
But the sending will be interrupted just before the end of the opaque due that the lwm2m engine do not know to proceed the sending with the data in the coap buffer.

The problem arises in perform_multi_resource_read_op() function when it return an error instead of sending next part of the opaque.

Could current fix work:
if (!(lwm2m_buf.len > 0 && lwm2m_buf_lock[0])) // New check if data still shall be sent { /* did not read anything even if we should have - on single item */ if(num_read == 0 && ctx->level == 3) { lwm2m_buf_lock[0] = 0; ERROR_HANDLER(ERROR_NOT_FOUND, "Nothing read", SEVERITY_LVL_INFO); return LWM2M_STATUS_NOT_FOUND; } }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions