diff options
author | Bastien Nocera <hadess@hadess.net> | 2017-09-04 19:54:46 +0200 |
---|---|---|
committer | Szymon Janc <szymon.janc@codecoup.pl> | 2017-10-17 11:33:59 +0200 |
commit | db4ec110361a288886bb2160b6fede7654167f90 (patch) | |
tree | ce96adb6427b065272d591ec1a5102ce63c8b421 /plugins | |
parent | cd8197d5b1d4bc8fdd21170a0c9f984ccd0783f9 (diff) | |
download | bluez-db4ec110361a288886bb2160b6fede7654167f90.tar.gz |
autopair: Don't handle the iCade
We can't easily enter digits other than 1 through 4 (inclusive)
so leave it up to the agent to figure out a good passcode
for the iCade.
Note that we can not use the VID/PID of the device, as it is not
yet known at that point.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/autopair.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/autopair.c b/plugins/autopair.c index d44cf539b..6980b0a64 100644 --- a/plugins/autopair.c +++ b/plugins/autopair.c @@ -60,13 +60,23 @@ static ssize_t autopair_pincb(struct btd_adapter *adapter, { char addr[18]; char pinstr[7]; + char name[25]; uint32_t class; ba2str(device_get_address(device), addr); class = btd_device_get_class(device); - DBG("device %s 0x%x", addr, class); + device_get_name(device, name, sizeof(name)); + + DBG("device '%s' (%s) class: 0x%x vid/pid: 0x%X/0x%X", + name, addr, class, + btd_device_get_vendor (device), + btd_device_get_product (device)); + + /* The iCade shouldn't use random PINs like normal keyboards */ + if (name != NULL && strstr(name, "iCade") != NULL) + return 0; /* This is a class-based pincode guesser. Ignore devices with an * unknown class. |