diff --git a/src/device.c b/src/device.c
index 0ae52ce..7d64eb8 100644
--- a/src/device.c
+++ b/src/device.c
}
int device_request_authentication(struct btd_device *device, auth_type_t type,
- uint32_t passkey, gboolean secure, void *cb)
+ void *data, gboolean secure, void *cb)
{
struct authentication_req *auth;
struct agent *agent;
auth->device = device;
auth->cb = cb;
auth->type = type;
- auth->passkey = passkey;
auth->secure = secure;
device->authr = auth;
auth, NULL);
break;
case AUTH_TYPE_CONFIRM:
- err = agent_request_confirmation(agent, device, passkey,
+ auth->passkey = *((uint32_t *) data);
+ err = agent_request_confirmation(agent, device, auth->passkey,
confirm_cb, auth, NULL);
break;
case AUTH_TYPE_NOTIFY_PASSKEY:
- err = agent_display_passkey(agent, device, passkey);
+ auth->passkey = *((uint32_t *) data);
+ err = agent_display_passkey(agent, device, auth->passkey);
break;
default:
err = -EINVAL;
diff --git a/src/device.h b/src/device.h
index d5fdf45..4aca224 100644
--- a/src/device.h
+++ b/src/device.h
gboolean device_is_bonding(struct btd_device *device, const char *sender);
void device_cancel_bonding(struct btd_device *device, uint8_t status);
int device_request_authentication(struct btd_device *device, auth_type_t type,
- uint32_t passkey, gboolean secure, void *cb);
+ void *data, gboolean secure, void *cb);
void device_cancel_authentication(struct btd_device *device, gboolean aborted);
gboolean device_is_authenticating(struct btd_device *device);
gboolean device_is_authorizing(struct btd_device *device);
diff --git a/src/event.c b/src/event.c
index 3259e7d..a4a60d0 100644
--- a/src/event.c
+++ b/src/event.c
return 0;
}
- return device_request_authentication(device, AUTH_TYPE_PINCODE, 0,
+ return device_request_authentication(device, AUTH_TYPE_PINCODE, NULL,
secure, pincode_cb);
}
return -ENODEV;
return device_request_authentication(device, AUTH_TYPE_CONFIRM,
- passkey, FALSE, confirm_cb);
+ &passkey, FALSE, confirm_cb);
}
int btd_event_user_passkey(bdaddr_t *sba, bdaddr_t *dba)
if (!get_adapter_and_device(sba, dba, &adapter, &device, TRUE))
return -ENODEV;
- return device_request_authentication(device, AUTH_TYPE_PASSKEY, 0,
+ return device_request_authentication(device, AUTH_TYPE_PASSKEY, NULL,
FALSE, passkey_cb);
}
return -ENODEV;
return device_request_authentication(device, AUTH_TYPE_NOTIFY_PASSKEY,
- passkey, FALSE, NULL);
+ &passkey, FALSE, NULL);
}
void btd_event_simple_pairing_complete(bdaddr_t *local, bdaddr_t *peer,