Bluetooth Low Energy GATT Server/Client API. More...
Go to the source code of this file.
Classes | |
| struct | BLE_UUID128 |
| 128-bit UUID structure for BLE More... | |
| struct | BLE_UUID_ALIAS |
| UUID base + alias structure. More... | |
| struct | BLE_UUID |
| BLE UUID structure. More... | |
| struct | BLE_ATTR_PERM |
| Attribute permission structure. More... | |
| struct | BLE_CHAR_VALUE |
| characteristic value attribute structure More... | |
| struct | BLE_CHAR_PROP |
| Characteristic standard properties. More... | |
| struct | ble_gatt_peripheral_ops_s |
| Bluetooth LE characteristic callbacks(for Peripheral) More... | |
| struct | ble_gatt_char_s |
| Bluetooth LE GATT characteristic context. More... | |
| struct | ble_gatt_service_s |
| Bluetooth LE GATT service context. More... | |
| struct | ble_gatt_state_s |
| Bluetooth LE GATT context. More... | |
| struct | ble_gattc_handle_range_s |
| GATTC handle range structure. More... | |
| struct | ble_gattc_char_s |
| GATTC characteristic structure. More... | |
| struct | ble_gattc_db_disc_char_s |
| GATTC discovered characteristic data structure. More... | |
| struct | ble_gattc_db_disc_srv_s |
| GATTC discovered service data structure. More... | |
| struct | ble_gattc_db_discovery_s |
| GATTC discovered attribute database data structure. More... | |
| struct | ble_gatt_coverrun_state_s |
| struct | ble_gatt_event_db_discovery_t |
| GATTC attribute database discovery event structure. More... | |
| struct | ble_gatt_central_ops_s |
| Bluetooth LE characteristic callbacks(for Central) More... | |
Enumerations | |
| enum | BLE_GATT_UUID_TYPE { BLE_UUID_TYPE_UUID128 = 0 , BLE_UUID_TYPE_BASEALIAS_BTSIG , BLE_UUID_TYPE_BASEALIAS_VENDOR } |
| GATTS UUID type. More... | |
| enum | BLE_GATT_TYPE { BLE_GATTS_SRVTYP_PRIMARY = 1 , BLE_GATTS_SRVTYP_SECONDARY } |
| GATTS service type. More... | |
| enum | BLE_SEC_MODE { BLE_SEC_MODE_NO_ACCESS = 0x00 , BLE_SEC_MODE1LV1_NO_SEC , BLE_SEC_MODE1LV2_NO_MITM_ENC , BLE_SEC_MODE1LV3_MITM_ENC , BLE_SEC_MODE2LV1_NO_MITM_DATA_SGN , BLE_SEC_MODE2LV2__MITM_DATA_SGN } |
Functions | |
| bool | ble_gatt_is_supported (void) |
| Get Bluetooth Low Ennergy GATT support or not support. More... | |
| int | ble_create_service (struct ble_gatt_service_s **service) |
| BLE Create GATT Service Create GATT Service instance and return instance pointer via *service. More... | |
| int | ble_register_servce (struct ble_gatt_service_s *service) |
| BLE Register GATT Service Register GATT Service to HAL. More... | |
| int | ble_add_characteristic (struct ble_gatt_service_s *service, struct ble_gatt_char_s *charc) |
| BLE add Characteristic to service Add characteristic to service. More... | |
| int | ble_characteristic_notify (uint16_t conn_handle, struct ble_gatt_char_s *charc, uint8_t *data, int len) |
| BLE Notify Characteristic value Notify characteristic value to Central (For Peripheral role) More... | |
| int | ble_characteristic_read (uint16_t conn_handle, struct ble_gatt_char_s *charc) |
| BLE Read Characteristic value (Deprecated) Send read characteristic request to peripheral (For Central role) More... | |
| int | ble_characteristic_write (uint16_t conn_handle, struct ble_gatt_char_s *charc, uint8_t *data, int len) |
| BLE Write Characteristic value (Deprecated) Send write characteristic request to peripheral (For Central role) More... | |
| int | ble_read_characteristic (uint16_t conn_handle, uint16_t char_handle) |
| BLE Read Characteristic value Send read characteristic request to peripheral (For Central role) More... | |
| int | ble_write_characteristic (uint16_t conn_handle, uint16_t char_handle, uint8_t *data, int len, bool rsp) |
| BLE Write Characteristic value Send write characteristic request to peripheral (For Central role) More... | |
| int | ble_descriptor_read (uint16_t conn_handle, uint16_t handle) |
| BLE Read Descriptor value Send read descriptor request to peripheral (For Central role) More... | |
| int | ble_descriptor_write (uint16_t conn_handle, uint16_t handle, uint8_t *data, int len) |
| BLE Write Descriptor value Send write descriptor request to peripheral (For Central role) More... | |
| int | ble_start_db_discovery (uint16_t conn_handle) |
| BLE start database discovery Send database discovery request to peripheral (For Central role) In case of device/nrf52 configuration, 128-bit UUID information is not discovered correctly. Then, you may use ble_discover_uuid() API. More... | |
| int | ble_continue_db_discovery (uint16_t start_handle, uint16_t conn_handle) |
| BLE continue database discovery Send continue database discovery request to peripheral (For Central role) In case of device/nrf52 configuration, 128-bit UUID information is not discovered correctly. Then, you may use ble_discover_uuid() API. More... | |
| int | ble_discover_uuid (uint16_t conn_handle, BLE_UUID *srv_uuid, BLE_UUID *char_uuid) |
| Discover GATT database with specific UUID. More... | |
| int | ble_set_vendor_uuid (BLE_UUID *uuid) |
| Set vendor specific UUID This API allows the vendor specific UUID to be discovered. More... | |
Bluetooth Low Energy GATT Server/Client API.
This API is for using BLE GATT and includes Function and Callback
| enum BLE_GATT_UUID_TYPE |
| enum BLE_GATT_TYPE |
| enum BLE_SEC_MODE |
| bool ble_gatt_is_supported | ( | void | ) |
Get Bluetooth Low Ennergy GATT support or not support.
| Suppot | or Not support |
| int ble_create_service | ( | struct ble_gatt_service_s ** | service | ) |
BLE Create GATT Service Create GATT Service instance and return instance pointer via *service.
| [out] | service | Bluetooth LE service context ble_gatt_service_s |
| error | code |
| int ble_register_servce | ( | struct ble_gatt_service_s * | service | ) |
BLE Register GATT Service Register GATT Service to HAL.
| [in] | service | Bluetooth LE GATT service context ble_gatt_service_s |
| error | code |
| int ble_add_characteristic | ( | struct ble_gatt_service_s * | service, |
| struct ble_gatt_char_s * | charc | ||
| ) |
BLE add Characteristic to service Add characteristic to service.
| [in] | service | Bluetooth LE GATT service context ble_gatt_service_s |
| [in] | charc | Bluetooth LE GATT characteristic context ble_gatt_char_s |
| error | code |
| int ble_characteristic_notify | ( | uint16_t | conn_handle, |
| struct ble_gatt_char_s * | charc, | ||
| uint8_t * | data, | ||
| int | len | ||
| ) |
BLE Notify Characteristic value Notify characteristic value to Central (For Peripheral role)
| [in] | conn_handle | connection handle for which notification is sent |
| [in] | charc | Target characteristic ble_gatt_char_s |
| [in] | data | Notify data |
| [in] | len | Notify data length |
| error | code |
| int ble_characteristic_read | ( | uint16_t | conn_handle, |
| struct ble_gatt_char_s * | charc | ||
| ) |
BLE Read Characteristic value (Deprecated) Send read characteristic request to peripheral (For Central role)
| [in] | conn_handle | connection handle for which read request is sent |
| [in] | charc | Bluetooth LE GATT characteristic context ble_gatt_char_s |
| error | code |
| int ble_characteristic_write | ( | uint16_t | conn_handle, |
| struct ble_gatt_char_s * | charc, | ||
| uint8_t * | data, | ||
| int | len | ||
| ) |
BLE Write Characteristic value (Deprecated) Send write characteristic request to peripheral (For Central role)
| [in] | conn_handle | connection handle for which write request is sent |
| [in] | charc | Bluetooth LE GATT characteristic context ble_gatt_char_s |
| [in] | data | Write data |
| [in] | len | Write data length |
| error | code |
| int ble_read_characteristic | ( | uint16_t | conn_handle, |
| uint16_t | char_handle | ||
| ) |
BLE Read Characteristic value Send read characteristic request to peripheral (For Central role)
| [in] | conn_handle | connection handle for which write request is sent |
| [in] | char_handle | characteristic handle for which write request is sent |
| error | code |
| int ble_write_characteristic | ( | uint16_t | conn_handle, |
| uint16_t | char_handle, | ||
| uint8_t * | data, | ||
| int | len, | ||
| bool | rsp | ||
| ) |
BLE Write Characteristic value Send write characteristic request to peripheral (For Central role)
| [in] | conn_handle | connection handle for which write request is sent |
| [in] | char_handle | characteristic handle for which write request is sent |
| [in] | data | Write data |
| [in] | len | Write data length |
| [in] | rsp | Require write response to receive write result |
| error | code |
| int ble_descriptor_read | ( | uint16_t | conn_handle, |
| uint16_t | handle | ||
| ) |
BLE Read Descriptor value Send read descriptor request to peripheral (For Central role)
| [in] | conn_handle | connection handle |
| [in] | handle | desctiptor handle |
| error | code |
| int ble_descriptor_write | ( | uint16_t | conn_handle, |
| uint16_t | handle, | ||
| uint8_t * | data, | ||
| int | len | ||
| ) |
BLE Write Descriptor value Send write descriptor request to peripheral (For Central role)
| [in] | conn_handle | connection handle |
| [in] | handle | desctiptor handle |
| [in] | data | Write data |
| [in] | len | Write data length |
| error | code |
| int ble_start_db_discovery | ( | uint16_t | conn_handle | ) |
BLE start database discovery Send database discovery request to peripheral (For Central role) In case of device/nrf52 configuration, 128-bit UUID information is not discovered correctly. Then, you may use ble_discover_uuid() API.
| [in] | conn_handle | Bluetooth LE GATT connection handle |
| error | code |
| int ble_continue_db_discovery | ( | uint16_t | start_handle, |
| uint16_t | conn_handle | ||
| ) |
BLE continue database discovery Send continue database discovery request to peripheral (For Central role) In case of device/nrf52 configuration, 128-bit UUID information is not discovered correctly. Then, you may use ble_discover_uuid() API.
| [in] | start_handle | Bluetooth LE GATT start handle |
| [in] | conn_handle | Bluetooth LE GATT connection handle |
| error | code |
Discover GATT database with specific UUID.
| [in] | conn_handle | BLE connection handle |
| [in] | srv_uuid | Service UUID to be discovered |
| [in] | char_uuid | Characteristic UUID to be discovered |
| error | code |
| int ble_set_vendor_uuid | ( | BLE_UUID * | uuid | ) |
Set vendor specific UUID This API allows the vendor specific UUID to be discovered.
| [in] | uuid | Vendor Specific UUID (128 bit) |
| error | code |