-
Notifications
You must be signed in to change notification settings - Fork 3
/
cy_ble_ndcs.h
138 lines (108 loc) · 4.43 KB
/
cy_ble_ndcs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/***************************************************************************//**
* \file cy_ble_ndcs.h
* \version 3.60
*
* \brief
* Contains the function prototypes and constants for Next DST Change
* service.
*
********************************************************************************
* \copyright
* Copyright 2017-2021, Cypress Semiconductor Corporation. All rights reserved.
* You may use this file only in accordance with the license, terms, conditions,
* disclaimers, and limitations in the end user license agreement accompanying
* the software package with which this file was provided.
*******************************************************************************/
#ifndef CY_BLE_NDCS_H
#define CY_BLE_NDCS_H
#include "cy_ble.h"
#if defined(CY_IP_MXBLESS)
/* C binding of definitions if building with C++ compiler */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*******************************************************************************
* Data Types
*******************************************************************************/
/**
* \addtogroup group_ble_service_api_NDCS_definitions
* \{
*/
/** Characteristic indexes */
typedef enum
{
CY_BLE_NDCS_TIME_WITH_DST, /**< Time with DST Characteristic index */
CY_BLE_NDCS_CHAR_COUNT /**< Total Count of NDCS Characteristics */
} cy_en_ble_ndcs_char_index_t;
/** Next DST Change Service Characteristic Value parameter structure */
typedef struct
{
cy_stc_ble_conn_handle_t connHandle; /**< Peer Device Handle */
cy_en_ble_ndcs_char_index_t charIndex; /**< Index of Next DST Change Service Characteristic */
cy_stc_ble_gatt_value_t *value; /**< Characteristic Value */
} cy_stc_ble_ndcs_char_value_t;
/** Structure with Next DST Change Service Characteristic attribute handles */
typedef struct
{
cy_ble_gatt_db_attr_handle_t serviceHandle; /**< Handle of the Next DST Change Service */
cy_ble_gatt_db_attr_handle_t timeWithDst; /**< Handle of the Time with DST Characteristic */
} cy_stc_ble_ndcss_t;
/** Structure with Discovered Attributes Information of Next DST Change Service */
typedef struct
{
/** Characteristic handle and properties */
cy_stc_ble_srvr_char_info_t charInfo[CY_BLE_NDCS_CHAR_COUNT];
} cy_stc_ble_ndcsc_t;
/** Service configuration structure (server) */
typedef struct
{
/** Service GATT DB Handles structure */
const cy_stc_ble_ndcss_t *attrInfo;
} cy_stc_ble_ndcss_config_t;
/** Service Configuration structure (client) */
typedef struct
{
/** Structure with Discovered Attributes Information */
cy_stc_ble_ndcsc_t *attrInfo;
/** The Discovery Service index */
uint8_t serviceDiscIdx;
} cy_stc_ble_ndcsc_config_t;
/** \} */
/*******************************************************************************
* Function Prototypes
*******************************************************************************/
/**
* \addtogroup group_ble_service_api_NDCS_server_client
* \{
*/
cy_en_ble_api_result_t Cy_BLE_NDCSS_Init(const cy_stc_ble_ndcss_config_t *config);
cy_en_ble_api_result_t Cy_BLE_NDCSC_Init(const cy_stc_ble_ndcsc_config_t *config);
void Cy_BLE_NDCS_RegisterAttrCallback(cy_ble_callback_t callbackFunc);
/** \} */
/**
* \addtogroup group_ble_service_api_NDCS_server
* \{
*/
cy_en_ble_api_result_t Cy_BLE_NDCSS_SetCharacteristicValue(cy_en_ble_ndcs_char_index_t charIndex, uint8_t attrSize,
uint8_t *attrValue);
cy_en_ble_api_result_t Cy_BLE_NDCSS_GetCharacteristicValue(cy_en_ble_ndcs_char_index_t charIndex, uint8_t attrSize,
uint8_t *attrValue);
/** \} */
/**
* \addtogroup group_ble_service_api_NDCS_client
* \{
*/
cy_en_ble_api_result_t Cy_BLE_NDCSC_GetCharacteristicValue(cy_stc_ble_conn_handle_t connHandle,
cy_en_ble_ndcs_char_index_t charIndex);
/** \} */
/*******************************************************************************
* External Data references
*******************************************************************************/
extern const cy_stc_ble_ndcss_config_t *cy_ble_ndcssConfigPtr;
extern const cy_stc_ble_ndcsc_config_t *cy_ble_ndcscConfigPtr;
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* CY_IP_MXBLESS */
#endif /* CY_BLE_NDCS_H */
/* [] END OF FILE */