9 years, 3 months ago.

Using the txIsBusy() method


I have been using the MODSERIAL library but am struggling to understand the example1.cpp. How do you use the txIsBusy method? I have tried several things but can't seem to get it to work.



Question relating to:

Erik - / MODSERIAL Featured
MODSERIAL with support for more devices Buffered, MODSERIAL, Serial

1 Answer

9 years, 3 months ago.

The function should return true when it is sending something and false otherwise. Mainly useful for RS485 networks.

Thank you for your reply. What I was hoping for was some code showing how to use the method. I am new at programming and can't see how to use it.

posted by Alexander Lang 23 Nov 2014

The question is more what do you want it to do? It might very well not be the function you are looking for.

posted by Erik - 23 Nov 2014

I'm using the mbed to received data from an RF field probe. The probe sends a huge packet of data at switch on and then once has received a specific command (goes into slave mode) responds upon request. I would like to be sure that all data has been correctly received from the probe before sending it another command. The example1.cpp code alludes to the fact that although the code has finished sending not all data has been received. I think the better method would be to probe the RXbuffer to see if it is empty. If all data has been sent the RX buffer will be empty.

posted by Alexander Lang 24 Nov 2014

I think you will need something like a TimeOut, where if no new data has been received for a while it should have received everything. Unless it simply finishes with a specific character, in which case you can wait on that one.

For sure TxIsBusy will not be related to received data./

posted by Erik - 24 Nov 2014