Editing DS4-BT
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
{{wikify}} | |||
See also {{talk}} page | |||
'''Source:''' http://eleccelerator.com/wiki/index.php?title=DualShock_4 (full paste 17:50 UTC, 18 January 2014 ) | '''Source:''' http://eleccelerator.com/wiki/index.php?title=DualShock_4 (full paste 17:50 UTC, 18 January 2014 ) | ||
Line 12: | Line 16: | ||
}} | }} | ||
[[File:Bluetooth.png|15px]] | [[File:Bluetooth.png|15px]] Bluetooth is a [[Wireless|wireless]] technology for creating personal area networks operating in the 2.4 GHz unlicensed band, with a default range of 10 meters. | ||
An overview of Bluetooth: | |||
*http://engineeringagenda.com/agenda/2013/09/bluetooth/ An introduction to Bluetooth <!-- the formatting on that article is so 1990 --> | |||
*http://www.eetimes.com/document.asp?doc_id=1200909 An introduction to debugging Bluetooth in embedded systems | |||
Capable of streaming 32Khz sound to the controllers speakers for up to 2 players, but that reduces to 16Khz when 3 or more players are hooked up. | Capable of streaming 32Khz sound to the controllers speakers for up to 2 players, but that reduces to 16Khz when 3 or more players are hooked up. | ||
Line 45: | Line 54: | ||
In comparison, USB has 250x (4ms) | In comparison, USB has 250x (4ms) | ||
=== Overlapping channels BT/ | === Overlapping channels BT/WiFi === | ||
* [ | *[http://www.psdevwiki.com/ps4/File:BT-Wifi-channels.png archaic BT/Wifi channels] | ||
=== Bluetooth | {| class="wikitable" | ||
|- | |||
! Center Frequency<br />(2.4xx Ghz) !! BT 2.0<br />Channel !! BT 4.0<br />Channel !! colspan="5" | WiFi channel<br />(center freq. in GHz) | |||
|- | |||
| 00 || rowspan="2" | Guard || rowspan="2" | Guard | |||
|- | |||
| 01 || rowspan="23" style="background-color: #afafaf;" | 1<br />(2.412) | |||
|- | |||
| 02 || 0 || rowspan="2" style="background-color: #6666ff;" | 0 | |||
|- | |||
| 03 || 1 | |||
|- | |||
| 04 || 2 || rowspan="2" style="background-color: #6666ff;" | 1 | |||
|- | |||
| 05 || 3 | |||
|- | |||
| 06 || 4 || rowspan="2" style="background-color: #6666ff;" | 2 || rowspan="23" style="background-color: #afafaf;" | 2<br />(2.417) | |||
|- | |||
| 07 || 5 | |||
|- | |||
| 08 || 6 || rowspan="2" style="background-color: #6666ff;" | 3 | |||
|- | |||
| 09 || 7 | |||
|- | |||
| 10 || 8 || rowspan="2" style="background-color: #6666ff;" | 4 | |||
|- | |||
| 11 || 9 || rowspan="23" style="background-color: #afafaf;" | 3<br />(2.422) | |||
|- | |||
| 12 || 10 || rowspan="2" style="background-color: #6666ff;" | 5 | |||
|- | |||
| 13 || 11 | |||
|- | |||
| 14 || 12 || rowspan="2" style="background-color: #6666ff;" | 6 | |||
|- | |||
| 15 || 13 | |||
|- | |||
| 16 || 14 || rowspan="2" style="background-color: #6666ff;" | 7 || rowspan="23" style="background-color: #afafaf;" | 4<br />(2.427) | |||
|- | |||
| 17 || 15 | |||
|- | |||
| 18 || 16 || rowspan="2" style="background-color: #6666ff;" | 8 | |||
|- | |||
| 19 || 17 | |||
|- | |||
| 20 || 18 || rowspan="2" style="background-color: #6666ff;" | 9 | |||
|- | |||
| 21 || 19 || rowspan="23" style="background-color: #afafaf;" | 5<br />(2.432) | |||
|- | |||
| 22 || 20 || rowspan="2" style="background-color: #6666ff;" | 10 | |||
|- | |||
| 23 || 21 | |||
|- | |||
| 24 || 22 || rowspan="2" style="background-color: #6666ff;" | 11 | |||
|- | |||
| 25 || 23 | |||
|- | |||
| 26 || 24 || rowspan="2" style="background-color: #6666ff;" | 12 || rowspan="23" style="background-color: #afafaf;" | 6<br />(2.437) | |||
|- | |||
| 27 || 25 | |||
|- | |||
| 28 || 26 || rowspan="2" style="background-color: #6666ff;" | 13 | |||
|- | |||
| 29 || 27 | |||
|- | |||
| 30 || 28 || rowspan="2" style="background-color: #6666ff;" | 14 | |||
|- | |||
| 31 || 29 || rowspan="23" style="background-color: #afafaf;" | 7<br />(2.442) | |||
|- | |||
| 32 || 30 || rowspan="2" style="background-color: #6666ff;" | 15 | |||
|- | |||
| 33 || 31 | |||
|- | |||
| 34 || 32 || rowspan="2" style="background-color: #6666ff;" | 16 | |||
|- | |||
| 35 || 33 | |||
|- | |||
| 36 || 34 || rowspan="2" style="background-color: #6666ff;" | 17 || rowspan="23" style="background-color: #afafaf;" | 8<br />(2.447) | |||
|- | |||
| 37 || 35 | |||
|- | |||
| 38 || 36 || rowspan="2" style="background-color: #6666ff;" | 18 | |||
|- | |||
| 39 || 37 | |||
|- | |||
| 40 || 38 || rowspan="2" style="background-color: #6666ff;" | 19 | |||
|- | |||
| 41 || 39 || rowspan="23" style="background-color: #afafaf;" | 9<br />(2.452) | |||
|- | |||
| 42 || 40 || rowspan="2" style="background-color: #6666ff;" | 20 | |||
|- | |||
| 43 || 41 | |||
|- | |||
| 44 || 42 || rowspan="2" style="background-color: #6666ff;" | 21 | |||
|- | |||
| 45 || 43 | |||
|- | |||
| 46 || 44 || rowspan="2" style="background-color: #6666ff;" | 22 || rowspan="23" style="background-color: #afafaf;" | 10<br />(2.457) | |||
|- | |||
| 47 || 45 | |||
|- | |||
| 48 || 46 || rowspan="2" style="background-color: #6666ff;" | 23 | |||
|- | |||
| 49 || 47 | |||
|- | |||
| 50 || 48 || rowspan="2" style="background-color: #6666ff;" | 24 | |||
|- | |||
| 51 || 49 || rowspan="23" style="background-color: #afafaf;" | 11<br />(2.462) | |||
|- | |||
| 52 || 50 || rowspan="2" style="background-color: #6666ff;" | 25 | |||
|- | |||
| 53 || 51 | |||
|- | |||
| 54 || 52 || rowspan="2" style="background-color: #6666ff;" | 26 | |||
|- | |||
| 55 || 53 | |||
|- | |||
| 56 || 54 || rowspan="2" style="background-color: #6666ff;" | 27 || rowspan="23" style="background-color: #afafaf;" | 12<br />(2.467) | |||
|- | |||
| 57 || 55 | |||
|- | |||
| 58 || 56 || rowspan="2" style="background-color: #6666ff;" | 28 | |||
|- | |||
| 59 || 57 | |||
|- | |||
| 60 || 58 || rowspan="2" style="background-color: #6666ff;" | 29 | |||
|- | |||
| 61 || 59 || rowspan="23" style="background-color: #afafaf;" | 13<br />(2.472) | |||
|- | |||
| 62 || 60 || rowspan="2" style="background-color: #6666ff;" | 30 | |||
|- | |||
| 63 || 61 | |||
|- | |||
| 64 || 62 || rowspan="2" style="background-color: #6666ff;" | 31 | |||
|- | |||
| 65 || 63 | |||
|- | |||
| 66 || 64 || rowspan="2" style="background-color: #6666ff;" | 32 | |||
|- | |||
| 67 || 65 | |||
|- | |||
| 68 || 66 || rowspan="2" style="background-color: #6666ff;" | 33 | |||
|- | |||
| 69 || 67 | |||
|- | |||
| 70 || 68 || rowspan="2" style="background-color: #6666ff;" | 34 | |||
|- | |||
| 71 || 69 | |||
|- | |||
| 72 || 70 || rowspan="2" style="background-color: #6666ff;" | 35 | |||
|- | |||
| 73 || 71 | |||
|- | |||
| 74 || 72 || rowspan="2" style="background-color: #6666ff;" | 36 | |||
|- | |||
| 75 || 73 | |||
|- | |||
| 76 || 74 || rowspan="2" style="background-color: #6666ff;" | 37 | |||
|- | |||
| 77 || 75 | |||
|- | |||
| 78 || 76 || rowspan="2" style="background-color: #6666ff;" | 38 | |||
|- | |||
| 79 || 77 | |||
|- | |||
| 80 || 78 || rowspan="2" style="background-color: #6666ff;" | 39 | |||
|- | |||
| 81 || rowspan="3" | Guard | |||
|- | |||
| 82 || rowspan="2" | Guard | |||
|- | |||
| 83 | |||
|- | |||
|} | |||
=== Bluetooth Adressing === | |||
Each Bluetooth unit has a unique 48-bit address (BD_ADDR). | Each Bluetooth unit has a unique 48-bit address (BD_ADDR). | ||
{| class="wikitable" style="text-align: center;border:3px solid #123AAA;" | {| class="wikitable" style="text-align: center;border:3px solid #123AAA;" | ||
Line 62: | Line 241: | ||
|colspan="6"|'''Company_id''' | |colspan="6"|'''Company_id''' | ||
|- | |- | ||
|colspan="6"|'''L'''ower '''A''' | |colspan="6"|'''L'''ower '''A'''dress '''P'''art (24-bit) | ||
|colspan="2"|'''U'''pper '''A''' | |colspan="2"|'''U'''pper '''A'''dress '''P'''art (8-bit) | ||
|colspan="4"|'''N'''on-Significant '''A''' | |colspan="4"|'''N'''on-Significant '''A'''dress '''P'''art (16-bit) | ||
|- | |- | ||
!width=" | !width="60"|<sub>lsb</sub>xxxx | ||
!width=" | !width="60"|xxxx | ||
!width=" | !width="60"|xxxx | ||
!width=" | !width="60"|xxxx | ||
!width=" | !width="60"|xxxx | ||
!width=" | !width="60"|xxxx | ||
!width=" | !width="60"|xxxx | ||
!width=" | !width="60"|xxxx | ||
!width=" | !width="60"|xxxx | ||
!width=" | !width="60"|xxxx | ||
!width=" | !width="60"|xxxx | ||
!width=" | !width="60"|xxxx<sup>msb</sup> | ||
|- | |- | ||
|} | |} | ||
If you spoof a previously paired DS4's BDADDR (is the unique address of a Bluetooth device, similar to the MAC address of a network card) and class, then using "[http://www.linux-commands-examples.com/hcitool sudo hcitool cc <ps4's bdaddr>]" will wake up the PS4. If the same cc request comes from an unknown BDADDR, nothing happens. | |||
The [[DualShock 4]] has two modes, one where you can pair it with a computer (hold PS and share at the same time until the light blinks twice in quick succession rapidly), and another mode when it is used with a PS4. | |||
===Class of Device/Service (CoD)=== | ===Class of Device/Service (CoD)=== | ||
In practice, most Bluetooth clients scan their surroundings in two successive steps: they first look for all bluetooth devices around them and find out their "class". You can do this on Linux with the hcitool scan command. Then, they use SDP in order to check if a device in a given class offers the type of service that they want. | |||
In the PS4 mode, the DualShock 4 appears to be advertised as two devices (neither has a name), one is a game controller and the other is an audio device: | In the PS4 mode, the DualShock 4 appears to be advertised as two devices (neither has a name), one is a game controller and the other is an audio device: | ||
Line 211: | Line 391: | ||
**0x0100: L2CAP | **0x0100: L2CAP | ||
*0x0800: Maximum Attribute Byte count (2048)? | *0x0800: Maximum Attribute Byte count (2048)? | ||
*0x0A: Data element (type:1, Size index: 2 (4 bytes) | |||
**0x0000FFFF: Attribute ID list | **0x0000FFFF: Attribute ID list | ||
*0x00: Continuation State | *0x00: Continuation State | ||
Line 599: | Line 778: | ||
Protocol code: | Protocol code: | ||
===== 0x01 ===== | ===== 0x01 ===== | ||
This report is sent until the GET REPORT FEATURE 0x02 is received. | This report is sent until the GET REPORT FEATURE 0x02 is received. | ||
0xa1, '''0x01''', 0x7d, 0x7d, 0x80, 0x7e, 0x08, 0x00, 0x00, 0x00, 0x00 | |||
^Left Stick X ... ^D-PAD | |||
0x00, 0x00, 0x00 | |||
===== 0x11 ===== | ===== 0x11 ===== | ||
This report is sent once the GET REPORT FEATURE 0x02 is received. | This report is sent once the GET REPORT FEATURE 0x02 is received. | ||
See example | |||
==== HID OUTPUT reports ==== | ==== HID OUTPUT reports ==== | ||
Line 895: | Line 792: | ||
Protocol code: | Protocol code: | ||
===== 0x11 ===== | ===== 0x11 ===== | ||
===== 0x14 ===== | ===== 0x14 ===== | ||
Speculation: contains sound. | |||
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F | ||
0000 <span style="background:#ff6666;">0f 01 42 00</span> a2 '''14''' 40 a0 f4 69 02 | 0000 <span style="background:#ff6666;">0f 01 42 00</span> a2 '''14''' 40 a0 f4 69 02 9c 75 19 24 00 [email protected].$. | ||
0010 00 00 00 00 00 00 00 76 db 6d bb 6d b6 dd b6 db .......v.m.m.... | 0010 00 00 00 00 00 00 00 76 db 6d bb 6d b6 dd b6 db .......v.m.m.... | ||
0020 6e db 6d b7 6d b6 db b6 db 6d db 6d b6 ed b6 db n.m.m....m.m.... | 0020 6e db 6d b7 6d b6 db b6 db 6d db 6d b6 ed b6 db n.m.m....m.m.... | ||
Line 1,008: | Line 805: | ||
0050 b6 db 6e db 6d b7 6d b6 db b6 db 6d db 6d b6 ed ..n.m.m....m.m.. | 0050 b6 db 6e db 6d b7 6d b6 db b6 db 6d db 6d b6 ed ..n.m.m....m.m.. | ||
0060 b6 db 76 db 6d bb 6d b6 dd b6 db 6e db 6d b7 6d ..v.m.m....n.m.m | 0060 b6 db 76 db 6d bb 6d b6 dd b6 db 6e db 6d b7 6d ..v.m.m....n.m.m | ||
0070 b6 db b6 db 6d db 6d b6 ed b6 db | 0070 b6 db b6 db 6d db 6d b6 ed b6 db 9c 75 19 24 00 ....m.m.....u.$. | ||
0080 00 00 00 00 00 00 00 76 db 6d bb 6d b6 dd b6 db .......v.m.m.... | 0080 00 00 00 00 00 00 00 76 db 6d bb 6d b6 dd b6 db .......v.m.m.... | ||
0090 6e db 6d b7 6d b6 db b6 db 6d db 6d b6 ed b6 db n.m.m....m.m.... | 0090 6e db 6d b7 6d b6 db b6 db 6d db 6d b6 ed b6 db n.m.m....m.m.... | ||
Line 1,019: | Line 816: | ||
0100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <span style="background:lime;">9f</span> ................ | 0100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <span style="background:lime;">9f</span> ................ | ||
0110 <span style="background:lime;">42 86 54</span> B.T | 0110 <span style="background:lime;">42 86 54</span> B.T | ||
===== 0x15 ===== | ===== 0x15 ===== | ||
Line 1,073: | Line 827: | ||
0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ | 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ | ||
0040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ | 0040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ | ||
0050 00 00 00 | 0050 00 00 00 f6 69 02 9c 75 19 24 00 00 00 00 00 00 ....i..u.$...... | ||
0060 00 00 76 db 6d bb 6d b6 dd b6 db 6e db 6d b7 6d ..v.m.m....n.m.m | 0060 00 00 76 db 6d bb 6d b6 dd b6 db 6e db 6d b7 6d ..v.m.m....n.m.m | ||
0070 b6 db b6 db 6d db 6d b6 ed b6 db 76 db 6d bb 6d ....m.m....v.m.m | 0070 b6 db b6 db 6d db 6d b6 ed b6 db 76 db 6d bb 6d ....m.m....v.m.m | ||
Line 1,080: | Line 834: | ||
00a0 b7 6d b6 db b6 db 6d db 6d b6 ed b6 db 76 db 6d .m....m.m....v.m | 00a0 b7 6d b6 db b6 db 6d db 6d b6 ed b6 db 76 db 6d .m....m.m....v.m | ||
00b0 bb 6d b6 dd b6 db 6e db 6d b7 6d b6 db b6 db 6d .m....n.m.m....m | 00b0 bb 6d b6 dd b6 db 6e db 6d b7 6d b6 db b6 db 6d .m....n.m.m....m | ||
00c0 db 6d b6 ed b6 db | 00c0 db 6d b6 ed b6 db 9c 75 19 24 00 00 00 00 00 00 .m.....u.$...... | ||
00d0 00 00 76 db 6d bb 6d b6 dd b6 db 6e db 6d b7 6d ..v.m.m....n.m.m | 00d0 00 00 76 db 6d bb 6d b6 dd b6 db 6e db 6d b7 6d ..v.m.m....n.m.m | ||
00e0 b6 db b6 db 6d db 6d b6 ed b6 db 76 db 6d bb 6d ....m.m....v.m.m | 00e0 b6 db b6 db 6d db 6d b6 ed b6 db 76 db 6d bb 6d ....m.m....v.m.m | ||
Line 1,105: | Line 859: | ||
===== 0x17 ===== | ===== 0x17 ===== | ||
===== 0x18 ===== | ===== 0x18 ===== | ||
===== 0x19 ===== | ===== 0x19 ===== | ||
==== HID features reports ==== | ==== HID features reports ==== | ||
A user-mode application can obtain (get) and set feature information by using this report designation. | A user-mode application can obtain (get) and set feature information by using this report designation. | ||
===== GET FEATURE===== | ===== GET FEATURE===== | ||
====== 0x02 ====== | ====== 0x02 ====== | ||
====== 0x04 ====== | ====== 0x04 ====== | ||
====== 0x06 ====== | ====== 0x06 ====== | ||
====== 0xA3 ====== | ====== 0xA3 ====== | ||
====== 0xF1 ====== | ====== 0xF1 ====== | ||
02 15 20 08 00 04 00 41 00 4b f1 40 00 | |||
====== 0xF2 ====== | ====== 0xF2 ====== | ||
===== SET FEATURE===== | ===== SET FEATURE===== | ||
====== 0x03 ====== | ====== 0x03 ====== | ||
====== 0xF0 ====== | ====== 0xF0 ====== | ||
{{Reverse Engineering}} | {{Reverse Engineering}} | ||
<noinclude>[[Category:Main]]</noinclude> | <noinclude>[[Category:Main]]</noinclude> |