BLE UART example

Fork of Nucleo_BLE_BlueNRG by ST Americas mbed Team

Committer:
sjallouli
Date:
Sun Jan 03 16:05:38 2016 +0000
Revision:
3:104f1bba39ca
Parent:
0:a948f5f3904c
test

Who changed what in which revision?

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