node-poweredup 9.0.0 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -11
- package/dist/color.d.ts +7 -0
- package/dist/color.d.ts.map +1 -0
- package/dist/color.js +15 -0
- package/dist/color.js.map +1 -0
- package/dist/consts.d.ts +645 -0
- package/dist/consts.d.ts.map +1 -0
- package/{docs/consts.js.html → dist/consts.js} +74 -127
- package/dist/consts.js.map +1 -0
- package/dist/devices/absolutemotor.d.ts +41 -0
- package/dist/devices/absolutemotor.d.ts.map +1 -0
- package/dist/devices/absolutemotor.js +115 -0
- package/dist/devices/absolutemotor.js.map +1 -0
- package/dist/devices/basicmotor.d.ts +37 -0
- package/dist/devices/basicmotor.d.ts.map +1 -0
- package/dist/devices/basicmotor.js +57 -0
- package/dist/devices/basicmotor.js.map +1 -0
- package/dist/devices/colordistancesensor.d.ts +74 -0
- package/dist/devices/colordistancesensor.d.ts.map +1 -0
- package/dist/devices/colordistancesensor.js +278 -0
- package/dist/devices/colordistancesensor.js.map +1 -0
- package/dist/devices/currentsensor.d.ts +17 -0
- package/dist/devices/currentsensor.d.ts.map +1 -0
- package/dist/devices/currentsensor.js +55 -0
- package/dist/devices/currentsensor.js.map +1 -0
- package/dist/devices/device.d.ts +72 -0
- package/dist/devices/device.d.ts.map +1 -0
- package/dist/devices/device.js +162 -0
- package/dist/devices/device.js.map +1 -0
- package/dist/devices/duplotrainbasecolorsensor.d.ts +20 -0
- package/dist/devices/duplotrainbasecolorsensor.d.ts.map +1 -0
- package/dist/devices/duplotrainbasecolorsensor.js +77 -0
- package/dist/devices/duplotrainbasecolorsensor.js.map +1 -0
- package/dist/devices/duplotrainbasemotor.d.ts +10 -0
- package/dist/devices/duplotrainbasemotor.d.ts.map +1 -0
- package/dist/devices/duplotrainbasemotor.js +12 -0
- package/dist/devices/duplotrainbasemotor.js.map +1 -0
- package/dist/devices/duplotrainbasespeaker.d.ts +27 -0
- package/dist/devices/duplotrainbasespeaker.d.ts.map +1 -0
- package/dist/devices/duplotrainbasespeaker.js +38 -0
- package/dist/devices/duplotrainbasespeaker.js.map +1 -0
- package/dist/devices/duplotrainbasespeedometer.d.ts +17 -0
- package/dist/devices/duplotrainbasespeedometer.d.ts.map +1 -0
- package/dist/devices/duplotrainbasespeedometer.js +34 -0
- package/dist/devices/duplotrainbasespeedometer.js.map +1 -0
- package/dist/devices/hubled.d.ts +28 -0
- package/dist/devices/hubled.d.ts.map +1 -0
- package/dist/devices/hubled.js +58 -0
- package/dist/devices/hubled.js.map +1 -0
- package/dist/devices/light.d.ts +24 -0
- package/dist/devices/light.d.ts.map +1 -0
- package/dist/devices/light.js +44 -0
- package/dist/devices/light.js.map +1 -0
- package/dist/devices/marioaccelerometer.d.ts +18 -0
- package/dist/devices/marioaccelerometer.d.ts.map +1 -0
- package/dist/devices/marioaccelerometer.js +50 -0
- package/dist/devices/marioaccelerometer.js.map +1 -0
- package/dist/devices/mariobarcodesensor.d.ts +18 -0
- package/dist/devices/mariobarcodesensor.d.ts.map +1 -0
- package/dist/devices/mariobarcodesensor.js +58 -0
- package/dist/devices/mariobarcodesensor.js.map +1 -0
- package/dist/devices/mariopantssensor.d.ts +17 -0
- package/dist/devices/mariopantssensor.d.ts.map +1 -0
- package/dist/devices/mariopantssensor.js +34 -0
- package/dist/devices/mariopantssensor.js.map +1 -0
- package/dist/devices/mediumlinearmotor.d.ts +10 -0
- package/dist/devices/mediumlinearmotor.d.ts.map +1 -0
- package/dist/devices/mediumlinearmotor.js +12 -0
- package/dist/devices/mediumlinearmotor.js.map +1 -0
- package/dist/devices/motionsensor.d.ts +17 -0
- package/dist/devices/motionsensor.d.ts.map +1 -0
- package/dist/devices/motionsensor.js +38 -0
- package/dist/devices/motionsensor.js.map +1 -0
- package/dist/devices/movehubmediumlinearmotor.d.ts +10 -0
- package/dist/devices/movehubmediumlinearmotor.d.ts.map +1 -0
- package/dist/devices/movehubmediumlinearmotor.js +12 -0
- package/dist/devices/movehubmediumlinearmotor.js.map +1 -0
- package/dist/devices/movehubtiltsensor.d.ts +17 -0
- package/dist/devices/movehubtiltsensor.d.ts.map +1 -0
- package/dist/devices/movehubtiltsensor.js +36 -0
- package/dist/devices/movehubtiltsensor.js.map +1 -0
- package/dist/devices/piezobuzzer.d.ts +17 -0
- package/dist/devices/piezobuzzer.d.ts.map +1 -0
- package/dist/devices/piezobuzzer.js +27 -0
- package/dist/devices/piezobuzzer.js.map +1 -0
- package/dist/devices/remotecontrolbutton.d.ts +20 -0
- package/dist/devices/remotecontrolbutton.d.ts.map +1 -0
- package/dist/devices/remotecontrolbutton.js +40 -0
- package/dist/devices/remotecontrolbutton.js.map +1 -0
- package/dist/devices/simplemediumlinearmotor.d.ts +10 -0
- package/dist/devices/simplemediumlinearmotor.d.ts.map +1 -0
- package/dist/devices/simplemediumlinearmotor.js +12 -0
- package/dist/devices/simplemediumlinearmotor.js.map +1 -0
- package/dist/devices/tachomotor.d.ts +65 -0
- package/dist/devices/tachomotor.d.ts.map +1 -0
- package/dist/devices/tachomotor.js +161 -0
- package/dist/devices/tachomotor.js.map +1 -0
- package/dist/devices/technic3x3colorlightmatrix.d.ts +22 -0
- package/dist/devices/technic3x3colorlightmatrix.d.ts.map +1 -0
- package/dist/devices/technic3x3colorlightmatrix.js +53 -0
- package/dist/devices/technic3x3colorlightmatrix.js.map +1 -0
- package/dist/devices/techniccolorsensor.d.ts +27 -0
- package/dist/devices/techniccolorsensor.d.ts.map +1 -0
- package/dist/devices/techniccolorsensor.js +71 -0
- package/dist/devices/techniccolorsensor.js.map +1 -0
- package/dist/devices/technicdistancesensor.d.ts +27 -0
- package/dist/devices/technicdistancesensor.d.ts.map +1 -0
- package/dist/devices/technicdistancesensor.js +57 -0
- package/dist/devices/technicdistancesensor.js.map +1 -0
- package/dist/devices/technicforcesensor.d.ts +19 -0
- package/dist/devices/technicforcesensor.d.ts.map +1 -0
- package/dist/devices/technicforcesensor.js +58 -0
- package/dist/devices/technicforcesensor.js.map +1 -0
- package/dist/devices/techniclargeangularmotor.d.ts +13 -0
- package/dist/devices/techniclargeangularmotor.d.ts.map +1 -0
- package/dist/devices/techniclargeangularmotor.js +12 -0
- package/dist/devices/techniclargeangularmotor.js.map +1 -0
- package/dist/devices/techniclargelinearmotor.d.ts +10 -0
- package/dist/devices/techniclargelinearmotor.d.ts.map +1 -0
- package/dist/devices/techniclargelinearmotor.js +12 -0
- package/dist/devices/techniclargelinearmotor.js.map +1 -0
- package/dist/devices/technicmediumangularmotor.d.ts +13 -0
- package/dist/devices/technicmediumangularmotor.d.ts.map +1 -0
- package/dist/devices/technicmediumangularmotor.js +12 -0
- package/dist/devices/technicmediumangularmotor.js.map +1 -0
- package/dist/devices/technicmediumhubaccelerometersensor.d.ts +17 -0
- package/dist/devices/technicmediumhubaccelerometersensor.d.ts.map +1 -0
- package/dist/devices/technicmediumhubaccelerometersensor.js +38 -0
- package/dist/devices/technicmediumhubaccelerometersensor.js.map +1 -0
- package/dist/devices/technicmediumhubgyrosensor.d.ts +17 -0
- package/dist/devices/technicmediumhubgyrosensor.d.ts.map +1 -0
- package/dist/devices/technicmediumhubgyrosensor.js +38 -0
- package/dist/devices/technicmediumhubgyrosensor.js.map +1 -0
- package/dist/devices/technicmediumhubtiltsensor.d.ts +38 -0
- package/dist/devices/technicmediumhubtiltsensor.d.ts.map +1 -0
- package/dist/devices/technicmediumhubtiltsensor.js +103 -0
- package/dist/devices/technicmediumhubtiltsensor.js.map +1 -0
- package/dist/devices/technicsmallangularmotor.d.ts +13 -0
- package/dist/devices/technicsmallangularmotor.d.ts.map +1 -0
- package/dist/devices/technicsmallangularmotor.js +12 -0
- package/dist/devices/technicsmallangularmotor.js.map +1 -0
- package/dist/devices/technicxlargelinearmotor.d.ts +10 -0
- package/dist/devices/technicxlargelinearmotor.d.ts.map +1 -0
- package/dist/devices/technicxlargelinearmotor.js +12 -0
- package/dist/devices/technicxlargelinearmotor.js.map +1 -0
- package/dist/devices/tiltsensor.d.ts +17 -0
- package/dist/devices/tiltsensor.d.ts.map +1 -0
- package/dist/devices/tiltsensor.js +36 -0
- package/dist/devices/tiltsensor.js.map +1 -0
- package/dist/devices/trainmotor.d.ts +10 -0
- package/dist/devices/trainmotor.d.ts.map +1 -0
- package/dist/devices/trainmotor.js +12 -0
- package/dist/devices/trainmotor.js.map +1 -0
- package/dist/devices/voltagesensor.d.ts +17 -0
- package/dist/devices/voltagesensor.d.ts.map +1 -0
- package/dist/devices/voltagesensor.js +59 -0
- package/dist/devices/voltagesensor.js.map +1 -0
- package/dist/hubs/basehub.d.ts +154 -0
- package/dist/hubs/basehub.d.ts.map +1 -0
- package/dist/hubs/basehub.js +383 -0
- package/dist/hubs/basehub.js.map +1 -0
- package/dist/hubs/duplotrainbase.d.ts +18 -0
- package/dist/hubs/duplotrainbase.d.ts.map +1 -0
- package/dist/hubs/duplotrainbase.js +35 -0
- package/dist/hubs/duplotrainbase.js.map +1 -0
- package/dist/hubs/hub.d.ts +20 -0
- package/dist/hubs/hub.d.ts.map +1 -0
- package/dist/hubs/hub.js +44 -0
- package/dist/hubs/hub.js.map +1 -0
- package/dist/hubs/lpf2hub.d.ts +46 -0
- package/dist/hubs/lpf2hub.d.ts.map +1 -0
- package/{docs/hubs_lpf2hub.js.html → dist/hubs/lpf2hub.js} +23 -103
- package/dist/hubs/lpf2hub.js.map +1 -0
- package/dist/hubs/mario.d.ts +18 -0
- package/dist/hubs/mario.d.ts.map +1 -0
- package/dist/hubs/mario.js +31 -0
- package/dist/hubs/mario.js.map +1 -0
- package/dist/hubs/movehub.d.ts +19 -0
- package/dist/hubs/movehub.d.ts.map +1 -0
- package/dist/hubs/movehub.js +46 -0
- package/dist/hubs/movehub.js.map +1 -0
- package/dist/hubs/remotecontrol.d.ts +18 -0
- package/dist/hubs/remotecontrol.d.ts.map +1 -0
- package/dist/hubs/remotecontrol.js +37 -0
- package/dist/hubs/remotecontrol.js.map +1 -0
- package/dist/hubs/technicmediumhub.d.ts +18 -0
- package/dist/hubs/technicmediumhub.d.ts.map +1 -0
- package/dist/hubs/technicmediumhub.js +42 -0
- package/dist/hubs/technicmediumhub.js.map +1 -0
- package/dist/hubs/technicsmallhub.d.ts +19 -0
- package/dist/hubs/technicsmallhub.d.ts.map +1 -0
- package/dist/hubs/technicsmallhub.js +41 -0
- package/dist/hubs/technicsmallhub.js.map +1 -0
- package/dist/hubs/wedo2smarthub.d.ts +39 -0
- package/dist/hubs/wedo2smarthub.d.ts.map +1 -0
- package/dist/hubs/wedo2smarthub.js +186 -0
- package/dist/hubs/wedo2smarthub.js.map +1 -0
- package/dist/index-browser.d.ts +2 -0
- package/dist/index-browser.d.ts.map +1 -0
- package/dist/index-browser.js +96 -0
- package/dist/index-browser.js.map +1 -0
- package/dist/index-node.d.ts +50 -0
- package/dist/index-node.d.ts.map +1 -0
- package/dist/index-node.js +50 -0
- package/dist/index-node.js.map +1 -0
- package/dist/interfaces.d.ts +24 -0
- package/dist/interfaces.d.ts.map +1 -0
- package/dist/interfaces.js +2 -0
- package/dist/interfaces.js.map +1 -0
- package/dist/nobleabstraction.d.ts +27 -0
- package/dist/nobleabstraction.d.ts.map +1 -0
- package/dist/nobleabstraction.js +121 -0
- package/dist/nobleabstraction.js.map +1 -0
- package/dist/node/color.js +2 -29
- package/dist/node/color.js.map +1 -1
- package/dist/node/commands.d.ts +299 -0
- package/dist/node/commands.js +672 -0
- package/dist/node/commands.js.map +1 -0
- package/dist/node/connection.d.ts +187 -0
- package/dist/node/connection.js +478 -0
- package/dist/node/connection.js.map +1 -0
- package/dist/node/consts.js +57 -60
- package/dist/node/consts.js.map +1 -1
- package/dist/node/devices/absolutemotor.d.ts +0 -1
- package/dist/node/devices/absolutemotor.js +14 -41
- package/dist/node/devices/absolutemotor.js.map +1 -1
- package/dist/node/devices/basicmotor.d.ts +3 -3
- package/dist/node/devices/basicmotor.js +6 -33
- package/dist/node/devices/basicmotor.js.map +1 -1
- package/dist/node/devices/colordistancesensor.d.ts +4 -5
- package/dist/node/devices/colordistancesensor.js +11 -38
- package/dist/node/devices/colordistancesensor.js.map +1 -1
- package/dist/node/devices/currentsensor.d.ts +0 -1
- package/dist/node/devices/currentsensor.js +7 -34
- package/dist/node/devices/currentsensor.js.map +1 -1
- package/dist/node/devices/device.d.ts +4 -7
- package/dist/node/devices/device.js +3 -30
- package/dist/node/devices/device.js.map +1 -1
- package/dist/node/devices/duplotrainbasecolorsensor.d.ts +0 -1
- package/dist/node/devices/duplotrainbasecolorsensor.js +9 -36
- package/dist/node/devices/duplotrainbasecolorsensor.js.map +1 -1
- package/dist/node/devices/duplotrainbasemotor.js +3 -30
- package/dist/node/devices/duplotrainbasemotor.js.map +1 -1
- package/dist/node/devices/duplotrainbasespeaker.js +5 -32
- package/dist/node/devices/duplotrainbasespeaker.js.map +1 -1
- package/dist/node/devices/duplotrainbasespeedometer.d.ts +0 -1
- package/dist/node/devices/duplotrainbasespeedometer.js +7 -34
- package/dist/node/devices/duplotrainbasespeedometer.js.map +1 -1
- package/dist/node/devices/hubled.js +5 -32
- package/dist/node/devices/hubled.js.map +1 -1
- package/dist/node/devices/index.d.ts +14 -0
- package/dist/node/devices/index.js +154 -0
- package/dist/node/devices/index.js.map +1 -0
- package/dist/node/devices/led.d.ts +140 -0
- package/dist/node/devices/led.js +295 -0
- package/dist/node/devices/led.js.map +1 -0
- package/dist/node/devices/light.js +5 -32
- package/dist/node/devices/light.js.map +1 -1
- package/dist/node/devices/marioaccelerometer.d.ts +0 -1
- package/dist/node/devices/marioaccelerometer.js +7 -34
- package/dist/node/devices/marioaccelerometer.js.map +1 -1
- package/dist/node/devices/mariobarcodesensor.d.ts +0 -1
- package/dist/node/devices/mariobarcodesensor.js +7 -34
- package/dist/node/devices/mariobarcodesensor.js.map +1 -1
- package/dist/node/devices/mariopantssensor.d.ts +0 -1
- package/dist/node/devices/mariopantssensor.js +7 -34
- package/dist/node/devices/mariopantssensor.js.map +1 -1
- package/dist/node/devices/mediumlinearmotor.js +3 -30
- package/dist/node/devices/mediumlinearmotor.js.map +1 -1
- package/dist/node/devices/motionsensor.d.ts +0 -1
- package/dist/node/devices/motionsensor.js +7 -34
- package/dist/node/devices/motionsensor.js.map +1 -1
- package/dist/node/devices/motor.d.ts +182 -0
- package/dist/node/devices/motor.js +367 -0
- package/dist/node/devices/motor.js.map +1 -0
- package/dist/node/devices/movehubmediumlinearmotor.js +3 -30
- package/dist/node/devices/movehubmediumlinearmotor.js.map +1 -1
- package/dist/node/devices/movehubtiltsensor.d.ts +0 -1
- package/dist/node/devices/movehubtiltsensor.js +7 -34
- package/dist/node/devices/movehubtiltsensor.js.map +1 -1
- package/dist/node/devices/piezobuzzer.js +3 -30
- package/dist/node/devices/piezobuzzer.js.map +1 -1
- package/dist/node/devices/remotecontrolbutton.d.ts +0 -1
- package/dist/node/devices/remotecontrolbutton.js +8 -35
- package/dist/node/devices/remotecontrolbutton.js.map +1 -1
- package/dist/node/devices/sensor.d.ts +305 -0
- package/dist/node/devices/sensor.js +662 -0
- package/dist/node/devices/sensor.js.map +1 -0
- package/dist/node/devices/simplemediumlinearmotor.js +3 -30
- package/dist/node/devices/simplemediumlinearmotor.js.map +1 -1
- package/dist/node/devices/tachomotor.d.ts +0 -1
- package/dist/node/devices/tachomotor.js +14 -41
- package/dist/node/devices/tachomotor.js.map +1 -1
- package/dist/node/devices/technic3x3colorlightmatrix.js +7 -34
- package/dist/node/devices/technic3x3colorlightmatrix.js.map +1 -1
- package/dist/node/devices/techniccolorsensor.d.ts +0 -1
- package/dist/node/devices/techniccolorsensor.js +9 -36
- package/dist/node/devices/techniccolorsensor.js.map +1 -1
- package/dist/node/devices/technicdistancesensor.d.ts +0 -1
- package/dist/node/devices/technicdistancesensor.js +7 -34
- package/dist/node/devices/technicdistancesensor.js.map +1 -1
- package/dist/node/devices/technicforcesensor.d.ts +0 -1
- package/dist/node/devices/technicforcesensor.js +7 -34
- package/dist/node/devices/technicforcesensor.js.map +1 -1
- package/dist/node/devices/techniclargeangularmotor.js +3 -30
- package/dist/node/devices/techniclargeangularmotor.js.map +1 -1
- package/dist/node/devices/techniclargelinearmotor.js +3 -30
- package/dist/node/devices/techniclargelinearmotor.js.map +1 -1
- package/dist/node/devices/technicmediumangularmotor.js +3 -30
- package/dist/node/devices/technicmediumangularmotor.js.map +1 -1
- package/dist/node/devices/technicmediumhubaccelerometersensor.d.ts +0 -1
- package/dist/node/devices/technicmediumhubaccelerometersensor.js +7 -34
- package/dist/node/devices/technicmediumhubaccelerometersensor.js.map +1 -1
- package/dist/node/devices/technicmediumhubgyrosensor.d.ts +0 -1
- package/dist/node/devices/technicmediumhubgyrosensor.js +7 -34
- package/dist/node/devices/technicmediumhubgyrosensor.js.map +1 -1
- package/dist/node/devices/technicmediumhubtiltsensor.d.ts +0 -1
- package/dist/node/devices/technicmediumhubtiltsensor.js +7 -34
- package/dist/node/devices/technicmediumhubtiltsensor.js.map +1 -1
- package/dist/node/devices/technicsmallangularmotor.js +3 -30
- package/dist/node/devices/technicsmallangularmotor.js.map +1 -1
- package/dist/node/devices/technicxlargelinearmotor.js +3 -30
- package/dist/node/devices/technicxlargelinearmotor.js.map +1 -1
- package/dist/node/devices/tiltsensor.d.ts +0 -1
- package/dist/node/devices/tiltsensor.js +7 -34
- package/dist/node/devices/tiltsensor.js.map +1 -1
- package/dist/node/devices/trainmotor.js +3 -30
- package/dist/node/devices/trainmotor.js.map +1 -1
- package/dist/node/devices/voltagesensor.d.ts +0 -1
- package/dist/node/devices/voltagesensor.js +7 -34
- package/dist/node/devices/voltagesensor.js.map +1 -1
- package/dist/node/hub.d.ts +291 -0
- package/dist/node/hub.js +778 -0
- package/dist/node/hub.js.map +1 -0
- package/dist/node/hubs/basehub.d.ts +9 -11
- package/dist/node/hubs/basehub.js +74 -101
- package/dist/node/hubs/basehub.js.map +1 -1
- package/dist/node/hubs/duplotrainbase.d.ts +1 -2
- package/dist/node/hubs/duplotrainbase.js +6 -33
- package/dist/node/hubs/duplotrainbase.js.map +1 -1
- package/dist/node/hubs/hub.d.ts +1 -2
- package/dist/node/hubs/hub.js +8 -35
- package/dist/node/hubs/hub.js.map +1 -1
- package/dist/node/hubs/lpf2hub.d.ts +5 -6
- package/dist/node/hubs/lpf2hub.js +17 -44
- package/dist/node/hubs/lpf2hub.js.map +1 -1
- package/dist/node/hubs/mario.d.ts +1 -2
- package/dist/node/hubs/mario.js +6 -33
- package/dist/node/hubs/mario.js.map +1 -1
- package/dist/node/hubs/movehub.d.ts +1 -2
- package/dist/node/hubs/movehub.js +8 -35
- package/dist/node/hubs/movehub.js.map +1 -1
- package/dist/node/hubs/remotecontrol.d.ts +1 -2
- package/dist/node/hubs/remotecontrol.js +6 -33
- package/dist/node/hubs/remotecontrol.js.map +1 -1
- package/dist/node/hubs/technicmediumhub.d.ts +1 -2
- package/dist/node/hubs/technicmediumhub.js +6 -33
- package/dist/node/hubs/technicmediumhub.js.map +1 -1
- package/dist/node/hubs/technicsmallhub.d.ts +1 -2
- package/dist/node/hubs/technicsmallhub.js +6 -33
- package/dist/node/hubs/technicsmallhub.js.map +1 -1
- package/dist/node/hubs/wedo2smarthub.d.ts +3 -5
- package/dist/node/hubs/wedo2smarthub.js +10 -37
- package/dist/node/hubs/wedo2smarthub.js.map +1 -1
- package/dist/node/index-browser.js +91 -116
- package/dist/node/index-browser.js.map +1 -1
- package/dist/node/index-node.d.ts +1 -0
- package/dist/node/index-node.js +49 -119
- package/dist/node/index-node.js.map +1 -1
- package/dist/node/index.d.ts +31 -0
- package/dist/node/index.js +93 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/index.mjs +0 -0
- package/dist/node/interfaces.d.ts +1 -3
- package/dist/node/interfaces.js +1 -2
- package/dist/node/nobleabstraction.d.ts +0 -2
- package/dist/node/nobleabstraction.js +5 -7
- package/dist/node/nobleabstraction.js.map +1 -1
- package/dist/node/poweredup-browser.d.ts +0 -2
- package/dist/node/poweredup-browser.js +23 -49
- package/dist/node/poweredup-browser.js.map +1 -1
- package/dist/node/poweredup-node.d.ts +0 -2
- package/dist/node/poweredup-node.js +31 -58
- package/dist/node/poweredup-node.js.map +1 -1
- package/dist/node/poweredup.d.ts +83 -0
- package/dist/node/poweredup.js +542 -0
- package/dist/node/poweredup.js.map +1 -0
- package/dist/node/protocol-wedo.d.ts +158 -0
- package/dist/node/protocol-wedo.js +342 -0
- package/dist/node/protocol-wedo.js.map +1 -0
- package/dist/node/protocol.d.ts +340 -0
- package/dist/node/protocol.js +730 -0
- package/dist/node/protocol.js.map +1 -0
- package/dist/node/types.d.ts +408 -0
- package/dist/node/types.js +291 -0
- package/dist/node/types.js.map +1 -0
- package/dist/node/utils.d.ts +1 -2
- package/dist/node/utils.js +14 -26
- package/dist/node/utils.js.map +1 -1
- package/dist/node/webbleabstraction.d.ts +1 -3
- package/dist/node/webbleabstraction.js +3 -7
- package/dist/node/webbleabstraction.js.map +1 -1
- package/dist/poweredup-browser.d.ts +46 -0
- package/dist/poweredup-browser.d.ts.map +1 -0
- package/dist/poweredup-browser.js +210 -0
- package/dist/poweredup-browser.js.map +1 -0
- package/dist/poweredup-node.d.ts +49 -0
- package/dist/poweredup-node.d.ts.map +1 -0
- package/dist/poweredup-node.js +166 -0
- package/dist/poweredup-node.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/utils.d.ts +13 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +90 -0
- package/dist/utils.js.map +1 -0
- package/dist/webbleabstraction.d.ts +27 -0
- package/dist/webbleabstraction.d.ts.map +1 -0
- package/dist/webbleabstraction.js +104 -0
- package/dist/webbleabstraction.js.map +1 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/hierarchy.js +1 -0
- package/docs/assets/highlight.css +99 -0
- package/docs/assets/icons.js +18 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +60 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1633 -0
- package/docs/classes/AbsoluteMotor.html +242 -0
- package/docs/classes/BaseHub.html +220 -0
- package/docs/classes/BasicMotor.html +201 -0
- package/docs/classes/Color.html +3 -0
- package/docs/classes/ColorDistanceSensor.html +214 -0
- package/docs/classes/CurrentSensor.html +185 -0
- package/docs/classes/Device.html +185 -0
- package/docs/classes/DuploTrainBase.html +233 -0
- package/docs/classes/DuploTrainBaseColorSensor.html +185 -0
- package/docs/classes/DuploTrainBaseMotor.html +201 -0
- package/docs/classes/DuploTrainBaseSpeaker.html +191 -0
- package/docs/classes/DuploTrainBaseSpeedometer.html +185 -0
- package/docs/classes/Hub.html +233 -0
- package/docs/classes/HubLED.html +191 -0
- package/docs/classes/Light.html +195 -0
- package/docs/classes/Mario.html +233 -0
- package/docs/classes/MediumLinearMotor.html +229 -0
- package/docs/classes/MotionSensor.html +185 -0
- package/docs/classes/MoveHub.html +233 -0
- package/docs/classes/MoveHubMediumLinearMotor.html +229 -0
- package/docs/classes/MoveHubTiltSensor.html +185 -0
- package/docs/classes/PiezoBuzzer.html +189 -0
- package/docs/classes/PoweredUP.html +180 -0
- package/docs/classes/RemoteControl.html +233 -0
- package/docs/classes/RemoteControlButton.html +185 -0
- package/docs/classes/SimpleMediumLinearMotor.html +201 -0
- package/docs/classes/TachoMotor.html +229 -0
- package/docs/classes/Technic3x3ColorLightMatrix.html +189 -0
- package/docs/classes/TechnicColorSensor.html +191 -0
- package/docs/classes/TechnicDistanceSensor.html +192 -0
- package/docs/classes/TechnicForceSensor.html +185 -0
- package/docs/classes/TechnicLargeAngularMotor.html +242 -0
- package/docs/classes/TechnicLargeLinearMotor.html +242 -0
- package/docs/classes/TechnicMediumAngularMotor.html +242 -0
- package/docs/classes/TechnicMediumHub.html +233 -0
- package/docs/classes/TechnicMediumHubAccelerometerSensor.html +185 -0
- package/docs/classes/TechnicMediumHubGyroSensor.html +185 -0
- package/docs/classes/TechnicMediumHubTiltSensor.html +197 -0
- package/docs/classes/TechnicSmallAngularMotor.html +242 -0
- package/docs/classes/TechnicXLargeLinearMotor.html +242 -0
- package/docs/classes/TiltSensor.html +185 -0
- package/docs/classes/TrainMotor.html +201 -0
- package/docs/classes/VoltageSensor.html +185 -0
- package/docs/classes/WeDo2SmartHub.html +229 -0
- package/docs/enums/ActionType.html +22 -0
- package/docs/enums/AlertOperation.html +10 -0
- package/docs/enums/AlertPayload.html +6 -0
- package/docs/enums/AlertType.html +10 -0
- package/docs/enums/BLECharacteristic.html +15 -0
- package/docs/enums/BLEManufacturerData.html +8 -0
- package/docs/enums/BLEService.html +7 -0
- package/docs/enums/BrakingStyle.html +7 -0
- package/docs/enums/ButtonState.html +11 -0
- package/docs/enums/Consts.Color.html +25 -0
- package/docs/enums/DeviceType.html +79 -0
- package/docs/enums/DuploTrainBaseSound.html +11 -0
- package/docs/enums/ErrorCode.html +18 -0
- package/docs/enums/Event.html +8 -0
- package/docs/enums/HWNetWorkCommandType.html +28 -0
- package/docs/enums/HWNetworkFamily.html +20 -0
- package/docs/enums/HWNetworkSubFamily.html +16 -0
- package/docs/enums/HubPropertyOperation.html +14 -0
- package/docs/enums/HubPropertyPayload.html +32 -0
- package/docs/enums/HubPropertyReference.html +32 -0
- package/docs/enums/HubType.html +19 -0
- package/docs/enums/IOTypeID.html +30 -0
- package/docs/enums/MarioColor.html +17 -0
- package/docs/enums/MarioPantsType.html +13 -0
- package/docs/enums/MessageType.html +48 -0
- package/docs/enums/ModeInformationType.html +22 -0
- package/docs/enums/PortInputFormatSetupSubCommand.html +14 -0
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +18 -120
- package/docs/modules/Consts.html +1 -0
- package/docs/modules.html +1 -0
- package/docs/variables/ColorNames.html +1 -0
- package/docs/variables/DeviceTypeNames.html +1 -0
- package/docs/variables/HubTypeNames.html +1 -0
- package/docs/variables/isWebBluetooth.html +1 -0
- package/package.json +19 -25
- package/src/color.ts +1 -1
- package/src/consts.ts +16 -16
- package/src/devices/absolutemotor.ts +4 -7
- package/src/devices/basicmotor.ts +4 -8
- package/src/devices/colordistancesensor.ts +8 -14
- package/src/devices/currentsensor.ts +3 -3
- package/src/devices/device.ts +2 -2
- package/src/devices/duplotrainbasecolorsensor.ts +4 -4
- package/src/devices/duplotrainbasemotor.ts +3 -3
- package/src/devices/duplotrainbasespeaker.ts +3 -5
- package/src/devices/duplotrainbasespeedometer.ts +3 -3
- package/src/devices/hubled.ts +3 -5
- package/src/devices/light.ts +4 -6
- package/src/devices/marioaccelerometer.ts +3 -3
- package/src/devices/mariobarcodesensor.ts +3 -3
- package/src/devices/mariopantssensor.ts +3 -3
- package/src/devices/mediumlinearmotor.ts +3 -3
- package/src/devices/motionsensor.ts +3 -3
- package/src/devices/movehubmediumlinearmotor.ts +3 -3
- package/src/devices/movehubtiltsensor.ts +3 -3
- package/src/devices/piezobuzzer.ts +3 -4
- package/src/devices/remotecontrolbutton.ts +3 -3
- package/src/devices/simplemediumlinearmotor.ts +3 -3
- package/src/devices/tachomotor.ts +5 -11
- package/src/devices/technic3x3colorlightmatrix.ts +4 -5
- package/src/devices/techniccolorsensor.ts +4 -5
- package/src/devices/technicdistancesensor.ts +3 -4
- package/src/devices/technicforcesensor.ts +3 -3
- package/src/devices/techniclargeangularmotor.ts +3 -3
- package/src/devices/techniclargelinearmotor.ts +3 -3
- package/src/devices/technicmediumangularmotor.ts +3 -3
- package/src/devices/technicmediumhubaccelerometersensor.ts +3 -3
- package/src/devices/technicmediumhubgyrosensor.ts +3 -3
- package/src/devices/technicmediumhubtiltsensor.ts +6 -9
- package/src/devices/technicsmallangularmotor.ts +3 -3
- package/src/devices/technicxlargelinearmotor.ts +3 -3
- package/src/devices/tiltsensor.ts +3 -3
- package/src/devices/trainmotor.ts +3 -3
- package/src/devices/voltagesensor.ts +3 -3
- package/src/hubs/basehub.ts +42 -51
- package/src/hubs/duplotrainbase.ts +5 -5
- package/src/hubs/hub.ts +5 -5
- package/src/hubs/lpf2hub.ts +4 -7
- package/src/hubs/mario.ts +5 -5
- package/src/hubs/movehub.ts +5 -5
- package/src/hubs/remotecontrol.ts +5 -5
- package/src/hubs/technicmediumhub.ts +5 -5
- package/src/hubs/technicsmallhub.ts +5 -5
- package/src/hubs/wedo2smarthub.ts +7 -9
- package/src/index-browser.ts +46 -46
- package/src/index-node.ts +47 -46
- package/src/interfaces.ts +2 -2
- package/src/nobleabstraction.ts +10 -10
- package/src/poweredup-browser.ts +15 -19
- package/src/poweredup-node.ts +15 -22
- package/src/utils.ts +1 -1
- package/src/webbleabstraction.ts +3 -3
- package/tsconfig.tsbuildinfo +1 -0
- package/typedoc.json +14 -0
- package/.jsdoc.json +0 -40
- package/abandonware-noble.d.ts +0 -129
- package/dist/browser/poweredup.js +0 -3
- package/dist/browser/poweredup.js.LICENSE.txt +0 -8
- package/dist/browser/poweredup.js.map +0 -1
- package/docs/AbsoluteMotor.html +0 -2008
- package/docs/BaseHub.html +0 -1391
- package/docs/BasicMotor.html +0 -1459
- package/docs/ColorDistanceSensor.html +0 -3025
- package/docs/CurrentSensor.html +0 -1022
- package/docs/Device.html +0 -841
- package/docs/DuploTrainBase.html +0 -2092
- package/docs/DuploTrainBaseColorSensor.html +0 -1509
- package/docs/DuploTrainBaseMotor.html +0 -1479
- package/docs/DuploTrainBaseSpeaker.html +0 -1193
- package/docs/DuploTraniBaseSpeedometer.html +0 -871
- package/docs/Hub.html +0 -7451
- package/docs/HubLED.html +0 -1239
- package/docs/LPF2Hub.html +0 -2066
- package/docs/Light.html +0 -1239
- package/docs/Mario.html +0 -2092
- package/docs/MarioAccelerometer.html +0 -1215
- package/docs/MarioBarcodeSensor.html +0 -1215
- package/docs/MarioPantsSensor.html +0 -1022
- package/docs/MediumLinearMotor.html +0 -1357
- package/docs/MotionSensor.html +0 -1022
- package/docs/MoveHub.html +0 -2092
- package/docs/MoveHubMediumLinearMotor.html +0 -1357
- package/docs/MoveHubTiltSensor.html +0 -1045
- package/docs/PiezoBuzzer.html +0 -1057
- package/docs/PoweredUP.html +0 -4371
- package/docs/RemoteControl.html +0 -2092
- package/docs/RemoteControlButton.html +0 -1022
- package/docs/SimpleMediumLinearMotor.html +0 -871
- package/docs/TachoMotor.html +0 -2620
- package/docs/Technic3x3ColorLightMatrix.html +0 -1037
- package/docs/TechnicColorSensor.html +0 -1525
- package/docs/TechnicDistanceSensor.html +0 -1401
- package/docs/TechnicForceSensor.html +0 -1316
- package/docs/TechnicLargeAngularMotor.html +0 -2028
- package/docs/TechnicLargeLinearMotor.html +0 -2028
- package/docs/TechnicMediumAngularMotor.html +0 -2028
- package/docs/TechnicMediumHub.html +0 -2092
- package/docs/TechnicMediumHubAccelerometerSensor.html +0 -1068
- package/docs/TechnicMediumHubGyroSensor.html +0 -1068
- package/docs/TechnicMediumHubTiltSensor.html +0 -1696
- package/docs/TechnicSmallAngularMotor.html +0 -2028
- package/docs/TechnicXLargeLinearMotor.html +0 -2028
- package/docs/TiltSensor.html +0 -1045
- package/docs/TrainMotor.html +0 -1479
- package/docs/VoltageSensor.html +0 -1022
- package/docs/WeDo2SmartHub.html +0 -1887
- package/docs/devices_absolutemotor.js.html +0 -195
- package/docs/devices_basicmotor.js.html +0 -138
- package/docs/devices_colordistancesensor.js.html +0 -361
- package/docs/devices_currentsensor.js.html +0 -132
- package/docs/devices_device.js.html +0 -239
- package/docs/devices_duplotrainbasecolorsensor.js.html +0 -154
- package/docs/devices_duplotrainbasemotor.js.html +0 -89
- package/docs/devices_duplotrainbasespeaker.js.html +0 -117
- package/docs/devices_duplotrainbasespeedometer.js.html +0 -111
- package/docs/devices_hubled.js.html +0 -137
- package/docs/devices_light.js.html +0 -123
- package/docs/devices_marioaccelerometer.js.html +0 -127
- package/docs/devices_mariobarcodesensor.js.html +0 -135
- package/docs/devices_mariopantssensor.js.html +0 -111
- package/docs/devices_mediumlinearmotor.js.html +0 -89
- package/docs/devices_motionsensor.js.html +0 -115
- package/docs/devices_movehubmediumlinearmotor.js.html +0 -89
- package/docs/devices_movehubtiltsensor.js.html +0 -113
- package/docs/devices_piezobuzzer.js.html +0 -105
- package/docs/devices_remotecontrolbutton.js.html +0 -117
- package/docs/devices_simplemediumlinearmotor.js.html +0 -89
- package/docs/devices_tachomotor.js.html +0 -244
- package/docs/devices_technic3x3colorlightmatrix.js.html +0 -131
- package/docs/devices_techniccolorsensor.js.html +0 -149
- package/docs/devices_technicdistancesensor.js.html +0 -135
- package/docs/devices_technicforcesensor.js.html +0 -135
- package/docs/devices_techniclargeangularmotor.js.html +0 -89
- package/docs/devices_techniclargelinearmotor.js.html +0 -89
- package/docs/devices_technicmediumangularmotor.js.html +0 -89
- package/docs/devices_technicmediumhubaccelerometersensor.js.html +0 -115
- package/docs/devices_technicmediumhubgyrosensor.js.html +0 -115
- package/docs/devices_technicmediumhubtiltsensor.js.html +0 -183
- package/docs/devices_technicsmallangularmotor.js.html +0 -89
- package/docs/devices_technicxlargelinearmotor.js.html +0 -89
- package/docs/devices_tiltsensor.js.html +0 -113
- package/docs/devices_trainmotor.js.html +0 -89
- package/docs/devices_voltagesensor.js.html +0 -136
- package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Bold-webfont.svg +0 -1830
- package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
- package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Italic-webfont.svg +0 -1830
- package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Light-webfont.svg +0 -1831
- package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
- package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
- package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Regular-webfont.svg +0 -1831
- package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Semibold-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Semibold-webfont.svg +0 -1830
- package/docs/fonts/OpenSans-Semibold-webfont.ttf +0 -0
- package/docs/fonts/OpenSans-Semibold-webfont.woff +0 -0
- package/docs/fonts/OpenSans-SemiboldItalic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-SemiboldItalic-webfont.svg +0 -1830
- package/docs/fonts/OpenSans-SemiboldItalic-webfont.ttf +0 -0
- package/docs/fonts/OpenSans-SemiboldItalic-webfont.woff +0 -0
- package/docs/global.html +0 -3996
- package/docs/hubs_basehub.js.html +0 -469
- package/docs/hubs_duplotrainbase.js.html +0 -112
- package/docs/hubs_hub.js.html +0 -121
- package/docs/hubs_mario.js.html +0 -108
- package/docs/hubs_movehub.js.html +0 -123
- package/docs/hubs_remotecontrol.js.html +0 -114
- package/docs/hubs_technicmediumhub.js.html +0 -119
- package/docs/hubs_technicsmallhub.js.html +0 -118
- package/docs/hubs_wedo2smarthub.js.html +0 -265
- package/docs/icons/home.svg +0 -4
- package/docs/icons/search.svg +0 -4
- package/docs/poweredup-browser.js.html +0 -292
- package/docs/poweredup-node.js.html +0 -250
- package/docs/scripts/linenumber.js +0 -25
- package/docs/scripts/pagelocation.js +0 -89
- package/docs/scripts/prettify/Apache-License-2.0.txt +0 -202
- package/docs/scripts/prettify/lang-css.js +0 -2
- package/docs/scripts/prettify/prettify.js +0 -28
- package/docs/styles/collapse.css +0 -27
- package/docs/styles/jsdoc-default.css +0 -358
- package/docs/styles/prettify-jsdoc.css +0 -111
- package/docs/styles/prettify-tomorrow.css +0 -132
- package/noble-mac.d.ts +0 -3
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PoweredUp Protocol
|
|
3
|
+
* LEGO Wireless Protocol 3.0 (LWP3) message encoding/decoding
|
|
4
|
+
* https://lego.github.io/lego-ble-wireless-protocol-docs/
|
|
5
|
+
*/
|
|
6
|
+
import { DeviceType, PortEvent, AlertType, BrakingStyle, Profile, Color, MotorFeedback } from "./types";
|
|
7
|
+
export declare const BLE_SERVICE_UUID = "00001623-1212-efde-1623-785feabcd123";
|
|
8
|
+
export declare const BLE_CHARACTERISTIC_UUID = "00001624-1212-efde-1623-785feabcd123";
|
|
9
|
+
export declare const BLE_BOOTLOADER_SERVICE_UUID = "00001625-1212-efde-1623-785feabcd123";
|
|
10
|
+
export declare const BLE_BOOTLOADER_CHARACTERISTIC_UUID = "00001626-1212-efde-1623-785feabcd123";
|
|
11
|
+
export declare enum MessageType {
|
|
12
|
+
HUB_PROPERTIES = 1,
|
|
13
|
+
HUB_ACTIONS = 2,
|
|
14
|
+
HUB_ALERTS = 3,
|
|
15
|
+
HUB_ATTACHED_IO = 4,
|
|
16
|
+
GENERIC_ERROR_MESSAGES = 5,
|
|
17
|
+
HW_NETWORK_COMMANDS = 8,
|
|
18
|
+
FW_UPDATE_GO_INTO_BOOT_MODE = 16,
|
|
19
|
+
FW_UPDATE_LOCK_MEMORY = 17,
|
|
20
|
+
FW_UPDATE_LOCK_STATUS_REQUEST = 18,
|
|
21
|
+
FW_LOCK_STATUS = 19,
|
|
22
|
+
PORT_INFORMATION_REQUEST = 33,
|
|
23
|
+
PORT_MODE_INFORMATION_REQUEST = 34,
|
|
24
|
+
PORT_INPUT_FORMAT_SETUP_SINGLE = 65,
|
|
25
|
+
PORT_INPUT_FORMAT_SETUP_COMBINEDMODE = 66,
|
|
26
|
+
PORT_INFORMATION = 67,
|
|
27
|
+
PORT_MODE_INFORMATION = 68,
|
|
28
|
+
PORT_VALUE_SINGLE = 69,
|
|
29
|
+
PORT_VALUE_COMBINEDMODE = 70,
|
|
30
|
+
PORT_INPUT_FORMAT_SINGLE = 71,
|
|
31
|
+
PORT_INPUT_FORMAT_COMBINEDMODE = 72,
|
|
32
|
+
VIRTUAL_PORT_SETUP = 97,
|
|
33
|
+
PORT_OUTPUT_COMMAND = 129,
|
|
34
|
+
PORT_OUTPUT_COMMAND_FEEDBACK = 130
|
|
35
|
+
}
|
|
36
|
+
export declare enum HubProperty {
|
|
37
|
+
ADVERTISING_NAME = 1,
|
|
38
|
+
BUTTON = 2,
|
|
39
|
+
FW_VERSION = 3,
|
|
40
|
+
HW_VERSION = 4,
|
|
41
|
+
RSSI = 5,
|
|
42
|
+
BATTERY_VOLTAGE = 6,
|
|
43
|
+
BATTERY_TYPE = 7,
|
|
44
|
+
MANUFACTURER_NAME = 8,
|
|
45
|
+
RADIO_FIRMWARE_VERSION = 9,
|
|
46
|
+
LWP_PROTOCOL_VERSION = 10,
|
|
47
|
+
SYSTEM_TYPE_ID = 11,
|
|
48
|
+
HW_NETWORK_ID = 12,
|
|
49
|
+
PRIMARY_MAC_ADDRESS = 13,
|
|
50
|
+
SECONDARY_MAC_ADDRESS = 14,
|
|
51
|
+
HW_NETWORK_FAMILY = 15
|
|
52
|
+
}
|
|
53
|
+
export declare enum HubPropertyOperation {
|
|
54
|
+
SET = 1,
|
|
55
|
+
ENABLE_UPDATES = 2,
|
|
56
|
+
DISABLE_UPDATES = 3,
|
|
57
|
+
RESET = 4,
|
|
58
|
+
REQUEST_UPDATE = 5,
|
|
59
|
+
UPDATE = 6
|
|
60
|
+
}
|
|
61
|
+
export declare enum HubAction {
|
|
62
|
+
SWITCH_OFF_HUB = 1,
|
|
63
|
+
DISCONNECT = 2,
|
|
64
|
+
VCC_PORT_CONTROL_ON = 3,
|
|
65
|
+
VCC_PORT_CONTROL_OFF = 4,
|
|
66
|
+
ACTIVATE_BUSY_INDICATION = 5,
|
|
67
|
+
RESET_BUSY_INDICATION = 6,
|
|
68
|
+
SHUTDOWN = 47,
|
|
69
|
+
HUB_WILL_SWITCH_OFF = 48,
|
|
70
|
+
HUB_WILL_DISCONNECT = 49,
|
|
71
|
+
HUB_WILL_GO_INTO_BOOT_MODE = 50
|
|
72
|
+
}
|
|
73
|
+
export declare enum AlertOperation {
|
|
74
|
+
ENABLE_UPDATE = 1,
|
|
75
|
+
DISABLE_UPDATE = 2,
|
|
76
|
+
REQUEST_UPDATE = 3,
|
|
77
|
+
UPDATE = 4
|
|
78
|
+
}
|
|
79
|
+
export declare enum MotorSubCommand {
|
|
80
|
+
START_POWER = 1,
|
|
81
|
+
START_POWER_DUAL = 2,
|
|
82
|
+
SET_ACC_TIME = 5,
|
|
83
|
+
SET_DEC_TIME = 6,
|
|
84
|
+
START_SPEED = 7,
|
|
85
|
+
START_SPEED_DUAL = 8,
|
|
86
|
+
START_SPEED_FOR_TIME = 9,
|
|
87
|
+
START_SPEED_FOR_TIME_DUAL = 10,
|
|
88
|
+
START_SPEED_FOR_DEGREES = 11,
|
|
89
|
+
START_SPEED_FOR_DEGREES_DUAL = 12,
|
|
90
|
+
GOTO_ABSOLUTE_POSITION = 13,
|
|
91
|
+
GOTO_ABSOLUTE_POSITION_DUAL = 14,
|
|
92
|
+
PRESET_ENCODER = 19,
|
|
93
|
+
PRESET_ENCODER_DUAL = 20,
|
|
94
|
+
WRITE_DIRECT = 80,
|
|
95
|
+
WRITE_DIRECT_MODE_DATA = 81
|
|
96
|
+
}
|
|
97
|
+
export declare enum PortInformationType {
|
|
98
|
+
PORT_VALUE = 0,
|
|
99
|
+
MODE_INFO = 1,
|
|
100
|
+
POSSIBLE_MODE_COMBINATIONS = 2
|
|
101
|
+
}
|
|
102
|
+
export declare enum ModeInformationType {
|
|
103
|
+
NAME = 0,
|
|
104
|
+
RAW = 1,
|
|
105
|
+
PCT = 2,
|
|
106
|
+
SI = 3,
|
|
107
|
+
SYMBOL = 4,
|
|
108
|
+
MAPPING = 5,
|
|
109
|
+
MOTOR_BIAS = 7,
|
|
110
|
+
CAPABILITY_BITS = 8,
|
|
111
|
+
VALUE_FORMAT = 128
|
|
112
|
+
}
|
|
113
|
+
export declare enum ErrorCode {
|
|
114
|
+
ACK = 1,
|
|
115
|
+
MACK = 2,
|
|
116
|
+
BUFFER_OVERFLOW = 3,
|
|
117
|
+
TIMEOUT = 4,
|
|
118
|
+
COMMAND_NOT_RECOGNIZED = 5,
|
|
119
|
+
INVALID_USE = 6,
|
|
120
|
+
OVERCURRENT = 7,
|
|
121
|
+
INTERNAL_ERROR = 8
|
|
122
|
+
}
|
|
123
|
+
export interface HubPropertyMessage {
|
|
124
|
+
type: MessageType.HUB_PROPERTIES;
|
|
125
|
+
property: HubProperty;
|
|
126
|
+
operation: HubPropertyOperation;
|
|
127
|
+
payload: Buffer;
|
|
128
|
+
}
|
|
129
|
+
export interface HubActionMessage {
|
|
130
|
+
type: MessageType.HUB_ACTIONS;
|
|
131
|
+
action: HubAction;
|
|
132
|
+
}
|
|
133
|
+
export interface HubAlertMessage {
|
|
134
|
+
type: MessageType.HUB_ALERTS;
|
|
135
|
+
alertType: AlertType;
|
|
136
|
+
operation: AlertOperation;
|
|
137
|
+
payload: number;
|
|
138
|
+
}
|
|
139
|
+
export interface AttachedIOMessage {
|
|
140
|
+
type: MessageType.HUB_ATTACHED_IO;
|
|
141
|
+
portId: number;
|
|
142
|
+
event: PortEvent;
|
|
143
|
+
deviceType: DeviceType;
|
|
144
|
+
hardwareRevision?: string;
|
|
145
|
+
softwareRevision?: string;
|
|
146
|
+
portIdA?: number;
|
|
147
|
+
portIdB?: number;
|
|
148
|
+
}
|
|
149
|
+
export interface GenericErrorMessage {
|
|
150
|
+
type: MessageType.GENERIC_ERROR_MESSAGES;
|
|
151
|
+
commandType: number;
|
|
152
|
+
errorCode: ErrorCode;
|
|
153
|
+
}
|
|
154
|
+
export interface PortInformationMessage {
|
|
155
|
+
type: MessageType.PORT_INFORMATION;
|
|
156
|
+
portId: number;
|
|
157
|
+
informationType: PortInformationType;
|
|
158
|
+
capabilities?: number;
|
|
159
|
+
modeCount?: number;
|
|
160
|
+
inputModes?: number;
|
|
161
|
+
outputModes?: number;
|
|
162
|
+
modeCombinations?: number[];
|
|
163
|
+
}
|
|
164
|
+
export interface PortModeInformationMessage {
|
|
165
|
+
type: MessageType.PORT_MODE_INFORMATION;
|
|
166
|
+
portId: number;
|
|
167
|
+
mode: number;
|
|
168
|
+
informationType: ModeInformationType;
|
|
169
|
+
name?: string;
|
|
170
|
+
rawRange?: {
|
|
171
|
+
min: number;
|
|
172
|
+
max: number;
|
|
173
|
+
};
|
|
174
|
+
pctRange?: {
|
|
175
|
+
min: number;
|
|
176
|
+
max: number;
|
|
177
|
+
};
|
|
178
|
+
siRange?: {
|
|
179
|
+
min: number;
|
|
180
|
+
max: number;
|
|
181
|
+
};
|
|
182
|
+
symbol?: string;
|
|
183
|
+
mapping?: number;
|
|
184
|
+
motorBias?: number;
|
|
185
|
+
capabilityBits?: Buffer;
|
|
186
|
+
valueFormat?: {
|
|
187
|
+
datasetCount: number;
|
|
188
|
+
datasetType: number;
|
|
189
|
+
figures: number;
|
|
190
|
+
decimals: number;
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
export interface PortValueSingleMessage {
|
|
194
|
+
type: MessageType.PORT_VALUE_SINGLE;
|
|
195
|
+
portId: number;
|
|
196
|
+
value: Buffer;
|
|
197
|
+
}
|
|
198
|
+
export interface PortValueCombinedMessage {
|
|
199
|
+
type: MessageType.PORT_VALUE_COMBINEDMODE;
|
|
200
|
+
portId: number;
|
|
201
|
+
modeDatasets: number;
|
|
202
|
+
values: Buffer;
|
|
203
|
+
}
|
|
204
|
+
export interface PortInputFormatSingleMessage {
|
|
205
|
+
type: MessageType.PORT_INPUT_FORMAT_SINGLE;
|
|
206
|
+
portId: number;
|
|
207
|
+
mode: number;
|
|
208
|
+
deltaInterval: number;
|
|
209
|
+
notificationEnabled: boolean;
|
|
210
|
+
}
|
|
211
|
+
export interface PortInputFormatCombinedMessage {
|
|
212
|
+
type: MessageType.PORT_INPUT_FORMAT_COMBINEDMODE;
|
|
213
|
+
portId: number;
|
|
214
|
+
combinedControl: number;
|
|
215
|
+
modeDatasetPointer: number;
|
|
216
|
+
}
|
|
217
|
+
export interface PortOutputFeedbackMessage {
|
|
218
|
+
type: MessageType.PORT_OUTPUT_COMMAND_FEEDBACK;
|
|
219
|
+
portId: number;
|
|
220
|
+
feedback: number;
|
|
221
|
+
}
|
|
222
|
+
export type DecodedMessage = HubPropertyMessage | HubActionMessage | HubAlertMessage | AttachedIOMessage | GenericErrorMessage | PortInformationMessage | PortModeInformationMessage | PortValueSingleMessage | PortValueCombinedMessage | PortInputFormatSingleMessage | PortInputFormatCombinedMessage | PortOutputFeedbackMessage;
|
|
223
|
+
/**
|
|
224
|
+
* Decode the message length from raw bytes
|
|
225
|
+
* Messages longer than 127 bytes use two-byte length encoding
|
|
226
|
+
*/
|
|
227
|
+
export declare function decodeMessageLength(data: Buffer): {
|
|
228
|
+
length: number;
|
|
229
|
+
headerSize: number;
|
|
230
|
+
};
|
|
231
|
+
/**
|
|
232
|
+
* Encode message length as header bytes
|
|
233
|
+
*/
|
|
234
|
+
export declare function encodeMessageLength(length: number): Buffer;
|
|
235
|
+
/**
|
|
236
|
+
* Decode a version number from 4 bytes (BCD encoded)
|
|
237
|
+
*/
|
|
238
|
+
export declare function decodeVersion(data: Buffer, offset?: number): string;
|
|
239
|
+
/**
|
|
240
|
+
* Decode a MAC address from 6 bytes
|
|
241
|
+
*/
|
|
242
|
+
export declare function decodeMACAddress(data: Buffer, offset?: number): string;
|
|
243
|
+
/**
|
|
244
|
+
* Decode a complete LWP3 message
|
|
245
|
+
*/
|
|
246
|
+
export declare function decodeMessage(data: Buffer): DecodedMessage | null;
|
|
247
|
+
/**
|
|
248
|
+
* Wrap payload with LWP3 message header
|
|
249
|
+
*/
|
|
250
|
+
export declare function encodeMessage(messageType: MessageType, payload: Buffer): Buffer;
|
|
251
|
+
/**
|
|
252
|
+
* Create hub property request message
|
|
253
|
+
*/
|
|
254
|
+
export declare function createHubPropertyRequest(property: HubProperty, operation: HubPropertyOperation): Buffer;
|
|
255
|
+
/**
|
|
256
|
+
* Create hub property set message (for writable properties)
|
|
257
|
+
*/
|
|
258
|
+
export declare function createHubPropertySet(property: HubProperty, value: Buffer): Buffer;
|
|
259
|
+
/**
|
|
260
|
+
* Create hub action message
|
|
261
|
+
*/
|
|
262
|
+
export declare function createHubAction(action: HubAction): Buffer;
|
|
263
|
+
/**
|
|
264
|
+
* Create alert subscription message
|
|
265
|
+
*/
|
|
266
|
+
export declare function createAlertSubscription(alertType: AlertType, enable: boolean): Buffer;
|
|
267
|
+
/**
|
|
268
|
+
* Create port information request message
|
|
269
|
+
*/
|
|
270
|
+
export declare function createPortInformationRequest(portId: number, informationType: PortInformationType): Buffer;
|
|
271
|
+
/**
|
|
272
|
+
* Create port mode information request message
|
|
273
|
+
*/
|
|
274
|
+
export declare function createPortModeInformationRequest(portId: number, mode: number, infoType: ModeInformationType): Buffer;
|
|
275
|
+
/**
|
|
276
|
+
* Create port input format setup (subscribe/unsubscribe to notifications)
|
|
277
|
+
*/
|
|
278
|
+
export declare function createPortInputFormatSetup(portId: number, mode: number, deltaInterval: number, notificationEnabled: boolean): Buffer;
|
|
279
|
+
/**
|
|
280
|
+
* Create virtual port setup message (connect/disconnect)
|
|
281
|
+
*/
|
|
282
|
+
export declare function createVirtualPortSetup(connect: boolean, portIdA: number, portIdB?: number, virtualPortId?: number): Buffer;
|
|
283
|
+
/**
|
|
284
|
+
* Set motor power (unregulated)
|
|
285
|
+
*/
|
|
286
|
+
export declare function createStartPower(portId: number, power: number): Buffer;
|
|
287
|
+
/**
|
|
288
|
+
* Set motor power for dual motors (virtual port)
|
|
289
|
+
*/
|
|
290
|
+
export declare function createStartPowerDual(portId: number, power1: number, power2: number): Buffer;
|
|
291
|
+
/**
|
|
292
|
+
* Set motor speed (regulated)
|
|
293
|
+
*/
|
|
294
|
+
export declare function createStartSpeed(portId: number, speed: number, maxPower?: number, useProfile?: Profile): Buffer;
|
|
295
|
+
/**
|
|
296
|
+
* Set motor speed for dual motors (virtual port)
|
|
297
|
+
*/
|
|
298
|
+
export declare function createStartSpeedDual(portId: number, speed1: number, speed2: number, maxPower?: number, useProfile?: Profile): Buffer;
|
|
299
|
+
/**
|
|
300
|
+
* Run motor for a specified time
|
|
301
|
+
*/
|
|
302
|
+
export declare function createStartSpeedForTime(portId: number, time: number, speed: number, maxPower?: number, endState?: BrakingStyle, useProfile?: Profile): Buffer;
|
|
303
|
+
/**
|
|
304
|
+
* Run motor for a specified number of degrees
|
|
305
|
+
*/
|
|
306
|
+
export declare function createStartSpeedForDegrees(portId: number, degrees: number, speed: number, maxPower?: number, endState?: BrakingStyle, useProfile?: Profile): Buffer;
|
|
307
|
+
/**
|
|
308
|
+
* Go to absolute position
|
|
309
|
+
*/
|
|
310
|
+
export declare function createGotoAbsolutePosition(portId: number, position: number, speed: number, maxPower?: number, endState?: BrakingStyle, useProfile?: Profile): Buffer;
|
|
311
|
+
/**
|
|
312
|
+
* Preset (reset) encoder position
|
|
313
|
+
*/
|
|
314
|
+
export declare function createPresetEncoder(portId: number, position?: number): Buffer;
|
|
315
|
+
/**
|
|
316
|
+
* Set acceleration time
|
|
317
|
+
*/
|
|
318
|
+
export declare function createSetAccTime(portId: number, time: number, profileNumber?: number): Buffer;
|
|
319
|
+
/**
|
|
320
|
+
* Set deceleration time
|
|
321
|
+
*/
|
|
322
|
+
export declare function createSetDecTime(portId: number, time: number, profileNumber?: number): Buffer;
|
|
323
|
+
/**
|
|
324
|
+
* Set LED color by color number
|
|
325
|
+
*/
|
|
326
|
+
export declare function createSetLEDColor(portId: number, color: Color): Buffer;
|
|
327
|
+
/**
|
|
328
|
+
* Set LED color by RGB values
|
|
329
|
+
*/
|
|
330
|
+
export declare function createSetLEDRGB(portId: number, red: number, green: number, blue: number): Buffer;
|
|
331
|
+
/**
|
|
332
|
+
* Parse motor feedback flags
|
|
333
|
+
*/
|
|
334
|
+
export declare function parseMotorFeedback(feedback: number): MotorFeedback & {
|
|
335
|
+
portId: number;
|
|
336
|
+
};
|
|
337
|
+
/**
|
|
338
|
+
* Convert hub property payload to typed value
|
|
339
|
+
*/
|
|
340
|
+
export declare function parseHubPropertyValue(property: HubProperty, payload: Buffer): unknown;
|