ObexFTP current status of transfer operations

  • Luka Napotnik

    Luka Napotnik - 2009-06-23


    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?


    • Christian W. Zuckschwerdt

      Have a look at the callback function.

      In obexftp_open()

      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?

        • Christian W. Zuckschwerdt

          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.


Log in to post a comment.