linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC v2] Convert storage to use per-remote device directories
@ 2012-10-02 12:08 Frederic Danis
  2012-10-02 12:41 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Frederic Danis @ 2012-10-02 12:08 UTC (permalink / raw)
  To: linux-bluetooth@vger.kernel.org

Hi everyone,

Here is my proposal for new storage directory structure using ini-file 
format.

Each adapter directory (/var/lib/bluetooth/<adapter address>/) will contain:
  - an adapter.conf file for the local adapter
  - an attribute_db.conf file containing attributes of supported LE services
  - one directory per remote device, named by remote device address. A 
directory will contain:
     - a device.conf file
     - a key file accessible only by root
     - an attribute_db.conf file containing attributes of remote LE services

So the directory structure should be:
     /var/lib/bluetooth/<adapter address>/
         ./adapter.conf
         ./attribute_db.conf
         ./<remote device address>/
             ./device.conf
             ./keys.conf
             ./attribute_db.conf
         ./<remote device address>/
             ./device.conf
             ./keys.conf
             ./attribute_db.conf
         ...


The adapter config file just need to be converted to ini-file format 
with only 1 group called [adapter], for example:
   [Adapter]
   Name=desktop-0
   Class=0x780011
   Pairable=true
   OnMode=discoverable
   Mode=discoverable

The attribute_db.conf file should be a list of handles (group name) with 
UUID and Value as keys, for example:
   [0x0001]
   UUID=00002800-0000-1000-8000-00805f9b34fb
   Value=0018

   [0x0004]
   UUID=00002803-0000-1000-8000-00805f9b34fb
   Value=020600002A

   [0x0006]
   UUID=00002a00-0000-1000-8000-00805f9b34fb
   Value=4578616D706C6520446576696365


Remote device config file will include a [device] group with general 
device infos (name, alias, profiles or primary services list, ...), for 
example:
   [Device]
   Name=MyPhone
   Alias=Fred's phone
   Class=0x180204
   DeviceId=FFFF 0000 0000 0000
   EIR=040D040218
   Manufacturer=15
   LmpVersion=2
   LmpSubversion=777
   Features=FFFE0D0008080000
   LastSeen=2012-09-26 11:19:40 GMT
   LastUsed=2012-09-26 11:43:42 GMT
   Trusted=true
 
Profiles=00001101-0000-1000-8000-00805f9b34fb;00001103-0000-1000-8000-00805f9b34fb

For LE devices, LEAddressType entry should exist to distinguish 
LE-Public from LE-Random address.

Keys file will include informations related to link key or long term 
link key, for example:
   [LinkKey]
   Key=9EF4BDFA68C5438A176DF42ACD59816C
   Type=0
   Length=4

   [LongTermKey]
   Key=
   Authenticated=
   EncSize=
   EDiv=
   Rand=

-- 
Frederic Danis                            Open Source Technology Center
frederic.danis@intel.com                              Intel Corporation




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFC v2] Convert storage to use per-remote device directories
  2012-10-02 12:08 [RFC v2] Convert storage to use per-remote device directories Frederic Danis
@ 2012-10-02 12:41 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2012-10-02 12:41 UTC (permalink / raw)
  To: Frederic Danis; +Cc: linux-bluetooth@vger.kernel.org

Hi Frederic,

On Tue, Oct 02, 2012, Frederic Danis wrote:
> The adapter config file just need to be converted to ini-file format
> with only 1 group called [adapter], for example:
>   [Adapter]
>   Name=desktop-0
>   Class=0x780011
>   Pairable=true
>   OnMode=discoverable
>   Mode=discoverable

Looks ok, except I'd call the main section [General] to make it more
natural to extend the file with new sections in the future. This is also
consistent with what we have under /etc/bluetooth.

> Remote device config file will include a [device] group with general
> device infos (name, alias, profiles or primary services list, ...),
> for example:
>   [Device]

Same thing as with adapter.conf, i.e. I'd call this simply [General]

>   DeviceId=FFFF 0000 0000 0000

I'd move this into its own [DeviceID] section with separate Assigner,
Vendor, Product and Version fields.

> Keys file will include informations related to link key or long term
> link key, for example:
>   [LinkKey]
>   Key=9EF4BDFA68C5438A176DF42ACD59816C
>   Type=0
>   Length=4

I suppose s/Length/PINLength/ would be in order here.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-02 12:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-02 12:08 [RFC v2] Convert storage to use per-remote device directories Frederic Danis
2012-10-02 12:41 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).