Is there a method to check the status of the tx buffer?
If I just hard code in a delay(); does this block the serial transmission?
No. Interrupts happen even while delay() is wasting time.
Is there a way to find out if the tx buffer has been sent?
Serial.flush() does that. It waits until the outgoing serial buffer is empty.
I want to hold my processing until the zigbee transmission has completed.
Hold the processing of what? It's hard to guess what processing on the sender needs to wait until all data has been sent. Waiting until all data has been received is a different story, with a completely different solution.
PaulS:
If I just hard code in a delay(); does this block the serial transmission?
No. Interrupts happen even while delay() is wasting time.
Is there a way to find out if the tx buffer has been sent?
Serial.flush() does that. It waits until the outgoing serial buffer is empty.
I want to hold my processing until the zigbee transmission has completed.
Hold the processing of what? It's hard to guess what processing on the sender needs to wait until all data has been sent. Waiting until all data has been received is a different story, with a completely different solution.
Thanks Mark,
Just done some more testing....
It's the zigbee module that's going to sleep or something if there's no transmission for 5 seconds....
I need to do more digging in the xbee datasheet....
Thanks for the help though!
I have the impression that @richardtheboffin has deleted stuff from his original post so that the rest of this Thread makes little sense.
It would be nice if you could reinstate it for the benefit of others.
...R
Robin2:
I have the impression that @richardtheboffin has deleted stuff from his original post so that the rest of this Thread makes little sense.It would be nice if you could reinstate it for the benefit of others.
...R
Indeed! I was going to delete the whole post but Mark had already answered!
I had suspicions that calling delay(); immediately after sending to the serial port may be holding up the transmission, but I was mistaken.
I was looking for ways to wait for the transmission to complete before continuing with the next process, in my case sending some data over gprs.
I have since found that the zigbee radio fails to send anything if it's been left dormant for 5 seconds and it only wakes if data is sent from the other direction...
richardtheboffin:
I was looking for ways to wait for the transmission to complete before continuing with the next process, in my case sending some data over gprs.
how about:
while Serial.available()
{
//process your serial message
}
chew it all up at once...
BulldogLowell:
richardtheboffin:
I was looking for ways to wait for the transmission to complete before continuing with the next process, in my case sending some data over gprs.how about:
while Serial.available()
{
//process your serial message
}
chew it all up at once...
I'm waiting for stuff to go out, not come in.
I'm pretty sure serial.available() is for incoming data.
richardtheboffin:
BulldogLowell:
richardtheboffin:
I was looking for ways to wait for the transmission to complete before continuing with the next process, in my case sending some data over gprs.how about:
while Serial.available()
{
//process your serial message
}
chew it all up at once...
I'm waiting for stuff to go out, not come in.
I'm pretty sure serial.available() is for incoming data.
oops.
Serial.flush()