Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
 4.1.99
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
openthread.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_MODULES_OPENTHREAD_OPENTHREAD_H_
8#define ZEPHYR_MODULES_OPENTHREAD_OPENTHREAD_H_
9
10#include <zephyr/kernel.h>
11
12#include <openthread/instance.h>
13#include <openthread/message.h>
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
27typedef void (*openthread_receive_cb)(struct otMessage *message, void *context);
28
48 otStateChangedCallback otCallback;
49
51 void *user_data;
52
58};
59
67
74
79
86struct otInstance *openthread_get_default_instance(void);
87
107
118
123
135
144
153
158
159#ifdef __cplusplus
160}
161#endif
162
163#endif /* ZEPHYR_MODULES_OPENTHREAD_OPENTHREAD_H_ */
struct _snode sys_snode_t
Single-linked list node structure.
Definition slist.h:39
Public kernel APIs.
void openthread_set_receive_cb(openthread_receive_cb cb, void *context)
Set the additional callback for receiving packets.
int openthread_state_changed_callback_register(struct openthread_state_changed_callback *cb)
Register callbacks that will be called when a certain configuration or state changes occur within Ope...
void openthread_mutex_unlock(void)
Unlock internal mutex after accessing OpenThread API.
int openthread_init(void)
Initialize the OpenThread module.
struct otInstance * openthread_get_default_instance(void)
Get pointer to default OpenThread instance.
int openthread_run(void)
Run the OpenThread network.
void(* openthread_receive_cb)(struct otMessage *message, void *context)
The common callback type for receiving IPv4 (translated by NAT64) and IPv6 datagrams.
Definition openthread.h:27
k_tid_t openthread_thread_id_get(void)
Get OpenThread thread identification.
int openthread_mutex_try_lock(void)
Try to lock internal mutex before accessing OpenThread API.
void openthread_mutex_lock(void)
Lock internal mutex before accessing OpenThread API.
int openthread_state_changed_callback_unregister(struct openthread_state_changed_callback *cb)
Unregister OpenThread configuration or state changed callbacks.
int openthread_stop(void)
Disable the OpenThread network.
Thread Structure.
Definition thread.h:262
OpenThread state change callback
Definition openthread.h:40
sys_snode_t node
Internally used field for list handling.
Definition openthread.h:57
otStateChangedCallback otCallback
Callback for notifying configuration or state changes.
Definition openthread.h:48
void * user_data
User data if required.
Definition openthread.h:51