nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches
nrf_modem_lib.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019-2023 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef NRF_MODEM_LIB_H_
8#define NRF_MODEM_LIB_H_
9
10#include <nrf_modem.h>
11#include <zephyr/kernel.h>
12
13#if CONFIG_NRF_MODEM_LIB_MEM_DIAG
14#include <zephyr/sys/sys_heap.h>
15#endif
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
57
82
91
101 void (*callback)(int dfu_res, void *ctx);
103 void *context;
104};
105
115 void (*callback)(int ret, void *ctx);
117 void *context;
118};
119
128 void (*callback)(void *ctx);
130 void *context;
131};
132
138 void (*callback)(int mode, void *ctx);
140 void *context;
141};
142
153#define NRF_MODEM_LIB_ON_DFU_RES(name, _callback, _context) \
154 static void _callback(int dfu_res, void *ctx); \
155 STRUCT_SECTION_ITERABLE(nrf_modem_lib_dfu_cb, nrf_modem_dfu_hook_##name) = { \
156 .callback = _callback, \
157 .context = _context, \
158 };
159
175#define NRF_MODEM_LIB_ON_INIT(name, _callback, _context) \
176 static void _callback(int ret, void *ctx); \
177 STRUCT_SECTION_ITERABLE(nrf_modem_lib_init_cb, nrf_modem_hook_##name) = { \
178 .callback = _callback, \
179 .context = _context, \
180 };
181
191#define NRF_MODEM_LIB_ON_SHUTDOWN(name, _callback, _context) \
192 static void _callback(void *ctx); \
193 STRUCT_SECTION_ITERABLE(nrf_modem_lib_shutdown_cb, nrf_modem_hook_##name) = { \
194 .callback = _callback, \
195 .context = _context, \
196 };
197
205#define NRF_MODEM_LIB_ON_CFUN(name, _callback, _context) \
206 static void _callback(int mode, void *ctx); \
207 STRUCT_SECTION_ITERABLE(nrf_modem_lib_at_cfun_cb, nrf_modem_at_cfun_hook_##name) = { \
208 .callback = _callback, \
209 .context = _context, \
210 };
211
218void nrf_modem_fault_handler(struct nrf_modem_fault_info *fault_info);
219
220#if defined(CONFIG_NRF_MODEM_LIB_FAULT_STRERROR) || defined(__DOXYGEN__)
227const char *nrf_modem_lib_fault_strerror(int fault);
228#endif
229
230#if defined(CONFIG_NRF_MODEM_LIB_MEM_DIAG) || defined(__DOXYGEN__)
232 struct {
233 struct sys_memory_stats heap;
236 struct {
237 struct sys_memory_stats heap;
238 uint32_t failed_allocs;
240};
249#endif
250
253#ifdef __cplusplus
254}
255#endif
256
257#endif /* NRF_MODEM_LIB_H_ */
int nrf_modem_lib_bootloader_init(void)
Initialize the Modem library in bootloader mode and turn on the modem.
int nrf_modem_lib_shutdown(void)
Shutdown the Modem library and turn off the modem.
int nrf_modem_lib_init(void)
Initialize the Modem library and turn on the modem.
int nrf_modem_lib_diag_stats_get(struct nrf_modem_lib_diag_stats *stats)
Retrieve heap runtime statistics.
const char * nrf_modem_lib_fault_strerror(int fault)
Retrieve a statically allocated textual description of a given fault.
void nrf_modem_fault_handler(struct nrf_modem_fault_info *fault_info)
Modem fault handler.
void(* callback)(int mode, void *ctx)
Definition nrf_modem_lib.h:138
void * context
Definition nrf_modem_lib.h:140
AT CFUN callback entry.
Definition nrf_modem_lib.h:136
void * context
Definition nrf_modem_lib.h:103
void(* callback)(int dfu_res, void *ctx)
Callback function.
Definition nrf_modem_lib.h:101
Modem library dfu callback struct.
Definition nrf_modem_lib.h:95
uint32_t failed_allocs
Definition nrf_modem_lib.h:234
struct nrf_modem_lib_diag_stats::@189 shmem
struct sys_memory_stats heap
Definition nrf_modem_lib.h:233
struct nrf_modem_lib_diag_stats::@188 library
Definition nrf_modem_lib.h:231
void(* callback)(int ret, void *ctx)
Callback function.
Definition nrf_modem_lib.h:115
void * context
Definition nrf_modem_lib.h:117
Modem library initialization callback struct.
Definition nrf_modem_lib.h:109
void(* callback)(void *ctx)
Callback function.
Definition nrf_modem_lib.h:128
void * context
Definition nrf_modem_lib.h:130
Modem library shutdown callback struct.
Definition nrf_modem_lib.h:123