mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 22:41:07 +08:00
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:
@@ -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
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user