From 6f08f1597c660340a253920dbb3d9b573dac60f8 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 11 Feb 2021 10:46:58 +0100 Subject: [PATCH] tool/compile_gatt.py: support dynamic descriptors for environmental sensing --- tool/compile_gatt.py | 17 ++++++----------- tool/convert_gatt_service.py | 12 ++++++++---- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/tool/compile_gatt.py b/tool/compile_gatt.py index 7d2d16072..70d3f2cf1 100755 --- a/tool/compile_gatt.py +++ b/tool/compile_gatt.py @@ -945,9 +945,9 @@ def parseLines(fname_in, fin, fout): parseCharacteristicAggregateFormat(fout, parts) continue - # 2906 + # 2906 if parts[0] == 'VALID_RANGE': - print("WARNING: %s not implemented yet\n" % (parts[0])) + parseGenericDynamicReadOnlyDescriptor(fout, parts, 0x2906, 'VALID_RANGE') continue # 2907 @@ -967,27 +967,22 @@ def parseLines(fname_in, fin, fout): # 290A if parts[0] == 'VALUE_TRIGGER_SETTING': - print("WARNING: %s not implemented yet\n" % (parts[0])) + parseGenericDynamicDescriptor(fout, parts, 0x290A, 'VALUE_TRIGGER_SETTING') continue # 290B if parts[0] == 'ENVIRONMENTAL_SENSING_CONFIGURATION': - print("WARNING: %s not implemented yet\n" % (parts[0])) + parseGenericDynamicDescriptor(fout, parts, 0x290B, 'ENVIRONMENTAL_SENSING_CONFIGURATION') continue # 290C if parts[0] == 'ENVIRONMENTAL_SENSING_MEASUREMENT': - print("WARNING: %s not implemented yet\n" % (parts[0])) + parseGenericDynamicReadOnlyDescriptor(fout, parts, 0x290C, 'ENVIRONMENTAL_SENSING_MEASUREMENT') continue # 290D if parts[0] == 'ENVIRONMENTAL_SENSING_TRIGGER_SETTING': - print("WARNING: %s not implemented yet\n" % (parts[0])) - continue - - # 2906 - if parts[0] == 'VALID_RANGE': - print("WARNING: %s not implemented yet\n" % (parts[0])) + parseGenericDynamicDescriptor(fout, parts, 0x290D, 'ENVIRONMENTAL_SENSING_TRIGGER_SETTING') continue print("WARNING: unknown token: %s\n" % (parts[0])) diff --git a/tool/convert_gatt_service.py b/tool/convert_gatt_service.py index 66334078c..89dad8996 100755 --- a/tool/convert_gatt_service.py +++ b/tool/convert_gatt_service.py @@ -216,7 +216,8 @@ def convert_service(fout, specification_type): continue if (type == 'org.bluetooth.descriptor.valid_range'): - print('-- Descriptor %-40s - WARNING: VALID_RANGE not supported yet' % name) + print('-- Descriptor %-40s' % name) + fout.write('VALID_RANGE, %s,\n' % properties) continue if (type == 'org.bluetooth.descriptor.external_report_reference'): @@ -237,15 +238,18 @@ def convert_service(fout, specification_type): continue if (type == 'org.bluetooth.descriptor.es_configuration'): - print('-- Descriptor %-40s - WARNING: ENVIRONMENTAL_SENSING_CONFIGURATION not supported yet' % name) + print('-- Descriptor %-40s' % name) + fout.write('ENVIRONMENTAL_SENSING_CONFIGURATION, %s,\n' % properties) continue if (type == 'org.bluetooth.descriptor.es_measurement'): - print('-- Descriptor %-40s - WARNING: ENVIRONMENTAL_SENSING_MEASUREMENT not supported yet' % name) + print('-- Descriptor %-40s' % name) + fout.write('ENVIRONMENTAL_SENSING_MEASUREMENT, %s,\n' % properties) continue if (type == 'org.bluetooth.descriptor.es_trigger_setting'): - print('-- Descriptor %-40s - WARNING: ENVIRONMENTAL_SENSING_TRIGGER_SETTING not supported yet' % name) + print('-- Descriptor %-40s' % name) + fout.write('ENVIRONMENTAL_SENSING_TRIGGER_SETTING, %s,\n' % properties) continue if (type == 'org.bluetooth.descriptor.gatt.characteristic_extended_properties'):