While sphinx-build messages are captured to a file (and tee'd to
stdout), messages from doxygen weren't captured to the file and so were
missed as an error that needed fixing. (You can see the message if you
run 'make htmldocs' locally and in shippable script output, but the
message filtering tool that throws an error if unexpected messages
appear, didn't get to see those. This fixes that.
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
It's much more intuitive to read "if (module)" instead of
"if (module != -1)" when checking for a valid module. Update the code
to use struct shell_module pointers instead of integers for tracking
modules.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Make the internal commands (exit, select & help) as any other
commands, so that e.g. "help help" works as expected. Also redesign
the way commands are looked up to avoid duplicate lookups.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The print_cmd_unknown() is just a two-liner and only called from a
single place, so just do the printk calls inline.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The code was completely broken wrt command lookups when the command is
given in the format "<module> <cmd> <args...>". It would only work if
the default module is not set, which is almost never the case (as most
apps set it explicitly).
Refactor the command handling by moving more logic up to shell_exec(),
so that get_cb() does a lookup for a single module
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The way get_command_and_module() is used it's impossible for it to be
given an argv where argv[0] is NULL.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The way the command line parsing works, argv[0] is always guaranteed
to be non-NULL as well as a non-empty string, so doing checks for this
in get_cb() is redundant.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
All code paths in shell_exec() are guaranteed to set err before
returning it, so doing this (rather curious) initialization is
completely unnecessary.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Added a case for ARC in the test so it builds. ARC MPU has execute
permision bit so we can enable the NO_EXECUTE_SUPPORT testing.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Copy/paste error was checking minimum measurements where it
should have been checking maximum measurements.
Signed-off-by: Michael Scott <michael.scott@linaro.org>
Initial values for the min/max measurements were 0 and this caused
issues with sensors maximums that weren't above 0 and minimums that
went below 0. Let's update those to MAX_INT so the first sensor
value update will set those to correct values.
When resetting the measured values, let's use the current sensor
value not 0.
Signed-off-by: Michael Scott <michael.scott@linaro.org>
10 seconds is quite long for configuration messages, and way too much
currently since we only talk through the local networking interface.
Set the default timeout to 2 seconds, and provide APIs through which
the timeout may be changed at run-time (mainly useful for the shell).
Note: The timeout_set() API is normally assumed to be called just once
for an application, based on the expected size of the network (hops &
latency). Trying to change it e.g. in a multi-threaded environment for
every message may not yield the expected results.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Convert the hb-ub-set command to a more generic hb-sub that can be
used both for getting and setting the Heartrate Subscription State.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Convert the hb-pub-set command to a more generic hb-pub that can be
used both for getting and setting the Heartrate Publication State.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Avoid having to go do "init" for the bt module before issuing "init"
for the mesh module. Instead perform Bluetooth init implicitly. The
bt_enable() API will cleanly fail with -EALREADY if it was previously
called.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
If the app does direct provisioning, it may still want to do common
handling through its provisioning complete callback (if it has one
registered). This also means that we always require a non-NULL
provisioning context provided to bt_enable(), and that it needs to
fail if NULL was given.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
It may be useful for the app to know what the initial NetKeyIndex that
it was given during provisioning is.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This is in anticipation of soon adding health client support, which
could then cause confusion due to the ambiguous API names.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Now that there's support for configuration client as well, rename cfg
to cfg_srv to avoid any confusion.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Some of the provisoning routines, such as node reset assume that we
have a valid bt_mesh_prov pointer.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Add the ability to track the provisioning bearer through an extra
parameter to link_open/close. Also introduce new public functions to
enable/disable specific provisioning bearers. This also means that one
now needs to explicitly enable provisioning bearers after calling
bt_mesh_init().
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The original fragment chain of incoming packet will be lost and leaked
in case of early error, add frag back to packet and
let the caller do unref.
Fixes#4323
Signed-off-by: june li <junelizh@foxmail.com>
No need to do any IPv6 neighbor checks if the packet is routed back
to us by loopback driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Instead of passing net_pkt as is to the receiving side of the
interface, clone the sent packet and drop the sent one.
This is needed mainly in TCP where passing the same packet from
sending to receiving side is causing havoc.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If there is loopback interface, then let it handle all local
traffic. Loopback interface is only needed for test applications.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The command name and a shortened form of valid parameters is not
necessarily enough to understand its usage. Add the option of
providing a more lengthy description of the command usage.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>