From 78dd03d80f0acb0de7c722e38ad9bc676f1503ee Mon Sep 17 00:00:00 2001 From: David Lechner Date: Mon, 27 Dec 2021 11:29:33 -0600 Subject: [PATCH] ble-device-info-service/protocol: document PnP ID This explains the Pybricks-specific usage of the PnP ID fields. --- src/ble-device-info-service/protocol.ts | 4 ++++ src/ble-lwp3-service/protocol.ts | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/src/ble-device-info-service/protocol.ts b/src/ble-device-info-service/protocol.ts index b94296ae..b1dfb101 100644 --- a/src/ble-device-info-service/protocol.ts +++ b/src/ble-device-info-service/protocol.ts @@ -31,9 +31,13 @@ export enum PnpIdVendorIdSource { * Decoded data from the PnP ID characteristic. */ export type PnpId = { + /** For Pybricks hubs, this should be PnpIdVendorIdSource.BluetoothSig */ vendorIdSource: PnpIdVendorIdSource; + /** For Pybricks hubs, this should be LegoCompanyId (from ble-lwp3-service/protocol). */ vendorId: number; + /** For Pybricks hubs, this should be one of HubType (from ble-lwp3-service/protocol). */ productId: number; + /** For Pybricks hubs, this should be hub variant if applicable (from ble-lwp3-service/protocol). */ productVersion: number; }; diff --git a/src/ble-lwp3-service/protocol.ts b/src/ble-lwp3-service/protocol.ts index 4ddb149d..b9223cef 100644 --- a/src/ble-lwp3-service/protocol.ts +++ b/src/ble-lwp3-service/protocol.ts @@ -5,6 +5,13 @@ // // https://lego.github.io/lego-ble-wireless-protocol-docs/ +/** + * LEGO's Bluetooth SIG company identifier. + * + * https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers/ + */ +export const LegoCompanyId = 0x0397; + /** * LEGO Powered Up Hub type IDs *