Date: Tue, 2 Nov 2010 22:26:08 +0000 (GMT) From: Iain Hibbert <plunky@rya-online.net> To: freebsd-bluetooth@freebsd.org Subject: obexapp alloc server channel Message-ID: <alpine.NEB.2.00.1011022212470.10122@galant.ukfsn.org>
next in thread | raw e-mail | index | archive | help
This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-707870261-1288736768=:10122 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi, one more thing for obexapp, I think FreeBSD has the thing of RFCOMM where you can bind() to channel 0 and use getsockname() after listen() in order to find the allocated channel? It was discussed on the list some time ago anyway, and I did implement it on NetBSD (using RFCOMM_CHANNEL_ANY == 0) The patch attached implements this functionality in obexapp, allowing -C to be optional in server mode. regards, iain btw I implemented similar for L2CAP except that binding to L2CAP_PSM_ANY gets you one of the dynamic PSM (1001->) after listen() call --0-707870261-1288736768=:10122 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=any.diff Content-Transfer-Encoding: BASE64 Content-ID: <alpine.NEB.2.00.1011022226080.10122@galant.ukfsn.org> Content-Description: Content-Disposition: attachment; filename=any.diff LS0tIG1haW4uYy5vcmlnCTIwMTAtMTAtMjIgMDc6Mjk6MDYuMDAwMDAwMDAw ICswMTAwDQorKysgbWFpbi5jCTIwMTAtMTEtMDIgMjI6MDU6MDguMDAwMDAw MDAwICswMDAwDQpAQCAtMjY2LDcgKzI2Niw3IEBADQogCQl9DQogCX0NCiAN Ci0JaWYgKGNvbnRleHQuY2hhbm5lbCA8PSAwIHx8IGNvbnRleHQuY2hhbm5l bCA+IDMwKQ0KKwlpZiAoKGNvbnRleHQuY2hhbm5lbCA9PSAwICYmICFjb250 ZXh0LnNlcnZlcikgfHwgY29udGV4dC5jaGFubmVsID4gMzApDQogCQllcnJ4 KDEsICJJbnZhbGlkIFJGQ09NTSBjaGFubmVsICVkIiwNCiAJCQljb250ZXh0 LmNoYW5uZWwpOw0KIA0KLS0tIHRyYW5zcG9ydC5jLm9yaWcJMjAxMC0x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GVjaWZpZXMgUkZDT01NIGNoYW5uZWwNCiB0 byBjb25uZWN0IHRvIG9yIGxpc3RlbiBvbi4NCiBJbiB0aGUgc2VydmVyIG1v ZGUgUkZDT01NIGNoYW5uZWwgc2hvdWxkIGJlIG51bWJlciBiZXR3ZWVuIDEg YW5kIDMwLg0KIEluIHRoZSBjbGllbnQgbW9kZSBSRkNPTU0gY2hhbm5lbCBj b3VsZCBiZSBlaXRoZXIgbnVtYmVyIGJldHdlZW4gMSBhbmQgMzAgb3INCg== --0-707870261-1288736768=:10122--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.NEB.2.00.1011022212470.10122>