I need to send bin file to the Alljoyn enabled board from Android. What is the standard way to transfer it through Alljoyn.
How to transfer bin file to Alljoyn enabled board in Android
129 Views Asked by Robin Royal AtThere are 2 best solutions below
On
There has been some discussion of this in other forums in the past. The consensus seems to be to chunk and send via AllJoyn signals.
There is a java FileTransferModule library and corresponding FileTransferSample android app that was contributed to AllSeen Alliance several years ago (this git repo is in archive state now). It transfers files by chunking them and sending the chunks via AllJoyn signals. The project hadn't been updated in some time and wasn't running on Android 6, so I forked and fixed it. You can find the forked version on my github.
Here is the link to the updated FileTransferModule library:
All of the supported functionality of this library is intended to be accessed through the FileTransferModule class. Here is a brief description of its functionality from the FileTransferModule.java file comment:
The File Transfer Module is a library that provides application developers with a simple framework they can use to send and receive files with the various peers within their AllJoyn session. This module is designed to be utilized with any existing AllJoyn application with little, to no, modification. The framework provides many different operations to the application developer that include: announce/unannounce files to session peers, requesting file announcements from other peers, request file by file ID and by absolute path, cancel/pause file transfer, and offering files to a specified peer. There are also a series of listeners that allow the developer to be notified at the application level when various events occur; such examples include: an announcement being received by a session peer, a file transfer has completed, a session peer has offered you a file, or a file request by path has been received. The listeners allow the developer to respond accordingly to the various events. Furthermore, the user has tremendous flexibility through the ability to change the current AllJoyn sesion associated with File Transfer. This allows users to instantiate multiple instances of the File Transfer Module and specify a different AllJoyn session for each.
Side Note: There use to be some basic C++ and iOS FileTransfer samples in AllJoyn Core, but these have since been removed. If you wanted to you could go back and look at these older AllJoyn release branches to see how their algorithms compare.
RB14.06
alljoyn_core/samples/FileTransfer/
RB15.04
alljoyn_objc/samples/iOS/FileTransferClient/
alljoyn_objc/samples/iOS/FileTransferServer/
AJ has payload limitation so file needs to be sent in chunks. You can see example how it can be implemented using Alljoyn signals in this C++ sample: https://cgit.allseenalliance.org/core/test.git/tree/scl/bbftp.cc