DM BLE APIs

[English]

重要

The DM BLE API v1.0 is the lastest stable DM BLE APIs. All new applications should use DM BLE API v1.0.

DM BLE API Categories

Most of DM BLE APIs can be categoried as:

Interface specific DM BLE APIs:
  • BLE common interface

  • BLE scan interface

  • BLE ADV interface

  • BLE connect interface

Compitability and Extension

The DM BLE APIs are flexible, easy to be extended and backward compatible. For most of the BLE configurations, we put some reserved fields in the config struct for future extendence. The API users need to make sure the reserved fields are initialized to 0, otherwise the compatibility may be broken as more fields are added.

Programing Principle

重要

Here is some general principle for DM BLE API users:
  • Always init the reserved fields of config stuct to 0

  • Use BK_ERR_CHECK to check the return value of the DM BLE API

  • If you are not sure how to use DM BLE APIs, study the BLE example code first

  • If you are not sure how to initialize some fields of config struct, use the default configuration macro to use the config first and then set application specific fields.

  • Don’t do too much work in BLE event callback, relay the event to your own application task.

User Development Model

Similar as most popular BLE driver, the Beken BLE driver is implemented as event driver. The application call DM BLE APIs to operate the BLE driver and get notified by BLE event.

User Guide

  • create att database

typedef struct
{
    uint16_t pri_service_handle;
    uint16_t chara_notify_handle;
    uint16_t chara_ssid_handle;
    uint16_t chara_pass_handle;
}boarding_env_s;

static boarding_env_s boarding_env;

void ble_do_reg_db(void)
{
    int retval = kNoErr;

    GATT_DB_SERVICE_INFO service_info;
    uint16_t num_attr_handles;
    uint16_t service_handle;
    GATT_DB_UUID_TYPE char_uuid;
    uint16_t perm;
    uint16_t property;
    ATT_VALUE char_value;
    UINT16 char_handle;

    bk_ble_set_notice_cb(ble_at_notice_cb);

    service_info.is_primary = 1;
    service_info.uuid.uuid_format = ATT_16_BIT_UUID_FORMAT;
    service_info.uuid.uuid.uuid_16 = GATT_BOARDING_SERVICE_UUID;
    service_info.link_req = GATT_DB_SER_SUPPORT_ANY_LINK_TYPE;
    service_info.sec_req = GATT_DB_SER_NO_SECURITY_PROPERTY;
    num_attr_handles = 30U;
    retval = bk_ble_gatt_db_add_service
               (
                   &service_info,
                   num_attr_handles,
                   &service_handle
               );

    if (0 != retval)
    {
        os_printf("%s: BT_gatt_db_add_service() failed. Result: 0x%04X\n", __func__, retval);
        goto error;
    }
    else
    {
        boarding_env.pri_service_handle = service_handle;
    }

    char_uuid.uuid_format = ATT_16_BIT_UUID_FORMAT;
    char_uuid.uuid.uuid_16 = GATT_BOARDING_NOTIFY_CHARACTERISTIC;
    perm = GATT_DB_PERM_READ;
    property = (GATT_DB_CHAR_READ_PROPERTY | GATT_DB_CHAR_NOTIFY_PROPERTY);
    char_value.val = s_boarding_notify;
    char_value.len = sizeof(s_boarding_notify);
    char_value.actual_len = char_value.len;
    retval = bk_ble_gatt_db_add_characteristic
                   (
                       service_handle,
                       &char_uuid,
                       perm,
                       property,
                       &char_value,
                       &char_handle
                   );
    if (0 != retval)
    {
        os_printf("%s: bk_ble_gatt_db_add_characteristic() failed. Result: 0x%04X\n", __func__, retval);
        goto error;
    }
    else
    {
        boarding_env.chara_notify_handle = char_handle;
    }

    GATT_DB_UUID_TYPE    desc_uuid;
    ATT_VALUE            desc_value;

    uint8_t cccd_value[2U]    = { 0x00U, 0x00U };

    desc_uuid.uuid_format  = ATT_16_BIT_UUID_FORMAT;
    desc_uuid.uuid.uuid_16 = GATT_CLIENT_CONFIG;

    perm                   = (GATT_DB_PERM_READ | GATT_DB_PERM_WRITE);

    desc_value.val         = cccd_value;
    desc_value.len         = 2U;
    desc_value.actual_len  = desc_value.len;

    /* Add descriptor CCCD */
    retval = bk_ble_gatt_db_add_characteristic_descriptor
             (
                 service_handle,
                 boarding_env.chara_notify_handle,
                 &desc_uuid,
                 perm,
                 &desc_value
             );
    if (0 != retval)
    {
        os_printf("%s: bk_ble_gatt_db_add_characteristic_descriptor() failed. Result: 0x%04X\n", __func__, retval);
        goto error;
    }

    char_uuid.uuid_format = ATT_16_BIT_UUID_FORMAT;
    char_uuid.uuid.uuid_16 = GATT_BOARDING_SSID_CHARACTERISTIC;
    perm = GATT_DB_PERM_READ | GATT_DB_PERM_WRITE;
    property = (GATT_DB_CHAR_READ_PROPERTY | GATT_DB_CHAR_WRITE_PROPERTY | GATT_DB_CHAR_WRITE_WITHOUT_RSP_PROPERTY);
    char_value.val = s_boarding_ssid;
    char_value.len = sizeof(s_boarding_ssid);
    char_value.actual_len = char_value.len;
    retval = bk_ble_gatt_db_add_characteristic
                   (
                       service_handle,
                       &char_uuid,
                       perm,
                       property,
                       &char_value,
                       &char_handle
                   );
    if (0 != retval)
    {
        os_printf("%s: bk_ble_gatt_db_add_characteristic() failed. Result: 0x%04X\n", __func__, retval);
        goto error;
    }
    else
    {
        boarding_env.chara_ssid_handle = char_handle;
    }

    char_uuid.uuid_format = ATT_16_BIT_UUID_FORMAT;
    char_uuid.uuid.uuid_16 = GATT_BOARDING_PASSWORD_CHARACTERISTIC;
    perm = GATT_DB_PERM_READ | GATT_DB_PERM_WRITE;
    property = (GATT_DB_CHAR_READ_PROPERTY | GATT_DB_CHAR_WRITE_PROPERTY | GATT_DB_CHAR_WRITE_WITHOUT_RSP_PROPERTY);
    char_value.val = s_boarding_password;
    char_value.len = sizeof(s_boarding_password);
    char_value.actual_len = char_value.len;
    retval = bk_ble_gatt_db_add_characteristic
                   (
                       service_handle,
                       &char_uuid,
                       perm,
                       property,
                       &char_value,
                       &char_handle
                   );
    if (0 != retval)
    {
        os_printf("%s: bk_ble_gatt_db_add_characteristic() failed. Result: 0x%04X\n", __func__, retval);
        goto error;
    }
    else
    {
        boarding_env.chara_pass_handle = char_handle;
    }

    retval = bk_ble_gatt_db_add_completed();

    if (retval != 0)
    {
        os_printf("%s GATT Database Registration err: 0x%04X\n", __func__, retval);
        goto error;
    }

    retval = bk_ble_gatt_db_set_callback(gatt_db_boarding_gatt_char_handler);

    if (retval != 0)
    {
        os_printf("%s bk_ble_gatt_db_set_callback err: 0x%04X\n", __func__, retval);
        goto error;
    }
}

static API_RESULT gatt_db_boarding_gatt_char_handler(GATT_DB_HANDLE    * handle, GATT_DB_PARAMS    * params)
{
    uint16_t config;

    if(handle->service_id == boarding_env.pri_service_handle)
    {
        switch (params->db_op)
        {
            case GATT_DB_CHAR_PEER_CLI_CNFG_WRITE_REQ:
            {
                if(handle->char_id == boarding_env.chara_notify_handle)
                {
                    config = (((uint16_t)(params->value.val[1]))<<8) | params->value.val[0];
                    if (GATT_CLI_CNFG_NOTIFICATION == config)
                    {
                        os_printf("client notify config open\r\n");
                    }
                    else if(GATT_CLI_CNFG_DEFAULT == config)
                    {
                        os_printf("client notify config close\r\n");
                    }
                    else
                    {
                        //nothing to do
                    }
                }
            }
            break;

            case GATT_DB_CHAR_PEER_READ_REQ:
            {
                if(handle->char_id == boarding_env.chara_pass_handle)
                {
                    ATT_VALUE param;
                    bk_ble_gatt_get_char_val(handle, &param);
                    os_printf("Borading read PASS:%s, %d \r\n",param.val, param.actual_len);
                }
                else if(handle->char_id == boarding_env.chara_ssid_handle)
                {
                    ATT_VALUE param;
                    bk_ble_gatt_get_char_val(handle, &param);
                    os_printf("Borading read SSID:%s, %d \r\n",param.val, param.actual_len);
                }
                else
                {
                    //nothing to do
                }
            }
            break;

            case GATT_DB_CHAR_PEER_WRITE_REQ:
            {
                if(handle->char_id == boarding_env.chara_pass_handle)
                {
                    s_boarding_password_len = 0;
                    os_memset((uint8_t *)s_boarding_password, 0, sizeof(s_boarding_password)/sizeof(s_boarding_password[0]));
                    os_memcpy((uint8_t *)s_boarding_password, params->value.val, params->value.len);
                    s_boarding_password_len = params->value.len;
                    os_printf("Boarding write PASS:%s, %d, %d\r\n",s_boarding_password, s_boarding_password_len, params->value.actual_len);
                    demo_sta_app_init((char *)s_boarding_ssid, (char *)s_boarding_password);
                }
                else if(handle->char_id == boarding_env.chara_ssid_handle)
                {
                    s_boarding_ssid_len = 0;
                    os_memset((uint8_t *)s_boarding_ssid, 0, sizeof(s_boarding_ssid)/sizeof(s_boarding_ssid[0]));
                    os_memcpy((uint8_t *)s_boarding_ssid, params->value.val, params->value.len);
                    s_boarding_ssid_len = params->value.len;
                    os_printf("Boarding write SSID:%s, %d, %d\r\n",s_boarding_ssid, s_boarding_ssid_len, params->value.actual_len);
                }
                else
                {
                    //nothing to do
                }
            }
            break;
            default:
                os_printf("No Specific Application Handling Required for Operation 0x%02X\n", params->db_op);
                break;
        }
    }

    return 0;
}
  • start adv

::

int retval; ble_adv_parameter_t tmp_param;

memset(&tmp_param, 0, sizeof(tmp_param));

tmp_param.adv_intv_max = 160; tmp_param.adv_intv_min = 120; tmp_param.adv_type = ADV_LEGACY_TYPE_ADV_IND; tmp_param.chnl_map = ADV_ALL_CHNLS; tmp_param.filter_policy = ADV_FILTER_POLICY_ALLOW_SCAN_ANY_CONNECT_ANY; tmp_param.own_addr_type = 0; tmp_param.peer_addr_type = 0;

const uint8_t adv_data[] = {0x02, 0x01, 0x06, 0x0f, 0x08, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x2d, 0x44, 0x6f, 0x6f, 0x72, 0x62, 0x65, 0x6c, 0x6c};

//wait for ble_at_cmd_cb retval = bk_ble_set_advertising_data(adv_len, adv_data, ble_at_cmd_cb); if (retval != BK_ERR_BLE_SUCCESS) {

}

retval = bk_ble_set_advertising_enable(1, ble_at_cmd_cb); //wait for ble_at_cmd_cb if (retval != BK_ERR_BLE_SUCCESS) {

}

API Reference

Header File

Functions

void bk_ble_set_event_callback(ble_event_cb_t func)

Register dm_ble event notification callback.

User example:


Attention

1. you must regist it, otherwise you cant get any event !

2. you must regist it before bk_ble_create_db, otherwise you cant get BLE_5_CREATE_DB event

参数

func, : – event callback

返回

  • void

ble_err_t bk_ble_set_advertising_params(ble_adv_parameter_t *param, ble_cmd_cb_t callback)

Set adv param.

Attention

1.you must wait callback status, 0 mean success.

参数
  • param, : – adv param see ble_adv_parameter_t

  • callback, : – register a callback for this action, ble_cmd_t: BLE_CREATE_ADV

返回

  • BK_ERR_BLE_SUCCESS: succeed

  • others: other errors.

ble_err_t bk_ble_set_advertising_data(uint8_t adv_len, uint8_t *adv_buff, ble_cmd_cb_t callback)

Set adv data.

Attention

1.you must wait callback status, 0 mean success.

参数
  • adv_len, : – adv data len

  • adv_buff, : – adv data

  • callback, : – register a callback for this action, ble_cmd_t: BLE_SET_ADV_DATA

返回

  • BK_ERR_BLE_SUCCESS: succeed

  • others: other errors.

ble_err_t bk_ble_set_scan_response_data(uint8_t scan_response_data_length, uint8_t *scan_response_data, ble_cmd_cb_t callback)

Set adv scan response data.

Attention

1.you must wait callback status, 0 mean success.

参数
  • scan_response_data_length, : – data len

  • scan_response_data, : – data

  • callback, : – register a callback for this action, ble_cmd_t: BLE_SET_RSP_DATA

返回

  • BK_ERR_BLE_SUCCESS: succeed

  • others: other errors.

ble_err_t bk_ble_set_advertising_enable(uint8_t enable, ble_cmd_cb_t callback)

Set enable/disable adv.

Attention

1.you must wait callback status, 0 mean success.

参数
  • enable, : – enable or disable

  • callback, : – register a callback for this action, ble_cmd_t: BLE_START_ADV(enable) BLE_STOP_ADV(disable)

返回

  • BK_ERR_BLE_SUCCESS: succeed

  • others: other errors.

ble_err_t bk_ble_disconnect_connection(bd_addr_t *addr, ble_cmd_cb_t callback)

disconnect ble connection

Attention

1.you must wait callback status, 0 mean success.

参数
  • addr, : – peer addr

  • callback, : – register a callback for this action, ble_cmd_t: BLE_CONN_DIS_CONN

返回

  • BK_ERR_BLE_SUCCESS: succeed

  • others: other errors.

ble_err_t bk_ble_gatt_db_add_service(GATT_DB_SERVICE_INFO *service_info, uint16_t num_attr_handles, uint16_t *service_handle)

add a primary service in gatt db

User example:

GATT_DB_SERVICE_INFO service_info;
uint16_t num_attr_handles;
uint16_t service_handle;

service_info.is_primary = 1;
service_info.uuid.uuid_format = ATT_16_BIT_UUID_FORMAT;
service_info.uuid.uuid.uuid_16 = GATT_BOARDING_SERVICE_UUID;
service_info.link_req = GATT_DB_SER_SUPPORT_ANY_LINK_TYPE;
service_info.sec_req = GATT_DB_SER_NO_SECURITY_PROPERTY;
num_attr_handles = 30U;
retval = bk_ble_gatt_db_add_service
           (
               &service_info,
               num_attr_handles,
               &service_handle
           );
Attention

1.you must wait callback status, 0 mean success.

参数
  • service_info, : – service info

  • num_attr_handles, : – how many attr in this service

  • service_handle, :[out] out put a handle to user.

返回

  • BK_ERR_BLE_SUCCESS: succeed

  • others: other errors.

ble_err_t bk_ble_gatt_db_add_characteristic(uint16_t service_handle, GATT_DB_UUID_TYPE *char_uuid, uint16_t perm, uint16_t property, ATT_VALUE *char_value, uint16_t *char_handle)

add a characteristic in a gatt service

User example:

GATT_DB_UUID_TYPE char_uuid;
uint16_t perm;
uint16_t property;
ATT_VALUE char_value;
UINT16 char_handle;

char_uuid.uuid_format = ATT_16_BIT_UUID_FORMAT;
char_uuid.uuid.uuid_16 = GATT_BOARDING_NOTIFY_CHARACTERISTIC;
perm = GATT_DB_PERM_READ;
property = (GATT_DB_CHAR_READ_PROPERTY | GATT_DB_CHAR_NOTIFY_PROPERTY);
char_value.val = s_boarding_notify;
char_value.len = sizeof(s_boarding_notify);
char_value.actual_len = char_value.len;
retval = bk_ble_gatt_db_add_characteristic
               (
                   service_handle,
                   &char_uuid,
                   perm,
                   property,
                   &char_value,
                   &char_handle
               );

Attention

1.you must wait callback status, 0 mean success.

参数
返回

  • BK_ERR_BLE_SUCCESS: succeed

  • others: other errors.

ble_err_t bk_ble_gatt_db_add_characteristic_descriptor(uint16_t service_handle, uint16_t char_handle, GATT_DB_UUID_TYPE *desc_uuid, uint16_t perm, ATT_VALUE *desc_value)

add a characteristic descriptor in a characteristic

User example:

GATT_DB_UUID_TYPE    desc_uuid;
ATT_VALUE            desc_value;

uint8_t cccd_value[2U]    = { 0x00U, 0x00U };

desc_uuid.uuid_format  = ATT_16_BIT_UUID_FORMAT;
desc_uuid.uuid.uuid_16 = GATT_CLIENT_CONFIG;

perm                   = (GATT_DB_PERM_READ | GATT_DB_PERM_WRITE);

desc_value.val         = cccd_value;
desc_value.len         = 2U;
desc_value.actual_len  = desc_value.len;

// Add descriptor CCCD
retval = bk_ble_gatt_db_add_characteristic_descriptor
         (
             service_handle,
             boarding_env.chara_notify_handle,
             &desc_uuid,
             perm,
             &desc_value
         );

Attention

1.you must wait callback status, 0 mean success.

参数
  • service_handle, : – service handle, get from bk_ble_gatt_db_add_service

  • char_handle, : – get from bk_ble_gatt_db_add_characteristic

  • desc_uuid, : – characteristic’s uuid, in ATT_UUID16 or ATT_UUID128, see GATT_DB_UUID_TYPE

  • perm, : – permission, such as GATT_DB_PERM_READ GATT_DB_PERM_WRITE

  • desc_value, : – att data, see ATT_VALUE

返回

  • BK_ERR_BLE_SUCCESS: succeed

  • others: other errors.

ble_err_t bk_ble_gatt_db_add_completed(void)

call when gatt db add completed

Attention

1.you must wait callback status, 0 mean success.

返回

  • BK_ERR_BLE_SUCCESS: succeed

  • others: other errors.

ble_err_t bk_ble_gatt_db_set_callback(ble_gatt_db_callback_t hndlr_cb)

set callback, when recv write read req

Attention

1.you must wait callback status, 0 mean success.

参数

hndlr_cb, : – callback, see ble_gatt_db_callback_t

返回

  • BK_ERR_BLE_SUCCESS: succeed

  • others: other errors.

ble_err_t bk_ble_gatt_read_resp(uint8_t conn_handle, uint8_t *value, uint16_t length)

When recv GATT_DB_CHAR_PEER_READ_REQ, async response.

Attention

1.you must wait callback status, 0 mean success.

参数
  • conn_handle, : – connection handle

  • value, : – a point to buffer

  • length, : – buffer len

返回

  • BK_ERR_BLE_SUCCESS: succeed

  • others: other errors.

ble_err_t bk_ble_send_notify(uint8_t conn_handle, uint16_t service_handle, uint16_t char_handle, uint8_t *data, uint16_t len)

send notify when recv enable notify

Attention

1.you must wait callback status, 0 mean success.

参数
  • conn_handle, : – connection handle

  • adv – service_handle: from bk_ble_gatt_db_add_service

  • char_handle, : – get from bk_ble_gatt_db_add_characteristic

  • data, : – a point to buffer

  • len, : – buffer len

返回

  • BK_ERR_BLE_SUCCESS: succeed

  • others: other errors.

ble_err_t bk_ble_gatt_get_char_val(GATT_DB_HANDLE *handle, ATT_VALUE *attr_value)

get db value

Attention

1.you must wait callback status, 0 mean success.

参数
  • handle, : – handle

  • attr_value, : – attr

返回

  • BK_ERR_BLE_SUCCESS: succeed

  • others: other errors.

ble_err_t bk_ble_set_random_addr(bd_addr_t *addr, ble_cmd_cb_t callback)

set random addr

Attention

1.you must wait callback status, 0 mean success.

2.this api must call after bk_ble_set_advertising_params now !

参数
  • addr, : – addr

  • callback, : – register a callback for this action, ble_cmd_t: BLE_SET_RANDOM_ADDR

返回

  • BK_ERR_BLE_SUCCESS: succeed

  • others: other errors.

ble_err_t bk_ble_update_connection_params(ble_update_conn_param_t *conn_param)

update connection param, result as BK_DM_BLE_EVENT_CONN_UPDATA

Attention

1.you must wait callback status, 0 mean success.

2.you don’t need to wait BK_DM_BLE_EVENT_CONN_UPDATA because it is an aysnc procedure.

参数

conn_param, :ble_update_conn_param_t

返回

  • BK_ERR_BLE_SUCCESS: succeed

  • others: other errors.

API Typedefs

Header File

Unions

union ATT_UUID
#include <dm_ble_types.h>

att uuid struct

Public Members

ATT_UUID16 uuid_16
ATT_UUID128 uuid_128

Structures

struct ATT_UUID128

Abstracts 128 Bit UUID.

struct ATT_VALUE

att value struct

Public Members

uint8_t *val

Value to be packed

uint16_t len

Length of Value

uint16_t actual_len

Out Parameter Indicating Actual Length Packed

struct ATT_HANDLE_VALUE_PAIR

Abstracts Handle Value Pair This is used in multiple PDUs - see ATT_WRITE_REQ_PARAM, ATT_WRITE_CMD_PARAM etc.

Public Members

ATT_VALUE value

Attribute Value

ATT_ATTR_HANDLE handle

Attribute Handle

struct ATT_HANDLE

ATT Handle.

Public Members

DEVICE_HANDLE device_id

Identifies the peer instance

ATT_CON_ID att_id

Identifies the ATT Instance

struct ATT_HANDLE_RANGE

ATT range.

Public Members

ATT_ATTR_HANDLE start_handle

Start Handle

ATT_ATTR_HANDLE end_handle

End Handle

struct GATT_DB_UUID_TYPE

gatt db uuid type

Public Members

uint8_t uuid_format

Format indicating, 16 bit or 128 bit UUIDs, see ATT_16_BIT_UUID_FORMAT ATT_128_BIT_UUID_FORMAT.

ATT_UUID uuid

Attribute UUID.

struct GATT_DB_SERVICE_INFO

used in bk_ble_gatt_db_add_service

Public Members

GATT_DB_UUID_TYPE uuid

UUID, see GATT_DB_UUID_TYPE

uint8_t is_primary

If this service is primary or not

GATT_DB_SERVICE_DESC sec_req

Security Requrirements for the Service Logical OR of desired combinations of

  1. Security Mode

  2. Security Level

  3. Encryption Key Size

Acceptable values for Security Mode are: GATT_DB_SER_SECURITY_MODE1 GATT_DB_SER_SECURITY_MODE2

Acceptable values for Security Level are: GATT_DB_SER_SECURITY_LEVEL1 GATT_DB_SER_SECURITY_LEVEL2 GATT_DB_SER_SECURITY_LEVEL3

Acceptable values for Encryption Key Size are: GATT_DB_SER_ENCRYPT_KEY_SIZE_7 GATT_DB_SER_ENCRYPT_KEY_SIZE_8 GATT_DB_SER_ENCRYPT_KEY_SIZE_9 GATT_DB_SER_ENCRYPT_KEY_SIZE_10 GATT_DB_SER_ENCRYPT_KEY_SIZE_11 GATT_DB_SER_ENCRYPT_KEY_SIZE_12 GATT_DB_SER_ENCRYPT_KEY_SIZE_13 GATT_DB_SER_ENCRYPT_KEY_SIZE_14 GATT_DB_SER_ENCRYPT_KEY_SIZE_15 GATT_DB_SER_ENCRYPT_KEY_SIZE_16 When the Service does not mandate any specific Key size GATT_DB_SER_ENC_KEY_SIZE_DONT_CARE shall be used.

When No Security is mandated for the service Value GATT_DB_SER_NO_SECURITY_PROPERTY shall be used.

