All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Amisha Jain (QUIC)" <quic_amisjain@quicinc.com>
To: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Cc: "Mohammed Sameer Mulla (QUIC)" <quic_mohamull@quicinc.com>,
	"Harish Bandi (QUIC)" <quic_hbandi@quicinc.com>,
	"Anubhav Gupta (QUIC)" <quic_anubhavg@quicinc.com>
Subject: RE: [PATCH v2] obex: Add messages_get_message() implementation for MAP plugin
Date: Wed, 12 Feb 2025 18:48:38 +0000	[thread overview]
Message-ID: <b54a7f6cc3ea48ec98a7c81ccfc40f7a@quicinc.com> (raw)
In-Reply-To: <20250206164852.3649751-1-quic_amisjain@quicinc.com>

Hi @linux-bluetooth@vger.kernel.org,
Please review the below patch.
Gentle reminder.

> -----Original Message-----
> From: Amisha Jain <quic_amisjain@quicinc.com>
> Sent: Thursday, February 6, 2025 10:19 PM
> To: linux-bluetooth@vger.kernel.org
> Cc: Mohammed Sameer Mulla (QUIC) <quic_mohamull@quicinc.com>;
> Harish Bandi (QUIC) <quic_hbandi@quicinc.com>; Anubhav Gupta (QUIC)
> <quic_anubhavg@quicinc.com>
> Subject: [PATCH v2] obex: Add messages_get_message() implementation for
> MAP plugin
> 
> GET Message() operation should be supported for passing below PTS
> testcases - 1.MAP/MSE/MMB/BV-12-C Verify that the MSE can return an email
> message to the MCE.
> 2.MAP/MSE/MMB/BV-13-C
> Verify that the MSE can return a SMS message in native format to the MCE.
> 3.MAP/MSE/MMB/BV-14-C
> Verify that the MSE can return a SMS message with text trans-coded to UTF-8
> to the MCE.
> 
> ---
>  obexd/plugins/mas.c            |  4 ++--
>  obexd/plugins/messages-dummy.c | 32
> +++++++++++++++++++++++++++++++-
>  2 files changed, 33 insertions(+), 3 deletions(-)
> 
> diff --git a/obexd/plugins/mas.c b/obexd/plugins/mas.c index
> 10b972d65..f63fcf6c6 100644
> --- a/obexd/plugins/mas.c
> +++ b/obexd/plugins/mas.c
> @@ -612,11 +612,11 @@ static void *message_open(const char *name, int
> oflag, mode_t mode,
>  		return NULL;
>  	}
> 
> +	mas->buffer = g_string_new("");
> +
>  	*err = messages_get_message(mas->backend_data, name, 0,
>  			get_message_cb, mas);
> 
> -	mas->buffer = g_string_new("");
> -
>  	if (*err < 0)
>  		return NULL;
>  	else
> diff --git a/obexd/plugins/messages-dummy.c b/obexd/plugins/messages-
> dummy.c index e313c6163..93648831a 100644
> --- a/obexd/plugins/messages-dummy.c
> +++ b/obexd/plugins/messages-dummy.c
> @@ -516,7 +516,37 @@ int messages_get_message(void *session, const char
> *handle,
>  					messages_get_message_cb callback,
>  					void *user_data)
>  {
> -	return -ENOSYS;
> +	struct session *s =  session;
> +	FILE *fp;
> +	char *path;
> +	char buffer[1024];
> +
> +	DBG(" ");
> +	path = g_build_filename(s->cwd_absolute, handle, NULL);
> +	fp = fopen(path, "r");
> +	if (fp == NULL)
> +	{
> +		DBG("fopen() failed");
> +		return -EBADR;
> +	}
> +
> +	/* 1024 is the maximum size of the line which is calculated to be more
> +	 * sufficient*/
> +	while (fgets(buffer, 1024, fp)) {
> +		if (callback)
> +		{
> +			callback(session, 0, 0, (const char*)buffer, user_data);
> +		}
> +	}
> +
> +	if (callback)
> +	{
> +		callback(session, 0, 0, NULL, user_data);
> +	}
> +
> +	g_free(path);
> +	fclose(fp);
> +	return 0;
>  }
> 
>  int messages_update_inbox(void *session, messages_status_cb callback,
> --
> 2.34.1
> 


  parent reply	other threads:[~2025-02-12 18:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-06 16:48 [PATCH v2] obex: Add messages_get_message() implementation for MAP plugin Amisha Jain
2025-02-06 18:09 ` [v2] " bluez.test.bot
2025-02-12 18:48 ` Amisha Jain (QUIC) [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-02-20  8:43 [PATCH v2] " Amisha Jain

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=b54a7f6cc3ea48ec98a7c81ccfc40f7a@quicinc.com \
    --to=quic_amisjain@quicinc.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=quic_anubhavg@quicinc.com \
    --cc=quic_hbandi@quicinc.com \
    --cc=quic_mohamull@quicinc.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.