1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #2777 from authmillenon/xbee/feat/max_packet_size

xbee: add maximum packet size option
This commit is contained in:
Peter Kietzmann 2015-04-17 09:15:16 +02:00
commit 32f901a142

View File

@ -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: