# Global

##

### Type Definitions

#### ActionType

https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#action-types

##### Parameters:

Name | Type | Description
--- | --- | ---
`SWITCH_OFF_HUB` | number | 0x01
`DISCONNECT` | number | 0x02
`VCC_PORT_CONTROL_ON` | number | 0x03
`VCC_PORT_CONTROL_OFF` | number | 0x04
`ACTIVATE_BUSY_INDICATION` | number | 0x05
`RESET_BUSY_INDICATION` | number | 0x06
`SHUTDOWN` | number | 0x2F
`HUB_WILL_SWITCH_OFF` | number | 0x30
`HUB_WILL_DISCONNECT` | number | 0x31
`HUB_WILL_GO_INTO_BOOT_MODE` | number | 0x32

Source:
  - consts.js, line 374

#### AlertOperation

https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#alert-operation

##### Parameters:

Name | Type | Description
--- | --- | ---
`ENABLE_UPDATE` | number | 0x01
`DISABLE_UPDATE` | number | 0x02
`REQUEST_UPDATE` | number | 0x03
`UPDATE` | number | 0x04

Source:
  - consts.js, line 416

#### AlertPayload

https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#alert-payload

##### Parameters:

Name | Type | Description
--- | --- | ---
`STATUS_OK` | number | 0x00
`ALERT` | number | 0xFF

Source:
  - consts.js, line 431

#### AlertType

https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#alert-type

##### Parameters:

Name | Type | Description
--- | --- | ---
`LOW_VOLTAGE` | number | 0x01
`HIGH_CURRENT` | number | 0x02
`LOW_SIGNAL_STRENGTH` | number | 0x03
`OVER_POWER_CONDITION` | number | 0x04

Source:
  - consts.js, line 401

#### BrakingStyle

##### Properties:

Name | Type | Description
--- | --- | ---
`FLOAT` | number | 0
`HOLD` | number | 127
`BRAKE` | number | 128

Source:
  - consts.js, line 164

#### ButtonState

##### Properties:

Name | Type | Description
--- | --- | ---
`PRESSED` | number | 2
`RELEASED` | number | 0
`UP` | number | 1
`DOWN` | number | 255
`STOP` | number | 127

Source:
  - consts.js, line 148

#### Color

##### Properties:

Name | Type | Description
--- | --- | ---
`BLACK` | number | 0
`PINK` | number | 1
`PURPLE` | number | 2
`BLUE` | number | 3
`LIGHT_BLUE` | number | 4
`CYAN` | number | 5
`GREEN` | number | 6
`YELLOW` | number | 7
`ORANGE` | number | 8
`RED` | number | 9
`WHITE` | number | 10
`NONE` | number | 255

Source:
  - consts.js, line 116

#### DeviceType

##### Properties:

Name | Type | Description
--- | --- | ---
`UNKNOWN` | number | 0
`SIMPLE_MEDIUM_LINEAR_MOTOR` | number | 1
`TRAIN_MOTOR` | number | 2
`LIGHT` | number | 8
`VOLTAGE_SENSOR` | number | 20
`CURRENT_SENSOR` | number | 21
`PIEZO_BUZZER` | number | 22
`HUB_LED` | number | 23
`TILT_SENSOR` | number | 34
`MOTION_SENSOR` | number | 35
`COLOR_DISTANCE_SENSOR` | number | 37
`MEDIUM_LINEAR_MOTOR` | number | 38
`MOVE_HUB_MEDIUM_LINEAR_MOTOR` | number | 39
`MOVE_HUB_TILT_SENSOR` | number | 40
`DUPLO_TRAIN_BASE_MOTOR` | number | 41
`DUPLO_TRAIN_BASE_SPEAKER` | number | 42
`DUPLO_TRAIN_BASE_COLOR_SENSOR` | number | 43
`DUPLO_TRAIN_BASE_SPEEDOMETER` | number | 44
`TECHNIC_LARGE_LINEAR_MOTOR` | number | 46
`TECHNIC_XLARGE_LINEAR_MOTOR` | number | 47
`TECHNIC_MEDIUM_ANGULAR_MOTOR` | number | 48
`TECHNIC_LARGE_ANGULAR_MOTOR` | number | 49
`TECHNIC_MEDIUM_HUB_GEST_SENSOR` | number | 54
`REMOTE_CONTROL_BUTTON` | number | 55
`REMOTE_CONTROL_RSSI` | number | 56
`TECHNIC_MEDIUM_HUB_ACCELEROMETER` | number | 57
`TECHNIC_MEDIUM_HUB_GYRO_SENSOR` | number | 58
`TECHNIC_MEDIUM_HUB_TILT_SENSOR` | number | 59
`TECHNIC_MEDIUM_HUB_TEMPERATURE_SENSOR` | number | 60
`TECHNIC_COLOR_SENSOR` | number | 61
`TECHNIC_DISTANCE_SENSOR` | number | 62
`TECHNIC_FORCE_SENSOR` | number | 63
`TECHNIC_3X3_COLOR_LIGHT_MATRIX` | number | 64
`TECHNIC_SMALL_ANGULAR_MOTOR` | number | 65
`MARIO_ACCELEROMETER` | number | 71
`MARIO_BARCODE_SENSOR` | number | 73
`MARIO_PANTS_SENSOR` | number | 74
`TECHNIC_MEDIUM_ANGULAR_MOTOR_GREY` | number | 75
`TECHNIC_LARGE_ANGULAR_MOTOR_GREY` | number | 76

Source:
  - consts.js, line 30

#### DuploTrainBaseSound

##### Properties:

Name | Type | Description
--- | --- | ---
`BRAKE` | number | 3
`STATION_DEPARTURE` | number | 5
`WATER_REFILL` | number | 7
`HORN` | number | 9
`STEAM` | number | 10

Source:
  - consts.js, line 176

#### ErrorCode

https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#error-codes

##### Parameters:

Name | Type | Description
--- | --- | ---
`ACK` | number | 0x01
`MACK` | number | 0x02
`BUFFER_OVERFLOW` | number | 0x03
`TIMEOUT` | number | 0x04
`COMMAND_NOT_RECOGNIZED` | number | 0x05
`INVALID_USE` | number | 0x06
`OVERCURRENT` | number | 0x07
`INTERNAL_ERROR` | number | 0x08

Source:
  - consts.js, line 490

#### Event

https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#event

##### Parameters:

Name | Type | Description
--- | --- | ---
`DETACHED_IO` | number | 0x00
`ATTACHED_IO` | number | 0x01
`ATTACHED_VIRTUAL_IO` | number | 0x02

Source:
  - consts.js, line 442

#### HubPropertyOperation

https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#hub-property-reference

##### Parameters:

Name | Type | Description
--- | --- | ---
`SET_DOWNSTREAM` | number | 0x01
`ENABLE_UPDATES_DOWNSTREAM` | number | 0x02
`DISABLE_UPDATES_DOWNSTREAM` | number | 0x03
`RESET_DOWNSTREAM` | number | 0x04
`REQUEST_UPDATE_DOWNSTREAM` | number | 0x05
`UPDATE_UPSTREAM` | number | 0x06

Source:
  - consts.js, line 318

#### HubPropertyPayload

https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#hub-property-reference

##### Parameters:

Name | Type | Description
--- | --- | ---
`ADVERTISING_NAME` | number | 0x01
`BUTTON_STATE` | number | 0x02
`FW_VERSION` | number | 0x03
`HW_VERSION` | number | 0x04
`RSSI` | number | 0x05
`BATTERY_VOLTAGE` | number | 0x06
`BATTERY_TYPE` | number | 0x07
`MANUFACTURER_NAME` | number | 0x08
`RADIO_FIRMWARE_VERSION` | number | 0x09
`LWP_PROTOCOL_VERSION` | number | 0x0A
`SYSTEM_TYPE_ID` | number | 0x0B
`HW_NETWORK_ID` | number | 0x0C
`PRIMARY_MAC_ADDRESS` | number | 0x0D
`SECONDARY_MAC_ADDRESS` | number | 0x0E
`HW_NETWORK_FAMILY` | number | 0x0F

