radio802154_device.c now accesses the PHY layer via the IOCTL helper functions.

This commit is contained in:
Gregory Nutt 2017-04-14 13:04:24 -06:00
parent 0c4ff5e60b
commit 92c83489ba

View File

@ -52,6 +52,8 @@
#include <nuttx/kmalloc.h>
#include <nuttx/wireless/ieee802154/ieee802154_radio.h>
#include "radio802154_ioctl.h"
/****************************************************************************
* Private Types
****************************************************************************/
@ -390,71 +392,71 @@ static int radio802154dev_ioctl(FAR struct file *filep, int cmd,
switch (cmd)
{
case PHY802154IOC_SET_CHAN:
ret = child->ops->setchannel(child, (uint8_t)arg);
ret = radio802154_setchannel(child, (uint8_t)arg);
break;
case PHY802154IOC_GET_CHAN:
ret = child->ops->getchannel(child, (FAR uint8_t*)arg);
ret = radio802154_getchannel(child, (FAR uint8_t*)arg);
break;
case PHY802154IOC_SET_PANID:
ret = child->ops->setpanid(child, (uint16_t)arg);
ret = radio802154_setpanid(child, (uint16_t)arg);
break;
case PHY802154IOC_GET_PANID:
ret = child->ops->getpanid(child, (FAR uint16_t*)arg);
ret = radio802154_getpanid(child, (FAR uint16_t*)arg);
break;
case PHY802154IOC_SET_SADDR:
ret = child->ops->setsaddr(child, (uint16_t)arg);
ret = radio802154_setsaddr(child, (uint16_t)arg);
break;
case PHY802154IOC_GET_SADDR:
ret = child->ops->getsaddr(child, (FAR uint16_t*)arg);
ret = radio802154_getsaddr(child, (FAR uint16_t*)arg);
break;
case PHY802154IOC_SET_EADDR:
ret = child->ops->seteaddr(child, (FAR uint8_t*)arg);
ret = radio802154_seteaddr(child, (FAR uint8_t*)arg);
break;
case PHY802154IOC_GET_EADDR:
ret = child->ops->geteaddr(child, (FAR uint8_t*)arg);
ret = radio802154_geteaddr(child, (FAR uint8_t*)arg);
break;
case PHY802154IOC_SET_PROMISC:
ret = child->ops->setpromisc(child, (bool)arg);
ret = radio802154_setpromisc(child, (bool)arg);
break;
case PHY802154IOC_GET_PROMISC:
ret = child->ops->getpromisc(child, (FAR bool*)arg);
ret = radio802154_getpromisc(child, (FAR bool*)arg);
break;
case PHY802154IOC_SET_DEVMODE:
ret = child->ops->setdevmode(child, (uint8_t)arg);
ret = radio802154_setdevmode(child, (uint8_t)arg);
break;
case PHY802154IOC_GET_DEVMODE:
ret = child->ops->getdevmode(child, (FAR uint8_t*)arg);
ret = radio802154_getdevmode(child, (FAR uint8_t*)arg);
break;
case PHY802154IOC_SET_TXPWR:
ret = child->ops->settxpower(child, (int32_t)arg);
ret = radio802154_settxpower(child, (int32_t)arg);
break;
case PHY802154IOC_GET_TXPWR:
ret = child->ops->gettxpower(child, (FAR int32_t*)arg);
ret = radio802154_gettxpower(child, (FAR int32_t*)arg);
break;
case PHY802154IOC_SET_CCA:
ret = child->ops->setcca(child, (FAR struct ieee802154_cca_s*)arg);
ret = radio802154_setcca(child, (FAR struct ieee802154_cca_s*)arg);
break;
case PHY802154IOC_GET_CCA:
ret = child->ops->getcca(child, (FAR struct ieee802154_cca_s*)arg);
ret = radio802154_getcca(child, (FAR struct ieee802154_cca_s*)arg);
break;
case PHY802154IOC_ENERGYDETECT:
ret = child->ops->energydetect(child, (FAR uint8_t*)arg);
ret = radio802154_energydetect(child, (FAR uint8_t*)arg);
break;
default: