1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2025-04-21 12:27:27 +03:00

libatrf: added HardMAC functions

This function set isn't really usable for real communication. Its main
purpose is to help with testing the firmware.

- tools/lib/driver.h (struct atrf_driver): added driver functions for
  HardMAC access
- tools/include/atrf.h (atrf_rx_mode, atrf_rx, atrf_tx),
  tools/lib/atrf.c: functions to enable/disable HardMAC mode and to
  send/receive frames
This commit is contained in:
Werner Almesberger
2011-07-12 12:03:12 -03:00
parent c1071309d8
commit 862b554e2d
6 changed files with 44 additions and 17 deletions

View File

@@ -322,3 +322,25 @@ int atrf_interrupt_wait(struct atrf_dsc *dsc, int timeout_ms)
{
return dsc->driver->interrupt_wait(dsc->handle, timeout_ms);
}
void atrf_rx_mode(struct atrf_dsc *dsc, int on)
{
if (dsc->driver->rx_mode)
dsc->driver->rx_mode(dsc->handle, on);
}
int atrf_rx(struct atrf_dsc *dsc, void *buf, int size, uint8_t *lqi)
{
if (!dsc->driver->rx)
return 0;
return dsc->driver->rx(dsc->handle, buf, size, lqi);
}
void atrf_tx(struct atrf_dsc *dsc, const void *buf, int size)
{
if (dsc->driver->tx)
dsc->driver->tx(dsc->handle, buf, size);
}