Source:
  - consts.js, line 337

#### HubPropertyReference

https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#hub-property-reference

##### Parameters:

Name | Type | Description
--- | --- | ---
`ADVERTISING_NAME` | number | 0x01
`BUTTON` | number | 0x02
`FW_VERSION` | number | 0x03
`HW_VERSION` | number | 0x04
`RSSI` | number | 0x05
`BATTERY_VOLTAGE` | number | 0x06
`BATTERY_TYPE` | number | 0x07
`MANUFACTURER_NAME` | number | 0x08
`RADIO_FIRMWARE_VERSION` | number | 0x09
`LEGO_WIRELESS_PROTOCOL_VERSION` | number | 0x0A
`SYSTEM_TYPE_ID` | number | 0x0B
`HW_NETWORK_ID` | number | 0x0C
`PRIMARY_MAC_ADDRESS` | number | 0x0D
`SECONDARY_MAC_ADDRESS` | number | 0x0E
`HARDWARE_NETWORK_FAMILY` | number | 0x0F

Source:
  - consts.js, line 281

#### HubType

##### Properties:

Name | Type | Description
--- | --- | ---
`UNKNOWN` | number | 0
`WEDO2_SMART_HUB` | number | 1
`MOVE_HUB` | number | 2
`HUB` | number | 3
`REMOTE_CONTROL` | number | 4
`DUPLO_TRAIN_BASE` | number | 5
`TECHNIC_MEDIUM_HUB` | number | 6
`MARIO` | number | 7
`TECHNIC_SMALL_HUB` | number | 8

Source:
  - consts.js, line 4

#### HWNetWorkCommandType

https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#h-w-network-command-type

##### Parameters:

Name | Type | Description
--- | --- | ---
`CONNECTION_REQUEST` | number | 0x02
`FAMILY_REQUEST` | number | 0x03
`FAMILY_SET` | number | 0x04
`JOIN_DENIED` | number | 0x05
`GET_FAMILY` | number | 0x06
`FAMILY` | number | 0x07
`GET_SUBFAMILY` | number | 0x08
`SUBFAMILY` | number | 0x09
`SUBFAMILY_SET` | number | 0x0A
`GET_EXTENDED_FAMILY` | number | 0x0B
`EXTENDED_FAMILY` | number | 0x0C
`EXTENDED_FAMILY_SET` | number | 0x0D
`RESET_LONG_PRESS_TIMING` | number | 0x0E

Source:
  - consts.js, line 513

#### HWNetworkFamily

https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#h-w-network-family

##### Parameters:

Name | Type | Description
--- | --- | ---
`GREEN` | number | 0x01
`YELLOW` | number | 0x02
`RED` | number | 0x03
`BLUE` | number | 0x04
`PURPLE` | number | 0x05
`LIGHT_BLUE` | number | 0x06
`TEAL` | number | 0x07
`PINK` | number | 0x08
`WHITE` | number | 0x00

Source:
  - consts.js, line 546

#### HWNetworkSubFamily

https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#h-w-network-sub-family

##### Parameters:

Name | Type | Description
--- | --- | ---
`ONE_FLASH` | number | 0x01
`TWO_FLASHES` | number | 0x02
`THREE_FLASHES` | number | 0x03
`FOUR_FLASHES` | number | 0x04
`FIVE_FLASHES` | number | 0x05
`SIX_FLASHES` | number | 0x06
`SEVEN_FLASHES` | number | 0x07

Source:
  - consts.js, line 571

#### IOTypeID

https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#io-type-id

##### Parameters:

Name | Type | Description
--- | --- | ---
`MOTOR` | number | 0x0001
`SYSTEM_TRAIN_MOTOR` | number | 0x0002
`BUTTON` | number | 0x0005
`LED_LIGHT` | number | 0x0008
`VOLTAGE` | number | 0x0014
`CURRENT` | number | 0x0015
`PIEZO_TONE_SOUND` | number | 0x0016
`RGB_LIGHT` | number | 0x0017
`EXTERNAL_TILT_SENSOR` | number | 0x0022
`MOTION_SENSOR` | number | 0x0023
`VISION_SENSOR` | number | 0x0025
`EXTERNAL_MOTOR` | number | 0x0026
`INTERNAL_MOTOR` | number | 0x0027
`INTERNAL_TILT` | number | 0x0028

Source:
  - consts.js, line 455

#### MarioColor

##### Parameters:

Name | Type | Description
--- | --- | ---
`WHITE` | number | 0x1300
`RED` | number | 0x1500
`BLUE` | number | 0x1700
`YELLOW` | number | 0x1800
`BLACK` | number | 0x1a00
`GREEN` | number | 0x2500
`BROWN` | number | 0x6a00
`CYAN` | number | 0x4201

Source:
  - consts.js, line 656

#### MarioPantsType

##### Parameters:

Name | Type | Description
--- | --- | ---
`NONE` | number | 0x00
`PROPELLER` | number | 0x06
`CAT` | number | 0x11
`FIRE` | number | 0x12
`NORMAL` | number | 0x21
`BUILDER` | number | 0x22

Source:
  - consts.js, line 638

#### MessageType

https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#message-types

##### Properties:

Name | Type | Description
--- | --- | ---
`HUB_PROPERTIES` | number | 0x01
`HUB_ACTIONS` | number | 0x02
`HUB_ALERTS` | number | 0x03
`HUB_ATTACHED_IO` | number | 0x04
`GENERIC_ERROR_MESSAGES` | number | 0x05
`HW_NETWORK_COMMANDS` | number | 0x08
`FW_UPDATE_GO_INTO_BOOT_MODE` | number | 0x10
`FW_UPDATE_LOCK_MEMORY` | number | 0x11
`FW_UPDATE_LOCK_STATUS_REQUEST` | number | 0x12
`FW_LOCK_STATUS` | number | 0x13
`PORT_INFORMATION_REQUEST` | number | 0x21
`PORT_MODE_INFORMATION_REQUEST` | number | 0x22
`PORT_INPUT_FORMAT_SETUP_SINGLE` | number | 0x41
`PORT_INPUT_FORMAT_SETUP_COMBINEDMODE` | number | 0x42
`PORT_INFORMATION` | number | 0x43
`PORT_MODE_INFORMATION` | number | 0x44
`PORT_VALUE_SINGLE` | number | 0x45
`PORT_VALUE_COMBINEDMODE` | number | 0x46
`PORT_INPUT_FORMAT_SINGLE` | number | 0x47
`PORT_INPUT_FORMAT_COMBINEDMODE` | number | 0x48
`VIRTUAL_PORT_SETUP` | number | 0x61
`PORT_OUTPUT_COMMAND` | number | 0x81
`PORT_OUTPUT_COMMAND_FEEDBACK` | number | 0x82

Source:
  - consts.js, line 228

#### ModeInformationType

https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#mode-information-types

##### Parameters:

Name | Type | Description
--- | --- | ---
`NAME` | number | 0x00
`RAW` | number | 0x01
`PCT` | number | 0x02
`SI` | number | 0x03
`SYMBOL` | number | 0x04
`MAPPING` | number | 0x05
`USED_INTERNALLY` | number | 0x06
`MOTOR_BIAS` | number | 0x07
`CAPABILITY_BITS` | number | 0x08
`VALUE_FORMAT` | number | 0x80

Source:
  - consts.js, line 592

#### PortInputFormatSetupSubCommand

https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#port-input-format-setup-sub-commands

##### Parameters:

Name | Type | Description
--- | --- | ---
`SET_MODEANDDATASET_COMBINATIONS` | number | 0x01
`LOCK_LPF2_DEVICE_FOR_SETUP` | number | 0x02
`UNLOCKANDSTARTWITHMULTIUPDATEENABLED` | number | 0x03
`UNLOCKANDSTARTWITHMULTIUPDATEDISABLED` | number | 0x04
`NOT_USED` | number | 0x05
`RESET_SENSOR` | number | 0x06

Source:
  - consts.js, line 619