示例#1
0
        /// <summary>
        /// Constructor for received Pdus.
        /// </summary>
        /// <param name="incomingBytes">The incoming bytes to translate to a Pdu.</param>
        protected Pdu(byte[] incomingBytes)
        {
                        #if DEBUG
            Console.WriteLine("In Pdu byte[] constructor");
                        #endif
            _PacketBytes    = incomingBytes;
            _CommandLength  = DecodeCommandLength(_PacketBytes);
            _CommandID      = DecodeCommandId(_PacketBytes);
            _CommandStatus  = UnsignedNumConverter.SwapByteOrdering(BitConverter.ToUInt32(_PacketBytes, 8));
            _SequenceNumber = UnsignedNumConverter.SwapByteOrdering(BitConverter.ToUInt32(_PacketBytes, 12));
            _PacketBytes    = TrimResponsePdu(_PacketBytes);

            //set the other Pdu-specific fields
            DecodeSmscResponse();
        }
 public EditorCommandEntry(CommandIdType commandId, int customSubId, EditorCommandStrategy commandExecutor)
 {
     this.CommandId       = commandId;
     this.CustomSubId     = customSubId;
     this.CommandExecutor = commandExecutor;
 }
示例#3
0
 /// <summary>
 /// Initializes this Pdu.  Override to add more functionality, but don't forget to
 /// call this one.
 /// </summary>
 protected virtual void InitPdu()
 {
     CommandStatus = 0;
     CommandID     = Pdu.CommandIdType.generic_nack;
 }