ObexFTP current status of transfer operations

Help
2009-06-23
2013-05-01
  • Luka Napotnik
    Luka Napotnik
    2009-06-23

    Hello.

    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?

    Greets,
    Luka

     
    • Have a look at the callback function.

      In obexftp_open()
      http://dev.zuckschwerdt.org/obexftp/doxygen/html//client_8c.html#5d8a0ed9cc372e8c8785f4e19c36fe62

      defined as
      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.

       
      • Luka Napotnik
        Luka Napotnik
        2009-06-23

        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.