linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bharat Bhusan Panda <bharat.panda@samsung.com>
To: linux-bluetooth@vger.kernel.org
Cc: cpgs@samsung.com
Subject: RE: [PATCH  2/2] obexd/ftp: Update ftp transfer progress
Date: Tue, 28 Oct 2014 19:57:05 +0530	[thread overview]
Message-ID: <005c01cff2bb$541b5fc0$fc521f40$@samsung.com> (raw)
In-Reply-To: <1414504462-25412-1-git-send-email-bharat.panda@samsung.com>

Hi,

> -----Original Message-----
> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
> owner@vger.kernel.org] On Behalf Of Bharat Panda
> Sent: Tuesday, October 28, 2014 7:24 PM
> To: linux-bluetooth@vger.kernel.org
> Cc: cpgs@samsung.com; Bharat Panda
> Subject: [PATCH 2/2] obexd/ftp: Update ftp transfer progress
> 
> Adds support for updating file transfer progress for FTP
> ---
>  obexd/plugins/ftp.c | 21 ++++++++++++++++++++-  obexd/plugins/ftp.h |
> 1 +
>  2 files changed, 21 insertions(+), 1 deletion(-)
> 
> diff --git a/obexd/plugins/ftp.c b/obexd/plugins/ftp.c index
> 773861d..2004a77 100644
> --- a/obexd/plugins/ftp.c
> +++ b/obexd/plugins/ftp.c
> @@ -59,6 +59,7 @@ static const uint8_t FTP_TARGET[TARGET_SIZE] = {
> 
>  struct ftp_session {
>  	struct obex_session *os;
> +	struct obex_transfer *transfer;
>  	char *folder;
>  };
> 
> @@ -116,6 +117,8 @@ void *ftp_connect(struct obex_session *os, int *err)
>  	if (err)
>  		*err = 0;
> 
> +	ftp->transfer = manager_register_transfer(os);
> +
>  	DBG("session %p created", ftp);
> 
>  	return ftp;
> @@ -136,6 +139,9 @@ int ftp_get(struct obex_session *os, void *user_data)
>  	if (ret < 0)
>  		return ret;
> 
> +	if (type == NULL)
> +		manager_emit_transfer_started(ftp->transfer);
> +
>  	return 0;
>  }
> 
> @@ -181,6 +187,9 @@ int ftp_chkput(struct obex_session *os, void
> *user_data)
> 
>  	ret = obex_put_stream_start(os, path);
> 
> +	if (ret == 0)
> +		manager_emit_transfer_started(ftp->transfer);
> +
>  	g_free(path);
> 
>  	return ret;
> @@ -471,10 +480,19 @@ void ftp_disconnect(struct obex_session *os, void
> *user_data)
> 
>  	manager_unregister_session(os);
> 
> +	manager_unregister_transfer(ftp->transfer);
> +
>  	g_free(ftp->folder);
>  	g_free(ftp);
>  }
> 
> +void ftp_progress(struct obex_session *os, void *user_data) {
> +	struct ftp_session *ftp = user_data;
> +
> +	manager_emit_transfer_progress(ftp->transfer);
> +}
> +
>  static struct obex_service_driver ftp = {
>  	.name = "File Transfer server",
>  	.service = OBEX_FTP,
> @@ -486,7 +504,8 @@ static struct obex_service_driver ftp = {
>  	.chkput = ftp_chkput,
>  	.setpath = ftp_setpath,
>  	.action = ftp_action,
> -	.disconnect = ftp_disconnect
> +	.disconnect = ftp_disconnect,
> +	.progress = ftp_progress
>  };
> 
>  static int ftp_init(void)
> diff --git a/obexd/plugins/ftp.h b/obexd/plugins/ftp.h index
> f06de84..c0e97a7 100644
> --- a/obexd/plugins/ftp.h
> +++ b/obexd/plugins/ftp.h
> @@ -28,3 +28,4 @@ int ftp_put(struct obex_session *os, void *user_data);
> int ftp_setpath(struct obex_session *os, void *user_data);  void
> ftp_disconnect(struct obex_session *os, void *user_data);  int
> ftp_action(struct obex_session *os, void *user_data);
> +void ftp_progress(struct obex_session *os, void *user_data);
> --
> 1.9.1


Please ignore this patch because of wrong patch sequencing.

BR,
Bharat


      reply	other threads:[~2014-10-28 14:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-28 13:54 [PATCH 2/2] obexd/ftp: Update ftp transfer progress Bharat Panda
2014-10-28 14:27 ` Bharat Bhusan Panda [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='005c01cff2bb$541b5fc0$fc521f40$@samsung.com' \
    --to=bharat.panda@samsung.com \
    --cc=cpgs@samsung.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).