This change is in preparation to [PR 10788]. PR 10788 will make the
shell exitable which may lead to unexpected behavior in comparison to
previous usage of the shell.
To prevent this, this PR introduces two "new" functions to the shell's
API: `shell_run_once()` and `shell_run_forever()`.
`shell_run_once()` basically has the same behavior as `shell_run()` in
current master: Start a shell and continue reading lines until EOF is
reached.
`shell_run_forever()` wraps around `shell_run_once()` and restarts the
shell if it exits.
`shell_run()` is re-introduced as a back-porting alias for
`shell_run_forever()`.
As a consequence all current calls to `shell_run()` won't exit even
with [PR 10788] merged (which would add EOT as additional exit
condition for `shell_run_once()`).
[PR 10788]: https://github.com/RIOT-OS/RIOT/pull/10788
Replaces the special heap command approach of the lpc_common module with a more general heap command approach. Module lpc_common was already removed with PR #2118. PR #2118 integrated cpu/lpc_common code in cpu/lpc2387. With PR #3530 special heap handling for cpu/lpc2387 was replaced by newlib memory management which uses _sbrk_r to allocate chunks from the heap. _sbrk_r uses _sheap and _eheap symbols that are defined in lpc2387.ld and can be used together with mallinfo function for heap statistics.
CTRL-C cancels the current line, similar to how getty works.
This is useful if one is using a dumb terminal to communicate with
a node, as it saves having to repeatedly type backspace to discard the
current line. It also helps when connecting to an already running node,
as one does not know what is on the line buffer, the safest thing to do
is to begin by sending a ctrl-C.
This is a suggestion of @benemorius.
- Add SEMTECH_LORAMAC_ALREADY_JOINED ret code for semtech_loramac_join
- Add SEMTECH_LORAMAC_TX_CNF_FAILED ret code for semtech_loramac_send
- Update shell commands to notify when no ACK is received on cnf tx
Add a trivial shell program that scans for all slaves on an I2C bus by iterating
all of the possible 127 I2C addresses and checking for the ACK of the device.
I was looking for a quick way to gauge the link quality between two nodes,
so I added the rssi to the output of the ping6 command.
Maybe this is generally useful to have.
Loosely based on [the original ping] and [netutil]'s ping
New features (compared to old RIOT version):
- non-positional parameters
- Better duplicate detection (addresses #9387)
- Better asynchronous behavior
- Potential for future move to `sock_ip`
- (Optional) DNS-support
- Multithreading-safe (in case shell-command handler gets called
from multiple threads)
[the original ping]: http://ftp.arl.army.mil/~mike/ping.html
[netutil]: https://www.gnu.org/software/inetutils/
When IPv6 is enabled, the MTU is given. So users(*) sending IPv6 packets can
easily figure out what the supported maximum protocol unit is.
However, when IPv6 is disabled and a user wants to send layer 2 frames directly,
no information about the maximum PDU is available using the shell.
When 6LoWPAN is used, a user may be interested in the layer 2 PDU as well in
order to avoid layer 2 fragmentation.
This PR adds the L2-PDU info to the output of the ifconfig shell command, which
is printed regardless of the use of IPv6.
(*): Here "users" refers to human beings interacting with the shell.
Applications can get the maximum PDU of each layer more easily using
gnrc_netapi_get() with NETOPT_MAX_PACKET_SIZE instead of using a shell command.
Currently an interface's existence is not checked when it is supplied
by the user with the `nib` command. This can lead to assertion errors
as soon as the generated entry tries to resolve an address or route
generated with that command and the network interface not being found.
When using a serial terminal without local echo, the current line
would not get updated as the user typed because the shell module's
readline() was not flushing each character.
This commit fixes that behavior. For additional clarity, fflush is
turned into a macro (flush_if_needed) which expands to either a call
to fflush() or empty, according to the standard library used.
This also fixes the erase/line editing behavior (the delete characters
were not being flushed either.)
sc_rtc.c should only be compiled if periph_rtc module is actually used.
In practice there was not linking error when PERIPH_OPTIONAL|_REQUIRED
was not set as shell_commands hides calling the functions with
'#ifdef MODULE_PERIPH_RTC'.
In RIOT native, sending CTRL+D to a shell started using shell_run would resulted in and
endless prompt loop. I've been unable to trigger such a behaviour
on actual hardware using a UART connection, but calling `pm_off` seemed
like a better alternative than having an `#ifdef BOARD_NATIVE`.
Fixes#9946
This updates the ccn-lite package version which brings in the
latest upstream fixes for some compiler issues found on macOS
with clang and newer GCC versions.
A minor adaption of the RIOT shell commands is also included.
When compiled for `hifive1` board with `gcc-7.2.0` this warning was raised:
'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]
- Use RIOT's GPIO interface to access the sensor to increase portability
- Changed API to allow more than one sensor per board
- Added `sht1x_params.h` that specifies how the sensors is connected - each
board can overwrite default settings by #defining SHT1X_PARAM_CLK and
SHT1X_PARAM_DATA
- Changed arithmetic to use integer calculations only instead of floating point
arithmetic
- Added support for checking the CRC sum
- Allow optional skipping of the CRC check to speed up measuring
- Added support for advanced features like reducing the resolution and skipping
calibration to speed up measuring
- Allow specifying the supply voltage of sensor which heavily influences the
temperature result (and use that information to calculate the correct
temperature)
- Reset sensor on initialization to bring it in a well known state
- Support for the obscure heater feature. (Can be useful to check the
temperature sensor?)
- Updated old SHT11 shell commands to the new driver interface, thus allowing
more than one SHT10/11/15 sensor to be used
- Added new shell command to allow full configuration of all attached SHT1x
sensors
- Removed old command for setting the SHT11 temperature offset, as this feature
is implemented in the new configuration command
The sensor family SHT10, SHT11 and SHT15 only differ in their accuracy (as in
calibration, not as in resolution). Thus, the same driver can be used for all.
The new driver name better reflects this fact.
I'm using something like this command for a while now for debugging
GNRC. Usually, I just patch it into the application I'm using it with,
but I think there is a benefit to also provide it to RIOT upstream
properly.
After thinking about it a bit, I decided to remove the reactive
advertisement of context information all together in the shell command.
RFC 6775 does not explicitly forbids, but it discourages multicast RAs,
which would be the alternative.
If a single word is added to the content cache via `ccnl_cont /TEST
hello`, then the resulting wireshark dump of a successful `ccnl_int
/TEST` will contain a TLV of len(hello) plus 1 (whit space). By
incrementing `buf_ptr` only for loop iterations `> 2` fixes this. As a
bonus, I removed the superfluous `memset` to white space, as the buffer
is correctly terminated with a '\0' character.
When SHELL_NO_ECHO was defined and not SHELL_NO_PROMPT build was broken
because _putchar was not defined.
This define _putchar when one of SHELL_NO_PROMPT or SHELL_NO_ECHO is not
defined.
This ZEP implementation is based on `gnrc_netdev`, it is complicated to
use, I'm not even sure anyone used it except me or if it is working
still. See #6121 for a better port of ZEP.
This commit allows to enable/disable the txtsnd shell command. The
command is used to send strings over L2 in GNRC. Until now the command
was automatically enabled if GNRC and shell_commands were present, which
may lead to confusion if no L2 packet handler is registered.
add encryption to drivers
fix new line at the end of file
add shell command for enable encryption and set encryption key on a given device
modify _net_if_set_encrypt_key to support any key length
modify _net_if_set_encrypt_key to support any key length of the key
modify blank line
fix ace before tab in indent
fix ace before tab indent
fix ace before tab indent an error
fix trailing white space
drivers/xbee: encryption support
add encryption to drivers
fix new line at the end of file
add shell command for enable encryption and set encryption key on a given device
modify _net_if_set_encrypt_key to support any key length
modify _net_if_set_encrypt_key to support any key length of the key
modify blank line
fix ace before tab in indent
fix ace before tab indent
fix ace before tab indent an error
fix trailing white space
modify drivers/xbee/xbee.c
fix white spaces on xbee.c
Update xbee encryption driver
white line at end xbee.h
fix error
fix sc_netif.c
fix rebase master interactive
drivers/xbee: encryption support
add encryption to drivers
fix new line at the end of file
add shell command for enable encryption and set encryption key on a given device
modify _net_if_set_encrypt_key to support any key length
modify _net_if_set_encrypt_key to support any key length of the key
modify blank line
fix ace before tab in indent
fix ace before tab indent
fix ace before tab indent an error
fix trailing white space
drivers/xbee: encryption support
add encryption to drivers
fix new line at the end of file
add shell command for enable encryption and set encryption key on a given device
modify _net_if_set_encrypt_key to support any key length
modify _net_if_set_encrypt_key to support any key length of the key
modify blank line
fix ace before tab in indent
fix ace before tab indent
fix ace before tab indent an error
fix trailing white space
modify drivers/xbee/xbee.c
fix white spaces on xbee.c
Update xbee encryption driver
white line at end xbee.h
fix error
fix rebase conflict 4
fix same missing in patches changes
fix ascii to hex index parser
fix syntax rules
fix syntax issue 2
add _netopt_strmap NETOPT_ENCRYPTION e NETOPT_ENCRYPTION_KEY
fix trailng white spaces