public void SetDataSample() { FrameCJT188_2004 frame = new FrameCJT188_2004(); byte[] data = Tools.HexStrToByteArr("68 10 88 05 27 10 15 20 00 01 03 90 1F 01 25 16", ' '); frame.SetData(data); byte[] data1 = Tools.HexStrToByteArr("68 10 88 05 27 10 15 20 00 81 16 90 1F 01 00 00 00 00 2C 00 00 00 00 2C 06 20 17 09 01 17 20 00 00 8E 16", ' '); frame.SetData(data1); }
public void IsProtocolSample() { byte[] data = Tools.HexStrToByteArr("68 10 88 05 27 10 15 20 00 01 03 90 1F 01 24 16", ' '); byte[] data1 = Tools.HexStrToByteArr("68 10 88 05 27 10 15 20 00 81 16 90 1F 01 00 00 00 00 2C 00 00 00 00 2C 06 20 17 09 01 17 20 00 00 8E 16", ' '); Result is0 = FrameCJT188_2004.IsProtocol(data, 0, data.Length); Assert.AreEqual(false, is0.Successful); bool is1 = FrameCJT188_2004.IsProtocol(data1, 0, data1.Length); Assert.AreEqual(true, is1); }
public void GetDataSample() { FrameCJT188_2004 frame = new FrameCJT188_2004(); frame.FMeterType = 0x10; frame.FAddress.Value = new byte[] { 0x00, 0x20, 0x15, 0x10, 0x27, 0x05, 0x88 }; frame.FControl.Value = 0x01; OtherDataField odf = new OtherDataField(); odf.FData.Value = new byte[] { 0x90, 0x1F, 0x01 }; frame.FDataField = odf; byte[] data = frame.GetData(); string str = String.Join(" ", data.Select(o => o.ToString("X2"))); }
public void ExtractFrameSample() { byte[] data = Tools.HexStrToByteArr("FE FE FE FE 68 10 88 05 27 10 15 20 00 01 03 90 1F 01 25 16 00 00 00", ' '); byte[] frame = FrameCJT188_2004.ExtractFrame(data); }