6LoWPAN/Radio: Rename radio property sp_pktlen to sp_framelen. Add 6LoWPAN utility to get the max frame length (not yet hooked in)

This commit is contained in:
Gregory Nutt
2017-09-10 10:13:33 -06:00
parent 435dd39d4c
commit 334d1734dc
8 changed files with 61 additions and 10 deletions
+1 -1
View File
@@ -50,7 +50,7 @@
* -Add compression options to UDP, currently only supports
* both ports compressed or both ports elided
* -Verify TC/FL compression works
* -Add stateless multicast option
* -Add multicast support for M=1 and DAC=1
*/
/****************************************************************************
+17
View File
@@ -606,6 +606,23 @@ void sixlowpan_ipfromaddr(FAR const struct netdev_varaddr_s *addr,
bool sixlowpan_ismacbased(const net_ipv6addr_t ipaddr,
FAR const struct netdev_varaddr_s *addr);
/****************************************************************************
* Name: sixlowpan_radio_framelen
*
* Description:
* Get the maximum frame length supported by radio network drvier.
*
* Input parameters:
* radio - Reference to a radio network driver state instance.
*
* Returned Value:
* A non-negative, maximum frame lengthis returned on success; A negated
* errno valueis returned on any failure.
*
****************************************************************************/
int sixlowpan_radio_framelen(FAR struct radio_driver_s *radio);
/****************************************************************************
* Name: sixlowpan_src_panid
*
+34
View File
@@ -508,6 +508,40 @@ bool sixlowpan_ismacbased(const net_ipv6addr_t ipaddr,
}
}
/****************************************************************************
* Name: sixlowpan_radio_framelen
*
* Description:
* Get the maximum frame length supported by radio network drvier.
*
* Input parameters:
* radio - Reference to a radio network driver state instance.
*
* Returned Value:
* A non-negative, maximum frame lengthis returned on success; A negated
* errno valueis returned on any failure.
*
****************************************************************************/
int sixlowpan_radio_framelen(FAR struct radio_driver_s *radio)
{
struct radiodev_properties_s properties;
int ret;
/* Only the radio driver knows the correct max frame length supported by
* the radio.
*/
DEBUGASSERT(radio->r_properties != NULL);
ret = radio->r_properties(radio, &properties);
if (ret < 0)
{
return ret;
}
return (int)properties.sp_framelen;
}
/****************************************************************************
* Name: sixlowpan_src_panid
*