This guide focuses on integrating and porting CHPP to your desired platform. For implementation details please refer to the included README.md instead. The minimum typical steps are provided.
Implement the platform-specific functionality utilized by CHPP. These can be found in chpp/platform and include:
Sample Linux implementations are provided.
You need to create a ChppLinkApi
API struct and a ChppLinkConfiguration
configuration struct for your link layer. See details in link.h.
In order to initialize CHPP, it is necessary to:
Several unit tests are provided in transport_test.c. In addition, loopback functionality is already implemented in CHPP, and can be used for testing. For details on crafting a loopback datagram, please refer to README.md and the transport layer unit tests (transport_test.c).
In order to terminate CHPP's main transport layer thread, it is necessary to:
If the system does not support multi-threading, the chppWorkThreadHandleSignal method can be used to directly handle signals without using chppWorkThreadStart.
Note that the system MUST replicate the high-level behavior of chppWorkThreadStart exactly in this case. More details in the documentation of chppWorkThreadHandleSignal.
For such systems, chppTransportGetTimeUntilNextDoWorkNs() can be used to replicate the functionality of chppNotifierTimedWait(). chppTransportGetTimeUntilNextDoWorkNs() returns the time until chppTransportDoWork() must be called again.
CHPP provides several predefined services (including Loopback Test, Service Discovery), as well as three standard services that follow the CHRE PAL API to simplify integration and testing. CHPP allows for custom services as well, as described in README.md. The standard services included in CHPP are:
In order to integrate the standard services using the CHRE PAL API, please refer to each service's interface as provided in include/chre/pal/