CSSE4011_BLE_IMU IMU Seeed Tiny Ble

Dependencies:   BLE_API_Tiny_BLE MPU6050-DMP-Seeed-Tiny-BLE mbed

Committer:
flywind
Date:
Wed Jun 10 09:46:16 2015 +0000
Revision:
0:f90c3452d779
CSSE4011_Seed-Tiny-BLE

Who changed what in which revision?

UserRevisionLine numberNew contents of line
flywind 0:f90c3452d779 1 /**************************************************************************/
flywind 0:f90c3452d779 2 /*!
flywind 0:f90c3452d779 3 @file ble_error.h
flywind 0:f90c3452d779 4 @author hathach (tinyusb.org)
flywind 0:f90c3452d779 5
flywind 0:f90c3452d779 6 @section LICENSE
flywind 0:f90c3452d779 7
flywind 0:f90c3452d779 8 Software License Agreement (BSD License)
flywind 0:f90c3452d779 9
flywind 0:f90c3452d779 10 Copyright (c) 2013, K. Townsend (microBuilder.eu)
flywind 0:f90c3452d779 11 All rights reserved.
flywind 0:f90c3452d779 12
flywind 0:f90c3452d779 13 Redistribution and use in source and binary forms, with or without
flywind 0:f90c3452d779 14 modification, are permitted provided that the following conditions are met:
flywind 0:f90c3452d779 15 1. Redistributions of source code must retain the above copyright
flywind 0:f90c3452d779 16 notice, this list of conditions and the following disclaimer.
flywind 0:f90c3452d779 17 2. Redistributions in binary form must reproduce the above copyright
flywind 0:f90c3452d779 18 notice, this list of conditions and the following disclaimer in the
flywind 0:f90c3452d779 19 documentation and/or other materials provided with the distribution.
flywind 0:f90c3452d779 20 3. Neither the name of the copyright holders nor the
flywind 0:f90c3452d779 21 names of its contributors may be used to endorse or promote products
flywind 0:f90c3452d779 22 derived from this software without specific prior written permission.
flywind 0:f90c3452d779 23
flywind 0:f90c3452d779 24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
flywind 0:f90c3452d779 25 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
flywind 0:f90c3452d779 26 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
flywind 0:f90c3452d779 27 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
flywind 0:f90c3452d779 28 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
flywind 0:f90c3452d779 29 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
flywind 0:f90c3452d779 30 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
flywind 0:f90c3452d779 31 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
flywind 0:f90c3452d779 32 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
flywind 0:f90c3452d779 33 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
flywind 0:f90c3452d779 34 */
flywind 0:f90c3452d779 35 /**************************************************************************/
flywind 0:f90c3452d779 36
flywind 0:f90c3452d779 37 /** \file
flywind 0:f90c3452d779 38 * \brief Error Header
flywind 0:f90c3452d779 39 *
flywind 0:f90c3452d779 40 * \note TBD
flywind 0:f90c3452d779 41 */
flywind 0:f90c3452d779 42
flywind 0:f90c3452d779 43 /** \ingroup Group_Common
flywind 0:f90c3452d779 44 * \defgroup Group_Error Error Codes
flywind 0:f90c3452d779 45 * @{
flywind 0:f90c3452d779 46 */
flywind 0:f90c3452d779 47
flywind 0:f90c3452d779 48 #ifndef _BLE_ERROR_H_
flywind 0:f90c3452d779 49 #define _BLE_ERROR_H_
flywind 0:f90c3452d779 50
flywind 0:f90c3452d779 51 #include "projectconfig.h"
flywind 0:f90c3452d779 52
flywind 0:f90c3452d779 53 #ifdef __cplusplus
flywind 0:f90c3452d779 54 extern "C" {
flywind 0:f90c3452d779 55 #endif
flywind 0:f90c3452d779 56
flywind 0:f90c3452d779 57 typedef enum
flywind 0:f90c3452d779 58 {
flywind 0:f90c3452d779 59 /*=======================================================================
flywind 0:f90c3452d779 60 NORDIC GLOBAL ERRORS 0x0000 .. 0x00FF
flywind 0:f90c3452d779 61 -----------------------------------------------------------------------
flywind 0:f90c3452d779 62 Errors mapped from nrf_error.h
flywind 0:f90c3452d779 63 -----------------------------------------------------------------------*/
flywind 0:f90c3452d779 64 ERROR_NONE = 0x0000 , ///< Successful command
flywind 0:f90c3452d779 65 ERROR_SVC_HANDLER_MISSING = 0x0001 , ///< SVC handler is missing
flywind 0:f90c3452d779 66 ERROR_SOFTDEVICE_NOT_ENABLED = 0x0002 , ///< SoftDevice has not been enabled
flywind 0:f90c3452d779 67 ERROR_INTERNAL = 0x0003 , ///< Internal Error
flywind 0:f90c3452d779 68 ERROR_NO_MEM = 0x0004 , ///< No Memory for operation
flywind 0:f90c3452d779 69 ERROR_NOT_FOUND = 0x0005 , ///< Not found
flywind 0:f90c3452d779 70 ERROR_NOT_SUPPORTED = 0x0006 , ///< Not supported
flywind 0:f90c3452d779 71 ERROR_INVALID_PARAM = 0x0007 , ///< Invalid Parameter
flywind 0:f90c3452d779 72 ERROR_INVALID_STATE = 0x0008 , ///< Invalid state, operation disallowed in this state
flywind 0:f90c3452d779 73 ERROR_INVALID_LENGTH = 0x0009 , ///< Invalid Length
flywind 0:f90c3452d779 74 ERROR_INVALID_FLAGS = 0x000A , ///< Invalid Flags
flywind 0:f90c3452d779 75 ERROR_INVALID_DATA = 0x000B , ///< Invalid Data
flywind 0:f90c3452d779 76 ERROR_DATA_SIZE = 0x000C , ///< Data size exceeds limit
flywind 0:f90c3452d779 77 ERROR_TIMEOUT = 0x000D , ///< Operation timed out
flywind 0:f90c3452d779 78 ERROR_NULL = 0x000E , ///< Null Pointer
flywind 0:f90c3452d779 79 ERROR_FORBIDDEN = 0x000F , ///< Forbidden Operation
flywind 0:f90c3452d779 80 ERROR_INVALID_ADDR = 0x0010 , ///< Bad Memory Address
flywind 0:f90c3452d779 81 ERROR_BUSY = 0x0011 , ///< Busy
flywind 0:f90c3452d779 82 /*=======================================================================*/
flywind 0:f90c3452d779 83
flywind 0:f90c3452d779 84 ERROR_INVALIDPARAMETER = 0x0100 , /**< An invalid parameter value was provided */
flywind 0:f90c3452d779 85 ERROR_I2C_XFER_FAILED = 0x0101 , /**< an failed attempt to make I2C transfer */
flywind 0:f90c3452d779 86
flywind 0:f90c3452d779 87 /*=======================================================================
flywind 0:f90c3452d779 88 SIMPLE BINARY PROTOCOL ERRORS 0x0120 .. 0x013F
flywind 0:f90c3452d779 89 -----------------------------------------------------------------------
flywind 0:f90c3452d779 90 Errors relating to the simple binary protocol (/src//protocol)
flywind 0:f90c3452d779 91 -----------------------------------------------------------------------*/
flywind 0:f90c3452d779 92 ERROR_PROT_INVALIDMSGTYPE = 0x121, /**< Unexpected msg type encountered */
flywind 0:f90c3452d779 93 ERROR_PROT_INVALIDCOMMANDID = 0x122, /**< Unknown or out of range command ID */
flywind 0:f90c3452d779 94 ERROR_PROT_INVALIDPAYLOAD = 0x123, /**< Message payload has a problem (invalid len, etc.) */
flywind 0:f90c3452d779 95 /*=======================================================================*/
flywind 0:f90c3452d779 96
flywind 0:f90c3452d779 97 //------------- based on Nordic SDM nrf_error_sdm.h -------------//
flywind 0:f90c3452d779 98 ERROR_SDM_LFCLK_SOURCE_UNKNOWN = 0x1000 , ///< Unknown lfclk source
flywind 0:f90c3452d779 99 ERROR_SDM_INCORRECT_INTERRUPT_CONFIGURATION = 0x1001 , ///< Incorrect interrupt configuration (can be caused by using illegal priority levels, or having enabled SoftDevice interrupts)
flywind 0:f90c3452d779 100 ERROR_SDM_INCORRECT_CLENR0 = 0x1002 , ///< Incorrect CLENR0 (can be caused by erronous SoftDevice flashing)
flywind 0:f90c3452d779 101
flywind 0:f90c3452d779 102 //------------- based on Nordic SOC nrf_error_soc.h -------------//
flywind 0:f90c3452d779 103 /* Mutex Errors */
flywind 0:f90c3452d779 104 ERROR_SOC_MUTEX_ALREADY_TAKEN = 0x2000 , ///< Mutex already taken
flywind 0:f90c3452d779 105
flywind 0:f90c3452d779 106 /* NVIC errors */
flywind 0:f90c3452d779 107 ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE = 0x2001 , ///< NVIC interrupt not available
flywind 0:f90c3452d779 108 ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED = 0x2002 , ///< NVIC interrupt priority not allowed
flywind 0:f90c3452d779 109 ERROR_SOC_NVIC_SHOULD_NOT_RETURN = 0x2003 , ///< NVIC should not return
flywind 0:f90c3452d779 110
flywind 0:f90c3452d779 111 /* Power errors */
flywind 0:f90c3452d779 112 ERROR_SOC_POWER_MODE_UNKNOWN = 0x2004 , ///< Power mode unknown
flywind 0:f90c3452d779 113 ERROR_SOC_POWER_POF_THRESHOLD_UNKNOWN = 0x2005 , ///< Power POF threshold unknown
flywind 0:f90c3452d779 114 ERROR_SOC_POWER_OFF_SHOULD_NOT_RETURN = 0x2006 , ///< Power off should not return
flywind 0:f90c3452d779 115
flywind 0:f90c3452d779 116 /* Rand errors */
flywind 0:f90c3452d779 117 ERROR_SOC_RAND_NOT_ENOUGH_VALUES = 0x2007 , ///< RAND not enough values
flywind 0:f90c3452d779 118
flywind 0:f90c3452d779 119 /* PPI errors */
flywind 0:f90c3452d779 120 ERROR_SOC_PPI_INVALID_CHANNEL = 0x2008 , ///< Invalid PPI Channel
flywind 0:f90c3452d779 121 ERROR_SOC_PPI_INVALID_GROUP = 0x2009 , ///< Invalid PPI Group
flywind 0:f90c3452d779 122
flywind 0:f90c3452d779 123 //------------- based on Nordic STK (ble) ble_err.h -------------//
flywind 0:f90c3452d779 124 ERROR_BLE_INVALID_CONN_HANDLE = 0x3001 , /**< Invalid connection handle. */
flywind 0:f90c3452d779 125 ERROR_BLE_INVALID_ATTR_HANDLE = 0x3002 , /**< Invalid attribute handle. */
flywind 0:f90c3452d779 126 ERROR_BLE_NO_TX_BUFFERS = 0x3003 , /**< Buffer capacity exceeded. */
flywind 0:f90c3452d779 127
flywind 0:f90c3452d779 128 // L2CAP
flywind 0:f90c3452d779 129 ERROR_BLE_L2CAP_CID_IN_USE = 0x3100 , /**< CID already in use. */
flywind 0:f90c3452d779 130
flywind 0:f90c3452d779 131 // GAP
flywind 0:f90c3452d779 132 ERROR_BLE_GAP_UUID_LIST_MISMATCH = 0x3200 , /**< UUID list does not contain an integral number of UUIDs. */
flywind 0:f90c3452d779 133 ERROR_BLE_GAP_DISCOVERABLE_WITH_WHITELIST = 0x3201 , /**< Use of Whitelist not permitted with discoverable advertising. */
flywind 0:f90c3452d779 134 ERROR_BLE_GAP_INVALID_BLE_ADDR = 0x3202 , /**< The upper two bits of the address do not correspond to the specified address type. */
flywind 0:f90c3452d779 135
flywind 0:f90c3452d779 136 // GATTC
flywind 0:f90c3452d779 137 ERROR_BLE_GATTC_PROC_NOT_PERMITTED = 0x3300 ,
flywind 0:f90c3452d779 138
flywind 0:f90c3452d779 139 // GATTS
flywind 0:f90c3452d779 140 ERROR_BLEGATTS_INVALID_ATTR_TYPE = 0x3400 , /**< Invalid attribute type. */
flywind 0:f90c3452d779 141 ERROR_BLEGATTS_SYS_ATTR_MISSING = 0x3401 , /**< System Attributes missing. */
flywind 0:f90c3452d779 142
flywind 0:f90c3452d779 143 }error_t;
flywind 0:f90c3452d779 144
flywind 0:f90c3452d779 145 #ifdef __cplusplus
flywind 0:f90c3452d779 146 }
flywind 0:f90c3452d779 147 #endif
flywind 0:f90c3452d779 148
flywind 0:f90c3452d779 149 #endif /* _BLE_ERROR_H_ */
flywind 0:f90c3452d779 150
flywind 0:f90c3452d779 151 /** @} */