T3.6 USB Host - Bluetooth

Hi @mjs513 and @defragster - I think the issue is more getting the right flow of messages going both ways...

I figured out (in mouse case at least) where I diverged... At least in this case... There may still be some more changes that I need to do, but I did know get a version that appeared to work when setup to do pair and paired with mouse. Then update program to be not in pair mode and it was able to connect when I Pressed a button..

I pushed the changes up for bluetooth.cpp that made this work... Later I will also try with joystick...

Also need to figure out where asking for the name should happen in bind case... WIll probably look at binding PS4 on HS2 and see where they did it in the flow...

I know I should probably try out PS4 with these changes as well!

@defragster - hard to say how best to figure out some of this stuff... Sometimes I have the best luck when I look at the raw data like I showed in #197... Maybe would be nice if it was instrumented with what the different commands are, but also nice that things sort of line up... Note the actual raw data has time stamps and bunches of other stuff which I edited out.

Kurt
 
@KurtE and @defragster
Some test results with debug commented out in Bluetooth.cpp:

1. BluetoothController bluet(myusb);
Tries to connect but then it dies:
Code:
BluetoothController::find_driver  driver 1fff48f8
JoystickController::claim_bluetooth TRUE: 9472
    *** Claimed ***
  JoystickController::remoteNameComplete Wireless Controller - set to PS4
Joystick update Rumble/LEDs
E
It looks like its trying to get a data packet before its ready.

2. BluetoothController bluet(myusb, true, "0000"); // Version does pairing to device
Still Works along with Rumble but remoteName still a problem.

With Debug enabled:
1.BluetoothController bluet(myusb, true, "0000"); Connects and disconnects a few times and rumble doesn't seem to work with this occurring. This seems to occur if the joystick is totally disconnected (reset) prior to connecting) which this would preclude.
Code:
USB Host Testing
960
*** Device Bluet a12:1 - connected ***
  product: CSR8510 A10
*** Device Bluet - disconnected ***
*** Device Bluet a12:1 - connected ***
  product: CSR8510 A10
*** Device Bluet - disconnected ***
*** Device Bluet a12:1 - connected ***
  product: CSR8510 A10
*** First Joystick message 0:0 ***
LX: 129, LY: 127, RX: 127, RY: 128 
L-Trig: 31, R-Trig: 0, Trig-Button: 4 
Buttons: 8, PS: 0
Arrows: 1
Battery level percentage: 0 

Rumbling: 31, 0
JoystickType --------------> 0

2. With pairing off seeing the connect/disconnect pattern but never connects. What I did notice is that it seems to get a data packet that causes the rumble to trip. Have to try something:
Code:
    Event: handle_hci_remote_name_complete(0)
    Remote Name: Wireless Controller
  JoystickController::remoteNameComplete Wireless Controller - set to PS4
Joystick update Rumble/LEDs
00 20 06 00 02 00 40 00 43 02 )
HCI_OP_ACCEPT_CONN_REQ called (09 04 07 ea 94 9b e2 1f 00 00 )
tx_data callback (bluetooth): 0 : 9 4 7 ea 94 9b e2 1f 0 0 
Bluetooth DisconnectBluetoothController claim this=1fff40c0 vid:pid=a12:1
    9 4 0 0 3 e0 1 1 0 7 5 81 3 10 0 1 7 5 2 2 40 0 1 7 5 82 2 40 0 1 9 4 1 0 2 e0 1 1 0 7 5 3 1 0 0 1 7 5 83 1 0 0 1 9 4 1 1 2 e0 1 1 0 7 5 
    3 1 9 0 1 7 5 83 1 9 0 1 9 4 1 2 2 e0 1 1 0 7 5 3 1 11 0 1 7 5 83 1 11 0 1 9 4 1 3 2 e0 1 1 0 7 5 3 1 19 0 1 7 5 83 1 19 0 1 9 4 1 4 2 e0 
    1 1 0 7 5 3 1 21 0 1 7 5 83 1 21 0 1 9 4 1 5 2 e0 1 1 0 7 5 3 1 31 0 1 7 5 83 1 31 0 1 
      rxep=1(16) txep=2(64) rx2ep=2(64)
HCI_RESET called (03 0c 00 )
    Control callback (bluetooth): 1 : 3 c 0 
BT rx_data(6): e 4 1 3 c 0 
    Command Completed! 
HCI_WRITE_CLASS_OF_DEV called (24 0c 03 04 08 00 )
    Control callback (bluetooth): 3 : 24 c 3 4 8 0 
BT rx_data(6): e 4 1 24 c 0 
    Command Completed! 
HCI_Read_BD_ADDR called (09 10 00 )
    Control callback (bluetooth): 4 : 9 10 0 
BT rx_data(12): e a 1 9 10 0 11 71 da 7d 1a 0 
    Command Completed! 
   BD Addr:11:71:da:7d:1a:0
HCI_Read_Local_Version_Information called (01 10 00 )
    Control callback (bluetooth): 4 : 1 10 0 
BT rx_data(14): e c 1 1 10 0 6 bb 22 6 a 0 bb 22 
    Command Completed! 
    Local Version: 6
HCI_WRITE_SCAN_ENABLE called(1a 0c 01 02 )
    Control callback (bluetooth): 0 : 1a c 1 2 
BT rx_data(6): e 4 1 1a c 0 
    Command Completed! 
Write_Scan_enable Completed
te
No doesn't connect when I removed the hack to rumble

Don't get my BT mouse until tomorrow so couldn't test that
 
@defragster.

There is a bunch of stuff out there for windows including some source code. I did find this but the guy never posted the source: https://www.plop.at/en/teensy.html

In the uhs2.0 code they get the id's from the device descriptor, but I can't really find where we do that - just started looking though - say for the joystick.

Just for a data point I commented out Serial1 as a test for the pairing on and off (true or blank). In the first case I get the same behavior. In the second case it gets more interesting. With Serial1 it does not seem to want to connect at all, with Serial1 uncommented, I see that connect/disconnect/connect behavior to the joystick.

Is the UHS2.0 the external Host adapter you guys have?

I sent a message to Elmar asking about his source availability in case it might show something.
Kurt - I saw the timestamps before wasn't sure if it might show something when not doing a compare but analyzing and worth recording them.
More mystery that the side effect of Serial.begin

Odd the 'name' isn't offered but for doing the right incantation. I did notice the name of the MSFT Mouse was not shown even though it connected in the Serial1 begin or not test.
 
@... - Sorry I was busy sweating...

Note: I tried running the PS4 on T4 and it did bind correctly when it has the PIN... But is not going through full setup when it is not with PIN...

Again need to figure out why, it is not continuing... Maybe something conditional wrong...

Code:
Write_Scan_enable Completed
BT rx_data(12): 4 a 97 a2 6c 68 af dc 8 25 0 1
    Event: Incoming Connect -  97:a2:6c:68:af:dc CL:2508 LT:1
      Peripheral device
        Gamepad
BluetoothController::find_driver  driver 20005458
JoystickController::claim_bluetooth TRUE
    *** Claimed ***
HCI_OP_REMOTE_NAME_REQ called (19 04 0a 97 a2 6c 68 af dc 01 00 00 00 )
    Control callback (bluetooth): 0 : 19 4 a 97 a2 6c 68 af dc 1 0 0 0
BT rx_data(6): f 4 0 1 19 4
    Command 419 Status 0
BT rx_data(16): 7 ff 0 97 a2 6c 68 af dc 57 69 72 65 6c 65 73
BT rx_data(16): 73 20 43 6f 6e 74 72 6f 6c 6c 65 72 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(1): 0
    Event: handle_hci_remote_name_complete(0)
    Remote Name: Wireless Controller
  JoystickController::remoteNameComplete Wireless Controller - set to PS4
HCI_OP_ACCEPT_CONN_REQ called (09 04 07 97 a2 6c 68 af dc 00 )
    Control callback (bluetooth): 0 : 9 4 7 97 a2 6c 68 af dc 0
BT rx_data(6): f 4 0 1 9 4
    Command 409 Status 0
BT rx_data(10): 12 8 0 97 a2 6c 68 af dc 0
BT rx_data(13): 3 b 0 b 0 97 a2 6c 68 af dc 1 0
    Connection Complete - ST:0 LH:b
BT rx_data(5): 1b 3 b 0 5

=====================
BT rx2_data(16): b 20 c 0 8 0 1 0 2 1 4 0 1 0 40 0
    L2CAP Connection Request: ID: 1, PSM: 1, SCID: 40
Also compare to what the HS2...

