[gnome-bluetooth] lib: Add support for joysticks



commit 16e9032f14a48248c10734f3fc7fbb90b1e4aef1
Author: Bastien Nocera <hadess hadess net>
Date:   Mon May 23 20:15:41 2016 +0200

    lib: Add support for joysticks
    
    As supported by the 8bitdo joypads.

 lib/pin-code-database.xml |    5 ++++-
 lib/pin.c                 |    1 +
 2 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/lib/pin-code-database.xml b/lib/pin-code-database.xml
index 0cefbd5..783800f 100644
--- a/lib/pin-code-database.xml
+++ b/lib/pin-code-database.xml
@@ -43,7 +43,7 @@
 <!DOCTYPE devices [
        <!ELEMENT devices (device)+>
        <!ELEMENT device EMPTY>
-       <!ATTLIST device type (any|mouse|tablet|keyboard|headset|headphones|audio|printer|network) "any">
+       <!ATTLIST device type (any|mouse|tablet|keyboard|headset|headphones|audio|printer|network|joypad) 
"any">
        <!ATTLIST device oui CDATA #IMPLIED>
        <!ATTLIST device vendor CDATA #IMPLIED>
        <!ATTLIST device name CDATA #IMPLIED>
@@ -171,6 +171,9 @@
        <!-- Printers -->
        <device type="printer" pin="0000"/>
 
+       <!-- Joypads and joysticks -->
+       <device type="joypad" pin="0000"/>
+
        <!-- Headphones and headsets -->
        <device type="headphones" pin="0000"/>
        <device type="headset" pin="0000"/>
diff --git a/lib/pin.c b/lib/pin.c
index f07b53f..f3248d1 100644
--- a/lib/pin.c
+++ b/lib/pin.c
@@ -100,6 +100,7 @@ static guint string_to_type(const char *type)
        TYPE_IS ("audio", BLUETOOTH_TYPE_OTHER_AUDIO);
        TYPE_IS ("printer", BLUETOOTH_TYPE_PRINTER);
        TYPE_IS ("network", BLUETOOTH_TYPE_NETWORK);
+       TYPE_IS ("joypad", BLUETOOTH_TYPE_JOYPAD);
 
        g_warning ("unhandled type '%s'", type);
        return BLUETOOTH_TYPE_ANY;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]