1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #13192 from leandrolanzieri/pr/drivers/xbee_fix_ref_to_device

drivers/xbee: Fix reference to device from netif in send function
This commit is contained in:
Francisco 2020-01-24 08:46:40 +01:00 committed by GitHub
commit 618919bb17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -116,12 +116,12 @@ static int xbee_adpt_send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt)
hdr = (gnrc_netif_hdr_t *)pkt->data; hdr = (gnrc_netif_hdr_t *)pkt->data;
if (hdr->flags & BCAST) { if (hdr->flags & BCAST) {
uint16_t addr = 0xffff; uint16_t addr = 0xffff;
res = xbee_build_hdr((xbee_t *)netif, xhdr, size, &addr, 2); res = xbee_build_hdr((xbee_t *)netif->dev, xhdr, size, &addr, 2);
DEBUG("[xbee-gnrc] send: preparing to send broadcast\n"); DEBUG("[xbee-gnrc] send: preparing to send broadcast\n");
} }
else { else {
uint8_t *addr = gnrc_netif_hdr_get_dst_addr(hdr); uint8_t *addr = gnrc_netif_hdr_get_dst_addr(hdr);
res = xbee_build_hdr((xbee_t *)netif, xhdr, size, addr, res = xbee_build_hdr((xbee_t *)netif->dev, xhdr, size, addr,
hdr->dst_l2addr_len); hdr->dst_l2addr_len);
if (res < 0) { if (res < 0) {
if (res == -EOVERFLOW) { if (res == -EOVERFLOW) {