Transport Requrirements for the Service. This describes the Transport on which this required to be operational. GATT_DB_SER_SUPPORT_ANY_LINK_TYPE GATT_DB_SER_SUPPORT_LE_LINK_TYPE GATT_DB_SER_SUPPORT_BR_LINK_TYPE

struct GATT_DB_HANDLE

GATT db handle.

Public Members

DEVICE_HANDLE device_id

Identifies the peer accessing the database

uint8_t service_id

Identifies the Service being Accessed

uint8_t char_id

Identifies the Characteristic being Accessed

struct GATT_DB_PARAMS

GATT db param.

Public Members

ATT_VALUE value

Abstracts Value to get/set the Attribute Value

ATT_ATTR_HANDLE handle

Abstracts the handle information

GATT_DB_OPERATION db_op

Abstracts the Access Operation, such as GATT_DB_CHAR_PEER_READ_REQ

Attention

when recv GATT_DB_CHAR_PEER_READ_REQ and you dont want response immediately, return GATT_DB_DELAYED_RESPONSE in ble_gatt_db_callback_t

struct GATT_SERVICE_PARAM

gatt Service param

Public Members

ATT_UUID uuid

Service UUID

uint8_t uuid_type

Service UUID Type

ATT_HANDLE_RANGE range

Service Range

struct GATT_CHAR_DESC_PARAM

gatt Characteristic Descriptor Information

Public Members

ATT_ATTR_HANDLE handle

Descriptor handle

ATT_UUID uuid

Descriptor UUID

uint8_t uuid_type

Descriptor UUID Type

struct GATT_CHARACTERISTIC_PARAM

gatt Characteristic Information

Public Members

ATT_HANDLE_RANGE range

Characteristic Range

uint8_t cproperty

Characteristic Property

ATT_ATTR_HANDLE value_handle

Characteristic Value Handle

ATT_UUID uuid

Characteristic UUID

uint8_t uuid_type

Characteristic UUID Type

uint8_t desc_index

ATT_128_BIT_UUID_FORMAT Characteristic desciptor index

uint16_t val_offset

Characteristics Value Offset

uint16_t val_length

Characteristic Value Length

GATT_CHAR_DESC_PARAM descriptor[GATT_MAX_CHAR_DESCRIPTORS]

Characteristic descriptor array

struct ble_adv_parameter_t

use in bk_ble_set_advertising_params

Public Members

uint32_t adv_intv_min

Minimum advertising interval (in unit of 625us). Must be greater than or equal to 20ms.

uint32_t adv_intv_max

Maximum advertising interval (in unit of 625us). Must be greater than or equal to 20ms.

uint8_t adv_type

Advertising type, see advertise_legacy_type.

uint8_t own_addr_type

Own address type: public=0 / random=1 / rpa_or_pub=2 / rpa_or_rnd=3.

bd_addr_t peer_address

Peer address.

uint8_t peer_addr_type

Peer address type: public or public identity addr =0 / RDP or random Identity Addr =1.

uint8_t chnl_map

Bit field indicating the channel mapping (.

参见

enum adv_chnl_map)

uint16_t filter_policy

advertising policy see advertise_filter_policy

struct ble_conn_att_t

use in BK_DM_BLE_EVENT_CONNECT BK_DM_BLE_EVENT_DISCONNECT

Public Members

uint8_t peer_addr_type

Peer address type.

uint8_t peer_addr[6]

Peer BT address.

struct ble_att_tx_compl_t

use in BK_DM_BLE_EVENT_TX_DONE

struct ble_att_notify_t

use in BK_DM_BLE_EVENT_RECV_NOTIFY

struct ble_conn_update_param_ind_t

use in BK_DM_BLE_EVENT_CONN_UPD_PAR_ASK

struct ble_conn_update_param_compl_ind_t

use in BK_DM_BLE_EVENT_CONN_UPDATA

struct ble_update_conn_param_t

use when we need to trigger an update

struct ble_att_rw_t

use in BK_DM_BLE_EVENT_ATT_READ_RESPONSE

Macros

_H_GATT_DEFINES_
ATT_APPL_PROCEDURE_ALREADY_IN_PROGRESS
ATT_APPL_CCD_IMPROPERLY_CONFIGURED
_H_BT_ERROR_

H_GATT_DEFINES

GATT_DB_ERR_ID
GATT_DB_DELAYED_RESPONSE

Not an error code. More of a status code

GATT_DB_DONOT_RESPOND
GATT_DB_ALREADY_RESPONDED
_H_BT_DEVICE_QUEUE_
_H_BT_ATT_API_
ATT_AUTH_SIGNATURE_SIZE

ATT Default MTU ATT Signature Size in Signed Write

ATT_EXECUTE_WRITE_CANCEL_FLAG

ATT Execute Write Cancel Flag

ATT_EXECUTE_WRITE_EXEC_FLAG

ATT Execute Write Execute Flag

ATT_16_BIT_UUID_FORMAT

ATT Identification for 16-bit UUID Format

ATT_128_BIT_UUID_FORMAT

ATT Identification for 128-bit UUID Format

ATT_16_BIT_UUID_SIZE

ATT 16-bit UUID Size

ATT_128_BIT_UUID_SIZE

ATT 128-bit UUID Size

ATT_CON_ID_INIT_VAL

ATT Connection Instance Initialization Value.

ATT_APPL_CB_INIT_VAL

ATT Application Callback Initialization Value.

ATT_INVALID_ATTR_HANDLE_VAL

ATT Invalid Attribute Handle Value

ATT_ATTR_HANDLE_START_RANGE

ATT Attribute Handle Start Range

ATT_ATTR_HANDLE_END_RANGE

ATT Attribute Handle End Range

_H_BT_GATT_DB_API_
_H_GATT_
GATT_MAX_CHAR_DESCRIPTORS

Type Definitions

typedef uint16_t API_RESULT
typedef uint8_t DEVICE_HANDLE
typedef uint8_t ATT_CON_ID
typedef uint16_t ATT_ATTR_HANDLE

ble att protocol handle

typedef uint16_t ATT_UUID16

Abstracts 16 Bit UUID

typedef uint8_t GATT_DB_OPERATION

such as GATT_DB_CHAR_VALUE_READ_REQ

typedef uint32_t GATT_DB_SERVICE_DESC

such as GATT_DB_SER_NO_SECURITY_PROPERTY GATT_DB_SER_SUPPORT_ANY_LINK_TYPE

typedef bk_err_t (*ble_gatt_db_callback_t)(uint8_t conn_handle, GATT_DB_HANDLE *handle, GATT_DB_PARAMS *param)

GATT DB callback extension, GATT DB Handler Callback. The GATT DB PL extension calls the registered callback to indicate any ongoing GATT DB Operation. The Upper Layer can implement specific handling for any Characterisitc or Characteritistic Descriptor depending on its requirement.

Param conn_handle

[in] connection handle, see BK_DM_BLE_EVENT_CONNECT

Param handle

[in] Pointer to GATT DB identifier GATT_DB_HANDLE

Param param

[in] Pointer to GATT DB Parameters GATT_DB_PARAMS

Return

API_SUCCESS if ATT/GATT response for the incoming request to be sent from the below layer GATT_DB_DELAYED_RESPONSE if ATT/GATT response will be sent at a later point by the application GATT_DB_DONOT_RESPOND if ATT/GATT response will be sent at a later point by the application GATT_DB_ALREADY_RESPONDED if ATT/GATT response is already sent the application else and Error code describing cause of failure.

typedef uint32_t (*ble_event_cb_t)(ble_event_enum_t event, void *param)

for async dm_ble api event.

ble event report.

Param event, :

event id. see ble_event_enum_t

  • param: param

Enumerations

enum [anonymous]

GATT Attributes.

Values:

enumerator GATT_PRIMARY_SERVICE
enumerator GATT_SECONDARY_SERVICE
enumerator GATT_INCLUDE
enumerator GATT_CHARACTERISTIC
enumerator GATT_EXTENDED_PROPERTIES
enumerator GATT_USER_DESCRIPTION
enumerator GATT_CLIENT_CONFIG
enumerator GATT_SERVER_CONFIG
enumerator GATT_FORMAT
enumerator GATT_AGGREGATE_FORMAT
enumerator GATT_VALID_RANGE
enumerator GATT_EXTERNAL_REPORT_REF
enumerator GATT_IP_OP_FEATURE_REPORT_REF
enum [anonymous]

GATT Configuration.

Values:

enumerator GATT_CLI_CNFG_NOTIFICATION

GATT Client Configuration values

enumerator GATT_CLI_CNFG_INDICATION
enumerator GATT_CLI_CNFG_DEFAULT
enumerator GATT_SER_CNFG_BROADCAST

GATT Server Configuration values

enumerator GATT_SER_CNFG_DEFAULT
enum [anonymous]

GATT Services.

Values:

enumerator GATT_GAP_SERVICE
enumerator GATT_GATT_SERVICE
enumerator GATT_IMMEDIATE_ALERT_SERVICE
enumerator GATT_TX_POWER_SERVICE
enumerator GATT_CURRENT_TIME_SERVICE
enumerator GATT_REF_TIME_UPDATE_SERVICE
enumerator GATT_NEXT_DST_CHANGE_SERVICE
enumerator GATT_GLUCOSE_SERVICE
enumerator GATT_HEALTH_THERMOMETER_SERVICE
enumerator GATT_DEVICE_INFO_SERVICE
enumerator GATT_NWA_SERVICE
enumerator GATT_WATCH_DOG_SERVICE
enumerator GATT_HEART_RATE_SERVICE
enumerator GATT_PHONE_ALERT_STATUS_SERVICE
enumerator GATT_BATTERY_SERVICE
enumerator GATT_BLOOD_PRESSURE_SERVICE
enumerator GATT_ALERT_NOTIFICATION_SERVICE
enumerator GATT_HID_SERVICE
enumerator GATT_SCAN_PARAM_SERVICE
enumerator GATT_RUNNING_SPEED_AND_CADENCE_SERVICE
enumerator GATT_AIOS_SERVICE
enumerator GATT_CYCLING_SPEED_AND_CADENCE_SERVICE
enumerator GATT_CPM_SERVICE
enumerator GATT_LOCATION_AND_NAVIGATION_SERVICE
enumerator GATT_ENVIRONMENTAL_SENSING_SERVICE
enumerator GATT_BODY_COMPOSITION_SERVICE
enumerator GATT_USER_DATA_SERVICE
enumerator GATT_WEIGHT_SCALE_SERVICE
enumerator GATT_BM_SERVICE
enumerator GATT_CGM_SERVICE
enumerator GATT_INT_PS_SERVICE
enumerator GATT_IPS_SERVICE
enumerator GATT_PULSE_OXIMETER_SERVICE
enumerator GATT_HPS_SERVICE
enumerator GATT_TDS_SERVICE
enumerator GATT_OBJECT_TRANSFER_SERVICE
enumerator GATT_FTMS_SERVICE
enumerator GATT_RCS_SERVICE
enumerator GATT_INSULIN_DELIVERY_SERVICE
enumerator GATT_FIND_ME_SERVICE

Dont find this on .org

enumerator GATT_TPMS_SERVICE

Still not adopted, may need updation

enum [anonymous]

GATT Characteristic.

Values:

enumerator GATT_DEVICE_NAME_CHARACTERISTIC
enumerator GATT_APPEARANCE_CHARACTERISTIC
enumerator GATT_PERIPHRL_PRIVCY_FLG_CHARACTERISTIC
enumerator GATT_RECONNECT_ADDR_CHARACTERISTIC
enumerator GATT_PRFRRD_CNXN_PARAM_CHARACTERISTIC
enumerator GATT_SERVICE_CHANGED_CHARACTERISTIC
enumerator GATT_ALERT_LEVEL_CHARACTERISTIC
enumerator GATT_TX_POWER_LEVEL_CHARACTERISTIC
enumerator GATT_DATE_TIME_CHARACTERISTIC
enumerator GATT_DAY_OF_WEEK_CHARACTERISTIC
enumerator GATT_DAY_DATE_TIME_CHARACTERISTIC
enumerator GATT_EXACT_TIME_100_CHARACTERISTIC
enumerator GATT_EXACT_TIME_256_CHARACTERISTIC
enumerator GATT_DST_OFFSET_CHARACTERISTIC
enumerator GATT_TIME_ZONE_CHARACTERISTIC
enumerator GATT_LOCAL_TIME_INFO_CHARACTERISTIC
enumerator GATT_SEC_TIME_ZONE_CHARACTERISTIC
enumerator GATT_TIME_WITH_DST_CHARACTERISTIC
enumerator GATT_TIME_ACCURACY_CHARACTERISTIC
enumerator GATT_TIME_SOURCE_CHARACTERISTIC
enumerator GATT_REF_TIME_INFO_CHARACTERISTIC
enumerator GATT_TIME_BROADCAST_CHARACTERISTIC
enumerator GATT_TIME_UPDATE_CONTROL_POINT
enumerator GATT_TIME_UPDATE_STATE_CHARACTERISTIC
enumerator GATT_GLUCOSE_MSRMNT_CHARACTERISTIC
enumerator GATT_BATTERY_LEVEL_CHARACTERISTIC
enumerator GATT_BATTERY_PWR_ST_CHARCTERISTIC
enumerator GATT_BATTERY_LEVEL_ST_CHARACTERISTIC
enumerator GATT_TEMPERATURE_MSMNT_CHARACTERISTIC
enumerator GATT_TEMPERATURE_TYPE_CHARACTERISTIC
enumerator GATT_INTERMEDIATE_TEMP_CHARACTERISTIC
enumerator GATT_MSMNT_INTERVAL_CHARATACTERISTIC
enumerator GATT_BOOT_KYBRD_IN_RPT_CHARACTERISTIC
enumerator GATT_SYSTEM_ID_CHARACTERISTIC
enumerator GATT_MODEL_NUMBER_CHARACTERISTIC
enumerator GATT_SERIAL_NUMBER_CHARACTERISTIC
enumerator GATT_FIRMWARE_REV_CHARACTERISTIC
enumerator GATT_HARDWARE_REV_CHARACTERISTIC
enumerator GATT_SOFTWARE_REV_CHARACTERISTIC
enumerator GATT_MANUFACTURER_NAME_CHARACTERISTIC
enumerator GATT_REG_CERT_DATA_CHARACTERISTIC
enumerator GATT_CURRENT_TIME_CHARACTERISTIC
enumerator GATT_SCAN_REFRESH_CHARACTERISTIC
enumerator GATT_BOOT_KYBRD_OP_CHARACTERISTIC
enumerator GATT_MOUSE_IP_CHARACTERISTIC
enumerator GATT_GL_MSRMT_CTX_CHARACTERISTIC
enumerator GATT_BP_MSRMT_CHARACTERISTIC
enumerator GATT_INTRMDT_CUFF_PRSR_CHARACTERISTIC
enumerator GATT_HR_MSRMT_CHARACTERISTIC
enumerator GATT_BODY_SENSOR_LOC_CHARACTERISTIC
enumerator GATT_HR_CNTRL_POINT
enumerator GATT_NWA_CHARACTERISTIC
enumerator GATT_ALERT_STATUS_CHARACTERISTIC
enumerator GATT_RINGER_CONTROL_POINT_CHARACTERISTIC
enumerator GATT_RINGER_SETTING_CHARACTERISTIC
enumerator GATT_ALERT_ID_BIT_MASK_CHARACTERISTIC
enumerator GATT_ALERT_ID_CHARACTERISTIC
enumerator GATT_ALERT_NTF_CONTROL_POINT
enumerator GATT_UNREAD_ALRT_STATUS_CHARACTERISTIC
enumerator GATT_NEW_ALERT_CHARACTERISTIC
enumerator GATT_SPRTD_NEW_ALRT_CTGRY_CHARACTERISTIC
enumerator GATT_SPRT_UNRD_ALRT_CTGRY_CHARACTERISTIC
enumerator GATT_BP_FEATURE_CHARACTERISTIC
enumerator GATT_HID_INFO_CHARACTERISTIC
enumerator GATT_HID_RPT_MAP_CHARACTERISTIC
enumerator GATT_HID_CP_CHARACTERISTIC
enumerator GATT_HID_RPT_CHARACTERISTIC
enumerator GATT_HID_PROTO_MODE_CHARACTERISTIC
enumerator GATT_SCAN_WINDOW_CHARACTERISTIC
enumerator GATT_PNP_ID_CHARACTERISTIC
enumerator GATT_GL_FEATURE_CHARACTERISTIC
enumerator GATT_RACP_CHARACTERISTIC
enumerator GATT_RSC_MSRMT_CHARACTERISTIC
enumerator GATT_RSC_FEATURE_CHARACTERISTIC
enumerator GATT_SC_CONTROL_POINT_CHARACTERISTIC
enumerator GATT_CSC_MSRMT_CHARACTERISTIC
enumerator GATT_CSC_FEATURE_CHARACTERISTIC
enumerator GATT_SENSOR_LOCATION_CHARACTERISTIC
enumerator GATT_POX_SPOT_CHK_MSRMT_CHARACTERISTIC

Still Not Adopted, may need updation Pulse Oximeter Characteristics defines

enumerator GATT_POX_CONTINUOUS_MSRMT_CHARACTERISTIC
enumerator GATT_POX_PULSATILE_EVENT_CHARACTERISTIC
enumerator GATT_POX_FEATURES_CHARACTERISTIC
enumerator GATT_POX_CONTROL_POINT_CHARACTERISTIC
enumerator GATT_CPM_MSRMT_CHARACTERISTIC

CPM Characteristics Measurments

enumerator GATT_CPM_VECTOR_CHARACTERISTIC
enumerator GATT_CPM_FEATURE_CHARACTERISTIC
enumerator GATT_CPM_CNTRL_PNT_CHARACTERISTIC
enumerator GATT_CPM_SENSOR_LOCATION_CHARACTERISTIC
enumerator GATT_LOCATION_AND_SPEED_CHARACTERISTIC

Location and Navigation Characteristics

enumerator GATT_NAVIGATION_CHARACTERISTIC
enumerator GATT_LN_POSITION_QUALITY_CHARACTERISTIC
enumerator GATT_LN_FEATURE_CHARACTERISTIC
enumerator GATT_LN_CNTRL_PNT_CHARACTERISTIC
enumerator GATT_CGM_MSRMT_CHARACTERISTIC

CGM Characteristics defines

enumerator GATT_CGM_FEATURES_CHARACTERISTIC
enumerator GATT_CGM_STATUS_CHARACTERISTIC
enumerator GATT_CGM_SSN_STRT_TIME_CHARACTERISTIC
enumerator GATT_CGM_SSN_RUN_TIME_CHARACTERISTIC
enumerator GATT_CGM_SPECIFIC_OPS_CP_CHARACTERISTIC
enumerator GATT_BATTERY_REMOVABLE_CHARACTERISTIC
enumerator GATT_BATTERY_SERV_REQRD_CHARACTERISTIC
enumerator GATT_WS_MSRMT_CHARACTERISTIC

Weight Scale Characteristics define

enumerator GATT_WS_FEATURE_CHARACTERISTIC
enumerator GATT_BC_MSRMT_CHARACTERISTIC

Body Composition Characteristics define

enumerator GATT_BC_FEATURE_CHARACTERISTIC
enumerator GATT_UD_FIRST_NAME_CHARACTERISTIC

User Name Characterictics define

enumerator GATT_UD_LAST_NAME_CHARACTERISTIC
enumerator GATT_UD_EMAIL_CHARACTERISTIC
enumerator GATT_UD_AGE_CHARACTERISTIC
enumerator GATT_UD_GENDER_CHARACTERISTIC
enumerator GATT_UD_DB_CHNG_INC_CHARACTERISTIC
enumerator GATT_UD_DOB_CHARACTERISTIC
enumerator GATT_UD_WEIGHT_CHARACTERISTIC
enumerator GATT_UD_HEIGHT_CHARACTERISTIC
enumerator GATT_UD_VO2MAX_CHARACTERISTIC
enumerator GATT_UD_HRMAX_CHARACTERISTIC
enumerator GATT_UD_RHR_CHARACTERISTIC
enumerator GATT_UD_MAXRHR_CHARACTERISTIC
enumerator GATT_UD_AEROTH_CHARACTERISTIC
enumerator GATT_UD_ANAETH_CHARACTERISTIC
enumerator GATT_UD_SPORTTYPE_CHARACTERISTIC
enumerator GATT_UD_DATETHASS_CHARACTERISTIC
enumerator GATT_UD_WAISTCIR_CHARACTERISTIC
enumerator GATT_UD_HIPCIR_CHARACTERISTIC
enumerator GATT_UD_FATBURN_LOW_CHARACTERISTIC
enumerator GATT_UD_FATBURN_UPL_CHARACTERISTIC
enumerator GATT_UD_AERO_LOW_CHARACTERISTIC
enumerator GATT_UD_AERO_UPL_CHARACTERISTIC
enumerator GATT_UD_ANAE_LOW_CHARACTERISTIC
enumerator GATT_UD_ANAE_UPL_CHARACTERISTIC
enumerator GATT_UD_FIVEZONE_HRL_CHARACTERISTIC
enumerator GATT_UD_THREEZONE_HRL_CHARACTERISTIC
enumerator GATT_UD_TWOZONE_HRL_CHARACTERISTIC
enumerator GATT_UD_USER_INDEX_CHARACTERISTIC
enumerator GATT_UD_USER_CNTRL_PNT_CHARACTERISTIC
enumerator GATT_UD_LANGUAGE_CHARACTERISTIC
enumerator GATT_UD_REGISTERED_USER_CHARACTERISTIC
enumerator GATT_ESS_DVC_CHARACTERISTIC

Environmental Sensing Characterisitcs define

enumerator GATT_ESS_TEMP_CHARACTERISTIC
enumerator GATT_ES_MEASURMENT_DESCRIPTOR
enumerator GATT_ES_TRIGGER_SETTING_DESCRIPTOR
enumerator GATT_ES_CONFIGURATION_DESCRIPTOR
enumerator GATT_ES_MEASUREMENT_DESCRIPTOR
enumerator GATT_BM_FEATURES_CHARACTERISTIC

Bond Management Characteritiscs defines

enumerator GATT_BM_CNTRL_PNT_CHARACTERISTIC
enumerator GATT_AIO_DIGITAL_CHARACTERISTIC

Automation IO Service Characteritiscs defines

enumerator GATT_AIO_ANALOG_CHARACTERISTIC
enumerator GATT_AIO_AGGREGATE_CHARACTERISTIC
enumerator GATT_IP_INDOOR_POS_CONFIG_CHARACTERISTIC

Indoor Positioning Characteritiscs defines

enumerator GATT_IP_LATITUDE_CHARACTERISTIC
enumerator GATT_IP_LONGITUDE_CHARACTERISTIC
enumerator GATT_IP_LOCAL_NORTH_CHARACTERISTIC
enumerator GATT_IP_LOCAL_EAST_CHARACTERISTIC
enumerator GATT_IP_FLOOR_NUM_CHARACTERISTIC
enumerator GATT_IP_ALTITUDE_CHARACTERISTIC
enumerator GATT_IP_UNCERTAINTY_CHARACTERISTIC
enumerator GATT_IP_LOCAL_NAME_CHARACTERISTIC
enumerator GATT_OTS_FEATURE_CHARACTERISTIC

Object Transfer Characteritics defines

enumerator GATT_OTS_OBJ_NAME_CHARACTERISTIC
enumerator GATT_OTS_OBJ_TYPE_CHARACTERISTIC
enumerator GATT_OTS_OBJ_SIZE_CHARACTERISTIC
enumerator GATT_OTS_OBJ_FIRST_CRTD_CHARACTERISTIC
enumerator GATT_OTS_OBJ_LAST_MODFD_CHARACTERISTIC
enumerator GATT_OTS_OBJ_ID_CHARACTERISTIC
enumerator GATT_OTS_OBJ_PRPTY_CHARACTERISTIC
enumerator GATT_OTS_OACP_CHARACTERISTIC
enumerator GATT_OTS_OLCP_CHARACTERISTIC
enumerator GATT_OTS_OBJ_LIST_FILTER_CHARACTERISTIC
enumerator GATT_OTS_OBJ_CHANGED_CHARACTERISTIC
enumerator GATT_OTS_LE_PSM_CHARACTERISTIC
enumerator GATT_OTS_OBJ_LAST_ACCSD_CHARACTERISTIC
enumerator GATT_OTS_OBJ_CHECKSUM_CHARACTERISTIC
enumerator GATT_OTS_OCTECT_OFFSET_CHARACTERISTIC
enumerator GATT_TPM_TIRE_PRESSURE_CHARACTERISTIC

Tire Pressure Monitoring Characteritiscs defines Needs to update the opcode once TPMS spec is adopted

enumerator GATT_TPM_TIRE_TEMP_CHARACTERISTIC
enumerator GATT_TPM_PRESSURE_CALIBN_CHARACTERISTIC
enumerator GATT_TPM_TEMP_CALIBN_CHARACTERISTIC
enumerator GATT_TPM_DISRY_CONN_MGMNT_CHARACTERISTIC
enumerator GATT_TPM_ADV_PERIOD_CHARACTERISTIC
enumerator GATT_TD_CONTROL_POINT_CHARACTERISTIC

Transport Discovery Characteristics defines

enumerator GATT_HPC_URI_CHARACTERISTIC

HTTP Proxy Characteristics defines

enumerator GATT_HPC_HTTP_HEADERS_CHARACTERISTIC
enumerator GATT_HPC_HTTP_ENTITY_BODY_CHARACTERISTIC
enumerator GATT_HPC_HTTP_CP_CHARACTERISTIC
enumerator GATT_HPC_HTTP_STATUS_CODE_CHARACTERISTIC
enumerator GATT_HPC_HTTPS_SECURITY_CHARACTERISTIC
enumerator GATT_FTM_FEATURE_CHARACTERISTIC

Fitness Machine Characteristics defines

enumerator GATT_FTM_TREADMILL_CHARACTERISTIC
enumerator GATT_FTM_CROSS_TRAINER_CHARACTERISTIC
enumerator GATT_FTM_STEP_CLIMBER_CHARACTERISTIC
enumerator GATT_FTM_STAIR_CLIMBER_CHARACTERISTIC
enumerator GATT_FTM_ROWER_DATA_CHARACTERISTIC
enumerator GATT_FTM_INDOOR_BIKE_CHARACTERISTIC
enumerator GATT_FTM_TRAINING_STATUS_CHARACTERISTIC
enumerator GATT_FTM_SUPPD_SPEED_RNG_CHARACTERISTIC
enumerator GATT_FTM_SUPPD_INCLN_RNG_CHARACTERISTIC
enumerator GATT_FTM_SUPPD_RESIS_RNG_CHARACTERISTIC
enumerator GATT_FTM_SUPPD_POWER_RNG_CHARACTERISTIC
enumerator GATT_FTM_SUPPD_HRTRE_RNG_CHARACTERISTIC
enumerator GATT_FTM_CONTROL_POINT_CHARACTERISTIC
enumerator GATT_FTM_MACHINE_STATUS_CHARACTERISTIC
enumerator GATT_RC_FEATURE_CHARACTERISTIC

Reconnection Configuration Characteristic defines

enumerator GATT_RC_SETTING_CHARACTERISTIC
enumerator GATT_RC_CP_CHARACTERISTIC
enumerator GATT_IDD_STATUS_CHANGED_CHARACTERISTIC

Insulin Delivery Characteristics defines

enumerator GATT_IDD_STATUS_CHARACTERISTIC
enumerator GATT_IDD_ANNUN_STATUS_CHARACTERISTIC
enumerator GATT_IDD_FEATURE_CHARACTERISTIC
enumerator GATT_IDD_STATUS_READER_CP_CHARACTERISTIC
enumerator GATT_IDD_COMMAND_CP_CHARACTERISTIC
enumerator GATT_IDD_COMMAND_DATA_CHARACTERISTIC
enumerator GATT_IDD_RACP_CHARACTERISTIC
enumerator GATT_IDD_HISTORY_DATA_CHARACTERISTIC
enum [anonymous]

only use for Operations Notified In Characteristic Callback

Values:

enumerator GATT_DB_READ

Read operation for Attribute

enumerator GATT_DB_WRITE

Write operation for Attribute

enumerator GATT_DB_READ_BLOB

Read blob operation for Attribute

enumerator GATT_DB_WRITE_WITHOUT_RSP

Write Without Response operation for Attribute

enumerator GATT_DB_READ_BY_TYPE

Read by UUID/Type operation for Attribute

enumerator GATT_DB_SIGNED_WRITE

Signed Write operation for Attribute

enumerator GATT_DB_EXECUTE

Execute Write operation for Attribute

enumerator GATT_DB_PREPARE

Prepare Write operation for Attribute

enumerator GATT_DB_UPDATE

Local update of a Readable Attribute Value using GATT_DB_HANDLE instead of Attribute Handle. See BT_gatt_db_set_char_val for more details.

enumerator GATT_DB_128_BIT_UUID_FORMAT

128 Bit Attribute UUID

enumerator GATT_DB_PEER_INITIATED

Peer initiated operation, needed when Peer is Reading or Writing Values either using GATT Read Procedures for Value and Descriptors.

enumerator GATT_DB_LOCALLY_INITIATED

Locally initiated operation, needed for local updates based on Attribute Handles. In case GATT_DB_HANDLE is known, use of access through GATT_DB_UPDATE is recommended.

enum [anonymous]

Values:

enumerator GATT_DB_CHAR_VALUE_READ_REQ

Characteristic Value Local Read Operation

enumerator GATT_DB_CHAR_VALUE_WRITE_REQ

Characteristic Value Local Write Operation

enumerator GATT_DB_CHAR_VALUE_WRITE_WITHOUT_REQ

Characteristic Value Local Write Without Response Operation

enumerator GATT_DB_CHAR_CLI_CNFG_READ_REQ

Characteristic Client Configuration Local Read Operation

enumerator GATT_DB_CHAR_CLI_CNFG_WRITE_REQ

Characteristic Client Configuration Local Write Operation

enumerator GATT_DB_CHAR_SER_CNFG_READ_REQ

Characteristic Server Configuration Local Read Operation

enumerator GATT_DB_CHAR_SER_CNFG_WRITE_REQ

Characteristic Server Configuration Local Write Operation

enumerator GATT_DB_CHAR_PEER_READ_REQ

Characteristic Value Peer Read Operation

enumerator GATT_DB_CHAR_PEER_WRITE_REQ

Characteristic Value Peer Write Operation

enumerator GATT_DB_CHAR_PEER_READ_BLOB_REQ

Characteristic Value Peer Read Blob Operation

enumerator GATT_DB_CHAR_PEER_WRITE_CMD

Characteristic Value Peer Write Command

enumerator GATT_DB_CHAR_PEER_READ_BY_TYPE_REQ

Characteristic Value Peer Read by Type Operation

enumerator GATT_DB_CHAR_PEER_SIGNED_WRITE_CMD

Characteristic Value Peer Signed Write Operation

enumerator GATT_DB_CHAR_PEER_EXECUTE_WRITE_REQ

Characteristic Value Peer Execute Write Req

enumerator GATT_DB_CHAR_PEER_PREPARE_WRITE_REQ

Characteristic Value Peer Prepare Write Req

enumerator GATT_DB_CHAR_PEER_CLI_CNFG_READ_REQ

Characteristic Client Configuration Peer Read Operation

enumerator GATT_DB_CHAR_PEER_CLI_CNFG_WRITE_REQ

Characteristic Client Configuration Peer Write Operation

enumerator GATT_DB_CHAR_PEER_SER_CNFG_READ_REQ

Characteristic Server Configuration Peer Read Operation

enumerator GATT_DB_CHAR_PEER_SER_CNFG_WRITE_REQ

Characteristic Server Configuration Peer Write Operation

enumerator GATT_DB_CHAR_PEER_USR_DESC_READ_REQ

Characteristic User Description Peer Read Operation

enumerator GATT_DB_CHAR_PEER_USR_DESC_WRITE_REQ

Characteristic User Description Peer Write Operation

enumerator GATT_DB_CHAR_PEER_HLD_DESC_READ_REQ

