compile_gatt.py (dbb3997aeefadd2a87b3f2d45a5835e455e3b2ab) compile_gatt.py (9be4aecf3258ab528c593bf4354a7fcf089d883c)
1#!/usr/bin/env python
2#
3# BLE GATT configuration generator for use with BTstack
4# Copyright 2018 BlueKitchen GmbH
5#
6# Format of input file:
7# PRIMARY_SERVICE, SERVICE_UUID
8# CHARACTERISTIC, ATTRIBUTE_TYPE_UUID, [READ | WRITE | DYNAMIC], VALUE

--- 461 unchanged lines hidden (view full) ---

470 defines_for_characteristics.append('#define ATT_CHARACTERISTIC_%s_VALUE_HANDLE 0x%04x' % (current_characteristic_uuid_string, handle))
471 handle = handle + 1
472
473 if add_client_characteristic_configuration(properties):
474 # use write permissions and encryption key size from attribute value and set READ_ANYBODY | READ | WRITE | DYNAMIC
475 flags = write_permissions_and_key_size_flags_from_properties(properties)
476 flags |= property_flags['READ']
477 flags |= property_flags['WRITE']
1#!/usr/bin/env python
2#
3# BLE GATT configuration generator for use with BTstack
4# Copyright 2018 BlueKitchen GmbH
5#
6# Format of input file:
7# PRIMARY_SERVICE, SERVICE_UUID
8# CHARACTERISTIC, ATTRIBUTE_TYPE_UUID, [READ | WRITE | DYNAMIC], VALUE

--- 461 unchanged lines hidden (view full) ---

470 defines_for_characteristics.append('#define ATT_CHARACTERISTIC_%s_VALUE_HANDLE 0x%04x' % (current_characteristic_uuid_string, handle))
471 handle = handle + 1
472
473 if add_client_characteristic_configuration(properties):
474 # use write permissions and encryption key size from attribute value and set READ_ANYBODY | READ | WRITE | DYNAMIC
475 flags = write_permissions_and_key_size_flags_from_properties(properties)
476 flags |= property_flags['READ']
477 flags |= property_flags['WRITE']
478 flags |= property_flags['WRITE_WITHOUT_RESPONSE']
478 flags |= property_flags['DYNAMIC']
479 size = 2 + 2 + 2 + 2 + 2
480
481 write_indent(fout)
482 fout.write('// 0x%04x CLIENT_CHARACTERISTIC_CONFIGURATION\n' % (handle))
483
484 dump_flags(fout, flags)
485

--- 424 unchanged lines hidden ---
479 flags |= property_flags['DYNAMIC']
480 size = 2 + 2 + 2 + 2 + 2
481
482 write_indent(fout)
483 fout.write('// 0x%04x CLIENT_CHARACTERISTIC_CONFIGURATION\n' % (handle))
484
485 dump_flags(fout, flags)
486

--- 424 unchanged lines hidden ---