* [Bluez-users] Delete, write and read link keys using functions in hci.c
@ 2006-12-21 12:45 Staale A. Kleppe
2006-12-21 12:48 ` Marcel Holtmann
0 siblings, 1 reply; 3+ messages in thread
From: Staale A. Kleppe @ 2006-12-21 12:45 UTC (permalink / raw)
To: bluez-users
[-- Attachment #1.1: Type: text/plain, Size: 1504 bytes --]
Good atfernoon (or morning depending on your whereabouts)!
Working on my Master's I want to be able to delete, write and read the link
keys associated with a paired device. I found the functions
int hci_read_stored_link_key(int dd, bdaddr_t *bdaddr, uint8_t all, int to)
int hci_write_stored_link_key(int dd, bdaddr_t *bdaddr, uint8_t *key, int
to)
int hci_delete_stored_link_key(int dd, bdaddr_t *bdaddr, uint8_t all, int
to)
in hci.c and tried to use the delete-function. It seems to work, as the
function call returns 0, indicating that no problems occured. However, the
link key still appears in /var/libs/bluetooth/BD_ADDR/linkkeys, and a
following authentication is still successfull.
Hcidump reports this:
< HCI Command: Delete Stored Link Key (0x03|0x0012) plen 7
bdaddr 00:09:DD:60:02:45 all 0
> HCI Event: Command Complete (0x0e) plen 4
Delete Stored Link Key (0x03|0x0012) ncmd 1
status 0x11 deleted 2525
Error: Unsupported Feature or Parameter Value
I guess it might be the value of parameter "all". I didn't know what it is,
so I tried with 0 and 1 (apperently not correct). Anyone knows what this
parameter of type uint8_t is for? I thought it might be like a "boolean"
variable, instructing deletion of ALL the associated link keys. Am I far
off?
Another thing, about the hci_read_stored_link_key function. Is the key
returned as an int-value or by some other means? I'm a bit confused about
this matter..
Any reply will be valued greetly.
Regards,
Staale A. Kleppe
[-- Attachment #1.2: Type: text/html, Size: 1694 bytes --]
[-- Attachment #2: Type: text/plain, Size: 347 bytes --]
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
[-- Attachment #3: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Bluez-users] Delete, write and read link keys using functions in hci.c
2006-12-21 12:45 [Bluez-users] Delete, write and read link keys using functions in hci.c Staale A. Kleppe
@ 2006-12-21 12:48 ` Marcel Holtmann
2006-12-21 15:07 ` Ståle Andreas Kleppe
0 siblings, 1 reply; 3+ messages in thread
From: Marcel Holtmann @ 2006-12-21 12:48 UTC (permalink / raw)
To: BlueZ users
Hi Stale,
> Working on my Master's I want to be able to delete, write and read the
> link keys associated with a paired device. I found the functions
>
> int hci_read_stored_link_key(int dd, bdaddr_t *bdaddr, uint8_t all,
> int to)
> int hci_write_stored_link_key(int dd, bdaddr_t *bdaddr, uint8_t *key,
> int to)
> int hci_delete_stored_link_key(int dd, bdaddr_t *bdaddr, uint8_t all,
> int to)
>
> in hci.c and tried to use the delete-function. It seems to work, as
> the function call returns 0, indicating that no problems occured.
> However, the link key still appears
> in /var/libs/bluetooth/BD_ADDR/linkkeys, and a following
> authentication is still successfull.
> Hcidump reports this:
> < HCI Command: Delete Stored Link Key (0x03|0x0012) plen 7
> bdaddr 00:09:DD:60:02:45 all 0
> > HCI Event: Command Complete (0x0e) plen 4
> Delete Stored Link Key (0x03|0x0012) ncmd 1
> status 0x11 deleted 2525
> Error: Unsupported Feature or Parameter Value
>
> I guess it might be the value of parameter "all". I didn't know what
> it is, so I tried with 0 and 1 (apperently not correct). Anyone knows
> what this parameter of type uint8_t is for? I thought it might be like
> a "boolean" variable, instructing deletion of ALL the associated link
> keys. Am I far off?
>
> Another thing, about the hci_read_stored_link_key function. Is the key
> returned as an int-value or by some other means? I'm a bit confused
> about this matter..
all these functions deal with the link keys stored on the chip. The
default operation of BlueZ is not to store these link keys on the
Bluetooth chip itself. Have a look at the D-Bus API for BlueZ. The
methods ListBondings() and RemoveBonding() give you what you actually
need.
Regards
Marcel
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Bluez-users] Delete, write and read link keys using functions in hci.c
2006-12-21 12:48 ` Marcel Holtmann
@ 2006-12-21 15:07 ` Ståle Andreas Kleppe
0 siblings, 0 replies; 3+ messages in thread
From: Ståle Andreas Kleppe @ 2006-12-21 15:07 UTC (permalink / raw)
To: BlueZ users
[-- Attachment #1.1: Type: text/plain, Size: 2041 bytes --]
On 12/21/06, Marcel Holtmann <marcel@holtmann.org> wrote:
>
> Hi Stale,
>
> > Working on my Master's I want to be able to delete, write and read the
> > link keys associated with a paired device. I found the functions
> >
> > int hci_read_stored_link_key(int dd, bdaddr_t *bdaddr, uint8_t all,
> > int to)
> > int hci_write_stored_link_key(int dd, bdaddr_t *bdaddr, uint8_t *key,
> > int to)
> > int hci_delete_stored_link_key(int dd, bdaddr_t *bdaddr, uint8_t all,
> > int to)
> >
> > in hci.c and tried to use the delete-function. It seems to work, as
> > the function call returns 0, indicating that no problems occured.
> > However, the link key still appears
> > in /var/libs/bluetooth/BD_ADDR/linkkeys, and a following
> > authentication is still successfull.
> > Hcidump reports this:
> > < HCI Command: Delete Stored Link Key (0x03|0x0012) plen 7
> > bdaddr 00:09:DD:60:02:45 all 0
> > > HCI Event: Command Complete (0x0e) plen 4
> > Delete Stored Link Key (0x03|0x0012) ncmd 1
> > status 0x11 deleted 2525
> > Error: Unsupported Feature or Parameter Value
> >
> > I guess it might be the value of parameter "all". I didn't know what
> > it is, so I tried with 0 and 1 (apperently not correct). Anyone knows
> > what this parameter of type uint8_t is for? I thought it might be like
> > a "boolean" variable, instructing deletion of ALL the associated link
> > keys. Am I far off?
> >
> > Another thing, about the hci_read_stored_link_key function. Is the key
> > returned as an int-value or by some other means? I'm a bit confused
> > about this matter..
>
> all these functions deal with the link keys stored on the chip. The
> default operation of BlueZ is not to store these link keys on the
> Bluetooth chip itself. Have a look at the D-Bus API for BlueZ. The
> methods ListBondings() and RemoveBonding() give you what you actually
> need.
>
> Regards
>
> Marcel
Thank you so much! Really appreciate it!
You have no idea how long I've been trying to solve this one! I'll take a
look at D-Bus.
Regards
Staale
[-- Attachment #1.2: Type: text/html, Size: 2628 bytes --]
[-- Attachment #2: Type: text/plain, Size: 347 bytes --]
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
[-- Attachment #3: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-12-21 15:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-21 12:45 [Bluez-users] Delete, write and read link keys using functions in hci.c Staale A. Kleppe
2006-12-21 12:48 ` Marcel Holtmann
2006-12-21 15:07 ` Ståle Andreas Kleppe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox