nRF Connect SDK API 3.3.99
Loading...
Searching...
No Matches
log_rpc.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef LOG_RPC_H_
8#define LOG_RPC_H_
9
10#include <stdbool.h>
11#include <stddef.h>
12#include <stdint.h>
13
21#ifdef __cplusplus
22extern "C" {
23#endif
24
35
40 uint32_t uuid;
41 uint16_t reason;
42 uint32_t pc;
43 uint32_t lr;
44 uint32_t sp;
45 uint32_t xpsr;
46 uint32_t assert_line;
47 char assert_filename[CONFIG_LOG_BACKED_RPC_CRASH_INFO_FILENAME_SIZE];
48};
49
60typedef void (*log_rpc_history_handler_t)(enum log_rpc_level level, const char *msg,
61 size_t msg_len);
62
70
83
97
106
115
124
144 uint8_t threshold);
145
164
176
196int log_rpc_get_crash_dump(size_t offset, uint8_t *buffer, size_t buffer_length);
197
209
215
226void log_rpc_echo(enum log_rpc_level level, const char *message);
227
241void log_rpc_set_time(uint64_t now_us);
242
243#ifdef __cplusplus
244}
245#endif
246
251#endif /* LOG_RPC_H_ */
void log_rpc_echo(enum log_rpc_level level, const char *message)
Generates a log message on the remote device.
void log_rpc_set_stream_level(enum log_rpc_level level)
Sets the log streaming verbosity level.
void log_rpc_set_history_level(enum log_rpc_level level)
Sets the log history verbosity level.
void log_rpc_set_history_usage_threshold(log_rpc_history_threshold_reached_handler_t handler, uint8_t threshold)
Sets the current history usage threshold.
uint8_t log_rpc_get_history_usage_threshold(void)
Gets the current history usage threshold.
void(* log_rpc_history_handler_t)(enum log_rpc_level level, const char *msg, size_t msg_len)
Log history handler.
Definition log_rpc.h:60
int log_rpc_invalidate_crash_dump(void)
Invalidates the crash dump saved on the remote device.
int log_rpc_get_crash_dump(size_t offset, uint8_t *buffer, size_t buffer_length)
Retrieves the crash dump saved on the remote device.
log_rpc_level
nRF RPC logging level.
Definition log_rpc.h:28
@ LOG_RPC_LEVEL_WRN
Definition log_rpc.h:31
@ LOG_RPC_LEVEL_DBG
Definition log_rpc.h:33
@ LOG_RPC_LEVEL_NONE
Definition log_rpc.h:29
@ LOG_RPC_LEVEL_ERR
Definition log_rpc.h:30
@ LOG_RPC_LEVEL_INF
Definition log_rpc.h:32
size_t log_rpc_get_history_usage_max(void)
Gets the maximum history size in bytes.
int log_rpc_fetch_history(log_rpc_history_handler_t handler)
Fetches the log history.
void log_rpc_set_time(uint64_t now_us)
Sets the current time used for log timestamping.
void log_rpc_stop_fetch_history(bool pause)
Stops the log history transfer.
int log_rpc_get_crash_info(struct nrf_rpc_crash_info *info)
Get crash dump summary.
void(* log_rpc_history_threshold_reached_handler_t)(void)
Log history threshold reached handler.
Definition log_rpc.h:69
size_t log_rpc_get_history_usage_current(void)
Gets the current history usage size in bytes.
uint32_t uuid
Definition log_rpc.h:40
uint32_t xpsr
Definition log_rpc.h:45
uint16_t reason
Definition log_rpc.h:41
uint32_t sp
Definition log_rpc.h:44
uint32_t pc
Definition log_rpc.h:42
uint32_t assert_line
Definition log_rpc.h:46
uint32_t lr
Definition log_rpc.h:43
char assert_filename[CONFIG_LOG_BACKED_RPC_CRASH_INFO_FILENAME_SIZE]
Definition log_rpc.h:47
nRF RPC crash info.
Definition log_rpc.h:39