nRF Connect SDK API
3.4.99
Toggle main menu visibility
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
20
21
#ifdef __cplusplus
22
extern
"C"
{
23
#endif
24
28
enum
log_rpc_level
{
29
LOG_RPC_LEVEL_NONE
= 0,
30
LOG_RPC_LEVEL_ERR
,
31
LOG_RPC_LEVEL_WRN
,
32
LOG_RPC_LEVEL_INF
,
33
LOG_RPC_LEVEL_DBG
,
34
};
35
39
struct
nrf_rpc_crash_info
{
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
60
typedef
void (*
log_rpc_history_handler_t
)(
enum
log_rpc_level
level,
const
char
*msg,
61
size_t
msg_len);
62
69
typedef
void (*
log_rpc_history_threshold_reached_handler_t
)(void);
70
82
void
log_rpc_set_stream_level
(
enum
log_rpc_level
level);
83
96
void
log_rpc_set_history_level
(
enum
log_rpc_level
level);
97
105
uint8_t
log_rpc_get_history_usage_threshold
(
void
);
106
114
size_t
log_rpc_get_history_usage_current
(
void
);
115
123
size_t
log_rpc_get_history_usage_max
(
void
);
124
143
void
log_rpc_set_history_usage_threshold
(
log_rpc_history_threshold_reached_handler_t
handler,
144
uint8_t threshold);
145
163
int
log_rpc_fetch_history
(
log_rpc_history_handler_t
handler);
164
175
void
log_rpc_stop_fetch_history
(
bool
pause);
176
196
int
log_rpc_get_crash_dump
(
size_t
offset, uint8_t *buffer,
size_t
buffer_length);
197
208
int
log_rpc_invalidate_crash_dump
(
void
);
209
214
int
log_rpc_get_crash_info
(
struct
nrf_rpc_crash_info
*info);
215
226
void
log_rpc_echo
(
enum
log_rpc_level
level,
const
char
*message);
227
241
void
log_rpc_set_time
(uint64_t now_us);
242
243
#ifdef __cplusplus
244
}
245
#endif
246
250
251
#endif
/* LOG_RPC_H_ */
log_rpc_echo
void log_rpc_echo(enum log_rpc_level level, const char *message)
Generates a log message on the remote device.
log_rpc_set_stream_level
void log_rpc_set_stream_level(enum log_rpc_level level)
Sets the log streaming verbosity level.
log_rpc_set_history_level
void log_rpc_set_history_level(enum log_rpc_level level)
Sets the log history verbosity level.
log_rpc_set_history_usage_threshold
void log_rpc_set_history_usage_threshold(log_rpc_history_threshold_reached_handler_t handler, uint8_t threshold)
Sets the current history usage threshold.
log_rpc_get_history_usage_threshold
uint8_t log_rpc_get_history_usage_threshold(void)
Gets the current history usage threshold.
log_rpc_history_handler_t
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
log_rpc_invalidate_crash_dump
int log_rpc_invalidate_crash_dump(void)
Invalidates the crash dump saved on the remote device.
log_rpc_get_crash_dump
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
log_rpc_level
nRF RPC logging level.
Definition
log_rpc.h:28
LOG_RPC_LEVEL_WRN
@ LOG_RPC_LEVEL_WRN
Definition
log_rpc.h:31
LOG_RPC_LEVEL_DBG
@ LOG_RPC_LEVEL_DBG
Definition
log_rpc.h:33
LOG_RPC_LEVEL_NONE
@ LOG_RPC_LEVEL_NONE
Definition
log_rpc.h:29
LOG_RPC_LEVEL_ERR
@ LOG_RPC_LEVEL_ERR
Definition
log_rpc.h:30
LOG_RPC_LEVEL_INF
@ LOG_RPC_LEVEL_INF
Definition
log_rpc.h:32
log_rpc_get_history_usage_max
size_t log_rpc_get_history_usage_max(void)
Gets the maximum history size in bytes.
log_rpc_fetch_history
int log_rpc_fetch_history(log_rpc_history_handler_t handler)
Fetches the log history.
log_rpc_set_time
void log_rpc_set_time(uint64_t now_us)
Sets the current time used for log timestamping.
log_rpc_stop_fetch_history
void log_rpc_stop_fetch_history(bool pause)
Stops the log history transfer.
log_rpc_get_crash_info
int log_rpc_get_crash_info(struct nrf_rpc_crash_info *info)
Get crash dump summary.
log_rpc_history_threshold_reached_handler_t
void(* log_rpc_history_threshold_reached_handler_t)(void)
Log history threshold reached handler.
Definition
log_rpc.h:69
log_rpc_get_history_usage_current
size_t log_rpc_get_history_usage_current(void)
Gets the current history usage size in bytes.
nrf_rpc_crash_info::uuid
uint32_t uuid
Definition
log_rpc.h:40
nrf_rpc_crash_info::xpsr
uint32_t xpsr
Definition
log_rpc.h:45
nrf_rpc_crash_info::reason
uint16_t reason
Definition
log_rpc.h:41
nrf_rpc_crash_info::sp
uint32_t sp
Definition
log_rpc.h:44
nrf_rpc_crash_info::pc
uint32_t pc
Definition
log_rpc.h:42
nrf_rpc_crash_info::assert_line
uint32_t assert_line
Definition
log_rpc.h:46
nrf_rpc_crash_info::lr
uint32_t lr
Definition
log_rpc.h:43
nrf_rpc_crash_info::assert_filename
char assert_filename[CONFIG_LOG_BACKED_RPC_CRASH_INFO_FILENAME_SIZE]
Definition
log_rpc.h:47
nrf_rpc_crash_info
nRF RPC crash info.
Definition
log_rpc.h:39
include
logging
log_rpc.h
Generated on
for nRF Connect SDK API by
1.17.0