Line data Source code
1 1 : /*
2 : * Copyright (c) 2023 Victor Chavez
3 : *
4 : * SPDX-License-Identifier: Apache-2.0
5 : */
6 :
7 : /**
8 : * @file
9 : * @brief Header file for the Bluetooth log backend API
10 : * @ingroup log_backend_ble
11 : */
12 :
13 : #ifndef ZEPHYR_LOG_BACKEND_BLE_H_
14 : #define ZEPHYR_LOG_BACKEND_BLE_H_
15 :
16 : /**
17 : * @brief Bluetooth log backend API
18 : * @defgroup log_backend_ble Bluetooth log backend API
19 : * @ingroup log_backend
20 : * @{
21 : */
22 :
23 : #include <stdbool.h>
24 : /**
25 : * @brief Raw adv UUID data to add the Bluetooth backend for the use with apps
26 : * such as the NRF Toolbox
27 : *
28 : */
29 :
30 1 : #define LOGGER_BACKEND_BLE_ADV_UUID_DATA \
31 : 0x9E, 0xCA, 0xDC, 0x24, 0x0E, 0xE5, 0xA9, 0xE0, 0x93, 0xF3, 0xA3, 0xB5, 0x01, 0x00, 0x40, \
32 : 0x6E
33 :
34 : /**
35 : * @brief Hook for application to know when the Bluetooth backend
36 : * is enabled or disabled.
37 : * @param backend_status True if the backend is enabled or false if disabled
38 : * @param ctx User context
39 : *
40 : */
41 1 : typedef void (*logger_backend_ble_hook)(bool backend_status, void *ctx);
42 :
43 : /**
44 : * @brief Allows application to add a hook for the status of the Bluetooth
45 : * logger backend.
46 : * @details The Bluetooth logger backend is enabled or disabled auomatically by
47 : * the subscription of the notification characteristic of this Bluetooth
48 : * Logger backend service.
49 : *
50 : * @param hook The hook that will be called when the status of the backend changes
51 : * @param ctx User context for whenever the hook is called
52 : */
53 1 : void logger_backend_ble_set_hook(logger_backend_ble_hook hook, void *ctx);
54 :
55 : /** @} */
56 :
57 : #endif /* ZEPHYR_LOG_BACKEND_BLE_H_ */
|