EHS5 (EHS6): NON-Blocking serial communication | Telit Cinterion IoT Developer Community
October 8, 2015 - 11:46am, 2483 views
Hi all.
I've a problem.
I open a serial connection in non-blocking mode, and when I read the buffer, the modem halt on the read instruction. When I execute the seguent code, the system halt on the read instruction. Note: the code work perfectly on TC65i.
commConn = (CommConnection)Connector.open("comm:COM0;blocking=off;baudrate=9600");
inStream = commConn.openInputStream();
len = inStream.read( buffer );
Trying playing with CTS/RTS flowcontrol.
Hello,
The API says: "This method blocks until input data is available, the end of the stream is detected, or an exception is thrown." So this behaviour does not depend on "blocking" setting.
Please try the 'available()' method.
Regards,
Bartłomiej
Hi,
like Bartlomiej said you should check for availability of data on input. Here is some code if it will help you:
Regards,
Jure