Lego
Lego copied to clipboard
SetCombinedInputMode does not work
awesome work 👍
primaryBoom.SetSingleInputMode(Motor.INPUT_MODE__SPEED);
works.
primaryBoom.Speed
is updated. However, speed and position are not updated when SetCombinedInputMode(0)
is called.
I think there is an issue. The Lego BLE docs say, that the message for setting the device to combined input mode is 5 or 7 byte long. However, when I print the message, it is 9 bytes long. Maybe that helps. link to ble docs
This is the message Body of the set combined input message: 0x00 Port ID 0x01 Subcommand SetModeDataSet 0x00 CombinationIndex 0x10 ? 0x20 ? 0x30 ?
@Vouzamo Found the problem. As explained here: bricknil and here lego ble docs it is necessary to send an unlock message, too.
Maybe, it is enough to insert
SendMessage(new PortInputFormatSetupCombinedMessage(Port, PortInputFormatSetupSubCommands.Unlock_And_Start_With_Multi_Update_Enabled));
after this line https://github.com/Vouzamo/Lego/blob/44695a10824e51c0ecf42b6dcf1aff6eb300445e/src/Lego/Lego.Core/Models/Device.cs#L172
Well I reopen that, so if someone wants to fix it. Can't do it, as I don't want to setup the project.
Probably those two things might enable combinedMode updates: