All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 6/6] doc/obex-api: Update documentation
@ 2019-12-16  9:28 Ajay Kishore
  2019-12-16  9:28 ` [PATCH v2 5/5] obexd: Handle MAP Event Report v1.1 and v1.2 Ajay Kishore
  2019-12-18  0:13 ` [PATCH 6/6] doc/obex-api: Update documentation Luiz Augusto von Dentz
  0 siblings, 2 replies; 4+ messages in thread
From: Ajay Kishore @ 2019-12-16  9:28 UTC (permalink / raw)
  To: linux-bluetooth

This adds documentation with the conversation listing feature

Signed-off-by: Ajay Kishore <ajay.kishore@intel.com>
---
 doc/obex-api.txt | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/doc/obex-api.txt b/doc/obex-api.txt
index f39355a..9a76159 100644
--- a/doc/obex-api.txt
+++ b/doc/obex-api.txt
@@ -712,6 +712,71 @@ Methods		void SetFolder(string name)
 			Possible errors: org.bluez.obex.Error.InvalidArguments
 					 org.bluez.obex.Error.Failed
 
+
+
+		array{object, dict} listconversations(string folder, dict filter)
+			Returns an array containing the conversations found in the
+			given subfolder of the current folder, or in the current
+			folder if folder is empty.
+
+			Possible Filters: LastActivityBegin, LastActivityEnd,
+			ReadStatus, Recipient
+
+
+			Properties:
+
+				string id:
+
+					Conversation unique identification
+
+				string name:
+
+					Conversation name
+
+				string last_activity:
+
+					Conversation timestamp for the last activity
+
+				boolean read_status:
+
+					Conversation read flag
+
+				string version_counter:
+
+					128 bits version counter.
+					The ‘Conversation-Listing Version Counter’,
+					‘Conversation Version Counter’, and ‘Folder
+					Version Counter’ are used to detect if something
+					has changed
+
+				string summary:
+
+					Conversation summary
+
+				string display:
+
+					Conversation participants name
+
+				string chat_state:
+
+					Conversation current chat state of the participants
+
+				string presence_availability:
+
+					Conversation  participants availability
+
+				string presence_text:
+
+					User defined status of the conversation
+
+				uint16 priority:
+
+					Conversation participant priority
+
+			Possible errors: org.bluez.obex.Error.InvalidArguments
+					 org.bluez.obex.Error.Failed
+
+
 		void UpdateInbox(void)
 
 			Request remote to update its inbox.
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 5/5] obexd: Handle MAP Event Report v1.1 and v1.2
  2019-12-16  9:28 [PATCH 6/6] doc/obex-api: Update documentation Ajay Kishore
@ 2019-12-16  9:28 ` Ajay Kishore
  2019-12-18  0:13 ` [PATCH 6/6] doc/obex-api: Update documentation Luiz Augusto von Dentz
  1 sibling, 0 replies; 4+ messages in thread
From: Ajay Kishore @ 2019-12-16  9:28 UTC (permalink / raw)
  To: linux-bluetooth

Changes made to add handler function for the corresponding
events mentioned in extended event reports 1.1 and 1.2.

Signed-off-by: Ajay Kishore <ajay.kishore@intel.com>
---
 obexd/client/map-event.h |  8 +++++++-
 obexd/client/map.c       | 19 +++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/obexd/client/map-event.h b/obexd/client/map-event.h
index 5414b26..c41bb67 100644
--- a/obexd/client/map-event.h
+++ b/obexd/client/map-event.h
@@ -32,7 +32,13 @@ enum map_event_type {
 	MAP_ET_MEMORY_FULL,
 	MAP_ET_MEMORY_AVAILABLE,
 	MAP_ET_MESSAGE_DELETED,
-	MAP_ET_MESSAGE_SHIFT
+	MAP_ET_MESSAGE_SHIFT,
+	MAP_ET_READ_STATUS_CHANGED,
+	MAP_ET_MESSAGE_REMOVED,
+	MAP_ET_MESSAGE_EXTENDED_DATA_CHANGED,
+	MAP_ET_PARTICIPANT_PRESENCE_CHANGED,
+	MAP_ET_PARTICIPANT_CHAT_STATE_CHANGED,
+	MAP_ET_CONVERSATION_CHANGED
 };
 
 struct map_event {
diff --git a/obexd/client/map.c b/obexd/client/map.c
index b65131a..846794f 100644
--- a/obexd/client/map.c
+++ b/obexd/client/map.c
@@ -2550,6 +2550,12 @@ static void map_handle_folder_changed(struct map_data *map,
 								"Folder");
 }
 
