chris_taglia | 11 May 2012 19:44

Adding commands to NSH

 

Hello,

I am trying to make an application that uses NSH to communicate with a running process. The idea is to include apps/nshlib, but to use my own start-up code so that the main process (a PID controller) starts up in the background.
The idea is to have the process run at startup and add various commands to change the control of the background process.

Does anyone have a suggestion on the best way to do this?

Right now I see my options as either cloning the nsh_console and parsing my new commands in nsh_parse, or creating a number of named applications and passing command line arguments. Both of those seem like inefficient approaches.

I'm still new to embedded systems and slowly learning Nuttx. I'm guessing there's a more straight-forward way that I'm missing.

I appreciate any suggestions.

-Chris

__._,_.___
Recent Activity:
    .

    __,_._,___
    Gregory N | 11 May 2012 20:38
    Picon
    Favicon
    Gravatar

    Re: Adding commands to NSH

     

    > I am trying to make an application that uses NSH to communicate with a running process. The idea is to include apps/nshlib, but to use my own start-up code so that the main process (a PID controller) starts up in the background.
    > The idea is to have the process run at startup and add various commands to change the control of the background process.
    >
    > Does anyone have a suggestion on the best way to do this?
    >
    > Right now I see my options as either cloning the nsh_console and parsing my new commands in nsh_parse, or creating a number of named applications and passing command line arguments. Both of those seem like inefficient approaches.
    >
    > I'm still new to embedded systems and slowly learning Nuttx. I'm guessing there's a more straight-forward way that I'm missing.

    Hi, Chris,

    I just uploaded a document here: http://tech.groups.yahoo.com/group/nuttx/files/ called nuttx-overview.doc. Section 4 of the document discusses all known ways to modify NSH behavior.

    As you say, you can add new commands or you can add new applications. But it sounds like you have something else in mind. Maybe if you describe more of the properties of the solution that you are looking for, I can help you more.

    Greg

    __._,_.___
    Recent Activity:
    .

    __,_._,___
    chris_taglia | 11 May 2012 22:47

    Re: Adding commands to NSH

     

    Greg,
    Thanks much!
    nuttx-overview.doc explains this perfectly. What I was looking for is described in section 4.4.1: Adding New NSH Commands.

    What I plan on doing is using apps/nshlib/nsh_parse.c, adding my commands to the g_cmdmap[] table, and including the necessary header files for my app.

    -Chris

    --- In nuttx-hHKSG33TihhbjbujkaE4pw@public.gmane.org, "Gregory N" <spudarnia <at> ...> wrote:
    >
    > > I am trying to make an application that uses NSH to communicate with a running process. The idea is to include apps/nshlib, but to use my own start-up code so that the main process (a PID controller) starts up in the background.
    > > The idea is to have the process run at startup and add various commands to change the control of the background process.
    > >
    > > Does anyone have a suggestion on the best way to do this?
    > >
    > > Right now I see my options as either cloning the nsh_console and parsing my new commands in nsh_parse, or creating a number of named applications and passing command line arguments. Both of those seem like inefficient approaches.
    > >
    > > I'm still new to embedded systems and slowly learning Nuttx. I'm guessing there's a more straight-forward way that I'm missing.
    >
    > Hi, Chris,
    >
    > I just uploaded a document here: http://tech.groups.yahoo.com/group/nuttx/files/ called nuttx-overview.doc. Section 4 of the document discusses all known ways to modify NSH behavior.
    >
    > As you say, you can add new commands or you can add new applications. But it sounds like you have something else in mind. Maybe if you describe more of the properties of the solution that you are looking for, I can help you more.
    >
    > Greg
    >

    __._,_.___
    Recent Activity:
    .

    __,_._,___

    Gmane