struct eir_data eir_data;
char *alias, *name;
gboolean legacy, name_known;
- uint32_t dev_class;
int err;
GSList *l;
return;
}
- dev_class = eir_data.dev_class[0] | (eir_data.dev_class[1] << 8) |
- (eir_data.dev_class[2] << 16);
- if (dev_class != 0)
- write_remote_class(&adapter->bdaddr, bdaddr, dev_class);
+ if (eir_data.class != 0)
+ write_remote_class(&adapter->bdaddr, bdaddr, eir_data.class);
if (eir_data.appearance != 0)
write_remote_appearance(&adapter->bdaddr, bdaddr, bdaddr_type,
alias = read_stored_data(&adapter->bdaddr, bdaddr, bdaddr_type,
"aliases");
- dev = found_device_new(bdaddr, bdaddr_type, name, alias, dev_class,
- legacy, eir_data.flags);
+ dev = found_device_new(bdaddr, bdaddr_type, name, alias,
+ eir_data.class, legacy, eir_data.flags);
free(name);
free(alias);
case EIR_CLASS_OF_DEV:
if (data_len < 3)
break;
- memcpy(eir->dev_class, data, 3);
+ eir->class = data[0] | (data[1] << 8) |
+ (data[2] << 16);
break;
case EIR_GAP_APPEARANCE:
GSList *services;
int flags;
char *name;
- uint8_t dev_class[3];
+ uint32_t class;
uint16_t appearance;
gboolean name_complete;
uint8_t *hash;
}
void btd_event_conn_complete(bdaddr_t *local, bdaddr_t *peer, uint8_t bdaddr_type,
- char *name, uint8_t *dev_class)
+ char *name, uint32_t class)
{
struct btd_adapter *adapter;
struct btd_device *device;
update_lastused(local, peer, bdaddr_type);
- if (dev_class != NULL) {
- uint32_t class = dev_class[0] | (dev_class[1] << 8) |
- (dev_class[2] << 16);
-
- if (class != 0)
- write_remote_class(local, peer, class);
- }
+ if (class != 0)
+ write_remote_class(local, peer, class);
device_set_addr_type(device, bdaddr_type);
void btd_event_remote_class(bdaddr_t *local, bdaddr_t *peer, uint32_t class);
void btd_event_remote_name(bdaddr_t *local, bdaddr_t *peer, char *name);
void btd_event_conn_complete(bdaddr_t *local, bdaddr_t *peer, uint8_t bdaddr_type,
- char *name, uint8_t *dev_class);
+ char *name, uint32_t class);
void btd_event_conn_failed(bdaddr_t *local, bdaddr_t *peer, uint8_t status);
void btd_event_disconn_complete(bdaddr_t *local, bdaddr_t *peer);
void btd_event_simple_pairing_complete(bdaddr_t *local, bdaddr_t *peer, uint8_t status);
btd_event_conn_complete(&info->bdaddr, &ev->addr.bdaddr,
ev->addr.type,
eir_data.name,
- eir_data.dev_class);
+ eir_data.class);
eir_data_free(&eir_data);
}