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
3ced9350
Unverified
Commit
3ced9350
authored
7 years ago
by
Peter Kietzmann
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #7488 from miri64/at86rf2xx/fix/assert-chan
at86rf2xx: fix channel asserts
parents
e0946af7
bae9c2e2
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
drivers/at86rf2xx/at86rf2xx_netdev.c
+6
-6
6 additions, 6 deletions
drivers/at86rf2xx/at86rf2xx_netdev.c
with
6 additions
and
6 deletions
drivers/at86rf2xx/at86rf2xx_netdev.c
+
6
−
6
View file @
3ced9350
...
@@ -424,8 +424,8 @@ static int _set(netdev_t *netdev, netopt_t opt, const void *val, size_t len)
...
@@ -424,8 +424,8 @@ static int _set(netdev_t *netdev, netopt_t opt, const void *val, size_t len)
/* don't set res to set netdev_ieee802154_t::pan */
/* don't set res to set netdev_ieee802154_t::pan */
break
;
break
;
case
NETOPT_CHANNEL
:
case
NETOPT_CHANNEL
:
assert
(
len
!
=
sizeof
(
uint
8
_t
));
assert
(
len
=
=
sizeof
(
uint
16
_t
));
uint8_t
chan
=
((
const
uint
8
_t
*
)
val
)[
0
];
uint8_t
chan
=
((
(
const
uint
16
_t
*
)
val
)[
0
]
)
&
UINT8_MAX
;
if
((
chan
<
AT86RF2XX_MIN_CHANNEL
)
if
((
chan
<
AT86RF2XX_MIN_CHANNEL
)
||
(
chan
>
AT86RF2XX_MAX_CHANNEL
))
{
||
(
chan
>
AT86RF2XX_MAX_CHANNEL
))
{
res
=
-
EINVAL
;
res
=
-
EINVAL
;
...
@@ -436,15 +436,15 @@ static int _set(netdev_t *netdev, netopt_t opt, const void *val, size_t len)
...
@@ -436,15 +436,15 @@ static int _set(netdev_t *netdev, netopt_t opt, const void *val, size_t len)
break
;
break
;
case
NETOPT_CHANNEL_PAGE
:
case
NETOPT_CHANNEL_PAGE
:
assert
(
len
!
=
sizeof
(
uint
8
_t
));
assert
(
len
=
=
sizeof
(
uint
16
_t
));
uint8_t
page
=
((
const
uint
8
_t
*
)
val
)[
0
];
uint8_t
page
=
((
(
const
uint
16
_t
*
)
val
)[
0
]
)
&
UINT8_MAX
;
#ifdef MODULE_AT86RF212B
#ifdef MODULE_AT86RF212B
if
((
page
!=
0
)
&&
(
page
!=
2
))
{
if
((
page
!=
0
)
&&
(
page
!=
2
))
{
res
=
-
EINVAL
;
res
=
-
EINVAL
;
}
}
else
{
else
{
at86rf2xx_set_page
(
dev
,
page
);
at86rf2xx_set_page
(
dev
,
page
);
res
=
sizeof
(
uint
8
_t
);
res
=
sizeof
(
uint
16
_t
);
}
}
#else
#else
/* rf23x only supports page 0, no need to configure anything in the driver. */
/* rf23x only supports page 0, no need to configure anything in the driver. */
...
@@ -452,7 +452,7 @@ static int _set(netdev_t *netdev, netopt_t opt, const void *val, size_t len)
...
@@ -452,7 +452,7 @@ static int _set(netdev_t *netdev, netopt_t opt, const void *val, size_t len)
res
=
-
EINVAL
;
res
=
-
EINVAL
;
}
}
else
{
else
{
res
=
sizeof
(
uint
8
_t
);
res
=
sizeof
(
uint
16
_t
);
}
}
#endif
#endif
break
;
break
;
...
...
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