Linux bluetooth development
 help / color / mirror / Atom feed
* [Bluez-devel] Patch: GetRemoteClass
@ 2006-08-01  3:29 Denis KENZIOR
  2006-08-02  3:13 ` Marcel Holtmann
  0 siblings, 1 reply; 4+ messages in thread
From: Denis KENZIOR @ 2006-08-01  3:29 UTC (permalink / raw)
  To: bluez-devel

[-- Attachment #1: Type: text/plain, Size: 519 bytes --]

All,

Attached is a patch to get remote class of device information as a uint32.  
This introduces a new method with signature:
uint32 GetRemoteClass(string address), which returns the class of device 
information encoded as a 32 bit integer.

The reasoning is that some applications might want to rely on their own 
conversion routines for the Major, Minor and Service class attributes, and 
thus the DBUS GetRemoteMajorClass, GetRemoteMinorClass, etc methods that 
return strings are not useful.

Thoughts?

-Denis



[-- Attachment #2: bluez.patch --]
[-- Type: text/x-diff, Size: 2227 bytes --]

Index: dbus-adapter.c
===================================================================
RCS file: /cvsroot/bluez/utils/hcid/dbus-adapter.c,v
retrieving revision 1.67
diff -u -r1.67 dbus-adapter.c
--- dbus-adapter.c	26 Jul 2006 13:57:50 -0000	1.67
+++ dbus-adapter.c	1 Aug 2006 03:24:10 -0000
@@ -1276,6 +1276,26 @@
 	return send_reply_and_unref(conn, reply);
 }
 
+static DBusHandlerResult handle_dev_get_remote_class_req(DBusConnection *conn,
+								DBusMessage *msg,
+								void *data)
+{
+	DBusMessage *reply;
+	uint32_t class;
+
+	if (get_remote_class(conn, msg, data, &class) < 0)
+		return DBUS_HANDLER_RESULT_HANDLED;
+
+	reply = dbus_message_new_method_return(msg);
+	if (!reply)
+		return DBUS_HANDLER_RESULT_NEED_MEMORY;
+
+	dbus_message_append_args(reply, DBUS_TYPE_UINT32, &class,
+					DBUS_TYPE_INVALID);
+
+	return send_reply_and_unref(conn, reply);
+}
+
 static DBusHandlerResult handle_dev_get_remote_name_req(DBusConnection *conn, DBusMessage *msg, void *data)
 {
 	char filename[PATH_MAX + 1];
@@ -2333,6 +2353,7 @@
 	{ "GetRemoteMajorClass",			handle_dev_get_remote_major_class_req	},
 	{ "GetRemoteMinorClass",			handle_dev_get_remote_minor_class_req	},
 	{ "GetRemoteServiceClasses",			handle_dev_get_remote_service_cls_req	},
+	{ "GetRemoteClass",				handle_dev_get_remote_class_req		},
 	{ "GetRemoteName",				handle_dev_get_remote_name_req		},
 	{ "GetRemoteAlias",				handle_dev_get_remote_alias_req		},
 	{ "SetRemoteAlias",				handle_dev_set_remote_alias_req		},
Index: dbus-api.txt
===================================================================
RCS file: /cvsroot/bluez/utils/hcid/dbus-api.txt,v
retrieving revision 1.39
diff -u -r1.39 dbus-api.txt
--- dbus-api.txt	26 Jun 2006 12:33:13 -0000	1.39
+++ dbus-api.txt	1 Aug 2006 03:24:10 -0000
@@ -461,6 +461,14 @@
 			Possible errors: org.bluez.Error.InvalidArguments
 			                 org.bluez.Error.NotAvailable
 
+		uint32 GetRemoteClass(string address)
+
+			Get the remote major, minor, and service classes 
+			encoded as 32 bit integer.
+
+			Possible errors: org.bluez.Error.InvalidArguments
+					 org.bluez.Error.NotAvailable
+
 		string GetRemoteName(string address)
 
 			Get adapter name for a remote device. This request

[-- Attachment #3: Type: text/plain, Size: 348 bytes --]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- Attachment #4: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Patch: GetRemoteClass
  2006-08-01  3:29 [Bluez-devel] Patch: GetRemoteClass Denis KENZIOR
@ 2006-08-02  3:13 ` Marcel Holtmann
  2006-08-02 11:04   ` Peter Wippich
  0 siblings, 1 reply; 4+ messages in thread
From: Marcel Holtmann @ 2006-08-02  3:13 UTC (permalink / raw)
  To: BlueZ development

Hi Denis,

> Attached is a patch to get remote class of device information as a uint32.  
> This introduces a new method with signature:
> uint32 GetRemoteClass(string address), which returns the class of device 
> information encoded as a 32 bit integer.
> 
> The reasoning is that some applications might want to rely on their own 
> conversion routines for the Major, Minor and Service class attributes, and 
> thus the DBUS GetRemoteMajorClass, GetRemoteMinorClass, etc methods that 
> return strings are not useful.

the patch is clean. So before I apply it and so extend the API, does
someone else thinks it is useful to have?

Regards

Marcel



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Patch: GetRemoteClass
  2006-08-02  3:13 ` Marcel Holtmann
@ 2006-08-02 11:04   ` Peter Wippich
  2006-08-09 22:09     ` Marcel Holtmann
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Wippich @ 2006-08-02 11:04 UTC (permalink / raw)
  To: BlueZ development



Hi All, 

On Wed, 2 Aug 2006, Marcel Holtmann wrote:
> Hi Denis,
> 
> > Attached is a patch to get remote class of device information as a uint32.  
> > This introduces a new method with signature:
> > uint32 GetRemoteClass(string address), which returns the class of device 
> > information encoded as a 32 bit integer.
> > 
> > The reasoning is that some applications might want to rely on their own 
> > conversion routines for the Major, Minor and Service class attributes, and 
> > thus the DBUS GetRemoteMajorClass, GetRemoteMinorClass, etc methods that 
> > return strings are not useful.
> 
> the patch is clean. So before I apply it and so extend the API, does
> someone else thinks it is useful to have?
> 
I'm currently not using the DBUS API, but I think this would be something 
very usefull. 

Ciao, 

Peter 



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

* Re: [Bluez-devel] Patch: GetRemoteClass
  2006-08-02 11:04   ` Peter Wippich
@ 2006-08-09 22:09     ` Marcel Holtmann
  0 siblings, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2006-08-09 22:09 UTC (permalink / raw)
  To: BlueZ development

Hi Peter,

> > > Attached is a patch to get remote class of device information as a uint32.  
> > > This introduces a new method with signature:
> > > uint32 GetRemoteClass(string address), which returns the class of device 
> > > information encoded as a 32 bit integer.
> > > 
> > > The reasoning is that some applications might want to rely on their own 
> > > conversion routines for the Major, Minor and Service class attributes, and 
> > > thus the DBUS GetRemoteMajorClass, GetRemoteMinorClass, etc methods that 
> > > return strings are not useful.
> > 
> > the patch is clean. So before I apply it and so extend the API, does
> > someone else thinks it is useful to have?
> > 
> I'm currently not using the DBUS API, but I think this would be something 
> very usefull. 

that's fair enough. I applied the patch to the CVS now.

Regards

Marcel



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

end of thread, other threads:[~2006-08-09 22:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-01  3:29 [Bluez-devel] Patch: GetRemoteClass Denis KENZIOR
2006-08-02  3:13 ` Marcel Holtmann
2006-08-02 11:04   ` Peter Wippich
2006-08-09 22:09     ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox