Skip to content

Commit

Permalink
test/kw2xrf: use fmt_is_number()
Browse files Browse the repository at this point in the history
  • Loading branch information
haukepetersen committed Dec 5, 2019
1 parent ca1fd87 commit fd34b5c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
1 change: 1 addition & 0 deletions tests/driver_kw2xrf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ include ../Makefile.tests_common

USEMODULE += auto_init_gnrc_netif
USEMODULE += gnrc_netdev_default
USEMODULE += fmt
USEMODULE += shell
USEMODULE += shell_commands
USEMODULE += ps
Expand Down
14 changes: 2 additions & 12 deletions tests/driver_kw2xrf/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <stdio.h>

#include "fmt.h"
#include "shell.h"
#include "kw2xrf.h"
#include "shell_commands.h"
Expand All @@ -32,21 +33,10 @@
#include "kw2xrf_tm.h"

/* utility functions */
static bool _is_number(char *str)
{
for (; *str; str++) {
if (*str < '0' || *str > '9') {
return false;
}
}

return true;
}

static void _set_test_mode(int argc, char **argv, uint8_t mode)
{
(void) argc;
if (_is_number(argv[1])) {
if (fmt_is_number(argv[1])) {
kernel_pid_t dev = atoi(argv[1]);

if (gnrc_netif_get_by_pid(dev)) {
Expand Down

0 comments on commit fd34b5c

Please sign in to comment.