A
Antonio Feliziani
HI,
i hve a problemi whit a little serial port proxi application,
the application send the byte recivedo from port1 to port 2 and from
port 2 to port 1
in this moment nothing more...
before i whant see the comunication and send command to my device.
I see the comunication ..send and recived the message but the
application not open connection whit the device correctly
My source code:
all'evento serialPort1_DataReceived
lock (bju)//bju.. ojb che mi serge giusto per fare il lock
{
List<byte> bBuffer = new List<byte>();
while (serialPort1.BytesToRead > 0)
bBuffer.Add((byte)serialPort1.ReadByte());
serialPort2.Write(bBuffer.ToArray(), 0,
bBuffer.ToArray
().Length);
bBuffer.Clear();
}
i have try also :
byte[] BytesLetti = new byte[1000];
int iBytesLetti = serialPort1.Read(BytesLetti, 0, 1000);
byte[] BytesToBridge = new byte[iBytesLetti];
Array.Copy(BytesLetti, BytesToBridge, iBytesLetti);
serialPort2.Write(BytesToBridge, 0, iBytesLetti);
what is the possible problem?
i hve a problemi whit a little serial port proxi application,
the application send the byte recivedo from port1 to port 2 and from
port 2 to port 1
in this moment nothing more...
before i whant see the comunication and send command to my device.
I see the comunication ..send and recived the message but the
application not open connection whit the device correctly
My source code:
all'evento serialPort1_DataReceived
lock (bju)//bju.. ojb che mi serge giusto per fare il lock
{
List<byte> bBuffer = new List<byte>();
while (serialPort1.BytesToRead > 0)
bBuffer.Add((byte)serialPort1.ReadByte());
serialPort2.Write(bBuffer.ToArray(), 0,
bBuffer.ToArray
().Length);
bBuffer.Clear();
}
i have try also :
byte[] BytesLetti = new byte[1000];
int iBytesLetti = serialPort1.Read(BytesLetti, 0, 1000);
byte[] BytesToBridge = new byte[iBytesLetti];
Array.Copy(BytesLetti, BytesToBridge, iBytesLetti);
serialPort2.Write(BytesToBridge, 0, iBytesLetti);
what is the possible problem?