Linux bluetooth development
 help / color / mirror / Atom feed
* [Bluez-devel] pan on zaurus
@ 2004-03-17 19:28 Kutschenreuter Matthias
  2004-03-18  0:40 ` Philip Blundell
  0 siblings, 1 reply; 4+ messages in thread
From: Kutschenreuter Matthias @ 2004-03-17 19:28 UTC (permalink / raw)
  To: 'Bluez-devel@lists.sourceforge.net'

Hi,

I installed "bluez-zaurus_2.3b_arm.ipk" on zaurus and
can perfetly pan between zaurus and non-arm laptops: pand -s, pand -c <MAC>.

Now I wrote a software, that  does the same as in the
source file <pand.c>  (connect / accept, bnep_create_connectio ...).
this software works perfectly among non-arm devices, but
the zaurus can only be a slave with it (the "pand -s" part).

if the zaurus tries to create the connection (would
be equivalent to pand -c MAC), it fails on l2cap before 
bnep commands are involved.

sk=socket(AF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP)
getsockopt(sk, ...)
...
connect(sk, (struct sockaddr *) &l2a, sizeof(l2a))  
<---- this connect fails

gives back: "No route to host."

using hcidump, I see that no "CreateConnection" is sent.
I found out that sizeof(l2a) equals 12, although it should only
be 10. this is due to padding:  on zaurus struct-sizes are padded
to a multiple of 4 bytes, i.e. 12 instead of 10. But I think
this cant be the problem, as it also will pad when executing "pand -c"
(which works). 


Now I cannot understand, why my software fails on Zaurus, 
using the same commands as the official PAN, that doesnt fail.
Which are the sources of  bluez-zaurus_2.3b_arm.ipk? 
	(I only found those of bluez-zaurus_2.3_arm.ipk)
Are they different to the one for non-arm devices?
Is there a trick, when cross compiling bluez for zaurus ?

Kind regards, Matthias


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
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] pan on zaurus
  2004-03-17 19:28 Kutschenreuter Matthias
@ 2004-03-18  0:40 ` Philip Blundell
  0 siblings, 0 replies; 4+ messages in thread
From: Philip Blundell @ 2004-03-18  0:40 UTC (permalink / raw)
  To: Kutschenreuter Matthias; +Cc: 'Bluez-devel@lists.sourceforge.net'

On Wed, 2004-03-17 at 19:28, Kutschenreuter Matthias wrote:
> Now I cannot understand, why my software fails on Zaurus, 
> using the same commands as the official PAN, that doesnt fail.

I suggest you run both programs under strace and look for difference in
the syscalls that they make.  There should be nothing special about the
ARM other than the structure-packing issue that you mentioned.

p.



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
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

* AW: [Bluez-devel] pan on zaurus
@ 2004-03-18 15:39 Kutschenreuter Matthias
  2004-03-18 16:00 ` Marcel Holtmann
  0 siblings, 1 reply; 4+ messages in thread
From: Kutschenreuter Matthias @ 2004-03-18 15:39 UTC (permalink / raw)
  To: 'Philip Blundell'; +Cc: 'Bluez-devel@lists.sourceforge.net'


mystery dissolves, when you watch it byte-wise and in hex notation !


thanks for the "strace" tip. I found the error soon:

 9687  bind(5, {sa_family=3D0x1f /* AF_??? */,
sa_data=3D"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"...}=
, 10)
=3D 0

pand initialises the l2a-struct with "0"s, before binding.
	static bdaddr_t src_addr =3D *BDADDR_ANY; // where BDADDR_ANY is
{0,0,0,0,0,0}
	l2a.l2_bdaddr =3D src_addr;
    if (bind(sk, (struct sockaddr *) &l2a, sizeof(l2a)))


thats what I forgot, a simple=20
  memset(&l2a, 0, sizeof(l2a));
makes the code working.

the padding seems to make no problems.

Matthias




> -----Urspr=FCngliche Nachricht-----
> Von: Philip Blundell [mailto:pb@nexus.co.uk]=20
> Gesendet: Donnerstag, 18. M=E4rz 2004 01:40
> An: Kutschenreuter Matthias
> Cc: 'Bluez-devel@lists.sourceforge.net'
> Betreff: Re: [Bluez-devel] pan on zaurus
>=20
>=20
> On Wed, 2004-03-17 at 19:28, Kutschenreuter Matthias wrote:
> > Now I cannot understand, why my software fails on Zaurus,
> > using the same commands as the official PAN, that doesnt fail.
>=20
> I suggest you run both programs under strace and look for=20
> difference in the syscalls that they make.  There should be=20
> nothing special about the ARM other than the=20
> structure-packing issue that you mentioned.
>=20
> p.
>=20


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
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] pan on zaurus
  2004-03-18 15:39 AW: [Bluez-devel] pan on zaurus Kutschenreuter Matthias
@ 2004-03-18 16:00 ` Marcel Holtmann
  0 siblings, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2004-03-18 16:00 UTC (permalink / raw)
  To: Kutschenreuter Matthias
  Cc: 'Philip Blundell',
	'Bluez-devel@lists.sourceforge.net'

Hi Matthias,

> pand initialises the l2a-struct with "0"s, before binding.
> 	static bdaddr_t src_addr = *BDADDR_ANY; // where BDADDR_ANY is
> {0,0,0,0,0,0}
> 	l2a.l2_bdaddr = src_addr;
>     if (bind(sk, (struct sockaddr *) &l2a, sizeof(l2a)))

I think it is better if you use

	bacpy(&l2a.l2_bdaddr, BDADDR_ANY);

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
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:[~2004-03-18 16:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-18 15:39 AW: [Bluez-devel] pan on zaurus Kutschenreuter Matthias
2004-03-18 16:00 ` Marcel Holtmann
  -- strict thread matches above, loose matches on Subject: below --
2004-03-17 19:28 Kutschenreuter Matthias
2004-03-18  0:40 ` Philip Blundell

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