nRF Connect SDK API 0.1.0
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
176#define NRF_MODEM_LIB_ON_INIT(name, _callback, _context) \
177 static void _callback(int ret, void *ctx); \
178 STRUCT_SECTION_ITERABLE(nrf_modem_lib_init_cb, nrf_modem_hook_##name) = { \
179 .callback = _callback, \
180 .context = _context, \
181 };
182
192#define NRF_MODEM_LIB_ON_SHUTDOWN(name, _callback, _context) \
193 static void _callback(void *ctx); \
194 STRUCT_SECTION_ITERABLE(nrf_modem_lib_shutdown_cb, nrf_modem_hook_##name) = { \
195 .callback = _callback, \
196 .context = _context, \
197 };
198
206#define NRF_MODEM_LIB_ON_CFUN(name, _callback, _context) \
207 static void _callback(int mode, void *ctx); \
208 STRUCT_SECTION_ITERABLE(nrf_modem_lib_at_cfun_cb, nrf_modem_at_cfun_hook_##name) = { \
209 .callback = _callback, \
210 .context = _context, \
211 };
212
219void nrf_modem_fault_handler(struct nrf_modem_fault_info *fault_info);
220
221#if defined(CONFIG_NRF_MODEM_LIB_FAULT_STRERROR) || defined(__DOXYGEN__)
228const char *nrf_modem_lib_fault_strerror(int fault);
229#endif
230
231#if defined(CONFIG_NRF_MODEM_LIB_MEM_DIAG) || defined(__DOXYGEN__)
233 struct {
234 struct sys_memory_stats heap;
237 struct {
238 struct sys_memory_stats heap;
239 uint32_t failed_allocs;
241};
250#endif
251
254#ifdef __cplusplus
255}
256#endif
257
258#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:235
struct sys_memory_stats heap
Definition: nrf_modem_lib.h:234
struct nrf_modem_lib_diag_stats::@184 shmem
struct nrf_modem_lib_diag_stats::@183 library
Definition: nrf_modem_lib.h:232
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