MT2523 API Reference  LinkIt SDK v4
bt_gatts_service.h
1 /* Copyright Statement:
2  *
3  * (C) 2005-2016 MediaTek Inc. All rights reserved.
4  *
5  * This software/firmware and related documentation ("MediaTek Software") are
6  * protected under relevant copyright laws. The information contained herein
7  * is confidential and proprietary to MediaTek Inc. ("MediaTek") and/or its licensors.
8  * Without the prior written permission of MediaTek and/or its licensors,
9  * any reproduction, modification, use or disclosure of MediaTek Software,
10  * and information contained herein, in whole or in part, shall be strictly prohibited.
11  * You may only use, reproduce, modify, or distribute (as applicable) MediaTek Software
12  * if you have agreed to and been bound by the applicable license agreement with
13  * MediaTek ("License Agreement") and been granted explicit permission to do so within
14  * the License Agreement ("Permitted User"). If you are not a Permitted User,
15  * please cease any access or use of MediaTek Software immediately.
16  * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
17  * THAT MEDIATEK SOFTWARE RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES
18  * ARE PROVIDED TO RECEIVER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
19  * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
21  * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
22  * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
23  * SUPPLIED WITH MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
24  * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
25  * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
26  * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
27  * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
28  * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
29  * CUMULATIVE LIABILITY WITH RESPECT TO MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
30  * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE MEDIATEK SOFTWARE AT ISSUE,
31  * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
32  * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
33  */
34 
35 
36 #ifndef __BT_GATTS_SERVICE_H__
37 #define __BT_GATTS_SERVICE_H__
38 
79 #include <stdbool.h>
80 #include <stdint.h>
81 #include <stdio.h>
82 #include "bt_type.h"
83 
84 BT_EXTERN_C_BEGIN
85 
95 typedef struct
96 {
97  uint16_t min_conn_interval;
98  uint16_t max_conn_interval;
99  uint16_t slave_latency;
102 
106 /* --------------Extern Service --------------------- */
107 extern const bt_gatts_service_t bt_if_gatt_service; /*< GATT Service. */
108 extern const bt_gatts_service_t bt_if_gap_service; /*< GAP Service. */
109 
115 void bt_gatts_service_init(void);
116 
124 bt_status_t bt_gatts_service_set_gap_device_name(const uint8_t *device_name, uint16_t length);
125 
131 const uint8_t *bt_gatts_service_get_gap_device_name(void);
132 
138 void bt_gatts_service_set_gap_appearance(uint16_t appearance);
139 
148 
157 
158 
159 BT_EXTERN_C_END
160 
166 #endif /*__BT_GATTS_SERVICE_H__*/
167 
168 
const uint8_t * bt_gatts_service_get_gap_device_name(void)
This function gets the current Device Name Characteristic value.
The Peripheral Preferred Connection Parameters structure of the GAP service.
Definition: bt_gatts_service.h:95
uint16_t supervision_timeout
Connection Supervision Timeout in 10 ms units, value range: 0x000A to 0x0C80.
Definition: bt_gatts_service.h:100
bt_status_t bt_gatts_service_set_gap_ppcp(bt_gatts_le_gap_ppcp_t *ppcp_param)
This function sets Peripheral Preferred Connection Parameters Characteristic.
void bt_gatts_service_init(void)
This function initializes the GATTS service.
uint16_t slave_latency
Slave Latency in number of connection events, value range: 0x0000 to 0x03E8.
Definition: bt_gatts_service.h:99
bt_status_t bt_gatts_service_set_gap_central_address_resolution(uint8_t flag)
This function sets Central Address Resolution Characteristic.
int32_t bt_status_t
Define the status type, returned from the APIs, and defined as BT_STATUS_XXX.
Definition: bt_type.h:173
bt_status_t bt_gatts_service_set_gap_device_name(const uint8_t *device_name, uint16_t length)
This function sets Device Name Characteristic.
uint16_t max_conn_interval
Maximum Connection Interval in 1.25 ms units, value range: 0x0006 to 0x0C80.
Definition: bt_gatts_service.h:98
void bt_gatts_service_set_gap_appearance(uint16_t appearance)
This function sets Appearance Characteristic.
uint16_t min_conn_interval
Minimum Connection Interval in 1.25 ms units, value range: 0x0006 to 0x0C80.
Definition: bt_gatts_service.h:97
Service structure of the GATTS.
Definition: bt_gatts.h:245