Minor temporary patch to allow DFU packet callback
Fork of BLE_API by
blecommon.h@27:4a83843f04b0, 2014-01-09 (annotated)
- Committer:
- ktownsend
- Date:
- Thu Jan 09 11:03:10 2014 +0000
- Revision:
- 27:4a83843f04b0
- Parent:
- 25:7cf2a38ea175
- Child:
- 29:011e95ce78b8
Matching file names and apache headers
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ktownsend | 27:4a83843f04b0 | 1 | /* mbed Microcontroller Library |
ktownsend | 27:4a83843f04b0 | 2 | * Copyright (c) 2006-2013 ARM Limited |
ktownsend | 27:4a83843f04b0 | 3 | * |
ktownsend | 27:4a83843f04b0 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
ktownsend | 27:4a83843f04b0 | 5 | * you may not use this file except in compliance with the License. |
ktownsend | 27:4a83843f04b0 | 6 | * You may obtain a copy of the License at |
ktownsend | 27:4a83843f04b0 | 7 | * |
ktownsend | 27:4a83843f04b0 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
ktownsend | 27:4a83843f04b0 | 9 | * |
ktownsend | 27:4a83843f04b0 | 10 | * Unless required by applicable law or agreed to in writing, software |
ktownsend | 27:4a83843f04b0 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
ktownsend | 27:4a83843f04b0 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
ktownsend | 27:4a83843f04b0 | 13 | * See the License for the specific language governing permissions and |
ktownsend | 27:4a83843f04b0 | 14 | * limitations under the License. |
ktownsend | 27:4a83843f04b0 | 15 | */ |
ktownsend | 27:4a83843f04b0 | 16 | |
ktownsend | 0:ace2e8d3ce79 | 17 | #ifndef __BLE_COMMON_H__ |
ktownsend | 0:ace2e8d3ce79 | 18 | #define __BLE_COMMON_H__ |
ktownsend | 0:ace2e8d3ce79 | 19 | |
ktownsend | 4:50a31ff5f974 | 20 | #ifdef __cplusplus |
ktownsend | 4:50a31ff5f974 | 21 | extern "C" { |
ktownsend | 4:50a31ff5f974 | 22 | #endif |
ktownsend | 4:50a31ff5f974 | 23 | |
ktownsend | 0:ace2e8d3ce79 | 24 | #include <stdint.h> |
ktownsend | 0:ace2e8d3ce79 | 25 | |
ktownsend | 21:5442f7c70e71 | 26 | /**************************************************************************/ |
ktownsend | 21:5442f7c70e71 | 27 | /*! |
ktownsend | 21:5442f7c70e71 | 28 | \brief Error codes for the BLE API |
ktownsend | 21:5442f7c70e71 | 29 | */ |
ktownsend | 21:5442f7c70e71 | 30 | /**************************************************************************/ |
ktownsend | 0:ace2e8d3ce79 | 31 | typedef enum ble_error_e |
ktownsend | 0:ace2e8d3ce79 | 32 | { |
ktownsend | 21:5442f7c70e71 | 33 | BLE_ERROR_NONE = 0, /**< No error */ |
ktownsend | 21:5442f7c70e71 | 34 | BLE_ERROR_BUFFER_OVERFLOW = 1, /**< The requested action would cause a buffer overflow and has been aborted */ |
ktownsend | 21:5442f7c70e71 | 35 | BLE_ERROR_NOT_IMPLEMENTED = 2, /**< Requested a feature that isn't yet implement or isn't supported by the target HW */ |
ktownsend | 21:5442f7c70e71 | 36 | BLE_ERROR_PARAM_OUT_OF_RANGE = 3 /**< One of the supplied parameters is outside the valid range */ |
ktownsend | 0:ace2e8d3ce79 | 37 | } ble_error_t; |
ktownsend | 0:ace2e8d3ce79 | 38 | |
ktownsend | 21:5442f7c70e71 | 39 | /**************************************************************************/ |
ktownsend | 21:5442f7c70e71 | 40 | /*! |
ktownsend | 21:5442f7c70e71 | 41 | \brief Standard GATT characteristic presentation format unit types. |
ktownsend | 21:5442f7c70e71 | 42 | These unit types are used to decribe what the raw numeric |
ktownsend | 21:5442f7c70e71 | 43 | data in a characteristic actually represents. |
ktownsend | 21:5442f7c70e71 | 44 | |
ktownsend | 21:5442f7c70e71 | 45 | \note See https://developer.bluetooth.org/gatt/units/Pages/default.aspx |
ktownsend | 21:5442f7c70e71 | 46 | */ |
ktownsend | 21:5442f7c70e71 | 47 | /**************************************************************************/ |
ktownsend | 0:ace2e8d3ce79 | 48 | typedef enum ble_gatt_unit_e |
ktownsend | 0:ace2e8d3ce79 | 49 | { |
ktownsend | 21:5442f7c70e71 | 50 | BLE_GATT_UNIT_NONE = 0x2700, /**< No specified unit type */ |
ktownsend | 21:5442f7c70e71 | 51 | BLE_GATT_UNIT_LENGTH_METRE = 0x2701, /**< Length, Metre */ |
ktownsend | 21:5442f7c70e71 | 52 | BLE_GATT_UNIT_MASS_KILOGRAM = 0x2702, /**< Mass, Kilogram */ |
ktownsend | 21:5442f7c70e71 | 53 | BLE_GATT_UNIT_TIME_SECOND = 0x2703, /**< Time, Second */ |
ktownsend | 21:5442f7c70e71 | 54 | BLE_GATT_UNIT_ELECTRIC_CURRENT_AMPERE = 0x2704, /**< Electric Current, Ampere */ |
ktownsend | 21:5442f7c70e71 | 55 | BLE_GATT_UNIT_THERMODYNAMIC_TEMPERATURE_KELVIN = 0x2705, /**< Thermodynamic Temperature, Kelvin */ |
ktownsend | 21:5442f7c70e71 | 56 | BLE_GATT_UNIT_AMOUNT_OF_SUBSTANCE_MOLE = 0x2706, /**< Amount of Substance, Mole */ |
ktownsend | 21:5442f7c70e71 | 57 | BLE_GATT_UNIT_LUMINOUS_INTENSITY_CANDELA = 0x2707, /**< Luminous Intensity, Candela */ |
ktownsend | 21:5442f7c70e71 | 58 | BLE_GATT_UNIT_AREA_SQUARE_METRES = 0x2710, /**< Area, Square Metres */ |
ktownsend | 21:5442f7c70e71 | 59 | BLE_GATT_UNIT_VOLUME_CUBIC_METRES = 0x2711, /**< Volume, Cubic Metres*/ |
ktownsend | 21:5442f7c70e71 | 60 | BLE_GATT_UNIT_VELOCITY_METRES_PER_SECOND = 0x2712, /**< Velocity, Metres per Second*/ |
ktownsend | 21:5442f7c70e71 | 61 | BLE_GATT_UNIT_ACCELERATION_METRES_PER_SECOND_SQUARED = 0x2713, /**< Acceleration, Metres per Second Squared */ |
ktownsend | 21:5442f7c70e71 | 62 | BLE_GATT_UNIT_WAVENUMBER_RECIPROCAL_METRE = 0x2714, /**< Wave Number Reciprocal, Metre */ |
ktownsend | 21:5442f7c70e71 | 63 | BLE_GATT_UNIT_DENSITY_KILOGRAM_PER_CUBIC_METRE = 0x2715, /**< Density, Kilogram per Cubic Metre */ |
ktownsend | 21:5442f7c70e71 | 64 | BLE_GATT_UNIT_SURFACE_DENSITY_KILOGRAM_PER_SQUARE_METRE = 0x2716, /**< */ |
ktownsend | 21:5442f7c70e71 | 65 | BLE_GATT_UNIT_SPECIFIC_VOLUME_CUBIC_METRE_PER_KILOGRAM = 0x2717, /**< */ |
ktownsend | 21:5442f7c70e71 | 66 | BLE_GATT_UNIT_CURRENT_DENSITY_AMPERE_PER_SQUARE_METRE = 0x2718, /**< */ |
ktownsend | 21:5442f7c70e71 | 67 | BLE_GATT_UNIT_MAGNETIC_FIELD_STRENGTH_AMPERE_PER_METRE = 0x2719, /**< Magnetic Field Strength, Ampere per Metre */ |
ktownsend | 21:5442f7c70e71 | 68 | BLE_GATT_UNIT_AMOUNT_CONCENTRATION_MOLE_PER_CUBIC_METRE = 0x271A, /**< */ |
ktownsend | 21:5442f7c70e71 | 69 | BLE_GATT_UNIT_MASS_CONCENTRATION_KILOGRAM_PER_CUBIC_METRE = 0x271B, /**< */ |
ktownsend | 21:5442f7c70e71 | 70 | BLE_GATT_UNIT_LUMINANCE_CANDELA_PER_SQUARE_METRE = 0x271C, /**< */ |
ktownsend | 21:5442f7c70e71 | 71 | BLE_GATT_UNIT_REFRACTIVE_INDEX = 0x271D, /**< */ |
ktownsend | 21:5442f7c70e71 | 72 | BLE_GATT_UNIT_RELATIVE_PERMEABILITY = 0x271E, /**< */ |
ktownsend | 21:5442f7c70e71 | 73 | BLE_GATT_UNIT_PLANE_ANGLE_RADIAN = 0x2720, /**< */ |
ktownsend | 21:5442f7c70e71 | 74 | BLE_GATT_UNIT_SOLID_ANGLE_STERADIAN = 0x2721, /**< */ |
ktownsend | 21:5442f7c70e71 | 75 | BLE_GATT_UNIT_FREQUENCY_HERTZ = 0x2722, /**< Frequency, Hertz */ |
ktownsend | 21:5442f7c70e71 | 76 | BLE_GATT_UNIT_FORCE_NEWTON = 0x2723, /**< Force, Newton */ |
ktownsend | 21:5442f7c70e71 | 77 | BLE_GATT_UNIT_PRESSURE_PASCAL = 0x2724, /**< Pressure, Pascal */ |
ktownsend | 21:5442f7c70e71 | 78 | BLE_GATT_UNIT_ENERGY_JOULE = 0x2725, /**< Energy, Joule */ |
ktownsend | 21:5442f7c70e71 | 79 | BLE_GATT_UNIT_POWER_WATT = 0x2726, /**< Power, Watt */ |
ktownsend | 21:5442f7c70e71 | 80 | BLE_GATT_UNIT_ELECTRIC_CHARGE_COULOMB = 0x2727, /**< Electrical Charge, Coulomb */ |
ktownsend | 21:5442f7c70e71 | 81 | BLE_GATT_UNIT_ELECTRIC_POTENTIAL_DIFFERENCE_VOLT = 0x2728, /**< Electrical Potential Difference, Voltage */ |
ktownsend | 21:5442f7c70e71 | 82 | BLE_GATT_UNIT_CAPACITANCE_FARAD = 0x2729, /**< */ |
ktownsend | 21:5442f7c70e71 | 83 | BLE_GATT_UNIT_ELECTRIC_RESISTANCE_OHM = 0x272A, /**< */ |
ktownsend | 21:5442f7c70e71 | 84 | BLE_GATT_UNIT_ELECTRIC_CONDUCTANCE_SIEMENS = 0x272B, /**< */ |
ktownsend | 21:5442f7c70e71 | 85 | BLE_GATT_UNIT_MAGNETIC_FLEX_WEBER = 0x272C, /**< */ |
ktownsend | 21:5442f7c70e71 | 86 | BLE_GATT_UNIT_MAGNETIC_FLEX_DENSITY_TESLA = 0x272D, /**< */ |
ktownsend | 21:5442f7c70e71 | 87 | BLE_GATT_UNIT_INDUCTANCE_HENRY = 0x272E, /**< */ |
ktownsend | 21:5442f7c70e71 | 88 | BLE_GATT_UNIT_THERMODYNAMIC_TEMPERATURE_DEGREE_CELSIUS = 0x272F, /**< */ |
ktownsend | 21:5442f7c70e71 | 89 | BLE_GATT_UNIT_LUMINOUS_FLUX_LUMEN = 0x2730, /**< */ |
ktownsend | 21:5442f7c70e71 | 90 | BLE_GATT_UNIT_ILLUMINANCE_LUX = 0x2731, /**< */ |
ktownsend | 21:5442f7c70e71 | 91 | BLE_GATT_UNIT_ACTIVITY_REFERRED_TO_A_RADIONUCLIDE_BECQUEREL = 0x2732, /**< */ |
ktownsend | 21:5442f7c70e71 | 92 | BLE_GATT_UNIT_ABSORBED_DOSE_GRAY = 0x2733, /**< */ |
ktownsend | 21:5442f7c70e71 | 93 | BLE_GATT_UNIT_DOSE_EQUIVALENT_SIEVERT = 0x2734, /**< */ |
ktownsend | 21:5442f7c70e71 | 94 | BLE_GATT_UNIT_CATALYTIC_ACTIVITY_KATAL = 0x2735, /**< */ |
ktownsend | 21:5442f7c70e71 | 95 | BLE_GATT_UNIT_DYNAMIC_VISCOSITY_PASCAL_SECOND = 0x2740, /**< */ |
ktownsend | 21:5442f7c70e71 | 96 | BLE_GATT_UNIT_MOMENT_OF_FORCE_NEWTON_METRE = 0x2741, /**< */ |
ktownsend | 21:5442f7c70e71 | 97 | BLE_GATT_UNIT_SURFACE_TENSION_NEWTON_PER_METRE = 0x2742, /**< */ |
ktownsend | 21:5442f7c70e71 | 98 | BLE_GATT_UNIT_ANGULAR_VELOCITY_RADIAN_PER_SECOND = 0x2743, /**< */ |
ktownsend | 21:5442f7c70e71 | 99 | BLE_GATT_UNIT_ANGULAR_ACCELERATION_RADIAN_PER_SECOND_SQUARED = 0x2744, /**< */ |
ktownsend | 21:5442f7c70e71 | 100 | BLE_GATT_UNIT_HEAT_FLUX_DENSITY_WATT_PER_SQUARE_METRE = 0x2745, /**< */ |
ktownsend | 21:5442f7c70e71 | 101 | BLE_GATT_UNIT_HEAT_CAPACITY_JOULE_PER_KELVIN = 0x2746, /**< */ |
ktownsend | 21:5442f7c70e71 | 102 | BLE_GATT_UNIT_SPECIFIC_HEAT_CAPACITY_JOULE_PER_KILOGRAM_KELVIN = 0x2747, /**< */ |
ktownsend | 21:5442f7c70e71 | 103 | BLE_GATT_UNIT_SPECIFIC_ENERGY_JOULE_PER_KILOGRAM = 0x2748, /**< */ |
ktownsend | 21:5442f7c70e71 | 104 | BLE_GATT_UNIT_THERMAL_CONDUCTIVITY_WATT_PER_METRE_KELVIN = 0x2749, /**< */ |
ktownsend | 21:5442f7c70e71 | 105 | BLE_GATT_UNIT_ENERGY_DENSITY_JOULE_PER_CUBIC_METRE = 0x274A, /**< */ |
ktownsend | 21:5442f7c70e71 | 106 | BLE_GATT_UNIT_ELECTRIC_FIELD_STRENGTH_VOLT_PER_METRE = 0x274B, /**< */ |
ktownsend | 21:5442f7c70e71 | 107 | BLE_GATT_UNIT_ELECTRIC_CHARGE_DENSITY_COULOMB_PER_CUBIC_METRE = 0x274C, /**< */ |
ktownsend | 21:5442f7c70e71 | 108 | BLE_GATT_UNIT_SURFACE_CHARGE_DENSITY_COULOMB_PER_SQUARE_METRE = 0x274D, /**< */ |
ktownsend | 21:5442f7c70e71 | 109 | BLE_GATT_UNIT_ELECTRIC_FLUX_DENSITY_COULOMB_PER_SQUARE_METRE = 0x274E, /**< */ |
ktownsend | 21:5442f7c70e71 | 110 | BLE_GATT_UNIT_PERMITTIVITY_FARAD_PER_METRE = 0x274F, /**< */ |
ktownsend | 21:5442f7c70e71 | 111 | BLE_GATT_UNIT_PERMEABILITY_HENRY_PER_METRE = 0x2750, /**< */ |
ktownsend | 21:5442f7c70e71 | 112 | BLE_GATT_UNIT_MOLAR_ENERGY_JOULE_PER_MOLE = 0x2751, /**< */ |
ktownsend | 21:5442f7c70e71 | 113 | BLE_GATT_UNIT_MOLAR_ENTROPY_JOULE_PER_MOLE_KELVIN = 0x2752, /**< */ |
ktownsend | 21:5442f7c70e71 | 114 | BLE_GATT_UNIT_EXPOSURE_COULOMB_PER_KILOGRAM = 0x2753, /**< */ |
ktownsend | 21:5442f7c70e71 | 115 | BLE_GATT_UNIT_ABSORBED_DOSE_RATE_GRAY_PER_SECOND = 0x2754, /**< */ |
ktownsend | 21:5442f7c70e71 | 116 | BLE_GATT_UNIT_RADIANT_INTENSITY_WATT_PER_STERADIAN = 0x2755, /**< */ |
ktownsend | 21:5442f7c70e71 | 117 | BLE_GATT_UNIT_RADIANCE_WATT_PER_SQUARE_METRE_STERADIAN = 0x2756, /**< */ |
ktownsend | 21:5442f7c70e71 | 118 | BLE_GATT_UNIT_CATALYTIC_ACTIVITY_CONCENTRATION_KATAL_PER_CUBIC_METRE = 0x2757, /**< */ |
ktownsend | 21:5442f7c70e71 | 119 | BLE_GATT_UNIT_TIME_MINUTE = 0x2760, /**< Time, Minute */ |
ktownsend | 21:5442f7c70e71 | 120 | BLE_GATT_UNIT_TIME_HOUR = 0x2761, /**< Time, Hour */ |
ktownsend | 21:5442f7c70e71 | 121 | BLE_GATT_UNIT_TIME_DAY = 0x2762, /**< Time, Day */ |
ktownsend | 21:5442f7c70e71 | 122 | BLE_GATT_UNIT_PLANE_ANGLE_DEGREE = 0x2763, /**< */ |
ktownsend | 21:5442f7c70e71 | 123 | BLE_GATT_UNIT_PLANE_ANGLE_MINUTE = 0x2764, /**< */ |
ktownsend | 21:5442f7c70e71 | 124 | BLE_GATT_UNIT_PLANE_ANGLE_SECOND = 0x2765, /**< */ |
ktownsend | 21:5442f7c70e71 | 125 | BLE_GATT_UNIT_AREA_HECTARE = 0x2766, /**< */ |
ktownsend | 21:5442f7c70e71 | 126 | BLE_GATT_UNIT_VOLUME_LITRE = 0x2767, /**< */ |
ktownsend | 21:5442f7c70e71 | 127 | BLE_GATT_UNIT_MASS_TONNE = 0x2768, /**< */ |
ktownsend | 21:5442f7c70e71 | 128 | BLE_GATT_UNIT_PRESSURE_BAR = 0x2780, /**< Pressure, Bar */ |
ktownsend | 21:5442f7c70e71 | 129 | BLE_GATT_UNIT_PRESSURE_MILLIMETRE_OF_MERCURY = 0x2781, /**< Pressure, Millimetre of Mercury */ |
ktownsend | 21:5442f7c70e71 | 130 | BLE_GATT_UNIT_LENGTH_ANGSTROM = 0x2782, /**< */ |
ktownsend | 21:5442f7c70e71 | 131 | BLE_GATT_UNIT_LENGTH_NAUTICAL_MILE = 0x2783, /**< */ |
ktownsend | 21:5442f7c70e71 | 132 | BLE_GATT_UNIT_AREA_BARN = 0x2784, /**< */ |
ktownsend | 21:5442f7c70e71 | 133 | BLE_GATT_UNIT_VELOCITY_KNOT = 0x2785, /**< */ |
ktownsend | 21:5442f7c70e71 | 134 | BLE_GATT_UNIT_LOGARITHMIC_RADIO_QUANTITY_NEPER = 0x2786, /**< */ |
ktownsend | 21:5442f7c70e71 | 135 | BLE_GATT_UNIT_LOGARITHMIC_RADIO_QUANTITY_BEL = 0x2787, /**< */ |
ktownsend | 21:5442f7c70e71 | 136 | BLE_GATT_UNIT_LENGTH_YARD = 0x27A0, /**< Length, Yard */ |
ktownsend | 21:5442f7c70e71 | 137 | BLE_GATT_UNIT_LENGTH_PARSEC = 0x27A1, /**< Length, Parsec */ |
ktownsend | 21:5442f7c70e71 | 138 | BLE_GATT_UNIT_LENGTH_INCH = 0x27A2, /**< Length, Inch */ |
ktownsend | 21:5442f7c70e71 | 139 | BLE_GATT_UNIT_LENGTH_FOOT = 0x27A3, /**< Length, Foot */ |
ktownsend | 21:5442f7c70e71 | 140 | BLE_GATT_UNIT_LENGTH_MILE = 0x27A4, /**< Length, Mile */ |
ktownsend | 21:5442f7c70e71 | 141 | BLE_GATT_UNIT_PRESSURE_POUND_FORCE_PER_SQUARE_INCH = 0x27A5, /**< */ |
ktownsend | 21:5442f7c70e71 | 142 | BLE_GATT_UNIT_VELOCITY_KILOMETRE_PER_HOUR = 0x27A6, /**< Velocity, Kilometre per Hour */ |
ktownsend | 21:5442f7c70e71 | 143 | BLE_GATT_UNIT_VELOCITY_MILE_PER_HOUR = 0x27A7, /**< Velocity, Mile per Hour */ |
ktownsend | 21:5442f7c70e71 | 144 | BLE_GATT_UNIT_ANGULAR_VELOCITY_REVOLUTION_PER_MINUTE = 0x27A8, /**< Angular Velocity, Revolution per Minute */ |
ktownsend | 21:5442f7c70e71 | 145 | BLE_GATT_UNIT_ENERGY_GRAM_CALORIE = 0x27A9, /**< Energy, Gram Calorie */ |
ktownsend | 21:5442f7c70e71 | 146 | BLE_GATT_UNIT_ENERGY_KILOGRAM_CALORIE = 0x27AA, /**< Energy, Kilogram Calorie */ |
ktownsend | 21:5442f7c70e71 | 147 | BLE_GATT_UNIT_ENERGY_KILOWATT_HOUR = 0x27AB, /**< Energy, Killowatt Hour */ |
ktownsend | 21:5442f7c70e71 | 148 | BLE_GATT_UNIT_THERMODYNAMIC_TEMPERATURE_DEGREE_FAHRENHEIT = 0x27AC, /**< */ |
ktownsend | 21:5442f7c70e71 | 149 | BLE_GATT_UNIT_PERCENTAGE = 0x27AD, /**< Percentage */ |
ktownsend | 21:5442f7c70e71 | 150 | BLE_GATT_UNIT_PER_MILLE = 0x27AE, /**< */ |
ktownsend | 21:5442f7c70e71 | 151 | BLE_GATT_UNIT_PERIOD_BEATS_PER_MINUTE = 0x27AF, /**< */ |
ktownsend | 21:5442f7c70e71 | 152 | BLE_GATT_UNIT_ELECTRIC_CHARGE_AMPERE_HOURS = 0x27B0, /**< */ |
ktownsend | 21:5442f7c70e71 | 153 | BLE_GATT_UNIT_MASS_DENSITY_MILLIGRAM_PER_DECILITRE = 0x27B1, /**< */ |
ktownsend | 21:5442f7c70e71 | 154 | BLE_GATT_UNIT_MASS_DENSITY_MILLIMOLE_PER_LITRE = 0x27B2, /**< */ |
ktownsend | 21:5442f7c70e71 | 155 | BLE_GATT_UNIT_TIME_YEAR = 0x27B3, /**< Time, Year */ |
ktownsend | 21:5442f7c70e71 | 156 | BLE_GATT_UNIT_TIME_MONTH = 0x27B4, /**< Time, Month */ |
ktownsend | 21:5442f7c70e71 | 157 | BLE_GATT_UNIT_CONCENTRATION_COUNT_PER_CUBIC_METRE = 0x27B5, /**< */ |
ktownsend | 21:5442f7c70e71 | 158 | BLE_GATT_UNIT_IRRADIANCE_WATT_PER_SQUARE_METRE = 0x27B6 /**< */ |
ktownsend | 0:ace2e8d3ce79 | 159 | } ble_gatt_unit_t; |
ktownsend | 0:ace2e8d3ce79 | 160 | |
ktownsend | 21:5442f7c70e71 | 161 | /**************************************************************************/ |
ktownsend | 21:5442f7c70e71 | 162 | /*! |
ktownsend | 21:5442f7c70e71 | 163 | \brief Standard GATT number types |
ktownsend | 21:5442f7c70e71 | 164 | |
ktownsend | 21:5442f7c70e71 | 165 | \note See Bluetooth Specification 4.0 (Vol. 3), Part G, Section 3.3.3.5.2 |
ktownsend | 21:5442f7c70e71 | 166 | \note See http://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorViewer.aspx?u=org.bluetooth.descriptor.gatt.characteristic_presentation_format.xml |
ktownsend | 21:5442f7c70e71 | 167 | */ |
ktownsend | 21:5442f7c70e71 | 168 | /**************************************************************************/ |
ktownsend | 0:ace2e8d3ce79 | 169 | typedef enum ble_gatt_format_e |
ktownsend | 0:ace2e8d3ce79 | 170 | { |
ktownsend | 0:ace2e8d3ce79 | 171 | BLE_GATT_FORMAT_RFU = 0x00, /**< Reserved For Future Use. */ |
ktownsend | 0:ace2e8d3ce79 | 172 | BLE_GATT_FORMAT_BOOLEAN = 0x01, /**< Boolean. */ |
ktownsend | 0:ace2e8d3ce79 | 173 | BLE_GATT_FORMAT_2BIT = 0x02, /**< Unsigned 2-bit integer. */ |
ktownsend | 0:ace2e8d3ce79 | 174 | BLE_GATT_FORMAT_NIBBLE = 0x03, /**< Unsigned 4-bit integer. */ |
ktownsend | 0:ace2e8d3ce79 | 175 | BLE_GATT_FORMAT_UINT8 = 0x04, /**< Unsigned 8-bit integer. */ |
ktownsend | 0:ace2e8d3ce79 | 176 | BLE_GATT_FORMAT_UINT12 = 0x05, /**< Unsigned 12-bit integer. */ |
ktownsend | 0:ace2e8d3ce79 | 177 | BLE_GATT_FORMAT_UINT16 = 0x06, /**< Unsigned 16-bit integer. */ |
ktownsend | 0:ace2e8d3ce79 | 178 | BLE_GATT_FORMAT_UINT24 = 0x07, /**< Unsigned 24-bit integer. */ |
ktownsend | 0:ace2e8d3ce79 | 179 | BLE_GATT_FORMAT_UINT32 = 0x08, /**< Unsigned 32-bit integer. */ |
ktownsend | 0:ace2e8d3ce79 | 180 | BLE_GATT_FORMAT_UINT48 = 0x09, /**< Unsigned 48-bit integer. */ |
ktownsend | 0:ace2e8d3ce79 | 181 | BLE_GATT_FORMAT_UINT64 = 0x0A, /**< Unsigned 64-bit integer. */ |
ktownsend | 0:ace2e8d3ce79 | 182 | BLE_GATT_FORMAT_UINT128 = 0x0B, /**< Unsigned 128-bit integer. */ |
ktownsend | 0:ace2e8d3ce79 | 183 | BLE_GATT_FORMAT_SINT8 = 0x0C, /**< Signed 2-bit integer. */ |
ktownsend | 0:ace2e8d3ce79 | 184 | BLE_GATT_FORMAT_SINT12 = 0x0D, /**< Signed 12-bit integer. */ |
ktownsend | 0:ace2e8d3ce79 | 185 | BLE_GATT_FORMAT_SINT16 = 0x0E, /**< Signed 16-bit integer. */ |
ktownsend | 0:ace2e8d3ce79 | 186 | BLE_GATT_FORMAT_SINT24 = 0x0F, /**< Signed 24-bit integer. */ |
ktownsend | 0:ace2e8d3ce79 | 187 | BLE_GATT_FORMAT_SINT32 = 0x10, /**< Signed 32-bit integer. */ |
ktownsend | 0:ace2e8d3ce79 | 188 | BLE_GATT_FORMAT_SINT48 = 0x11, /**< Signed 48-bit integer. */ |
ktownsend | 0:ace2e8d3ce79 | 189 | BLE_GATT_FORMAT_SINT64 = 0x12, /**< Signed 64-bit integer. */ |
ktownsend | 0:ace2e8d3ce79 | 190 | BLE_GATT_FORMAT_SINT128 = 0x13, /**< Signed 128-bit integer. */ |
ktownsend | 0:ace2e8d3ce79 | 191 | BLE_GATT_FORMAT_FLOAT32 = 0x14, /**< IEEE-754 32-bit floating point. */ |
ktownsend | 0:ace2e8d3ce79 | 192 | BLE_GATT_FORMAT_FLOAT64 = 0x15, /**< IEEE-754 64-bit floating point. */ |
ktownsend | 0:ace2e8d3ce79 | 193 | BLE_GATT_FORMAT_SFLOAT = 0x16, /**< IEEE-11073 16-bit SFLOAT. */ |
ktownsend | 0:ace2e8d3ce79 | 194 | BLE_GATT_FORMAT_FLOAT = 0x17, /**< IEEE-11073 32-bit FLOAT. */ |
ktownsend | 0:ace2e8d3ce79 | 195 | BLE_GATT_FORMAT_DUINT16 = 0x18, /**< IEEE-20601 format. */ |
ktownsend | 0:ace2e8d3ce79 | 196 | BLE_GATT_FORMAT_UTF8S = 0x19, /**< UTF-8 string. */ |
ktownsend | 0:ace2e8d3ce79 | 197 | BLE_GATT_FORMAT_UTF16S = 0x1A, /**< UTF-16 string. */ |
ktownsend | 2:ffc5216bd2cc | 198 | BLE_GATT_FORMAT_STRUCT = 0x1B /**< Opaque Structure. */ |
ktownsend | 0:ace2e8d3ce79 | 199 | } ble_gatt_format_t; |
ktownsend | 0:ace2e8d3ce79 | 200 | |
ktownsend | 21:5442f7c70e71 | 201 | /**************************************************************************/ |
ktownsend | 21:5442f7c70e71 | 202 | /*! |
ktownsend | 21:5442f7c70e71 | 203 | \brief Standard GATT characteritic properties |
ktownsend | 21:5442f7c70e71 | 204 | |
ktownsend | 21:5442f7c70e71 | 205 | \note See Bluetooth Specification 4.0 (Vol. 3), Part G, Section 3.3.1.1 |
ktownsend | 21:5442f7c70e71 | 206 | and Section 3.3.3.1 for Extended Properties |
ktownsend | 21:5442f7c70e71 | 207 | */ |
ktownsend | 21:5442f7c70e71 | 208 | /**************************************************************************/ |
ktownsend | 3:46de446e82ed | 209 | typedef enum ble_gatt_char_properties_e |
ktownsend | 3:46de446e82ed | 210 | { |
ktownsend | 3:46de446e82ed | 211 | BLE_GATT_CHAR_PROPERTIES_BROADCAST = 0x01, /**< Permits broadcasts of the Characteristic Value using Server Characteristic Configuration Descriptor. */ |
ktownsend | 3:46de446e82ed | 212 | BLE_GATT_CHAR_PROPERTIES_READ = 0x02, /**< Permits reads of the Characteristic Value. */ |
ktownsend | 3:46de446e82ed | 213 | BLE_GATT_CHAR_PROPERTIES_WRITE_WITHOUT_RESPONSE = 0x04, /**< Permits writes of the Characteristic Value without response. */ |
ktownsend | 3:46de446e82ed | 214 | BLE_GATT_CHAR_PROPERTIES_WRITE = 0x08, /**< Permits writes of the Characteristic Value with response. */ |
ktownsend | 3:46de446e82ed | 215 | BLE_GATT_CHAR_PROPERTIES_NOTIFY = 0x10, /**< Permits notifications of a Characteristic Value without acknowledgement. */ |
ktownsend | 3:46de446e82ed | 216 | BLE_GATT_CHAR_PROPERTIES_INDICATE = 0x20, /**< Permits indications of a Characteristic Value with acknowledgement. */ |
ktownsend | 3:46de446e82ed | 217 | BLE_GATT_CHAR_PROPERTIES_AUTHENTICATED_SIGNED_WRITES = 0x40, /**< Permits signed writes to the Characteristic Value. */ |
ktownsend | 3:46de446e82ed | 218 | BLE_GATT_CHAR_PROPERTIES_EXTENDED_PROPERTIES = 0x80 /**< Additional characteristic properties are defined in the Characteristic Extended Properties Descriptor */ |
ktownsend | 3:46de446e82ed | 219 | } ble_gatt_char_properties_t; |
ktownsend | 3:46de446e82ed | 220 | |
ktownsend | 21:5442f7c70e71 | 221 | /**************************************************************************/ |
ktownsend | 21:5442f7c70e71 | 222 | /*! |
ktownsend | 21:5442f7c70e71 | 223 | \brief GATT presentation format wrapper |
ktownsend | 21:5442f7c70e71 | 224 | |
ktownsend | 21:5442f7c70e71 | 225 | \note See Bluetooth Specification 4.0 (Vol. 3), Part G, Section 3.3.3.5 |
ktownsend | 21:5442f7c70e71 | 226 | \note See https://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorViewer.aspx?u=org.bluetooth.descriptor.gatt.characteristic_presentation_format.xml |
ktownsend | 21:5442f7c70e71 | 227 | */ |
ktownsend | 21:5442f7c70e71 | 228 | /**************************************************************************/ |
ktownsend | 4:50a31ff5f974 | 229 | typedef struct PresentationFormat |
ktownsend | 4:50a31ff5f974 | 230 | { |
ktownsend | 4:50a31ff5f974 | 231 | uint8_t gatt_format; /**< Format of the value, see @ref ble_gatt_format_t. */ |
ktownsend | 4:50a31ff5f974 | 232 | int8_t exponent; /**< Exponent for integer data types. Ex. if Exponent = -3 and the char value is 3892, the actual value is 3.892 */ |
ktownsend | 4:50a31ff5f974 | 233 | uint16_t gatt_unit; /**< UUID from Bluetooth Assigned Numbers, see @ref ble_gatt_unit_t. */ |
ktownsend | 4:50a31ff5f974 | 234 | uint8_t gatt_namespace; /**< Namespace from Bluetooth Assigned Numbers, normally '1', see @ref BLE_GATT_CPF_NAMESPACES. */ |
ktownsend | 4:50a31ff5f974 | 235 | uint16_t gatt_nsdesc; /**< Namespace description from Bluetooth Assigned Numbers, normally '0', see @ref BLE_GATT_CPF_NAMESPACES. */ |
ktownsend | 4:50a31ff5f974 | 236 | } presentation_format_t; |
ktownsend | 4:50a31ff5f974 | 237 | |
ktownsend | 0:ace2e8d3ce79 | 238 | struct SecurityMode |
ktownsend | 0:ace2e8d3ce79 | 239 | { |
ktownsend | 0:ace2e8d3ce79 | 240 | uint8_t mode; /**< Security Mode (1 or 2), 0 for no permissions at all. */ |
ktownsend | 0:ace2e8d3ce79 | 241 | uint8_t level; /**< Level (1, 2 or 3), 0 for no permissions at all. */ |
ktownsend | 0:ace2e8d3ce79 | 242 | }; |
ktownsend | 0:ace2e8d3ce79 | 243 | |
ktownsend | 4:50a31ff5f974 | 244 | #ifdef __cplusplus |
ktownsend | 4:50a31ff5f974 | 245 | } |
ktownsend | 4:50a31ff5f974 | 246 | #endif |
ktownsend | 0:ace2e8d3ce79 | 247 | |
ktownsend | 0:ace2e8d3ce79 | 248 | #endif |