ras.h
Go to the documentation of this file.
1 /**
2 *****************************************************************************************
3 *
4 * @file ras.h
5 *
6 * @brief Ranging Service API
7 *
8 *****************************************************************************************
9 * @attention
10 #####Copyright (c) 2024 GOODIX
11 All rigras reserved.
12
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15 * Redistributions of source code must retain the above copyright
16 notice, this list of conditions and the following disclaimer.
17 * Redistributions in binary form must reproduce the above copyright
18 notice, this list of conditions and the following disclaimer in the
19 documentation and/or other materials provided with the distribution.
20 * Neither the name of GOODIX nor the names of its contributors may be used
21 to endorse or promote products derived from this software without
22 specific prior written permission.
23
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35 *****************************************************************************************
36 */
37
38 #ifndef __RAS_H__
39 #define __RAS_H__
40
41 #include "gr_includes.h"
42 #include "custom_config.h"
43 #include "ble_prf_utils.h"
44 #include "ras_common.h"
45 #include <stdint.h>
46 #include <stdbool.h>
47
48 #ifdef __cplusplus
49 extern "C"
50 {
51 #endif /* __cplusplus */
52
53 /**
54 *****************************************************************************************
55 * @brief Initialize Ranging Service.
56 *
57 * @param[in] features: Ranging Service support features, bit mask @ref ras_fea_bit_mask_t.
58 *
59 * @return Result of service initialization.
60 *****************************************************************************************
61 */
62 sdk_err_t ras_service_init(uint32_t features);
63
64 /**
65 *****************************************************************************************
66 * @brief Handle for the connection event.
67 *
68 * @param[in] conn_idx: Connection index.
69 *
70 *****************************************************************************************
71 */
72 void ras_connect_handler(uint8_t conn_idx);
73
74 /**
75 *****************************************************************************************
76 * @brief Handle for the disconnection event.
77 *
78 * @param[in] conn_idx: Connection index.
79 *
80 *****************************************************************************************
81 */
82 void ras_disconnect_handler(uint8_t conn_idx);
83
84 /**
85 *****************************************************************************************
86 * @brief Handle for the mtu exchange event.
87 *
88 * @param[in] conn_idx: Connection index.
89 * @param[in] mtu: exchange mtu value.
90 *
91 *****************************************************************************************
92 */
93 void ras_mtu_exch_handler(uint8_t conn_idx, uint16_t mtu);
94
95 /**
96 *****************************************************************************************
97 * @brief Handle for receiving subevt data.
98 *
99 * @param[in] conn_idx: Connection index.
100 * @param[in] p_data: Pointer to the data buffer.
101 *
102 *****************************************************************************************
103 */
104 void ras_rcv_subevt_data_handler(uint8_t conn_idx, uint8_t *p_data);
105
106 #ifdef __cplusplus
107 }
108 #endif /* __cplusplus */
109
110 #endif
111
gr_includes.h
Include Files API.
ras_mtu_exch_handler
void ras_mtu_exch_handler(uint8_t conn_idx, uint16_t mtu)
Handle for the mtu exchange event.
ras_common.h
ras_disconnect_handler
void ras_disconnect_handler(uint8_t conn_idx)
Handle for the disconnection event.
ras_connect_handler
void ras_connect_handler(uint8_t conn_idx)
Handle for the connection event.
ras_rcv_subevt_data_handler
void ras_rcv_subevt_data_handler(uint8_t conn_idx, uint8_t *p_data)
Handle for receiving subevt data.
sdk_err_t
uint16_t sdk_err_t
SDK API result type.
Definition: ble_error.h:273
ble_prf_utils.h
Profile/Service Utilities API.
ras_service_init
sdk_err_t ras_service_init(uint32_t features)
Initialize Ranging Service.