mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-19 06:40:54 +00:00
gatt: add tool for processing UUID list, update defines
This commit is contained in:
parent
b5d6d34ae1
commit
987989bd15
@ -16,7 +16,8 @@
|
||||
#define ORG_BLUETOOTH_ATTRIBUTE_GATT_SECONDARY_SERVICE_DECLARATION 0x2801 // Secondary Service
|
||||
|
||||
/**
|
||||
* Assigned numbers from www.bluetooth.com/specifications/gatt/services
|
||||
* Assigned numbers from:
|
||||
* https://www.bluetooth.com/specifications/gatt/services
|
||||
*/
|
||||
#define ORG_BLUETOOTH_SERVICE_ALERT_NOTIFICATION 0x1811 // Alert Notification Service
|
||||
#define ORG_BLUETOOTH_SERVICE_AUTOMATION_IO 0x1815 // Automation IO
|
||||
@ -59,6 +60,31 @@
|
||||
#define ORG_BLUETOOTH_SERVICE_USER_DATA 0x181C // User Data
|
||||
#define ORG_BLUETOOTH_SERVICE_WEIGHT_SCALE 0x181D // Weight Scale
|
||||
|
||||
/**
|
||||
* Assigned numbers, manually added from:
|
||||
* https://btprodspecificationrefs.blob.core.windows.net/assigned-values/16-bit%20UUID%20Numbers%20Document.pdf
|
||||
* and processed with tool: bluetooth_gatt_process_uuid_list.py
|
||||
*/
|
||||
#define ORG_BLUETOOTH_SERVICE_AUDIO_INPUT_CONTROL 0x1843 // Audio Input Control
|
||||
#define ORG_BLUETOOTH_SERVICE_AUDIO_STREAM_CONTROL_SERVICE 0x184E // Audio Stream Control Service
|
||||
#define ORG_BLUETOOTH_SERVICE_BASIC_AUDIO_ANNOUNCEMENT_SERVICE 0x1851 // Basic Audio Announcement Service
|
||||
#define ORG_BLUETOOTH_SERVICE_BINARY_SENSOR 0x183B // Binary Sensor
|
||||
#define ORG_BLUETOOTH_SERVICE_BROADCAST_AUDIO_ANNOUNCEMENT_SERVICE 0x1852 // Broadcast Audio Announcement Service
|
||||
#define ORG_BLUETOOTH_SERVICE_BROADCAST_AUDIO_SCAN_SERVICE 0x184F // Broadcast Audio Scan Service
|
||||
#define ORG_BLUETOOTH_SERVICE_CONSTANT_TONE_EXTENSION 0x184A // Constant Tone Extension
|
||||
#define ORG_BLUETOOTH_SERVICE_COORDINATED_SET_IDENTIFICATION_SERVICE 0x1846 // Coordinated Set Identification Service
|
||||
#define ORG_BLUETOOTH_SERVICE_DEVICE_TIME 0x1847 // Device Time
|
||||
#define ORG_BLUETOOTH_SERVICE_EMERGENCY_CONFIGURATION 0x183C // Emergency Configuration
|
||||
#define ORG_BLUETOOTH_SERVICE_GENERIC_MEDIA_CONTROL_SERVICE 0x1849 // Generic Media Control Service
|
||||
#define ORG_BLUETOOTH_SERVICE_GENERIC_TELEPHONE_BEARER_SERVICE 0x184C // Generic Telephone Bearer Service
|
||||
#define ORG_BLUETOOTH_SERVICE_MEDIA_CONTROL_SERVICE 0x1848 // Media Control Service
|
||||
#define ORG_BLUETOOTH_SERVICE_MICROPHONE_CONTROL 0x184D // Microphone Control
|
||||
#define ORG_BLUETOOTH_SERVICE_PHYSICAL_ACTIVITY_MONITOR 0x183E // Physical Activity Monitor
|
||||
#define ORG_BLUETOOTH_SERVICE_PUBLISHED_AUDIO_CAPABILITIES_SERVICE 0x1850 // Published Audio Capabilities Service
|
||||
#define ORG_BLUETOOTH_SERVICE_TELEPHONE_BEARER_SERVICE 0x184B // Telephone Bearer Service
|
||||
#define ORG_BLUETOOTH_SERVICE_VOLUME_CONTROL 0x1844 // Volume Control
|
||||
#define ORG_BLUETOOTH_SERVICE_VOLUME_OFFSET_CONTROL 0x1845 // Volume Offset Control
|
||||
|
||||
/**
|
||||
* Assigned numbers from www.bluetooth.com/specifications/gatt/characteristics
|
||||
*/
|
||||
@ -289,6 +315,129 @@
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_WEIGHT_SCALE_FEATURE 0x2A9E // Weight Scale Feature
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_WIND_CHILL 0x2A79 // Wind Chill
|
||||
|
||||
/**
|
||||
* Assigned numbers, manually added from:
|
||||
* https://btprodspecificationrefs.blob.core.windows.net/assigned-values/16-bit%20UUID%20Numbers%20Document.pdf
|
||||
* and processed with tool: bluetooth_gatt_process_uuid_list.py
|
||||
*/
|
||||
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_CLIENT_SUPPORTED_FEATURES 0x2B29 // Client Supported Features
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_DATABASE_HASH 0x2B2A // Database Hash
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_BSS_CONTROL_POINT 0x2B2B // BSS Control Point
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_BSS_RESPONSE 0x2B2C // BSS Response
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_EMERGENCY_ID 0x2B2D // Emergency ID
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_EMERGENCY_TEXT 0x2B2E // Emergency Text
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_ENHANCED_BLOOD_PRESSURE_MEASUREMENT 0x2B34 // Enhanced Blood Pressure Measurement
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_ENHANCED_INTERMEDIATE_CUFF_PRESSURE 0x2B35 // Enhanced Intermediate Cuff Pressure
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_BLOOD_PRESSURE_RECORD 0x2B36 // Blood Pressure Record
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_BR_EDR_HANDOVER_DATA 0x2B38 // BR-EDR Handover Data
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_BLUETOOTH_SIG_DATA 0x2B39 // Bluetooth SIG Data
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_SERVER_SUPPORTED_FEATURES 0x2B3A // Server Supported Features
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_PHYSICAL_ACTIVITY_MONITOR_FEATURES 0x2B3B // Physical Activity Monitor Features
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_GENERAL_ACTIVITY_INSTANTANEOUS_DATA 0x2B3C // General Activity Instantaneous Data
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_GENERAL_ACTIVITY_SUMMARY_DATA 0x2B3D // General Activity Summary Data
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_CARDIORESPIRATORY_ACTIVITY_INSTANTANEOUS_DATA 0x2B3E // CardioRespiratory Activity Instantaneous Data
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_CARDIORESPIRATORY_ACTIVITY_SUMMARY_DATA 0x2B3F // CardioRespiratory Activity Summary Data
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_STEP_COUNTER_ACTIVITY_SUMMARY_DATA 0x2B40 // Step Counter Activity Summary Data
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_SLEEP_ACTIVITY_INSTANTANEOUS_DATA 0x2B41 // Sleep Activity Instantaneous Data
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_SLEEP_ACTIVITY_SUMMARY_DATA 0x2B42 // Sleep Activity Summary Data
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_PHYSICAL_ACTIVITY_MONITOR_CONTROL_POINT 0x2B43 // Physical Activity Monitor Control Point
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_CURRENT_SESSION 0x2B44 // Current Session
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_SESSION 0x2B45 // Session
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_PREFERRED_UNITS 0x2B46 // Preferred Units
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_HIGH_RESOLUTION_HEIGHT 0x2B47 // High Resolution Height
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_MIDDLE_NAME 0x2B48 // Middle Name
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_STRIDE_LENGTH 0x2B49 // Stride Length
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_HANDEDNESS 0x2B4A // Handedness
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_DEVICE_WEARING_POSITION 0x2B4B // Device Wearing Position
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_FOUR_ZONE_HEART_RATE_LIMITS 0x2B4C // Four Zone Heart Rate Limits
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_HIGH_INTENSITY_EXERCISE_THRESHOLD 0x2B4D // High Intensity Exercise Threshold
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_ACTIVITY_GOAL 0x2B4E // Activity Goal
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_SEDENTARY_INTERVAL_NOTIFICATION 0x2B4F // Sedentary Interval Notification
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_CALORIC_INTAKE 0x2B50 // Caloric Intake
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_AUDIO_INPUT_STATE 0x2B77 // Audio Input State
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_GAIN_SETTINGS_ATTRIBUTE 0x2B78 // Gain Settings Attribute
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_AUDIO_INPUT_TYPE 0x2B79 // Audio Input Type
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_AUDIO_INPUT_STATUS 0x2B7A // Audio Input Status
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_AUDIO_INPUT_CONTROL_POINT 0x2B7B // Audio Input Control Point
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_AUDIO_INPUT_DESCRIPTION 0x2B7C // Audio Input Description
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_VOLUME_STATE 0x2B7D // Volume State
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_VOLUME_CONTROL_POINT 0x2B7E // Volume Control Point
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_VOLUME_FLAGS 0x2B7F // Volume Flags
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_OFFSET_STATE 0x2B80 // Offset State
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_AUDIO_LOCATION 0x2B81 // Audio Location
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_VOLUME_OFFSET_CONTROL_POINT 0x2B82 // Volume Offset Control Point
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_AUDIO_OUTPUT_DESCRIPTION 0x2B83 // Audio Output Description
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_SET_IDENTITY_RESOLVING_KEY_CHARACTERISTIC 0x2B84 // Set Identity Resolving Key Characteristic
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_SIZE_CHARACTERISTIC 0x2B85 // Size Characteristic
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_LOCK_CHARACTERISTIC 0x2B86 // Lock Characteristic
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_RANK_CHARACTERISTIC 0x2B87 // Rank Characteristic
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_DEVICE_TIME_FEATURE_ 0x2B8E // Device Time Feature
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_DEVICE_TIME_PARAMETERS_ 0x2B8F // Device Time Parameters
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_DEVICE_TIME 0x2B90 // Device Time
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_DEVICE_TIME_CONTROL_POINT_ 0x2B91 // Device Time Control Point
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_TIME_CHANGE_LOG_DATA_ 0x2B92 // Time Change Log Data
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_MEDIA_PLAYER_NAME 0x2B93 // Media Player Name
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_MEDIA_PLAYER_ICON_OBJECT_ID_ 0x2B94 // Media Player Icon Object ID
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_MEDIA_PLAYER_ICON_URL_ 0x2B95 // Media Player Icon URL
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_TRACK_CHANGED 0x2B96 // Track Changed
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_TRACK_TITLE 0x2B97 // Track Title
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_TRACK_DURATION 0x2B98 // Track Duration
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_TRACK_POSITION 0x2B99 // Track Position
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_PLAYBACK_SPEED 0x2B9A // Playback Speed
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_SEEKING_SPEED 0x2B9B // Seeking Speed
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_CURRENT_TRACK_SEGMENTS_OBJECT_ID 0x2B9C // Current Track Segments Object ID
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_CURRENT_TRACK_OBJECT_ID 0x2B9D // Current Track Object ID
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_NEXT_TRACK_OBJECT_ID 0x2B9E // Next Track Object ID
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_PARENT_GROUP_OBJECT_ID 0x2B9F // Parent Group Object ID
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_CURRENT_GROUP_OBJECT_ID 0x2BA0 // Current Group Object ID
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_PLAYING_ORDER 0x2BA1 // Playing Order
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_PLAYING_ORDERS_SUPPORTED 0x2BA2 // Playing Orders Supported
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_MEDIA_STATE 0x2BA3 // Media State
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_MEDIA_CONTROL_POINT 0x2BA4 // Media Control Point
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_MEDIA_CONTROL_POINT_OPCODES_SUPPORTED 0x2BA5 // Media Control Point Opcodes Supported
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_SEARCH_RESULTS_OBJECT_ID 0x2BA6 // Search Results Object ID
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_SEARCH_CONTROL_POINT 0x2BA7 // Search Control Point
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_MEDIA_PLAYER_ICON_OBJECT_TYPE 0x2BA9 // Media Player Icon Object Type
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_TRACK_SEGMENTS_OBJECT_TYPE 0x2BAA // Track Segments Object Type
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_TRACK_OBJECT_TYPE 0x2BAB // Track Object Type
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_GROUP_OBJECT_TYPE 0x2BAC // Group Object Type
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_CONSTANT_TONE_EXTENSION_ENABLE 0x2BAD // Constant Tone Extension Enable
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_ADVERTISING_CONSTANT_TONE_EXTENSION_MINIMUM_LENGTH 0x2BAE // Advertising Constant Tone Extension Minimum Length
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_ADVERTISING_CONSTANT_TONE_EXTENSION_MINIMUM_TRANSMIT_COUNT 0x2BAF // Advertising Constant Tone Extension Minimum Transmit Count
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_ADVERTISING_CONSTANT_TONE_EXTENSION_TRANSMIT_DURATION 0x2BB0 // Advertising Constant Tone Extension Transmit Duration
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_ADVERTISING_CONSTANT_TONE_EXTENSION_INTERVAL 0x2BB1 // Advertising Constant Tone Extension Interval
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_ADVERTISING_CONSTANT_TONE_EXTENSION_PHY 0x2BB2 // Advertising Constant Tone Extension PHY
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_BEARER_PROVIDER_NAME 0x2BB3 // Bearer Provider Name
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_BEARER_UCI 0x2BB4 // Bearer UCI
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_BEARER_TECHNOLOGY 0x2BB5 // Bearer Technology
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_BEARER_URI_SCHEMES_SUPPORTED_LIST 0x2BB6 // Bearer URI Schemes Supported List
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_BEARER_SIGNAL_STRENGTH 0x2BB7 // Bearer Signal Strength
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_BEARER_SIGNAL_STRENGTH_REPORTING_INTERVAL 0x2BB8 // Bearer Signal Strength Reporting Interval
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_BEARER_LIST_CURRENT_CALLS 0x2BB9 // Bearer List Current Calls
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_CONTENT_CONTROL_ID 0x2BBA // Content Control ID
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_STATUS_FLAGS 0x2BBB // Status Flags
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_INCOMING_CALL_TARGET_BEARER_URI 0x2BBC // Incoming Call Target Bearer URI
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_CALL_STATE 0x2BBD // Call State
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_CALL_CONTROL_POINT 0x2BBE // Call Control Point
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_CALL_CONTROL_POINT_OPTIONAL_OPCODES 0x2BBF // Call Control Point Optional Opcodes
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_TERMINATION_REASON 0x2BC0 // Termination Reason
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_INCOMING_CALL 0x2BC1 // Incoming Call
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_CALL_FRIENDLY_NAME 0x2BC2 // Call Friendly Name
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_MUTE 0x2BC3 // Mute
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_SINK_ASE 0x2BC4 // Sink ASE
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_SOURCE_ASE 0x2BC5 // Source ASE
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_ASE_CONTROL_POINT 0x2BC6 // ASE Control Point
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_BROADCAST_AUDIO_SCAN_CONTROL_POINT 0x2BC7 // Broadcast Audio Scan Control Point
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_BROADCAST_RECEIVE_STATE 0x2BC8 // Broadcast Receive State
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_SINK_PAC 0x2BC9 // Sink PAC
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_SINK_AUDIO_LOCATIONS 0x2BCA // Sink Audio Locations
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_SOURCE_PAC 0x2BCB // Source PAC
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_SOURCE_AUDIO_LOCATIONS 0x2BCC // Source Audio Locations
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_AVAILABLE_AUDIO_CONTEXTS 0x2BCD // Available Audio Contexts
|
||||
#define ORG_BLUETOOTH_CHARACTERISTIC_SUPPORTED_AUDIO_CONTEXTS 0x2BCE // Supported Audio Contexts
|
||||
|
||||
|
||||
/**
|
||||
* Assigned numbers from www.bluetooth.com/specifications/gatt/descriptors
|
||||
*/
|
||||
|
63
tool/bluetooth_gatt_process_uuid_list.py
Normal file
63
tool/bluetooth_gatt_process_uuid_list.py
Normal file
@ -0,0 +1,63 @@
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
# Convert format UUID16 // SERVICE_NAME into bluetooth_gatt.h defines
|
||||
# Copyright 2021 BlueKitchen GmbH
|
||||
#
|
||||
import os, sys, getopt
|
||||
|
||||
tag_description = {
|
||||
"-c" : "ORG_BLUETOOTH_CHARACTERISTIC",
|
||||
"-s" : "ORG_BLUETOOTH_SERVICE"
|
||||
}
|
||||
|
||||
def main(argv):
|
||||
cmd = "\nUSAGE: %s [-s|-c] [-f filename]" % sys.argv[0]
|
||||
cmd += "\n -s: for SERVICE_UUID"
|
||||
cmd += "\n -c: for CHARACTERISTICS_UUID"
|
||||
cmd += "\n -f filename: input file with UUID and comment, i.e. 0x2B29 // Client Supported Features\n"
|
||||
|
||||
tag_define = None
|
||||
filename = None
|
||||
|
||||
try:
|
||||
opts, args = getopt.getopt(argv[1:],"scf:")
|
||||
except getopt.GetoptError:
|
||||
print("ERROR: wrong options")
|
||||
print (cmd)
|
||||
sys.exit(2)
|
||||
|
||||
print(opts)
|
||||
|
||||
for opt, arg in opts:
|
||||
if opt == '-s' or opt == '-c':
|
||||
tag_define = tag_description[opt]
|
||||
elif opt == '-f':
|
||||
print("filename")
|
||||
filename = arg
|
||||
else:
|
||||
print("ERROR: wrong options")
|
||||
print (cmd)
|
||||
sys.exit(2)
|
||||
|
||||
if (not tag_define) or (not filename):
|
||||
print("ERROR: wrong options")
|
||||
print (cmd)
|
||||
sys.exit(2)
|
||||
|
||||
with open (filename, 'rt') as fin:
|
||||
for line in fin:
|
||||
data = line.strip('\n').split(" // ")
|
||||
if len(data) != 2:
|
||||
continue
|
||||
else:
|
||||
uuid = data[0]
|
||||
summary = data[1]
|
||||
|
||||
tag = summary.upper().replace('.', '_').replace('-','_').replace(' ', '_')
|
||||
print("#define %s_%-80s %s // %s" % (tag_define, tag, uuid, summary))
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(sys.argv)
|
||||
|
Loading…
x
Reference in New Issue
Block a user