Hi,
thanks for the suggestion. I sniffed the packets from my device, and the input reports look like this:
bytes (sent by my btstack program): a1 03 00 00 00 00 00
bytes (sniffed): 02 47 20 0b 00 07 00 41 00 a1 03 00 00 00 00 00
info: Rcvd DATA - Input - unknown type
Bluetooth HCI H4
[Direction: Rcvd (0x01)]
HCI Packet Type: ACL Data (0x02)
Bluetooth HCI ACL Packet
.... 0000 0100 0111 = Connection Handle: 0x047
..10 .... .... .... = PB Flag: First Automatically Flushable Packet (2)
00.. .... .... .... = BC Flag: Point-To-Point (0)
Data Total Length: 11
Data
[Connect in frame: 7]
[Source BD_ADDR: RaspberryPiF_XX:XX:XX (XX:XX:XX:XX:XX:XX)]
[Source Device Name: ]
[Source Role: Slave (2)]
[Destination BD_ADDR: Xerox_00:00:00 (00:00:00:00:00:00)]
[Destination Device Name: ]
[Destination Role: Master (1)]
[Last Role Change in Frame: 6]
[Current Mode: Active Mode (0)]
[Last Mode Change in Frame: 7]
Bluetooth L2CAP Protocol
Length: 7
CID: Dynamically Allocated Channel (0x0041)
[Connect in frame: 63]
[PSM: HID-Interrupt (0x0013)]
Bluetooth HID Profile
1010 .... = Transaction Type: DATA (0xa)
.... 00.. = Parameter reserved: 0x0
.... ..01 = Report Type: Input (0x1)
Protocol Code: Unknown (0x03)
The GUI in wireshark does not give any more details after this last byte 0x03.
Wireshark seem to think that the last byte 0x03 is the protocol code, but it really is the report ID which I sent, and the last 5 bytes all set to 0, are the report data: joystick axes and buttons.
I am not sure if they are supposed to look like this, but when I sniff USB packets (non-bluetooth) from other devices, they look significatly different, and I can recognize the fields described in the HID documentation (bmRequestType, bRequest,wValue,...)
Another difference is that this packet info is "Rcvd DATA - Input - unknown type", while packets from a USB device are labelled "URB_CONTROL in" or "URB_INTERRUPT in".
Regardless, this does work, it is treated as the joystick input.
Then I made a C# app using
HIDAPI.NET. This also reads the input reports just fine, but then sends an output report using the Device.Write() function.
I sent 0x03 0x01, which should be the report ID (same as input report) and just one test byte as expected by the descriptor.
This is how it is logged in wireshark:
bytes (sent by my C# program): 03 01
bytes (sniffed): 02 47 00 07 00 03 00 42 00 a2 03 01
info: Sent DATA - Output - unknown type
Bluetooth HCI H4
[Direction: Sent (0x00)]
HCI Packet Type: ACL Data (0x02)
Bluetooth HCI ACL Packet
.... 0000 0100 0111 = Connection Handle: 0x047
..00 .... .... .... = PB Flag: First Non-automatically Flushable Packet (0)
00.. .... .... .... = BC Flag: Point-To-Point (0)
Data Total Length: 7
Data
[Connect in frame: 7]
[Source BD_ADDR: Xerox_00:00:00 (00:00:00:00:00:00)]
[Source Device Name: ]
[Source Role: Master (1)]
[Destination BD_ADDR: RaspberryPiF_XX:XX:XX (XX:XX:XX:XX:XX:XX)]
[Destination Device Name: ]
[Destination Role: Slave (2)]
[Last Role Change in Frame: 6]
[Current Mode: Active Mode (0)]
[Last Mode Change in Frame: 7]
Bluetooth L2CAP Protocol
Length: 3
CID: Dynamically Allocated Channel (0x0042)
[Connect in frame: 63]
[PSM: HID-Interrupt (0x0013)]
Bluetooth HID Profile
1010 .... = Transaction Type: DATA (0xa)
.... 00.. = Parameter reserved: 0x0
.... ..10 = Report Type: Output (0x2)
Protocol Code: Unknown (0x03)
On the device nothing happens, the set_report callback is never called.