Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated missing Bluetooth SIG characteristics and service UUIDs #1452

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

jpstotz
Copy link
Contributor

@jpstotz jpstotz commented Nov 13, 2023

As the Bluetooth SIG now provides UUIDs in YAML format and I noticed some were missing I updated the bleak uuid dictionary:
https://bitbucket.org/bluetooth-SIG/public/src/main/assigned_numbers/uuids/characteristic_uuids.yaml
https://bitbucket.org/bluetooth-SIG/public/src/main/assigned_numbers/uuids/service_uuids.yaml

Just for the records, I used this script to identify missing entries:

from bleak.uuids import uuid16_dict
import yaml  ## pyyaml

file_name = 'service_uuids.yaml'  # or 'characteristic_uuids.yaml'

with open(file_name, 'r', encoding='utf-8') as file:
    yaml_data = yaml.safe_load(file)

for c in yaml_data['uuids']:
    val = int(c['uuid'])
    name = c['name']
    if val not in uuid16_dict:
        print('    0x{:02X}: "{}",'.format(val, name))

@dlech
Copy link
Collaborator

dlech commented Nov 15, 2023

Thanks. This looks fine.

In the future, it could be nice to make a separate library that is just automatically generated from those yaml files that could be used by any Bluetooth library, not just Bleak.

@dlech dlech merged commit 9b25608 into hbldh:develop Nov 15, 2023
13 checks passed
@koenvervloesem
Copy link
Contributor

I made this project exactly for this purpose: https://github.com/koenvervloesem/bluetooth-numbers

Generated from Nordic Semiconductor's Bluetooth numbers database because the Bluetooth SIG's YAML files didn't exist when I started the project, but I'm planning to integrate those YAML files in a later version. Feel free to open a discussion or issue in my project for suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants