15 #include <epicsExport.h> 23 epicsInt16 SFP::read16(
unsigned int offset)
const 25 epicsUInt16 val = buffer[offset];
27 val |= buffer[offset+1];
31 SFP::SFP(
const std::string &n,
volatile unsigned char *reg)
41 fprintf(stderr,
"Found SFP EEPROM\n");
43 fprintf(stderr,
"Found SFP Strangeness %02x%02x%02x%02x\n",
44 buffer[0],buffer[1],buffer[2],buffer[3]);
54 epicsUInt32* p32=(epicsUInt32*)&buffer[0];
59 valid = buffer[0]==3 && buffer[2]==7;
94 static const char nomod[] =
"<No Module>";
99 return std::string(nomod);
101 return std::string(it, it+16);
107 return std::string(nomod);
108 buffer_t::const_iterator it=buffer.begin()+
SFP_part_num;
109 return std::string(it, it+16);
115 return std::string(nomod);
116 buffer_t::const_iterator it=buffer.begin()+
SFP_part_rev;
117 return std::string(it, it+4);
123 return std::string(nomod);
124 buffer_t::const_iterator it=buffer.begin()+
SFP_serial;
125 return std::string(it, it+16);
131 return std::string(nomod);
132 std::string ret(
"20XX/XX");
142 printf(
"SFP tranceiver information\n" 144 " Link: %.1f MBits/s\n" 145 " Tx Power: %.1f uW\n" 146 " Rx Power: %.1f uW\n",
151 printf(
" Vendor:%s\n Model: %s\n Rev: %s\n Manufacture date: %s\n Serial: %s\n",
double temperature() const
std::string vendorPart() const
void updateNow(bool=true)
std::string vendorName() const
#define OBJECT_PROP1(NAME, GET)
std::string vendorRev() const
std::string manuDate() const
SFP(const std::string &n, volatile unsigned char *reg)
#define OBJECT_END(klass)
#define OBJECT_PROP2(NAME, GET, SET)
std::string serial() const
ObjectInst(const std::string &n)