Microbit as a BLE gamepad

Dependents:   nRF51822

Fork of nrf51-sdk by Lancaster University

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ble_ranges.h Source File

ble_ranges.h

00001 /*
00002  * Copyright (c) Nordic Semiconductor ASA
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without modification,
00006  * are permitted provided that the following conditions are met:
00007  *
00008  *   1. Redistributions of source code must retain the above copyright notice, this
00009  *   list of conditions and the following disclaimer.
00010  *
00011  *   2. Redistributions in binary form must reproduce the above copyright notice, this
00012  *   list of conditions and the following disclaimer in the documentation and/or
00013  *   other materials provided with the distribution.
00014  *
00015  *   3. Neither the name of Nordic Semiconductor ASA nor the names of other
00016  *   contributors to this software may be used to endorse or promote products
00017  *   derived from this software without specific prior written permission.
00018  *
00019  *
00020  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
00021  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00022  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00023  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
00024  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00025  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00026  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
00027  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00028  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00029  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00030  *
00031  */
00032 
00033 /**
00034   @addtogroup BLE_COMMON
00035   @{
00036   @defgroup ble_ranges Module specific SVC, event and option number subranges
00037   @{
00038 
00039   @brief Definition of SVC, event and option number subranges for each API module.
00040 
00041   @note
00042   SVCs, event and option numbers are split into subranges for each API module.
00043   Each module receives its entire allocated range of SVC calls, whether implemented or not,
00044   but return BLE_ERROR_NOT_SUPPORTED for unimplemented or undefined calls in its range.
00045 
00046   Note that the symbols BLE_<module>_SVC_LAST is the end of the allocated SVC range,
00047   rather than the last SVC function call actually defined and implemented.
00048 
00049   Specific SVC, event and option values are defined in each module's ble_<module>.h file,
00050   which defines names of each individual SVC code based on the range start value.
00051 */
00052 
00053 #ifndef BLE_RANGES_H__
00054 #define BLE_RANGES_H__
00055 
00056 #define BLE_SVC_BASE           0x60       /**< Common BLE SVC base. */
00057 #define BLE_SVC_LAST           0x6B       /**< Total: 12. */
00058 
00059 #define BLE_RESERVED_SVC_BASE  0x6C       /**< Reserved BLE SVC base. */
00060 #define BLE_RESERVED_SVC_LAST  0x6F       /**< Total: 4. */
00061 
00062 #define BLE_GAP_SVC_BASE       0x70       /**< GAP BLE SVC base. */
00063 #define BLE_GAP_SVC_LAST       0x8F       /**< Total: 32. */
00064 
00065 #define BLE_GATTC_SVC_BASE     0x90       /**< GATTC BLE SVC base. */
00066 #define BLE_GATTC_SVC_LAST     0x9F       /**< Total: 32. */
00067 
00068 #define BLE_GATTS_SVC_BASE     0xA0       /**< GATTS BLE SVC base. */
00069 #define BLE_GATTS_SVC_LAST     0xAF       /**< Total: 16. */
00070 
00071 #define BLE_L2CAP_SVC_BASE     0xB0       /**< L2CAP BLE SVC base. */
00072 #define BLE_L2CAP_SVC_LAST     0xBF       /**< Total: 16. */
00073 
00074 
00075 #define BLE_EVT_INVALID        0x00       /**< Invalid BLE Event. */
00076 
00077 #define BLE_EVT_BASE           0x01       /**< Common BLE Event base. */
00078 #define BLE_EVT_LAST           0x0F       /**< Total: 15. */
00079 
00080 #define BLE_GAP_EVT_BASE       0x10       /**< GAP BLE Event base. */
00081 #define BLE_GAP_EVT_LAST       0x2F       /**< Total: 32. */
00082 
00083 #define BLE_GATTC_EVT_BASE     0x30       /**< GATTC BLE Event base. */
00084 #define BLE_GATTC_EVT_LAST     0x4F       /**< Total: 32. */
00085 
00086 #define BLE_GATTS_EVT_BASE     0x50       /**< GATTS BLE Event base. */
00087 #define BLE_GATTS_EVT_LAST     0x6F       /**< Total: 32. */
00088 
00089 #define BLE_L2CAP_EVT_BASE     0x70       /**< L2CAP BLE Event base. */
00090 #define BLE_L2CAP_EVT_LAST     0x8F       /**< Total: 32.  */
00091 
00092 
00093 #define BLE_OPT_INVALID        0x00       /**< Invalid BLE Option. */
00094 
00095 #define BLE_OPT_BASE           0x01       /**< Common BLE Option base. */
00096 #define BLE_OPT_LAST           0x1F       /**< Total: 31. */
00097 
00098 #define BLE_GAP_OPT_BASE       0x20       /**< GAP BLE Option base. */
00099 #define BLE_GAP_OPT_LAST       0x3F       /**< Total: 32. */
00100 
00101 #define BLE_GATTC_OPT_BASE     0x40       /**< GATTC BLE Option base. */
00102 #define BLE_GATTC_OPT_LAST     0x5F       /**< Total: 32. */
00103 
00104 #define BLE_GATTS_OPT_BASE     0x60       /**< GATTS BLE Option base. */
00105 #define BLE_GATTS_OPT_LAST     0x7F       /**< Total: 32. */
00106 
00107 #define BLE_L2CAP_OPT_BASE     0x80       /**< L2CAP BLE Option base. */
00108 #define BLE_L2CAP_OPT_LAST     0x9F       /**< Total: 32.  */
00109 
00110 #endif /* BLE_RANGES_H__ */
00111 
00112 /**
00113   @}
00114   @}
00115 */