CommConnection OutputStream | Telit Cinterion IoT Developer Community
August 9, 2016 - 8:25am, 3886 views
Hello,
I have a question about OutputStream of CommConnection interface.
I'm using the public void write(byte [] b) method to write a set of data to output.
The size of b array in my app is nearly 700 byte and I saw, above method writes 512 byte of data.
Probably the maximum buffer size of OutputStream of CommConnection.
Did you experince this maximum size for CommConnection OutputStream?
Is there a way of changing this buffer size?
Best Regards,
Hi Euyar,
could you provide a working snippet of your code, please?
What module are you using?
Regards
Piotr
--
Regards,
Piotr
Hi Piotr,
I'm using BGS5T terminal. I'm trying this work for ASC0 com port.
Code is simple. The main parts is like below:
private OutputStream MyOutStream;
byte [] dataArray = new byte [700];
MyOutStream.write(dataArray);
write method send only 512 bytes of all data.
Hi Euyar,
the internal buffers size are bigger than 512 bytes... Do you have enabled hardware flow control? Are you using it in your application? Notice that hardware flow control is enabled by default.
--
Regards,
Piotr
Hi Piotr,
Does buffer size change according to flow control? For this connection flow control is enabled.
I will try it by changing flow control as off.(autorts=off, autocts=off)
Is there somewhere buffer sizes is mentioned?
Hi Piotr,
I changed the com connection setting as autorts=off, autocts=off to provide flow control none and tested again.
The result is same. OutputStream.wrte(byte []) method writes 512 bytes of array although its size size greater than 512.
If it is possible, could you please test this function with a CommConnection example?
Hi Euyar,
I have checked this. Here is what I did:
On the terminal I got exactly 700 dots. Please check the above code. If this will not work for you please let us know what is exact FW version.
Hi Michal,
Thank you very much for reproducing the scenario and answer.
I tested your code with 2 terminal program. One puts 700 dots and the other again puts 512 dots.
I think terminal program putting 512 dots has some bugs or ***** some settings to be changed.
I tried the scenario by changing some settings but couldn't get successfull result.
A possible reason maybe write method writes data to output block by block (block size = 512 byte) and terminal program suppose all data has finished when a block has finished. The other possible reason is maybe flow control cannot be handled by terminal program properly.
Which terminal are you using? I'm using IONinja and "Terminal v1.9b by Br@y++".
Hello,
Michał has probably been using our internal terminal program. But you can also try Zoc, Hterm or Termite. I suppose this should be working properly with those.
This seems to be a terminal issue. You could try to trace the communication for example with a free HHD Serial Port Monitor if it makes sense for you.
Best regards,
Bartłomiej
Hello Bartlomiej,
Thanks for the answer. Yes, it seems a terminal issue.
I tried the scenario with Hterm and with Termite. Both terminal program gets 700 dots from com connection correctly.
Best Regards,