mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 01:23:52 +00:00
ble-lwp3-service/protocol: add enums for hub types
This is the full list of hub types.
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// Copyright (c) 2021 The Pybricks Authors
|
||||
//
|
||||
// Constants and helper functions for LEGO Wireless protocol v3.
|
||||
//
|
||||
// https://lego.github.io/lego-ble-wireless-protocol-docs/
|
||||
|
||||
/**
|
||||
* LEGO Powered Up Hub type IDs
|
||||
*
|
||||
* https://github.com/pybricks/technical-info/blob/master/assigned-numbers.md#hub-type-ids
|
||||
*/
|
||||
export enum HubType {
|
||||
/** WeDo 2.0 uses different protocol so shouldn't be seen in LWP3. */
|
||||
WeDo2Hub = 0x00,
|
||||
/** Duplo train hub. */
|
||||
DuploTrainHub = 0x20,
|
||||
/** BOOST Move hub. */
|
||||
MoveHub = 0x40,
|
||||
/** 2-port System hub. */
|
||||
CityHub = 0x41,
|
||||
/** Remote Control. */
|
||||
Handset = 0x42,
|
||||
/** Mario minifig. */
|
||||
Mario = 0x43,
|
||||
/** Luigi minifig. */
|
||||
Luigi = 0x44,
|
||||
/** 4-port Technic hub. */
|
||||
TechnicHub = 0x80,
|
||||
/** 6-port SPIKE/MINDSTORMS hub. */
|
||||
TechnicLargeHub = 0x81,
|
||||
/** 2-port SPIKE hub. */
|
||||
TechnicSmallHub = 0x83,
|
||||
}
|
||||
|
||||
/**
|
||||
* Variants of the 6-port Technic Large hub.
|
||||
*/
|
||||
export enum TechnicLargeHubVariant {
|
||||
/** Yellow SPIKE Prime variant. */
|
||||
SpikePrimeHub = 0,
|
||||
/** Teal MINDSTORMS Robot Inventor variant. */
|
||||
MindstormsInventorHub = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* Variants of the 2-port Technic Small hub.
|
||||
*/
|
||||
export enum TechnicSmallHubVariant {
|
||||
/** Yellow SPIKE Essential variant. */
|
||||
SpikeEssentialHub = 0,
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// Copyright (c) 2020 The Pybricks Authors
|
||||
// Copyright (c) 2020-2021 The Pybricks Authors
|
||||
|
||||
// Ref: https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#lego-hub-boot-loader-service
|
||||
|
||||
@@ -22,6 +22,8 @@ export const MaxMessageSize = 20;
|
||||
|
||||
/**
|
||||
* LEGO Powered Up Hub IDs
|
||||
*
|
||||
* This is the subset of hubs that actually support this bootloader protocol.
|
||||
*/
|
||||
export enum HubType {
|
||||
MoveHub = 0x40,
|
||||
|
||||
Reference in New Issue
Block a user