+static void map_handle_remove_message(struct map_data *map,
+						struct map_event *event)
+{
+	g_hash_table_remove(map->messages, &event->handle);
+}
+
 static void map_handle_notification(struct map_event *event, void *user_data)
 {
 	struct map_data *map = user_data;
@@ -2582,6 +2588,19 @@ static void map_handle_notification(struct map_event *event, void *user_data)
 	case MAP_ET_MESSAGE_SHIFT:
 		map_handle_folder_changed(map, event, event->folder);
 		break;
+	case MAP_ET_READ_STATUS_CHANGED:
+		map_handle_status_changed(map, event, "read");
+		break;
+	case MAP_ET_MESSAGE_REMOVED:
+		map_handle_remove_message(map, event);
+		break;
+	case MAP_ET_MESSAGE_EXTENDED_DATA_CHANGED:
+		map_handle_status_changed(map, event,
+					"message-extended-data-changed");
+		break;
+	case MAP_ET_PARTICIPANT_PRESENCE_CHANGED:
+	case MAP_ET_PARTICIPANT_CHAT_STATE_CHANGED:
+	case MAP_ET_CONVERSATION_CHANGED:
 	case MAP_ET_MEMORY_FULL:
 	case MAP_ET_MEMORY_AVAILABLE:
 	default:
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 6/6] doc/obex-api: Update documentation
  2019-12-16  9:28 [PATCH 6/6] doc/obex-api: Update documentation Ajay Kishore
  2019-12-16  9:28 ` [PATCH v2 5/5] obexd: Handle MAP Event Report v1.1 and v1.2 Ajay Kishore
@ 2019-12-18  0:13 ` Luiz Augusto von Dentz
  2019-12-24  5:47   ` Kishore, Ajay
  1 sibling, 1 reply; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2019-12-18  0:13 UTC (permalink / raw)
  To: Ajay Kishore; +Cc: linux-bluetooth

Hi Ajay,

On Mon, Dec 16, 2019 at 1:54 AM Ajay Kishore <ajay.kishore@intel.com> wrote:
>
> This adds documentation with the conversation listing feature
>
> Signed-off-by: Ajay Kishore <ajay.kishore@intel.com>
> ---
>  doc/obex-api.txt | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 65 insertions(+)
>
> diff --git a/doc/obex-api.txt b/doc/obex-api.txt
> index f39355a..9a76159 100644
> --- a/doc/obex-api.txt
> +++ b/doc/obex-api.txt
> @@ -712,6 +712,71 @@ Methods            void SetFolder(string name)
>                         Possible errors: org.bluez.obex.Error.InvalidArguments
>                                          org.bluez.obex.Error.Failed
>
> +
> +
> +               array{object, dict} listconversations(string folder, dict filter)

It should have been ListConversations to adhere with our D-Bus APIs,
but read bellow.

> +                       Returns an array containing the conversations found in the
> +                       given subfolder of the current folder, or in the current
> +                       folder if folder is empty.
> +
> +                       Possible Filters: LastActivityBegin, LastActivityEnd,
> +                       ReadStatus, Recipient

So here is the big design question, why hasn't this been done as a
filter to ListMessages? We could just have a couple of different
properties to indicate it is a conversation rather than a single
message, in any case we would need something like
org.bluez.obex.Conversation1 to enumerate these objects, something
that is not documented here.


> +
> +                       Properties:
> +
> +                               string id:
> +
> +                                       Conversation unique identification
> +
> +                               string name:
> +
> +                                       Conversation name
> +
> +                               string last_activity:
> +
> +                                       Conversation timestamp for the last activity
> +
> +                               boolean read_status:
> +
> +                                       Conversation read flag
> +
> +                               string version_counter:
> +
> +                                       128 bits version counter.
> +                                       The ‘Conversation-Listing Version Counter’,
> +                                       ‘Conversation Version Counter’, and ‘Folder
> +                                       Version Counter’ are used to detect if something
> +                                       has changed
> +
> +                               string summary:
> +
> +                                       Conversation summary
> +
> +                               string display:
> +
> +                                       Conversation participants name
> +
> +                               string chat_state:
> +
> +                                       Conversation current chat state of the participants
> +
> +                               string presence_availability:
> +
> +                                       Conversation  participants availability
> +
> +                               string presence_text:
> +
> +                                       User defined status of the conversation
> +
> +                               uint16 priority:
> +
> +                                       Conversation participant priority
> +
> +                       Possible errors: org.bluez.obex.Error.InvalidArguments
> +                                        org.bluez.obex.Error.Failed
> +
> +
>                 void UpdateInbox(void)
>
>                         Request remote to update its inbox.
> --
> 2.7.4
>


-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH 6/6] doc/obex-api: Update documentation
  2019-12-18  0:13 ` [PATCH 6/6] doc/obex-api: Update documentation Luiz Augusto von Dentz
