Added support for obtaining BLE device name by parsing advertising data.

Fork of BLE_BlueNRG by Mridupawan Das

Committer:
hemddabral
Date:
Thu Jul 31 11:09:28 2014 +0000
Revision:
7:e293b0f43dc7
Parent:
0:309c845d289d
Added support for parsing BLE device name from advertising data

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mridup 0:309c845d289d 1 /******************** (C) COPYRIGHT 2012 STMicroelectronics ********************
mridup 0:309c845d289d 2 * File Name : ble_status.h
mridup 0:309c845d289d 3 * Author : AMS - HEA&RF BU
mridup 0:309c845d289d 4 * Version : V1.0.0
mridup 0:309c845d289d 5 * Date : 19-July-2012
mridup 0:309c845d289d 6 * Description : Header file with BLE Stack status codes.
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 #ifndef __BLE_STATUS_H__
mridup 0:309c845d289d 16 #define __BLE_STATUS_H__
mridup 0:309c845d289d 17
mridup 0:309c845d289d 18 #include <hal_types.h>
mridup 0:309c845d289d 19
mridup 0:309c845d289d 20
mridup 0:309c845d289d 21 /** @defgroup ble_status Bluetooth Status/Error Codes
mridup 0:309c845d289d 22 * @{
mridup 0:309c845d289d 23 */
mridup 0:309c845d289d 24
mridup 0:309c845d289d 25 typedef tHalUint8 tBleStatus;
mridup 0:309c845d289d 26
mridup 0:309c845d289d 27 /* Error Codes as specified by the specification
mridup 0:309c845d289d 28 * according to the spec the error codes range
mridup 0:309c845d289d 29 * from 0x00 to 0x3F
mridup 0:309c845d289d 30 */
mridup 0:309c845d289d 31 #define ERR_CMD_SUCCESS (0x00)
mridup 0:309c845d289d 32 #define BLE_STATUS_SUCCESS (0x00)
mridup 0:309c845d289d 33 #define ERR_UNKNOWN_HCI_COMMAND (0x01)
mridup 0:309c845d289d 34 #define ERR_UNKNOWN_CONN_IDENTIFIER (0x02)
mridup 0:309c845d289d 35
mridup 0:309c845d289d 36 #define ERR_AUTH_FAILURE (0x05)
mridup 0:309c845d289d 37 #define ERR_PIN_OR_KEY_MISSING (0x06)
mridup 0:309c845d289d 38 #define ERR_MEM_CAPACITY_EXCEEDED (0x07)
mridup 0:309c845d289d 39 #define ERR_CONNECTION_TIMEOUT (0x08)
mridup 0:309c845d289d 40
mridup 0:309c845d289d 41 #define ERR_COMMAND_DISALLOWED (0x0C)
mridup 0:309c845d289d 42
mridup 0:309c845d289d 43 #define ERR_UNSUPPORTED_FEATURE (0x11)
mridup 0:309c845d289d 44 #define ERR_INVALID_HCI_CMD_PARAMS (0x12)
mridup 0:309c845d289d 45 #define ERR_RMT_USR_TERM_CONN (0x13)
mridup 0:309c845d289d 46 #define ERR_RMT_DEV_TERM_CONN_LOW_RESRCES (0x14)
mridup 0:309c845d289d 47 #define ERR_RMT_DEV_TERM_CONN_POWER_OFF (0x15)
mridup 0:309c845d289d 48 #define ERR_LOCAL_HOST_TERM_CONN (0x16)
mridup 0:309c845d289d 49
mridup 0:309c845d289d 50 #define ERR_UNSUPP_RMT_FEATURE (0x1A)
mridup 0:309c845d289d 51
mridup 0:309c845d289d 52 #define ERR_INVALID_LMP_PARAM (0x1E)
mridup 0:309c845d289d 53 #define ERR_UNSPECIFIED_ERROR (0x1F)
mridup 0:309c845d289d 54
mridup 0:309c845d289d 55 #define ERR_LL_RESP_TIMEOUT (0x22)
mridup 0:309c845d289d 56 #define ERR_LMP_PDU_NOT_ALLOWED (0x24)
mridup 0:309c845d289d 57
mridup 0:309c845d289d 58 #define ERR_INSTANT_PASSED (0x28)
mridup 0:309c845d289d 59
mridup 0:309c845d289d 60 #define ERR_PAIR_UNIT_KEY_NOT_SUPP (0x29)
mridup 0:309c845d289d 61 #define ERR_CONTROLLER_BUSY (0x3A)
mridup 0:309c845d289d 62
mridup 0:309c845d289d 63 #define ERR_DIRECTED_ADV_TIMEOUT (0x3C)
mridup 0:309c845d289d 64
mridup 0:309c845d289d 65 #define ERR_CONN_END_WITH_MIC_FAILURE (0x3D)
mridup 0:309c845d289d 66
mridup 0:309c845d289d 67 #define ERR_CONN_FAILED_TO_ESTABLISH (0x3E)
mridup 0:309c845d289d 68
mridup 0:309c845d289d 69
mridup 0:309c845d289d 70 /**
mridup 0:309c845d289d 71 * Generic/System error codes
mridup 0:309c845d289d 72 * starts with 0x40
mridup 0:309c845d289d 73 */
mridup 0:309c845d289d 74
mridup 0:309c845d289d 75 #define BLE_STATUS_FAILED (0x41)
mridup 0:309c845d289d 76 #define BLE_STATUS_INVALID_PARAMS (0x42)
mridup 0:309c845d289d 77 #define BLE_STATUS_BUSY (0x43)
mridup 0:309c845d289d 78 #define BLE_STATUS_INVALID_LEN_PDU (0x44)
mridup 0:309c845d289d 79 #define BLE_STATUS_PENDING (0x45)
mridup 0:309c845d289d 80 #define BLE_STATUS_NOT_ALLOWED (0x46)
mridup 0:309c845d289d 81 #define BLE_STATUS_ERROR (0x47)
mridup 0:309c845d289d 82
mridup 0:309c845d289d 83 /**
mridup 0:309c845d289d 84 * flash error codes
mridup 0:309c845d289d 85 * starts with 0x49
mridup 0:309c845d289d 86 */
mridup 0:309c845d289d 87 #define FLASH_READ_FAILED (0x49)
mridup 0:309c845d289d 88 #define FLASH_WRITE_FAILED (0x4A)
mridup 0:309c845d289d 89 #define FLASH_ERASE_FAILED (0x4B)
mridup 0:309c845d289d 90
mridup 0:309c845d289d 91 /**
mridup 0:309c845d289d 92 * L2CAP error codes
mridup 0:309c845d289d 93 * starts with 0x50
mridup 0:309c845d289d 94 */
mridup 0:309c845d289d 95 #define BLE_STATUS_INVALID_CID (0x50)
mridup 0:309c845d289d 96
mridup 0:309c845d289d 97 /*
mridup 0:309c845d289d 98 * timer error codes
mridup 0:309c845d289d 99 * starts with 0x54
mridup 0:309c845d289d 100 */
mridup 0:309c845d289d 101 #define TIMER_NOT_VALID_LAYER (0x54)
mridup 0:309c845d289d 102 #define TIMER_INSUFFICIENT_RESOURCES (0x55)
mridup 0:309c845d289d 103
mridup 0:309c845d289d 104 /**
mridup 0:309c845d289d 105 * SM error codes
mridup 0:309c845d289d 106 * starts with 0x5A
mridup 0:309c845d289d 107 */
mridup 0:309c845d289d 108 #define BLE_STATUS_CSRK_NOT_FOUND (0x5A)
mridup 0:309c845d289d 109 #define BLE_STATUS_IRK_NOT_FOUND (0x5B)
mridup 0:309c845d289d 110 #define BLE_STATUS_DEV_NOT_FOUND_IN_DB (0x5C)
mridup 0:309c845d289d 111 #define BLE_STATUS_SEC_DB_FULL (0x5D)
mridup 0:309c845d289d 112 #define BLE_STATUS_DEV_NOT_BONDED (0x5E)
mridup 0:309c845d289d 113
mridup 0:309c845d289d 114 /**
mridup 0:309c845d289d 115 * Gatt Error Codes
mridup 0:309c845d289d 116 * starts with 0x60
mridup 0:309c845d289d 117 */
mridup 0:309c845d289d 118 #define BLE_STATUS_INVALID_HANDLE (0x60)
mridup 0:309c845d289d 119 #define BLE_STATUS_INVALID_PARAMETER (0x61)
mridup 0:309c845d289d 120 #define BLE_STATUS_OUT_OF_HANDLE (0x62)
mridup 0:309c845d289d 121 #define BLE_STATUS_INVALID_OPERATION (0x63)
mridup 0:309c845d289d 122 #define BLE_STATUS_INSUFFICIENT_RESOURCES (0x64)
mridup 0:309c845d289d 123 #define BLE_INSUFFICIENT_ENC_KEYSIZE (0x65)
mridup 0:309c845d289d 124 #define BLE_STATUS_CHARAC_ALREADY_EXISTS (0x66)
mridup 0:309c845d289d 125
mridup 0:309c845d289d 126 /**
mridup 0:309c845d289d 127 * @}
mridup 0:309c845d289d 128 */
mridup 0:309c845d289d 129
mridup 0:309c845d289d 130
mridup 0:309c845d289d 131 #endif /* __BLE_STATUS_H__ */