Skip to content

Commit a6379d9

Browse files
author
Kevin Townsend
committedMay 2, 2014
Code cleanup
1 parent 985359d commit a6379d9

File tree

2 files changed

+229
-208
lines changed

2 files changed

+229
-208
lines changed
 

‎nRF51822/projects/uartservice/btle.c

+30
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,36 @@
11
/**************************************************************************/
22
/*!
33
@file btle.c
4+
@author hathach (tinyusb.org)
5+
6+
@section LICENSE
7+
8+
Software License Agreement (BSD License)
9+
10+
Copyright (c) 2014, K. Townsend (microBuilder.eu)
11+
All rights reserved.
12+
13+
Redistribution and use in source and binary forms, with or without
14+
modification, are permitted provided that the following conditions are met:
15+
1. Redistributions of source code must retain the above copyright
16+
notice, this list of conditions and the following disclaimer.
17+
2. Redistributions in binary form must reproduce the above copyright
18+
notice, this list of conditions and the following disclaimer in the
19+
documentation and/or other materials provided with the distribution.
20+
3. Neither the name of the copyright holders nor the
21+
names of its contributors may be used to endorse or promote products
22+
derived from this software without specific prior written permission.
23+
24+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
25+
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
28+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
31+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
434
*/
535
/**************************************************************************/
636
#include "common/common.h"

‎nRF51822/projects/uartservice/btle.h

+199-208
Original file line numberDiff line numberDiff line change
@@ -1,208 +1,199 @@
1-
/**************************************************************************/
2-
/*!
3-
@file btle.h
4-
@author hathach (tinyusb.org)
5-
6-
@section LICENSE
7-
8-
Software License Agreement (BSD License)
9-
10-
Copyright (c) 2013, K. Townsend (microBuilder.eu)
11-
All rights reserved.
12-
13-
Redistribution and use in source and binary forms, with or without
14-
modification, are permitted provided that the following conditions are met:
15-
1. Redistributions of source code must retain the above copyright
16-
notice, this list of conditions and the following disclaimer.
17-
2. Redistributions in binary form must reproduce the above copyright
18-
notice, this list of conditions and the following disclaimer in the
19-
documentation and/or other materials provided with the distribution.
20-
3. Neither the name of the copyright holders nor the
21-
names of its contributors may be used to endorse or promote products
22-
derived from this software without specific prior written permission.
23-
24-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
25-
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
28-
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29-
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
31-
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34-
*/
35-
/**************************************************************************/
36-
#ifndef _BTLE_H_
37-
#define _BTLE_H_
38-
39-
#ifdef __cplusplus
40-
extern "C" {
41-
#endif
42-
43-
//--------------------------------------------------------------------+
44-
// INCLUDES
45-
//--------------------------------------------------------------------+
46-
#include "common/common.h"
47-
48-
#include "ble_srv_common.h"
49-
#include "ble.h"
50-
51-
//#include "heart_rate.h"
52-
#include "btle_uart.h"
53-
54-
//--------------------------------------------------------------------+
55-
// TYPE
56-
//--------------------------------------------------------------------+
57-
enum {
58-
BTLE_MAX_CHARACTERISTIC_PER_SERVICE = 10
59-
};
60-
61-
typedef struct {
62-
uint16_t uuid;
63-
ble_gatt_char_props_t properties;
64-
uint16_t len_min;
65-
uint16_t len_max;
66-
uint8_t const * init_value;
67-
68-
ble_gatts_char_handles_t handle; // characteristic handle
69-
}btle_characteristic_t;
70-
71-
typedef struct {
72-
uint8_t uuid_base[16]; // all zero means standard service
73-
uint16_t uuid; // primary service uuid
74-
75-
uint8_t uuid_type; // standard = 1, custom = 2, invalid 0
76-
uint16_t handle; // service handle
77-
78-
uint8_t char_count; // number of characteristics
79-
btle_characteristic_t* char_pool[BTLE_MAX_CHARACTERISTIC_PER_SERVICE];
80-
}btle_service_t;
81-
82-
/* ---------------------------------------------------------------------- */
83-
/* PUBLIC API */
84-
/* ---------------------------------------------------------------------- */
85-
error_t btle_characteristic_update(btle_characteristic_t const * p_char, void const * p_data, uint16_t len);
86-
error_t btle_init(btle_service_t service_list[], uint8_t const service_count);
87-
88-
// https://developer.bluetooth.org/gatt/units/Pages/default.aspx
89-
typedef enum ble_gatt_unit_e
90-
{
91-
BLE_GATT_CPF_UNIT_NONE = 0x2700,
92-
BLE_GATT_CPF_UNIT_LENGTH_METRE = 0x2701,
93-
BLE_GATT_CPF_UNIT_MASS_KILOGRAM = 0x2702,
94-
BLE_GATT_CPF_UNIT_TIME_SECOND = 0x2703,
95-
BLE_GATT_CPF_UNIT_ELECTRIC_CURRENT_AMPERE = 0x2704,
96-
BLE_GATT_CPF_UNIT_THERMODYNAMIC_TEMPERATURE_KELVIN = 0x2705,
97-
BLE_GATT_CPF_UNIT_AMOUNT_OF_SUBSTANCE_MOLE = 0x2706,
98-
BLE_GATT_CPF_UNIT_LUMINOUS_INTENSITY_CANDELA = 0x2707,
99-
BLE_GATT_CPF_UNIT_AREA_SQUARE_METRES = 0x2710,
100-
BLE_GATT_CPF_UNIT_VOLUME_CUBIC_METRES = 0x2711,
101-
BLE_GATT_CPF_UNIT_VELOCITY_METRES_PER_SECOND = 0x2712,
102-
BLE_GATT_CPF_UNIT_ACCELERATION_METRES_PER_SECOND_SQUARED = 0x2713,
103-
BLE_GATT_CPF_UNIT_WAVENUMBER_RECIPROCAL_METRE = 0x2714,
104-
BLE_GATT_CPF_UNIT_DENSITY_KILOGRAM_PER_CUBIC_METRE = 0x2715,
105-
BLE_GATT_CPF_UNIT_SURFACE_DENSITY_KILOGRAM_PER_SQUARE_METRE = 0x2716,
106-
BLE_GATT_CPF_UNIT_SPECIFIC_VOLUME_CUBIC_METRE_PER_KILOGRAM = 0x2717,
107-
BLE_GATT_CPF_UNIT_CURRENT_DENSITY_AMPERE_PER_SQUARE_METRE = 0x2718,
108-
BLE_GATT_CPF_UNIT_MAGNETIC_FIELD_STRENGTH_AMPERE_PER_METRE = 0x2719,
109-
BLE_GATT_CPF_UNIT_AMOUNT_CONCENTRATION_MOLE_PER_CUBIC_METRE = 0x271A,
110-
BLE_GATT_CPF_UNIT_MASS_CONCENTRATION_KILOGRAM_PER_CUBIC_METRE = 0x271B,
111-
BLE_GATT_CPF_UNIT_LUMINANCE_CANDELA_PER_SQUARE_METRE = 0x271C,
112-
BLE_GATT_CPF_UNIT_REFRACTIVE_INDEX = 0x271D,
113-
BLE_GATT_CPF_UNIT_RELATIVE_PERMEABILITY = 0x271E,
114-
BLE_GATT_CPF_UNIT_PLANE_ANGLE_RADIAN = 0x2720,
115-
BLE_GATT_CPF_UNIT_SOLID_ANGLE_STERADIAN = 0x2721,
116-
BLE_GATT_CPF_UNIT_FREQUENCY_HERTZ = 0x2722,
117-
BLE_GATT_CPF_UNIT_FORCE_NEWTON = 0x2723,
118-
BLE_GATT_CPF_UNIT_PRESSURE_PASCAL = 0x2724,
119-
BLE_GATT_CPF_UNIT_ENERGY_JOULE = 0x2725,
120-
BLE_GATT_CPF_UNIT_POWER_WATT = 0x2726,
121-
BLE_GATT_CPF_UNIT_ELECTRIC_CHARGE_COULOMB = 0x2727,
122-
BLE_GATT_CPF_UNIT_ELECTRIC_POTENTIAL_DIFFERENCE_VOLT = 0x2728,
123-
BLE_GATT_CPF_UNIT_CAPACITANCE_FARAD = 0x2729,
124-
BLE_GATT_CPF_UNIT_ELECTRIC_RESISTANCE_OHM = 0x272A,
125-
BLE_GATT_CPF_UNIT_ELECTRIC_CONDUCTANCE_SIEMENS = 0x272B,
126-
BLE_GATT_CPF_UNIT_MAGNETIC_FLEX_WEBER = 0x272C,
127-
BLE_GATT_CPF_UNIT_MAGNETIC_FLEX_DENSITY_TESLA = 0x272D,
128-
BLE_GATT_CPF_UNIT_INDUCTANCE_HENRY = 0x272E,
129-
BLE_GATT_CPF_UNIT_THERMODYNAMIC_TEMPERATURE_DEGREE_CELSIUS = 0x272F,
130-
BLE_GATT_CPF_UNIT_LUMINOUS_FLUX_LUMEN = 0x2730,
131-
BLE_GATT_CPF_UNIT_ILLUMINANCE_LUX = 0x2731,
132-
BLE_GATT_CPF_UNIT_ACTIVITY_REFERRED_TO_A_RADIONUCLIDE_BECQUEREL = 0x2732,
133-
BLE_GATT_CPF_UNIT_ABSORBED_DOSE_GRAY = 0x2733,
134-
BLE_GATT_CPF_UNIT_DOSE_EQUIVALENT_SIEVERT = 0x2734,
135-
BLE_GATT_CPF_UNIT_CATALYTIC_ACTIVITY_KATAL = 0x2735,
136-
BLE_GATT_CPF_UNIT_DYNAMIC_VISCOSITY_PASCAL_SECOND = 0x2740,
137-
BLE_GATT_CPF_UNIT_MOMENT_OF_FORCE_NEWTON_METRE = 0x2741,
138-
BLE_GATT_CPF_UNIT_SURFACE_TENSION_NEWTON_PER_METRE = 0x2742,
139-
BLE_GATT_CPF_UNIT_ANGULAR_VELOCITY_RADIAN_PER_SECOND = 0x2743,
140-
BLE_GATT_CPF_UNIT_ANGULAR_ACCELERATION_RADIAN_PER_SECOND_SQUARED = 0x2744,
141-
BLE_GATT_CPF_UNIT_HEAT_FLUX_DENSITY_WATT_PER_SQUARE_METRE = 0x2745,
142-
BLE_GATT_CPF_UNIT_HEAT_CAPACITY_JOULE_PER_KELVIN = 0x2746,
143-
BLE_GATT_CPF_UNIT_SPECIFIC_HEAT_CAPACITY_JOULE_PER_KILOGRAM_KELVIN = 0x2747,
144-
BLE_GATT_CPF_UNIT_SPECIFIC_ENERGY_JOULE_PER_KILOGRAM = 0x2748,
145-
BLE_GATT_CPF_UNIT_THERMAL_CONDUCTIVITY_WATT_PER_METRE_KELVIN = 0x2749,
146-
BLE_GATT_CPF_UNIT_ENERGY_DENSITY_JOULE_PER_CUBIC_METRE = 0x274A,
147-
BLE_GATT_CPF_UNIT_ELECTRIC_FIELD_STRENGTH_VOLT_PER_METRE = 0x274B,
148-
BLE_GATT_CPF_UNIT_ELECTRIC_CHARGE_DENSITY_COULOMB_PER_CUBIC_METRE = 0x274C,
149-
BLE_GATT_CPF_UNIT_SURFACE_CHARGE_DENSITY_COULOMB_PER_SQUARE_METRE = 0x274D,
150-
BLE_GATT_CPF_UNIT_ELECTRIC_FLUX_DENSITY_COULOMB_PER_SQUARE_METRE = 0x274E,
151-
BLE_GATT_CPF_UNIT_PERMITTIVITY_FARAD_PER_METRE = 0x274F,
152-
BLE_GATT_CPF_UNIT_PERMEABILITY_HENRY_PER_METRE = 0x2750,
153-
BLE_GATT_CPF_UNIT_MOLAR_ENERGY_JOULE_PER_MOLE = 0x2751,
154-
BLE_GATT_CPF_UNIT_MOLAR_ENTROPY_JOULE_PER_MOLE_KELVIN = 0x2752,
155-
BLE_GATT_CPF_UNIT_EXPOSURE_COULOMB_PER_KILOGRAM = 0x2753,
156-
BLE_GATT_CPF_UNIT_ABSORBED_DOSE_RATE_GRAY_PER_SECOND = 0x2754,
157-
BLE_GATT_CPF_UNIT_RADIANT_INTENSITY_WATT_PER_STERADIAN = 0x2755,
158-
BLE_GATT_CPF_UNIT_RADIANCE_WATT_PER_SQUARE_METRE_STERADIAN = 0x2756,
159-
BLE_GATT_CPF_UNIT_CATALYTIC_ACTIVITY_CONCENTRATION_KATAL_PER_CUBIC_METRE = 0x2757,
160-
BLE_GATT_CPF_UNIT_TIME_MINUTE = 0x2760,
161-
BLE_GATT_CPF_UNIT_TIME_HOUR = 0x2761,
162-
BLE_GATT_CPF_UNIT_TIME_DAY = 0x2762,
163-
BLE_GATT_CPF_UNIT_PLANE_ANGLE_DEGREE = 0x2763,
164-
BLE_GATT_CPF_UNIT_PLANE_ANGLE_MINUTE = 0x2764,
165-
BLE_GATT_CPF_UNIT_PLANE_ANGLE_SECOND = 0x2765,
166-
BLE_GATT_CPF_UNIT_AREA_HECTARE = 0x2766,
167-
BLE_GATT_CPF_UNIT_VOLUME_LITRE = 0x2767,
168-
BLE_GATT_CPF_UNIT_MASS_TONNE = 0x2768,
169-
BLE_GATT_CPF_UNIT_PRESSURE_BAR = 0x2780,
170-
BLE_GATT_CPF_UNIT_PRESSURE_MILLIMETRE_OF_MERCURY = 0x2781,
171-
BLE_GATT_CPF_UNIT_LENGTH_ANGSTROM = 0x2782,
172-
BLE_GATT_CPF_UNIT_LENGTH_NAUTICAL_MILE = 0x2783,
173-
BLE_GATT_CPF_UNIT_AREA_BARN = 0x2784,
174-
BLE_GATT_CPF_UNIT_VELOCITY_KNOT = 0x2785,
175-
BLE_GATT_CPF_UNIT_LOGARITHMIC_RADIO_QUANTITY_NEPER = 0x2786,
176-
BLE_GATT_CPF_UNIT_LOGARITHMIC_RADIO_QUANTITY_BEL = 0x2787,
177-
BLE_GATT_CPF_UNIT_LENGTH_YARD = 0x27A0,
178-
BLE_GATT_CPF_UNIT_LENGTH_PARSEC = 0x27A1,
179-
BLE_GATT_CPF_UNIT_LENGTH_INCH = 0x27A2,
180-
BLE_GATT_CPF_UNIT_LENGTH_FOOT = 0x27A3,
181-
BLE_GATT_CPF_UNIT_LENGTH_MILE = 0x27A4,
182-
BLE_GATT_CPF_UNIT_PRESSURE_POUND_FORCE_PER_SQUARE_INCH = 0x27A5,
183-
BLE_GATT_CPF_UNIT_VELOCITY_KILOMETRE_PER_HOUR = 0x27A6,
184-
BLE_GATT_CPF_UNIT_VELOCITY_MILE_PER_HOUR = 0x27A7,
185-
BLE_GATT_CPF_UNIT_ANGULAR_VELOCITY_REVOLUTION_PER_MINUTE = 0x27A8,
186-
BLE_GATT_CPF_UNIT_ENERGY_GRAM_CALORIE = 0x27A9,
187-
BLE_GATT_CPF_UNIT_ENERGY_KILOGRAM_CALORIE = 0x27AA,
188-
BLE_GATT_CPF_UNIT_ENERGY_KILOWATT_HOUR = 0x27AB,
189-
BLE_GATT_CPF_UNIT_THERMODYNAMIC_TEMPERATURE_DEGREE_FAHRENHEIT = 0x27AC,
190-
BLE_GATT_CPF_UNIT_PERCENTAGE = 0x27AD,
191-
BLE_GATT_CPF_UNIT_PER_MILLE = 0x27AE,
192-
BLE_GATT_CPF_UNIT_PERIOD_BEATS_PER_MINUTE = 0x27AF,
193-
BLE_GATT_CPF_UNIT_ELECTRIC_CHARGE_AMPERE_HOURS = 0x27B0,
194-
BLE_GATT_CPF_UNIT_MASS_DENSITY_MILLIGRAM_PER_DECILITRE = 0x27B1,
195-
BLE_GATT_CPF_UNIT_MASS_DENSITY_MILLIMOLE_PER_LITRE = 0x27B2,
196-
BLE_GATT_CPF_UNIT_TIME_YEAR = 0x27B3,
197-
BLE_GATT_CPF_UNIT_TIME_MONTH = 0x27B4,
198-
BLE_GATT_CPF_UNIT_CONCENTRATION_COUNT_PER_CUBIC_METRE = 0x27B5,
199-
BLE_GATT_CPF_UNIT_IRRADIANCE_WATT_PER_SQUARE_METRE = 0x27B6
200-
} ble_gatt_unit_t;
201-
202-
#ifdef __cplusplus
203-
}
204-
#endif
205-
206-
#endif /* _BTLE_H_ */
207-
208-
/** @} */
1+
/**************************************************************************/
2+
/*!
3+
@file btle.h
4+
@author hathach (tinyusb.org)
5+
6+
@section LICENSE
7+
8+
Software License Agreement (BSD License)
9+
10+
Copyright (c) 2014, K. Townsend (microBuilder.eu)
11+
All rights reserved.
12+
13+
Redistribution and use in source and binary forms, with or without
14+
modification, are permitted provided that the following conditions are met:
15+
1. Redistributions of source code must retain the above copyright
16+
notice, this list of conditions and the following disclaimer.
17+
2. Redistributions in binary form must reproduce the above copyright
18+
notice, this list of conditions and the following disclaimer in the
19+
documentation and/or other materials provided with the distribution.
20+
3. Neither the name of the copyright holders nor the
21+
names of its contributors may be used to endorse or promote products
22+
derived from this software without specific prior written permission.
23+
24+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
25+
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
28+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
31+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34+
*/
35+
/**************************************************************************/
36+
#ifndef _BTLE_H_
37+
#define _BTLE_H_
38+
39+
#ifdef __cplusplus
40+
extern "C" {
41+
#endif
42+
43+
#include "common/common.h"
44+
#include "ble_srv_common.h"
45+
#include "ble.h"
46+
#include "btle_uart.h"
47+
48+
enum
49+
{
50+
BTLE_MAX_CHARACTERISTIC_PER_SERVICE = 10
51+
};
52+
53+
/* Abstraction for custom GATT characteristics */
54+
typedef struct
55+
{
56+
uint16_t uuid;
57+
ble_gatt_char_props_t properties; // Characteristic properties/access-rights
58+
uint16_t len_min; // Min length (in bytes) for the char value
59+
uint16_t len_max; // Max length (in bytes) for the char value
60+
uint8_t const * init_value; // Initial value for the char
61+
ble_gatts_char_handles_t handle; // Characteristic handle
62+
} btle_characteristic_t;
63+
64+
/* Abstraction for custom GATT services */
65+
typedef struct
66+
{
67+
uint8_t uuid_base[16]; // All zeroes = standard BLE service
68+
uint16_t uuid; // The primary service UUID
69+
uint8_t uuid_type; // Standard = 1, Custom = 2, Invalid = 0
70+
uint16_t handle; // Service handle
71+
uint8_t char_count; // Number of characteristics
72+
btle_characteristic_t* char_pool[BTLE_MAX_CHARACTERISTIC_PER_SERVICE];
73+
} btle_service_t;
74+
75+
/* Characteristic Presentation Format unit values aren't defined by Nordic */
76+
/* See https://developer.bluetooth.org/gatt/units/Pages/default.aspx */
77+
typedef enum ble_gatt_unit_e
78+
{
79+
BLE_GATT_CPF_UNIT_NONE = 0x2700,
80+
BLE_GATT_CPF_UNIT_LENGTH_METRE = 0x2701,
81+
BLE_GATT_CPF_UNIT_MASS_KILOGRAM = 0x2702,
82+
BLE_GATT_CPF_UNIT_TIME_SECOND = 0x2703,
83+
BLE_GATT_CPF_UNIT_ELECTRIC_CURRENT_AMPERE = 0x2704,
84+
BLE_GATT_CPF_UNIT_THERMODYNAMIC_TEMPERATURE_KELVIN = 0x2705,
85+
BLE_GATT_CPF_UNIT_AMOUNT_OF_SUBSTANCE_MOLE = 0x2706,
86+
BLE_GATT_CPF_UNIT_LUMINOUS_INTENSITY_CANDELA = 0x2707,
87+
BLE_GATT_CPF_UNIT_AREA_SQUARE_METRES = 0x2710,
88+
BLE_GATT_CPF_UNIT_VOLUME_CUBIC_METRES = 0x2711,
89+
BLE_GATT_CPF_UNIT_VELOCITY_METRES_PER_SECOND = 0x2712,
90+
BLE_GATT_CPF_UNIT_ACCELERATION_METRES_PER_SECOND_SQUARED = 0x2713,
91+
BLE_GATT_CPF_UNIT_WAVENUMBER_RECIPROCAL_METRE = 0x2714,
92+
BLE_GATT_CPF_UNIT_DENSITY_KILOGRAM_PER_CUBIC_METRE = 0x2715,
93+
BLE_GATT_CPF_UNIT_SURFACE_DENSITY_KILOGRAM_PER_SQUARE_METRE = 0x2716,
94+
BLE_GATT_CPF_UNIT_SPECIFIC_VOLUME_CUBIC_METRE_PER_KILOGRAM = 0x2717,
95+
BLE_GATT_CPF_UNIT_CURRENT_DENSITY_AMPERE_PER_SQUARE_METRE = 0x2718,
96+
BLE_GATT_CPF_UNIT_MAGNETIC_FIELD_STRENGTH_AMPERE_PER_METRE = 0x2719,
97+
BLE_GATT_CPF_UNIT_AMOUNT_CONCENTRATION_MOLE_PER_CUBIC_METRE = 0x271A,
98+
BLE_GATT_CPF_UNIT_MASS_CONCENTRATION_KILOGRAM_PER_CUBIC_METRE = 0x271B,
99+
BLE_GATT_CPF_UNIT_LUMINANCE_CANDELA_PER_SQUARE_METRE = 0x271C,
100+
BLE_GATT_CPF_UNIT_REFRACTIVE_INDEX = 0x271D,
101+
BLE_GATT_CPF_UNIT_RELATIVE_PERMEABILITY = 0x271E,
102+
BLE_GATT_CPF_UNIT_PLANE_ANGLE_RADIAN = 0x2720,
103+
BLE_GATT_CPF_UNIT_SOLID_ANGLE_STERADIAN = 0x2721,
104+
BLE_GATT_CPF_UNIT_FREQUENCY_HERTZ = 0x2722,
105+
BLE_GATT_CPF_UNIT_FORCE_NEWTON = 0x2723,
106+
BLE_GATT_CPF_UNIT_PRESSURE_PASCAL = 0x2724,
107+
BLE_GATT_CPF_UNIT_ENERGY_JOULE = 0x2725,
108+
BLE_GATT_CPF_UNIT_POWER_WATT = 0x2726,
109+
BLE_GATT_CPF_UNIT_ELECTRIC_CHARGE_COULOMB = 0x2727,
110+
BLE_GATT_CPF_UNIT_ELECTRIC_POTENTIAL_DIFFERENCE_VOLT = 0x2728,
111+
BLE_GATT_CPF_UNIT_CAPACITANCE_FARAD = 0x2729,
112+
BLE_GATT_CPF_UNIT_ELECTRIC_RESISTANCE_OHM = 0x272A,
113+
BLE_GATT_CPF_UNIT_ELECTRIC_CONDUCTANCE_SIEMENS = 0x272B,
114+
BLE_GATT_CPF_UNIT_MAGNETIC_FLEX_WEBER = 0x272C,
115+
BLE_GATT_CPF_UNIT_MAGNETIC_FLEX_DENSITY_TESLA = 0x272D,
116+
BLE_GATT_CPF_UNIT_INDUCTANCE_HENRY = 0x272E,
117+
BLE_GATT_CPF_UNIT_THERMODYNAMIC_TEMPERATURE_DEGREE_CELSIUS = 0x272F,
118+
BLE_GATT_CPF_UNIT_LUMINOUS_FLUX_LUMEN = 0x2730,
119+
BLE_GATT_CPF_UNIT_ILLUMINANCE_LUX = 0x2731,
120+
BLE_GATT_CPF_UNIT_ACTIVITY_REFERRED_TO_A_RADIONUCLIDE_BECQUEREL = 0x2732,
121+
BLE_GATT_CPF_UNIT_ABSORBED_DOSE_GRAY = 0x2733,
122+
BLE_GATT_CPF_UNIT_DOSE_EQUIVALENT_SIEVERT = 0x2734,
123+
BLE_GATT_CPF_UNIT_CATALYTIC_ACTIVITY_KATAL = 0x2735,
124+
BLE_GATT_CPF_UNIT_DYNAMIC_VISCOSITY_PASCAL_SECOND = 0x2740,
125+
BLE_GATT_CPF_UNIT_MOMENT_OF_FORCE_NEWTON_METRE = 0x2741,
126+
BLE_GATT_CPF_UNIT_SURFACE_TENSION_NEWTON_PER_METRE = 0x2742,
127+
BLE_GATT_CPF_UNIT_ANGULAR_VELOCITY_RADIAN_PER_SECOND = 0x2743,
128+
BLE_GATT_CPF_UNIT_ANGULAR_ACCELERATION_RADIAN_PER_SECOND_SQUARED = 0x2744,
129+
BLE_GATT_CPF_UNIT_HEAT_FLUX_DENSITY_WATT_PER_SQUARE_METRE = 0x2745,
130+
BLE_GATT_CPF_UNIT_HEAT_CAPACITY_JOULE_PER_KELVIN = 0x2746,
131+
BLE_GATT_CPF_UNIT_SPECIFIC_HEAT_CAPACITY_JOULE_PER_KILOGRAM_KELVIN = 0x2747,
132+
BLE_GATT_CPF_UNIT_SPECIFIC_ENERGY_JOULE_PER_KILOGRAM = 0x2748,
133+
BLE_GATT_CPF_UNIT_THERMAL_CONDUCTIVITY_WATT_PER_METRE_KELVIN = 0x2749,
134+
BLE_GATT_CPF_UNIT_ENERGY_DENSITY_JOULE_PER_CUBIC_METRE = 0x274A,
135+
BLE_GATT_CPF_UNIT_ELECTRIC_FIELD_STRENGTH_VOLT_PER_METRE = 0x274B,
136+
BLE_GATT_CPF_UNIT_ELECTRIC_CHARGE_DENSITY_COULOMB_PER_CUBIC_METRE = 0x274C,
137+
BLE_GATT_CPF_UNIT_SURFACE_CHARGE_DENSITY_COULOMB_PER_SQUARE_METRE = 0x274D,
138+
BLE_GATT_CPF_UNIT_ELECTRIC_FLUX_DENSITY_COULOMB_PER_SQUARE_METRE = 0x274E,
139+
BLE_GATT_CPF_UNIT_PERMITTIVITY_FARAD_PER_METRE = 0x274F,
140+
BLE_GATT_CPF_UNIT_PERMEABILITY_HENRY_PER_METRE = 0x2750,
141+
BLE_GATT_CPF_UNIT_MOLAR_ENERGY_JOULE_PER_MOLE = 0x2751,
142+
BLE_GATT_CPF_UNIT_MOLAR_ENTROPY_JOULE_PER_MOLE_KELVIN = 0x2752,
143+
BLE_GATT_CPF_UNIT_EXPOSURE_COULOMB_PER_KILOGRAM = 0x2753,
144+
BLE_GATT_CPF_UNIT_ABSORBED_DOSE_RATE_GRAY_PER_SECOND = 0x2754,
145+
BLE_GATT_CPF_UNIT_RADIANT_INTENSITY_WATT_PER_STERADIAN = 0x2755,
146+
BLE_GATT_CPF_UNIT_RADIANCE_WATT_PER_SQUARE_METRE_STERADIAN = 0x2756,
147+
BLE_GATT_CPF_UNIT_CATALYTIC_ACTIVITY_CONCENTRATION_KATAL_PER_CUBIC_METRE = 0x2757,
148+
BLE_GATT_CPF_UNIT_TIME_MINUTE = 0x2760,
149+
BLE_GATT_CPF_UNIT_TIME_HOUR = 0x2761,
150+
BLE_GATT_CPF_UNIT_TIME_DAY = 0x2762,
151+
BLE_GATT_CPF_UNIT_PLANE_ANGLE_DEGREE = 0x2763,
152+
BLE_GATT_CPF_UNIT_PLANE_ANGLE_MINUTE = 0x2764,
153+
BLE_GATT_CPF_UNIT_PLANE_ANGLE_SECOND = 0x2765,
154+
BLE_GATT_CPF_UNIT_AREA_HECTARE = 0x2766,
155+
BLE_GATT_CPF_UNIT_VOLUME_LITRE = 0x2767,
156+
BLE_GATT_CPF_UNIT_MASS_TONNE = 0x2768,
157+
BLE_GATT_CPF_UNIT_PRESSURE_BAR = 0x2780,
158+
BLE_GATT_CPF_UNIT_PRESSURE_MILLIMETRE_OF_MERCURY = 0x2781,
159+
BLE_GATT_CPF_UNIT_LENGTH_ANGSTROM = 0x2782,
160+
BLE_GATT_CPF_UNIT_LENGTH_NAUTICAL_MILE = 0x2783,
161+
BLE_GATT_CPF_UNIT_AREA_BARN = 0x2784,
162+
BLE_GATT_CPF_UNIT_VELOCITY_KNOT = 0x2785,
163+
BLE_GATT_CPF_UNIT_LOGARITHMIC_RADIO_QUANTITY_NEPER = 0x2786,
164+
BLE_GATT_CPF_UNIT_LOGARITHMIC_RADIO_QUANTITY_BEL = 0x2787,
165+
BLE_GATT_CPF_UNIT_LENGTH_YARD = 0x27A0,
166+
BLE_GATT_CPF_UNIT_LENGTH_PARSEC = 0x27A1,
167+
BLE_GATT_CPF_UNIT_LENGTH_INCH = 0x27A2,
168+
BLE_GATT_CPF_UNIT_LENGTH_FOOT = 0x27A3,
169+
BLE_GATT_CPF_UNIT_LENGTH_MILE = 0x27A4,
170+
BLE_GATT_CPF_UNIT_PRESSURE_POUND_FORCE_PER_SQUARE_INCH = 0x27A5,
171+
BLE_GATT_CPF_UNIT_VELOCITY_KILOMETRE_PER_HOUR = 0x27A6,
172+
BLE_GATT_CPF_UNIT_VELOCITY_MILE_PER_HOUR = 0x27A7,
173+
BLE_GATT_CPF_UNIT_ANGULAR_VELOCITY_REVOLUTION_PER_MINUTE = 0x27A8,
174+
BLE_GATT_CPF_UNIT_ENERGY_GRAM_CALORIE = 0x27A9,
175+
BLE_GATT_CPF_UNIT_ENERGY_KILOGRAM_CALORIE = 0x27AA,
176+
BLE_GATT_CPF_UNIT_ENERGY_KILOWATT_HOUR = 0x27AB,
177+
BLE_GATT_CPF_UNIT_THERMODYNAMIC_TEMPERATURE_DEGREE_FAHRENHEIT = 0x27AC,
178+
BLE_GATT_CPF_UNIT_PERCENTAGE = 0x27AD,
179+
BLE_GATT_CPF_UNIT_PER_MILLE = 0x27AE,
180+
BLE_GATT_CPF_UNIT_PERIOD_BEATS_PER_MINUTE = 0x27AF,
181+
BLE_GATT_CPF_UNIT_ELECTRIC_CHARGE_AMPERE_HOURS = 0x27B0,
182+
BLE_GATT_CPF_UNIT_MASS_DENSITY_MILLIGRAM_PER_DECILITRE = 0x27B1,
183+
BLE_GATT_CPF_UNIT_MASS_DENSITY_MILLIMOLE_PER_LITRE = 0x27B2,
184+
BLE_GATT_CPF_UNIT_TIME_YEAR = 0x27B3,
185+
BLE_GATT_CPF_UNIT_TIME_MONTH = 0x27B4,
186+
BLE_GATT_CPF_UNIT_CONCENTRATION_COUNT_PER_CUBIC_METRE = 0x27B5,
187+
BLE_GATT_CPF_UNIT_IRRADIANCE_WATT_PER_SQUARE_METRE = 0x27B6
188+
} ble_gatt_unit_t;
189+
190+
error_t btle_init ( btle_service_t service_list[], uint8_t const service_count );
191+
error_t btle_characteristic_update ( btle_characteristic_t const * p_char, void const * p_data, uint16_t len );
192+
193+
#ifdef __cplusplus
194+
}
195+
#endif
196+
197+
#endif /* _BTLE_H_ */
198+
199+
/** @} */

0 commit comments

Comments
 (0)
Please sign in to comment.