Exemple #1
0
            public static Int32 Decode(ReceivedFrame frame, Byte[] buf, Int32 ptr, out String s)
            {
                String r = "";

                s = "";
                ptr++;

                if (frame.frameType.Equals(FrameTypes.UIType))
                {
                    frame.pidInfo = new PidInfo();
                    ptr           = frame.pidInfo.Decode(buf, ptr, out r);

                    if (frame.pidInfo.cmdDecode.Equals(PidInfo.CommandDecode.Standard))
                    {
                        //
                        // On standard PID fields, pre-load the segmentation chuck data where the PID used to be in the buffer.
                        // Extended info will already have the correct segmentation chunk info there.
                        //
                        buf[ptr] = Segmenter.StartOfSegment;
                    }

                    frame.iBuf = Support.PackByte(buf, ptr, (buf.Length - ptr));

                    s = r + "|||len:" + frame.iBuf.Length.ToString() + "|txt:(" + Support.GetString(frame.iBuf) + ")";
                }
                if (frame.frameType == FrameTypes.TESTType)
                {
                    frame.iBuf = Support.PackByte(buf, ptr, (buf.Length - ptr));
                }
                if (frame.frameType == FrameTypes.XIDType)
                {
                    XIDInfo xidInfo = new XIDInfo();
                    ptr            = xidInfo.Decode(buf, ptr, out r);
                    s              = r;
                    frame.xidFrame = xidInfo;
                }

                return(ptr);
            }
Exemple #2
0
            public static Int32 Decode(ReceivedFrame frame, Byte[] buf, Int32 ptr, out String s)
            {
                String r;

                //if (seqNumMode.Equals(SequenceNumberMode.Mod8))
                //{
                frame.numS = (buf[ptr] >> 1) & 0x07;
                frame.numR = (buf[ptr++] >> 5) & 0x07;

                //    NumR = (buf[ptr++] >> 5) & 0x07;
                //}
                //else
                //{
                //    NumS = (buf[ptr++] >> 1) & 0x7f;
                //    PFBit = buf[ptr] & 0x01;
                //    NumR = (buf[ptr++] >> 1) & 0x7f;
                //}
                s = "|ns=" + frame.numS.ToString() + "|nr=" + frame.numR.ToString();

                frame.pidInfo = new PidInfo();
                ptr           = frame.pidInfo.Decode(buf, ptr, out r);

                if (frame.pidInfo.cmdDecode.Equals(PidInfo.CommandDecode.Standard))
                {
                    //
                    // On standard PID fields, pre-load the segmentation chuck data where the PID used to be in the buffer.
                    // Extended info will already have the correct segmentation chunk info there.
                    //
                    buf[ptr] = Segmenter.StartOfSegment;
                }

                frame.iBuf = Support.PackByte(buf, ptr, (buf.Length - ptr));

                s = s + r + "|len:" + frame.iBuf.Length.ToString() + "|txt:(" + Support.GetString(frame.iBuf) + ")";

                return(ptr);
            }