You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by Amr Bekhit <am...@gmail.com> on 2018/06/12 12:08:10 UTC

Changing modules in the shell

Hello all,

Quick intro - I've recently started using mynewt and hoping to use it
primarily for the Bluetooth and LoraWAN functionality. I quite like the
package and syscfg system in mynewt, I think it's very flexible and I look
forward to seeing the project grow. I've managed to make a small
contribution (
https://github.com/apache/mynewt-core/pull/1180#pullrequestreview-127505931)
and hope to get involved more.

I have a question regarding shell modules (mynewt master - cloned 2018/06).
I've created a new shell module and registered it using shell_register,
then set it as the default module using shell_register_default_module. The
module works fine and I can access the commands no problem. I can use the
select command to to change modules as described in the documentation (
https://mynewt.apache.org/latest/os/modules/shell/shell/), but the
documentation also states the following:

"To run a command in the shell, you enter the module name and the command
name."

I can't seem to get this to work - if the compat module is currently set,
and I have a module "gpio" with a command "set", I can't seem to run "gpio
set" from within the compat module.

Amr

Re: Changing modules in the shell

Posted by Szymon Janc <sz...@codecoup.pl>.
Hi Amr,

On Wednesday, 13 June 2018 08:55:11 CEST Amr Bekhit wrote:
> After playing around some more, it appears that this only works when you
> are in the base "shell" module, but not from other sub-modules.

Yes, I think that was the intention that it works from top menu when no 
subshell is selected. Maybe we should update docs to clarify that..

> 
> On Tue, 12 Jun 2018 at 15:08, Amr Bekhit <am...@gmail.com> wrote:
> > Hello all,
> > 
> > Quick intro - I've recently started using mynewt and hoping to use it
> > primarily for the Bluetooth and LoraWAN functionality. I quite like the
> > package and syscfg system in mynewt, I think it's very flexible and I look
> > forward to seeing the project grow. I've managed to make a small
> > contribution (
> > https://github.com/apache/mynewt-core/pull/1180#pullrequestreview-12750593
> > 1) and hope to get involved more.
> > 
> > I have a question regarding shell modules (mynewt master - cloned
> > 2018/06). I've created a new shell module and registered it using
> > shell_register, then set it as the default module
> > using shell_register_default_module. The module works fine and I can
> > access
> > the commands no problem. I can use the select command to to change modules
> > as described in the documentation (
> > https://mynewt.apache.org/latest/os/modules/shell/shell/), but the
> > documentation also states the following:
> > 
> > "To run a command in the shell, you enter the module name and the command
> > name."
> > 
> > I can't seem to get this to work - if the compat module is currently set,
> > and I have a module "gpio" with a command "set", I can't seem to run "gpio
> > set" from within the compat module.
> > 
> > Amr


-- 
pozdrawiam
Szymon Janc



Re: Changing modules in the shell

Posted by Amr Bekhit <am...@gmail.com>.
After playing around some more, it appears that this only works when you
are in the base "shell" module, but not from other sub-modules.

On Tue, 12 Jun 2018 at 15:08, Amr Bekhit <am...@gmail.com> wrote:

> Hello all,
>
> Quick intro - I've recently started using mynewt and hoping to use it
> primarily for the Bluetooth and LoraWAN functionality. I quite like the
> package and syscfg system in mynewt, I think it's very flexible and I look
> forward to seeing the project grow. I've managed to make a small
> contribution (
> https://github.com/apache/mynewt-core/pull/1180#pullrequestreview-127505931)
> and hope to get involved more.
>
> I have a question regarding shell modules (mynewt master - cloned
> 2018/06). I've created a new shell module and registered it using
> shell_register, then set it as the default module
> using shell_register_default_module. The module works fine and I can access
> the commands no problem. I can use the select command to to change modules
> as described in the documentation (
> https://mynewt.apache.org/latest/os/modules/shell/shell/), but the
> documentation also states the following:
>
> "To run a command in the shell, you enter the module name and the command
> name."
>
> I can't seem to get this to work - if the compat module is currently set,
> and I have a module "gpio" with a command "set", I can't seem to run "gpio
> set" from within the compat module.
>
> Amr
>