Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VENDOR_NAME decoding problem #14

Open
insekt opened this issue Aug 20, 2019 · 1 comment
Open

VENDOR_NAME decoding problem #14

insekt opened this issue Aug 20, 2019 · 1 comment

Comments

@insekt
Copy link

insekt commented Aug 20, 2019

Get such key-value pair when reading SERIAL_ID from SFP HG Genuine MXPD-243S.

'VENDOR_NAME': 'HG GENUINE\x00\x00\x00\x00\x00\x00'

To me it seems strange.

i2cdump of this SFP.

root@raspberrypi:~# i2cdump -y 11 0x50
No size specified (using byte-data access)
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 03 04 07 00 00 00 02 12 00 01 01 01 0d 00 0a 64    ???...??.????.?d
10: 00 00 00 00 48 47 20 47 45 4e 55 49 4e 45 00 00    ....HG GENUINE..
20: 00 00 00 00 00 00 00 00 4d 58 50 44 2d 32 34 33    ........MXPD-243
30: 53 20 20 20 20 20 20 20 00 00 00 00 05 1e 00 af    S       ....??.?
40: 00 1a 00 00 48 41 30 39 33 36 30 30 32 30 35 36    .?..HA0936002056
50: 32 20 20 20 30 39 30 39 30 33 20 20 58 f0 01 f2    2   090903  X???
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
@donboll
Copy link
Contributor

donboll commented Oct 14, 2019

The vendor of that transceiver appears to have put null/zero into the remaining bytes after 'HG GENUINE'. The spec says that the vendor name is 16 bytes long, so OOM reads all 16 bytes in and provides them to the programmer. It looks like some defensive coding might be required to handle the variety of data that some vendors provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants