Joy-Con HID Reverse Engineering

shinyquagsire23 Apr 11, 2017.

  1. shinyquagsire23
    OP

    shinyquagsire23 SALT/Sm4sh Leak Guy

    Member
    13
    Nov 18, 2012
    United States
    Las Vegas
    OK I found a solution for Pro Controllers, add this after the last 80 02 handshake:
    Code:
    //Only talk HID from now on
        memset(buf_l, 0x00, 0x40);
        buf_l[0] = 0x80;
        buf_l[1] = 0x04;
        hid_exchange(handle_l, buf_l, 0x2);
    
    I found this while messing with vibrations (by stealing the vibrate enable flag from the Bluetooth session). While I was messing with vibration, my controller would time out the right Joy-Con if I talked exclusively with the left Joy-Con for too long, 80 04 stopped that, and 80 05 can allow the controller to connect back to Bluetooth again.

    Weird vibration stuff if anyone is curious:


    With that fix found though I'll try and see if I can make some nicer code which works better for Pro Controllers, should be able to sign in each Joy-Con one at a time now.
     
    Cava and TotalInsanity4 like this.
  2. Maschell

    Maschell GBAtemp Advanced Fan

    Member
    10
    Jun 14, 2008
    Gambia, The
    The interface_number for the pro controller is -1

    Edit: Yay got working now with the pro controller! It sometimes takes a few tries, but then it's working
    That vibration test is really spooky. WTF :D
     
    Last edited by Maschell, Apr 15, 2017
  3. shinyquagsire23
    OP

    shinyquagsire23 SALT/Sm4sh Leak Guy

    Member
    13
    Nov 18, 2012
    United States
    Las Vegas
    If it sometimes takes a few tries I'd place bets on the baudrate switching, have a feeling the Pro Controller defaults to a higher baudrate so maybe that doesn't need to be done. Or maybe I just need to place the 80 04 call after the first handshake but before the baudrate switch. Or you just had the vibration test on, that does some dumb stuff to keep the Bluetooth states.
     
  4. normal19

    normal19 GBAtemp Regular

    Member
    5
    Aug 23, 2014
    Afghanistan
    This works now, ther'es a lot of randomly changing numbers in the output now and pressing buttons and moving the analogs causes constant changes. Sso it does actually read inputs through USB, interesting, can't wait for drivers. SPI dump doesn't work anymore though.

    What are those random numbers, just noise? would itbe possible to read acceleormeters too?
     
    Last edited by normal19, Apr 16, 2017
  5. shinyquagsire23
    OP

    shinyquagsire23 SALT/Sm4sh Leak Guy

    Member
    13
    Nov 18, 2012
    United States
    Las Vegas
    No, they aren't motion data, motion data is at the very end of the packet from what I've gathered. Managed to see some motion data doing the same trick I did to get vibration to work.
     
  6. Kekskrümel

    Kekskrümel Member

    Newcomer
    5
    Mar 3, 2014
    Gambia, The
    Would it be later also possible to send commands to the switch?

    So pc with bt adapter could send commands to the switch ?

    Thx for the work
     
Quick Reply
Draft saved Draft deleted
Loading...