smartcitizen-kit-21
smartcitizen-kit-21 copied to clipboard
Control commands don't parse correctly
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
This is a general issue with the parsing strings in the command line now (not just control commands)