Using MegunoLink command interface ontop of exiting CLI

Support forum for MegunoLink
Post Reply
strud
Posts: 20
Joined: Sat Nov 18, 2023 6:51 am

Sat Nov 18, 2023 10:29 pm

I have a well developed project that has a CLI implemented with my own extensive set of commands and responses etc.

However I would very much like to leverage the fantastic set of tools and visualisers etc from MegunoLink.

My initial thought is to make up a filter that detects if the message format is one for MegunoLink and passes this onto the appropriate handler/stream whilst letting all others go through to my CLI.

Is this something others have done?

My project is running on a Teensy4.1 so I have plenty of resources available to do such an implementation.
strud
Posts: 20
Joined: Sat Nov 18, 2023 6:51 am

Sat Nov 18, 2023 10:53 pm

From the UDP command handling example:

Code: Select all

 if (Length >0 && ReceiveBuffer[0] == '!')
    { 
      TruncateAtNewLine(ReceiveBuffer);
      Commands.DispatchCommand(ReceiveBuffer + 1, UdpConnection);
    }
So it looks like the sort of thing I can implement in my CLI statemachine ie if message is prefixed with a '!' then invoke the DispatchCommand function as above.
Post Reply