public byte[] Read(byte[] addr) { var tmppacket = new TmpPacket(addr, new byte[] { 0x00 }, false); tmppacket.ForceDataLength = true; return(Write(tmppacket)); }
public byte[] Write(TmpPacket tmppacket) { var wb_array = tmppacket.Express(); udpclient.Send(wb_array, wb_array.Length, FPGAEndPoint); IPEndPoint RemoteIpEndPoint = null; byte[] msg = udpclient.Receive(ref RemoteIpEndPoint); if (msg[0] != TmpPacket.VER_TYPE) { throw new Exception("VER_TYPE error"); } if (msg[1] == 0x89 || msg[1] == 0xc9) { throw new Exception("Bus error"); } return(msg); }