Hi,
The Xbee driver test uses the shell to send packets. Because I don't need
the shell, what's the correct code to send data through the Xbee?
I try this:
```
char data[] = " hello";
size_t addr_len = 8;
uint8_t addr[8]={0x00, 0x13, 0xa2, 0x00, 0x40, 0xc4, 0x36, 0x57};
ng_pktsnip_t *pkt;
ng_netif_hdr_t *nethdr;
pkt = ng_pktbuf_add(NULL,(char *)data, strlen(data),
NG_NETTYPE_UNDEF);
pkt = ng_pktbuf_add(pkt, NULL, sizeof(ng_netif_hdr_t) + addr_len,
NG_NETTYPE_NETIF);
nethdr = (ng_netif_hdr_t *)pkt->data;
ng_netif_hdr_init(nethdr, 0, addr_len);
ng_netif_hdr_set_dst_addr(nethdr, addr, addr_len);
ng_netapi_send( dev.mac_pid, pkt);
```
But It don't works.
Thanks, Francesco
_______________________________________________
users mailing list
[email protected]
http://lists.riot-os.org/mailman/listinfo/users