Added support for obtaining BLE device name by parsing advertising data.
Fork of BLE_BlueNRG by
hci/inc/bluenrg_hci.h@2:a2b623661316, 2014-07-21 (annotated)
- Committer:
- mridup
- Date:
- Mon Jul 21 08:28:47 2014 +0000
- Revision:
- 2:a2b623661316
- Parent:
- 0:309c845d289d
Latest Changes 21/07
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mridup | 0:309c845d289d | 1 | /******************** (C) COPYRIGHT 2013 STMicroelectronics ******************** |
mridup | 0:309c845d289d | 2 | * File Name : bluenrg_hci.h |
mridup | 0:309c845d289d | 3 | * Author : AMS - HEA&RF BU |
mridup | 0:309c845d289d | 4 | * Version : V1.0.0 |
mridup | 0:309c845d289d | 5 | * Date : 4-Oct-2013 |
mridup | 0:309c845d289d | 6 | * Description : Header file with HCI commands for BlueNRG FW6.0 and above. |
mridup | 0:309c845d289d | 7 | ******************************************************************************** |
mridup | 0:309c845d289d | 8 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS |
mridup | 0:309c845d289d | 9 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. |
mridup | 0:309c845d289d | 10 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, |
mridup | 0:309c845d289d | 11 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE |
mridup | 0:309c845d289d | 12 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING |
mridup | 0:309c845d289d | 13 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. |
mridup | 0:309c845d289d | 14 | *******************************************************************************/ |
mridup | 0:309c845d289d | 15 | |
mridup | 0:309c845d289d | 16 | #ifndef __BLUENRG_HCI_H__ |
mridup | 0:309c845d289d | 17 | #define __BLUENRG_HCI_H__ |
mridup | 0:309c845d289d | 18 | |
mridup | 2:a2b623661316 | 19 | #include "gatt_service.h" |
mridup | 0:309c845d289d | 20 | |
mridup | 0:309c845d289d | 21 | tBleStatus aci_gatt_init(void); |
mridup | 0:309c845d289d | 22 | tBleStatus aci_gap_init(uint8_t role, |
mridup | 0:309c845d289d | 23 | uint16_t* service_handle, |
mridup | 0:309c845d289d | 24 | uint16_t* dev_name_char_handle, |
mridup | 0:309c845d289d | 25 | uint16_t* appearance_char_handle); |
mridup | 0:309c845d289d | 26 | tBleStatus aci_gap_update_adv_data(uint8_t AdvLen, const uint8_t *AdvData); |
mridup | 0:309c845d289d | 27 | tBleStatus aci_gap_set_non_discoverable(void); |
mridup | 0:309c845d289d | 28 | tBleStatus aci_gap_set_discoverable(uint8_t AdvType, uint16_t AdvIntervMin, uint16_t AdvIntervMax, |
mridup | 0:309c845d289d | 29 | uint8_t OwnAddrType, uint8_t AdvFilterPolicy, uint8_t LocalNameLen, |
mridup | 0:309c845d289d | 30 | const char *LocalName, uint8_t ServiceUUIDLen, const uint8_t* ServiceUUIDList, |
mridup | 0:309c845d289d | 31 | uint16_t SlaveConnIntervMin, uint16_t SlaveConnIntervMax); |
mridup | 0:309c845d289d | 32 | tBleStatus aci_gap_set_auth_requirement(uint8_t mitm_mode, |
mridup | 0:309c845d289d | 33 | uint8_t oob_enable, |
mridup | 0:309c845d289d | 34 | uint8_t oob_data[16], |
mridup | 0:309c845d289d | 35 | uint8_t min_encryption_key_size, |
mridup | 0:309c845d289d | 36 | uint8_t max_encryption_key_size, |
mridup | 0:309c845d289d | 37 | uint8_t use_fixed_pin, |
mridup | 0:309c845d289d | 38 | uint32_t fixed_pin, |
mridup | 0:309c845d289d | 39 | uint8_t bonding_mode); |
mridup | 0:309c845d289d | 40 | tBleStatus aci_gap_start_limited_discovery_proc(uint16_t scanInterval, uint16_t scanWindow, |
mridup | 0:309c845d289d | 41 | uint8_t own_address_type, uint8_t filterDuplicates); |
mridup | 0:309c845d289d | 42 | tBleStatus aci_gap_start_general_discovery_proc(uint16_t scanInterval, uint16_t scanWindow, |
mridup | 0:309c845d289d | 43 | uint8_t own_address_type, uint8_t filterDuplicates); |
mridup | 0:309c845d289d | 44 | tBleStatus aci_gap_start_auto_conn_establishment(uint16_t scanInterval, uint16_t scanWindow, |
mridup | 0:309c845d289d | 45 | uint8_t own_bdaddr_type, uint16_t conn_min_interval, |
mridup | 0:309c845d289d | 46 | uint16_t conn_max_interval, uint16_t conn_latency, |
mridup | 0:309c845d289d | 47 | uint16_t supervision_timeout, uint16_t min_conn_length, |
mridup | 0:309c845d289d | 48 | uint16_t max_conn_length, uint8_t num_whitelist_entries, |
mridup | 0:309c845d289d | 49 | uint8_t *addr_array); |
mridup | 0:309c845d289d | 50 | tBleStatus aci_gap_create_connection(uint16_t scanInterval, uint16_t scanWindow, |
mridup | 0:309c845d289d | 51 | uint8_t peer_bdaddr_type, tBDAddr peer_bdaddr, |
mridup | 0:309c845d289d | 52 | uint8_t own_bdaddr_type, uint16_t conn_min_interval, |
mridup | 0:309c845d289d | 53 | uint16_t conn_max_interval, uint16_t conn_latency, |
mridup | 0:309c845d289d | 54 | uint16_t supervision_timeout, uint16_t min_conn_length, |
mridup | 0:309c845d289d | 55 | uint16_t max_conn_length); |
mridup | 0:309c845d289d | 56 | tBleStatus aci_gap_terminate_gap_procedure(uint8_t procedure_code); |
mridup | 0:309c845d289d | 57 | tBleStatus aci_gap_terminate(uint16_t conn_handle, uint8_t reason); |
mridup | 0:309c845d289d | 58 | tBleStatus aci_gatt_add_serv(tHalUint8 service_uuid_type, |
mridup | 0:309c845d289d | 59 | const tHalUint8* service_uuid, |
mridup | 0:309c845d289d | 60 | tHalUint8 service_type, |
mridup | 0:309c845d289d | 61 | tHalUint8 max_attr_records, |
mridup | 0:309c845d289d | 62 | tHalUint16 *serviceHandle); |
mridup | 0:309c845d289d | 63 | tBleStatus aci_gatt_add_char(tHalUint16 serviceHandle, |
mridup | 0:309c845d289d | 64 | tUuidType charUuidType, |
mridup | 0:309c845d289d | 65 | const tHalUint8* charUuid, |
mridup | 0:309c845d289d | 66 | tHalUint16 charValueLen, |
mridup | 0:309c845d289d | 67 | tHalUint8 charProperties, |
mridup | 0:309c845d289d | 68 | tAttrSecurityFlags secPermissions, |
mridup | 0:309c845d289d | 69 | tGattServerEvent gattEvtMask, |
mridup | 0:309c845d289d | 70 | tHalUint8 encryKeySize, |
mridup | 0:309c845d289d | 71 | tHalUint8 isVariable, |
mridup | 0:309c845d289d | 72 | tHalUint16* charHandle); |
mridup | 0:309c845d289d | 73 | tBleStatus aci_gatt_add_char_desc(tHalUint16 serviceHandle, |
mridup | 0:309c845d289d | 74 | tHalUint16 charHandle, |
mridup | 0:309c845d289d | 75 | tUuidType descUuidType, |
mridup | 0:309c845d289d | 76 | const tHalUint8* uuid, |
mridup | 0:309c845d289d | 77 | tHalUint8 descValueMaxLen, |
mridup | 0:309c845d289d | 78 | tHalUint8 descValueLen, |
mridup | 0:309c845d289d | 79 | const void* descValue, |
mridup | 0:309c845d289d | 80 | tAttrSecurityFlags secPermissions, |
mridup | 0:309c845d289d | 81 | tAttrSecurityFlags accPermissions, |
mridup | 0:309c845d289d | 82 | tGattServerEvent gattEvtMask, |
mridup | 0:309c845d289d | 83 | tHalUint8 encryKeySize, |
mridup | 0:309c845d289d | 84 | tHalUint8 isVariable, |
mridup | 0:309c845d289d | 85 | tHalUint16* descHandle); |
mridup | 0:309c845d289d | 86 | tBleStatus aci_gatt_update_char_value(tHalUint16 servHandle, |
mridup | 0:309c845d289d | 87 | tHalUint16 charHandle, |
mridup | 0:309c845d289d | 88 | tHalUint8 charValOffset, |
mridup | 0:309c845d289d | 89 | tHalUint8 charValueLen, |
mridup | 0:309c845d289d | 90 | const tHalUint8 *charValue); |
mridup | 0:309c845d289d | 91 | |
mridup | 0:309c845d289d | 92 | tBleStatus aci_gatt_set_desc_value(tHalUint16 servHandle, |
mridup | 0:309c845d289d | 93 | tHalUint16 charHandle, |
mridup | 0:309c845d289d | 94 | tHalUint16 charDescHandle, |
mridup | 0:309c845d289d | 95 | tHalUint16 charDescValOffset, |
mridup | 0:309c845d289d | 96 | tHalUint8 charDescValueLen, |
mridup | 0:309c845d289d | 97 | const tHalUint8 *charDescValue); |
mridup | 0:309c845d289d | 98 | |
mridup | 0:309c845d289d | 99 | tBleStatus aci_l2cap_connection_parameter_update_request(uint16_t conn_handle, uint16_t interval_min, uint16_t interval_max, |
mridup | 0:309c845d289d | 100 | uint16_t slave_latency, uint16_t timeout_mult); |
mridup | 0:309c845d289d | 101 | |
mridup | 0:309c845d289d | 102 | tBleStatus aci_hal_set_tx_power_level(uint8_t en_high_power, uint8_t pa_level); |
mridup | 0:309c845d289d | 103 | |
mridup | 0:309c845d289d | 104 | tBleStatus aci_hal_write_config_data(tHalUint8 offset, |
mridup | 0:309c845d289d | 105 | tHalUint8 len, |
mridup | 0:309c845d289d | 106 | const tHalUint8 *val); |
mridup | 0:309c845d289d | 107 | tBleStatus aci_hal_tone_start(uint8_t rf_channel); |
mridup | 0:309c845d289d | 108 | |
mridup | 0:309c845d289d | 109 | tBleStatus aci_gatt_allow_read(tHalUint16 conn_handle); |
mridup | 0:309c845d289d | 110 | |
mridup | 0:309c845d289d | 111 | tBleStatus aci_gatt_disc_all_prim_services(uint16_t conn_handle); |
mridup | 0:309c845d289d | 112 | |
mridup | 0:309c845d289d | 113 | tBleStatus aci_gatt_find_included_services(uint16_t conn_handle, uint16_t start_handle, |
mridup | 0:309c845d289d | 114 | uint16_t end_handle); |
mridup | 0:309c845d289d | 115 | |
mridup | 0:309c845d289d | 116 | tBleStatus aci_gatt_disc_all_charac_of_serv(uint16_t conn_handle, uint16_t start_attr_handle, |
mridup | 0:309c845d289d | 117 | uint16_t end_attr_handle); |
mridup | 0:309c845d289d | 118 | |
mridup | 0:309c845d289d | 119 | tBleStatus aci_gatt_disc_all_charac_descriptors(uint16_t conn_handle, uint16_t char_val_handle, |
mridup | 0:309c845d289d | 120 | uint16_t char_end_handle); |
mridup | 0:309c845d289d | 121 | |
mridup | 0:309c845d289d | 122 | tBleStatus aci_gatt_read_charac_val(uint16_t conn_handle, uint16_t attr_handle); |
mridup | 0:309c845d289d | 123 | |
mridup | 0:309c845d289d | 124 | tBleStatus aci_gatt_read_long_charac_val(uint16_t conn_handle, uint16_t attr_handle, |
mridup | 0:309c845d289d | 125 | uint16_t val_offset); |
mridup | 0:309c845d289d | 126 | |
mridup | 0:309c845d289d | 127 | tBleStatus aci_gatt_write_charac_value(uint16_t conn_handle, uint16_t attr_handle, |
mridup | 0:309c845d289d | 128 | uint8_t value_len, uint8_t *attr_value); |
mridup | 0:309c845d289d | 129 | |
mridup | 0:309c845d289d | 130 | tBleStatus aci_gatt_write_charac_descriptor(uint16_t conn_handle, uint16_t attr_handle, |
mridup | 0:309c845d289d | 131 | uint8_t value_len, uint8_t *attr_value); |
mridup | 0:309c845d289d | 132 | |
mridup | 0:309c845d289d | 133 | tBleStatus aci_gatt_write_without_response(uint16_t conn_handle, uint16_t attr_handle, |
mridup | 0:309c845d289d | 134 | uint8_t value_len, uint8_t *attr_value); |
mridup | 0:309c845d289d | 135 | |
mridup | 0:309c845d289d | 136 | tBleStatus aci_gatt_write_response(uint16_t conn_handle, |
mridup | 0:309c845d289d | 137 | uint16_t attr_handle, |
mridup | 0:309c845d289d | 138 | uint8_t write_status, |
mridup | 0:309c845d289d | 139 | uint8_t err_code, |
mridup | 0:309c845d289d | 140 | uint8_t att_val_len, |
mridup | 0:309c845d289d | 141 | uint8_t *att_val); |
mridup | 0:309c845d289d | 142 | |
mridup | 0:309c845d289d | 143 | #endif /* __BLUENRG_HCI_H__ */ |