1e41f4b71Sopenharmony_ci# LiteIPC 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci 4e41f4b71Sopenharmony_ci## Basic Concepts 5e41f4b71Sopenharmony_ci 6e41f4b71Sopenharmony_ciLiteIPC is a new inter-process communication (IPC) mechanism provided by the OpenHarmony LiteOS-A kernel. Different from the traditional System V IPC, LiteIPC is designed for Remote Procedure Call (RPC). In addition, it provides APIs for the upper layer through device files, not through traditional API functions. 7e41f4b71Sopenharmony_ci 8e41f4b71Sopenharmony_ciLiteIPC has two important concepts: ServiceManager and Service. The entire system can have one ServiceManager and multiple Services. 9e41f4b71Sopenharmony_ci 10e41f4b71Sopenharmony_ciServiceManager provides the following functions: 11e41f4b71Sopenharmony_ci 12e41f4b71Sopenharmony_ci- Registers and deregisters services. 13e41f4b71Sopenharmony_ci 14e41f4b71Sopenharmony_ci- Manages the access permission of services. Only authorized tasks can send IPC messages to the service. 15e41f4b71Sopenharmony_ci 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ci## Working Principles 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ciServiceManager registers the task that needs to receive IPC messages as a Service, and sets the access permission for the Service task (specifies the tasks that can send IPC messages to the Service). 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ciLiteIPC maintains an IPC message queue for each Service task in kernel mode. The message queue provides the upper-layer user-mode programs with the read operation (receiving IPC messages) and the write operations (sending IPC messages) through LiteIPC device files. 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ci 24e41f4b71Sopenharmony_ci## Development Guidelines 25e41f4b71Sopenharmony_ci 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci### Available APIs 28e41f4b71Sopenharmony_ci 29e41f4b71Sopenharmony_ci **Table 1** APIs of the LiteIPC module (applicable to LiteOS-A only) 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ci| Category | API Description | 32e41f4b71Sopenharmony_ci| ------------- | ------------------------------------------------------------ | 33e41f4b71Sopenharmony_ci| Module initialization | **OsLiteIpcInit**: initializes the LiteIPC module. | 34e41f4b71Sopenharmony_ci| IPC message memory pool| - **LiteIpcPoolInit**: initializes the IPC message memory pool of a process.<br>- **LiteIpcPoolReInit**: reinitializes the IPC message memory pool of a process.<br>- **LiteIpcPoolDelete**: releases the IPC message memory pool of a process. | 35e41f4b71Sopenharmony_ci| Service management | **LiteIpcRemoveServiceHandle**: deletes a service. | 36e41f4b71Sopenharmony_ci 37e41f4b71Sopenharmony_ci> **NOTE**<br> 38e41f4b71Sopenharmony_ci> The APIs of the LiteIPC module are dedicated for LiteOS-A internal use only. 39