Glimworm Beacons / nRF51822

Fork of nRF51822 by Nordic Semiconductor

Committer:
rgrover1
Date:
Mon Jul 06 10:21:01 2015 +0100
Revision:
374:d57070489710
Synchronized with git rev 3d87035e
Author: Rohit Grover
fix #16: hide duplicate symbol definitions in ble_types.h

Who changed what in which revision?

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