Changes

1,674 bytes added ,  21:21, 19 April 2015
no edit summary
Line 94: Line 94:  
|-
 
|-
 
! 0x00
 
! 0x00
| colspan="8"|Synchronization byte (<code>0xA5</code>)
+
| colspan="8"|Synchronization byte: <code>0xA5</code>
 
|-
 
|-
 
! 0x01
 
! 0x01
| colspan="8"|Reserved for future use (<code>0x00</code>)
+
| colspan="8"|Reserved for future use
 
|-
 
|-
 
! 0x02
 
! 0x02
Line 174: Line 174:  
=== Error detection ===
 
=== Error detection ===
 
The trailing error detection byte is calculated using [[CRC-8-CCITT]] <b>over the whole packet</b> (both the header and the payload)
 
The trailing error detection byte is calculated using [[CRC-8-CCITT]] <b>over the whole packet</b> (both the header and the payload)
 +
 +
== Layer 2 - "ircom" ==
 +
ircom is a simple stateful point-to-point master-slave communication protocol built on top of IR layer 1.
 +
 +
{| class="wikitable" style="margin: 0 auto; text-align: center;"
 +
|+IR framing format - long frame
 +
|-
 +
! style="border-top: none" | Byte
 +
! style="width:10%;"| 7
 +
! style="width:10%;"| 6
 +
! style="width:10%;"| 5
 +
! style="width:10%;"| 4
 +
! style="width:10%;"| 3
 +
! style="width:10%;"| 2
 +
! style="width:10%;"| 1
 +
! style="width:10%;"| 0
 +
|-
 +
! 0x00
 +
| colspan="8"|Random value in range <code>0x01</code>~<code>0xFE</code>
 +
|-
 +
! 0x01
 +
| colspan="8"|Random value in range <code>0x01</code>~<code>0xFE</code>
 +
|-
 +
! 0x02
 +
| colspan="8"|Random value in range <code>0x01</code>~<code>0xFE</code>
 +
|-
 +
! 0x03
 +
| colspan="8"|Random value in range <code>0x01</code>~<code>0xFE</code>
 +
|-
 +
! 0x04
 +
| colspan="4"|RFU?
 +
| colspan="4"|Protocol version: <code>0x1</code>
 +
|-
 +
! 0x05
 +
| colspan="8"|Connection identificator
 +
|-
 +
! 0x06
 +
| colspan="8"|Reserved for future use?
 +
|-
 +
! 0x07
 +
| colspan="4"|???
 +
| colspan="4"|Operation code
 +
|-
 +
! 0x08+
 +
| colspan="8" style="background:#ffd0d0;"|Payload (if any)
 +
|}
 +
 +
* Random values are generated using a Mersenne Twister whose seed is based off the NFC adapter system tick counter. It is therefore random, and the 3DS won't attempt to validate them by any means. Its purpose is unknown.
 +
* NFC adapter will ignore packets whose protocol version is not 1. It will not even reply.
 +
* Connection identifier is a random byte the 3DS assigns to identify the connection should be several connections in range at once. Slave devices must save this value from the initial handshake packet and use it for replies. It must also ignore packets whose connection ID does not match.
    
== Samples ==
 
== Samples ==
48

edits