linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] Add support for MAP MASInstance feature
@ 2014-10-07  4:06 Gowtham Anandha Babu
  2014-10-07  4:06 ` [PATCH 1/6] doc/obex-api: Add description about MASInstance request Gowtham Anandha Babu
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Gowtham Anandha Babu @ 2014-10-07  4:06 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: d.kasatkin, bharat.panda, cpgs, Gowtham Anandha Babu

This patch-set implements MAP 1.2 MAS Instance feature.

The patch 1,2,3 will handle the Client part(MCE). It passes
the PTS 5.3 test case:TC_MCE_MMI_BV_01_I.

The patch 4,5,6 will handle the Server part(MSE). It passes
the PTS 5.3 test case:TC_MSE_MMI_BV_02_I.

Gowtham Anandha Babu (6):
  doc/obex-api: Add description about MASInstance request
  test/map-client: Add D-Bus API support to make MASInstance request
  obexd/client/map: Add API Calls for request and handlers for response
  obexd/mas: Add support for providing MASInstance Info as response
  obexd/messages: Add prototypes for MASInstance response
  obexd/message-dummy: Add MAS Instance description to response

 doc/obex-api.txt               |  6 +++
 obexd/client/map.c             | 88 ++++++++++++++++++++++++++++++++++++++++++
 obexd/plugins/mas.c            | 62 +++++++++++++++++++++++++++++
 obexd/plugins/messages-dummy.c | 18 +++++++++
 obexd/plugins/messages.h       | 16 ++++++++
 test/map-client                |  9 +++++
 6 files changed, 199 insertions(+)

-- 
1.9.1


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

* [PATCH 1/6] doc/obex-api: Add description about MASInstance request
  2014-10-07  4:06 [PATCH 0/6] Add support for MAP MASInstance feature Gowtham Anandha Babu
@ 2014-10-07  4:06 ` Gowtham Anandha Babu
  2014-10-07  4:06 ` [PATCH 2/6] test/map-client: Add D-Bus API support to make " Gowtham Anandha Babu
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Gowtham Anandha Babu @ 2014-10-07  4:06 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: d.kasatkin, bharat.panda, cpgs, Gowtham Anandha Babu

---
 doc/obex-api.txt | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/doc/obex-api.txt b/doc/obex-api.txt
index a39abc0..d432da1 100644
--- a/doc/obex-api.txt
+++ b/doc/obex-api.txt
@@ -715,6 +715,12 @@ Methods		void SetFolder(string name)
 			Possible errors: org.bluez.obex.Error.InvalidArguments
 					 org.bluez.obex.Error.Failed
 
+		string GetMASInstanceInfo(void)
+
+			Request remote for MAS Instance Information
+
+			Possible errors: org.bluez.obex.Error.InvalidArguments
+					 org.bluez.obex.Error.Failed
 
 Filter:		uint16 Offset:
 
-- 
1.9.1


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

* [PATCH 2/6] test/map-client: Add D-Bus API support to make MASInstance request
  2014-10-07  4:06 [PATCH 0/6] Add support for MAP MASInstance feature Gowtham Anandha Babu
  2014-10-07  4:06 ` [PATCH 1/6] doc/obex-api: Add description about MASInstance request Gowtham Anandha Babu
@ 2014-10-07  4:06 ` Gowtham Anandha Babu
  2014-10-07  4:06 ` [PATCH 3/6] obexd/client/map: Add API Calls for request and handlers for response Gowtham Anandha Babu
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Gowtham Anandha Babu @ 2014-10-07  4:06 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: d.kasatkin, bharat.panda, cpgs, Gowtham Anandha Babu

---
 test/map-client | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/test/map-client b/test/map-client
index b9695da..a1666b2 100755
--- a/test/map-client
+++ b/test/map-client
@@ -66,6 +66,8 @@ def parse_options():
 			help="Undeletes the message")
 	parser.add_option("-u", "--update-inbox", action="store_true", dest="update_inbox",
 			help="Checks for new mails")
+	parser.add_option("-m", "--mas-instance-info", action="store_true", dest="get_mas_info",
+			help="Get MAS Instance Information")
 
 	return parser.parse_args()
 
@@ -172,6 +174,10 @@ class MapClient:
 	def update_inbox(self):
 		self.map.UpdateInbox()
 
+	def get_mas_instance_info(self):
+		ret = self.map.GetMASInstanceInfo()
+		print(pformat(unwrap(ret)))
+
 
 if  __name__ == '__main__':
 
@@ -229,4 +235,7 @@ if  __name__ == '__main__':
 	if options.update_inbox:
 		map_client.update_inbox()
 
+	if options.get_mas_info:
+		map_client.get_mas_instance_info()
+
 	mainloop.run()
-- 
1.9.1


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

* [PATCH 3/6] obexd/client/map: Add API Calls for request and handlers for response
  2014-10-07  4:06 [PATCH 0/6] Add support for MAP MASInstance feature Gowtham Anandha Babu
  2014-10-07  4:06 ` [PATCH 1/6] doc/obex-api: Add description about MASInstance request Gowtham Anandha Babu
  2014-10-07  4:06 ` [PATCH 2/6] test/map-client: Add D-Bus API support to make " Gowtham Anandha Babu
@ 2014-10-07  4:06 ` Gowtham Anandha Babu
  2014-10-07  4:06 ` [PATCH 4/6] obexd/mas: Add support for providing MASInstance Info as response Gowtham Anandha Babu
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Gowtham Anandha Babu @ 2014-10-07  4:06 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: d.kasatkin, bharat.panda, cpgs, Gowtham Anandha Babu

---
 obexd/client/map.c | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 88 insertions(+)

diff --git a/obexd/client/map.c b/obexd/client/map.c
index 44db96c..50b498c 100644
--- a/obexd/client/map.c
+++ b/obexd/client/map.c
@@ -1800,6 +1800,90 @@ static DBusMessage *map_push_message(DBusConnection *connection,
 	return push_message(map, message, filename, folder, apparam);
 }
 
+static void mas_instance_info_cb(struct obc_session *session,
+				struct obc_transfer *transfer,
+				GError *err, void *user_data)
+{
+	struct pending_request *request = user_data;
+	DBusMessage *reply;
+	char *contents;
+	size_t size;
+	int perr;
+
+	if (err != NULL) {
+		reply = g_dbus_create_error(request->msg,
+						ERROR_INTERFACE ".Failed",
+						"%s", err->message);
+		goto done;
+	}
+
+	perr = obc_transfer_get_contents(transfer, &contents, &size);
+	if (perr < 0) {
+		reply = g_dbus_create_error(request->msg,
+						ERROR_INTERFACE ".Failed",
+						"Error reading contents: %s",
+						strerror(-perr));
+		goto done;
+	}
+
+	reply = dbus_message_new_method_return(request->msg);
+	if (reply == NULL) {
+		g_free(contents);
+		goto clean;
+	}
+
+	dbus_message_append_args(reply, DBUS_TYPE_STRING, &contents,
+							DBUS_TYPE_INVALID);
+done:
+	g_dbus_send_message(conn, reply);
+clean:
+	pending_request_free(request);
+
+}
+
+static DBusMessage *map_get_mas_instance_info(DBusConnection *connection,
+					DBusMessage *message, void *user_data)
+{
+	struct map_data *map = user_data;
+	GObexApparam *apparam;
+	struct pending_request *request;
+	struct obc_transfer *transfer;
+	GError *err = NULL;
+	DBusMessage *reply;
+
+	if (map->mas_instance_id < 0)
+		return g_dbus_create_error(message,
+				ERROR_INTERFACE ".InvalidArguments", NULL);
+
+	apparam = g_obex_apparam_set_uint16(NULL, MAP_AP_MASINSTANCEID,
+							map->mas_instance_id);
+
+	transfer = obc_transfer_get("x-bt/MASInstanceInformation", NULL, NULL, &err);
+	if (transfer == NULL) {
+		g_obex_apparam_free(apparam);
+		goto fail;
+	}
+
+	obc_transfer_set_apparam(transfer, apparam);
+
+	request = pending_request_new(map, message);
+
+	if (!obc_session_queue(map->session, transfer, mas_instance_info_cb,
+							request, &err)) {
+		pending_request_free(request);
+		goto fail;
+	}
+
+	return NULL;
+
+fail:
+	reply = g_dbus_create_error(message, ERROR_INTERFACE ".Failed", "%s",
+								err->message);
+	g_error_free(err);
+	return reply;
+
+}
+
 static const GDBusMethodTable map_methods[] = {
 	{ GDBUS_ASYNC_METHOD("SetFolder",
 				GDBUS_ARGS({ "name", "s" }), NULL,
@@ -1826,6 +1910,10 @@ static const GDBusMethodTable map_methods[] = {
 			GDBUS_ARGS({ "transfer", "o" },
 						{ "properties", "a{sv}" }),
 			map_push_message) },
+	{ GDBUS_ASYNC_METHOD("GetMASInstanceInfo",
+			NULL,
+			GDBUS_ARGS({ "description", "s" }),
+			map_get_mas_instance_info) },
 	{ }
 };
 
-- 
1.9.1


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

* [PATCH 4/6] obexd/mas: Add support for providing MASInstance Info as response
  2014-10-07  4:06 [PATCH 0/6] Add support for MAP MASInstance feature Gowtham Anandha Babu
                   ` (2 preceding siblings ...)
  2014-10-07  4:06 ` [PATCH 3/6] obexd/client/map: Add API Calls for request and handlers for response Gowtham Anandha Babu
@ 2014-10-07  4:06 ` Gowtham Anandha Babu
  2014-10-07  4:06 ` [PATCH 5/6] obexd/messages: Add prototypes for MASInstance response Gowtham Anandha Babu
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Gowtham Anandha Babu @ 2014-10-07  4:06 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: d.kasatkin, bharat.panda, cpgs, Gowtham Anandha Babu

---
 obexd/plugins/mas.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/obexd/plugins/mas.c b/obexd/plugins/mas.c
index fb97fe3..f9ccab7 100644
--- a/obexd/plugins/mas.c
+++ b/obexd/plugins/mas.c
@@ -660,6 +660,56 @@ static void *message_set_status_open(const char *name, int oflag, mode_t mode,
 	return mas;
 }
 
+static void get_mas_instance_info_cb(void *session, int err, uint16_t size,
+					const char *name, void *user_data)
+{
+	struct mas_session *mas = user_data;
+
+	DBG("");
+
+	if (err < 0 && err != -EAGAIN) {
+		obex_object_set_io_flags(mas, G_IO_ERR, err);
+		return;
+	}
+
+	g_string_append(mas->buffer, name);
+
+	mas->finished = TRUE;
+	mas->outparams = NULL;
+
+	if (err != -EAGAIN)
+		obex_object_set_io_flags(mas, G_IO_IN, err);
+
+}
+
+static void *mas_instance_info_open(const char *name, int oflag, mode_t mode,
+				void *driver_data, size_t *size, int *err)
+{
+	struct mas_session *mas = driver_data;
+	uint16_t mas_instance_id = -1;
+
+	DBG("name %s ", name);
+
+	if (oflag != O_RDONLY) {
+		*err = -EBADR;
+		return NULL;
+	}
+
+	g_obex_apparam_get_uint16(mas->inparams, MAP_AP_MASINSTANCEID, &mas_instance_id);
+
+	DBG("mas-instance-id : %d", mas_instance_id);
+
+	mas->buffer = g_string_new("");
+
+	*err = messages_get_mas_instance_info(mas->backend_data, mas_instance_id,
+			get_mas_instance_info_cb, mas);
+	if (*err < 0)
+		return NULL;
+	else
+		return mas;
+}
+
+
 static ssize_t any_get_next_header(void *object, void *buf, size_t mtu,
 								uint8_t *hi)
 {
@@ -812,6 +862,17 @@ static struct obex_mime_type_driver mime_message_update = {
 	.write = any_write,
 };
 
+static struct obex_mime_type_driver mime_mas_instance_info = {
+	.target = MAS_TARGET,
+	.target_size = TARGET_SIZE,
+	.mimetype = "x-bt/MASInstanceInformation",
+	.get_next_header = any_get_next_header,
+	.open = mas_instance_info_open,
+	.close = any_close,
+	.read = any_read,
+	.write = any_write,
+};
+
 static struct obex_mime_type_driver *map_drivers[] = {
 	&mime_map,
 	&mime_message,
@@ -820,6 +881,7 @@ static struct obex_mime_type_driver *map_drivers[] = {
 	&mime_notification_registration,
 	&mime_message_status,
 	&mime_message_update,
+	&mime_mas_instance_info,
 	NULL
 };
 
-- 
1.9.1


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

* [PATCH 5/6] obexd/messages: Add prototypes for MASInstance response
  2014-10-07  4:06 [PATCH 0/6] Add support for MAP MASInstance feature Gowtham Anandha Babu
                   ` (3 preceding siblings ...)
  2014-10-07  4:06 ` [PATCH 4/6] obexd/mas: Add support for providing MASInstance Info as response Gowtham Anandha Babu
@ 2014-10-07  4:06 ` Gowtham Anandha Babu
  2014-10-08 11:12   ` Luiz Augusto von Dentz
  2014-10-07  4:06 ` [PATCH 6/6] obexd/message-dummy: Add MAS Instance description to response Gowtham Anandha Babu
  2014-10-08 10:38 ` [PATCH 0/6] Add support for MAP MASInstance feature Luiz Augusto von Dentz
  6 siblings, 1 reply; 13+ messages in thread
From: Gowtham Anandha Babu @ 2014-10-07  4:06 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: d.kasatkin, bharat.panda, cpgs, Gowtham Anandha Babu

---
 obexd/plugins/messages.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/obexd/plugins/messages.h b/obexd/plugins/messages.h
index 00a16b1..3aaeec1 100644
--- a/obexd/plugins/messages.h
+++ b/obexd/plugins/messages.h
@@ -307,3 +307,19 @@ int messages_set_delete(void *session, const char *handle, uint8_t value,
  * session: Backend session.
  */
 void messages_abort(void *session);
+
+
+
+/* Retrieves MAS Instance Information for the given mas-instance id.
+ *
+ * session: Backend session.
+ * mas_id: MAS Instance id requested by the MCE.
+ *
+ * Callback shall be called for every mas_instance_id request received from MCE.
+ */
+typedef void (*messages_mas_instance_info_cb)(void *session, int err,
+		uint16_t size, const char *name, void *user_data);
+
+int messages_get_mas_instance_info(void *session, uint16_t mas_instance_id,
+				messages_mas_instance_info_cb callback,
+				void *user_data);
-- 
1.9.1


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

* [PATCH 6/6] obexd/message-dummy: Add MAS Instance description to response
  2014-10-07  4:06 [PATCH 0/6] Add support for MAP MASInstance feature Gowtham Anandha Babu
                   ` (4 preceding siblings ...)
  2014-10-07  4:06 ` [PATCH 5/6] obexd/messages: Add prototypes for MASInstance response Gowtham Anandha Babu
@ 2014-10-07  4:06 ` Gowtham Anandha Babu
  2014-10-08 10:38 ` [PATCH 0/6] Add support for MAP MASInstance feature Luiz Augusto von Dentz
  6 siblings, 0 replies; 13+ messages in thread
From: Gowtham Anandha Babu @ 2014-10-07  4:06 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: d.kasatkin, bharat.panda, cpgs, Gowtham Anandha Babu

---
 obexd/plugins/messages-dummy.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/obexd/plugins/messages-dummy.c b/obexd/plugins/messages-dummy.c
index bb0627f..11da432 100644
--- a/obexd/plugins/messages-dummy.c
+++ b/obexd/plugins/messages-dummy.c
@@ -365,6 +365,24 @@ int messages_set_delete(void *session, const char *handle, uint8_t value,
 	return -ENOSYS;
 }
 
+
+int messages_get_mas_instance_info(void *s, uint16_t mas_instance_id,
+					messages_mas_instance_info_cb callback,
+					void *user_data)
+{
+	struct session *session =  s;
+
+/*
+ * The MAS Instance information is implementation specific.
+ */
+
+	char *info = "9876543210 : MAS INSTANCE INFO";
+
+	DBG("");
+	callback(session, 0, 0, info, user_data);
+
+	return 0;
+}
 void messages_abort(void *s)
 {
 	struct session *session = s;
-- 
1.9.1


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

* Re: [PATCH 0/6] Add support for MAP MASInstance feature
  2014-10-07  4:06 [PATCH 0/6] Add support for MAP MASInstance feature Gowtham Anandha Babu
                   ` (5 preceding siblings ...)
  2014-10-07  4:06 ` [PATCH 6/6] obexd/message-dummy: Add MAS Instance description to response Gowtham Anandha Babu
@ 2014-10-08 10:38 ` Luiz Augusto von Dentz
  2014-10-08 12:08   ` Gowtham Anandha Babu
  6 siblings, 1 reply; 13+ messages in thread
From: Luiz Augusto von Dentz @ 2014-10-08 10:38 UTC (permalink / raw)
  To: Gowtham Anandha Babu
  Cc: linux-bluetooth@vger.kernel.org, Dmitry Kasatkin, Bharat Panda,
	cpgs

Hi,

On Tue, Oct 7, 2014 at 7:06 AM, Gowtham Anandha Babu
<gowtham.ab@samsung.com> wrote:
> This patch-set implements MAP 1.2 MAS Instance feature.
>
> The patch 1,2,3 will handle the Client part(MCE). It passes
> the PTS 5.3 test case:TC_MCE_MMI_BV_01_I.
>
> The patch 4,5,6 will handle the Server part(MSE). It passes
> the PTS 5.3 test case:TC_MSE_MMI_BV_02_I.
>
> Gowtham Anandha Babu (6):
>   doc/obex-api: Add description about MASInstance request
>   test/map-client: Add D-Bus API support to make MASInstance request
>   obexd/client/map: Add API Calls for request and handlers for response
>   obexd/mas: Add support for providing MASInstance Info as response
>   obexd/messages: Add prototypes for MASInstance response
>   obexd/message-dummy: Add MAS Instance description to response
>
>  doc/obex-api.txt               |  6 +++
>  obexd/client/map.c             | 88 ++++++++++++++++++++++++++++++++++++++++++
>  obexd/plugins/mas.c            | 62 +++++++++++++++++++++++++++++
>  obexd/plugins/messages-dummy.c | 18 +++++++++
>  obexd/plugins/messages.h       | 16 ++++++++
>  test/map-client                |  9 +++++
>  6 files changed, 199 insertions(+)
>
> --
> 1.9.1

My plan is to actually do this as the name of the folder for each instance:

<MAS 1 info>/telecom/...
<MAS 2 info>/telecom/...

If there is no info, due to version or lack of support, then we
fallback to record description or something like that so we can
support multiple instances.


-- 
Luiz Augusto von Dentz

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

* Re: [PATCH 5/6] obexd/messages: Add prototypes for MASInstance response
  2014-10-07  4:06 ` [PATCH 5/6] obexd/messages: Add prototypes for MASInstance response Gowtham Anandha Babu
@ 2014-10-08 11:12   ` Luiz Augusto von Dentz
  2014-10-08 12:09     ` Gowtham Anandha Babu
  0 siblings, 1 reply; 13+ messages in thread
From: Luiz Augusto von Dentz @ 2014-10-08 11:12 UTC (permalink / raw)
  To: Gowtham Anandha Babu
  Cc: linux-bluetooth@vger.kernel.org, Dmitry Kasatkin, Bharat Panda,
	cpgs

Hi,

On Tue, Oct 7, 2014 at 7:06 AM, Gowtham Anandha Babu
<gowtham.ab@samsung.com> wrote:
> ---
>  obexd/plugins/messages.h | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/obexd/plugins/messages.h b/obexd/plugins/messages.h
> index 00a16b1..3aaeec1 100644
> --- a/obexd/plugins/messages.h
> +++ b/obexd/plugins/messages.h
> @@ -307,3 +307,19 @@ int messages_set_delete(void *session, const char *handle, uint8_t value,
>   * session: Backend session.
>   */
>  void messages_abort(void *session);
> +
> +
> +
> +/* Retrieves MAS Instance Information for the given mas-instance id.
> + *
> + * session: Backend session.
> + * mas_id: MAS Instance id requested by the MCE.
> + *
> + * Callback shall be called for every mas_instance_id request received from MCE.
> + */
> +typedef void (*messages_mas_instance_info_cb)(void *session, int err,
> +               uint16_t size, const char *name, void *user_data);
> +
> +int messages_get_mas_instance_info(void *session, uint16_t mas_instance_id,
> +                               messages_mas_instance_info_cb callback,
> +                               void *user_data);
> --
> 1.9.1

You can drop using mas here since it is pretty obvious what it is for,
also Im not sure we need the size in the callback since we can use
strlen there.


-- 
Luiz Augusto von Dentz

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

* RE: [PATCH 0/6] Add support for MAP MASInstance feature
  2014-10-08 10:38 ` [PATCH 0/6] Add support for MAP MASInstance feature Luiz Augusto von Dentz
@ 2014-10-08 12:08   ` Gowtham Anandha Babu
  0 siblings, 0 replies; 13+ messages in thread
From: Gowtham Anandha Babu @ 2014-10-08 12:08 UTC (permalink / raw)
  To: 'Luiz Augusto von Dentz'
  Cc: linux-bluetooth, 'Dmitry Kasatkin',
	'Bharat Panda', cpgs

Hi,

> -----Original Message-----
> From: Luiz Augusto von Dentz [mailto:luiz.dentz@gmail.com]
> Sent: Wednesday, October 08, 2014 4:09 PM
> To: Gowtham Anandha Babu
> Cc: linux-bluetooth@vger.kernel.org; Dmitry Kasatkin; Bharat Panda;
> cpgs@samsung.com
> Subject: Re: [PATCH 0/6] Add support for MAP MASInstance feature
> 
> Hi,
> 
> On Tue, Oct 7, 2014 at 7:06 AM, Gowtham Anandha Babu
> <gowtham.ab@samsung.com> wrote:
> > This patch-set implements MAP 1.2 MAS Instance feature.
> >
> > The patch 1,2,3 will handle the Client part(MCE). It passes the PTS
> > 5.3 test case:TC_MCE_MMI_BV_01_I.
> >
> > The patch 4,5,6 will handle the Server part(MSE). It passes the PTS
> > 5.3 test case:TC_MSE_MMI_BV_02_I.
> >
> > Gowtham Anandha Babu (6):
> >   doc/obex-api: Add description about MASInstance request
> >   test/map-client: Add D-Bus API support to make MASInstance request
> >   obexd/client/map: Add API Calls for request and handlers for response
> >   obexd/mas: Add support for providing MASInstance Info as response
> >   obexd/messages: Add prototypes for MASInstance response
> >   obexd/message-dummy: Add MAS Instance description to response
> >
> >  doc/obex-api.txt               |  6 +++
> >  obexd/client/map.c             | 88
> ++++++++++++++++++++++++++++++++++++++++++
> >  obexd/plugins/mas.c            | 62 +++++++++++++++++++++++++++++
> >  obexd/plugins/messages-dummy.c | 18 +++++++++
> >  obexd/plugins/messages.h       | 16 ++++++++
> >  test/map-client                |  9 +++++
> >  6 files changed, 199 insertions(+)
> >
> > --
> > 1.9.1
> 
> My plan is to actually do this as the name of the folder for each instance:
> 
> <MAS 1 info>/telecom/...
> <MAS 2 info>/telecom/...
> 
> If there is no info, due to version or lack of support, then we fallback to
> record description or something like that so we can support multiple
> instances.
> 
> 
> --
> Luiz Augusto von Dentz

I could not understand the first part of your explanation. 
Do we need to create any folders internally and store the MAS info?
Or do we need to append the below info to MAS Info? 
<MAS 1 info>/telecom/...
<MAS 2 info>/telecom/... 

Let me know if I am wrong. 
And then do we need to follow any predefined structure for storing the MAS Instance Info?
I think right now bluez supports single MAS instance. This patch will work for single instance. For supporting multiple MAS instances, we need to discuss upon the how this can be implemented?

Regards,
Gowtham Anandha Babu



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

* RE: [PATCH 5/6] obexd/messages: Add prototypes for MASInstance response
  2014-10-08 11:12   ` Luiz Augusto von Dentz
@ 2014-10-08 12:09     ` Gowtham Anandha Babu
  2014-10-08 12:31       ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 13+ messages in thread
From: Gowtham Anandha Babu @ 2014-10-08 12:09 UTC (permalink / raw)
  To: 'Luiz Augusto von Dentz'
  Cc: linux-bluetooth, 'Dmitry Kasatkin',
	'Bharat Panda', cpgs

Hi,

> -----Original Message-----
> From: Luiz Augusto von Dentz [mailto:luiz.dentz@gmail.com]
> Sent: Wednesday, October 08, 2014 4:42 PM
> To: Gowtham Anandha Babu
> Cc: linux-bluetooth@vger.kernel.org; Dmitry Kasatkin; Bharat Panda;
> cpgs@samsung.com
> Subject: Re: [PATCH 5/6] obexd/messages: Add prototypes for MASInstance
> response
> 
> Hi,
> 
> On Tue, Oct 7, 2014 at 7:06 AM, Gowtham Anandha Babu
> <gowtham.ab@samsung.com> wrote:
> > ---
> >  obexd/plugins/messages.h | 16 ++++++++++++++++
> >  1 file changed, 16 insertions(+)
> >
> > diff --git a/obexd/plugins/messages.h b/obexd/plugins/messages.h index
> > 00a16b1..3aaeec1 100644
> > --- a/obexd/plugins/messages.h
> > +++ b/obexd/plugins/messages.h
> > @@ -307,3 +307,19 @@ int messages_set_delete(void *session, const char
> *handle, uint8_t value,
> >   * session: Backend session.
> >   */
> >  void messages_abort(void *session);
> > +
> > +
> > +
> > +/* Retrieves MAS Instance Information for the given mas-instance id.
> > + *
> > + * session: Backend session.
> > + * mas_id: MAS Instance id requested by the MCE.
> > + *
> > + * Callback shall be called for every mas_instance_id request received
> from MCE.
> > + */
> > +typedef void (*messages_mas_instance_info_cb)(void *session, int err,
> > +               uint16_t size, const char *name, void *user_data);
> > +
> > +int messages_get_mas_instance_info(void *session, uint16_t
> mas_instance_id,
> > +                               messages_mas_instance_info_cb callback,
> > +                               void *user_data);
> > --
> > 1.9.1
> 
> You can drop using mas here since it is pretty obvious what it is for, also Im
> not sure we need the size in the callback since we can use strlen there.
> 
> 
> --
> Luiz Augusto von Dentz

I agree with you. I will update this comment for the patch[6/6] too. I will include this in v2. Still is there anything to be handled?

Regards,
Gowtham Anandha Babu


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

* Re: [PATCH 5/6] obexd/messages: Add prototypes for MASInstance response
  2014-10-08 12:09     ` Gowtham Anandha Babu
@ 2014-10-08 12:31       ` Luiz Augusto von Dentz
  2014-10-08 13:52         ` Gowtham Anandha Babu
  0 siblings, 1 reply; 13+ messages in thread
From: Luiz Augusto von Dentz @ 2014-10-08 12:31 UTC (permalink / raw)
  To: Gowtham Anandha Babu
  Cc: linux-bluetooth@vger.kernel.org, Dmitry Kasatkin, Bharat Panda,
	cpgs

Hi,

On Wed, Oct 8, 2014 at 3:09 PM, Gowtham Anandha Babu
<gowtham.ab@samsung.com> wrote:
> Hi,
>
>> -----Original Message-----
>> From: Luiz Augusto von Dentz [mailto:luiz.dentz@gmail.com]
>> Sent: Wednesday, October 08, 2014 4:42 PM
>> To: Gowtham Anandha Babu
>> Cc: linux-bluetooth@vger.kernel.org; Dmitry Kasatkin; Bharat Panda;
>> cpgs@samsung.com
>> Subject: Re: [PATCH 5/6] obexd/messages: Add prototypes for MASInstance
>> response
>>
>> Hi,
>>
>> On Tue, Oct 7, 2014 at 7:06 AM, Gowtham Anandha Babu
>> <gowtham.ab@samsung.com> wrote:
>> > ---
>> >  obexd/plugins/messages.h | 16 ++++++++++++++++
>> >  1 file changed, 16 insertions(+)
>> >
>> > diff --git a/obexd/plugins/messages.h b/obexd/plugins/messages.h index
>> > 00a16b1..3aaeec1 100644
>> > --- a/obexd/plugins/messages.h
>> > +++ b/obexd/plugins/messages.h
>> > @@ -307,3 +307,19 @@ int messages_set_delete(void *session, const char
>> *handle, uint8_t value,
>> >   * session: Backend session.
>> >   */
>> >  void messages_abort(void *session);
>> > +
>> > +
>> > +
>> > +/* Retrieves MAS Instance Information for the given mas-instance id.
>> > + *
>> > + * session: Backend session.
>> > + * mas_id: MAS Instance id requested by the MCE.
>> > + *
>> > + * Callback shall be called for every mas_instance_id request received
>> from MCE.
>> > + */
>> > +typedef void (*messages_mas_instance_info_cb)(void *session, int err,
>> > +               uint16_t size, const char *name, void *user_data);
>> > +
>> > +int messages_get_mas_instance_info(void *session, uint16_t
>> mas_instance_id,
>> > +                               messages_mas_instance_info_cb callback,
>> > +                               void *user_data);
>> > --
>> > 1.9.1
>>
>> You can drop using mas here since it is pretty obvious what it is for, also Im
>> not sure we need the size in the callback since we can use strlen there.
>>
>>
>> --
>> Luiz Augusto von Dentz
>
> I agree with you. I will update this comment for the patch[6/6] too. I will include this in v2. Still is there anything to be handled?

Start with the server side, I will be working on the client side to
add support for multiple instances, I have something already it just
need some polishing.

-- 
Luiz Augusto von Dentz

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

* RE: [PATCH 5/6] obexd/messages: Add prototypes for MASInstance response
  2014-10-08 12:31       ` Luiz Augusto von Dentz
@ 2014-10-08 13:52         ` Gowtham Anandha Babu
  0 siblings, 0 replies; 13+ messages in thread
From: Gowtham Anandha Babu @ 2014-10-08 13:52 UTC (permalink / raw)
  To: 'Luiz Augusto von Dentz'
  Cc: linux-bluetooth, 'Dmitry Kasatkin',
	'Bharat Panda', cpgs

Hi,

> -----Original Message-----
> From: Luiz Augusto von Dentz [mailto:luiz.dentz@gmail.com]
> Sent: Wednesday, October 08, 2014 6:01 PM
> To: Gowtham Anandha Babu
> Cc: linux-bluetooth@vger.kernel.org; Dmitry Kasatkin; Bharat Panda;
> cpgs@samsung.com
> Subject: Re: [PATCH 5/6] obexd/messages: Add prototypes for MASInstance
> response
> 
> Hi,
> 
> On Wed, Oct 8, 2014 at 3:09 PM, Gowtham Anandha Babu
> <gowtham.ab@samsung.com> wrote:
> > Hi,
> >
> >> -----Original Message-----
> >> From: Luiz Augusto von Dentz [mailto:luiz.dentz@gmail.com]
> >> Sent: Wednesday, October 08, 2014 4:42 PM
> >> To: Gowtham Anandha Babu
> >> Cc: linux-bluetooth@vger.kernel.org; Dmitry Kasatkin; Bharat Panda;
> >> cpgs@samsung.com
> >> Subject: Re: [PATCH 5/6] obexd/messages: Add prototypes for
> >> MASInstance response
> >>
> >> Hi,
> >>
> >> On Tue, Oct 7, 2014 at 7:06 AM, Gowtham Anandha Babu
> >> <gowtham.ab@samsung.com> wrote:
> >> > ---
> >> >  obexd/plugins/messages.h | 16 ++++++++++++++++
> >> >  1 file changed, 16 insertions(+)
> >> >
> >> > diff --git a/obexd/plugins/messages.h b/obexd/plugins/messages.h
> >> > index
> >> > 00a16b1..3aaeec1 100644
> >> > --- a/obexd/plugins/messages.h
> >> > +++ b/obexd/plugins/messages.h
> >> > @@ -307,3 +307,19 @@ int messages_set_delete(void *session, const
> >> > char
> >> *handle, uint8_t value,
> >> >   * session: Backend session.
> >> >   */
> >> >  void messages_abort(void *session);
> >> > +
> >> > +
> >> > +
> >> > +/* Retrieves MAS Instance Information for the given mas-instance id.
> >> > + *
> >> > + * session: Backend session.
> >> > + * mas_id: MAS Instance id requested by the MCE.
> >> > + *
> >> > + * Callback shall be called for every mas_instance_id request
> >> > +received
> >> from MCE.
> >> > + */
> >> > +typedef void (*messages_mas_instance_info_cb)(void *session, int
> err,
> >> > +               uint16_t size, const char *name, void *user_data);
> >> > +
> >> > +int messages_get_mas_instance_info(void *session, uint16_t
> >> mas_instance_id,
> >> > +                               messages_mas_instance_info_cb callback,
> >> > +                               void *user_data);
> >> > --
> >> > 1.9.1
> >>
> >> You can drop using mas here since it is pretty obvious what it is
> >> for, also Im not sure we need the size in the callback since we can use
> strlen there.
> >>
> >>
> >> --
> >> Luiz Augusto von Dentz
> >
> > I agree with you. I will update this comment for the patch[6/6] too. I will
> include this in v2. Still is there anything to be handled?
> 
> Start with the server side, I will be working on the client side to add support
> for multiple instances, I have something already it just need some polishing.
> 
> --
> Luiz Augusto von Dentz

I think not much implementation in server side is needed. 
No features are using the instance id in server side except this patch set. But can be added as below:

1)Define no_of_mas_instance (assign no of instances if it supports or '0')
2)While MCE discovering for MAS service, advertise all mas id's(if it supports more than one)
3) While mas_connect(), need to look match for which mas_id the MCE requesting
4) Folder ordering for multiple MAS instance is needed as you suggested. Like
MAS 1/telecom/...
MAS 2/telecom/...

Once the client part is known, we can implement that accordingly. 

Meanwhile is this patch set good to go?

Regards,
Gowtham Anandha Babu


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

end of thread, other threads:[~2014-10-08 13:52 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-07  4:06 [PATCH 0/6] Add support for MAP MASInstance feature Gowtham Anandha Babu
2014-10-07  4:06 ` [PATCH 1/6] doc/obex-api: Add description about MASInstance request Gowtham Anandha Babu
2014-10-07  4:06 ` [PATCH 2/6] test/map-client: Add D-Bus API support to make " Gowtham Anandha Babu
2014-10-07  4:06 ` [PATCH 3/6] obexd/client/map: Add API Calls for request and handlers for response Gowtham Anandha Babu
2014-10-07  4:06 ` [PATCH 4/6] obexd/mas: Add support for providing MASInstance Info as response Gowtham Anandha Babu
2014-10-07  4:06 ` [PATCH 5/6] obexd/messages: Add prototypes for MASInstance response Gowtham Anandha Babu
2014-10-08 11:12   ` Luiz Augusto von Dentz
2014-10-08 12:09     ` Gowtham Anandha Babu
2014-10-08 12:31       ` Luiz Augusto von Dentz
2014-10-08 13:52         ` Gowtham Anandha Babu
2014-10-07  4:06 ` [PATCH 6/6] obexd/message-dummy: Add MAS Instance description to response Gowtham Anandha Babu
2014-10-08 10:38 ` [PATCH 0/6] Add support for MAP MASInstance feature Luiz Augusto von Dentz
2014-10-08 12:08   ` Gowtham Anandha Babu

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).