-
Notifications
You must be signed in to change notification settings - Fork 4
Mbed IP integration with CHIP
This page describes the possibilities of integrating Mbed IP with the CHIP project.
Both Mbed platform and CHIP project have common features that define IP communication. However, the approach to architecture is slightly different which means a challenge in their integration.
The Mbed IP integration with CHIP requires two steps:
- Network interface integration - adding support for Mbed devices and stacks.
- Socket layer integration - bind Mbed socket API with CHIP network layer
There are two possible ways to accomplish these two steps:
- Add Mbed implementation of Inet layer function with define flag for both network interface and socket integration
- Add Mbed implementation of Inet layer function with define flag for network layer and adapt the Mbed socket to BSD interface and use it inside CHIP endpoints implementation
Comparison of the two approaches:
Solution | Target support | Maintenance | Complexity | Other |
---|---|---|---|---|
Mbed support through ifdef in Inet | All mbed target supported | Changes to Inet layer may require a change to Mbed integration | Add new ifdef block in inet layer - significant interference with the existing code | CHIP specific |
BSD socket adaptation layer | All mbed target supported | Updates to Inet code is transparent to mbed maintainer | Add glue socket layer - more secure for existing code | Reusable with code based on BSD socket |
Following Zephyr approach, a BSD socket adaptation layer will be provided on top of the existing Mbed Socket API. This adaptation layer should be more resilient to change compared to conditionally compiled code. When complete, it can be upstreamed to mbed-os and benefit all users of the ecosystem.
Some part of the system like the interface will require conditional code but are rather small.