Skip to content

Control commands don't parse correctly #79

@oscgonfer

Description

@oscgonfer

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 #60

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions