Re: [Bluez-devel] Bluetooth MIME types and URIs

Fred Schaettgen
2005-07-08T15:54:54Z

[-- Attachment #1: Type: text/plain, Size: 2393 bytes --]

On Friday, 8. July 2005 16:43, Marcel Holtmann wrote:
...
> > But I wonder if this isn´t actually an abuse of mimetypes. Aren´t
> > mimetypes supposed to declare the format of a file? Yet we are not
> > talking about file contents at all here. Instead we associate a mimetype
> > with a certain URL format.
>
> In general yes, but they always have been misused.

> > At the moment, an item with the mimetype ¨bluetooth/obex-push-profile¨
> > can only live inside the sdp kioslave.
> > Maybe a more correct way would in fact be to have a helper application
> > associated with the type application/x-bt.service, which gets the
> > information what device to connect to not from the URL, but from the URL
> > contents. application/x-bt.service could simply be a file that contains
> > the whole service record as xml, similar to the service record files for
> > the metaserver. The applications would have to parse this xml file, which
> > isn´t very lightweight, but it gives all available information and we
> > don´t have to worry how to squezze everything into an URL.
>
> I am not really happy with adding somekind of XML overhead.

But it´s the most natural format for a hierarchical data structure like the
service records. The computational overhead would be neglectable and it only
has to be implemented in the service dispatcher, not in each application
started by it. We can put everything we know in the xml structure without
much effort. Extending the url format might become more troublesome at some
point.
We could also go without the service dispatcher and still use distinct
mimetypes for each service, but let the application read the needed
information from the data the url points to and not from the URL itself.
We didn´t have to standardize on a URL format then, but just on the mimetypes
and the service description format, be it xml or anything else.
In KDE it would allow for a kfile plugin which displays additional properties
of services in konqueror besides the name.
Or we could do both - putting just the most relevant information into the URL
(bdaddr+channel) and the complete service record, device adress + name and
everything else we know about a service into the file contents as xml similar
to sdp registration files we use (see attachment).

Fred

--
Fred Schaettgen
bluez-devel@schaettgen.de

[-- Attachment #2: kbluetoothd_kbtobexsrv.sdp.xml --]
[-- Type: text/xml, Size: 1284 bytes --]

<sdprecord>
<attributes>


<attribute id='0x0100'>
<str>Obex Push Server</str>
</attribute>


<attribute id='0x0101'>
<str>KDE OBEX Object Push Service</str>
</attribute>


<attribute id='0x0303'>
<seq>
<uint val='0xFF' size='8'/>
<uint val='0x01' size='8'/>
<uint val='0x02' size='8'/>
<uint val='0x03' size='8'/>
<uint val='0x04' size='8'/>
<uint val='0x05' size='8'/>
<uint val='0x06' size='8'/>
</seq>
</attribute>


<attribute id='0x0001'>
<seq>
<uuid val='0x1105' size='16'/>
</seq>
</attribute>


<attribute id='0x0004'>
<seq>
<seq><uuid val='256' size='16'/></seq>
<seq><uuid val='3' size='16'/>
<uint valref='rfcommchannel' size='8'/></seq>
<seq><uuid val='0x0008' size='16'/></seq>
</seq>
</attribute>


<attribute id='0x0005'>
<seq>
<uuid val='0x1002' size='16'/>
</seq>
</attribute>


<attribute id='0x0009'>
<seq>
<seq><uuid val='0x1105' size='16'/>
<uint val='0x0100' size='16'/></seq>