I'm using ObexFTP to transfer files from my phone to my computer. While the transfer is successful, the obexftp_get() function blocks. While this isn't such a problem (I can always run it within a thread), I don't know where I can get the transfer status (e.g. bytes already transmitted) so I can show a progress of the transfer.
Any ideas where this information is stored?
Have a look at the callback function.
typedef void(*) obexftp_info_cb_t(int event, const char *buf, int len, void *data)
You can use apps/obexftp.c to copy a working example.
Hm ok I added the callback but the value of the len variable is always 0 so it's useless if I try to show the transfer progress. Any ideas?
The "len" field gets a meaningful value on completed transfers only. It's the size of the buffer.
You could count the number of recieved callbacks and multiply that with the expected MTU or something.
We should do something about that. There's already a request for fast canceling transfers (i.e. only get the first few bytes) pending, too.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.