Re: patch for irmc bluetooth on linuxppc
Armin Bauer <[email protected]> Thu, 12 May 2005 23:08:55 +0200
| Newsgroups | gmane.comp.gnome.apps.multisync.devel |
|---|---|
| Message-ID | <[email protected]> |
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig53B09C044BE09C0AA7266C71
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Nathan Hand wrote:
> On Thu, 2005-05-12 at 16:19 +0200, Armin Bauer wrote:
>
>>Nathan Hand wrote:
>>
>>>This code in irmc_bluetooth.c isn't endian safe. On a PowerPC it was
>>>searching over 16 million devices on the piconet.
>>>
>>> 94 if (!sdp_general_inquiry(ii, 10, 10000, (uint8_t*)&numfound))
>>> (gdb) next
>>> ...
>>> (gdb) print numfound
>>> $25 = 16777216.
>>>
>>>The search effectively never finishes and the list remains empty.
>>>
>>>Simple patch fixes the problem. Search now correctly detects my Sony
>>>T360 using LinuxPPC. Syncing with Evolution works beaut.
>>>
>>
>>Thanks for your patch!
>>
>>
>>>One last point, after adding the patch I notice that numfound is not
>>>equal to 1 but is equal to '1' (aka 0x31).
>>>
>>> (gdb) print numfound
>>> $1 = 49 '1'
>>>
>>>Maybe that's a libbluetooth bug? Anyway, doesn't hurt, it takes mere
>>>seconds to scan through 48 non-existent devices.
>>>
>>
>>Maybe it just always returns the result of this inquiry as a string so
>>we should do a atoi to get the correct integer... i think we should
>>check this before commiting the patch since i would consider 48 false
>>scans a pretty bad bug.
>
>
> I must have read gdb incorrectly. I put this line in irmc_bluetooth.c
> and rebuilt the plugin.
>
> if (!sdp_general_inquiry(ii, 10, 10000, (uint8_t*)&numfound)) {
> int t;
> printf("the value of numfound = %d\n", (int)(numfound));
>
> And the output looks perfectly cromulent.
>
> the value of numfound = 1
>
> The endian problem is still valid and needs the patch posted earlier.
>
ok. then i will commit the patch as is. thanks!
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
> _______________________________________________
> Multisync-devel mailing list
> Multisync-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/multisync-devel
--------------enig53B09C044BE09C0AA7266C71
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
iD8DBQFCg8Xrq9z7v9k9UakRAm4eAKCWvndugGWY/8JowkqIw8Wij6IanQCdEqQZ
wsEyUBGXtI1JDDRXwQa9TWY=
=HdT1
-----END PGP SIGNATURE-----
--------------enig53B09C044BE09C0AA7266C71--
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click