I've managed to send a file over serial from the t3 to the PC using Processing & java rxtx.
But, I'd like to ensure the data transfer is accurate. I need to ensure that the data has been received, that it's not corrupted, and some info about the file.
I've outlined below what I thought would work. Does anyone know if this has already been done? I don't want to use a big library though to just transmit a file.
arduino - periodically checks for command on serial
pc - sends command to receive file
arduino - closes file. Sends file info below:
<filename>test.edf</filename>
<filesize>-1</filesize>
<segmentBytes>512</segmentBytes>
<checksum>true</checksum>
<checksumBytes>4</checksumBytes>
arduino - listens for successful transmission
pc - sends command of success or retransmission
arduino - begins sending file, or retransmission of file info
pc - receives segmentBytes + checksum
Send success command, or command to re-send if doesn't match
arduino - waits for success command or re-send command
To end transmission
Last segment will have a -1 for checksum.
PC will then send a command to receive how many bytes in last chunk & checksum.
It will be a little awkward to send checksum on file info at beginning.
file info will need to fit in 1024bytes with an additional 4 byte checksum
I'm thinking this would be good for xbee too. I imagine I'm re-inventing the wheel here, but I also don't want to put a tractor tire on my RC car.
Is there anything that I'm missing or does this make sense as is?
But, I'd like to ensure the data transfer is accurate. I need to ensure that the data has been received, that it's not corrupted, and some info about the file.
I've outlined below what I thought would work. Does anyone know if this has already been done? I don't want to use a big library though to just transmit a file.
arduino - periodically checks for command on serial
pc - sends command to receive file
arduino - closes file. Sends file info below:
<filename>test.edf</filename>
<filesize>-1</filesize>
<segmentBytes>512</segmentBytes>
<checksum>true</checksum>
<checksumBytes>4</checksumBytes>
arduino - listens for successful transmission
pc - sends command of success or retransmission
arduino - begins sending file, or retransmission of file info
pc - receives segmentBytes + checksum
Send success command, or command to re-send if doesn't match
arduino - waits for success command or re-send command
To end transmission
Last segment will have a -1 for checksum.
PC will then send a command to receive how many bytes in last chunk & checksum.
It will be a little awkward to send checksum on file info at beginning.
file info will need to fit in 1024bytes with an additional 4 byte checksum
I'm thinking this would be good for xbee too. I imagine I'm re-inventing the wheel here, but I also don't want to put a tractor tire on my RC car.
Is there anything that I'm missing or does this make sense as is?