public PLV GetPLV(ParameterIndicator pInd) { foreach (PLV p in PLVList) { if (pInd.Equals(p.PI)) { return(p); } } return(null); }
public Int32 Decode(Byte[] buf, Int32 ptr, out String s) { Int32 result = 0; PI = (ParameterIndicator)buf[ptr++]; PL = buf[ptr++]; s = "|" + PI.ToString() + "(len=" + PL.ToString(); switch (PL) { case 4: result |= (buf[ptr++] << 24); result |= (buf[ptr++] << 16); result |= (buf[ptr++] << 8); PV = result | buf[ptr++]; s += ":" + PV.ToString("x8"); break; case 2: result |= (buf[ptr++] << 8); PV = result | buf[ptr++]; s += ":" + PV.ToString("x4"); break; case 1: PV = result | buf[ptr++]; s += ":" + PV.ToString("x2"); break; default: PVB = new Byte[PL]; s += ":"; for (Int32 i = 0; i < PL; i++) { PVB[i] = buf[ptr++]; s += PVB[i].ToString("x2"); if (i < PL - 1) { s += " "; } } break; } s += ")"; return(ptr); }