mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 14:27:37 +08:00
Swithches IEEE 802.15.4 based code to using byte arrays instead of uint16_t values for short address and PAN ID
This commit is contained in:
@@ -313,8 +313,7 @@ int sixlowpan_queue_frames(FAR struct ieee802154_driver_s *ieee,
|
||||
* PAN IDs are the same.
|
||||
*/
|
||||
|
||||
pktmeta.dpanid = 0xffff;
|
||||
(void)sixlowpan_src_panid(ieee, &pktmeta.dpanid);
|
||||
(void)sixlowpan_src_panid(ieee, pktmeta.dpanid);
|
||||
|
||||
/* Based on the collected attributes and addresses, construct the MAC meta
|
||||
* data structure that we need to interface with the IEEE802.15.4 MAC (we
|
||||
|
||||
@@ -198,7 +198,8 @@ int sixlowpan_meta_data(FAR struct ieee802154_driver_s *ieee,
|
||||
/* Broadcast requires short address mode. */
|
||||
|
||||
meta->destaddr.mode = IEEE802154_ADDRMODE_SHORT;
|
||||
meta->destaddr.saddr = 0;
|
||||
meta->destaddr.saddr[0] = 0;
|
||||
meta->destaddr.saddr[1] = 0;
|
||||
}
|
||||
else if (pktmeta->dextended != 0)
|
||||
{
|
||||
@@ -215,7 +216,7 @@ int sixlowpan_meta_data(FAR struct ieee802154_driver_s *ieee,
|
||||
sixlowpan_saddrcopy(&meta->destaddr.saddr, pktmeta->dest.saddr.u8);
|
||||
}
|
||||
|
||||
meta->destaddr.panid = pktmeta->dpanid;
|
||||
IEEE802154_SADDRCOPY(meta->destaddr.panid, pktmeta->dpanid);
|
||||
|
||||
/* Handle associated with MSDU. Will increment once per packet, not
|
||||
* necesarily per frame: The same MSDU handle will be used for each
|
||||
|
||||
@@ -180,12 +180,12 @@ struct ipv6icmp_hdr_s
|
||||
|
||||
struct packet_metadata_s
|
||||
{
|
||||
uint8_t sextended : 1; /* Extended source address */
|
||||
uint8_t dextended : 1; /* Extended destination address */
|
||||
uint8_t xmits; /* Max MAC transmisstion */
|
||||
uint16_t dpanid; /* Destination PAN ID */
|
||||
union sixlowpan_anyaddr_u source; /* Source IEEE 802.15.4 address */
|
||||
union sixlowpan_anyaddr_u dest; /* Destination IEEE 802.15.4 address */
|
||||
uint8_t sextended : 1; /* Extended source address */
|
||||
uint8_t dextended : 1; /* Extended destination address */
|
||||
uint8_t xmits; /* Max MAC transmisstion */
|
||||
uint8_t dpanid[IEEE802154_PANIDSIZE]; /* Destination PAN ID */
|
||||
union sixlowpan_anyaddr_u source; /* Source IEEE 802.15.4 address */
|
||||
union sixlowpan_anyaddr_u dest; /* Destination IEEE 802.15.4 address */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
@@ -592,6 +592,6 @@ bool sixlowpan_ismacbased(const net_ipv6addr_t ipaddr,
|
||||
****************************************************************************/
|
||||
|
||||
int sixlowpan_src_panid(FAR struct ieee802154_driver_s *ieee,
|
||||
FAR uint16_t *panid);
|
||||
FAR uint8_t *panid);
|
||||
#endif /* CONFIG_NET_6LOWPAN */
|
||||
#endif /* _NET_SIXLOWPAN_SIXLOWPAN_INTERNAL_H */
|
||||
|
||||
@@ -188,7 +188,7 @@ bool sixlowpan_ismacbased(const net_ipv6addr_t ipaddr,
|
||||
****************************************************************************/
|
||||
|
||||
int sixlowpan_src_panid(FAR struct ieee802154_driver_s *ieee,
|
||||
FAR uint16_t *panid)
|
||||
FAR uint8_t *panid)
|
||||
{
|
||||
FAR struct net_driver_s *dev = &ieee->i_dev;
|
||||
struct ieee802154_netmac_s arg;
|
||||
@@ -204,7 +204,7 @@ int sixlowpan_src_panid(FAR struct ieee802154_driver_s *ieee,
|
||||
return ret;
|
||||
}
|
||||
|
||||
*panid = arg.u.getreq.attrval.mac.panid;
|
||||
IEEE802154_PANIDCOPY(panid, arg.u.getreq.attrval.mac.panid);
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user