* [Bluez-devel] baswap neccesity
@ 2005-01-10 18:36 soraberri
2005-01-10 18:47 ` [SPAM?]: " Till Harbaum
2005-01-10 20:27 ` Marcel Holtmann
0 siblings, 2 replies; 5+ messages in thread
From: soraberri @ 2005-01-10 18:36 UTC (permalink / raw)
To: bluez-devel
Hi
I'm reading rctest.c:
In do_connect function, a call to bswap is used just before the connect
call:
baswap(&rem_addr.rc_bdaddr, strtoba(svr));
In the server, baswap is again called just after the accept call
Why is it neccesary? Why does the server listening at the other side
expect addresses in such byte ordering?
mmm, again thank you for your time (sometimes I feel like trying to slow
down a bit your work would enable me to get up to date, but it's
useless, the rate of events is dramatic and you always reemerge... ;-) )
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
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: [SPAM?]: [Bluez-devel] baswap neccesity
2005-01-10 18:36 [Bluez-devel] baswap neccesity soraberri
@ 2005-01-10 18:47 ` Till Harbaum
2005-01-10 20:27 ` Marcel Holtmann
1 sibling, 0 replies; 5+ messages in thread
From: Till Harbaum @ 2005-01-10 18:47 UTC (permalink / raw)
To: bluez-devel; +Cc: soraberri
Hi,
On Monday 10 January 2005 19:36, soraberri wrote:
> Why is it neccesary? Why does the server listening at the other side
> expect addresses in such byte ordering?
It's not the server on the other side but the local bluetooth chip that wants
to receive the address in the reverse order. If you want to know why this is
you'll probably have to ask someone from the Bluetooth SIG.
Till
--
Dr.-Ing. Till Harbaum Tel.: +49 721 4998963
BeeCon GmbH Fax: +49 721 4998962
Haid-und-Neu Strasse 7, 76131 Karlsruhe Mobil: +49 179 9087904
harbaum@beecon.de http://www.beecon.de
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
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] baswap neccesity
2005-01-10 18:36 [Bluez-devel] baswap neccesity soraberri
2005-01-10 18:47 ` [SPAM?]: " Till Harbaum
@ 2005-01-10 20:27 ` Marcel Holtmann
2005-01-11 8:52 ` [Bluez-devel] " soraberri
1 sibling, 1 reply; 5+ messages in thread
From: Marcel Holtmann @ 2005-01-10 20:27 UTC (permalink / raw)
To: BlueZ Mailing List
Hi,
> I'm reading rctest.c:
> In do_connect function, a call to bswap is used just before the connect
> call:
> baswap(&rem_addr.rc_bdaddr, strtoba(svr));
>
> In the server, baswap is again called just after the accept call
>
> Why is it neccesary? Why does the server listening at the other side
> expect addresses in such byte ordering?
this is part of the specification. The textual representation and the
over-air BD_ADDR is swapped.
However the code above has a memory leak. Where do you found it?
> mmm, again thank you for your time (sometimes I feel like trying to slow
> down a bit your work would enable me to get up to date, but it's
> useless, the rate of events is dramatic and you always reemerge... ;-) )
Sorry for that ;)
Regards
Marcel
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
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
* [Bluez-devel] Re: baswap neccesity
2005-01-10 20:27 ` Marcel Holtmann
@ 2005-01-11 8:52 ` soraberri
2005-01-11 9:59 ` Marcel Holtmann
0 siblings, 1 reply; 5+ messages in thread
From: soraberri @ 2005-01-11 8:52 UTC (permalink / raw)
To: bluez-devel
Hello Marcel,
Marcel Holtmann wrote:
> Hi,
>
>
>>I'm reading rctest.c:
>>In do_connect function, a call to bswap is used just before the connect
>>call:
>> baswap(&rem_addr.rc_bdaddr, strtoba(svr));
>>
>>In the server, baswap is again called just after the accept call
>>
>>Why is it neccesary? Why does the server listening at the other side
>>expect addresses in such byte ordering?
>
>
> this is part of the specification. The textual representation and the
> over-air BD_ADDR is swapped.
>
> However the code above has a memory leak. Where do you found it?
this piece of code is from the 'bluez-utils-2.13.tar.gz' package which
is downloadable now at the web site. Precisely in function 'int
do_connect(char *svr)' of rctest.c.
It's curious, I'm sure you'd see memory leaks where I only see flowers!
thanks Marcel
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
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] Re: baswap neccesity
2005-01-11 8:52 ` [Bluez-devel] " soraberri
@ 2005-01-11 9:59 ` Marcel Holtmann
0 siblings, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2005-01-11 9:59 UTC (permalink / raw)
To: BlueZ Mailing List
Hi,
> >>I'm reading rctest.c:
> >>In do_connect function, a call to bswap is used just before the connect
> >>call:
> >> baswap(&rem_addr.rc_bdaddr, strtoba(svr));
> >>
> >>In the server, baswap is again called just after the accept call
> >>
> >>Why is it neccesary? Why does the server listening at the other side
> >>expect addresses in such byte ordering?
> >
> >
> > this is part of the specification. The textual representation and the
> > over-air BD_ADDR is swapped.
> >
> > However the code above has a memory leak. Where do you found it?
> this piece of code is from the 'bluez-utils-2.13.tar.gz' package which
> is downloadable now at the web site. Precisely in function 'int
> do_connect(char *svr)' of rctest.c.
> It's curious, I'm sure you'd see memory leaks where I only see flowers!
the strtoba() allocates memory that is never freed. The correct way of
doing this address swapping and converting from a string is:
str2ba(svr, &rem_addr.rc_bdaddr);
Regards
Marcel
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
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:[~2005-01-11 9:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-10 18:36 [Bluez-devel] baswap neccesity soraberri
2005-01-10 18:47 ` [SPAM?]: " Till Harbaum
2005-01-10 20:27 ` Marcel Holtmann
2005-01-11 8:52 ` [Bluez-devel] " soraberri
2005-01-11 9:59 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox