smartcitizen-kit-21 icon indicating copy to clipboard operation
smartcitizen-kit-21 copied to clipboard

Control commands don't parse correctly

Open oscgonfer opened this issue 3 months ago • 0 comments

Control commands for sensors don't parse correctly when there are more than two words on the command:

This works:

SCK > control sen5x
SEN5X PM 1.0: 
Available commands:
* debug: [0-1] Sets debug messages
* doclean: Starts a cleaning
* lastClean
* info

Or:

SCK > control sen5x debug
SEN5X PM 1.0: debug
Debug: false

But this doesn't:

control sen5x debug 1
SEN5X PM 1.0: 1
Sensor not recognized, or no control interface available for this sensor

Culprit is the function sensorNameEndsIn, that doesn't work for more than two commands, and seems to return the wrong index for the command to be cleaned at.

IMPORTANT, when testing, it's important to check https://github.com/fablabbcn/smartcitizen-kit-2x/issues/60

oscgonfer avatar Nov 20 '24 18:11 oscgonfer