Open ismilak opened 1 month ago
Tested all targets on all possible platforms:
Test scenario
@ismilak: I’ve reviewed some portion of the overall changes in this PR#22.
Changes look good under and the build/makefile udpates
osal/efr32_wisun osal/freertos osal/linux
Changes under /src are in review.
Changes under /sample, we see a lot of refactorization of the sample application code into multiple files. Per our last discussion we agreed to move only the TLV GET/PUT implementations to a separate file(now moved under tlvs/_tlvs.c), while keeping the rest in the original sample/CsmpAgentLib_sample.[ch]
sample_tlvs.[ch] sample_util.[ch] tlvs/efr32_wisun_tlvs.c tlvs/freertos_tlvs.c tlvs/linux_tlvs.c
Yep, let me explain the purposes of the source files.
_sample/CsmpAgentLib_sampletlvs.h: It includes the common function declarations, like osal.h. These function implementations are platform specifics. They are implemented in _sample/tlvs/xxxxxtlvs.c files. It includes the function declaration of _csmptlvsget() and _csmptlvspost() handlers too.
_sample/CsmpAgentLib_sampletlvs.c: This source includes only 2 function implementation: _csmptlvsget() and _csmptlvspost(). These functions are the common handlers, they are registered as callbacks in the handler instance.
_sample/CsmpAgentLib_sampleutil.[ch]: These sources should include the utility functions, they can be used in the entire namespace of the sample application (sample/ dir). I note that, there is only one function yet (str2addr()) that is used only in _sample/CsmpAgentLibsample.c
The files are created to separate APIs and function implementations based on their functionality. I think what we can change to reduce the count of the files in sample/ directory:
I recommend to keep as it is to have this kind of architecture for future improvements and to reduce the length of sample source files.
Significant features and modifications: