BLE GATTS API. More...
Go to the source code of this file.
Classes | |
struct | attm_desc_t |
Service(16-bit UUID) description. More... | |
struct | attm_desc_128_t |
Service(128 bits UUID) description. More... | |
struct | gatts_create_db_t |
Parameter of Added service description. More... | |
union | gatts_create_db_t::attribute_table |
< Attribute table. More... | |
struct | gatts_read_cfm_t |
GATT read attribute result description. More... | |
struct | gatts_write_cfm_t |
GATT write attribute result description. More... | |
struct | gatts_prep_write_cfm_t |
GATT prepare write result description. More... | |
struct | gatts_noti_ind_t |
GATT sending Notification or Indication event param description. More... | |
Macros | |
#define | MAX_INC_SRVC_NUM (5) |
The max number of Included Services a Primary/Secondary service can have. More... | |
#define | BROADCAST (0x01) |
In one byte, bit0 means: Broadcast bit. More... | |
#define | READ (0x02) |
In one byte, bit1 means: Read bit. More... | |
#define | WRITE_CMD (0x04) |
In one byte, bit2 means: Write_cmd bit. More... | |
#define | WRITE_REQ (0x08) |
In one byte, bit3 means: Write_req bit. More... | |
#define | NOTIFY (0x10) |
In one byte, bit4 means: Notify bit. More... | |
#define | INDICATE (0x20) |
In one byte, bit5 means: Indicate bit. More... | |
#define | WRITE_SIGNED (0x40) |
In one byte, bit6 means: Write_signed bit. More... | |
#define | EXT_PROP (0x80) |
In one byte, bit7 means: Ext_property bit. More... | |
#define | READ_POS (0x00) |
Bit position of read permission. More... | |
#define | WRITE_POS (0x02) |
Bit position of write permission. More... | |
#define | INDICATE_POS (0x04) |
Bit position of indicate bit. More... | |
#define | NOTIFY_POS (0x06) |
Bit position of notify bit. More... | |
#define | NOAUTH (0x00) |
LE security mode 1, level 1. More... | |
#define | UNAUTH (0x01) |
LE security mode 1, level 2. More... | |
#define | AUTH (0x02) |
LE security mode 1, level 3. More... | |
#define | SEC_CON (0x03) |
LE security mode 1, level 4. More... | |
#define | SEC_LEVEL_MASK (0x03) |
Security level mask. More... | |
#define | UUID_TYPE_16 (0x00) |
16-bit UUID length. More... | |
#define | UUID_TYPE_128 (0x02) |
128-bit UUID length. More... | |
#define | SRVC_SECONDARY_SET (0x80) |
Secondary service set. More... | |
#define | SRVC_UUID_TYPE_SET(uuid_len) ((uuid_len) << 5) |
Service UUID length set. More... | |
#define | SRVC_DISABLE (0x10) |
Service disable. More... | |
#define | SRVC_PERM(sec_level) (((sec_level) & SEC_LEVEL_MASK) << 2) |
Service permission authentication. More... | |
#define | SRVC_ENCRP_KEY_SIZE_16 (0x02) |
16 bytes service encryption key size . More... | |
#define | SRVC_MULTI_ENABLE (0x01) |
Service is multi-instantiated. More... | |
#define | READ_PERM_UNSEC (READ << 8) |
Default Read permission. More... | |
#define | READ_PERM(sec_level) (READ << 8 | (((sec_level) & SEC_LEVEL_MASK) << READ_POS)) |
Read permission set. More... | |
#define | WRITE_REQ_PERM_UNSEC (WRITE_REQ << 8) |
Default Write Permission. More... | |
#define | WRITE_REQ_PERM(sec_level) (WRITE_REQ << 8 | (((sec_level) & SEC_LEVEL_MASK) << WRITE_POS)) |
Write permission set. More... | |
#define | WRITE_CMD_PERM_UNSEC (WRITE_CMD << 8) |
Default Write without Response Permission. More... | |
#define | WRITE_CMD_PERM(sec_level) (WRITE_CMD << 8 | (((sec_level) & SEC_LEVEL_MASK) << WRITE_POS)) |
Write without Response permission set. More... | |
#define | WRITE_SIGNED_PERM_UNSEC (WRITE_SIGNED << 8) |
Default Authenticated Signed Write Permission. More... | |
#define | WRITE_SIGNED_PERM(sec_level) (WRITE_SIGNED << 8 | (((sec_level) & SEC_LEVEL_MASK) << WRITE_POS)) |
Authenticated Signed Write permission set. More... | |
#define | INDICATE_PERM_UNSEC (INDICATE << 8) |
Default Indicate Permission. More... | |
#define | INDICATE_PERM(sec_level) (INDICATE << 8 | (((sec_level) & SEC_LEVEL_MASK) << INDICATE_POS)) |
Indicate permission set. More... | |
#define | NOTIFY_PERM_UNSEC (NOTIFY << 8) |
Default Notify Permission. More... | |
#define | NOTIFY_PERM(sec_level) (NOTIFY << 8 | (((sec_level) & SEC_LEVEL_MASK) << NOTIFY_POS)) |
Notify permission set. More... | |
#define | BROADCAST_ENABLE (BROADCAST << 8) |
Broadcast enable. More... | |
#define | EXT_PROP_ENABLE (EXT_PROP << 8) |
Extended Properties enable. More... | |
#define | ATT_VAL_LOC_USER (1 << 15) |
Value location which means value saved in user space, the profile's read/write callback will be called. More... | |
#define | ATT_VAL_LOC_STACK (0 << 15) |
Value location which means value saved in BLE Stack. More... | |
#define | ATT_UUID_TYPE_SET(uuid_len) ((uuid_len) << 13) |
Attribute UUID length set. More... | |
#define | ATT_ENC_KEY_SIZE_16 (0x1000) |
16 bytes attribute encryption key size . More... | |
Enumerations | |
enum | gatts_service_type_t { SERVICE_TABLE_TYPE_16 = 0x00, SERVICE_TABLE_TYPE_128 } |
Service table type. More... | |
Functions | |
uint16_t | ble_gatts_srvc_db_create (gatts_create_db_t *p_param) |
Register a service's attribute list. More... | |
uint16_t | ble_gatts_value_set (uint16_t handle, uint16_t length, uint16_t offset, const uint8_t *p_value) |
Update attribute value only if the attribute value is saved in the BLE Stack space. More... | |
uint16_t | ble_gatts_value_get (uint16_t handle, uint16_t *p_length, uint8_t *p_value) |
Retrieve attribute value only if the attribute value is saved in the BLE Stack space. More... | |
uint16_t | ble_gatts_attr_permission_set (uint16_t handle, uint16_t perm, uint16_t ext_perm) |
Update attribute permission. More... | |
uint16_t | ble_gatts_attr_permission_get (uint16_t handle, uint16_t *p_perm, uint16_t *p_ext_perm) |
Retrieve attribute permission. More... | |
uint16_t | ble_gatts_read_cfm (uint8_t conn_idx, const gatts_read_cfm_t *p_param) |
Respond to an attribute read request. More... | |
uint16_t | ble_gatts_write_cfm (uint8_t conn_idx, const gatts_write_cfm_t *p_param) |
Respond to an attribute write request. More... | |
uint16_t | ble_gatts_prepare_write_cfm (uint8_t conn_idx, const gatts_prep_write_cfm_t *p_param) |
Respond to an attribute prepare write request. More... | |
uint16_t | ble_gatts_noti_ind (uint8_t conn_idx, const gatts_noti_ind_t *p_param) |
Send out a notification or an indication. More... | |
void | ble_gatts_service_changed (void) |
When service on local device finishes upgrade, call this API to send service upgrade to stack. More... | |
BLE GATTS API.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of GOODIX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file ble_gatts.h.