kmilo17pet/QuarkTS

qATCLI minor optimization

kmilo17pet opened this issue · 2 comments

if ( strstr( cmd, Command->Text ) == cmd ) { /*check if the input match the subscribed command starting from the beginning*/ /*TODO : potentially unsafe, find a better way*/

Replace
if ( strstr( cmd, Command->Text ) == cmd )

with

if ( 0 == strncmp( cmd, Command->Text, Command->qPrivate.CmdLen ) )

This will improve speed and it will also be safe.

need to be tested on real scenarios

ATCLI is tested in stm32f411, it works correctly with of command type test, para, read y act.

view attachment image.

realScenarioAtcliInStm32f411

ready on 7e45572