Again not: if you hare having strange results with Serial1... I resolved by either going at 2000000 or by large write buffer.
My sketch is using a large buffer.
Code:
uint8_t Serial1_write_buffer[1024];
void setup()
{
  Serial1.addStorageForWrite(Serial1_write_buffer, sizeof(Serial1_write_buffer));
  Serial1.begin(115200);

Besides I needed to test to see if the extra storage code was working. But idea/issue is if you call off to Serial1.write(...) and buffer is full it will wait for room in buffer, which can screw up the normal flow...
 
FYI - here is an edit LA trace on UHS2 - with it doing the full pin connect
Code:
IN	0x01	0x12	0x02 0x0F 0x01 0x97 0xA2 0x6C 0x68 0xAF 0xDC 0x01 0x02 0x00 0x08 0x25 0x00 0xF5
IN	0x01	0x12	0x3F
SETUP	0x00	0x04	0x20 0x00 0x00 0x00 0x00 0x00 0x03 0x00
OUT	0x00	0x04	0x02 0x04 0x00
IN	0x01	0x12	0x0E 0x04 0x01 0x02 0x04 0x00
SETUP	0x00	0x04	0x20 0x00 0x00 0x00 0x00 0x00 0x10 0x00
OUT	0x00	0x04	0x05 0x04 0x0D 0x97 0xA2 0x6C 0x68 0xAF 0xDC 0x18 0xCC 0x01 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x0F 0x04 0x00 0x01 0x05 0x04
IN	0x01	0x12	0x03 0x0B 0x00 0x48 0x00 0x97 0xA2 0x6C 0x68 0xAF 0xDC 0x01 0x00
SETUP	0x00	0x04	0x20 0x00 0x00 0x00 0x00 0x00 0x05 0x00
OUT	0x00	0x04	0x11 0x04 0x02 0x48 0x00
IN	0x01	0x12	0x0F 0x04 0x00 0x00 0x11 0x04
IN	0x01	0x12	0x1B 0x03 0x48 0x00 0x05
IN	0x01	0x12	0x17 0x06 0x97 0xA2 0x6C 0x68 0xAF 0xDC
SETUP	0x00	0x04	0x20 0x00 0x00 0x00 0x00 0x00 0x09 0x00
OUT	0x00	0x04	0x0C 0x04 0x06 0x97 0xA2 0x6C 0x68 0xAF 0xDC
IN	0x01	0x12	0x0F 0x04 0x00 0x01 0x00 0x00
IN	0x01	0x12	0x0E 0x0A 0x01 0x0C 0x04 0x00 0x97 0xA2 0x6C 0x68 0xAF 0xDC
IN	0x01	0x12	0x16 0x06 0x97 0xA2 0x6C 0x68 0xAF 0xDC
SETUP	0x00	0x04	0x20 0x00 0x00 0x00 0x00 0x00 0x1A 0x00
OUT	0x00	0x04	0x0D 0x04 0x17 0x97 0xA2 0x6C 0x68 0xAF 0xDC 0x04 0x30 0x30 0x30 0x30 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x0E 0x0A 0x01 0x0D 0x04 0x00 0x97 0xA2 0x6C 0x68 0xAF 0xDC
IN	0x01	0x12	0x18 0x17 0x97 0xA2 0x6C 0x68 0xAF 0xDC 0x68 0x4B 0x05 0xEA 0x0F 0x26 0xB2 0x08
IN	0x01	0x12	0x5D 0x20 0x45 0x14 0x5F 0xEC 0xBB 0x0F 0x00
IN	0x01	0x12	0x06 0x03 0x00 0x48 0x00
OUT	0x02	0x01	0x48 0x20 0x0C 0x00 0x08 0x00 0x01 0x00 0x02 0x00 0x04 0x00 0x11 0x00 0x70 0x00
IN	0x01	0x12	0x13 0x05 0x01 0x48 0x00 0x01 0x00
IN	0x02	0x01	0x48 0x20 0x10 0x00 0x0C 0x00 0x01 0x00 0x03 0x00 0x08 0x00 0x40 0x00 0x70 0x00 0x01 0x00 0x02 0x00
IN	0x01	0x12	0x08 0x04 0x00 0x48 0x00 0x01
IN	0x02	0x01	0x48 0x20 0x10 0x00 0x0C 0x00 0x01 0x00 0x03 0x00 0x08 0x00 0x40 0x00 0x70 0x00 0x00 0x00 0x00 0x00
OUT	0x02	0x01	0x48 0x20 0x10 0x00 0x0C 0x00 0x01 0x00 0x04 0x01 0x08 0x00 0x40 0x00 0x00 0x00 0x01 0x02 0xFF 0xFF
IN	0x01	0x12	0x13 0x05 0x01 0x48 0x00 0x01 0x00
IN	0x02	0x01	0x48 0x20 0x12 0x00 0x0E 0x00 0x01 0x00 0x05 0x01 0x0A 0x00 0x70 0x00 0x00 0x00 0x00 0x00 0x01 0x02 0xFF 0xFF
OUT	0x02	0x01	0x48 0x20 0x05 0x00 0x01 0x00 0x40 0x00 0x70
OUT	0x02	0x01	0x48 0x20 0x0C 0x00 0x08 0x00 0x01 0x00 0x02 0x02 0x04 0x00 0x13 0x00 0x71 0x00
IN	0x02	0x01	0x48 0x20 0x10 0x00 0x0C 0x00 0x01 0x00 0x04 0x01 0x08 0x00 0x70 0x00 0x00 0x00 0x01 0x02 0xFF 0xFF
OUT	0x02	0x01	0x48 0x20 0x12 0x00 0x0E 0x00 0x01 0x00 0x05 0x01 0x0A 0x00 0x40 0x00 0x00 0x00 0x00 0x00 0x01 0x02 0xA0 0x02
IN	0x01	0x12	0x13 0x05 0x01 0x48 0x00 0x01 0x00
IN	0x01	0x12	0x13 0x05 0x01 0x48 0x00 0x01 0x00
IN	0x02	0x01	0x48 0x20 0x05 0x00 0x01 0x00 0x70 0x00 0x03
IN	0x02	0x01	0x48 0x20 0x10 0x00 0x0C 0x00 0x01 0x00 0x03 0x02 0x08 0x00 0x41 0x00 0x71 0x00 0x01 0x00 0x02 0x00
IN	0x01	0x12	0x13 0x05 0x01 0x48 0x00 0x01 0x00
IN	0x02	0x01	0x48 0x20 0x10 0x00 0x0C 0x00 0x01 0x00 0x03 0x02 0x08 0x00 0x41 0x00 0x71 0x00 0x00 0x00 0x00 0x00
OUT	0x02	0x01	0x48 0x20 0x10 0x00 0x0C 0x00 0x01 0x00 0x04 0x03 0x08 0x00 0x41 0x00 0x00 0x00 0x01 0x02 0xFF 0xFF
IN	0x01	0x12	0x13 0x05 0x01 0x48 0x00 0x01 0x00
IN	0x02	0x01	0x48 0x20 0x12 0x00 0x0E 0x00 0x01 0x00 0x05 0x03 0x0A 0x00 0x71 0x00 0x00 0x00 0x00 0x00 0x01 0x02 0xFF 0xFF
OUT	0x02	0x01	0x48 0x20 0x06 0x00 0x02 0x00 0x40 0x00 0x43 0x02
SETUP	0x00	0x04	0x20 0x00 0x00 0x00 0x00 0x00 0x04 0x00
OUT	0x00	0x04	0x1A 0x0C 0x01 0x02
IN	0x02	0x01	0x48 0x20 0x10 0x00 0x0C 0x00 0x01 0x00 0x04 0x02 0x08 0x00 0x71 0x00 0x00 0x00 0x01 0x02 0xFF 0xFF
OUT	0x02	0x01	0x48 0x20 0x12 0x00 0x0E 0x00 0x01 0x00 0x05 0x02 0x0A 0x00 0x41 0x00 0x00 0x00 0x00 0x00 0x01 0x02 0xA0 0x02
IN	0x01	0x12	0x13 0x05 0x01 0x48 0x00 0x01 0x00
IN	0x02	0x01	0x48 0x20 0x2A 0x00 0x26 0x00 0x70 0x00 0xA3 0x02 0x01 0x00 0x04 0x00 0x09 0x00 0x88 0x22 0xCE 0x22 0xE4 0x23 0xAF 0xDD 0x40 0xDD 0xFE 0xDB 0x1C 0x02 0x1C 0x02 0x1E 0x20 0xE1 0xDF 0x39 0x20 0xC8 0xDF 0x8F 0x1F 0x72 0xE0 0x04 0x00
IN	0x01	0x12	0x0E 0x04 0x01 0x1A 0x0C 0x00
IN	0x01	0x12	0x13 0x05 0x01 0x48 0x00 0x01 0x00
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x7D 0x7C 0x7C 0x79 0x08 0x10 0x01 0x00 0x00 0x16 0x59 0xFA 0xFD 0xFF 0x02 0x00 0x07 0x00 0xDC 0xFC 0x73 0x0D 0x10 0xE3 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
OUT	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x40 0x00 0x52 0x11 0x80 0x00 0xFF 0x00 0x00 0x00 0x00 0x00 0x00 0xFF 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
OUT	0x02	0x01	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
OUT	0x02	0x01	0x48 0x20 0x0C 0x00 0x08 0x00 0x01 0x00 0x06 0x04 0x04 0x00 0x41 0x00 0x71 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0xDF 0x43 0xC2 0x03
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x7D 0x7C 0x7C 0x79 0x08 0x10 0x05 0x00 0x00 0x8F 0x59 0xFA 0xFB 0xFF 0x01 0x00 0x0B 0x00 0xE6 0xFC 0x96 0x0D 0xEB 0xE2 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x13 0x05 0x01 0x48 0x00 0x01 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x4A 0x23 0x53 0x10
IN	0x01	0x12	0x13 0x05 0x01 0x48 0x00 0x01 0x00
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x7D 0x7C 0x7C 0x79 0x08 0x10 0x09 0x00 0x00 0xCB 0x5B 0xFA 0xFD 0xFF 0x02 0x00 0x0A 0x00 0xF3 0xFC 0x91 0x0D 0x01 0xE3 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x93 0xEF 0xCB 0xA8
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x7D 0x7C 0x7C 0x79 0x08 0x10 0x0D 0x00 0x00 0xB2 0x5C 0xFA 0xFB 0xFF 0x02 0x00 0x09 0x00 0xEE 0xFC 0x79 0x0D 0x23 0xE3 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0xE2 0x02 0xDF 0xB4
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x7D 0x7B 0x7C 0x7A 0x08 0x10 0x11 0x00 0x00 0x99 0x5D 0xFA 0xF8 0xFF 0x02 0x00 0x09 0x00 0xE6 0xFC 0x71 0x0D 0x16 0xE3 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x7C 0x0D 0x0C 0x4D
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x7D 0x7C 0x7C 0x79 0x08 0x10 0x15 0x00 0x00 0x80 0x5E 0xFA 0xF6 0xFF 0x03 0x00 0x0B 0x00 0xE9 0xFC 0x79 0x0D 0xFD 0xE2 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x04 0x18 0x0A 0xC6
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x7D 0x7B 0x7C 0x79 0x08 0x10 0x19 0x00 0x00 0x67 0x5F 0xFA 0xF7 0xFF 0x03 0x00 0x0A 0x00 0xF3 0xFC 0x7F 0x0D 0xDF 0xE2 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x43 0xEB 0xDD 0x98
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x7D 0x7C 0x7C 0x79 0x08 0x10 0x1D 0x00 0x00 0x4F 0x60 0xFA 0xF9 0xFF 0x04 0x00 0x08 0x00 0xF1 0xFC 0x7C 0x0D 0xE1 0xE2 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x3C 0x74 0xAB 0x27
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x7D 0x7B 0x7C 0x79 0x08 0x10 0x21 0x00 0x00 0x35 0x61 0xFA 0xF8 0xFF 0x05 0x00 0x07 0x00 0xEE 0xFC 0x6C 0x0D 0xEB 0xE2 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x7E 0x9A 0x88 0xC9
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x7D 0x7C 0x7C 0x79 0x08 0x10 0x25 0x00 0x00 0x1C 0x62 0xFA 0xF5 0xFF 0x04 0x00 0x08 0x00 0xF3 0xFC 0x71 0x0D 0xE1 0xE2 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0xEF 0x18 0xD1 0x57
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x7D 0x7B 0x7C 0x79 0x08 0x10 0x29 0x00 0x00 0x03 0x63 0xFA 0xF4 0xFF 0x03 0x00 0x08 0x00 0xF2 0xFC 0x86 0x0D 0xDD 0xE2 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0xEF 0x4B 0x7B 0x71
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x7D 0x7C 0x7C 0x79 0x08 0x10 0x2D 0x00 0x00 0xEA 0x63 0xFA 0xF6 0xFF 0x04 0x00 0x08 0x00 0xF9 0xFC 0x88 0x0D 0xE2 0xE2 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x8C 0xAE 0x82 0x11
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x7D 0x7C 0x7C 0x79 0x08 0x10 0x31 0x00 0x00 0xD1 0x64 0xFA 0xF8 0xFF 0x04 0x00 0x08 0x00 0x07 0xFD 0x79 0x0D 0xEC 0xE2 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x8F 0xE4 0x84 0xBC
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x7D 0x7C 0x7C 0x79 0x08 0x10 0x35 0x00 0x00 0xB8 0x65 0xFA 0xF8 0xFF 0x03 0x00 0x09 0x00 0x01 0xFD 0x67 0x0D 0x07 0xE3 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0xCC 0x8D 0x67 0x38
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x7D 0x7B 0x7C 0x79 0x08 0x10 0x39 0x00 0x00 0xA2 0x66 0xFA 0xF8 0xFF 0x03 0x00 0x08 0x00 0xF3 0xFC 0x61 0x0D 0x17 0xE3 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x9A 0xB4 0x17 0xF5
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x7D 0x7B 0x7C 0x7A 0x08 0x10 0x3D 0x00 0x00 0xFB 0x67 0xFA 0xFA 0xFF 0x04 0x00 0x07 0x00 0xEA 0xFC 0x85 0x0D 0xF1 0xE2 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0xF5 0x3F 0xE1 0x6D
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x7D 0x7C 0x7D 0x79 0x08 0x10 0x41 0x00 0x00 0x6E 0x68 0xFA 0xFA 0xFF 0x04 0x00 0x05 0x00 0xE2 0xFC 0xB9 0x0D 0xC7 0xE2 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0xCF 0x47 0xB1 0x3D
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x7D 0x7B 0x7C 0x7A 0x08 0x10 0x45 0x00 0x00 0x57 0x69 0xFA 0xF9 0xFF 0x03 0x00 0x04 0x00 0xD6 0xFC 0xC0 0x0D 0xC6 0xE2 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x7D 0x93 0xDF 0x70
IN	0x02	0x01	0x48 0x20 0x05 0x00 0x01 0x00 0x70 0x00 0x00
IN	0x02	0x01	0x48 0x20 0x0C 0x00 0x08 0x00 0x01 0x00 0x07 0x04 0x04 0x00 0x41 0x00 0x71 0x00
OUT	0x02	0x01	0x48 0x20 0x0C 0x00 0x08 0x00 0x01 0x00 0x06 0x05 0x04 0x00 0x40 0x00 0x70 0x00
IN	0x01	0x12	0x13 0x05 0x01 0x48 0x00 0x01 0x00
IN	0x02	0x01	0x48 0x20 0x0C 0x00 0x08 0x00 0x01 0x00 0x07 0x05 0x04 0x00 0x40 0x00 0x70 0x00
SETUP	0x00	0x04	0x20 0x00 0x00 0x00 0x00 0x00 0x06 0x00
OUT	0x00	0x04	0x06 0x04 0x03 0x48 0x00 0x13
IN	0x01	0x12	0x0F 0x04 0x00 0x01 0x06 0x04
IN	0x01	0x12	0x05 0x04 0x00 0x48 0x00 0x16
SETUP	0x00	0x04	0x20 0x00 0x00 0x00 0x00 0x00 0x04 0x00
OUT	0x00	0x04	0x1A 0x0C 0x01 0x02
IN	0x01	0x12	0x0E 0x04 0x01 0x1A 0x0C 0x00

Next up to try it with already paired version...

@defragster - yes the UHS2 version I am running that works in the full size shield that I have plugged into Arduino Mega (old 128K version)...
Sources for code up at: https://github.com/felis/USB_Host_Shield_2.0
 
Cool - now I'm sure I can know what I'm ignoring seeing UHS2 :)

Are the CALLBACK funcs the start of those message RX, RX2, Tx ?
 
Here is the UHS2 stuff to connect up to Joystick after it has already has a bind done...

Code:
Column1	Column2	Column3	Column4
IN	0x01	0x12	0x04 0x0A 0x97 0xA2 0x6C 0x68 0xAF 0xDC 0x08 0x25 0x00 0x01
SETUP	0x00	0x04	0x20 0x00 0x00 0x00 0x00 0x00 0x0D 0x00
OUT	0x00	0x04	0x19 0x04 0x0A 0x97 0xA2 0x6C 0x68 0xAF 0xDC 0x01 0x00 0x00 0x00
IN	0x00	0x04	0x0000
IN	0x01	0x12	0x0F 0x04 0x00 0x01 0x19 0x04
IN	0x01	0x12	0x07 0xFF 0x00 0x97 0xA2 0x6C 0x68 0xAF 0xDC 0x57 0x69 0x72 0x65 0x6C 0x65 0x73
IN	0x01	0x12	0x73 0x20 0x43 0x6F 0x6E 0x74 0x72 0x6F 0x6C 0x6C 0x65 0x72 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
SETUP	0x00	0x04	0x20 0x00 0x00 0x00 0x00 0x00 0x0A 0x00
OUT	0x00	0x04	0x09 0x04 0x07 0x97 0xA2 0x6C 0x68 0xAF 0xDC 0x00
IN	0x00	0x04	0x0000
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00
IN	0x01	0x12	0x0F 0x04 0x00 0x01 0x09 0x04
IN	0x01	0x12	0x12 0x08 0x00 0x97 0xA2 0x6C 0x68 0xAF 0xDC 0x00
IN	0x01	0x12	0x03 0x0B 0x00 0x48 0x00 0x97 0xA2 0x6C 0x68 0xAF 0xDC 0x01 0x00
OUT	0x02	0x01	0x48 0x20 0x0C 0x00 0x08 0x00 0x01 0x00 0x02 0x00 0x04 0x00 0x11 0x00 0x70 0x00
IN	0x01	0x12	0x20 0x07 0x97 0xA2 0x6C 0x68 0xAF 0xDC 0x01
IN	0x01	0x12	0x1B 0x03 0x48 0x00 0x05
IN	0x01	0x12	0x13 0x05 0x01 0x48 0x00 0x01 0x00
IN	0x02	0x01	0x48 0x20 0x10 0x00 0x0C 0x00 0x01 0x00 0x03 0x00 0x08 0x00 0x40 0x00 0x70 0x00 0x01 0x00 0x02 0x00
IN	0x01	0x12	0x17 0x06 0x97 0xA2 0x6C 0x68 0xAF 0xDC
SETUP	0x00	0x04	0x20 0x00 0x00 0x00 0x00 0x00 0x09 0x00
OUT	0x00	0x04	0x0C 0x04 0x06 0x97 0xA2 0x6C 0x68 0xAF 0xDC
IN	0x00	0x04	0x0000
IN	0x01	0x12	0x0E 0x0A 0x01 0x0C 0x04 0x00 0x97 0xA2 0x6C 0x68 0xAF 0xDC
IN	0x02	0x01	0x48 0x20 0x0C 0x00 0x08 0x00 0x01 0x00 0x02 0x01 0x04 0x00 0x01 0x00 0x41 0x00
IN	0x01	0x12	0x16 0x06 0x97 0xA2 0x6C 0x68 0xAF 0xDC
SETUP	0x00	0x04	0x20 0x00 0x00 0x00 0x00 0x00 0x1A 0x00
OUT	0x00	0x04	0x0D 0x04 0x17 0x97 0xA2 0x6C 0x68 0xAF 0xDC 0x04 0x30 0x30 0x30 0x30 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x00	0x04	0x0000
IN	0x01	0x12	0x0E 0x0A 0x01 0x0D 0x04 0x00 0x97 0xA2 0x6C 0x68 0xAF 0xDC
IN	0x01	0x12	0x18 0x17 0x97 0xA2 0x6C 0x68 0xAF 0xDC 0x57 0xED 0x0F 0x14 0xB5 0x0A 0xA5 0x03
IN	0x01	0x12	0x3B 0xEA 0xE2 0x7E 0x89 0x5B 0xCD 0xE2 0x00
IN	0x01	0x12	0x08 0x04 0x00 0x48 0x00 0x01
IN	0x02	0x01	0x48 0x20 0x10 0x00 0x0C 0x00 0x01 0x00 0x03 0x00 0x08 0x00 0x40 0x00 0x70 0x00 0x00 0x00 0x00 0x00
OUT	0x02	0x01	0x48 0x20 0x10 0x00 0x0C 0x00 0x01 0x00 0x04 0x01 0x08 0x00 0x40 0x00 0x00 0x00 0x01 0x02 0xFF 0xFF
IN	0x01	0x12	0x13 0x05 0x01 0x48 0x00 0x01 0x00
IN	0x02	0x01	0x48 0x20 0x12 0x00 0x0E 0x00 0x01 0x00 0x05 0x01 0x0A 0x00 0x70 0x00 0x00 0x00 0x00 0x00 0x01 0x02 0xFF 0xFF
OUT	0x02	0x01	0x48 0x20 0x05 0x00 0x01 0x00 0x40 0x00 0x70
OUT	0x02	0x01	0x48 0x20 0x0C 0x00 0x08 0x00 0x01 0x00 0x02 0x02 0x04 0x00 0x13 0x00 0x71 0x00
IN	0x02	0x01	0x48 0x20 0x10 0x00 0x0C 0x00 0x01 0x00 0x04 0x02 0x08 0x00 0x70 0x00 0x00 0x00 0x01 0x02 0xFF 0xFF
OUT	0x02	0x01	0x48 0x20 0x12 0x00 0x0E 0x00 0x01 0x00 0x05 0x02 0x0A 0x00 0x40 0x00 0x00 0x00 0x00 0x00 0x01 0x02 0xA0 0x02
IN	0x01	0x12	0x13 0x05 0x01 0x48 0x00 0x01 0x00
IN	0x01	0x12	0x13 0x05 0x01 0x48 0x00 0x01 0x00
IN	0x02	0x01	0x48 0x20 0x05 0x00 0x01 0x00 0x70 0x00 0x03
IN	0x01	0x12	0x13 0x05 0x01 0x48 0x00 0x01 0x00
IN	0x02	0x01	0x48 0x20 0x10 0x00 0x0C 0x00 0x01 0x00 0x03 0x02 0x08 0x00 0x42 0x00 0x71 0x00 0x01 0x00 0x02 0x00
IN	0x02	0x01	0x48 0x20 0x10 0x00 0x0C 0x00 0x01 0x00 0x03 0x02 0x08 0x00 0x42 0x00 0x71 0x00 0x00 0x00 0x00 0x00
OUT	0x02	0x01	0x48 0x20 0x10 0x00 0x0C 0x00 0x01 0x00 0x04 0x03 0x08 0x00 0x42 0x00 0x00 0x00 0x01 0x02 0xFF 0xFF
IN	0x01	0x12	0x13 0x05 0x01 0x48 0x00 0x01 0x00
IN	0x02	0x01	0x48 0x20 0x12 0x00 0x0E 0x00 0x01 0x00 0x05 0x03 0x0A 0x00 0x71 0x00 0x00 0x00 0x00 0x00 0x01 0x02 0xFF 0xFF
OUT	0x02	0x01	0x48 0x20 0x06 0x00 0x02 0x00 0x40 0x00 0x43 0x02
IN	0x02	0x01	0x48 0x20 0x10 0x00 0x0C 0x00 0x01 0x00 0x04 0x03 0x08 0x00 0x71 0x00 0x00 0x00 0x01 0x02 0xFF 0xFF
OUT	0x02	0x01	0x48 0x20 0x12 0x00 0x0E 0x00 0x01 0x00 0x05 0x03 0x0A 0x00 0x42 0x00 0x00 0x00 0x00 0x00 0x01 0x02 0xA0 0x02
IN	0x01	0x12	0x13 0x05 0x01 0x48 0x00 0x01 0x00
IN	0x01	0x12	0x13 0x05 0x01 0x48 0x00 0x01 0x00
IN	0x02	0x01	0x48 0x20 0x2A 0x00 0x26 0x00 0x70 0x00 0xA3 0x02 0x01 0x00 0x04 0x00 0x09 0x00 0x88 0x22 0xCE 0x22 0xE4 0x23 0xAF 0xDD 0x40 0xDD 0xFE 0xDB 0x1C 0x02 0x1C 0x02 0x1E 0x20 0xE1 0xDF 0x39 0x20 0xC8 0xDF 0x8F 0x1F 0x72 0xE0 0x04 0x00
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x81 0x7C 0x7F 0x7C 0x08 0x00 0x00 0x00 0x00 0x77 0x71 0xFE 0x5D 0x01 0x21 0x00 0xB1 0xFF 0x5E 0xFE 0xE0 0x0D 0xFF 0xE3 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
OUT	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x40 0x00 0x52 0x11 0x80 0x00 0xFF 0x00 0x00 0x00 0x00 0x00 0x00 0xFF 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
OUT	0x02	0x01	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x75 0xBC 0x00 0x11
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x81 0x7C 0x7E 0x7C 0x08 0x00 0x04 0x00 0x00 0x77 0x71 0xFE 0x5D 0x01 0x21 0x00 0xB1 0xFF 0x5E 0xFE 0xE0 0x0D 0xFF 0xE3 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x13 0x05 0x01 0x48 0x00 0x01 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x52 0x81 0x3F 0xAA
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x81 0x7D 0x80 0x7B 0x08 0x00 0x08 0x00 0x00 0xA9 0x74 0xFE 0xE2 0x00 0x29 0x00 0xD2 0xFF 0x64 0xFE 0xDC 0x0C 0x70 0xE3 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0xC9 0x39 0x2A 0x2B
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x81 0x7D 0x7F 0x7B 0x08 0x00 0x0C 0x00 0x00 0x93 0x75 0xFE 0xDD 0x00 0x29 0x00 0xD4 0xFF 0x71 0xFE 0xE5 0x0C 0x95 0xE3 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x80 0xCB 0x8D 0x89
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x82 0x7D 0x7F 0x7B 0x08 0x00 0x10 0x00 0x00 0x70 0x76 0xFE 0xDA 0x00 0x28 0x00 0xD4 0xFF 0x66 0xFE 0xD5 0x0C 0x9E 0xE3 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x31 0xBF 0xF8 0xB9
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x81 0x7C 0x7E 0x7B 0x08 0x00 0x14 0x00 0x00 0x55 0x77 0xFE 0xD7 0x00 0x29 0x00 0xD2 0xFF 0x5F 0xFE 0xC9 0x0C 0x94 0xE3 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0xCA 0x97 0xF9 0x6D
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x81 0x7D 0x80 0x7B 0x08 0x00 0x18 0x00 0x00 0x0A 0x7A 0xFE 0xD1 0x00 0x2A 0x00 0xD0 0xFF 0x62 0xFE 0xD0 0x0C 0x7B 0xE3 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x32 0x9D 0x60 0x45
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x81 0x7D 0x7F 0x7B 0x08 0x00 0x1C 0x00 0x00 0xF1 0x7A 0xFE 0xCB 0x00 0x2B 0x00 0xD2 0xFF 0x79 0xFE 0xCF 0x0C 0x85 0xE3 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x8B 0x33 0xA2 0xAC
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x81 0x7D 0x7F 0x7B 0x08 0x00 0x20 0x00 0x00 0xDA 0x7B 0xFE 0xC9 0x00 0x2B 0x00 0xD3 0xFF 0x8B 0xFE 0xD9 0x0C 0x8F 0xE3 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0xF4 0xA8 0x53 0x9A
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x81 0x7D 0x7F 0x7B 0x08 0x00 0x24 0x00 0x00 0xBF 0x7C 0xFE 0xC7 0x00 0x2B 0x00 0xD2 0xFF 0x8B 0xFE 0xDF 0x0C 0x81 0xE3 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x22 0x97 0xA1 0xE1
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x81 0x7D 0x7F 0x7B 0x08 0x00 0x28 0x00 0x00 0xA6 0x7D 0xFE 0xC3 0x00 0x2A 0x00 0xD0 0xFF 0x7C 0xFE 0xDE 0x0C 0x74 0xE3 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x17 0x5A 0x87 0x8B
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x82 0x7D 0x7F 0x7B 0x08 0x00 0x2C 0x00 0x00 0x8D 0x7E 0xFE 0xC2 0x00 0x29 0x00 0xCF 0xFF 0x73 0xFE 0xCE 0x0C 0x7F 0xE3 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x8F 0x99 0x1D 0xFD
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x81 0x7D 0x80 0x7B 0x08 0x00 0x30 0x00 0x00 0x74 0x7F 0xFE 0xC2 0x00 0x29 0x00 0xD0 0xFF 0x79 0xFE 0xD5 0x0C 0x84 0xE3 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0xC6 0xCE 0xAA 0x53
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x81 0x7D 0x7F 0x7B 0x08 0x00 0x34 0x00 0x00 0x5B 0x80 0xFE 0xBF 0x00 0x29 0x00 0xD1 0xFF 0x8F 0xFE 0xE7 0x0C 0x86 0xE3 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x4A 0x9F 0x0C 0x35
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x81 0x7D 0x7F 0x7B 0x08 0x00 0x38 0x00 0x00 0x42 0x81 0xFE 0xBC 0x00 0x2B 0x00 0xD2 0xFF 0xA1 0xFE 0xDC 0x0C 0x94 0xE3 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x91 0xBA 0x80 0xED
IN	0x02	0x01	0x48 0x20 0x05 0x00 0x01 0x00 0x70 0x00 0x00
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x82 0x7D 0x7F 0x7B 0x08 0x00 0x3C 0x00 0x00 0xDE 0x84 0xFE 0xB4 0x00 0x2B 0x00 0xD6 0xFF 0xB0 0xFE 0xC8 0x0C 0x84 0xE3 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x52 0x24 0x0A 0x92
IN	0x02	0x01	0x48 0x20 0x53 0x00 0x4F 0x00 0x71 0x00 0xA1 0x11 0xC0 0x00 0x81 0x7C 0x7F 0x7B 0x08 0x00 0x40 0x00 0x00 0xC5 0x85 0xFE 0xB1 0x00 0x26 0x00 0xDA 0xFF 0x84 0xFE 0xD3 0x0C 0xBC 0xE3 0x00 0x00 0x00 0x00 0x00 0x05 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
IN	0x02	0x01	0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x5A 0xDF 0x80 0x7F
@defragster -
This is edited stuff from the Saleae logic... That is very much edited. How it relates to my printout during debug...
SETUP - are the main USB commands... Could get more into it ... But need to see USB manual to explain more...
For most of the stuff I am debugging, it is the IN and OUT commands.

With my debug output:
If you see a line that looks like:
BT rx_data(16): 7 ff 0 97 a2 6c 68 af dc 57 69 72 65 6c 65 73
It should show up in here as an IN 0x01

Lines like:
BT rx2_data(14): b 20 a 0 6 0 71 0 a1 2 0 e9 fd 0
Show up as IN 0x2

and things like: HCI_OP_ACCEPT_CONN_REQ called (09 04 07 97 a2 6c 68 af dc 00 )
Should show up as an OUT 0x02...

Note, I should probably have reduced how many lines I show here as I think these include a bunch of output...
 
Thx. Will see about emulating that.

I am seeing odd number printing on ShowTrace with the one value I added to track _isr interference - I could just remove it now as all else seems good - but it is puzzling me so distracted by that as I was looking to do LIFO versus FIFO print order …
 
@defragster / @KurtE

See you guys have been busy since I was away the computer. :)

Tim = I am using a usb host mini shield connected to the T4 for my debugging and comparisons.

Note: I tried running the PS4 on T4 and it did bind correctly when it has the PIN... But is not going through full setup when it is not with PIN...
Kurt - that is pretty the same thing I see on the T3.6 with the PS4

I just ran a test using T4/USH2 combo (after initial pariing) with the following dump:
Code:
PS4 Bluetooth Library Started
Bluetooth Dongle Initialized
HCI Reset complete
Write class of device
Local Bluetooth Address: 5C:F3:70:7A:1C:C9
Wait For Incoming Connection Request
Gamepad is connecting
Incoming Connection Request
Remote Name: Wireless Controller
PS4 controller is connecting
Connected to Device: 00:1F:E2:9B:94:EA
Send HID Control Connection Request
L2CAP_COMMAND: 0x0B - Channel ID: 00 01
 Data:  0B 20 0C 00 08 00 01 00 02 00 04 00 11 00 70 00
