OSDN Git Service

autopair: Add special handling for printers
authorBastien Nocera <hadess@hadess.net>
Tue, 19 Nov 2013 13:15:40 +0000 (14:15 +0100)
committerJohan Hedberg <johan.hedberg@intel.com>
Tue, 19 Nov 2013 13:35:19 +0000 (15:35 +0200)
As was done in gnome-bluetooth since 2009:
https://git.gnome.org/browse/gnome-bluetooth/commit/?id=7a472c151d44a3378ecbd3c2a75c763f5c577fe9

plugins/autopair.c

index e6e5035..8c98c12 100644 (file)
@@ -121,6 +121,14 @@ static ssize_t autopair_pincb(struct btd_adapter *adapter,
                }
 
                break;
+       case 0x06:              /* Imaging */
+               if (class & 0x80) {     /* Printer */
+                       if (attempt > 1)
+                               return 0;
+                       memcpy(pinbuf, "0000", 4);
+                       return 4;
+               }
+               break;
        }
 
        return 0;