X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=opendaylight%2Fsal%2Fapi%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fpacket%2FLLDPTLV.java;h=efb938e37f50745aae8f1f560b0d85f2bb7e7c07;hb=66ca7f84baed5633cd135c5037a8aa847d2b9621;hp=27660221ceb56da61d3c6c68cdfd46a13622ef96;hpb=50598f3ccf91107069821376c8b52afcbd13b6b7;p=controller.git diff --git a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/LLDPTLV.java b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/LLDPTLV.java index 27660221ce..efb938e37f 100644 --- a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/LLDPTLV.java +++ b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/packet/LLDPTLV.java @@ -291,10 +291,17 @@ public class LLDPTLV extends Packet { * @return the string */ static public String getStringValue(byte[] tlvValue, int tlvLen) { + byte[] pidSubType = new byte[portIDSubType.length]; byte[] pidBytes = new byte[tlvLen - portIDSubType.length]; + System.arraycopy(tlvValue, 0, pidSubType, 0, + pidSubType.length); System.arraycopy(tlvValue, portIDSubType.length, pidBytes, 0, pidBytes.length); - return (new String(pidBytes, Charset.defaultCharset())); + if (pidSubType[0] == (byte) 0x3) { + return HexEncode.bytesToHexStringFormat(pidBytes); + } else { + return (new String(pidBytes, Charset.defaultCharset())); + } } /**