Skip to content

Commit 4a28bfc

Browse files
committed
pkg/openthread: use RIOT shell as wrapper for ot cli
Automatically use RIOT shell when compiling OpenThread with CLI module. Ordered Makefile.dep alpha numerically.
1 parent ddb957b commit 4a28bfc

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

pkg/openthread/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,6 @@ $(PKG_BUILD_DIR)/Makefile:
8181
-DOT_PLATFORM=NO \
8282
-DOT_CONFIG="$(RIOTBASE)/pkg/openthread/include/platform_config.h" \
8383
-DOT_APP_CLI=$(OT_APP_CLI) \
84+
-DOT_CLI_TRANSPORT=CONSOLE \
8485
-DOT_JOINER=$(OT_JOINER) \
8586
-DOT_COAP=$(OT_COAP)

pkg/openthread/Makefile.dep

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
USEMODULE += openthread_contrib
2-
1+
USEMODULE += event
2+
USEMODULE += l2util
33
USEMODULE += netdev
4+
USEMODULE += openthread_contrib
45
USEMODULE += openthread_contrib_netdev
5-
USEMODULE += l2util
6+
7+
ifneq (,$(filter openthread-cli-%,$(USEMODULE)))
8+
USEMODULE += shell_cmds_default
9+
endif
10+
611
USEMODULE += ztimer
712
USEMODULE += ztimer_msec
8-
USEMODULE += event
913

1014
FEATURES_REQUIRED += cpp

pkg/openthread/contrib/netdev/openthread_netdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static void *_openthread_event_loop(void *arg)
9696
sInstance = otInstanceInitSingle();
9797

9898
#if defined(MODULE_OPENTHREAD_CLI_FTD) || defined(MODULE_OPENTHREAD_CLI_MTD)
99-
otCliUartInit(sInstance);
99+
ot_shell_init(sInstance);
100100
/* Init default parameters */
101101
otPanId panid = OPENTHREAD_PANID;
102102
uint8_t channel = OPENTHREAD_CHANNEL;

pkg/openthread/include/ot.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,12 @@ int openthread_netdev_init(char *stack, int stacksize, char priority, const char
163163
*/
164164
void ot_random_init(void);
165165

166+
/**
167+
* @brief Init shell for OpenThread CLI
168+
* @todo Make conditional?
169+
*/
170+
void ot_shell_init(otInstance *aInstance);
171+
166172
#ifdef __cplusplus
167173
}
168174
#endif

0 commit comments

Comments
 (0)