@ 2019-12-24  5:47   ` Kishore, Ajay
  0 siblings, 0 replies; 4+ messages in thread
From: Kishore, Ajay @ 2019-12-24  5:47 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hi Luiz,

> -----Original Message-----
> From: linux-bluetooth-owner@vger.kernel.org <linux-bluetooth-
> owner@vger.kernel.org> On Behalf Of Luiz Augusto von Dentz
> Sent: Wednesday, December 18, 2019 5:44 AM
> To: Kishore, Ajay <ajay.kishore@intel.com>
> Cc: linux-bluetooth@vger.kernel.org
> Subject: Re: [PATCH 6/6] doc/obex-api: Update documentation
> 
> Hi Ajay,
> 
> On Mon, Dec 16, 2019 at 1:54 AM Ajay Kishore <ajay.kishore@intel.com>
> wrote:
> >
> > This adds documentation with the conversation listing feature
> >
> > Signed-off-by: Ajay Kishore <ajay.kishore@intel.com>
> > ---
> >  doc/obex-api.txt | 65
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 65 insertions(+)
> >
> > diff --git a/doc/obex-api.txt b/doc/obex-api.txt index
> > f39355a..9a76159 100644
> > --- a/doc/obex-api.txt
> > +++ b/doc/obex-api.txt
> > @@ -712,6 +712,71 @@ Methods            void SetFolder(string name)
> >                         Possible errors: org.bluez.obex.Error.InvalidArguments
> >                                          org.bluez.obex.Error.Failed
> >
> > +
> > +
> > +               array{object, dict} listconversations(string folder,
> > + dict filter)
> 
> It should have been ListConversations to adhere with our D-Bus APIs, but
> read bellow.
Fixed and pushed in the new patch ([PATCH v2 6/6] doc/obex-api: Update documentation).
> 
> > +                       Returns an array containing the conversations found in the
> > +                       given subfolder of the current folder, or in the current
> > +                       folder if folder is empty.
> > +
> > +                       Possible Filters: LastActivityBegin, LastActivityEnd,
> > +                       ReadStatus, Recipient
> 
> So here is the big design question, why hasn't this been done as a filter to
> ListMessages? We could just have a couple of different properties to indicate
> it is a conversation rather than a single message, in any case we would need
> something like
> org.bluez.obex.Conversation1 to enumerate these objects, something that is
> not documented here.
I Agree that the few properties are similar in ListMessages  and ListConversations functions and can be implemented to just add few new properties.
But we thought to implement both these functions separately as in MAP specification also it is separated.
Also with this implementation it will easier to develop separate application for both the feature.
In the current implementation we are using org.bluez.obex.Conversation1 interface to enumerate and it is updated in the new patch ([PATCH v2 6/6] doc/obex-api: Update documentation).

> 
> 
> > +
> > +                       Properties:
> > +
> > +                               string id:
> > +
> > +                                       Conversation unique
> > + identification
> > +
> > +                               string name:
> > +
> > +                                       Conversation name
> > +
> > +                               string last_activity:
> > +
> > +                                       Conversation timestamp for the
> > + last activity
> > +
> > +                               boolean read_status:
> > +
> > +                                       Conversation read flag
> > +
> > +                               string version_counter:
> > +
> > +                                       128 bits version counter.
> > +                                       The ‘Conversation-Listing Version Counter’,
> > +                                       ‘Conversation Version Counter’, and ‘Folder
> > +                                       Version Counter’ are used to detect if something
> > +                                       has changed
> > +
> > +                               string summary:
> > +
> > +                                       Conversation summary
> > +
> > +                               string display:
> > +
> > +                                       Conversation participants name
> > +
> > +                               string chat_state:
> > +
> > +                                       Conversation current chat
> > + state of the participants
> > +
> > +                               string presence_availability:
> > +
> > +                                       Conversation  participants
> > + availability
> > +
> > +                               string presence_text:
> > +
> > +                                       User defined status of the
> > + conversation
> > +
> > +                               uint16 priority:
> > +
> > +                                       Conversation participant
> > + priority
> > +
> > +                       Possible errors: org.bluez.obex.Error.InvalidArguments
> > +                                        org.bluez.obex.Error.Failed
> > +
> > +
> >                 void UpdateInbox(void)
> >
> >                         Request remote to update its inbox.
> > --
> > 2.7.4
> >
> 
> 
> --
> Luiz Augusto von Dentz

Thanks.
Ajay Kishore

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-24  5:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-16  9:28 [PATCH 6/6] doc/obex-api: Update documentation Ajay Kishore
2019-12-16  9:28 ` [PATCH v2 5/5] obexd: Handle MAP Event Report v1.1 and v1.2 Ajay Kishore
2019-12-18  0:13 ` [PATCH 6/6] doc/obex-api: Update documentation Luiz Augusto von Dentz
2019-12-24  5:47   ` Kishore, Ajay

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.