Re: [Bluez-users] Timeout message from kernel

Marcel Holtmann
2004-02-14T15:02:39Z

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

Hi Jeff,

> > maybe we really have some endian problems here and also in hcitool. The
> > pkt_type for create_connection is for example uint16 and this explains
> > why "hcitool info ..." fails. I don't have access to a machine with big
> > endian, so most of the userspace tools are not fully tested.
>
> I'll have access to this machine for a little while, so if you have something
> you'd like to try just send patches this way :-)

try this one to solve the problem with "hcitool info ...".

Regards

Marcel

[-- Attachment #2: patch --]
[-- Type: text/x-patch, Size: 919 bytes --]

Index: hcitool.c
===================================================================
RCS file: /cvsroot/bluez/utils/tools/hcitool.c,v
retrieving revision 1.35
diff -u -r1.35 hcitool.c
--- hcitool.c 21 Dec 2003 16:08:25 -0000 1.35
+++ hcitool.c 14 Feb 2004 14:56:52 -0000
@@ -436,7 +436,7 @@
bacpy(&cr->bdaddr, &bdaddr);
cr->type = ACL_LINK;
if (ioctl(dd, HCIGETCONNINFO, (unsigned long) cr) < 0) {
- if (hci_create_connection(dd, &bdaddr, HCI_DM1 | HCI_DH1, 0, 0, &handle, 25000) < 0) {
+ if (hci_create_connection(dd, &bdaddr, htobs(HCI_DM1 | HCI_DH1), 0, 0, &handle, 25000) < 0) {
perror("Can't create connection");
close(dd);
exit(1);
@@ -653,7 +653,7 @@
exit(1);
}

- if (hci_create_connection(dd, &bdaddr, ptype, 0, role, &handle, 1000) < 0)
+ if (hci_create_connection(dd, &bdaddr, htobs(ptype), 0, role, &handle, 1000) < 0)
perror("Can't create connection");
hci_close_dev(dd);
}