L2CAP Connection Request - PSM: 00 01 SCID: 00 41 Identifier: 01
Received Key Request
Bluetooth pin is set too: 0000
Send HID Control Config Request
L2CAP_COMMAND: 0x0B - Channel ID: 00 01
 Data:  0B 20 10 00 0C 00 01 00 04 01 08 00 40 00 00 00 01 02 FF FF
Set protocol mode: 00
L2CAP_COMMAND: 0x0B - Channel ID: 00 40
 Data:  0B 20 05 00 01 00 40 00 70
Send HID Interrupt Connection Request
L2CAP_COMMAND: 0x0B - Channel ID: 00 01
 Data:  0B 20 0C 00 08 00 01 00 02 02 04 00 13 00 71 00
L2CAP_COMMAND: 0x0B - Channel ID: 00 01
 Data:  0B 20 12 00 0E 00 01 00 05 02 0A 00 40 00 00 00 00 00 01 02 A0 02
L2CAP Control: 03 
Send HID Interrupt Config Request
L2CAP_COMMAND: 0x0B - Channel ID: 00 01
 Data:  0B 20 10 00 0C 00 01 00 04 03 08 00 42 00 00 00 01 02 FF FF
HID Channels Established
[COLOR="#FF0000"]SIXAXIS COMMAND ISSUED: 0x[/COLOR]
L2CAP_COMMAND: 0x0B - Channel ID: 00 40
 Data:  0B 20 06 00 02 00 40 00 43 02
L2CAP_COMMAND: 0x0B - Channel ID: 00 01
 Data:  0B 20 12 00 0E 00 01 00 05 03 0A 00 42 00 00 00 00 00 01 02 A0 02
L2CAP Control: A3 02 05 00 EC FF 13 00 8A 22 79 22 E7 22 83 DD 58 DD 3E DD 1C 02 1C 02 C0 20 2C E1 D2 21 FE E1 46 20 D3 DF 14 00 
L2CAP Interrupt: A1 11 C0 00 83 7C 7C 80 08 00 00 00 00 04 EC 0A 01 00 F4 FF 1B 00 5B FF 9B 21 CA FF 00 00 00 00 00 04 00 00 00 00 80 00 00 00 80 00 00 00 00 80 00 00 00 80 00 00 00 00 05 03 0A 00 42 00 00 00 00 00 01 02 A0 02 00 00 00 00 00 9C 02 00 20 
11 C0 00 83 7C 7C 80 08 00 00 00 00 04 EC 0A 01 00 F4 FF 1B 00 5B FF 9B 21 CA FF 00 00 00 00 00 04 00 00 00 00 80 00 00 00 80 00 00 00 00 80 00 00 00 80 00 00 00 00 05 03 0A 00 42 00 00 00 00 00 01 02 A0 02 00 00 00 00 00 9C 02 00 20 
RUMBLE COMMAND ISSUED: 0x
L2CAP_COMMAND: 0x0B - Channel ID: 00 40
 Data:  0B 20 53 00 4F 00 40 00 52 11 80 00 FF 00 00 00 00 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[COLOR="#FF0000"]Unknown Report type: 11
L2CAP Interrupt: [/COLOR]A1 11 C0 00 83 7C 7C 80 08 00 04 00 00 04 EC 0A 01 00 F4 FF 1B 00 5B FF 9B 21 CA FF 00 00 00 00 00 04 00 00 00 00 80 00 00 00 80 00 00 00 00 80 00 00 00 80 00 00 00 00 05 03 0A 00 42 00 00 00 00 00 01 02 A0 02 00 00 00 00 00 9C 02 00 20 
11 C0 00 83 7C 7C 80 08 00 04 00 00 04 EC 0A 01 00 F4 FF 1B 00 5B FF 9B 21 CA FF 00 00 00 00 00 04 00 00 00 00 80 00 00 00 80 00 00 00 00 80 00 00 00 80 00 00 00 00 05 03 0A 00 42 00 00 00 00 00 01 02 A0 02 00 00 00 00 00 9C 02 00 20 
Unknown Report type: 11
L2CAP Interrupt: A1 11 C0 00 83 7C 7C 80 08 00 08 00 00 CA EE 0A 02 00 EF FF 17 00 34 FF 73 21 ED FF 00 00 00 00 00 04 00 00 00 00 80 00 00 00 80 00 00 00 00 80 00 00 00 80 00 00 00 00 05 03 0A 00 42 00 00 00 00 00 01 02 A0 02 00 00 00 00 00 9C 02 00 20 
11 C0 00 83 7C 7C 80 08 00 08 00 00 CA EE 0A 02 00 EF FF 17 00 34 FF 73 21 ED FF 00 00 00 00 00 04 00 00 00 00 80 00 00 00 80 00 00 00 00 80 00 00 00 80 00 00 00 00 05 03 0A 00 42 00 00 00 00 00 01 02 A0 02 00 00 00 00 00 9C 02 00 20

