Page 1 of 1

System lockup with more than one SerialNET.Port

Posted: Fri Jun 06, 2008 6:23 pm
by andygood
I have a question regarding the creation of more than one SerialNET.Port object. When I run the following code, my system locks up on execution of the last line:

SerialNET.Port m_Port1 = new SerialNET.Port();
m_Port1.ComPort = 40;
m_Port1.BaudRate = 9600;
m_Port1.Timeout = 5000;
m_Port1.Enabled = true;

SerialNET.Port m_Port2 = new SerialNET.Port();
m_Port2.ComPort = 41;
m_Port2.BaudRate = 9600;
m_Port2.Timeout = 5000;
m_Port2.Enabled = true;

Note the port numbers 40 and 41. These are two Bluetooth devices. Is the (Toshiba) bluetooth stack to blame? If I run the code using ports 1 and 2, there are no problems...

PLEASE NOTE: I've already resolved the issue using threads, so I'm really just posting this to get your opinion... [:)]

Thanks & regards,
Andy.

RE: System lockup with more than one SerialNET.Port

Posted: Sat Aug 02, 2008 9:37 pm
by RonG
I have two ports working OK on my HP device. Make sure you set the m_Portx.parent value. I have a main form, then created a class for the port, then instantiated a class for each port. Works just fine. No extra threads required, as SerialNET takes care of it.