Skip to content

Commit df7927d

Browse files
committed
shell: introduce txtsnd pseudomodule
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.
1 parent 9666f58 commit df7927d

File tree

6 files changed

+7
-1
lines changed

6 files changed

+7
-1
lines changed

Makefile.pseudomodules

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ PSEUDOMODULES += gnrc_sixlowpan_nd_border_router
2222
PSEUDOMODULES += gnrc_sixlowpan_router
2323
PSEUDOMODULES += gnrc_sixlowpan_router_default
2424
PSEUDOMODULES += gnrc_sock_check_reuse
25+
PSEUDOMODULES += gnrc_txtsnd
2526
PSEUDOMODULES += log
2627
PSEUDOMODULES += log_printfnoformat
2728
PSEUDOMODULES += lwip_arp

examples/default/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ ifneq (,$(filter $(BOARD),$(BOARD_PROVIDES_NETIF)))
4747
USEMODULE += gnrc_netdev_default
4848
# automatically initialize the network interface
4949
USEMODULE += auto_init_gnrc_netif
50+
# shell command to send L2 packets with a simple string
51+
USEMODULE += gnrc_txtsnd
5052
# the application dumps received packets to stdout
5153
USEMODULE += gnrc_pktdump
5254

examples/posix_sockets/README.md

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ Running the `help` command on an iotlab-m3:
4444
2015-09-22 14:54:54,451 - INFO # mersenne_init initializes the PRNG
4545
2015-09-22 14:54:54,453 - INFO # mersenne_get returns 32 bit of pseudo randomness
4646
2015-09-22 14:54:54,454 - INFO # ifconfig Configure network interfaces
47-
2015-09-22 14:54:54,455 - INFO # txtsnd Sends a custom string as is over the link layer
4847
2015-09-22 14:54:54,457 - INFO # ncache manage neighbor cache by hand
4948
2015-09-22 14:54:54,459 - INFO # routers IPv6 default router list
5049
```

sys/shell/commands/shell_commands.c

+2
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,10 @@ const shell_command_t _shell_command_list[] = {
181181
#endif
182182
#ifdef MODULE_GNRC_NETIF
183183
{"ifconfig", "Configure network interfaces", _netif_config},
184+
#ifdef MODULE_GNRC_TXTSND
184185
{"txtsnd", "Sends a custom string as is over the link layer", _netif_send },
185186
#endif
187+
#endif
186188
#ifdef MODULE_FIB
187189
{"fibroute", "Manipulate the FIB (info: 'fibroute [add|del]')", _fib_route_handler},
188190
#endif

tests/driver_kw2xrf/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ BOARD_INSUFFICIENT_MEMORY := stm32f0discovery nucleo-f334 weio
77

88
USEMODULE += auto_init_gnrc_netif
99
USEMODULE += gnrc_netif
10+
USEMODULE += gnrc_txtsnd
1011
USEMODULE += gnrc_nomac
1112
USEMODULE += gnrc_pktdump
1213
USEMODULE += shell

tests/driver_xbee/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ BOARD_INSUFFICIENT_MEMORY := nucleo-f030 nucleo-f334 stm32f0discovery weio \
88

99
USEMODULE += xbee
1010
USEMODULE += gnrc_netif
11+
USEMODULE += gnrc_txtsnd
1112
USEMODULE += gnrc_netdev2
1213
USEMODULE += auto_init_gnrc_netif
1314
USEMODULE += gnrc_pktdump

0 commit comments

Comments
 (0)