new public PDU Decode(BACPacket cm) { System.Console.Write("Decoding PDUComplexAck"); byte a = cm.getNextByte(); segMessage = DecodeSegMessage(a); moreFollows = DecodeMoreFollows(a); orgInvokeID = cm.getNextByte(); // If the optional parameter are present if (segMessage) { sequenceNumber = cm.getNextByte(); proposedWindowSize = cm.getNextByte(); } serviceACKchoice = (ConfirmedServiceChoice)cm.getNextByte(); switch (serviceACKchoice) { case ConfirmedServiceChoice.READPROPERTY: apduService = new APDUReadProperty(); apduService.Decode(cm); break; } return(this); }
// PAGE new public PDU Decode(BACPacket cm) { cm.getNextByte(); invokerId = cm.getNextByte(); rej_reason = (BACNET_Reject_Reason)cm.getNextByte(); return(this); }
public Boolean Decode(BACPacket cm) { if (0 == cm.getNextByte().CompareTo(0x81)) { function = (BVLL_IP_Fnct)cm.getNextByte(); length = cm.getNextByte(); length = (UInt16)(length << 4); length += cm.getNextByte(); cm.setLength(length); switch (function) { case BVLL_IP_Fnct.ORIGINAL_UNICAST_NPDU: NPCI pic = new NPCI(); pic.Decode(cm); inner = pic.ToString(); System.Console.WriteLine(ToString()); break; case BVLL_IP_Fnct.ORIGINAL_BROADCAST_NPDU: NPCI pic1 = new NPCI(); pic1.Decode(cm); inner = pic1.ToString(); System.Console.WriteLine(ToString()); break; default: break; } return(true); } return(false); }
// PAGE new public PDU Decode(BACPacket cm) { cm.getNextByte(); invokerId = cm.getNextByte(); serviceChoseError = (BACNET_ServiceChoice_Error)cm.getNextByte(); Bv1 = new BACVnetVar().Decode(cm); Bv2 = new BACVnetVar().Decode(cm); return(this); }
public BACVnetVar Decode(BACPacket cm, byte length) { stringValue[0] = cm.getNextByte(); for (int x = 1; x < length; x++) { stringValue[x] = cm.getNextByte(); } return(this); }
public BACVnetVar Decode(BACPacket cm, int length) { numericValue = new byte[length]; numericValue[0] = cm.getNextByte(); for (int x = 1; x < length; x++) { numericValue[x] = cm.getNextByte(); } return(this); }
public override NSDU Decode(BACPacket cm) { nlm = (Network_Layer_Message)cm.getNextByte(); Ports = cm.getNextByte(); rd = new RoutingData[Ports]; for (int x = 0; x < Ports; x++) { rd[x] = new RoutingData().Decoder(cm); } return(this); }
new public PDU Decode(BACPacket cm) { cm.getNextByte(); srvChoise = (BACnetUnconfirmedServiceChoice)cm.getNextByte(); switch (srvChoise) { case BACnetUnconfirmedServiceChoice.I_AM: //a = new I_AM_Srv_Struct(); while (cm.hasMore() == true) { bv.Add(new BACVnetVar().Decode(cm)); } break; case BACnetUnconfirmedServiceChoice.I_HAVE: while (cm.hasMore() == true) { bv.Add(new BACVnetVar().Decode(cm)); } break; case BACnetUnconfirmedServiceChoice.WHO_HAS: while (cm.hasMore() == true) { bv.Add(new BACVnetVar().Decode(cm)); } break; case BACnetUnconfirmedServiceChoice.WHO_IS: while (cm.hasMore() == true) { bv.Add(new BACVnetVar().Decode(cm, BACVnetVar.CONTEXT_TAG.UINT)); } break; case BACnetUnconfirmedServiceChoice.TIMESYNCHRONIZATION: while (cm.hasMore() == true) { bv.Add(new BACVnetVar().Decode(cm)); } break; default: while (cm.hasMore() == true) { bv.Add(new BACVnetVar().Decode(cm)); } break; } return(this); }
public override NSDU Decode(BACPacket cm) { nlm = (Network_Layer_Message)cm.getNextByte(); if (cm.hasMore() == true) { networkNumber = new byte[2]; for (int x = 0; x < 2; x++) { networkNumber[x] = cm.getNextByte(); } } return(this); }
public override BACVnetVar Decode(BACPacket cm) { byte tag = cm.getNextByte(); int length = tag & 0x07; stringValue = new byte[length]; stringValue[0] = cm.getNextByte(); for (int x = 1; x < length; x++) { stringValue[x] = cm.getNextByte(); } return(this); }
public RoutingData Decoder(BACPacket cm) { for (int x = 0; x < 2; x++) { ConnectedDNET[x] = cm.getNextByte(); } PortId = cm.getNextByte(); PortInfLng = cm.getNextByte(); PortInf = new byte[PortInfLng]; for (int x = 0; x < PortInfLng; x++) { PortInf[x] = cm.getNextByte(); } return(this); }
public BACVnetVar Decode(BACPacket cm, int length) { // This is not right and needs to be removed later if (length == 0) { length = 1; } numericValue = new byte[length]; numericValue[0] = cm.getNextByte(); for (int x = 1; x < length; x++) { numericValue[x] = cm.getNextByte(); } return(this); }
public void Decode(BACPacket cm) { p = PRESENCES.EXIST; netNumber = cm.getNextByte(); netNumber *= 0x0100; netNumber += cm.getNextByte(); adrLen = cm.getNextByte(); adr = new byte[0]; for (int x = 0; x < adrLen; x++) { adr = adr.Concat(new byte[1] { cm.getNextByte() }).ToArray(); } }
UInt32 instanceNumber; // A 22-bit object instance number public BACVnetVar Decode(BACPacket cm, byte length) { if (length != 4) { return(null); } UInt32 val = cm.getNextByte(); for (int x = 0; x < 3; x++) { val *= 0x0100; val += cm.getNextByte(); } ((BACVnetObjectIdentifier)this).Decode(val); return(this); }
public Boolean Decode(BACPacket cm) { pciVersion = cm.getNextByte(); // PIC Version is allways 0x01 if (pciVersion != 0x01) { return(false); } byte picByt = cm.getNextByte(); messageType = this.DecodeMType(picByt); destPresent = this.DecodeDestonation(picByt); srcPresent = this.DecodeSource(picByt); expectingReply = this.DecodeExpectingReply(picByt); priority = this.DecodePriority(picByt); //IF it contains the destonation addr get it if (destPresent == PRESENCES.EXIST) { destAddr.Decode(cm); } //IF it contains the source addr get it if (srcPresent == PRESENCES.EXIST) { srcAddr.Decode(cm); } //IF it contains the destonation don't forget the hop count if (destPresent == PRESENCES.EXIST) { hopCnt = cm.getNextByte(); } if (messageType == MTYPE.APPICATION) { pdu = pdu.Decode(cm); } else { nsdu = nsdu.Decode(cm); } return(true); }
public networkNumberID Decode(BACPacket cm) { networkNumber = new byte[2]; for (int x = 0; x < 2; x++) { networkNumber[x] = cm.getNextByte(); } return(this); }
public override NSDU Decode(BACPacket cm) { nlm = (Network_Layer_Message)cm.getNextByte(); while (cm.hasMore() == true) { nNumbers.Add(new networkNumberID().Decode(cm)); } return(this); }
public virtual BACVnetVar Decode(BACPacket cm) { byte tag = cm.getByte(); switch (DecodeClass(tag)) { case CLASS.APPLICATION: CONTEXT_TAG ct = (CONTEXT_TAG)(cm.getByte() >> 4); return(Decode(cm, ct)); case CLASS.CONTEXT: // IF this is an Openning Tag if ((tag & 0x0F) == 0x0E) { BACVnetConstructed constr = new BACVnetConstructed(); cm.getNextByte(); while (cm.hasMore() == true) { tag = cm.getByte(); // IF this is the closing Tag if ((tag & 0x0F) == 0x0F) { cm.getNextByte(); break; } BACVnetVar vn = new BACVnetVar().Decode(cm); constr.AddVar(vn); //constr.AddVar(cm.getNextByte()); } return(constr); } else { // This would be an error ?? CONTEXT_TAG ct1 = (CONTEXT_TAG)(cm.getByte() >> 4); return(Decode(cm, ct1)); } default: break; } return(this); }
public virtual BACVnetVar Decode(BACPacket cm, CONTEXT_TAG ct) { byte a = cm.getNextByte(); classType = DecodeClass(a); length = DecodeLenValType(a); switch (ct) { case CONTEXT_TAG.NULL: return(new BACVnetNull().Decode(cm)); case CONTEXT_TAG.BOOLEAN: return(new BACVnetBoolean().Decode(cm)); case CONTEXT_TAG.INT: return(new BACVnetInt().Decode(cm, length)); case CONTEXT_TAG.UINT: return(new BACVnetUInt().Decode(cm, length)); case CONTEXT_TAG.REAL: return(new BACVnetReal().Decode(cm, length)); case CONTEXT_TAG.DOUBLE: return(new BACVnetDouble().Decode(cm, length)); case CONTEXT_TAG.BSTRING: return(new BACVnetBString().Decode(cm, length)); case CONTEXT_TAG.CSTRING: return(new BACVnetCString().Decode(cm, length)); case CONTEXT_TAG.OSTRING: return(new BACVnetOString().Decode(cm, length)); case CONTEXT_TAG.DATE: return(new BACVnetDate().Decode(cm, length)); case CONTEXT_TAG.TIME: return(new BACVnetTime().Decode(cm, length)); case CONTEXT_TAG.ENUM: // 20.2.11 Encoding of an Enumerated Value; pg 1496 return(new BACVnetEnum().Decode(cm, length)); case CONTEXT_TAG.OBJECT: return(new BACVnetObjectIdentifier().Decode(cm, length)); } return(this); }
new public PDU Decode(BACPacket cm) { System.Console.Write("Decoding PDUComplexAck"); byte a = cm.getNextByte(); segMessage = DecodeSegMessage(a); moreFollows = DecodeMoreFollows(a); segResponseAccp = DecodeSegResponse(a); if (segResponseAccp == true) { maxSegmentsAccepted = (MAX_SEGMENTS_ACCEPTED)cm.getByte(); } maxAPDUlengthAccepted = DecodeMaxAPDUlengthAccp(cm.getNextByte()); invokeID = cm.getNextByte(); // If the optional parameter are present if (segMessage) { sequenceNumber = cm.getNextByte(); proposedWindowSize = cm.getNextByte(); } serviceChoice = (ConfirmedServiceChoice)cm.getNextByte(); switch (serviceChoice) { case ConfirmedServiceChoice.READPROPERTY: apduService = new APDUReadProperty(); apduService.Decode(cm); break; } return(this); }
public override BACVnetVar Decode(BACPacket cm) { booleanValue = (cm.getNextByte() & 0x01) == 0x01? true : false; return(this); }
new public PDU Decode(BACPacket cm) { cm.getNextByte(); return(this); }