xref: /btstack/port/apollo2-em9304/example-template/src/le_counter.h (revision e6c9673776c7f85e24c76da7f4b1b83031102d2b)
1*e6c96737SMatthias Ringwald 
2*e6c96737SMatthias Ringwald // le_counter.h generated from ../../example/le_counter.gatt for BTstack
3*e6c96737SMatthias Ringwald 
4*e6c96737SMatthias Ringwald // binary representation
5*e6c96737SMatthias Ringwald // attribute size in bytes (16), flags(16), handle (16), uuid (16/128), value(...)
6*e6c96737SMatthias Ringwald 
7*e6c96737SMatthias Ringwald #include <stdint.h>
8*e6c96737SMatthias Ringwald 
9*e6c96737SMatthias Ringwald const uint8_t profile_data[] =
10*e6c96737SMatthias Ringwald {
11*e6c96737SMatthias Ringwald     // 0x0001 PRIMARY_SERVICE-GAP_SERVICE
12*e6c96737SMatthias Ringwald     0x0a, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x28, 0x00, 0x18,
13*e6c96737SMatthias Ringwald     // 0x0002 CHARACTERISTIC-GAP_DEVICE_NAME-READ
14*e6c96737SMatthias Ringwald     0x0d, 0x00, 0x02, 0x00, 0x02, 0x00, 0x03, 0x28, 0x02, 0x03, 0x00, 0x00, 0x2a,
15*e6c96737SMatthias Ringwald     // 0x0003 VALUE-GAP_DEVICE_NAME-READ-'LE Counter'
16*e6c96737SMatthias Ringwald     0x12, 0x00, 0x02, 0x00, 0x03, 0x00, 0x00, 0x2a, 0x4c, 0x45, 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72,
17*e6c96737SMatthias Ringwald     // add Battery Service
18*e6c96737SMatthias Ringwald     // #import <battery_service.gatt> -- BEGIN
19*e6c96737SMatthias Ringwald     // Specification Type org.bluetooth.service.battery_service
20*e6c96737SMatthias Ringwald     // https://www.bluetooth.com/api/gatt/xmlfile?xmlFileName=org.bluetooth.service.battery_service.xml
21*e6c96737SMatthias Ringwald     // Battery Service 180F
22*e6c96737SMatthias Ringwald 
23*e6c96737SMatthias Ringwald     // 0x0004 PRIMARY_SERVICE-ORG_BLUETOOTH_SERVICE_BATTERY_SERVICE
24*e6c96737SMatthias Ringwald     0x0a, 0x00, 0x02, 0x00, 0x04, 0x00, 0x00, 0x28, 0x0f, 0x18,
25*e6c96737SMatthias Ringwald     // 0x0005 CHARACTERISTIC-ORG_BLUETOOTH_CHARACTERISTIC_BATTERY_LEVEL-DYNAMIC | READ | NOTIFY
26*e6c96737SMatthias Ringwald     0x0d, 0x00, 0x02, 0x00, 0x05, 0x00, 0x03, 0x28, 0x12, 0x06, 0x00, 0x19, 0x2a,
27*e6c96737SMatthias Ringwald     // 0x0006 VALUE-ORG_BLUETOOTH_CHARACTERISTIC_BATTERY_LEVEL-DYNAMIC | READ | NOTIFY-''
28*e6c96737SMatthias Ringwald     0x08, 0x00, 0x02, 0x01, 0x06, 0x00, 0x19, 0x2a,
29*e6c96737SMatthias Ringwald     // 0x0007 CLIENT_CHARACTERISTIC_CONFIGURATION
30*e6c96737SMatthias Ringwald     0x0a, 0x00, 0x1b, 0x01, 0x07, 0x00, 0x02, 0x29, 0x00, 0x00,
31*e6c96737SMatthias Ringwald     // #import <battery_service.gatt> -- END
32*e6c96737SMatthias Ringwald 
33*e6c96737SMatthias Ringwald     // 0x0008 PRIMARY_SERVICE-GATT_SERVICE
34*e6c96737SMatthias Ringwald     0x0a, 0x00, 0x02, 0x00, 0x08, 0x00, 0x00, 0x28, 0x01, 0x18,
35*e6c96737SMatthias Ringwald     // 0x0009 CHARACTERISTIC-GATT_SERVICE_CHANGED-READ
36*e6c96737SMatthias Ringwald     0x0d, 0x00, 0x02, 0x00, 0x09, 0x00, 0x03, 0x28, 0x02, 0x0a, 0x00, 0x05, 0x2a,
37*e6c96737SMatthias Ringwald     // 0x000a VALUE-GATT_SERVICE_CHANGED-READ-''
38*e6c96737SMatthias Ringwald     0x08, 0x00, 0x02, 0x00, 0x0a, 0x00, 0x05, 0x2a,
39*e6c96737SMatthias Ringwald     // Counter Service
40*e6c96737SMatthias Ringwald 
41*e6c96737SMatthias Ringwald     // 0x000b PRIMARY_SERVICE-0000FF10-0000-1000-8000-00805F9B34FB
42*e6c96737SMatthias Ringwald     0x18, 0x00, 0x02, 0x00, 0x0b, 0x00, 0x00, 0x28, 0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0x10, 0xff, 0x00, 0x00,
43*e6c96737SMatthias Ringwald     // Counter Characteristic, with read and notify
44*e6c96737SMatthias Ringwald     // 0x000c CHARACTERISTIC-0000FF11-0000-1000-8000-00805F9B34FB-READ | NOTIFY | DYNAMIC
45*e6c96737SMatthias Ringwald     0x1b, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x03, 0x28, 0x12, 0x0d, 0x00, 0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0x11, 0xff, 0x00, 0x00,
46*e6c96737SMatthias Ringwald     // 0x000d VALUE-0000FF11-0000-1000-8000-00805F9B34FB-READ | NOTIFY | DYNAMIC-''
47*e6c96737SMatthias Ringwald     0x16, 0x00, 0x02, 0x03, 0x0d, 0x00, 0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0x11, 0xff, 0x00, 0x00,
48*e6c96737SMatthias Ringwald     // 0x000e CLIENT_CHARACTERISTIC_CONFIGURATION
49*e6c96737SMatthias Ringwald     0x0a, 0x00, 0x1b, 0x01, 0x0e, 0x00, 0x02, 0x29, 0x00, 0x00,
50*e6c96737SMatthias Ringwald 
51*e6c96737SMatthias Ringwald     // END
52*e6c96737SMatthias Ringwald     0x00, 0x00,
53*e6c96737SMatthias Ringwald }; // total size 122 bytes
54*e6c96737SMatthias Ringwald 
55*e6c96737SMatthias Ringwald 
56*e6c96737SMatthias Ringwald //
57*e6c96737SMatthias Ringwald // list service handle ranges
58*e6c96737SMatthias Ringwald //
59*e6c96737SMatthias Ringwald #define ATT_SERVICE_GAP_SERVICE_START_HANDLE 0x0001
60*e6c96737SMatthias Ringwald #define ATT_SERVICE_GAP_SERVICE_END_HANDLE 0x0003
61*e6c96737SMatthias Ringwald #define ATT_SERVICE_ORG_BLUETOOTH_SERVICE_BATTERY_SERVICE_START_HANDLE 0x0004
62*e6c96737SMatthias Ringwald #define ATT_SERVICE_ORG_BLUETOOTH_SERVICE_BATTERY_SERVICE_END_HANDLE 0x0007
63*e6c96737SMatthias Ringwald #define ATT_SERVICE_GATT_SERVICE_START_HANDLE 0x0008
64*e6c96737SMatthias Ringwald #define ATT_SERVICE_GATT_SERVICE_END_HANDLE 0x000a
65*e6c96737SMatthias Ringwald #define ATT_SERVICE_0000FF10_0000_1000_8000_00805F9B34FB_START_HANDLE 0x000b
66*e6c96737SMatthias Ringwald #define ATT_SERVICE_0000FF10_0000_1000_8000_00805F9B34FB_END_HANDLE 0x000e
67*e6c96737SMatthias Ringwald 
68*e6c96737SMatthias Ringwald //
69*e6c96737SMatthias Ringwald // list mapping between characteristics and handles
70*e6c96737SMatthias Ringwald //
71*e6c96737SMatthias Ringwald #define ATT_CHARACTERISTIC_GAP_DEVICE_NAME_01_VALUE_HANDLE 0x0003
72*e6c96737SMatthias Ringwald #define ATT_CHARACTERISTIC_ORG_BLUETOOTH_CHARACTERISTIC_BATTERY_LEVEL_01_VALUE_HANDLE 0x0006
73*e6c96737SMatthias Ringwald #define ATT_CHARACTERISTIC_ORG_BLUETOOTH_CHARACTERISTIC_BATTERY_LEVEL_01_CLIENT_CONFIGURATION_HANDLE 0x0007
74*e6c96737SMatthias Ringwald #define ATT_CHARACTERISTIC_GATT_SERVICE_CHANGED_01_VALUE_HANDLE 0x000a
75*e6c96737SMatthias Ringwald #define ATT_CHARACTERISTIC_0000FF11_0000_1000_8000_00805F9B34FB_01_VALUE_HANDLE 0x000d
76*e6c96737SMatthias Ringwald #define ATT_CHARACTERISTIC_0000FF11_0000_1000_8000_00805F9B34FB_01_CLIENT_CONFIGURATION_HANDLE 0x000e
77