pkg: Port NASA/bplib Package - #22091
Conversation
crasbe
left a comment
There was a problem hiding this comment.
Hello Simon,
thank you for submitting the PR early. I have some general remarks that can also be applied to the other files, I did not want to mark every occurance in every file.
Also the static test has some remarks that have to be addressed.
One thing I do not understand yet is why you include some files of the bplib repository directly? If you do not want to fetch the full repository in the package, you can use so called "Sparse Paths". An example of how this works can be found here: https://github.com/RIOT-OS/RIOT/pull/22040/changes#diff-1a9efff322ab2483b57b549e33422bcb923a3d6fcfb62c61a65f95e9b9ad5874
Unfortunately our documentation about that is a bit slim at the moment I think.
|
Thanks for your comments. Yes I am aware I need to integrate the RIOT coding conventions and fix the static tests. Could you elaborate on your first comment? Of the https://github.com/nasa/bplib repo, the folders |
You have files that are Copyright NASA, I assumed that you didn't write them, so they probably came from the What is the reason for adding them to the RIOT source tree instead of fetching and patching them from the official repo? |
ffabe7a to
2093708
Compare
|
For documentation purposes:
I did not look into the copyright headers yet. These should be added everywhere now, except for the vfs storage. Certain files, like NC "Node Config" and FWP "Framework Proxy" include OS specific callbacks or configuration tables. These are not part of the bplib core, but rather something that has to be implemented on the using environment. They come from the reference POSIX example in [bplib]/app. |
|
Apart from the typos and whitespace issues which I happened to introduce again this should now follow the coding conventions and have addressed the issued I mentioned in the original post @crasbe . The following was added feature-wise.
|
crasbe
left a comment
There was a problem hiding this comment.
This is the first part of a review up until and including pkg/bplib/cla/doc.md.
crasbe
left a comment
There was a problem hiding this comment.
This is the secondpart of a review up to and including pkg/bplib/storage/vfs/ordered/Makefile.
| static BPLib_Status_t BPA_TABLEP_TableUpdate(uint8_t TableType, void** TblPtr) | ||
| { | ||
| (void) TableType; | ||
| (void) TblPtr; | ||
| return BPLIB_SUCCESS; | ||
| } | ||
|
|
||
| static BPLib_Status_t BPA_EVP_Init(void) | ||
| { | ||
| return BPLIB_SUCCESS; | ||
| } | ||
|
|
||
| static BPLib_Status_t BPA_EVP_SendEvent(uint16_t EventID, | ||
| BPLib_EM_EventType_t EventType, char const* Spec) | ||
| { | ||
| DEBUG("Event Type: %d, Event ID: %d, Event Text: %s\n", EventID, EventType, Spec); | ||
| return BPLIB_SUCCESS; | ||
| } | ||
|
|
||
| static BPLib_Status_t BPA_TLMP_SendNodeMibConfigPkt( | ||
| BPLib_NodeMibConfigHkTlm_Payload_t* NodeMIBConfigTlmPayload) | ||
| { | ||
| (void) NodeMIBConfigTlmPayload; | ||
| return BPLIB_SUCCESS; | ||
| } | ||
|
|
||
| static BPLib_Status_t BPA_TLMP_SendPerSourceMibConfigPkt( | ||
| BPLib_SourceMibConfigHkTlm_Payload_t* SrcMIBConfigTlmPayload) | ||
| { | ||
| (void) SrcMIBConfigTlmPayload; | ||
| return BPLIB_SUCCESS; | ||
| } | ||
|
|
||
| static BPLib_Status_t BPA_TLMP_SendNodeMibReportsPkt( | ||
| BPLib_NodeMibReportsHkTlm_Payload_t* NodeMIBReportsTlmPayload) | ||
| { | ||
| (void) NodeMIBReportsTlmPayload; | ||
| return BPLIB_SUCCESS; | ||
| } | ||
|
|
||
| static BPLib_Status_t BPA_TLMP_SendNodeMibCounterPkt( | ||
| BPLib_NodeMibCountersHkTlm_Payload_t* NodeMIBCounterTlmPayload) | ||
| { | ||
| (void) NodeMIBCounterTlmPayload; | ||
| return BPLIB_SUCCESS; | ||
| } | ||
|
|
||
| static BPLib_Status_t BPA_TLMP_SendPerSourceMibCounterPkt( | ||
| BPLib_SourceMibCountersHkTlm_Payload_t* SrcMIBCounterTlmPayload) | ||
| { | ||
| (void) SrcMIBCounterTlmPayload; | ||
| return BPLIB_SUCCESS; | ||
| } | ||
|
|
||
| static BPLib_Status_t BPA_TLMP_SendChannelContactPkt( | ||
| BPLib_ChannelContactStatHkTlm_Payload_t* ChannelContactTlmPayload) | ||
| { | ||
| (void) ChannelContactTlmPayload; | ||
| return BPLIB_SUCCESS; | ||
| } | ||
|
|
||
| static BPLib_Status_t BPA_TLMP_SendStoragePkt( | ||
| BPLib_StorageHkTlm_Payload_t* StorTlmPayload) | ||
| { | ||
| (void) StorTlmPayload; | ||
| return BPLIB_SUCCESS; | ||
| } | ||
|
|
||
| static BPLib_Status_t BPA_ADUP_AddApplication(uint32_t ChanId) | ||
| { | ||
| (void) ChanId; | ||
| return BPLIB_SUCCESS; | ||
| } | ||
|
|
||
| static BPLib_Status_t BPA_ADUP_StartApplication(uint32_t ChanId) | ||
| { | ||
| #if defined(MODULE_BPLIB_STOR_VFS_ORDERED) || defined(MODULE_BPLIB_STOR_VFS_UNORDERED) | ||
| bplib_stor_vfs_channel_changed(ChanId); | ||
| #endif | ||
| (void) ChanId; | ||
| return BPLIB_SUCCESS; | ||
| } | ||
|
|
||
| static BPLib_Status_t BPA_ADUP_StopApplication(uint32_t ChanId) | ||
| { | ||
| (void) ChanId; | ||
| return BPLIB_SUCCESS; | ||
| } | ||
|
|
||
| static BPLib_Status_t BPA_ADUP_RemoveApplication(uint32_t ChanId) | ||
| { | ||
| (void) ChanId; | ||
| return BPLIB_SUCCESS; | ||
| } | ||
|
|
||
| static BPLib_Status_t BPA_CLAP_ContactSetup(uint32_t ContactId, BPLib_CLA_ContactsSet_t ContactInfo) | ||
| { | ||
| (void) ContactId; | ||
| (void) ContactInfo; | ||
| return BPLIB_SUCCESS; | ||
| } | ||
|
|
||
| static BPLib_Status_t BPA_CLAP_ContactStart(uint32_t ContactId) | ||
| { | ||
| #if defined(MODULE_BPLIB_STOR_VFS_ORDERED) || defined(MODULE_BPLIB_STOR_VFS_UNORDERED) | ||
| bplib_stor_vfs_contact_changed(ContactId); | ||
| #endif | ||
| (void) ContactId; | ||
| return BPLIB_SUCCESS; | ||
| } | ||
|
|
||
| static BPLib_Status_t BPA_CLAP_ContactStop(uint32_t ContactId) | ||
| { | ||
| (void) ContactId; | ||
| return BPLIB_SUCCESS; | ||
| } | ||
|
|
||
| static void BPA_CLAP_ContactTeardown(uint32_t ContactId) | ||
| { | ||
| (void) ContactId; | ||
| return; | ||
| } |
There was a problem hiding this comment.
I wonder if it makes sense to send a SUCCESS return message if the functions aren't actually implemented?
There was a problem hiding this comment.
I have not thought about that but I it seems necessary, since the real action this callback was called from might not be executed otherwise see bplib PI.
|
I ran BOARD_INSUFFICIENT_MEMORY := \
airfy-beacon \
calliope-mini \
e104-bt5010a-tb \
e104-bt5011a-tb \
microbit \
nrf51dk \
nrf51dongle \
yunjia-nrf51822 \
# |
|
The build succeeds for the ESPs now, but there is some kind of race condition for the Build log: |
crasbe
left a comment
There was a problem hiding this comment.
This fixes the build issues with LLVM on native32 and native64.
|
This is the |
|
All remaining review findings have been integrated in the fixup commits. |
crasbe
left a comment
There was a problem hiding this comment.
Alrighty then, let's get this merged now.
Thank you for enduring the review and applying all the fixes! You can squash your commits now :)
23ec57b to
871f32b
Compare
|
Any Idea why the tests suddenly complain about whitespaces in the patches? |
Good question, no idea. I think you can add an exception for I checked other patches and they also have the whitespaces. It's just the space where the
That would be good 👍 |
Port https://github.com/nasa/bplib. This initial port has the following features: 1. Port of bplib version 7.0.2. This is the first major release of bplib and still does not implement all features of BPv7. Fragmentation, Status Reports and Custody Transfer are missing currently. Extensions like BPSec are not supported, but there are plans to implement support in future versions of bplib. 2. An abstraction layer for easy initialization and configuration. This is modular and can be turned off (also partially). Especially callbacks for the system time are automatically set, which might need to be adjusted for a different implementation. 3. Two storage methods using the vfs 4. Two CLAs (Convergence Layer Adapters), i.e. ways to send bundles over other networks. Here UDP and BLE with NimBLE are supported currently. Refer to the Doxygen documentation for additional information regarding configuration options etc.
This implements two basic example configurations of bplib to send bundles over the currently available convergence layers: UDP and BLE.
871f32b to
71391c1
Compare
|
Thank you! Unfortunately we are limited in the CI resources, so the merge has to wait for a few days. |
DTN is a protocol architecture to make communication delay / disruption tolerant. Originating from space communication, NASAs bplib implements the BPv7 bundle protocol.
Usually it sits on top of the trasport layer (CLAs for TCP and UDP are most common), but it does not have to. Convergence Layer Adapters can be anything, as long as they are defined on both sides.
In this current draft the UDP convergence layer for testing on
nativeboard is implemented.Contribution description
Port into pkg/bplib. Also bump pkg/qcbor as required by bplib.
The changes (in the patches) are relatively small.
It is still a draft. The following is a likely incomplete list of what still needs to be done:
Testing procedure
The example under
examples/networking/dtn/bplib/cla_udpcan be run on native (or any board with gnrc + UDP).Issues/PRs references