diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2011-09-22 18:51:52 +0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2011-10-01 09:02:19 +0300 |
commit | 42b90a434a50348f0aefad0751fd7176fcd18db3 (patch) | |
tree | 50345f6d9e38fafc1aa2e2b3cdc7890d48257826 /plugins/wiimote.c | |
parent | 73952ca597960043de7c32bd172bc5bc816b324e (diff) | |
download | bluez-42b90a434a50348f0aefad0751fd7176fcd18db3.tar.gz |
Remove use of read_device_id in wiimote plugin
Make use of btd_device_get_vendor and btd_device_get_product intead.
Diffstat (limited to 'plugins/wiimote.c')
-rw-r--r-- | plugins/wiimote.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/plugins/wiimote.c b/plugins/wiimote.c index e60231b54..fead72a93 100644 --- a/plugins/wiimote.c +++ b/plugins/wiimote.c @@ -60,20 +60,21 @@ static ssize_t wii_pincb(struct btd_adapter *adapter, struct btd_device *device, { uint16_t vendor, product; bdaddr_t sba, dba; - char src_addr[18], dst_addr[18]; + char addr[18]; adapter_get_address(adapter, &sba); device_get_address(device, &dba); - ba2str(&sba, src_addr); - ba2str(&dba, dst_addr); - - if (0 == read_device_id(src_addr, dst_addr, NULL, &vendor, &product, - NULL)) { - if (vendor == 0x057e && product == 0x0306) { - DBG("Forcing fixed pin on detected wiimote %s", dst_addr); - memcpy(pinbuf, &sba, 6); - return 6; - } + ba2str(&dba, addr); + + vendor = btd_device_get_vendor(device); + if (vendor != 0x057e) + return 0; + + product = btd_device_get_product(device); + if (product == 0x0306) { + DBG("Forcing fixed pin on detected wiimote %s", addr); + memcpy(pinbuf, &sba, 6); + return 6; } return 0; |