diff --git a/android/bluetooth.c b/android/bluetooth.c
index d6cefb7..0515468 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
int bond_state;
char *name;
char *friendly_name;
+ uint32_t class;
};
struct browse_req {
{
const struct mgmt_ev_pin_code_request *ev = param;
struct hal_ev_pin_request hal_ev;
+ struct device *dev;
char dst[18];
if (length < sizeof(*ev)) {
ba2str(&ev->addr.bdaddr, dst);
+ dev = get_device(&ev->addr.bdaddr);
+
/* Workaround for Android Bluetooth.apk issue: send remote
* device property */
- get_device_name(get_device(&ev->addr.bdaddr));
+ get_device_name(dev);
set_device_bond_state(&ev->addr.bdaddr, HAL_STATUS_SUCCESS,
HAL_BOND_STATE_BONDING);
DBG("%s type %u secure %u", dst, ev->addr.type, ev->secure);
- /* TODO CoD of remote devices should probably be cached
- * Name we already send in remote device prop */
+ /* Name already sent in remote device prop */
memset(&hal_ev, 0, sizeof(hal_ev));
bdaddr2android(&ev->addr.bdaddr, hal_ev.bdaddr);
+ hal_ev.class_of_dev = dev->class;
ipc_send_notif(HAL_SERVICE_ID_BLUETOOTH, HAL_EV_PIN_REQUEST,
sizeof(hal_ev), &hal_ev);
}
if (eir.class) {
+ dev->class = eir.class;
+
size += fill_hal_prop(buf + size, HAL_PROP_DEVICE_CLASS,
sizeof(eir.class), &eir.class);
(*num_prop)++;
static uint8_t get_device_class(struct device *dev)
{
- DBG("Not implemented");
+ send_device_property(&dev->bdaddr, HAL_PROP_DEVICE_CLASS,
+ sizeof(dev->class), &dev->class);
- /* TODO */
-
- return HAL_STATUS_FAILED;
+ return HAL_STATUS_SUCCESS;
}
static uint8_t get_device_type(struct device *dev)