eclipse-wakaama / wakaama

Eclipse Wakaama is a C implementation of the Open Mobile Alliance's LightWeight M2M protocol (LWM2M).
BSD 3-Clause "New" or "Revised" License
498 stars 374 forks source link

Build Fails if LWM2M_RAW_BLOCK1_REQUESTS set #773

Closed mmb-davidsmith closed 4 months ago

mmb-davidsmith commented 5 months ago

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 commented 5 months ago

@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 commented 4 months ago

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

mmb-davidsmith commented 4 months ago

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

mmb-davidsmith commented 4 months ago

Fixed with the pushed commit.