1 /* @file
2  * @brief Object Transfer client internal header file
3  *
4  * For use with the Object Transfer Service Client (OTC)
5  *
6  * Copyright (c) 2020 - 2022 Nordic Semiconductor ASA
7  *
8  * SPDX-License-Identifier: Apache-2.0
9  */
10 #ifndef BT_GATT_OTC_INTERNAL_H_
11 #define BT_GATT_OTC_INTERNAL_H_
12 
13 #include "ots_oacp_internal.h"
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 /** @brief Translate OTS OLCP result code to "normal" error
20  *
21  * Replace the OTS SUCCESS value with the value 0.
22  *
23  * The OLCP result code has the value "1" for success.
24  * Elsewhere in the le-audio host stack, "0" is used for no error.
25  *
26  * TODO: Update to also convert the non-SUCCESS values
27  * TODO: The macro is called OLCP, but uses OACP success value
28  * TODO: See https://github.com/zephyrproject-rtos/zephyr/issues/41184
29  * OTS does not use the value "0".
30  */
31 #define OLCP_RESULT_TO_ERROR(RESULT) \
32 	(((RESULT) == BT_GATT_OTS_OACP_RES_SUCCESS) ? 0 : RESULT)
33 
34 
35 #define OTS_FEATURE_LEN        (uint32_t)(2 * sizeof(uint32_t))
36 #define OTS_SIZE_LEN           (uint32_t)(2 * sizeof(uint32_t))
37 #define OTS_PROPERTIES_LEN     (uint32_t)(sizeof(uint32_t))
38 #define OTS_TYPE_MAX_LEN       (uint32_t)(sizeof(struct bt_ots_obj_type))
39 
40 #ifdef __cplusplus
41 }
42 #endif
43 
44 #endif /* BT_GATT_OTC_INTERNAL_H_ */
45