An example program for SerialFileTransfer, receives files from a java application and stores them on the LocalFileSystem
Dependencies: MODSERIAL SerialFileTransfer SimpleSerialProtocol mbed
SerialFileReceiver allow the mbed to receive a file using binary packets over the serial connection,
you can test the library with this java application /media/uploads/p3p/mbedserialfiletransfer.zip
the arguments to the command are, Comport Baudrate file to see the console output use java, not javaw
Example command: java -jar SerialTransfer.jar com3 115200 test.bin
Revision 3:116c45e2a41e, committed 2014-09-18
- Comitter:
- p3p
- Date:
- Thu Sep 18 17:49:08 2014 +0000
- Parent:
- 2:1c0a9448df44
- Child:
- 4:dfe9a9434a92
- Commit message:
- Updated to reflect changes in SimpleSErialProtocol
Changed in this revision
--- a/SerialFileTransfer.lib Wed Aug 27 18:03:07 2014 +0000 +++ b/SerialFileTransfer.lib Thu Sep 18 17:49:08 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/p3p/code/SerialFileTransfer/#31dff1f79b4f +http://mbed.org/users/p3p/code/SerialFileTransfer/#f8aaff9c57e3
--- a/SimpleSerialProtocol.lib Wed Aug 27 18:03:07 2014 +0000 +++ b/SimpleSerialProtocol.lib Thu Sep 18 17:49:08 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/p3p/code/SimpleSerialProtocol/#98ad30934a71 +http://mbed.org/users/p3p/code/SimpleSerialProtocol/#43794e0b738f
--- a/main.cpp Wed Aug 27 18:03:07 2014 +0000 +++ b/main.cpp Thu Sep 18 17:49:08 2014 +0000 @@ -9,8 +9,9 @@ SFTProtocol fileAcceptor; int main() { - //initialise the comm port at 155200 baud - comms.initialise(115200); + //initialise the comm port at 155200 baud and use the default codec + SimpleSerialProtocol::Codec codec; + comms.initialise(115200, &codec); //listen for packets of type 1 and relay the data to the onFileStart callback in SFTProtocol comms.receiveCallback(1, &fileAcceptor, &SFTProtocol::onFileStart); //listen for packets of type 3 and relay