Select one of the symbols to view example projects that use it.
 
Outline
#define BTSTACK_FILE__
#include <string.h>
#include <stdlib.h>
#include "ble/att_db_util.h"
#include "ble/att_db.h"
#include "ble/core.h"
#include "btstack_util.h"
#include "btstack_debug.h"
#include "bluetooth.h"
#define ATT_DB_BUFFER_INCREMENT
att_db_storage
att_db
att_db_size
att_db_max_size
att_db_next_handle
att_db_hash_len
att_db_util_set_end_tag()
att_db_util_init()
att_db_util_hash_include_with_value(uint16_t)
att_db_util_hash_include_without_value(uint16_t)
att_db_util_assert_space(uint16_t)
att_db_util_add_attribute_uuid16(uint16_t, uint16_t, uint8_t *, uint16_t)
att_db_util_add_attribute_uuid128(const uint8_t *, uint16_t, uint8_t *, uint16_t)
att_db_util_add_service_uuid16(uint16_t)
att_db_util_add_service_uuid128(const uint8_t *)
att_db_util_add_secondary_service_uuid16(uint16_t)
att_db_util_add_secondary_service_uuid128(const uint8_t *)
att_db_util_add_included_service_uuid16(uint16_t, uint16_t, uint16_t)
att_db_util_add_client_characteristic_configuration(uint16_t)
att_db_util_encode_permissions(uint16_t, uint8_t, uint8_t)
att_db_util_add_characteristic_uuid16(uint16_t, uint16_t, uint8_t, uint8_t, uint8_t *, uint16_t)
att_db_util_add_characteristic_uuid128(const uint8_t *, uint16_t, uint8_t, uint8_t, uint8_t *, uint16_t)
att_db_util_add_descriptor_uuid16(uint16_t, uint16_t, uint8_t, uint8_t, uint8_t *, uint16_t)
att_db_util_add_descriptor_uuid128(const uint8_t *, uint16_t, uint8_t, uint8_t, uint8_t *, uint16_t)
att_db_util_get_address()
att_db_util_get_size()
att_db_util_hash_att_ptr
att_db_util_hash_offset
att_db_util_hash_bytes_available
att_db_util_hash_fetch_next_attribute()
att_db_util_hash_len()
att_db_util_hash_init()
att_db_util_hash_get_next()
att_db_util_hash_get(uint16_t)
att_db_util_hash_calc(btstack_crypto_aes128_cmac_t *, uint8_t *, void (*)(void *), void *)
Files
loading...
SourceVuRaspberry Pi Pico SDK and ExamplesBluetooth LE Stacksrc/ble/att_db_util.c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/* * Copyright (C) 2014 BlueKitchen GmbH * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holders nor the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * 4. Any redistribution, use, or modification is done solely for * personal benefit and not for any commercial purpose or for * monetary gain. * * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BLUEKITCHEN * GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * Please inquire about commercial licensing options at * contact@bluekitchen-gmbh.com * *//* ... */ #define BTSTACK_FILE__ "att_db_util.c" #include <string.h> #include <stdlib.h> #include "ble/att_db_util.h" #include "ble/att_db.h" #include "ble/core.h" #include "btstack_util.h" #include "btstack_debug.h" #include "bluetooth.h" 8 includes // ATT DB Storage #ifdef HAVE_MALLOC // number of bytes that the att db buffer is increased on init / realloc #define ATT_DB_BUFFER_INCREMENT 128 /* ... */#else #ifdef MAX_ATT_DB_SIZE static uint8_t att_db_storage[MAX_ATT_DB_SIZE]; #else #error Neither HAVE_MALLOC nor MAX_ATT_DB_SIZE is defined. #endif/* ... */ #endif static uint8_t * att_db; static uint16_t att_db_size; static uint16_t att_db_max_size; static uint16_t att_db_next_handle; static uint16_t att_db_hash_len; static void att_db_util_set_end_tag(void){ // end tag att_db[att_db_size] = 0u; att_db[att_db_size+1u] = 0u; }{ ... } void att_db_util_init(void){ #ifdef HAVE_MALLOC if (att_db == NULL){ att_db = (uint8_t*) malloc((size_t)ATT_DB_BUFFER_INCREMENT); att_db_max_size = (uint16_t)ATT_DB_BUFFER_INCREMENT; }if (att_db == NULL) { ... } /* ... */#else att_db = att_db_storage; att_db_max_size = sizeof(att_db_storage);/* ... */ #endif // store att version att_db[0] = (uint8_t)ATT_DB_VERSION; att_db_size = 1u; att_db_next_handle = 1u; att_db_hash_len = 0u; att_db_util_set_end_tag(); }{ ... } static bool att_db_util_hash_include_with_value(uint16_t uuid16){ /* «Primary Service», «Secondary Service», «Included Service», «Characteristic», or «Characteristic Extended Properties» */ switch (uuid16){ case GATT_PRIMARY_SERVICE_UUID: case GATT_SECONDARY_SERVICE_UUID: case GATT_INCLUDE_SERVICE_UUID: case GATT_CHARACTERISTICS_UUID: case GATT_CHARACTERISTIC_EXTENDED_PROPERTIES: return true;case GATT_CHARACTERISTIC_EXTENDED_PROPERTIES: default: return false;default }switch (uuid16) { ... } }{ ... } static bool att_db_util_hash_include_without_value(uint16_t uuid16){ /* «Characteristic User Description», «Client Characteristic Configuration», «Server Characteristic Configuration», * «Characteristic Aggregate Format», «Characteristic Format» *//* ... */ switch (uuid16){ case GATT_CHARACTERISTIC_USER_DESCRIPTION: case GATT_CLIENT_CHARACTERISTICS_CONFIGURATION: case GATT_SERVER_CHARACTERISTICS_CONFIGURATION: case GATT_CHARACTERISTIC_PRESENTATION_FORMAT: case GATT_CHARACTERISTIC_AGGREGATE_FORMAT: return true;case GATT_CHARACTERISTIC_AGGREGATE_FORMAT: default: return false;default }switch (uuid16) { ... } }{ ... } /** * asserts that the requested amount of bytes can be stored in the att_db * @return TRUE if space is available *//* ... */ static int att_db_util_assert_space(uint16_t size){ uint16_t required_size = att_db_size + size + 2u; if (required_size <= att_db_max_size) return 1; #ifdef HAVE_MALLOC uint16_t new_size = att_db_max_size; while (new_size < required_size){ new_size += (uint16_t)ATT_DB_BUFFER_INCREMENT; }while (new_size < required_size) { ... } uint8_t * new_db = (uint8_t*) realloc(att_db, new_size); if (!new_db) { log_error("att_db: realloc failed"); return 0; }if (!new_db) { ... } att_db = new_db; att_db_max_size = new_size; att_set_db(att_db); // Update att_db with the new db return 1;/* ... */ #else log_error("att_db: out of memory"); return 0;/* ... */ #endif }{ ... } // attribute size in bytes (16), flags(16), handle (16), uuid (16/128), value(...) // db endds with 0x00 0x00 static void att_db_util_add_attribute_uuid16(uint16_t uuid16, uint16_t flags, uint8_t * data, uint16_t data_len){ int size = 2u + 2u + 2u + 2u + data_len; if (!att_db_util_assert_space(size)) return; little_endian_store_16(att_db, att_db_size, size); att_db_size += 2u; little_endian_store_16(att_db, att_db_size, flags); att_db_size += 2u; little_endian_store_16(att_db, att_db_size, att_db_next_handle); att_db_size += 2u; att_db_next_handle++; little_endian_store_16(att_db, att_db_size, uuid16); att_db_size += 2u; (void)memcpy(&att_db[att_db_size], data, data_len); att_db_size += data_len; att_db_util_set_end_tag(); if (att_db_util_hash_include_with_value(uuid16)){ att_db_hash_len += 4u + data_len; }if (att_db_util_hash_include_with_value(uuid16)) { ... } else if (att_db_util_hash_include_without_value(uuid16)){ att_db_hash_len += 4u; }else if (att_db_util_hash_include_without_value(uuid16)) { ... } }{ ... } static void att_db_util_add_attribute_uuid128(const uint8_t * uuid128, uint16_t flags, uint8_t * data, uint16_t data_len){ int size = 2u + 2u + 2u + 16u + data_len; if (!att_db_util_assert_space(size)) return; uint16_t flags_to_store = flags | (uint16_t)ATT_PROPERTY_UUID128; little_endian_store_16(att_db, att_db_size, size); att_db_size += 2u; little_endian_store_16(att_db, att_db_size, flags_to_store); att_db_size += 2u; little_endian_store_16(att_db, att_db_size, att_db_next_handle); att_db_size += 2u; att_db_next_handle++; reverse_128(uuid128, &att_db[att_db_size]); att_db_size += 16u; (void)memcpy(&att_db[att_db_size], data, data_len); att_db_size += data_len; att_db_util_set_end_tag(); }{ ... } uint16_t att_db_util_add_service_uuid16(uint16_t uuid16){ uint8_t buffer[2]; little_endian_store_16(buffer, 0, uuid16); uint16_t service_handle = att_db_next_handle; att_db_util_add_attribute_uuid16(GATT_PRIMARY_SERVICE_UUID, ATT_PROPERTY_READ, buffer, 2); return service_handle; }{ ... } uint16_t att_db_util_add_service_uuid128(const uint8_t * uuid128){ uint8_t buffer[16]; reverse_128(uuid128, buffer); uint16_t service_handle = att_db_next_handle; att_db_util_add_attribute_uuid16(GATT_PRIMARY_SERVICE_UUID, ATT_PROPERTY_READ, buffer, 16); return service_handle; }{ ... } uint16_t att_db_util_add_secondary_service_uuid16(uint16_t uuid16){ uint8_t buffer[2]; little_endian_store_16(buffer, 0, uuid16); uint16_t service_handle = att_db_next_handle; att_db_util_add_attribute_uuid16(GATT_SECONDARY_SERVICE_UUID, ATT_PROPERTY_READ, buffer, 2); return service_handle; }{ ... } uint16_t att_db_util_add_secondary_service_uuid128(const uint8_t * uuid128){ uint8_t buffer[16]; reverse_128(uuid128, buffer); uint16_t service_handle = att_db_next_handle; att_db_util_add_attribute_uuid16(GATT_SECONDARY_SERVICE_UUID, ATT_PROPERTY_READ, buffer, 16); return service_handle; }{ ... } uint16_t att_db_util_add_included_service_uuid16(uint16_t start_group_handle, uint16_t end_group_handle, uint16_t uuid16){ uint8_t buffer[6]; little_endian_store_16(buffer, 0, start_group_handle); little_endian_store_16(buffer, 2, end_group_handle); little_endian_store_16(buffer, 4, uuid16); uint16_t service_handle = att_db_next_handle; att_db_util_add_attribute_uuid16(GATT_INCLUDE_SERVICE_UUID, ATT_PROPERTY_READ, buffer, sizeof(buffer)); return service_handle; }{ ... } static void att_db_util_add_client_characteristic_configuration(uint16_t flags){ uint8_t buffer[2]; // drop permission for read (0xc00), keep write permissions (0x0091) uint16_t flags_to_store = (flags & 0x1f391u) | (uint16_t)ATT_PROPERTY_READ | (uint16_t)ATT_PROPERTY_WRITE | (uint16_t)ATT_PROPERTY_DYNAMIC; little_endian_store_16(buffer, 0, 0); att_db_util_add_attribute_uuid16(GATT_CLIENT_CHARACTERISTICS_CONFIGURATION, flags_to_store, buffer, 2); }{ ... } static uint16_t att_db_util_encode_permissions(uint16_t properties, uint8_t read_permission, uint8_t write_permission){ // drop Broadcast (0x01), Notify (0x10), Indicate (0x20), Extended Attributes (0x80) - not used for flags uint16_t flags = properties & 0xfff4eu; // if encryption requested, set encryption key size to 16 if ((read_permission > (uint8_t)ATT_SECURITY_NONE) || (write_permission > (uint8_t)ATT_SECURITY_NONE)){ flags |= 0xf000u; }if ((read_permission > (uint8_t)ATT_SECURITY_NONE) || (write_permission > (uint8_t)ATT_SECURITY_NONE)) { ... } // map SC requirement uint8_t final_read_permission; if (read_permission == (uint8_t)ATT_SECURITY_AUTHENTICATED_SC){ final_read_permission = (uint8_t)ATT_SECURITY_AUTHENTICATED; flags |= (uint16_t)ATT_PROPERTY_READ_PERMISSION_SC; }if (read_permission == (uint8_t)ATT_SECURITY_AUTHENTICATED_SC) { ... } else { final_read_permission = read_permission; }else { ... } uint8_t final_write_permission; if (write_permission == (uint8_t)ATT_SECURITY_AUTHENTICATED_SC){ final_write_permission = (uint8_t)ATT_SECURITY_AUTHENTICATED; flags |= (uint16_t)ATT_PROPERTY_WRITE_PERMISSION_SC; }if (write_permission == (uint8_t)ATT_SECURITY_AUTHENTICATED_SC) { ... } else { final_write_permission = write_permission; }else { ... } // encode read/write security levels if ((final_read_permission & 1u) != 0u){ flags |= (uint16_t)ATT_PROPERTY_READ_PERMISSION_BIT_0; }if ((final_read_permission & 1u) != 0u) { ... } if ((final_read_permission & 2u) != 0u){ flags |= (uint16_t)ATT_PROPERTY_READ_PERMISSION_BIT_1; }if ((final_read_permission & 2u) != 0u) { ... } if ((final_write_permission & 1u) != 0u){ flags |= (uint16_t)ATT_PROPERTY_WRITE_PERMISSION_BIT_0; }if ((final_write_permission & 1u) != 0u) { ... } if ((final_write_permission & 2u) != 0u){ flags |= (uint16_t)ATT_PROPERTY_WRITE_PERMISSION_BIT_1; }if ((final_write_permission & 2u) != 0u) { ... } return flags; }{ ... } uint16_t att_db_util_add_characteristic_uuid16(uint16_t uuid16, uint16_t properties, uint8_t read_permission, uint8_t write_permission, uint8_t * data, uint16_t data_len){ uint8_t buffer[5]; buffer[0] = (uint8_t) (properties & 0xff); little_endian_store_16(buffer, 1u, att_db_next_handle + 1u); little_endian_store_16(buffer, 3, uuid16); att_db_util_add_attribute_uuid16(GATT_CHARACTERISTICS_UUID, ATT_PROPERTY_READ, buffer, sizeof(buffer)); uint16_t flags = att_db_util_encode_permissions(properties, read_permission, write_permission); uint16_t value_handle = att_db_next_handle; att_db_util_add_attribute_uuid16(uuid16, flags, data, data_len); if ((properties & (uint8_t)(ATT_PROPERTY_NOTIFY | ATT_PROPERTY_INDICATE)) != 0u){ att_db_util_add_client_characteristic_configuration(flags); }if ((properties & (uint8_t)(ATT_PROPERTY_NOTIFY | ATT_PROPERTY_INDICATE)) != 0u) { ... } return value_handle; }{ ... } uint16_t att_db_util_add_characteristic_uuid128(const uint8_t * uuid128, uint16_t properties, uint8_t read_permission, uint8_t write_permission, uint8_t * data, uint16_t data_len){ uint8_t buffer[19]; buffer[0] = (uint8_t) (properties & 0xff); little_endian_store_16(buffer, 1u, att_db_next_handle + 1u); reverse_128(uuid128, &buffer[3]); att_db_util_add_attribute_uuid16(GATT_CHARACTERISTICS_UUID, ATT_PROPERTY_READ, buffer, sizeof(buffer)); uint16_t flags = att_db_util_encode_permissions(properties, read_permission, write_permission); uint16_t value_handle = att_db_next_handle; att_db_util_add_attribute_uuid128(uuid128, flags, data, data_len); if ((properties & (uint8_t)(ATT_PROPERTY_NOTIFY | ATT_PROPERTY_INDICATE)) != 0u){ att_db_util_add_client_characteristic_configuration(flags); }if ((properties & (uint8_t)(ATT_PROPERTY_NOTIFY | ATT_PROPERTY_INDICATE)) != 0u) { ... } return value_handle; }{ ... } uint16_t att_db_util_add_descriptor_uuid16(uint16_t uuid16, uint16_t properties, uint8_t read_permission, uint8_t write_permission, uint8_t * data, uint16_t data_len){ uint16_t descriptor_handler = att_db_next_handle; uint16_t flags = att_db_util_encode_permissions(properties, read_permission, write_permission); att_db_util_add_attribute_uuid16(uuid16, flags, data, data_len); return descriptor_handler; }{ ... } uint16_t att_db_util_add_descriptor_uuid128(const uint8_t * uuid128, uint16_t properties, uint8_t read_permission, uint8_t write_permission, uint8_t * data, uint16_t data_len){ uint16_t descriptor_handler = att_db_next_handle; uint16_t flags = att_db_util_encode_permissions(properties, read_permission, write_permission); att_db_util_add_attribute_uuid128(uuid128, flags, data, data_len); return descriptor_handler; }{ ... } uint8_t * att_db_util_get_address(void){ return att_db; }{ ... } uint16_t att_db_util_get_size(void){ return att_db_size + 2u; // end tag }{ ... } static uint8_t * att_db_util_hash_att_ptr; static uint16_t att_db_util_hash_offset; static uint16_t att_db_util_hash_bytes_available; static void att_db_util_hash_fetch_next_attribute(void){ while (true){ uint16_t size = little_endian_read_16(att_db_util_hash_att_ptr, 0); btstack_assert(size != 0); UNUSED(size); uint16_t flags = little_endian_read_16(att_db_util_hash_att_ptr, 2); if ((flags & (uint16_t)ATT_PROPERTY_UUID128) == 0u) { uint16_t uuid16 = little_endian_read_16(att_db_util_hash_att_ptr, 6); if (att_db_util_hash_include_with_value(uuid16)){ att_db_util_hash_offset = 4; att_db_util_hash_bytes_available = size - 4u; return; }if (att_db_util_hash_include_with_value(uuid16)) { ... } else if (att_db_util_hash_include_without_value(uuid16)){ att_db_util_hash_offset = 4; att_db_util_hash_bytes_available = 4; return; }else if (att_db_util_hash_include_without_value(uuid16)) { ... } }if ((flags & (uint16_t)ATT_PROPERTY_UUID128) == 0u) { ... } att_db_util_hash_att_ptr += size; }while (true) { ... } }{ ... } uint16_t att_db_util_hash_len(void){ return att_db_hash_len; }{ ... } void att_db_util_hash_init(void){ // skip version info att_db_util_hash_att_ptr = &att_db[1]; att_db_util_hash_bytes_available = 0u; }{ ... } uint8_t att_db_util_hash_get_next(void){ // find next hashable data blob if (att_db_util_hash_bytes_available == 0u){ att_db_util_hash_fetch_next_attribute(); }if (att_db_util_hash_bytes_available == 0u) { ... } // get next byte uint8_t next = att_db_util_hash_att_ptr[att_db_util_hash_offset++]; att_db_util_hash_bytes_available--; // go to next attribute if blob used up if (att_db_util_hash_bytes_available == 0u){ uint16_t size = little_endian_read_16(att_db_util_hash_att_ptr, 0); att_db_util_hash_att_ptr += size; }if (att_db_util_hash_bytes_available == 0u) { ... } return next; }{ ... } static uint8_t att_db_util_hash_get(uint16_t offset){ UNUSED(offset); return att_db_util_hash_get_next(); }{ ... } void att_db_util_hash_calc(btstack_crypto_aes128_cmac_t * request, uint8_t * db_hash, void (* callback)(void * arg), void * callback_arg){ static const uint8_t zero_key[16] = { 0 }; att_db_util_hash_init(); btstack_crypto_aes128_cmac_generator(request, zero_key, att_db_hash_len, &att_db_util_hash_get, db_hash, callback, callback_arg); }{ ... }
Details
Show:
from
Types: Columns:
This file uses the notable symbols shown below. Click anywhere in the file to view more details.