Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Fails if LWM2M_RAW_BLOCK1_REQUESTS set #773

Open
mmb-davidsmith opened this issue May 3, 2024 · 3 comments
Open

Build Fails if LWM2M_RAW_BLOCK1_REQUESTS set #773

mmb-davidsmith opened this issue May 3, 2024 · 3 comments

Comments

@mmb-davidsmith
Copy link
Contributor

mmb-davidsmith commented May 3, 2024

I'm looking at using Wakaama in a firmware project and was trying to get the various knobs set to enable me to build for a low ram environment. In the documentation, it says that the LWM2M_RAW_BLOCK1_REQUESTS is intended for this sort of situation and configures the system to pass through each individual packet to the application rather than assembling the data.

When I enable this option and try to run my copy of the lightclient I run into the following compile errors:

wakaama/core/objects.c:530:20: error: unused variable 'dataP' [-Werror,-Wunused-variable]
    lwm2m_data_t * dataP = NULL;
                   ^
wakaama/core/objects.c:531:9: error: unused variable 'size' [-Werror,-Wunused-variable]
    int size = 0;
        ^

Quickly commenting these out since they're not used in the function, the following errors is raised:

wakaama/coap/block.c:294:9: error: conflicting types for 'coap_block1_handler'
uint8_t coap_block1_handler(lwm2m_block_data_t **pBlockDataHead,
        ^
wakaama/core/internals.h:483:9: note: previous declaration is here
uint8_t coap_block1_handler(lwm2m_block_data_t ** blockData, const char * uri, uint16_t mid, uint8_t * buffer, size_t length, uint16_t blockSize, uint32_t blockNum, bool blockMore, uint8_t ** outputBuffer, size_t * outputLength);
        ^

This is due to a missing const keyword on the uint8_t * buffer. Once that is changed, I'm able to compile but the samples don't handle the full block transfer and would need some updates to complete a transfer.

I'm just working on the internal processes to get a Contribution signed off to address this and should be able to contribute back.

@LukasWoodtli
Copy link
Contributor

@mmb-davidsmith Thank you for your participation. LWM2M_RAW_BLOCK1_REQUESTS has not got any attention lately. It would be nice to have some improvements and clean-ups in this area.
Looking forward to your contribution.

mmb-davidsmith added a commit to mmb-davidsmith/wakaama that referenced this issue May 22, 2024
Addresses the compile issues referenced in eclipse-wakaama#773 when using the
`LWM2M_RAW_BLOCK1_REQUESTS` compile flag by:
- removing unused variables
- specifying the missing const keyword.

In addition, to help validate that this doesn't happen in the future, this
commit adds an additional configuration option to the client example which
enables the `LWM2M_RAW_BLOCK1_REQUESTS` option. This allows for a basic test
that compilation succeeds. It does not go further in attempting to add unit
tests for this compile option.

Signed-off-by: David Smith <mmb-davidsmith@users.noreply.github.com>
@mmb-davidsmith
Copy link
Contributor Author

Sorry for the delay on a contribution, I was on holiday but now that I'm back I'll be submitting shortly.

@mmb-davidsmith
Copy link
Contributor Author

@LukasWoodtli - I've submitted PR #777, which gets this building again. It needs approval for the workflows to run.

LukasWoodtli pushed a commit that referenced this issue May 24, 2024
Addresses the compile issues referenced in #773 when using the
`LWM2M_RAW_BLOCK1_REQUESTS` compile flag by:
- removing unused variables
- specifying the missing const keyword.

In addition, to help validate that this doesn't happen in the future, this
commit adds an additional configuration option to the client example which
enables the `LWM2M_RAW_BLOCK1_REQUESTS` option. This allows for a basic test
that compilation succeeds. It does not go further in attempting to add unit
tests for this compile option.

Signed-off-by: David Smith <mmb-davidsmith@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants