Line data Source code
1 1 : /*
2 : * Copyright (c) 2024 Nordic Semiconductor ASA
3 : *
4 : * SPDX-License-Identifier: Apache-2.0
5 : */
6 :
7 : /**
8 : * @file
9 : * @brief Header file for the websocket log backend API
10 : * @ingroup log_backend_ws
11 : */
12 :
13 : #ifndef ZEPHYR_LOG_BACKEND_WS_H_
14 : #define ZEPHYR_LOG_BACKEND_WS_H_
15 :
16 : /**
17 : * @brief Websocket log backend API
18 : * @defgroup log_backend_ws Websocket log backend API
19 : * @ingroup log_backend
20 : * @{
21 : */
22 :
23 : #include <stdbool.h>
24 :
25 : #ifdef __cplusplus
26 : extern "C" {
27 : #endif
28 :
29 : /**
30 : * @brief Register websocket socket where the logging output is sent.
31 : *
32 : * @param fd Websocket socket value.
33 : *
34 : * @return 0 if ok, <0 if error
35 : */
36 1 : int log_backend_ws_register(int fd);
37 :
38 : /**
39 : * @brief Unregister websocket socket where the logging output was sent.
40 : *
41 : * @details After this the websocket output is disabled.
42 : *
43 : * @param fd Websocket socket value.
44 : *
45 : * @return 0 if ok, <0 if error
46 : */
47 1 : int log_backend_ws_unregister(int fd);
48 :
49 : /**
50 : * @brief Get the websocket logger backend
51 : *
52 : * @details This function returns the websocket logger backend.
53 : *
54 : * @return Pointer to the websocket logger backend.
55 : */
56 1 : const struct log_backend *log_backend_ws_get(void);
57 :
58 : /**
59 : * @brief Start the websocket logger backend
60 : *
61 : * @details This function starts the websocket logger backend.
62 : */
63 1 : void log_backend_ws_start(void);
64 :
65 : #ifdef __cplusplus
66 : }
67 : #endif
68 :
69 : /** @} */
70 :
71 : #endif /* ZEPHYR_LOG_BACKEND_WS_H_ */
|