This might help in looking at the Salae Logic dump. I highlighted a couple things, the send a sixaxis command to send the complete 0x11 report that I get right now when rumble starts. When you see Unknown Report type: 11 that is actually the returned data ((64bytes with the second line being the same data but with the 0xA1.

EDIT:
Kurt is there someplace you dump the joystick device descriptor?
 
@KurtE and @defragster

I was grepping through uhs2 for where the following lines come from:
Code:
Wait For Incoming Connection Request
Gamepad is connecting
Incoming Connection Request
Remote Name: Wireless Controller
PS4 controller is connecting
All seem to come from BTD.cpp.

There was one thing that was interesting was that there is a complete flag that is tested, guess to see if ready:
Code:
case HCI_REMOTE_NAME_STATE:
                        if(hci_check_flag(HCI_FLAG_REMOTE_NAME_COMPLETE)) {
#ifdef DEBUG_USB_HOST
                                Notify(PSTR("\r\nRemote Name: "), 0x80);
                                for(uint8_t i = 0; i < strlen(remote_name); i++)
                                        Notifyc(remote_name[i], 0x80);
#endif
The flags are set and cleared within the code, for instance on remote name:
Code:
void BTD::hci_remote_name() {
        hci_clear_flag(HCI_FLAG_REMOTE_NAME_COMPLETE);
        hcibuf[0] = 0x19; // HCI OCF = 19
        hcibuf[1] = 0x01 << 2; // HCI OGF = 1
        hcibuf[2] = 0x0A; // parameter length = 10
        hcibuf[3] = disc_bdaddr[0]; // 6 octet bdaddr
        hcibuf[4] = disc_bdaddr[1];
        hcibuf[5] = disc_bdaddr[2];
        hcibuf[6] = disc_bdaddr[3];
        hcibuf[7] = disc_bdaddr[4];
        hcibuf[8] = disc_bdaddr[5];
        hcibuf[9] = 0x01; // Page Scan Repetition Mode
        hcibuf[10] = 0x00; // Reserved
        hcibuf[11] = 0x00; // Clock offset - low byte
        hcibuf[12] = 0x00; // Clock offset - high byte

        HCI_Command(hcibuf, 13);
}
and it gets set:
Code:
                        case EV_REMOTE_NAME_COMPLETE:
                                if(!hcibuf[2]) { // Check if reading is OK
                                        for(uint8_t i = 0; i < min(sizeof (remote_name), sizeof (hcibuf) - 9); i++) {
                                                remote_name[i] = hcibuf[9 + i];
                                                if(remote_name[i] == '\0') // End of string
                                                        break;
                                        }
                                        // TODO: Altid sæt '\0' i remote name!
                                        hci_set_flag(HCI_FLAG_REMOTE_NAME_COMPLETE);
                                }
                                break;
 
@mjs513 and @defragster - found a fer more things...

From my previous post, the start of connecting (without bind...)
Code:
Column1	Column2	Column3	Column4
IN	0x01	0x12	0x04 0x0A 0x97 0xA2 0x6C 0x68 0xAF 0xDC 0x08 0x25 0x00 0x01
SETUP	0x00	0x04	0x20 0x00 0x00 0x00 0x00 0x00 0x0D 0x00
OUT	0x00	0x04	0x19 0x04 0x0A 0x97 0xA2 0x6C 0x68 0xAF 0xDC 0x01 0x00 0x00 0x00
IN	0x00	0x04	0x0000
IN	0x01	0x12	0x0F 0x04 0x00 0x01 0x19 0x04
IN	0x01	0x12	0x07 0xFF 0x00 0x97 0xA2 0x6C 0x68 0xAF 0xDC 0x57 0x69 0x72 0x65 0x6C 0x65 0x73
IN	0x01	0x12	0x73 0x20 0x43 0x6F 0x6E 0x74 0x72 0x6F 0x6C 0x6C 0x65 0x72 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
SETUP	0x00	0x04	0x20 0x00 0x00 0x00 0x00 0x00 0x0A 0x00
OUT	0x00	0x04	0x09 0x04 0x07 0x97 0xA2 0x6C 0x68 0xAF 0xDC 0x00
IN	0x00	0x04	0x0000
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
IN	0x01	0x12	0x00
IN	0x01	0x12	0x0F 0x04 0x00 0x01 0x09 0x04
IN	0x01	0x12	0x12 0x08 0x00 0x97 0xA2 0x6C 0x68 0xAF 0xDC 0x00
IN	0x01	0x12	0x03 0x0B 0x00 0x48 0x00 0x97 0xA2 0x6C 0x68 0xAF 0xDC 0x01 0x00
But then the HS2 continues with:
Code:
OUT	0x02	0x01	0x48 0x20 0x0C 0x00 0x08 0x00 0x01 0x00 0x02 0x00 0x04 0x00 0x11 0x00 0x70 0x00
Now looking at HS2 code you see: BTD.cpp around line 856 - process the name again the part with all of the 0s...
Code:
                                if(classOfDevice[2] == 0 && classOfDevice[1] == 0x25 && classOfDevice[0] == 0x08 && strncmp((const char*)remote_name, "Wireless Controller", 19) == 0) {
#ifdef DEBUG_USB_HOST
                                        Notify(PSTR("\r\nPS4 controller is connecting"), 0x80);
#endif
                                        incomingPS4 = true;
                                }
Again this is the test for saying it is a PS4...

But then more importantly a little after this process the HCI connection complete notification (the last line shown data starts with 0x03)
Code:
               case HCI_CONNECTED_STATE:
                        if(hci_check_flag(HCI_FLAG_CONNECT_COMPLETE)) {
#ifdef DEBUG_USB_HOST
                                Notify(PSTR("\r\nConnected to Device: "), 0x80);
                                for(int8_t i = 5; i > 0; i--) {
                                        D_PrintHex<uint8_t > (disc_bdaddr[i], 0x80);
                                        Notify(PSTR(":"), 0x80);
                                }
                                D_PrintHex<uint8_t > (disc_bdaddr[0], 0x80);
#endif
                                if(incomingPS4)
                                        connectToHIDDevice = true; // We should always connect to the PS4 controller
Which gets processed in the function: BTHID::Run
Code:
                        if(pBtd->connectToHIDDevice && !pBtd->l2capConnectionClaimed && !connected && !activeConnection) {
                                pBtd->l2capConnectionClaimed = true;
                                activeConnection = true;
#ifdef DEBUG_USB_HOST
                                Notify(PSTR("\r\nSend HID Control Connection Request"), 0x80);
#endif
                                hci_handle = pBtd->hci_handle; // Store the HCI Handle for the connection
                                l2cap_event_flag = 0; // Reset flags
                                identifier = 0;
                                pBtd->l2cap_connection_request(hci_handle, identifier, control_dcid, HID_CTRL_PSM);
                                l2cap_state = L2CAP_CONTROL_CONNECT_REQUEST;
                        } else if(l2cap_check_flag(L2CAP_FLAG_CONNECTION_CONTROL_REQUEST)) {
And that is where they send of the command. Note: they appear to have several more state variables than we do... May end up needing more. But again I have been feeling my way through understanding of things... My guess is will probably need some more. Things like the code asked to do a bind, and I setup to receive data. Maybe I need to know that I have already processed this (device has already completed a bind) and maybe next request gets handled different...

Now to see if there is a semi-clean way to setup force bind request... Thinking for now I may add a state variable to the BTHID object that says need to force... Then in the name call function which currently looks for PS4, the Joystick code can set this value to true, which I will then detect...


Kurt is there someplace you dump the joystick device descriptor?
Are you talking about the USB device descriptor? Most of this information can be dumped if you turn on the top level debug support. If you are talking about the Bluetooth information from the connect. The first line in the data above is the HCI Incoming connect event (starts with a 0x04), which does not give you a lot of details...
 
I am making some progress, I did the above of having the BTHID class know that it was PS4 by having new variable set in the object, and then on the HCI_CONNECTION_COMPLETE processing, force out the connect request... The below part in RED shows where the old code output ended and start of new stuff... Need to trace some more through what is being out put and where the last stuff is.... I am guessing that this has the stuff now in place for the HID_CTRL_PSM, now I need to find where it completed and again probable force out the connection request for the Interrupt ...

Code:
BluetoothController claim this=20004840 vid:pid=a12:1
    9 4 0 0 3 e0 1 1 0 7 5 81 3 10 0 1 7 5 2 2 40 0 1 7 5 82 2 40 0 1 9 4 1 0 2 e0 1 1 0 7 5 3 1 0 0 1 7 5 83 1 0 0 1 9 4 1 1 2 e0 1 1 0 7 5
    3 1 9 0 1 7 5 83 1 9 0 1 9 4 1 2 2 e0 1 1 0 7 5 3 1 11 0 1 7 5 83 1 11 0 1 9 4 1 3 2 e0 1 1 0 7 5 3 1 19 0 1 7 5 83 1 19 0 1 9 4 1 4 2 e0
    1 1 0 7 5 3 1 21 0 1 7 5 83 1 21 0 1 9 4 1 5 2 e0 1 1 0 7 5 3 1 31 0 1 7 5 83 1 31 0 1
      rxep=1(16) txep=2(64) rx2ep=2(64)
HCI_RESET called (03 0c 00 )
    Control callback (bluetooth): 1 : 3 c 0
BT rx_data(6): e 4 1 3 c 0
    Command Completed!
HCI_WRITE_CLASS_OF_DEV called (24 0c 03 04 08 00 )
    Control callback (bluetooth): 3 : 24 c 3 4 8 0
BT rx_data(6): e 4 1 24 c 0
    Command Completed!
HCI_Read_BD_ADDR called (09 10 00 )
    Control callback (bluetooth): 4 : 9 10 0
BT rx_data(12): e a 1 9 10 0 13 71 da 7d 1a 0
    Command Completed!
   BD Addr:13:71:da:7d:1a:0
HCI_Read_Local_Version_Information called (01 10 00 )
    Control callback (bluetooth): 4 : 1 10 0
BT rx_data(14): e c 1 1 10 0 6 bb 22 6 a 0 bb 22
    Command Completed!
    Local Version: 6
HCI_WRITE_SCAN_ENABLE called(1a 0c 01 02 )
    Control callback (bluetooth): 0 : 1a c 1 2
BT rx_data(6): e 4 1 1a c 0
    Command Completed!
Write_Scan_enable Completed
BT rx_data(12): 4 a 97 a2 6c 68 af dc 8 25 0 1
    Event: Incoming Connect -  97:a2:6c:68:af:dc CL:2508 LT:1
      Peripheral device
        Gamepad
BluetoothController::find_driver  driver 20005478
JoystickController::claim_bluetooth TRUE
    *** Claimed ***
HCI_OP_REMOTE_NAME_REQ called (19 04 0a 97 a2 6c 68 af dc 01 00 00 00 )
    Control callback (bluetooth): 0 : 19 4 a 97 a2 6c 68 af dc 1 0 0 0
BT rx_data(6): f 4 0 1 19 4
    Command 419 Status 0
BT rx_data(16): 7 ff 0 97 a2 6c 68 af dc 57 69 72 65 6c 65 73
BT rx_data(16): 73 20 43 6f 6e 74 72 6f 6c 6c 65 72 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(16): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(1): 0
    Event: handle_hci_remote_name_complete(0)
    Remote Name: Wireless Controller
  JoystickController::remoteNameComplete Wireless Controller - set to PS4
HCI_OP_ACCEPT_CONN_REQ called (09 04 07 97 a2 6c 68 af dc 00 )
    Control callback (bluetooth): 0 : 9 4 7 97 a2 6c 68 af dc 0
BT rx_data(6): f 4 0 1 9 4
    Command 409 Status 0
BT rx_data(10): 12 8 0 97 a2 6c 68 af dc 0
[COLOR="#FF0000"]BT rx_data(13): 3 b 0 48 0 97 a2 6c 68 af dc 1 0
    Connection Complete - ST:0 LH:48
   Needs connect to device(PS4?)
`ConnectionRequest called(48 20 0c 00 08 00 01 00 02 00 04 00 11 00 70 00 )
tx_data callback (bluetooth): 0 : 48 20 c 0 8 0 1 0 2 0 4 0 11 0 70 0
BT rx_data(9): 20 7 97 a2 6c 68 af dc 1
BT rx_data(5): 1b 3 48 0 5[/COLOR]

=====================
BT rx2_data(20): 48 20 10 0 c 0 1 0 3 0 8 0 40 0 70 0 1 0 2 0
    L2CAP Connection Response: ID: 0, Dest:40, Source:70, Result:1, Status: 2
      Control Response
L2CAP_ConfigRequest called(48 20 10 00 0c 00 01 00 04 00 08 00 40 00 00 00 01 02 ff ff )
BT rx_data(7): 13 5 1 48 0 1 0
tx_data callback (bluetooth): 0 : 48 20 10 0 c 0 1 0 4 0 8 0 40 0 0 0 1 2 ff ff
BT rx_data(8): 17 6 97 a2 6c 68 af dc
    Event: Link Key Request 97:a2:6c:68:af:dc
HCI_LINK_KEY_NEG_REPLY called (0c 04 06 97 a2 6c 68 af dc )

=====================
BT rx2_data(22): 48 20 12 0 e 0 1 0 5 0 a 0 70 0 0 0 0 0 1 2 ff ff
    L2CAP config Response: ID: 0, Source:70, Flags:0, Result:0, Config: 201
Set HID Protocol 0 (48 20 05 00 01 00 40 00 70 )
BT rx_data(7): 13 5 1 48 0 1 0
tx_data callback (bluetooth): 0 : 48 20 5 0 1 0 40 0 70
    Control callback (bluetooth): 0 : 48 20 5 0 1 0 40 0 70

=====================
BT rx2_data(20): 48 20 10 0 c 0 1 0 4 1 8 0 70 0 0 0 1 2 ff ff
    L2CAP config Request: ID: 1, Dest:70, Flags:0,  Options: 1 2 ff ff
      Control Configuration request
L2CAP_ConfigResponse called(48 20 12 00 0e 00 01 00 05 01 0a 00 40 00 00 00 00 00 01 02 a0 02 )
BT rx_data(12): e a 1 c 4 0 97 a2 6c 68 af dc
    Command Completed!
tx_data callback (bluetooth): 0 : 48 20 12 0 e 0 1 0 5 1 a 0 40 0 0 0 0 0 1 2 a0 2
BT rx_data(7): 13 5 1 48 0 1 0

=====================
BT rx2_data(16): 48 20 c 0 8 0 1 0 2 2 4 0 1 0 41 0
    L2CAP Connection Request: ID: 2, PSM: 1, SCID: 41
BT rx_data(8): 16 6 97 a2 6c 68 af dc
    Event: Pin Code Request 97:a2:6c:68:af:dc
HCI_PIN_CODE_REPLY called (0d 04 17 97 a2 6c 68 af dc 04 30 30 30 30 00 00 00 00 00 00 00 00 00 00 00 00 )

=====================
BT rx2_data(9): 48 20 5 0 1 0 70 0 3
    L2CAP Connection Response: ID: 2, Dest:1, Source:41, Result:201, Status: ffff
    Control callback (bluetooth): 130 : d 4 17 97 a2 6c 68 af dc 4 30 30 30 30 0 0 0 0 0 0 0 0 0 0 0 0
BT rx_data(7): 13 5 1 48 0 1 0
BT rx_data(12): e a 1 d 4 0 97 a2 6c 68 af dc
    Command Completed!
BT rx_data(16): 18 17 97 a2 6c 68 af dc b1 1f ed 4d dc 4e 5e 45
BT rx_data(9): d3 24 1 92 a4 a4 c2 c7 0
    Event: Link Key Notificaton 97:a2:6c:68:af:dc Type:0
    key:b1 1f ed 4d dc 4e 5e 45 d3 24 01 92 a4 a4 c2 c7
BT rx_data(6): 8 4 0 48 0 1

=====================
BT rx2_data(20): 48 20 10 0 c 0 1 0 3 0 8 0 40 0 70 0 0 0 0 0
    L2CAP Connection Response: ID: 0, Dest:40, Source:70, Result:0, Status: 0
      Control Response
L2CAP_ConfigRequest called(48 20 10 00 0c 00 01 00 04 02 08 00 40 00 00 00 01 02 ff ff )
tx_data callback (bluetooth): 0 : 48 20 10 0 c 0 1 0 4 2 8 0 40 0 0 0 1 2 ff ff

=====================
BT rx2_data(22): 48 20 12 0 e 0 1 0 5 2 a 0 70 0 0 0 0 0 1 2 ff ff
    L2CAP config Response: ID: 2, Source:70, Flags:0, Result:0, Config: 201
Set HID Protocol 0 (48 20 05 00 01 00 40 00 70 )
BT rx_data(7): 13 5 1 48 0 1 0
tx_data callback (bluetooth): 0 : 48 20 5 0 1 0 40 0 70
BT rx_data(7): 13 5 1 48 0 1 0

=====================
BT rx2_data(9): 48 20 5 0 1 0 70 0 3
    L2CAP Connection Response: ID: 2, Dest:70, Source:0, Result:0, Status: 201
 
@mjs513 and @defragster - I think I have the mouse connecting without bind and without printing going on...

I did as I mentioned above where I then needed to setup to then ask for INT connection... Then it was working... Then I turned off debug printing.... And it was NOT working...

Wondered if maybe a couple of the messages (request connect) needed a 1ms delay before sending, so added it before the two messages and then it appears like it is happier...

Pushed up changes to bluetooth.cpp usbhost_t36.h and joystick.cpp

You might give them a try to see if it helps with your version.

Sort of interesting, when the user does the bind version, I don't think the HS2 ever asks for the remote name... So if I want it... I will have to figure out where to ask for it. Maybe toward the end of the bind...
 
Last edited:
@mjs513 and @defragster - I think I have the mouse connecting without bind and without printing going on...

I did as I mentioned above where I then needed to setup to then ask for INT connection... Then it was working... Then I turned off debug printing.... And it was NOT working...

Wondered if maybe a couple of the messages (request connect) needed a 1ms delay before sending, so added it before the two messages and then it appears like it is happier...

Pushed up changes to bluetooth.cpp usbhost_t36.h and joystick.cpp

You might give them a try to see if it helps with your version.

Sort of interesting, when the user does the bind version, I don't think the HS2 ever asks for the remote name... So if I want it... I will have to figure out where to ask for it. Maybe toward the end of the bind...

@kurtE/@defragster
Will give it a try - just got home.

Was curious about your last comment about HS2 in bind mode. You are right - it never issues a remote name command:
Code:
PS4 Bluetooth Library Started
Bluetooth Dongle Initialized
HCI Reset complete
Write class of device
Local Bluetooth Address: 5C:F3:70:7A:1C:C9
Please enable discovery of your device
Gamepad found
HID device found
Now just create the instance like so:
BTHID bthid(&Btd);
And then press any button on the device
Connecting to HID device
Connected to HID device
Received Key Request
Bluetooth pin is set too: 0000
Pairing successful with HID device
Send HID Control Connection Request
L2CAP_COMMAND: 0x0B - Channel ID: 00 01
 Data:  0B 20 0C 00 08 00 01 00 02 00 04 00 11 00 70 00
Send HID Control Config Request
L2CAP_COMMAND: 0x0B - Channel ID: 00 01
 Data:  0B 20 10 00 0C 00 01 00 04 01 08 00 40 00 00 00 01 02 FF FF
Set protocol mode: 00
L2CAP_COMMAND: 0x0B - Channel ID: 00 40
 Data:  0B 20 05 00 01 00 40 00 70
Send HID Interrupt Connection Request
L2CAP_COMMAND: 0x0B - Channel ID: 00 01
 Data:  0B 20 0C 00 08 00 01 00 02 02 04 00 13 00 71 00
L2CAP_COMMAND: 0x0B - Channel ID: 00 01
 Data:  0B 20 12 00 0E 00 01 00 05 01 0A 00 40 00 00 00 00 00 01 02 A0 02
L2CAP Control: 03 
Send HID Interrupt Config Request
L2CAP_COMMAND: 0x0B - Channel ID: 00 01
 Data:  0B 20 10 00 0C 00 01 00 04 03 08 00 41 00 00 00 01 02 FF FF
HID Channels Established
SIXAXIS COMMAND ISSUED: 0x
L2CAP_COMMAND: 0x0B - Channel ID: 00 40
 Data:  0B 20 06 00 02 00 40 00 43 02
Wait For Incoming Connection Request
L2CAP_COMMAND: 0x0B - Channel ID: 00 01
 Data:  0B 20 12 00 0E 00 01 00 05 02 0A 00 41 00 00 00 00 00 01 02 A0 02
L2CAP Control: A3 02 05 00 EC FF 13 00 8A 22 79 22 E7 22 83 DD 58 DD 3E DD 1C 02 1C 02 C0 20 2C E1 D2 21 FE E1 46 20 D3 DF 14 00 
L2CAP Interrupt: A1 11 C0 00 80 7D 7D 7F 08 00 00 00 00 35 96 0A 1F 00 1E 00 16 00 BB 00 8F 05 AC E1 00 00 00 00 00 04 00 00 00 00 80 00 00 00 80 00 00 00 00 80 00 00 00 80 00 00 00 00 05 02 0A 00 41 00 00 00 00 00 01 02 A0 02 00 00 00 00 00 9C 02 00 20 
11 C0 00 80 7D 7D 7F 08 00 00 00 00 35 96 0A 1F 00 1E 00 16 00 BB 00 8F 05 AC E1 00 00 00 00 00 04 00 00 00 00 80 00 00 00 80 00 00 00 00 80 00 00 00 80 00 00 00 00 05 02 0A 00 41 00 00 00 00 00 01 02 A0 02 00 00 00 00 00 9C 02 00 20 
RUMBLE COMMAND ISSUED: 0x
L2CAP_COMMAND: 0x0B - Channel ID: 00 40
 Data:  0B 20 53 00 4F 00 40 00 52 11 80 00 FF 00 00 00 00 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Unknown Report type: 11
L2CAP Interrupt: A1 11 C0 00 80 7D 7D 7F 08 00 04 00 00 35 96 0A 1F 00 1E 00 16 00 BB 00 8F 05 AC E1 00 00 00 00 00 04 00 00 00 00 80 00 00 00 80 00 00 00 00 80 00 00 00 80 00 00 00 00 05 02 0A 00 41 00 00 00 00 00 01 02 A0 02 00 00 00 00 00 9C 02 00 20 
11 C0 00 80 7D 7D 7F 08 00 04 00 00 35 96 0A 1F 00 1E 00 16 00 BB 00 8F 05 AC E1 00 00 00 00 00 04 00 00 00 00 80 00 00 00 80 00 00 00 00 80 00 00 00 80 00 00 00 00 05 02 0A 00 41 00 00 00 00 00 01 02 A0 02 00 00 00 00 00 9C 02 00 20 
Unknown Report type: 11
 
@KurtE / @defragster

Copied your Bluetooth.cpp, joystick.cpp and usbhost_t36.h files over to the library. The good news is that if you don't use pair (w/key) no issue with connecting with or without debug commented. Did have to reconnect a couple of times to get it to work but it worked. Also, I added in my changes to get Rumble and LEDs working (still want to play with that) and it worked. I am attaching the just the joystick.cpp so you all can give it a try.

Think whats left it to send the sixaxis command and it looks like a rumble command> from the hs2 print out. Just don't know where to put that yet
 

Attachments

  • joystick.zip
    7.7 KB · Views: 62
@mjs513 - Yep looks like I get some rumble... Think we should change the values for L2 versus R2 as pressing the left makes the right side rumble ;)

Will play some with adding the ability for the different BTHID objects to maybe ask for or send additional info...
 
@mjs513 - Yep looks like I get some rumble... Think we should change the values for L2 versus R2 as pressing the left makes the right side rumble ;)

Will play some with adding the ability for the different BTHID objects to maybe ask for or send additional info...

LEDS should be working as well.
 
Not sure if there is anything currently setting the LED color?

May take awhile as may have another diversion and take dogs to a park or the like as it is sunny :D
 
@mjs513 - Yep looks like I get some rumble... Think we should change the values for L2 versus R2 as pressing the left makes the right side rumble ;)

Think its right the way its set up. The left trigger sets off the weak rumble while the right trigger sets off the strong trigger.

Will play some with adding the ability for the different BTHID objects to maybe ask for or send additional info...
Its funny, some times the data comes out with 64 bytes right from the start - at other times you have to trigger the rumble.
 
@mjs513 - Thanks just got back after taking dogs to park, then going to town to pick up mail, groceries... To answer the question (Me - more tired :lol: )

Now maybe a bit of time to play :D
 
@KurtE
Just hooked up my Tecknet BT mouse and it worked like a charm. Think you broke the code on the mouse.

EDIT: Think its almost time to take it for a spin on the T4. Positive it will work.

BTW: The XBOX controller and PS3 does work as wired units. As you mentioned don't think PS3 will work BT until we get Sixaxis command code embedded in the library for both PS4 and PS3.

XBOX is not recognized as BT. About the only thing I could find on XBOX was this: https://github.com/quantus/xbox-one-controller-protocol

EDIT2: Just found this regarding the xbox controller:
Xbox 360 controllers do not support Bluetooth, they use a proprietary RF interface which requires a special USB dongle. There are specific, newer Xbox ONE wireless controllers that do support Bluetooth to PC, but you need to make sure to get the one with Bluetooth support as all Xbox One controllers do not support it.
 
This is $46 on Amazon :: Xbox Wireless Controller - Black ...Includes Bluetooth technology - this one Mint and white also Bt - Sport White Special Edition is $53

{ Kurt is seems I saw it 'somewhere' else for $30 [mint one $35] }

I made some progress - turns out my queue manipulation through the trace array data was stomping on memory - DUH the funny number vars come right after the array that didn't typically fill before - thus the funny numbers and display issues. Got the LIFO print mostly right - and free of memory trash it seems except one odd case I need to get back to.

<edit>: BTW - was testing the LIFO prints from T$ to work well since that was what the Compile.cmd Sublime was running for a bit - until the faults got ugly - though I think was forced to button push for faults now on T_3.6 too - which should not be - at least it wasn't on USB before. So once it works on one USBHost it will work on both.
 
Last edited:
This is $46 on Amazon :: Xbox Wireless Controller - Black ...Includes Bluetooth technology - this one Mint and white also Bt - Sport White Special Edition is $53

{ Kurt is seems I saw it 'somewhere' else for $30 [mint one $35] }

…..
Tim - you are right the controller I have is this one from amazon: https://www.amazon.com/gp/product/B01GW3H3U8/ref=ppx_yo_dt_b_asin_title_o04_s00?ie=UTF8&th=1 and it is BT compatible. Just got frustrated with it.

Here is where I am so far with it:
1. Got it to pair with BT on my Win10 PC
2. Got it to pair with one dongle on the Win 10 pc
3. Tested it on the T3.6 with the same dongle and would not pair - the only thing I saw was where the dongle was identified then nothing
 
Will wait on another Joystick until the bit dust settles. Xbox not much less $ than a PS4 if it ends up working/better.

The list management for the LIFO display seems to be functional - I have one char string array[15][4] I was throwing in for a tag to track pair first and second … those string are corrupted like the 'func' name strings were before - except I'd expect the 'func' name the compiler made to be RO on Flash. Similar look on T_3.6 and T$ so it isn't a 'new' thing but a coding issue.

Started to clone that LIFO writer and make a DevTrace version to record the alternate data streams … but not very far on that.

It is printing lots of data inefficiently with putchar using the PJRC debug printf scheme - the T_$ seems much slower than the T_3.6 when scrolling on TyComm - will Time and test that to confirm what I think I saw. I should rewrite the putchar to buffer in szBlocks perhaps when not in Faulted mode.
T$___>> ShowTime =29054ms { > UART T_3.1 @1843200 baud}
T_3.6>> ShowTime =1479ms { T_3.6 at 180 MHz > UART T_3.6 @1843200 baud}
Yeah - I though it seemed 'noticeably' slower. I'll post a test {UART Rx Teensy can't matter with no data loss given the same uncontrolled data rate 1843200 baud} then on proper thread when the debug_tt gets uploaded.

Just a heads up more cycles per second and … Note the T$ Trace takes ~35 cycles and the T_3.6 Trace takes ~74 cycles for the same data writes to the array looking at the big number that is CycleCounter.
#_32: (ii=31): ii 26 ii2 428841612 func foo in foo [ii:31]L#:109 }{36
#_33: (ii=32): ii 27 ii2 428841647 func foo in foo [ii:32]L#:109 }{36
>>>versus
#_32: (ii=31): ii 26 ii2 4028151895 func foo in foo [ii:31]L#:109 }{36
#_33: (ii=32): ii 27 ii2 4028151969 func foo in foo [ii:32]L#:109 }{36
So even if the same code is running some parts may get a 2X boost beyond F_CPU 3.3X - if timing matters.
 
Back
Top