00001 00008 /* 00009 * Copyright (c) 2009 ThingMagic, Inc. 00010 * 00011 * Permission is hereby granted, free of charge, to any person obtaining a copy 00012 * of this software and associated documentation files (the "Software"), to deal 00013 * in the Software without restriction, including without limitation the rights 00014 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 00015 * copies of the Software, and to permit persons to whom the Software is 00016 * furnished to do so, subject to the following conditions: 00017 * 00018 * The above copyright notice and this permission notice shall be included in 00019 * all copies or substantial portions of the Software. 00020 * 00021 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00022 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00023 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00024 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00025 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 00026 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 00027 * THE SOFTWARE. 00028 */ 00029 00030 #include <string.h> 00031 00032 #include "tm_reader.h" 00033 #include "tmr_utils.h" 00034 00035 #ifdef TMR_ENABLE_PARAM_STRINGS 00036 00037 static const char *paramNames[1 + TMR_PARAM_MAX] = { 00038 "", /* TMR_PARAM_NONE */ 00039 "/reader/baudRate", /* TMR_PARAM_BAUDRATE */ 00040 "/reader/probeBaudRates",/* TMR_PARAM_PROBEBAUDRATES */ 00041 "/reader/commandTimeout", /* TMR_PARAM_COMMANDTIMEOUT */ 00042 "/reader/transportTimeout", /* TMR_PARAM_TRANSPORTTIMEOUT */ 00043 "/reader/powerMode", /* TMR_PARAM_POWERMODE */ 00044 "/reader/userMode", /* TMR_PARAM_USERMODE */ 00045 "/reader/antenna/checkPort", /* TMR_PARAM_ANTENNA_CHECKPORT */ 00046 "/reader/antenna/portList", /* TMR_PARAM_ANTENNA_PORTLIST */ 00047 "/reader/antenna/connectedPortList", /* TMR_PARAM_ANTENNA_CONNECTEDPORTLIST */ 00048 "/reader/antenna/portSwitchGpos", /* TMR_PARAM_ANTENNA_PORTSWITCHGPOS */ 00049 "/reader/antenna/settlingTimeList", /* TMR_PARAM_ANTENNA_SETTLINGTIMELIST */ 00050 "/reader/antenna/returnLoss", /* TMR_PARAM_ANTENNA_RETURNLOSS */ 00051 "/reader/antenna/txRxMap", /* TMR_PARAM_ANTENNA_TXRXMAP */ 00052 "/reader/gpio/inputList", /* TMR_PARAM_GPIO_INPUTLIST */ 00053 "/reader/gpio/outputList", /* TMR_PARAM_GPIO_OUTPUTLIST */ 00054 "/reader/gen2/accessPassword", /* TMR_PARAM_GEN2_ACCESSPASSWORD */ 00055 "/reader/gen2/q", /* TMR_PARAM_GEN2_Q */ 00056 "/reader/gen2/tagEncoding", /* TMR_PARAM_GEN2_TAGENCODING*/ 00057 "/reader/gen2/session", /* TMR_PARAM_GEN2_SESSION */ 00058 "/reader/gen2/target", /* TMR_PARAM_GEN2_TARGET */ 00059 "/reader/gen2/BLF", /* TMR_PARAM_GEN2_BLF */ 00060 "/reader/gen2/tari", /* TMR_PARAM_GEN2_TARI */ 00061 "/reader/gen2/writeMode",/*TMR_PARAM_GEN2_WRITEMODE*/ 00062 "/reader/gen2/bap", /* TMR_PARAM_GEN2_BAP */ 00063 "/reader/gen2/protocolExtension", /* TMR_PARAM_GEN2_PROTOCOLEXTENSION */ 00064 "/reader/iso180006b/BLF", /* TMR_PARAM_ISO18000_6B_LINKFREQUENCY */ 00065 "/reader/iso180006b/modulationDepth", /* TMR_PARAM_ISO18000_6B_MODULATION_DEPTH */ 00066 "/reader/iso180006b/delimiter", /* TMR_PARAM_ISO18000_6B_DELIMITER */ 00067 "/reader/read/asyncOffTime", /* TMR_PARAM_READ_ASYNCOFFTIME */ 00068 "/reader/read/asyncOnTime", /* TMR_PARAM_READ_ASYNCONTIME */ 00069 "/reader/read/plan", /* TMR_PARAM_READ_PLAN */ 00070 "/reader/radio/enablePowerSave", /* TMR_PARAM_RADIO_ENABLEPOWERSAVE */ 00071 "/reader/radio/powerMax", /* TMR_PARAM_RADIO_POWERMAX */ 00072 "/reader/radio/powerMin", /* TMR_PARAM_RADIO_POWERMIN */ 00073 "/reader/radio/portReadPowerList", /* TMR_PARAM_RADIO_PORTREADPOWERLIST */ 00074 "/reader/radio/portWritePowerList", /* TMR_PARAM_RADIO_PORTWRITEPOWERLIST */ 00075 "/reader/radio/readPower", /* TMR_PARAM_RADIO_READPOWER */ 00076 "/reader/radio/writePower", /* TMR_PARAM_RADIO_WRITEPOWER */ 00077 "/reader/radio/temperature", /* TMR_PARAM_RADIO_TEMPERATURE */ 00078 "/reader/tagReadData/recordHighestRssi", /* TMR_PARAM_TAGREADDATA_RECORDHIGHESTRSSI */ 00079 "/reader/tagReadData/reportRssiInDbm", /* TMR_PARAM_TAGREADDATA_REPORTRSSIINDBM */ 00080 "/reader/tagReadData/uniqueByAntenna", /* TMR_PARAM_TAGREADDATA_UNIQUEBYANTENNA */ 00081 "/reader/tagReadData/uniqueByData", /* TMR_PARAM_TAGREADDATA_UNIQUEBYDATA */ 00082 "/reader/tagop/antenna", /* TMR_PARAM_TAGOP_ANTENNA */ 00083 "/reader/tagop/protocol", /* TMR_PARAM_TAGOP_PROTOCOL */ 00084 "/reader/version/hardware", /* TMR_PARAM_VERSION_HARDWARE */ 00085 "/reader/version/serial", /* TMR_PARAM_VERSION_SERIAL */ 00086 "/reader/version/model", /* TMR_PARAM_VERSION_MODEL */ 00087 "/reader/version/software", /* TMR_PARAM_VERSION_SOFTWARE */ 00088 "/reader/version/supportedProtocols", /* TMR_PARAM_VERSION_SUPPORTEDPROTOCOLS */ 00089 "/reader/region/hopTable", /* TMR_PARAM_REGION_HOPTABLE */ 00090 "/reader/region/hopTime", /* TMR_PARAM_REGION_HOPTIME */ 00091 "/reader/region/id", /* TMR_PARAM_REGION_ID */ 00092 "/reader/region/supportedRegions", /* TMR_PARAM_REGION_SUPPORTEDREGIONS */ 00093 "/reader/region/lbt/enable", /* TMR_PARAM_REGION_LBT_ENABLE */ 00094 "/reader/licenseKey", /* TMR_PARAM_LICENSE_KEY */ 00095 "/reader/userConfig", /* TMR_PARAM_USER_CONFIG */ 00096 "/reader/radio/enableSJC", /* TMR_PARAM_RADIO_ENABLESJC */ 00097 "/reader/extendedEpc", /* TMR_PARAM_EXTENDEDEPC */ 00098 "/reader/statistics", /* TMR_PARAM_READER_STATISTICS */ 00099 "/reader/stats", /* TMR_PARAM_READER_STATS */ 00100 "/reader/uri", /* TMR_PARAM_URI */ 00101 "/reader/version/productGroupID", /* TMR_PARAM_PRODUCT_GROUP_ID */ 00102 "/reader/version/productGroup", /* TMR_PARAM_PRODUCT_GROUP */ 00103 "/reader/version/productID", /* TMR_PARAM_PRODUCT_ID */ 00104 "/reader/tagReadData/tagopSuccesses", /* TMR_PARAM_TAGREADATA_TAGOPSUCCESSCOUNT */ 00105 "/reader/tagReadData/tagopFailures", /* TMR_PARAM_TAGREADATA_TAGOPFAILURECOUNT */ 00106 "/reader/status/antennaEnable", /* TMR_PARAM_STATUS_ENABLE_ANTENNAREPORT */ 00107 "/reader/status/frequencyEnable", /* TMR_PARAM_STATUS_ENABLE_FREQUENCYREPORT */ 00108 "/reader/status/temperatureEnable", /* TMR_PARAM_STATUS_ENABLE_TEMPERATUREREPORT */ 00109 "/reader/tagReadData/enableReadFilter", /* TMR_PARAM_TAGREADDATA_ENABLEREADFILTER */ 00110 "/reader/tagReadData/readFilterTimeout", /* TMR_PARAM_TAGREADDATA_READFILTERTIMEOUT */ 00111 "/reader/tagReadData/uniqueByProtocol", /* TMR_PARAM_TAGREADDATA_UNIQUEBYPROTOCOL */ 00112 "/reader/description", /* TMR_PARAM_READER_DESCRIPTION */ 00113 "/reader/hostname", /* TMR_PARAM_READER_HOSTNAME */ 00114 "/reader/currentTime", /* TMR_PARAM_CURRENTTIME */ 00115 "/reader/gen2/writeReplyTimeout", /* TMR_PARAM_READER_WRITE_REPLY_TIMEOUT */ 00116 "/reader/gen2/writeEarlyExit", /* /reader/gen2/writeEarlyExit */ 00117 "/reader/stats/enable", /* /reader/stats/enable */ 00118 "/reader/trigger/read/Gpi", /* TMR_PARAM_TRIGGER_READ_GPI */ 00119 "/reader/metadataflags", /* TMR_PARAM_METADATAFLAG */ 00120 "/reader/licensedFeatures", /* TMR_PARAM_LICENSED_FEATURES */ 00121 }; 00122 00123 00124 TMR_Param 00125 TMR_paramID(const char *name) 00126 { 00127 int i; 00128 00129 for (i = 1 ; i <= TMR_PARAM_MAX ; i++) 00130 { 00131 if (0 == strcasecmp(name, paramNames[i])) 00132 { 00133 return (TMR_Param)i; 00134 } 00135 } 00136 00137 return TMR_PARAM_NONE; 00138 } 00139 00140 const char * 00141 TMR_paramName(TMR_Param key) 00142 { 00143 00144 if (key <= TMR_PARAM_MAX) 00145 { 00146 return paramNames[key]; 00147 } 00148 return NULL; 00149 } 00150 00151 #endif /* TMR_ENABLE_PARAM_STRINGS */