* [Bluez-devel] [DBUS PATCH] GetServiceClasses
@ 2006-02-23 20:50 Claudio Takahasi
2006-02-23 21:18 ` Marcel Holtmann
0 siblings, 1 reply; 5+ messages in thread
From: Claudio Takahasi @ 2006-02-23 20:50 UTC (permalink / raw)
To: bluez-devel
[-- Attachment #1: Type: text/plain, Size: 362 bytes --]
Hi Marcel,
Here is the GetServiceClasses service.
There are some shared constants(major classes, minor classes and
service classes) used by hciconfig.c and dbus-device.c. Maybe we could
put it in a common place.
Regards,
Claudio.
--
---------------------------------------------------------
Claudio Takahasi
Instituto Nokia de Tecnologia - INdT
[-- Attachment #2: svc-class01.patch --]
[-- Type: text/x-patch, Size: 3516 bytes --]
Index: hcid/dbus-device.c
===================================================================
RCS file: /cvsroot/bluez/utils/hcid/dbus-device.c,v
retrieving revision 1.15
diff -u -r1.15 dbus-device.c
--- hcid/dbus-device.c 23 Feb 2006 19:12:36 -0000 1.15
+++ hcid/dbus-device.c 23 Feb 2006 20:41:42 -0000
@@ -51,6 +51,17 @@
"wearable"
};
+static const char *service_cls[] = {
+ "positioning",
+ "networking",
+ "rendering",
+ "capturing",
+ "object transfer",
+ "audio",
+ "telephony",
+ "information"
+};
+
static char *get_peer_name(const bdaddr_t *local, const bdaddr_t *peer)
{
char filename[PATH_MAX + 1], addr[18];
@@ -110,6 +121,50 @@
return reply;
}
+static DBusMessage *handle_dev_get_service_classes_req(DBusMessage *msg, void *data)
+{
+ struct hci_dbus_data *dbus_data = data;
+ DBusMessage *reply;
+ DBusMessageIter iter;
+ DBusMessageIter array_iter;
+ const char *str_ptr;
+ uint8_t cls[3];
+ int dd, i;
+
+ dd = hci_open_dev(dbus_data->dev_id);
+ if (dd < 0) {
+ syslog(LOG_ERR, "HCI device open failed: hci%d", dbus_data->dev_id);
+ return bluez_new_failure_msg(msg, BLUEZ_ESYSTEM_ENODEV);
+ }
+
+ if (hci_read_class_of_dev(dd, cls, 1000) < 0) {
+ syslog(LOG_ERR, "Can't read class of device on hci%d: %s(%d)",
+ dbus_data->dev_id, strerror(errno), errno);
+ hci_close_dev(dd);
+ return bluez_new_failure_msg(msg, BLUEZ_ESYSTEM_OFFSET | errno);
+ }
+
+ reply = dbus_message_new_method_return(msg);
+
+ dbus_message_iter_init_append(reply, &iter);
+
+ dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
+ DBUS_TYPE_STRING_AS_STRING, &array_iter);
+
+ for (i = 0; i < (sizeof(service_cls) / sizeof(*service_cls)); i++) {
+ if ( cls[2] & ( 1 << i)) {
+ str_ptr = service_cls[i];
+ dbus_message_iter_append_basic(&array_iter, DBUS_TYPE_STRING, &str_ptr);
+ }
+ }
+
+ dbus_message_iter_close_container(&iter, &array_iter);
+
+ hci_close_dev(dd);
+
+ return reply;
+}
+
static DBusMessage *handle_dev_get_major_class_req(DBusMessage *msg, void *data)
{
DBusMessage *reply;
@@ -986,6 +1041,7 @@
{ DEV_GET_MODE, handle_dev_get_mode_req, DEV_GET_MODE_SIGNATURE },
{ DEV_GET_NAME, handle_dev_get_name_req, DEV_GET_NAME_SIGNATURE },
{ DEV_GET_REVISION, handle_dev_get_revision_req, DEV_GET_REVISION_SIGNATURE },
+ { DEV_GET_SERVICE_CLASSES, handle_dev_get_service_classes_req, DEV_GET_SERVICE_CLASSES_SIGNATURE },
{ DEV_GET_VERSION, handle_dev_get_version_req, DEV_GET_VERSION_SIGNATURE },
{ DEV_IS_CONNECTABLE, handle_dev_is_connectable_req, DEV_IS_CONNECTABLE_SIGNATURE },
Index: hcid/dbus.h
===================================================================
RCS file: /cvsroot/bluez/utils/hcid/dbus.h,v
retrieving revision 1.31
diff -u -r1.31 dbus.h
--- hcid/dbus.h 23 Feb 2006 19:11:02 -0000 1.31
+++ hcid/dbus.h 23 Feb 2006 20:41:42 -0000
@@ -118,6 +118,7 @@
#define DEV_GET_MODE "GetMode"
#define DEV_GET_NAME "GetName"
#define DEV_GET_REVISION "GetRevision"
+#define DEV_GET_SERVICE_CLASSES "GetServiceClasses"
#define DEV_GET_VERSION "GetVersion"
#define DEV_IS_CONNECTABLE "IsConnectable"
#define DEV_IS_DISCOVERABLE "IsDiscoverable"
@@ -155,6 +156,7 @@
#define DEV_GET_MODE_SIGNATURE __END_SIG__
#define DEV_GET_NAME_SIGNATURE __END_SIG__
#define DEV_GET_REVISION_SIGNATURE __END_SIG__
+#define DEV_GET_SERVICE_CLASSES_SIGNATURE __END_SIG__
#define DEV_GET_VERSION_SIGNATURE __END_SIG__
#define DEV_IS_CONNECTABLE_SIGNATURE __END_SIG__
#define DEV_IS_DISCOVERABLE_SIGNATURE __END_SIG__
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Bluez-devel] [DBUS PATCH] GetServiceClasses
2006-02-23 20:50 [Bluez-devel] [DBUS PATCH] GetServiceClasses Claudio Takahasi
@ 2006-02-23 21:18 ` Marcel Holtmann
2006-02-23 21:29 ` Claudio Takahasi
0 siblings, 1 reply; 5+ messages in thread
From: Marcel Holtmann @ 2006-02-23 21:18 UTC (permalink / raw)
To: bluez-devel
Hi Claudio,
> Here is the GetServiceClasses service.
the patch has been applied. So what have been left?
> There are some shared constants(major classes, minor classes and
> service classes) used by hciconfig.c and dbus-device.c. Maybe we could
> put it in a common place.
Keep them separate. It is not worth trying to move stuff around at this
point.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Bluez-devel] [DBUS PATCH] GetServiceClasses
2006-02-23 21:18 ` Marcel Holtmann
@ 2006-02-23 21:29 ` Claudio Takahasi
2006-02-23 21:51 ` Marcel Holtmann
2006-02-24 2:39 ` Marcel Holtmann
0 siblings, 2 replies; 5+ messages in thread
From: Claudio Takahasi @ 2006-02-23 21:29 UTC (permalink / raw)
To: bluez-devel
Hi Marcel,
On 2/23/06, Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Claudio,
>
> > Here is the GetServiceClasses service.
>
> the patch has been applied. So what have been left?
[Claudio Takahasi]
- GetFeatures
- PinCodeLength
- EncryptionKeySize
- MinorClassChanged
- dbus-test update
I am going home now. I think we can try finish it until tomorrow.
SDP will be another history, I think we can try develop it after the Carniv=
al :)
Regards,
Claudio.
>
> > There are some shared constants(major classes, minor classes and
> > service classes) used by hciconfig.c and dbus-device.c. Maybe we could
> > put it in a common place.
>
> Keep them separate. It is not worth trying to move stuff around at this
> point.
>
> Regards
>
> Marcel
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting langua=
ge
> that extends applications into web and mobile media. Attend the live webc=
ast
> and join the prime developer group breaking into this new coding territor=
y!
> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat=
=3D121642
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>
--
---------------------------------------------------------
Claudio Takahasi
Instituto Nokia de Tecnologia - INdT
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Bluez-devel] [DBUS PATCH] GetServiceClasses
2006-02-23 21:29 ` Claudio Takahasi
@ 2006-02-23 21:51 ` Marcel Holtmann
2006-02-24 2:39 ` Marcel Holtmann
1 sibling, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2006-02-23 21:51 UTC (permalink / raw)
To: bluez-devel
Hi Claudio,
> > the patch has been applied. So what have been left?
>
> - GetFeatures
> - PinCodeLength
> - EncryptionKeySize
> - MinorClassChanged
> - dbus-test update
we might wanna leave the GetFeatures part out of it, because I am not
sure if it is useful at all.
The PinCodeLength needs some work from my side, because we actually need
to store the length of the used PIN codes.
Support for EncryptionKeySize can be only implemented for CSR chips,
because I have no idea how to get this from other manufacturers.
The MinorClassChanged signal is kinda easy to add.
And I am not touching the dbus-test script ;)
> I am going home now. I think we can try finish it until tomorrow.
Looks really good. So we are almost ready for the next release. However
I actually like to have a better D-Bus service file. We need to restrict
some of the functions to the console user.
> SDP will be another history, I think we can try develop it after the Carnival :)
The SDP will take more time and is not that easy. Enjoy your Carnival :)
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Bluez-devel] [DBUS PATCH] GetServiceClasses
2006-02-23 21:29 ` Claudio Takahasi
2006-02-23 21:51 ` Marcel Holtmann
@ 2006-02-24 2:39 ` Marcel Holtmann
1 sibling, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2006-02-24 2:39 UTC (permalink / raw)
To: bluez-devel
Hi Claudio,
> > the patch has been applied. So what have been left?
>
> - GetFeatures
this returns an empty list for now.
> - PinCodeLength
It has been implemented, but it definitely needs more testing. I choose
an extension of the link keys file.
> - EncryptionKeySize
The basic functionality is there, but no backend for the different chips
has been implemented.
> - MinorClassChanged
Done.
> - dbus-test update
I did a small update for my own testing.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-02-24 2:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-23 20:50 [Bluez-devel] [DBUS PATCH] GetServiceClasses Claudio Takahasi
2006-02-23 21:18 ` Marcel Holtmann
2006-02-23 21:29 ` Claudio Takahasi
2006-02-23 21:51 ` Marcel Holtmann
2006-02-24 2:39 ` Marcel Holtmann
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).