Now that the ArduinoBLE librrary has been updated for the R4 WIFI, I thought it would be fun to try again to use the library to communicate with one or more devices, including the Xbox One controller.
This is more or less a continuation of the thread I opened up earlier, which has since been closed.
To start this up, I rebased my Fork/Branch of the ArduinoBLE, that I added Teensy (USBHost_t36) support to the current main fork/branch, which included the update to support UNO R4.
KurtE/ArduinoBLE at uno_r4_wifi_teensy (github.com)
My fork also includes, some changes, that I did earlier to address the issue I found with the discover attributes:
As well as my updates to the PeripheralExplorer example, which I built in some tables that map most/all of the standard UUIDs to names. I extracted this information in these tables from the Bluetooth documentation. The code also allows me to run the scan again by typing something in at the end. And if you type in more than just the CR or LF, it will use that string for the next search.
Example output:
Connected
Discovering attributes ...
Attributes discovered
Device name: Arduino
Appearance: 0x0
Service 1800 //Generic Access service
Characteristic 2a00, properties 0x2, value 0x41726475696E6F //Device Name
Descriptor 2803, value 0x020300002A //Characteristic
Descriptor 2a00, value 0x41726475696E6F //Device Name
Characteristic 2a01, properties 0x2, value 0x0000 //Appearance
Descriptor 2803, value 0x020500012A //Characteristic
Descriptor 2a01, value 0x0000 //Appearance
Service 1801 //Generic Attribute service
Characteristic 2a05, properties 0x20 //Service Changed
Descriptor 2803, value 0x200800052A //Characteristic
Descriptor 2a05, value 0x //Service Changed
Descriptor 2902, value 0x0000 //Client Characteristic Configuration
Service 19b10000-e8f2-537e-4f6c-d104768a1214
Characteristic 19b10001-e8f2-537e-4f6c-d104768a1214, properties 0xA, value 0x00
Descriptor 2803, value 0x0A0C0014128A7604D16C4F7E53F2E80100B119 //Characteristic
Descriptor 19b10001-e8f2-537e-4f6c-d104768a1214, value 0x00
Disconnecting ...
Disconnected
** Press any key to scan again: <optional device name> **Found 38:29:7d:08:54:72 ''
...
Found c8:3f:26:b3:ac:16 'Xbox Wireless Controller' 1812
Connecting ...
Connected
Discovering attributes ...
Attributes discovered
Device name: Xbox Wireless Controll
Appearance: 0x0
Service 1800 //Generic Access service
Characteristic 2a00, properties 0x2, value 0x58626F7820576972656C65737320436F6E74726F6C6C //Device Name
Descriptor 2803, value 0x020300002A //Characteristic
Descriptor 00002a00-0000-0000-0000-000000000000, value 0x58626F7820576972656C65737320436F6E74726F6C6C
Characteristic 2a01, properties 0x2, value 0xC403 //Appearance
Descriptor 2803, value 0x020500012A //Characteristic
Descriptor 00002a01-0000-0000-0000-000000000000, value 0xC403
Characteristic 2a04, properties 0x2, value 0x0600060000002C01 //Peripheral Preferred Connection Parameters
Descriptor 2803, value 0x020700042A //Characteristic
Descriptor 00002a04-0000-0000-0000-000000000000, value 0x0600060000002C01
Service 1801 //Generic Attribute service
Service 180a //Device Information service
Characteristic 2a29, properties 0x2, value 0x4D6963726F736F6674 //Manufacturer Name String
Descriptor 2803, value 0x020B00292A //Characteristic
Descriptor 00002a29-0000-0000-0000-000000000000, value 0x4D6963726F736F6674
Characteristic 2a50, properties 0x2, value 0x025E04200B1505 //PnP ID
Descriptor 2803, value 0x020D00502A //Characteristic
Descriptor 00002a50-0000-0000-0000-000000000000, value 0x025E04200B1505
Characteristic 2a26, properties 0x2, value 0x352E31352E333136382E30 //Firmware Revision String
Descriptor 2803, value 0x020F00262A //Characteristic
Descriptor 00002a26-0000-0000-0000-000000000000, value 0x352E31352E333136382E30
Characteristic 2a25, properties 0x2, value 0x3033363030303332393035363234 //Serial Number String
Descriptor 2803, value 0x021100252A //Characteristic
Descriptor 00002a25-0000-0000-0000-000000000000, value 0x3033363030303332393035363234
Service 180f //Battery service
Characteristic 2a19, properties 0x12, value 0x32 //Battery Level
Descriptor 2803, value 0x121400192A //Characteristic
Descriptor 00002a19-0000-0000-0000-000000000000, value 0x32
Descriptor 2902, value 0x0000 //Client Characteristic Configuration
Service 1812 //Human Interface Device service
Characteristic 2a4a, properties 0x2 //HID Information
Descriptor 2803, value 0x0218004A2A //Characteristic
Descriptor 00002a4a-0000-0000-0000-000000000000, value 0x
Characteristic 2a4c, properties 0x4 //HID Control Point
Descriptor 2803, value 0x041A004C2A //Characteristic
Descriptor 00002a4c-0000-0000-0000-000000000000, value 0x
Characteristic 2a4b, properties 0x2 //Report Map
Descriptor 2803, value 0x021C004B2A //Characteristic
Descriptor 00002a4b-0000-0000-0000-000000000000, value 0x
Characteristic 2a4d, properties 0x12 //Report
Descriptor 2803, value 0x121E004D2A //Characteristic
Descriptor 00002a4d-0000-0000-0000-000000000000, value 0x
Descriptor 2902, value 0x0000 //Client Characteristic Configuration
Descriptor 2908, value 0x0101 //Report Reference
Characteristic 2a4d, properties 0xE //Report
Descriptor 2803, value 0x0E22004D2A //Characteristic
Descriptor 00002a4d-0000-0000-0000-000000000000, value 0x
Descriptor 2908, value 0x0302 //Report Reference
Service 00000001-5f60-4c4f-9c83-a7953298d40d
Characteristic 00000002-5f60-4c4f-9c83-a7953298d40d, properties 0x2
Descriptor 2803, value 0x0226000DD4983295A7839C4F4C605F02000000 //Characteristic
Descriptor 00000002-5f60-4c4f-9c83-a7953298d40d, value 0x
Characteristic 00000003-5f60-4c4f-9c83-a7953298d40d, properties 0x2
Descriptor 2803, value 0x0228000DD4983295A7839C4F4C605F03000000 //Characteristic
Descriptor 00000003-5f60-4c4f-9c83-a7953298d40d, value 0x
Characteristic 00000004-5f60-4c4f-9c83-a7953298d40d, properties 0x8
Descriptor 2803, value 0x082A000DD4983295A7839C4F4C605F04000000 //Characteristic
Descriptor 00000004-5f60-4c4f-9c83-a7953298d40d, value 0x
Disconnecting ...
Disconnected
In the above run, I had a Nano 33 IOT programmed with the LED example.
I programmed the UNO R4 Wifi with the Peripheral explorer, which found the LED device and printed out the information about it, I then typed in: Xbox Wireless Controller
Which started the new scan, and then hit the button on the XBox one controller to enter pairing mode.
Things to try next:
Still need to figure out how to logically pair the XBox controller to the UNO. So don't have to enter pairing mode.
See about doing PR(s) maybe for example code. Also maybe for peripheral Discover Attribute failure.
Also see why some devices still fail to show attribute information, like the Surface Arc Mouse. It may turn out that it only will when you are logically paired with the mouse.
Now back to playing