I made an apps in wpf using C#.net to send packet to the device and received response of the packet both in byte value. The packet response byte is based on the packet data length which keeps on varying as the data size increase.
I want to specific byte length which is to be read to read from the port,which keeps on changing.
Pls help how to read entire coming packet from port
i used following function:-
byte Responseofpacket_byte = datareceived(30);
public byte datareceived(int length)
byte fp = new byte[length];
for (int i = 0; i < length; i++)
//objRawdata.portreceivedata = port.ReadByte();
x = port.ReadByte();
fp[i] = Convert.ToByte(x);