PDA

View Full Version : Wireless file transfer



Ron Marcus
- 27th December 2005, 02:41
Hey PICers,
I have an application that transfers a file from one SD card to another wirelessly. I've got the RF link working at 100%, but wondered what the proper protocol is for sending a file. Would one send the file size, then subtract the data packet size from that number at the receive end until it is zero? Or just send the data and timeout if there is no reception after a preset length of time? I don't want to add too much overhead to the transmissions, and need to recreate the file exactly at the receive end. Is there some trick to this, or am I overthinking it?
Thanks for any help,
Ron

skimask
- 27th December 2005, 05:00
Off the top of my head...remember the old XModem and Zmodem? Those might come in handy...
If I was you, I'd use RTP...Ron's Transfer Protocol. I've used something similar in the past, JTP...Jeremy's Transfer Protocol!

Seriously though...if the RF transfer works at close to 100%, then just go with whatever you think works. I built an MP3 player that uses a USB port (FTDI based). I use 513 byte blocks. I send out a load of $ff for sync'ing, at least a block worth, over 512 of them, send a block ID ($01=file length+file name, $03=file data, etc.etc), then send off the data, maybe three times in your case, best 2 out of 3 wins the block in case you get one or two corrupt bytes, then an end of block sequence, another dozen $ff's, then restart at the block ID mark...

Or whatever works...not much help I know. But if you're that confident in your RF method, you should need much error checking or identification. You're receiver firmware should know and expect what's coming next.

JDG

arniepj
- 27th December 2005, 12:11
I played around with the SNAP protocol a few years ago on a wired application and it worked fine.It could provide,at the least,some interesting reading.http://www.hth.com/snap/