Zephyr API Documentation  3.0.0
A Scalable Open Source RTOS
3.0.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
IPC service APIs

IPC Service API. More...

Data Structures

struct  ipc_service_cb
 Event callback structure. More...
 
struct  ipc_ept
 Endpoint instance. More...
 
struct  ipc_ept_cfg
 Endpoint configuration structure. More...
 
struct  ipc_service_backend
 IPC Service backend. More...
 

Functions

int ipc_service_open_instance (const struct device *instance)
 Open an instance. More...
 
int ipc_service_register_endpoint (const struct device *instance, struct ipc_ept *ept, const struct ipc_ept_cfg *cfg)
 Register IPC endpoint onto an instance. More...
 
int ipc_service_send (struct ipc_ept *ept, const void *data, size_t len)
 Send data using given IPC endpoint. More...
 

Detailed Description

IPC Service API.

Some terminology:

Function Documentation

◆ ipc_service_open_instance()

int ipc_service_open_instance ( const struct device instance)

#include <include/ipc/ipc_service.h>

Open an instance.

Function to be used to open an instance before being able to register a new endpoint on it.

Return values
-EINVALwhen instance configuration is invalid.
-EIOwhen no backend is registered.
-EALREADYwhen the instance is already opened (or being opened).
0on success or when not implemented on the backend (not needed).
othererrno codes depending on the implementation of the backend.

◆ ipc_service_register_endpoint()

int ipc_service_register_endpoint ( const struct device instance,
struct ipc_ept ept,
const struct ipc_ept_cfg cfg 
)

#include <include/ipc/ipc_service.h>

Register IPC endpoint onto an instance.

Registers IPC endpoint onto an instance to enable communication with a remote device.

The same function registers endpoints for both host and remote devices.

Parameters
instanceInstance to register the endpoint onto.
eptEndpoint object.
cfgEndpoint configuration.
Return values
-EIOwhen no backend is registered.
-EINVALwhen instance, endpoint or configuration is invalid.
-EBUSYwhen the instance is busy.
0on success.
othererrno codes depending on the implementation of the backend.

◆ ipc_service_send()

int ipc_service_send ( struct ipc_ept ept,
const void *  data,
size_t  len 
)

#include <include/ipc/ipc_service.h>

Send data using given IPC endpoint.

Parameters
eptRegistered endpoint by ipc_service_register_endpoint.
dataPointer to the buffer to send.
lenNumber of bytes to send.
Return values
-EIOwhen no backend is registered or send hook is missing from backend.
-EINVALwhen instance or endpoint is invalid.
-EBADMSGwhen the message is invalid.
-EBUSYwhen the instance is busy.
0on success.
othererrno codes depending on the implementation of the backend.