Characteristic Higher Layer Defined Descriptor Peer Read Operation

enumerator GATT_DB_CHAR_PEER_HLD_DESC_WRITE_REQ

Characteristic Higher Layer Defined Descriptor Peer Write Operation

enum [anonymous]

Values:

enumerator GATT_DB_CHAR_BROADCAST_PROPERTY

Characteristic support Broadcast of its value to the peer. Setting this property automatically includes Characteristic Server Configuration Descriptor to the Characteristic

enumerator GATT_DB_CHAR_READ_PROPERTY

Characteristic support Reading its value by peer

enumerator GATT_DB_CHAR_WRITE_WITHOUT_RSP_PROPERTY

Characteristic support Writing its value by peer Without Response

enumerator GATT_DB_CHAR_WRITE_PROPERTY

Characteristic supports Writing its value by peer

enumerator GATT_DB_CHAR_NOTIFY_PROPERTY

Characteristic supports Notifying its value to the peer. Setting this property automatically includes Characteristic Server Configuration Descriptor to the Characteristic

enumerator GATT_DB_CHAR_INDICATE_PROPERTY

Characteristic supports Indicating its value to the peer

enumerator GATT_DB_CHAR_SIGNED_WRITE_PROPERTY

Characteristic supports Signed Write on its value

enumerator GATT_DB_CHAR_WRIEABLE_AUX_PROPERTY

Characteristic supports write on its User Description Descriptor

enumerator GATT_DB_NO_AUXILLARY_PROPERTY

No Auxillary Property

enumerator GATT_DB_FIXED_LENGTH_PROPERTY

Characteristic Value is Fixed Length

enumerator GATT_DB_AUTHORIZATION_PROPERTY
enumerator GATT_DB_PEER_SPECIFIC_VAL_PROPERTY
enumerator GATT_DB_CONST_ATTR_VAL_PROPERTY
enum [anonymous]

GATT Characteristic and Descriptor permissions.

Values:

enumerator GATT_DB_PERM_NONE
enumerator GATT_DB_PERM_READ
enumerator GATT_DB_PERM_READ_ENCRYPTED
enumerator GATT_DB_PERM_READ_ENCRYPTED_MITM
enumerator GATT_DB_PERM_WRITE
enumerator GATT_DB_PERM_WRITE_ENCRYPTED
enumerator GATT_DB_PERM_WRITE_ENCRYPTED_MIMT
enumerator GATT_DB_PERM_WRITE_SIGNED
enumerator GATT_DB_PERM_WRITE_SIGNED_MITM
enum [anonymous]

Values:

enumerator GATT_DB_SER_SECURITY_LEVEL0

Security related - combination of Level, Mode and Encryption Key Size (if applicable) describes complete security needsService employs Level 0

enumerator GATT_DB_SER_SECURITY_LEVEL1

Service employs Level 1

enumerator GATT_DB_SER_SECURITY_LEVEL2

Service employs Level 2

enumerator GATT_DB_SER_SECURITY_LEVEL3

Service employs Level 3

enumerator GATT_DB_SER_SECURITY_MODE1

Service employs Mode 1

enumerator GATT_DB_SER_SECURITY_MODE2

Service employs Mode 2

enumerator GATT_DB_SER_MULTIPLE_CLIENTS_SUPPORT

ignore_this Unused right now

enumerator GATT_DB_SER_SECONDARY_SERVICE_PROPERTY

Service is a Secondary Service. If this not used, Service is by default considered to be Primary

enumerator GATT_DB_SER_128_BIT_UUID_FORMAT

Service UUID is 128-bit

enumerator GATT_DB_SER_NO_SECURITY_PROPERTY

Set this property to relax all Security on the Service

enumerator GATT_DB_SER_ENC_KEY_SIZE_DONT_CARE

This is employed to describe Service is not rigid on any Encryption Key Size. Any Size used by other Services or on the whole by the device will do

enumerator GATT_DB_SER_ENCRYPT_KEY_SIZE_7

Encyrption Key Size 7 Needed for the Service

enumerator GATT_DB_SER_ENCRYPT_KEY_SIZE_8

Encyrption Key Size 8 Needed for the Service

enumerator GATT_DB_SER_ENCRYPT_KEY_SIZE_9

Encyrption Key Size 9 Needed for the Service

enumerator GATT_DB_SER_ENCRYPT_KEY_SIZE_10

Encyrption Key Size 10 Needed for the Service

enumerator GATT_DB_SER_ENCRYPT_KEY_SIZE_11

Encyrption Key Size 11 Needed for the Service

enumerator GATT_DB_SER_ENCRYPT_KEY_SIZE_12

Encryption Key Size 12 Needed for the Service

enumerator GATT_DB_SER_ENCRYPT_KEY_SIZE_13

Encryption Key Size 13 Needed for the Service

enumerator GATT_DB_SER_ENCRYPT_KEY_SIZE_14

Encryption Key Size 14 Needed for the Service

enumerator GATT_DB_SER_ENCRYPT_KEY_SIZE_15

Encryption Key Size 15 Needed for the Service

enumerator GATT_DB_SER_ENCRYPT_KEY_SIZE_16

Encryption Key Size 16 Needed for the Service

enum ble_event_enum_t

Values:

enumerator BK_DM_BLE_EVENT_STACK_OK

ble stack init ok, param null

enumerator BK_DM_BLE_EVENT_REPORT_ADV

scan peer adv report, param ble_adv_report_t

enumerator BK_DM_BLE_EVENT_MTU_CHANGE

mtu change event, param ble_mtu_change_t

enumerator BK_DM_BLE_EVENT_CONNECT

recv connnect event, param ble_conn_att_t

enumerator BK_DM_BLE_EVENT_DISCONNECT

recv disconnect event, param ble_conn_att_t

enumerator BK_DM_BLE_EVENT_CREATE_DB

create db event, param ble_create_db_t, param null

enumerator BK_DM_BLE_EVENT_TX_DONE

tx complete event, param ble_att_tx_compl_t

enumerator BK_DM_BLE_EVENT_READ_PHY

get current conn phy result, param ble_read_phy_t

enumerator BK_DM_BLE_EVENT_CONN_UPDATA

recv ble conn update event result, param ble_conn_update_param_compl_ind_t

enumerator BK_DM_BLE_EVENT_DISCOVERY_PRIMARY_SERVICE

discover peer primary service result, param ble_discovery_primary_service_t

enumerator BK_DM_BLE_EVENT_DISCOVERY_CHAR

discover peer characteristic result, param ble_discovery_char_t

enumerator BK_DM_BLE_EVENT_RECV_NOTIFY

recv gatt client notify, param ble_att_notify_t

enumerator BK_DM_BLE_EVENT_ATT_READ_RESPONSE

recv gatt read response, param ble_att_rw_t

enumerator BK_DM_BLE_EVENT_CONN_UPD_PAR_ASK

recv ble connection param update req, param ble_conn_update_param_ind_t

enum advertise_filter_policy

use in bk_ble_set_advertising_params

Values:

enumerator ADV_FILTER_POLICY_ALLOW_SCAN_ANY_CONNECT_ANY

both scan and connect

enumerator ADV_FILTER_POLICY_ALLOW_SCAN_WLST_CONNECT_ANY

scan only in white list, connect any

enumerator ADV_FILTER_POLICY_ALLOW_SCAN_ANY_CONNECT_WLIT

scan any, connect only in white list

enumerator ADV_FILTER_POLICY_ALLOW_SCAN_WLIT_CONNECT_WLIT

both scan connect only in white list

enum advertise_legacy_type

use in bk_ble_set_advertising_params

Values:

enumerator ADV_LEGACY_TYPE_ADV_IND

adv that can be scan and connect

enumerator ADV_LEGACY_TYPE_ADV_DIRECT_IND_HIGH

adv that can be connect by special device(white list). This send adv more frequently.

enumerator ADV_LEGACY_TYPE_ADV_SCAN_IND

adv that can be scan

enumerator ADV_LEGACY_TYPE_ADV_NON_IND

adv that can’t be scan and connect

enumerator ADV_LEGACY_TYPE_ADV_DIRECT_IND_LOW

adv that can be connect by special device(white list). This send adv more few.