Problem with commands that uses Command.KEY_ENABLE

GPS4PETS16 days ago

Hi

i have a problem with commands in watch protocol using Command.KEY_ENABLE.
When the KEY is enabled/active the Command is send and the value is translated to "1"
When the KEY is disabled/inactive i only get the message in log that the command is send but dont see the command in the logs.

When i delete the row:

case Command.KEY_ENABLE-> (Boolean) value ? "1" : "0";

in the formatValue function in the WatchProtocolEncoder i have this behavior:

KEY enabled: the value is "true" in the command
KEY disabled: the value is empty in the command

Anton Tananaev16 days ago

How are you sending the command? Which specific command?

GPS4PETS16 days ago

just found out that all is functioning when you enable and than disable the active checkbox for the command.

GPS4PETS16 days ago

this is the WatchProtocolEncoder part

case Command.TYPE_STATUS_LED:
                return formatTextCommand(channel, command, "LEDSET,%s", Command.KEY_ENABLE);

and this is the formatValue part in the WatchProtocolEncoder

case Command.KEY_ENABLE-> (Boolean) value ? "1" : "0";
Anton Tananaev16 days ago

There's no such command in Traccar.

GPS4PETS16 days ago

this is a command i added, but you can use any other command which uses the Command.KEY_ENABLE in Watch protocol

It is a bug on the website.
if you enable and then disable the active checkbock for those command all is working.
But only choosing the command and click on send will result in an uncomplete command

Anton Tananaev16 days ago
GPS4PETS16 days ago

great thank you very much
that fixed this problem