Zephyr shell: Need to implement commands start with ":" prefix

nRF54L15 - NCS 3.02 - Toolchain 3.02

I'm exploring using the Zephyr Shell to replace my old legacy CLI interpreter which hooks onto a uart callback. I can set up custom commands but have hit a snag:

My legacy command line uses a prefix e.g. ":Cxxxx" where ":" is a command prefix, "C" is a command and "xxxx" the argument. But it looks like Zephyr won't accept the colon ":" character prefix.

Is there any way around this? I'm quite happy just setting up the one command, then parsing everything later with my own code, but it seems I've hit on the one character that's disallowed.

Parents
  • Hi,

    Zephyr doesn't allow or support commands with symbols like " : ". It only accepts normal letters/numbers. I can suggest a few solutions. 

    1) You might want to try to change from :Cxxxx to cmd Cxxxx or c Cxxxx.

    2) Try using "bypass mode" which basically tells Zephyr to temporarily stop interpreting commands and send all UART characters to your own parser. You get to keep your format of :Cxxxx. Zephyr provides shell_set_bypass() for this. By using standard shell command like legacy on / legacy off, you can enter/exit this mode. 

    Best Regards,

    Samruddhi

Reply
  • Hi,

    Zephyr doesn't allow or support commands with symbols like " : ". It only accepts normal letters/numbers. I can suggest a few solutions. 

    1) You might want to try to change from :Cxxxx to cmd Cxxxx or c Cxxxx.

    2) Try using "bypass mode" which basically tells Zephyr to temporarily stop interpreting commands and send all UART characters to your own parser. You get to keep your format of :Cxxxx. Zephyr provides shell_set_bypass() for this. By using standard shell command like legacy on / legacy off, you can enter/exit this mode. 

    Best Regards,

    Samruddhi

Children
Related