LEGO / lego-ble-wireless-protocol-docs

This repository contains information about LEGO Hubs (name, battery level, etc.) and to interact with any sensors and motors connected to it.
https://lego.github.io/lego-ble-wireless-protocol-docs
MIT License
340 stars 43 forks source link

StartPower(Power1, Power2) command type #15

Open laurentchar opened 4 years ago

laurentchar commented 4 years ago

Hello,

The StartPower(Power1, Power2) function (Output Command 0x81 - Sub Command 0x02) is stated as using the "WriteDirectDataMode" (0x81, 0x51, mode undefined?). I believe it is a error/typo since no mode is defined for the WriteDirectDataMode command and mode=0x02 is already used by PresetEncoder(Position).

It should most likely use the normal "Port Output Command" (0x81, 0x02).

Best Regards, Laurent

tthiery commented 4 years ago

I can confirm this. by treating the command not a WriteDirectDataMode but instead as a SubCommand 0x02 (and I guess therefore addressing the Hub and not the port), the method StartPower(power1, power2) start to work as expected. Lost some 30mins because of that.