Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
hdlc_rcp_if.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024, NXP
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
14#include <zephyr/sys/util.h>
15#include <zephyr/net/net_if.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
26typedef void (*hdlc_rx_callback_t)(uint8_t *data, uint16_t len, void *param);
27
29struct hdlc_api {
33 struct net_if_api iface_api;
34
44 int (*register_rx_cb)(hdlc_rx_callback_t hdlc_rx_callback, void *param);
45
57 int (*send)(const uint8_t *frame, uint16_t length);
58
67 int (*deinit)(void);
68};
69
70/* Make sure that the interface API is properly setup inside
71 * HDLC interface API struct (it is the first one).
72 */
73BUILD_ASSERT(offsetof(struct hdlc_api, iface_api) == 0);
74
75#ifdef __cplusplus
76}
77#endif
void(* hdlc_rx_callback_t)(uint8_t *data, uint16_t len, void *param)
OT RCP HDLC RX callback function.
Definition hdlc_rcp_if.h:26
Public API for network interface.
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
HDLC interface configuration data.
Definition hdlc_rcp_if.h:29
int(* register_rx_cb)(hdlc_rx_callback_t hdlc_rx_callback, void *param)
Register the Spinel HDLC RX callback.
Definition hdlc_rcp_if.h:44
int(* deinit)(void)
Deinitialize the device.
Definition hdlc_rcp_if.h:67
int(* send)(const uint8_t *frame, uint16_t length)
Transmit a HDLC frame.
Definition hdlc_rcp_if.h:57
struct net_if_api iface_api
HDLC interface API.
Definition hdlc_rcp_if.h:33
Misc utilities.