GATT Converter: replace - with _, prettify generated .h

This commit is contained in:
Matthias Ringwald 2016-10-31 15:52:58 +01:00
parent 0f308e7392
commit 66fd343250
2 changed files with 236 additions and 238 deletions

View File

@ -1,7 +1,6 @@
/** /**
* bluetooth_gatt.h generated from Bluetooth SIG website for BTstack * bluetooth_gatt.h generated from Bluetooth SIG website for BTstack
* 2016-10-27 16:24:46.134891
*/ */
#ifndef __BLUETOOTH_GATT_H #ifndef __BLUETOOTH_GATT_H
@ -207,7 +206,7 @@
#define ORG_BLUETOOTH_CHARACTERISTIC_INTERMEDIATE_TEMPERATURE 0x2A1E // Intermediate Temperature #define ORG_BLUETOOTH_CHARACTERISTIC_INTERMEDIATE_TEMPERATURE 0x2A1E // Intermediate Temperature
#define ORG_BLUETOOTH_CHARACTERISTIC_LANGUAGE 0x2AA2 // Language #define ORG_BLUETOOTH_CHARACTERISTIC_LANGUAGE 0x2AA2 // Language
#define ORG_BLUETOOTH_CHARACTERISTIC_IRRADIANCE 0x2A77 // Irradiance #define ORG_BLUETOOTH_CHARACTERISTIC_IRRADIANCE 0x2A77 // Irradiance
#define ORG_BLUETOOTH_CHARACTERISTIC_IEEE_11073-20601_REGULATORY_CERTIFICATION_DATA_LIST 0x2A2A // IEEE 11073-20601 Regulatory Certification Data List #define ORG_BLUETOOTH_CHARACTERISTIC_IEEE_11073_20601_REGULATORY_CERTIFICATION_DATA_LIST 0x2A2A // IEEE 11073-20601 Regulatory Certification Data List
#define ORG_BLUETOOTH_CHARACTERISTIC_HTTP_HEADERS 0x2AB7 // HTTP Headers #define ORG_BLUETOOTH_CHARACTERISTIC_HTTP_HEADERS 0x2AB7 // HTTP Headers
#define ORG_BLUETOOTH_CHARACTERISTIC_HTTP_ENTITY_BODY 0x2AB9 // HTTP Entity Body #define ORG_BLUETOOTH_CHARACTERISTIC_HTTP_ENTITY_BODY 0x2AB9 // HTTP Entity Body
#define ORG_BLUETOOTH_CHARACTERISTIC_HTTP_STATUS_CODE 0x2AB8 // HTTP Status Code #define ORG_BLUETOOTH_CHARACTERISTIC_HTTP_STATUS_CODE 0x2AB8 // HTTP Status Code

View File

@ -18,7 +18,6 @@ Copyright 2016, BlueKitchen GmbH
header = ''' header = '''
/** /**
* bluetooth_gatt.h generated from Bluetooth SIG website for BTstack * bluetooth_gatt.h generated from Bluetooth SIG website for BTstack
* {datetime}
*/ */
#ifndef __BLUETOOTH_GATT_H #ifndef __BLUETOOTH_GATT_H
@ -48,8 +47,8 @@ def scrape_page(fout, url):
id = children[1].text_content() id = children[1].text_content()
uuid = children[2].text_content() uuid = children[2].text_content()
if (len(id)): if (len(id)):
tag = id.upper().replace('.', '_') tag = id.upper().replace('.', '_').replace('-','_')
fout.write("#define %s %s // %s\n" % (tag, uuid, summary)) fout.write("#define %-80s %s // %s\n" % (tag, uuid, summary))
btstack_root = os.path.abspath(os.path.dirname(sys.argv[0]) + '/..') btstack_root = os.path.abspath(os.path.dirname(sys.argv[0]) + '/..')
gen_path = btstack_root + '/src/bluetooth_gatt.h' gen_path = btstack_root + '/src/bluetooth_gatt.h'