konashi/SBBLEのテスト

Dependencies:   BLE_API mbed

Fork of BLE_LoopbackUART by Bluetooth Low Energy

Committer:
robo8080
Date:
Sun Aug 17 00:53:23 2014 +0000
Revision:
8:a62b8f7d5dcf
Parent:
5:61109bce11fe
DeviceName??

Who changed what in which revision?

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