Download file from C SDK agent to local machine(using thingworx UI)
I have a C SDK agent running in a device. That device has got some log files (approx size - 100 MB).
I want to download the log files on to the local machine via ThingWorx UI using the file transfer mechanism.
My thing is of template RemoteThingWithTunnelsAndFileTransfer.
As per the C SDK developer guide, I have done the following for enabling file transfer alongwith the rest of the implementation -
#define ENABLE_FILE_XFER 1 //done at the top to enable file transfer
twcfg.file_xfer_staging_dir="/opt/thingworx/";
twFileManager_Create();
twFileManager_AddVirtualDir(thingName, "tw", "/opt/thingworx/staging_dir/"); //thingName points to name of a valid thing
twFileManager_AddVirtualDir(thingName, "tw2", "/opt/thingworx/staging_dir/out");
twFileManager_RegisterFileCallback(fileCallbackFunc, NULL, FALSE, NULL);
err = twApi_Connect(CONNECT_TIMEOUT, twcfg.connect_retries);
if (!err) {
/* Register our File Watcher with the tasker */
twApi_CreateTask(FILE_WATCHER_RATE_MSEC, fileWatcherTask);
}
When I run my program, my remote thing is connected(in ThingWorx, its 'isConnected' property gets set to 'true', I am able to invoke remote services on this remote thing as well).
When i try to test FileTransfer services(inherited) of my thing, like GetDirectoryStructure, I get an error - Unable to Invoke Service GetDirectoryStructure on <thingName> : null.
Please let me know if I am following the correct approach and how can I download the log file from the device.

