Commit 9b1deffa authored by Robert Schmidt's avatar Robert Schmidt

Add X400 to devtype_names, make char* array

parent 41a58a49
...@@ -43,16 +43,31 @@ ...@@ -43,16 +43,31 @@
//#include "targets/RT/USER/lte-softmodem.h" //#include "targets/RT/USER/lte-softmodem.h"
#include "executables/softmodem-common.h" #include "executables/softmodem-common.h"
char *get_devname(int devtype) { const char* devtype_names[MAX_RF_DEV_TYPE] = {
char *devnames[MAX_RF_DEV_TYPE]=DEVTYPE_NAMES; "",
"EXMIMO",
"USRP B200",
"USRP X300",
"USRP N300",
"USRP X400",
"BLADERF",
"LMSSDR",
"IRIS",
"No HW",
"ADRV9371_ZC706",
"UEDv2",
"RFSIMULATOR"
};
const char *get_devname(int devtype) {
if (devtype < MAX_RF_DEV_TYPE && devtype !=MIN_RF_DEV_TYPE ) if (devtype < MAX_RF_DEV_TYPE && devtype !=MIN_RF_DEV_TYPE )
return devnames[devtype]; return devtype_names[devtype];
return "none"; return "none";
} }
int set_device(openair0_device *device) int set_device(openair0_device *device)
{ {
char *devname = get_devname(device->type); const char *devname = get_devname(device->type);
if (strcmp(devname,"none") != 0) { if (strcmp(devname,"none") != 0) {
LOG_I(HW,"[%s] has loaded %s device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"),devname); LOG_I(HW,"[%s] has loaded %s device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"),devname);
} else { } else {
......
...@@ -109,7 +109,9 @@ typedef enum { ...@@ -109,7 +109,9 @@ typedef enum {
RFSIMULATOR, RFSIMULATOR,
MAX_RF_DEV_TYPE MAX_RF_DEV_TYPE
} dev_type_t; } dev_type_t;
#define DEVTYPE_NAMES {"","EXMIMO","USRP B200","USRP X300","USRP N300","BLADERF","LMSSDR","IRIS","No HW","ADRV9371_ZC706","UEDv2", "RFSIMULATOR"} /* list of names of devices, needs to match dev_type_t */
extern const char* devtype_names[MAX_RF_DEV_TYPE];
/*!\brief transport protocol types /*!\brief transport protocol types
*/ */
typedef enum { typedef enum {
...@@ -537,7 +539,7 @@ extern "C" ...@@ -537,7 +539,7 @@ extern "C"
/*! \brief get device name from device type */ /*! \brief get device name from device type */
char *get_devname(int devtype); const char *get_devname(int devtype);
/*! \brief Initialize openair RF target. It returns 0 if OK */ /*! \brief Initialize openair RF target. It returns 0 if OK */
int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cfg); int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cfg);
/*! \brief Initialize transport protocol . It returns 0 if OK */ /*! \brief Initialize transport protocol . It returns 0 if OK */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment