From: Hendrik S. <po...@he...> - 2005-07-22 16:26:29
|
Am Freitag, 22. Juli 2005 15:17 schrieb Alex Kanavin: > On Fri, 22 Jul 2005, Hendrik Sattler wrote: > > Can this list of possible OBEX usages be put into a obex_service enum or > > flags that the application can reference? My problem is that the > > application has to know too many OBEX internals. Maybe it only wants to > > know: I want to use the push service to send the file to the phone, give > > me a list of devices that support this. > > Like > > #define OBEX_SERVICE_PUSH 0x0001 > > #define OBEX_SERVICE_FTP 0x0002 > > #define OBEX_SERVICE_SYNCML 0x0004 > > .... > > Then let the functions accept an int (and let the list have the proper > > field to compare). For IrDA, all those bits are set for ObEx capable > > device (we don't know better). > > And suddenly the lib knows what the application wants, easy, isn't is? > > This isn't as easy as it may seem. In theory, every standard-compliant > obex interface must support object pushing and capability query ("GET > x-object/capability" request) but in practice neither of these may work, > so you'd have to resort to heuristics based on other information, such as > a non-standardized interface/service name ("PC Suite Services"? huh?). > Even then, capability query gives you a rather complex XML file which you > need to parse. (real-life example from my Nokia 7610: > http://www.sensi.org/~ak/openobex-usb/capability.txt ) Hmm, parsing should be possible, I know at least two usable XML libs ;) Then maybe the Java way of "magic strings" is a better approach? However, I agree that this might be hard to put into a few parameters. Hendrik =2D-=20 Mein GPG-Key ist auf meiner Homepage verf=C3=BCgbar: http://www.hendrik-sat= tler.de oder =C3=BCber pgp.net PingoS - Linux-User helfen Schulen: http://www.pingos.org |