Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
c30fea46
Unverified
Commit
c30fea46
authored
7 years ago
by
Martine Lenders
Browse files
Options
Downloads
Patches
Plain Diff
shell_commands: fix sc_gnrc_netif2 for MSP430
parent
b3ebdab8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sys/shell/commands/sc_gnrc_netif2.c
+12
-13
12 additions, 13 deletions
sys/shell/commands/sc_gnrc_netif2.c
with
12 additions
and
13 deletions
sys/shell/commands/sc_gnrc_netif2.c
+
12
−
13
View file @
c30fea46
...
@@ -258,7 +258,7 @@ static void _print_netopt(netopt_t opt)
...
@@ -258,7 +258,7 @@ static void _print_netopt(netopt_t opt)
}
}
}
}
const
char
*
_netopt_state_str
[]
=
{
static
const
char
*
_netopt_state_str
[]
=
{
[
NETOPT_STATE_OFF
]
=
"OFF"
,
[
NETOPT_STATE_OFF
]
=
"OFF"
,
[
NETOPT_STATE_SLEEP
]
=
"SLEEP"
,
[
NETOPT_STATE_SLEEP
]
=
"SLEEP"
,
[
NETOPT_STATE_IDLE
]
=
"IDLE"
,
[
NETOPT_STATE_IDLE
]
=
"IDLE"
,
...
@@ -270,12 +270,13 @@ const char *_netopt_state_str[] = {
...
@@ -270,12 +270,13 @@ const char *_netopt_state_str[] = {
/* for some lines threshold might just be 0, so we can't use _LINE_THRESHOLD
/* for some lines threshold might just be 0, so we can't use _LINE_THRESHOLD
* here */
* here */
static
voi
d
_newline
(
unsigned
threshold
,
unsigned
*
line_thresh
)
static
unsigne
d
_newline
(
unsigned
threshold
,
unsigned
line_thresh
)
{
{
if
(
*
line_thresh
>
threshold
)
{
if
(
line_thresh
>
threshold
)
{
printf
(
"
\n
"
);
printf
(
"
\n
"
);
*
line_thresh
=
0U
;
line_thresh
=
0U
;
}
}
return
line_thresh
;
}
}
...
@@ -288,8 +289,7 @@ static unsigned _netif_list_flag(kernel_pid_t iface, netopt_t opt, char *str,
...
@@ -288,8 +289,7 @@ static unsigned _netif_list_flag(kernel_pid_t iface, netopt_t opt, char *str,
if
((
res
>=
0
)
&&
(
enable
==
NETOPT_ENABLE
))
{
if
((
res
>=
0
)
&&
(
enable
==
NETOPT_ENABLE
))
{
printf
(
"%s"
,
str
);
printf
(
"%s"
,
str
);
line_thresh
++
;
line_thresh
=
_newline
(
_LINE_THRESHOLD
,
++
line_thresh
);
_newline
(
_LINE_THRESHOLD
,
&
line_thresh
);
}
}
return
line_thresh
;
return
line_thresh
;
}
}
...
@@ -323,7 +323,7 @@ static void _netif_list_ipv6(ipv6_addr_t *addr, uint8_t flags)
...
@@ -323,7 +323,7 @@ static void _netif_list_ipv6(ipv6_addr_t *addr, uint8_t flags)
printf
(
" VAL"
);
printf
(
" VAL"
);
break
;
break
;
}
}
_newline
(
0U
,
&
line_thresh
);
line_thresh
=
_newline
(
0U
,
line_thresh
);
}
}
#endif
#endif
...
@@ -359,7 +359,7 @@ static void _netif_list(kernel_pid_t iface)
...
@@ -359,7 +359,7 @@ static void _netif_list(kernel_pid_t iface)
if
(
res
>=
0
)
{
if
(
res
>=
0
)
{
printf
(
" NID: 0x%"
PRIx16
,
u16
);
printf
(
" NID: 0x%"
PRIx16
,
u16
);
}
}
_newline
(
0U
,
&
line_thresh
);
line_thresh
=
_newline
(
0U
,
line_thresh
);
res
=
gnrc_netapi_get
(
iface
,
NETOPT_ADDRESS_LONG
,
0
,
hwaddr
,
sizeof
(
hwaddr
));
res
=
gnrc_netapi_get
(
iface
,
NETOPT_ADDRESS_LONG
,
0
,
hwaddr
,
sizeof
(
hwaddr
));
if
(
res
>=
0
)
{
if
(
res
>=
0
)
{
char
hwaddr_str
[
res
*
3
];
char
hwaddr_str
[
res
*
3
];
...
@@ -367,7 +367,7 @@ static void _netif_list(kernel_pid_t iface)
...
@@ -367,7 +367,7 @@ static void _netif_list(kernel_pid_t iface)
printf
(
"%s "
,
gnrc_netif2_addr_to_str
(
hwaddr
,
res
,
hwaddr_str
));
printf
(
"%s "
,
gnrc_netif2_addr_to_str
(
hwaddr
,
res
,
hwaddr_str
));
line_thresh
++
;
line_thresh
++
;
}
}
_newline
(
0U
,
&
line_thresh
);
line_thresh
=
_newline
(
0U
,
line_thresh
);
res
=
gnrc_netapi_get
(
iface
,
NETOPT_TX_POWER
,
0
,
&
i16
,
sizeof
(
i16
));
res
=
gnrc_netapi_get
(
iface
,
NETOPT_TX_POWER
,
0
,
&
i16
,
sizeof
(
i16
));
if
(
res
>=
0
)
{
if
(
res
>=
0
)
{
printf
(
" TX-Power: %"
PRIi16
"dBm "
,
i16
);
printf
(
" TX-Power: %"
PRIi16
"dBm "
,
i16
);
...
@@ -391,7 +391,7 @@ static void _netif_list(kernel_pid_t iface)
...
@@ -391,7 +391,7 @@ static void _netif_list(kernel_pid_t iface)
}
}
line_thresh
++
;
line_thresh
++
;
}
}
_newline
(
0U
,
&
line_thresh
);
line_thresh
=
_newline
(
0U
,
line_thresh
);
line_thresh
=
_netif_list_flag
(
iface
,
NETOPT_PROMISCUOUSMODE
,
"PROMISC "
,
line_thresh
=
_netif_list_flag
(
iface
,
NETOPT_PROMISCUOUSMODE
,
"PROMISC "
,
line_thresh
);
line_thresh
);
line_thresh
=
_netif_list_flag
(
iface
,
NETOPT_AUTOACK
,
"AUTOACK "
,
line_thresh
=
_netif_list_flag
(
iface
,
NETOPT_AUTOACK
,
"AUTOACK "
,
...
@@ -438,13 +438,12 @@ static void _netif_list(kernel_pid_t iface)
...
@@ -438,13 +438,12 @@ static void _netif_list(kernel_pid_t iface)
printf
(
"Source address length: %"
PRIu16
,
u16
);
printf
(
"Source address length: %"
PRIu16
,
u16
);
line_thresh
++
;
line_thresh
++
;
}
}
_newline
(
0U
,
&
line_thresh
);
line_thresh
=
_newline
(
0U
,
line_thresh
);
#ifdef MODULE_GNRC_IPV6
#ifdef MODULE_GNRC_IPV6
printf
(
"Link type: %s"
,
printf
(
"Link type: %s"
,
(
gnrc_netapi_get
(
iface
,
NETOPT_IS_WIRED
,
0
,
&
u16
,
sizeof
(
u16
))
>
0
)
?
(
gnrc_netapi_get
(
iface
,
NETOPT_IS_WIRED
,
0
,
&
u16
,
sizeof
(
u16
))
>
0
)
?
"wired"
:
"wireless"
);
"wired"
:
"wireless"
);
line_thresh
++
;
line_thresh
=
_newline
(
0U
,
++
line_thresh
);
_newline
(
0U
,
&
line_thresh
);
res
=
gnrc_netapi_get
(
iface
,
NETOPT_IPV6_ADDR
,
0
,
ipv6_addrs
,
res
=
gnrc_netapi_get
(
iface
,
NETOPT_IPV6_ADDR
,
0
,
ipv6_addrs
,
sizeof
(
ipv6_addrs
));
sizeof
(
ipv6_addrs
));
if
(
res
>=
0
)
{
if
(
res
>=
0
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment