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
32f901a1
Commit
32f901a1
authored
10 years ago
by
Peter Kietzmann
Browse files
Options
Downloads
Plain Diff
Merge pull request #2777 from authmillenon/xbee/feat/max_packet_size
xbee: add maximum packet size option
parents
a2d48e48
e4deb1e5
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
drivers/xbee/xbee.c
+13
-0
13 additions, 0 deletions
drivers/xbee/xbee.c
with
13 additions
and
0 deletions
drivers/xbee/xbee.c
+
13
−
0
View file @
32f901a1
...
...
@@ -329,6 +329,17 @@ static int _set_channel(xbee_t *dev, uint8_t *val, size_t len)
return
-
EINVAL
;
}
static
int
_get_max_packet_size
(
xbee_t
*
dev
,
uint16_t
*
val
,
size_t
max
)
{
if
(
max
<
2
)
{
return
-
EOVERFLOW
;
}
*
val
=
XBEE_MAX_PAYLOAD_LENGTH
;
return
2
;
}
static
int
_get_panid
(
xbee_t
*
dev
,
uint8_t
*
val
,
size_t
max
)
{
uint8_t
cmd
[
2
];
...
...
@@ -611,6 +622,8 @@ static int _get(ng_netdev_t *netdev, ng_netconf_opt_t opt,
return
_get_addr_long
(
dev
,
(
uint8_t
*
)
value
,
max_len
);
case
NETCONF_OPT_CHANNEL
:
return
_get_channel
(
dev
,
(
uint8_t
*
)
value
,
max_len
);
case
NETCONF_OPT_MAX_PACKET_SIZE
:
return
_get_max_packet_size
(
dev
,
(
uint16_t
*
)
value
,
max_len
);
case
NETCONF_OPT_NID
:
return
_get_panid
(
dev
,
(
uint8_t
*
)
value
,
max_len
);
case
NETCONF_OPT_PROTO
:
...
...
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