diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2006-03-12 19:19:35 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2006-03-12 19:19:35 +0000 |
commit | ddf636d3df686b0f7b6c6f062b6a8b55d5cd558c (patch) | |
tree | fef13ba4ea9f8984cd42cb1c9061407b4653c63c /hcid | |
parent | ba684cadb26bdbcaac8fb2b6f0739b44028fa3a7 (diff) |
Cleanup the request_pin() function
Diffstat (limited to 'hcid')
-rw-r--r-- | hcid/security.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/hcid/security.c b/hcid/security.c index 97637d79..dcda63c5 100644 --- a/hcid/security.c +++ b/hcid/security.c @@ -192,9 +192,11 @@ void set_pin_length(bdaddr_t *sba, int length) io_data[dev_id].pin_length = length; } -#ifndef ENABLE_DBUS -static void call_pin_helper(int dev, bdaddr_t *sba, struct hci_conn_info *ci) +static void request_pin(int dev, bdaddr_t *sba, struct hci_conn_info *ci) { +#ifdef ENABLE_DBUS + hcid_dbus_request_pin(dev, sba, ci); +#else pin_code_reply_cp pr; char *pin = "BlueZ"; int len; @@ -207,17 +209,9 @@ static void call_pin_helper(int dev, bdaddr_t *sba, struct hci_conn_info *ci) bacpy(&pr.bdaddr, &ci->bdaddr); memcpy(pr.pin_code, pin, len); pr.pin_len = len; - hci_send_cmd(dev, OGF_LINK_CTL, OCF_PIN_CODE_REPLY, - PIN_CODE_REPLY_CP_SIZE, &pr); -} -#endif -static void request_pin(int dev, bdaddr_t *sba, struct hci_conn_info *ci) -{ -#ifdef ENABLE_DBUS - hcid_dbus_request_pin(dev, sba, ci); -#else - call_pin_helper(dev, sba, ci); + hci_send_cmd(dev, OGF_LINK_CTL, OCF_PIN_CODE_REPLY, + PIN_CODE_REPLY_CP_SIZE, &pr); #endif } |