On Thu, 18 Aug 2011 11:26:38 -0400 Alan Ott <alan@xxxxxxxxxxx> wrote: > On 08/18/2011 10:22 AM, Antonio Ospite wrote: > > Remove hardcoded #defines and put the values in a struct so we can handle > > different device types. > > > > From the USB dumps I've seen[1], different devices have just different ways to > > get and set the bdaddrs, the pairing algorithm is the same. > > > > [1] http://ps3.jim.sh/sixaxis/dumps/ > > > > --- > > plugins/sixaxis.c | 80 ++++++++++++++++++++++++++++++++++------------------ > > 1 files changed, 52 insertions(+), 28 deletions(-) > > > > diff --git a/plugins/sixaxis.c b/plugins/sixaxis.c > > index e08222c..608474f 100644 > > --- a/plugins/sixaxis.c > > +++ b/plugins/sixaxis.c > > @@ -70,12 +70,38 @@ > > [...] > > +static struct sony_controller controllers[] = { > > + { > > + .vendor_id = 0x054c, > > + .product_id = 0x0268, > > + .name = "PLAYSTATION(R)3 Controller", > > + .pnp_record = "3601920900000A000100000900013503191124090004350D35061901000900113503190011090006350909656E09006A0901000900093508350619112409010009000D350F350D350619010009001335031900110901002513576972656C65737320436F6E74726F6C6C65720901012513576972656C65737320436F6E74726F6C6C6572090102251B536F6E7920436F6D707574657220456E7465727461696E6D656E740902000901000902010901000902020800090203082109020428010902052801090206359A35980822259405010904A101A102850175089501150026FF00810375019513150025013500450105091901291381027501950D0600FF8103150026FF0005010901A10075089504350046FF0009300931093209358102C0050175089527090181027508953009019102750895300901B102C0A1028502750895300901B102C0A10285EE750895300901B102C0A10285EF750895300901B102C0C0090207350835060904090901000902082800090209280109020A280109020B09010009020C093E8009020D280009020E2800", > > + .hid_uuid = "00001124-0000-1000-8000-00805f9b34fb", > > Where do the pnp_record and hid_uuid come from? It seems a bit odd to > have a giant hard-coded identifier string (pnp), but I'm not an expert > on this stuff, and I'm mostly just curious about it. > Bastien provided those, AFAIR PNP_RECORD is an identifier shown in the association request when the plugin is not enabled, and it could depend on the device. WRT HID_UUID, maybe this is not device specific, it might just tell "this is a HID device", I need confirmation about that so I can move the field out of the structure. Thanks, Antonio -- Antonio Ospite http://ao2.it PGP public key ID: 0x4553B001 A: Because it messes up the order in which people normally read text. See http://en.wikipedia.org/wiki/Posting_style Q: Why is top-posting such a bad thing?
Attachment:
pgpA1_4YipKQP.pgp
Description: PGP signature