MT2523 API Reference  LinkIt SDK v4
bt_gatts.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 #ifndef __BT_GATTS_H__
36 #define __BT_GATTS_H__
37 
38 #include "bt_debug.h"
39 #include "bt_uuid.h"
40 #include "bt_gattc.h"
41 #include "bt_gatt.h"
42 
43 BT_EXTERN_C_BEGIN
167 #define BT_GATTS_REC_PERM_READ_SHIFT(mask) ((mask)<<4)
168 #define BT_GATTS_REC_PERM_WRITE_SHIFT(mask) ((mask)<<0)
169 #define BT_GATTS_REC_PERM_READ_MASK 0xf0
170 #define BT_GATTS_REC_PERM_READABLE 0x80
171 #define BT_GATTS_REC_PERM_READABLE_ENCRYPTION (BT_GATTS_REC_PERM_READABLE | (BT_GATTS_REC_PERM_READ_SHIFT(BT_GAP_LE_SECURITY_ENCRYPTION_MASK)))
172 #define BT_GATTS_REC_PERM_READABLE_AUTHENTICATION (BT_GATTS_REC_PERM_READABLE | (BT_GATTS_REC_PERM_READ_SHIFT(BT_GAP_LE_SECURITY_AUTHENTICATION_MASK)))
173 #define BT_GATTS_REC_PERM_READABLE_AUTHORIZATION (BT_GATTS_REC_PERM_READABLE | (BT_GATTS_REC_PERM_READ_SHIFT(BT_GAP_LE_SECURITY_AUTHORIZATION_MASK)))
174 #define BT_GATTS_IS_READABLE(perm) (((perm) & BT_GATTS_REC_PERM_READ_MASK)> 0)
175 #define BT_GATTS_REC_PERM_WRITE_MASK 0x0f
176 #define BT_GATTS_REC_PERM_WRITABLE 0x08
177 #define BT_GATTS_REC_PERM_WRITABLE_ENCRYPTION (BT_GATTS_REC_PERM_WRITABLE | (BT_GATTS_REC_PERM_WRITE_SHIFT(BT_GAP_LE_SECURITY_ENCRYPTION_MASK)))
178 #define BT_GATTS_REC_PERM_WRITABLE_AUTHENTICATION (BT_GATTS_REC_PERM_WRITABLE | (BT_GATTS_REC_PERM_WRITE_SHIFT(BT_GAP_LE_SECURITY_AUTHENTICATION_MASK)))
179 #define BT_GATTS_REC_PERM_WRITABLE_AUTHORIZATION (BT_GATTS_REC_PERM_WRITABLE | (BT_GATTS_REC_PERM_WRITE_SHIFT(BT_GAP_LE_SECURITY_AUTHORIZATION_MASK)))
180 #define BT_GATTS_IS_WRITABLE(perm) (((perm) & BT_GATTS_REC_PERM_WRITE_MASK)> 0)
181 /* #bt_atts_rec_perm_t format:
182  * 7 6 5 4 3 2 1 0
183  * [R][R_Encryption][R_Authentication][R_Authorization][W][W_Encryption][W_Authentication][W_Authorization] */
184 #define BT_GATTS_CALLBACK_READ 0
185 #define BT_GATTS_CALLBACK_WRITE 1
186 #define BT_GATTS_CALLBACK_PREPARE_WRITE 2
187 /* Please don't change sequence of #BT_GATTS_CALLBACK_EXECUTE_WRITE_CANCEL & #BT_GATTS_CALLBACK_EXECUTE_WRITE_WRITE */
188 #define BT_GATTS_CALLBACK_EXECUTE_WRITE_CANCEL 3
189 #define BT_GATTS_CALLBACK_EXECUTE_WRITE_WRITE 4
191 /* -------------Execute write status------------- */
192 /* The status should be one of BT_ATT_ERRCODE */
193 #define BT_GATTS_EXECUTE_WRITE_RLT_SET(handle, status) (((handle)<<8)|(status))
194 #define BT_GATTS_EXECUTE_WRITE_RLT_GET_HANDLE(s) (((s)>>8)&0xFFFF)
195 #define BT_GATTS_EXECUTE_WRITE_RLT_GET_STATUS(s) ((s)&0xFF)
199 typedef uint8_t bt_atts_rec_perm_t;
201 /* --------------Extern UUID --------------------- */
205 extern const bt_uuid_t BT_GATT_UUID_CHARC;
213 /* -------- Callback format ------ */
226 typedef uint32_t (*bt_gatts_rec_callback_t) (const uint8_t rw, uint16_t handle, void *data, uint16_t size, uint16_t offset);
235 typedef struct {
238  uint8_t value_len;
240 
241 /* -------- Service ---------------------------- */
245 typedef struct {
246  uint16_t starting_handle;
247  uint16_t ending_handle;
251 
255 typedef struct {
256  uint16_t handle;
257  uint8_t flag;
259 
263 BT_PACKED (
264 typedef struct {
265  uint8_t read_write;
266  uint16_t attribute_handle;
267  uint16_t connection_handle;
269 
273 BT_PACKED(
274 typedef struct {
275  uint16_t service_handle;
276  uint16_t end_group_handle;
277  uint16_t uuid16;
279 
283 BT_PACKED(
284 typedef struct {
285  uint8_t properties;
286  uint16_t handle;
287  uint16_t uuid16;
289 
293 BT_PACKED(
294 typedef struct {
295  uint8_t properties;
296  uint16_t handle;
297  bt_uuid_t uuid128;
299 
303 BT_PACKED(
304 typedef struct {
305  BT_PACKED(
306  union{
307  /* Other type will use callback instead. */
308  uint8_t value_uint_8;
309  uint16_t value_uint_16;
310  uint32_t value_uint_32;
311  int8_t value_int_8;
312  int16_t value_int_16;
313  int32_t value_int_32;
314  bt_gatts_rec_callback_t callback;
315  });
317 
321 BT_PACKED(
322 typedef struct {
323  uint8_t format;
324  uint8_t exponent;
325  uint16_t unit;
326  uint8_t name_space;
327  uint16_t description;
329 
333 typedef struct {
334  // Permission: #BT_GATTS_REC_PERM_READABLE
336  uint16_t uuid16;
338 
343 
347 typedef struct {
348  // Permission: #BT_GATTS_REC_PERM_READABLE
352 
357 
361 typedef struct {
362  // Permission: #BT_GATTS_REC_PERM_READABLE
366 
370 typedef struct {
371  // Permission: #BT_GATTS_REC_PERM_READABLE
375 
379 typedef struct {
380  // Permission: #BT_GATTS_REC_PERM_READABLE
384 
388 typedef struct {
389  // Permission: Application define
393 
397 typedef struct {
398  // Permission: Application define
400  uint8_t str[16];
402 
406 typedef struct {
407  // Permission: Application define
409  uint16_t halfw[8];
411 
415 typedef struct {
416  // Permission: #BT_GATTS_REC_PERM_READABLE
420 
424 typedef struct {
425  // Permission: Application define
429 
434 
438 typedef struct {
439  // Permission: #BT_GATTS_REC_PERM_READABLE | Application define write.
443 
448 
452 typedef struct {
453  // Permission: #BT_GATTS_REC_PERM_READABLE
457 
461 typedef struct {
462  // Permission: #BT_GATTS_REC_PERM_READABLE
464  uint16_t handle_list[8];
481 #define BT_GATTS_NEW_PRIMARY_SERVICE_16(name, uuid16_value) \
482  static const bt_gatts_primary_service_16_t name = { \
483  .rec_hdr.uuid_ptr = &BT_GATT_UUID_PRIMARY_SERVICE, \
484  .rec_hdr.perm = BT_GATTS_REC_PERM_READABLE, \
485  .rec_hdr.value_len = 2, \
486  .uuid16 = uuid16_value \
487  }
488 
494 #define BT_GATTS_NEW_PRIMARY_SERVICE_128(name, uuid128_value) \
495  static const bt_gatts_primary_service_128_t name = { \
496  .rec_hdr.uuid_ptr = &BT_GATT_UUID_PRIMARY_SERVICE, \
497  .rec_hdr.perm = BT_GATTS_REC_PERM_READABLE, \
498  .rec_hdr.value_len = 16, \
499  .uuid128 = uuid128_value \
500  }
501 
507 #define BT_GATTS_NEW_SECONDARY_SERVICE_16(name, uuid16_value) \
508  static const bt_gatts_secondary_service_16_t name = { \
509  .rec_hdr.uuid_ptr = &BT_GATT_UUID_SECONDARY_SERVICE, \
510  .rec_hdr.perm = BT_GATTS_REC_PERM_READABLE, \
511  .rec_hdr.value_len = 2, \
512  .uuid16 = uuid16_value \
513  }
514 
520 #define BT_GATTS_NEW_SECONDARY_SERVICE_128(name, uuid128_value) \
521  static const bt_gatts_secondary_service_128_t name = { \
522  .rec_hdr.uuid_ptr = &BT_GATT_UUID_SECONDARY_SERVICE, \
523  .rec_hdr.perm = BT_GATTS_REC_PERM_READABLE, \
524  .rec_hdr.value_len = 16, \
525  .uuid128 = uuid128_value \
526  }
527 
535 #define BT_GATTS_NEW_INCLUDED_SERVICE_16(name, s_handle, e_handle, uuid) \
536  static const bt_gatts_included_service_t name = { \
537  .rec_hdr.uuid_ptr = &BT_GATT_UUID_INCLUDED_SERVICE, \
538  .rec_hdr.perm = BT_GATTS_REC_PERM_READABLE, \
539  .rec_hdr.value_len = 6, \
540  .value.service_handle = s_handle, \
541  .value.end_group_handle = e_handle, \
542  .value.uuid16 = uuid \
543  }
544 
551 #define BT_GATTS_NEW_INCLUDED_SERVICE_128(name, s_handle, e_handle) \
552  static const bt_gatts_included_service_t name = { \
553  .rec_hdr.uuid_ptr = &BT_GATT_UUID_INCLUDED_SERVICE, \
554  .rec_hdr.perm = BT_GATTS_REC_PERM_READABLE, \
555  .rec_hdr.value_len = 4, \
556  .value.service_handle = s_handle, \
557  .value.end_group_handle = e_handle, \
558  .value.uuid16 =0x0000 \
559  }
560 
568 #define BT_GATTS_NEW_CHARC_16(name, prop, _handle, uuid) \
569  static const bt_gatts_characteristic_16_t name = { \
570  .rec_hdr.uuid_ptr = &BT_GATT_UUID_CHARC, \
571  .rec_hdr.perm = BT_GATTS_REC_PERM_READABLE, \
572  .rec_hdr.value_len = 5, \
573  .value.properties = prop, \
574  .value.handle = _handle, \
575  .value.uuid16 = uuid \
576  }
577 
585 #define BT_GATTS_NEW_CHARC_16_WRITABLE(name, prop, _handle, uuid) \
586  static bt_gatts_characteristic_16_t name = { \
587  .rec_hdr.uuid_ptr = &BT_GATT_UUID_CHARC, \
588  .rec_hdr.perm = BT_GATTS_REC_PERM_READABLE, \
589  .rec_hdr.value_len = 5, \
590  .value.properties = prop, \
591  .value.handle = _handle, \
592  .value.uuid16 = uuid \
593  }
594 
602 #define BT_GATTS_NEW_CHARC_128(name, prop, _handle, uuid) \
603  static const bt_gatts_characteristic_128_t name = { \
604  .rec_hdr.uuid_ptr = &BT_GATT_UUID_CHARC, \
605  .rec_hdr.perm = BT_GATTS_REC_PERM_READABLE, \
606  .rec_hdr.value_len = 19, \
607  .value.properties = prop, \
608  .value.handle = _handle, \
609  .value.uuid128 = uuid \
610  }
611 
619 #define BT_GATTS_NEW_CHARC_VALUE_UINT8(name, uuid, _perm, _value) \
620  static const bt_gatts_characteristic_t name = { \
621  .rec_hdr.uuid_ptr = &uuid, \
622  .rec_hdr.perm = _perm, \
623  .rec_hdr.value_len = 1, \
624  .value.value_uint_8 = _value \
625  }
626 
634 #define BT_GATTS_NEW_CHARC_VALUE_UINT8_WRITABLE(name, uuid, _perm, _value) \
635  static bt_gatts_characteristic_t name = { \
636  .rec_hdr.uuid_ptr = &uuid, \
637  .rec_hdr.perm = _perm, \
638  .rec_hdr.value_len = 1, \
639  .value.value_uint_8 = _value \
640  }
641 
649 #define BT_GATTS_NEW_CHARC_VALUE_UINT16(name, uuid, _perm, _value) \
650  static const bt_gatts_characteristic_t name = { \
651  .rec_hdr.uuid_ptr = &uuid, \
652  .rec_hdr.perm = _perm, \
653  .rec_hdr.value_len = 2, \
654  .value.value_uint_16 = _value \
655  }
656 
664 #define BT_GATTS_NEW_CHARC_VALUE_UINT32(name, uuid, _perm, _value) \
665  static const bt_gatts_characteristic_t name = { \
666  .rec_hdr.uuid_ptr = &uuid, \
667  .rec_hdr.perm = _perm, \
668  .rec_hdr.value_len = 4, \
669  .value.value_uint_32 = _value \
670  }
671 
679 #define BT_GATTS_NEW_CHARC_VALUE_UINT32_WRITABLE(name, uuid, _perm, _value) \
680  static bt_gatts_characteristic_t name = { \
681  .rec_hdr.uuid_ptr = &uuid, \
682  .rec_hdr.perm = _perm, \
683  .rec_hdr.value_len = 4, \
684  .value.value_uint_32 = _value \
685  }
686 
694 #define BT_GATTS_NEW_CHARC_VALUE_INT8(name, uuid, _perm, _value) \
695  static const bt_gatts_characteristic_t name = { \
696  .rec_hdr.uuid_ptr = &uuid, \
697  .rec_hdr.perm = _perm, \
698  .rec_hdr.value_len = 1, \
699  .value.value_int_8 = _value \
700  }
701 
709 #define BT_GATTS_NEW_CHARC_VALUE_INT16(name, uuid, _perm, _value) \
710  static const bt_gatts_characteristic_t name = { \
711  .rec_hdr.uuid_ptr = &uuid, \
712  .rec_hdr.perm = _perm, \
713  .rec_hdr.value_len = 2, \
714  .value.value_int_16 = _value \
715  }
716 
724 #define BT_GATTS_NEW_CHARC_VALUE_INT32(name, uuid, _perm, _value) \
725  static const bt_gatts_characteristic_t name = { \
726  .rec_hdr.uuid_ptr = &uuid, \
727  .rec_hdr.perm = _perm, \
728  .rec_hdr.value_len = 4, \
729  .value.value_int_32 = _value \
730  }
731 
739 #define BT_GATTS_NEW_CHARC_VALUE_CALLBACK(name, uuid, _perm, call) \
740  static const bt_gatts_characteristic_t name = { \
741  .rec_hdr.uuid_ptr = &uuid, \
742  .rec_hdr.perm = _perm, \
743  .rec_hdr.value_len = 0, \
744  .value.callback = call \
745  }
746 
754 #define BT_GATTS_NEW_CHARC_VALUE_CALLBACK_WRITABLE(name, uuid, _perm, call) \
755  static bt_gatts_characteristic_t name = { \
756  .rec_hdr.uuid_ptr = &uuid, \
757  .rec_hdr.perm = _perm, \
758  .rec_hdr.value_len = 0, \
759  .value.callback = call \
760  }
761 
771 #define BT_GATTS_NEW_CHARC_VALUE_STR16(name, uuid, _perm, val_len, val_name) \
772  static const bt_gatts_characteristic_str16_t name = { \
773  .rec_hdr.uuid_ptr = &uuid, \
774  .rec_hdr.perm = _perm, \
775  .rec_hdr.value_len = val_len, \
776  .str = val_name \
777  }
778 
786 #define BT_GATTS_NEW_CHARC_VALUE_HALFW8_WRITABLE(name, uuid, _perm, val_len,...) \
787  static bt_gatts_characteristic_halfw8_t name = { \
788  .rec_hdr.uuid_ptr = &uuid, \
789  .rec_hdr.perm = _perm, \
790  .rec_hdr.value_len = val_len, \
791  .halfw = {__VA_ARGS__} \
792  }
793 
799 #define BT_GATTS_NEW_CHARC_EXTENDED_PROPERTIES(name, ext_prop) \
800  static const bt_gatts_characteristic_extended_properties_t name = { \
801  .rec_hdr.uuid_ptr = &BT_GATT_UUID_CHARC_EXTENDED_PROPERTIES, \
802  .rec_hdr.perm = BT_GATTS_REC_PERM_READABLE, \
803  .rec_hdr.value_len = 2, \
804  .extended_properties = ext_prop \
805  }
806 
815 #define BT_GATTS_NEW_CHARC_USER_DESCRIPTION_STR16(name, _perm, val_len, val_name) \
816  static const bt_gatts_characteristic_user_description_str16_t name = { \
817  .rec_hdr.uuid_ptr = &BT_GATT_UUID_CHARC_USER_DESCRIPTION, \
818  .rec_hdr.perm = _perm, \
819  .rec_hdr.value_len = val_len, \
820  .str = val_name \
821  }
822 
829 #define BT_GATTS_NEW_CHARC_USER_DESCRIPTION(name, _perm, _callback) \
830  static const bt_gatts_characteristic_user_description_t name = { \
831  .rec_hdr.uuid_ptr = &BT_GATT_UUID_CHARC_USER_DESCRIPTION, \
832  .rec_hdr.perm = _perm, \
833  .rec_hdr.value_len = 0, \
834  .callback = _callback \
835  }
836 
843 #define BT_GATTS_NEW_CLIENT_CHARC_CONFIG(name, _perm, _callback) \
844  static const bt_gatts_client_characteristic_config_t name = { \
845  .rec_hdr.uuid_ptr = &BT_GATT_UUID_CLIENT_CHARC_CONFIG, \
846  .rec_hdr.perm = _perm, \
847  .rec_hdr.value_len = 0, \
848  .callback = _callback \
849  }
850 
857 #define BT_GATTS_NEW_SERVER_CHARC_CONFIG(name, _perm, _callback) \
858  static const bt_gatts_server_characteristic_config_t name = { \
859  .rec_hdr.uuid_ptr = &BT_GATT_UUID_SERVER_CHARC_CONFIG, \
860  .rec_hdr.perm = _perm, \
861  .rec_hdr.value_len = 0, \
862  .callback = _callback \
863  }
864 
874 #define BT_GATTS_NEW_CHARC_FORMAT(name, _format, _exponent, _unit, _name_space, _description) \
875  static const bt_gatts_characteristic_format_t name = { \
876  .rec_hdr.uuid_ptr = &BT_GATT_UUID_CHARC_FORMAT, \
877  .rec_hdr.perm = BT_GATTS_REC_PERM_READABLE, \
878  .rec_hdr.value_len = 7, \
879  .value.format = _format, \
880  .value.exponent = _exponent, \
881  .value.unit = _unit, \
882  .value.name_space = _name_space, \
883  .value.description = _description \
884  }
885 
893 #define BT_GATTS_NEW_CHARC_AGGREGATE_FORMAT_H8(name, _perm, val_len,...) \
894  static const bt_gatts_characteristic_aggregate_format_t name = { \
895  .rec_hdr.uuid_ptr = &BT_GATT_UUID_CHARC_AGGREGATE_FORMAT, \
896  .rec_hdr.perm = _perm, \
897  .rec_hdr.value_len = val_len, \
898  .handle_list = {__VA_ARGS__} \
899  }
900 
910 
921  bt_handle_t connection_handle,
928 bt_status_t bt_gatts_set_max_mtu(uint16_t max_mtu);
929 
936 
947 BT_EXTERN_C_END
948 #endif /*__BT_GATTS_H__*/
16-bit primary service structure of the GATTS.
Definition: bt_gatts.h:333
const bt_uuid_t BT_GATT_UUID_INCLUDED_SERVICE
UUID for GATT included service.
uint16_t handle
The connection handle.
Definition: bt_gatts.h:256
uint16_t extended_properties
The extended properties of the characteristic descriptor.
Definition: bt_gatts.h:418
Characteristic aggregate format descriptor structure of the GATTS.
Definition: bt_gatts.h:461
Characteristic structure of the GATTS.
Definition: bt_gatts.h:388
const bt_uuid_t * uuid_ptr
A pointer to the UUID of attribute type.
Definition: bt_gatts.h:236
bt_gatts_characteristic_value_t value
The value of the characteristic.
Definition: bt_gatts.h:391
bt_gatts_service_rec_t rec_hdr
The record, which is the basic element of a service or characteristic.
Definition: bt_gatts.h:440
const bt_gatts_service_t ** bt_get_gatt_server(void)
This function is a callback API called by the GATTS to get the application&#39;s GATTS database...
bt_gatts_service_rec_t rec_hdr
The record, which is the basic element of a service or characteristic.
Definition: bt_gatts.h:381
uint16_t uuid16
The 16-bit primary service UUID.
Definition: bt_gatts.h:336
128-bit primary service structure of the GATTS.
Definition: bt_gatts.h:347
bt_gatts_characteristic_format_value_t value
The format value of the descriptor.
Definition: bt_gatts.h:455
uint16_t bt_handle_t
Define the connection handle type.
Definition: bt_type.h:85
const bt_uuid_t BT_GATT_UUID_CHARC_FORMAT
UUID for GATT characteristic presentation format.
Record structure of the GATTS.
Definition: bt_gatts.h:235
Client characteristic configuration descriptor structure of the GATTS.
Definition: bt_gatts.h:438
Characteristic extended properties descriptor structure of the GATTS.
Definition: bt_gatts.h:415
const bt_uuid_t BT_GATT_UUID_CHARC
UUID for GATT characteristic.
bt_atts_rec_perm_t perm
The read or write permission and security requirement of the attribute, BT_GATTS_REC_PERM_READABLE, BT_GATTS_REC_PERM_WRITABLE.
Definition: bt_gatts.h:237
bt_gatts_service_rec_t rec_hdr
The record, which is the basic element of a service or characteristic.
Definition: bt_gatts.h:417
bt_status_t bt_gatts_send_charc_value_notification_indication(bt_handle_t connection_handle, bt_gattc_charc_value_notification_indication_t *req)
This function sends a characteristic value notification or indication.
uint8_t bt_atts_rec_perm_t
Bt_atts_rec_perm_t is a member of bt_gatts_service_rec_t.
Definition: bt_gatts.h:199
Characteristic presentation format descriptor structure of the GATTS.
Definition: bt_gatts.h:452
const bt_uuid_t BT_GATT_UUID_PRIMARY_SERVICE
UUID for GATT primary service.
Request the GATTS to do the execute write.
Definition: bt_gatts.h:255
Characteristic UUID16 value structure of the GATTS.
Definition: bt_gatts.h:288
const bt_uuid_t BT_GATT_UUID_CHARC_AGGREGATE_FORMAT
UUID for GATT characteristic aggregate format.
bt_gatts_service_rec_t rec_hdr
The record, which is the basic element of a service or characteristic.
Definition: bt_gatts.h:363
Characteristic format value structure of the GATTS.
Definition: bt_gatts.h:328
bt_uuid_t uuid128
The 128-bit primary service UUID.
Definition: bt_gatts.h:350
bt_gatts_service_rec_t rec_hdr
The record, which is the basic element of a service or characteristic.
Definition: bt_gatts.h:454
uint8_t value_len
The length of the attribute value.
Definition: bt_gatts.h:238
bt_gatts_service_rec_t rec_hdr
The record, which is the basic element of a service or characteristic.
Definition: bt_gatts.h:463
bt_gatts_characteristic_uuid16_value_t value
The value of the characteristic.
Definition: bt_gatts.h:373
bt_gatts_service_rec_t rec_hdr
The record, which is the basic element of a service or characteristic.
Definition: bt_gatts.h:390
uint16_t ending_handle
The service&#39;s ending handle.
Definition: bt_gatts.h:247
Included service structure of the GATTS.
Definition: bt_gatts.h:361
const bt_uuid_t BT_GATT_UUID_CHARC_USER_DESCRIPTION
UUID for GATT characteristic user description.
bt_gatts_service_rec_t rec_hdr
The record, which is the basic element of a service or characteristic.
Definition: bt_gatts.h:408
bt_gatts_included_service_value_t value
The value of the included service.
Definition: bt_gatts.h:364
bt_gatts_service_rec_t rec_hdr
The record, which is the basic element of a service or characteristic.
Definition: bt_gatts.h:399
Characteristic value structure of the GATTS.
Definition: bt_gatts.h:316
bt_gatts_rec_callback_t callback
When the rec_hdr.value_len is 0, the callback should handle the read and write request.
Definition: bt_gatts.h:427
bt_uuid union.
Definition: bt_uuid.h:124
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_gatts_characteristic_str16_t bt_gatts_characteristic_user_description_str16_t
Characteristic user description str16 descriptor structure of the GATTS.
Definition: bt_gatts.h:433
uint8_t flag
The flag indicating whether to execute write operation.
Definition: bt_gatts.h:257
Included service value structure of the GATTS.
Definition: bt_gatts.h:278
bt_gatts_service_rec_t rec_hdr
The record, which is the basic element of a service or characteristic.
Definition: bt_gatts.h:426
Characteristic user description descriptor structure of the GATTS.
Definition: bt_gatts.h:424
uint8_t required_encryption_key_size
The required encryption key size.
Definition: bt_gatts.h:248
bt_gatts_characteristic_uuid128_value_t value
The value of the characteristic.
Definition: bt_gatts.h:382
Characteristic UUID128 value structure of the GATTS.
Definition: bt_gatts.h:298
16-bit UUID characteristic structure of the GATTS.
Definition: bt_gatts.h:370
uint16_t starting_handle
The service&#39;s starting handle.
Definition: bt_gatts.h:246
bt_gatts_service_rec_t rec_hdr
The record, which is the basic element of a service or characteristic.
Definition: bt_gatts.h:372
const bt_uuid_t BT_GATT_UUID_SECONDARY_SERVICE
UUID for GATT secondary primary service.
const bt_uuid_t BT_GATT_UUID_CLIENT_CHARC_CONFIG
UUID for GATT client characteristic configuration.
bt_gatts_client_characteristic_config_t bt_gatts_server_characteristic_config_t
Server characteristic configuration descriptor structure of the GATTS.
Definition: bt_gatts.h:447
bt_status_t bt_gatts_set_max_mtu(uint16_t max_mtu)
This function sets the maximum MTU supported by the application.
utf-16 characteristic structure of the GATTS.
Definition: bt_gatts.h:397
const bt_uuid_t BT_GATT_UUID_CHARC_EXTENDED_PROPERTIES
UUID for GATT characteristic extended properties.
128-bit UUID characteristic structure of the GATTS.
Definition: bt_gatts.h:379
bt_status_t bt_gatts_get_authorization_check_result(bt_gatts_authorization_check_req_t *req)
This user defined API, invoked by the GATTS process, should be implemented by the application...
bt_gatts_rec_callback_t callback
If the rec_hdr.value_len is 0, the callback should handle the read and write request.
Definition: bt_gatts.h:441
bt_gatts_primary_service_128_t bt_gatts_secondary_service_128_t
128-bit secondary service structure of the GATTS.
Definition: bt_gatts.h:356
bt_status_t bt_gatts_get_execute_write_result(bt_gatts_execute_write_req_t *req)
This user defined API, invoked by the GATTS process, should be implemented by the application...
Notification or Indication.
Definition: bt_gattc.h:268
uint32_t(* bt_gatts_rec_callback_t)(const uint8_t rw, uint16_t handle, void *data, uint16_t size, uint16_t offset)
This function is the record&#39;s callback called by the GATTS to read or write the record&#39;s attribute va...
Definition: bt_gatts.h:226
const bt_uuid_t BT_GATT_UUID_SERVER_CHARC_CONFIG
UUID for GATT server characteristic configuration.
const bt_gatts_service_rec_t ** records
A pointer to the records in the service.
Definition: bt_gatts.h:249
bt_gatts_service_rec_t rec_hdr
The record, which is the basic element of a service or characteristic.
Definition: bt_gatts.h:349
Service structure of the GATTS.
Definition: bt_gatts.h:245
bt_gatts_service_rec_t rec_hdr
The record, which is the basic element of a service or characteristic.
Definition: bt_gatts.h:335
Half word characteristic structure of the GATTS.
Definition: bt_gatts.h:406
Request the GATTS to do an authorization check.
Definition: bt_gatts.h:268
bt_gatts_primary_service_16_t bt_gatts_secondary_service_16_t
16-bit secondary service structure of the GATTS.
Definition: bt_gatts.h:342