Skip to content

Mbed IP integration with CHIP

ATmobica edited this page Feb 18, 2021 · 5 revisions

Brief

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.

Mbed and CHIP IP comparison

Integration approach

The Mbed IP integration with CHIP requires two steps:

  1. Network interface integration - adding support for Mbed devices and stacks.
  2. Socket layer integration - bind Mbed socket API with CHIP network layer

There are two possible ways to accomplish these two steps:

  1. Add Mbed implementation of Inet layer function with define flag for both network interface and socket integration
  2. 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

Summary

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.