📄 apple accessory protocot.mht
字号:
disconnect". </P>
<P>Commands you send to the iPod are in bold, responses to those =
commands from=20
the iPod are not. The response is always the command + 1. </P>
<TABLE cellSpacing=3D0 cellPadding=3D5 border=3D1>
<CAPTION><B>Mode 4 Commands</B> </CAPTION>
<TBODY>
<TR>
<TH style=3D"BACKGROUND: #efefef">Command </TH>
<TH style=3D"BACKGROUND: #efefef">Parameter (bytes) </TH>
<TH style=3D"BACKGROUND: #efefef">Purpose </TH></TR>
<TR>
<TD>0x00 0x00 </TD>
<TD>Result(1) Command(2) </TD>
<TD>think that the result 0x04 means that the command wasn=C2=B4t =
understood=20
</TD></TR>
<TR>
<TD>0x00 0x01 </TD>
<TD>Result(1) Command(2) </TD>
<TD>Gives you feedback on the command you just executed. Result:=20
0=3Dsuccess, 2=3Dfailure, 4=3Dyou exceeded the limit of whatever =
you were=20
requesting/wrong parameter-count, 5=3Dsent an iPod-Answere-Cmd(?). =
The=20
Command is the command that this is in response to. </TD></TR>
<TR>
<TD><B>0x00 0x02</B> </TD>
<TD>none </TD>
<TD>perhaps a simple ping-request ?! </TD></TR>
<TR>
<TD>0x00 0x03 </TD>
<TD>8 bytes </TD>
<TD>0xFF 0xFF 0xFF 0xFF 0x00 0x00 0x00 0x00 (echo?) </TD></TR>
<TR>
<TD><B>0x00 0x09</B> </TD>
<TD>none </TD>
<TD> ? returns flag set with 0x00 0x0b, don=C2=B4t know, what =
this means=20
(perhaps an indicator for track-change - if you set this flag to =
0x01 it=20
turns to 0x00 again after changing the track) </TD></TR>
<TR>
<TD>0x00 0x0a </TD>
<TD>1 byte</TD>
<TD>0x00 or 0x01 </TD></TR>
<TR>
<TD><B>0x00 0x0b</B> </TD>
<TD>1 byte </TD>
<TD>parameter 0x00 & 0x01 result in a success-answere (copare =
0x00=20
0x01), don=C2=B4t know what happens - seems to be a flag which can =
be read with=20
0x00 0x09 </TD></TR>
<TR>
<TD><B>0x00 0x0c</B> </TD>
<TD>7 bytes </TD>
<TD> ??? results in a answer 0x0d </TD></TR>
<TR>
<TD>0x00 0x0d </TD>
<TD>11 bytes or 1 byte </TD>
<TD>tried some parameters - result seems to dependent on current =
playlist=20
<BR>parameters 0x00 0x00 0x00 0x00 0x00 0x00 0x00 give (on my =
Ipod) 11=20
bytes<BR>(0x00 0x00 0x00 0x00 0x00 0x00 0x02 0xf0 0xdb 0x00 0x00 =
in=20
main-Playlist - *not* the playlist-number and *not* the count of =
tracks in=20
this playlist)=20
<P>This command can also inform the accessory when there is a =
track change=20
(one song ends and another begins). So it is a "subscription" - =
some=20
previous query caused the ipod to send this every time the track =
changes.=20
Probably the parameter bytes are a kind of track ID, maybe based =
on some=20
filesystem attribute, such as actual position on the hard disk. =
</P></TD></TR>
<TR>
<TD><B>0x00 0x12</B> </TD>
<TD>none </TD>
<TD> ? Get iPod Type Size ? </TD></TR>
<TR>
<TD>0x00 0x13 </TD>
<TD>2 bytes </TD>
<TD>Gen3 20GB: 0x01 0x02 (0x01 =3D Gen3 iPod, 0x02 =3D =
20GB ??)<BR>Gen4=20
30GB: 0x01 0x09<BR>Gen5 30GB: 0x01 0x09 </TD></TR>
<TR>
<TD><B>0x00 0x14</B> </TD>
<TD>none </TD>
<TD>Get iPod Name </TD></TR>
<TR>
<TD>0x00 0x15 </TD>
<TD>namestring(var) </TD>
<TD>iPod Name as a null terminated string </TD></TR>
<TR>
<TD><B>0x00 0x16</B> </TD>
<TD>none </TD>
<TD>Switch to the main library playlist (playlist 0) </TD></TR>
<TR>
<TD><B>0x00 0x17</B> </TD>
<TD>type(1) number(4) </TD>
<TD>Switch to item identified by the number and type given. =
</TD></TR>
<TR>
<TD><B>0x00 0x18</B> </TD>
<TD>type(1) </TD>
<TD>Get Count of the given types (count of playlists, etc) =
</TD></TR>
<TR>
<TD>0x00 0x19 </TD>
<TD>number(4) </TD>
<TD>Amount of requested type returned </TD></TR>
<TR>
<TD><B>0x00 0x1A</B> </TD>
<TD>type(1) number(4) number(4) </TD>
<TD>Get Names for a range of items, first number is starting item =
offset=20
(0 for the first item), second number is number of items to =
retrieve. The=20
iPod will send back an entire message for each item requested. =
</TD></TR>
<TR>
<TD>0x00 0x1B </TD>
<TD>number(4) string </TD>
<TD>offset, name of the item (note that playlist 0 is the "main =
library"=20
and will contain all the songs on the iPod and have the same name =
as the=20
iPod itself as in command 0x00 0x14). </TD></TR>
<TR>
<TD><B>0x00 0x1C</B> </TD>
<TD>none </TD>
<TD>Get time and status info </TD></TR>
<TR>
<TD>0x00 0x1D </TD>
<TD>length(4) time(4) status(1) </TD>
<TD>Track length in milliseconds, elapsed time in milliseconds, =
status=3D0x0=20
stop, 0x01 playing, 0x02 paused </TD></TR>
<TR>
<TD><B>0x00 0x1E</B> </TD>
<TD>none </TD>
<TD>Get current position in playlist </TD></TR>
<TR>
<TD>0x00 0x1F </TD>
<TD>position(4) </TD>
<TD>Current position in playlist </TD></TR>
<TR>
<TD><B>0x00 0x20</B> </TD>
<TD>number(4) </TD>
<TD>Get title of a song number </TD></TR>
<TR>
<TD>0x00 0x21 </TD>
<TD>string </TD>
<TD>title returned as a null terminated string </TD></TR>
<TR>
<TD><B>0x00 0x22</B> </TD>
<TD>number(4) </TD>
<TD>Get artist of a song number </TD></TR>
<TR>
<TD>0x00 0x23 </TD>
<TD>string </TD>
<TD>Artist returned as a null terminated string </TD></TR>
<TR>
<TD><B>0x00 0x24</B> </TD>
<TD>number(4) </TD>
<TD>Get album of a song number </TD></TR>
<TR>
<TD>0x00 0x25 </TD>
<TD>string </TD>
<TD>Album returned as a null terminated string </TD></TR>
<TR>
<TD><B>0x00 0x26</B> </TD>
<TD>pollingmode(1) </TD>
<TD>Start Polling Mode =3D 0x01, Stop Polling Mode =3D 0x00. Polling =
mode=20
causes the iPod to return the time elapsed (0x00 0x27) every 500=20
milliseconds. </TD></TR>
<TR>
<TD>0x00 0x27 </TD>
<TD>number(4) </TD>
<TD>time elapsed on current song </TD></TR>
<TR>
<TD><B>0x00 0x28</B> </TD>
<TD>number(4) </TD>
<TD>Execute Playlist switch specified in command 0x00 0x17, and jump =
to=20
specified songnumber in the playlist (0xFFFFFFFF =3D start at the =
beginning=20
of the playlist, even when shuffled... probably what you want to =
use)=20
</TD></TR>
<TR>
<TD><B>0x00 0x29</B> </TD>
<TD>command(1) </TD>
<TD>AiR Playback Control. Play/Pause=3D0x01, Stop=3D0x02, =
Skip++=3D0x03,=20
Skip--=3D0x04, FFwd=3D0x05, FRwd=3D0x06, StopFF/RW=3D0x07 =
</TD></TR>
<TR>
<TD><B>0x00 0x2C</B> </TD>
<TD>none </TD>
<TD>Get Shuffle Mode </TD></TR>
<TR>
<TD>0x00 0x2D </TD>
<TD>shufflemode(1) </TD>
<TD>Returns current Shuffle mode: Off =3D 0x00, Songs =3D 0x01, =
Albums =3D 0x02=20
</TD></TR>
<TR>
<TD><B>0x00 0x2E</B> </TD>
<TD>shufflemode(1) </TD>
<TD>Sets the shuffle mode. Off =3D 0x00, Songs =3D 0x01, Albums =3D =
0x02. </TD></TR>
<TR>
<TD><B>0x00 0x2F</B> </TD>
<TD>none </TD>
<TD>Get Repeat Mode </TD></TR>
<TR>
<TD>0x00 0x30 </TD>
<TD>repeatmode(1) </TD>
<TD>Returns current Repeat mode: Off =3D 0x00, One song =3D 0x01, =
All songs =3D=20
0x02 </TD></TR>
<TR>
<TD><B>0x00 0x31</B> </TD>
<TD>repeatmode(1) </TD>
<TD>Sets the repeat mode. Off =3D 0x00, One song =3D 0x01, All songs =
=3D 0x02=20
</TD></TR>
<TR>
<TD><B>0x00 0x32</B> </TD>
<TD>Picture Blocks </TD>
<TD>Upload Picture for AiR mode (see picture block description =
below)=20
</TD></TR>
<TR>
<TD><B>0x00 0x33</B> </TD>
<TD>none </TD>
<TD> ? Get Max Screen Size for Picture Upload ? </TD></TR>
<TR>
<TD>0x00 0x34 </TD>
<TD>2+2+1 bytes </TD>
<TD>Gen3 20GB: 0x00 0x78 0x00 0x41 0x01 =3D> 120 x 65 ?<BR>
<P>Gen5 30GB: 0x01 0x36 0x00 0xa8 0x01 =3D> 310 x 168 ? =
<BR>what=20
means the 0x01 at the end? - perhaps the supported resolution for =
1bit=20
bitmaps </P></TD></TR>
<TR>
<TD><B>0x00 0x35</B> </TD>
<TD>none </TD>
<TD>Get number of songs in current playlist </TD></TR>
<TR>
<TD>0x00 0x36 </TD>
<TD>number(4) </TD>
<TD>Number of songs in current playlist </TD></TR>
<TR>
<TD><B>0x00 0x37</B> </TD>
<TD>number(4) </TD>
<TD>Jump to specified Songnumber in the current playlist </TD></TR>
<TR>
<TD><B>0x00 0x38</B> </TD>
<TD>none </TD>
<TD>??? </TD></TR>
<TR>
<TD>0x00 0x39 </TD>
<TD>2*(2+2+1) =3D 10 bytes </TD>
<TD> ?? Gen5 30GB: 0x01 0x36 0x00 0xa8 0x02 0x01 0x36 0x00 0xa8 =
0x03=20
... some similarities to 0x00 0x34<BR>
<P>perhaps different solutions for different colordepth?=20
</P></TD></TR></table>=20
<DIV class=3Deditsection style=3D"FLOAT: right; MARGIN-LEFT: 5px">[<A=20
title=3D"Apple Accessory Protocol"=20
=
href=3D"http://ipodlinux.org/index.php?title=3DApple_Accessory_Protocol&a=
mp;action=3Dedit&section=3D7">edit</A>]</DIV><A=20
name=3DType_Bytes></A>
<H3>Type Bytes</H3>
<P>Some of the commands refers to type bytes. These are as follows:=20
</P></TBODY></TABLE>
<TABLE cellSpacing=3D0 cellPadding=3D5 border=3D1>
<CAPTION><B>Type bytes</B> </CAPTION>
<TBODY>
<TR>
<TH style=3D"BACKGROUND: #efefef">Type </TH>
<TH style=3D"BACKGROUND: #efefef">Purpose </TH></TR>
<TR>
<TD>0x01 </TD>
<TD>Playlist </TD></TR>
<TR>
<TD>0x02 </TD>
<TD>Artist </TD></TR>
<TR>
<TD>0x03 </TD>
<TD>Album </TD></TR>
<TR>
<TD>0x04 </TD>
<TD>Genre </TD></TR>
<TR>
<TD>0x05 </TD>
<TD>Song </TD></TR>
<TR>
<TD>0x06 </TD>
<TD>Composer </TD></TR></TBODY></TABLE>
<DIV class=3Deditsection style=3D"FLOAT: right; MARGIN-LEFT: 5px">[<A=20
title=3D"Apple Accessory Protocol"=20
href=3D"http://ipodlinux.org/index.php?title=3DApple_Accessory_Protocol&a=
mp;action=3Dedit&section=3D8">edit</A>]</DIV><A=20
name=3DPicture_Blocks></A>
<H3>Picture Blocks</H3>
<P>Transferring a picture to the iPod's screen is done using picture =
blocks. A=20
picture block is basically the picture command (0x00 0x32). It's =
complicated=20
enough to deserve its own section. </P>
<P>The parameter bytes of a picture block look like the following: </P>
<TABLE cellSpacing=3D0 cellPadding=3D5 border=3D1>
<CAPTION><B>Picture Block Parameters</B> </CAPTION>
<TBODY>
<TR>
<TH style=3D"BACKGROUND: #efefef">field </TH>
<TH style=3D"BACKGROUND: #efefef">size </TH>
<TH style=3D"BACKGROUND: #efefef">value </TH></TR>
<TR>
<TD>block number </TD>
<TD>2 </TD>
<TD>number of the block (starting from zero) </TD></TR>
<TR>
<TD>unknown </TD>
<TD>1 </TD>
<TD>always 1, only in the first block </TD></TR>
<TR>
<TD>width </TD>
<TD>2 </TD>
<TD>width of the picture, only in the first block </TD></TR>
<TR>
<TD>height </TD>
<TD>2 </TD>
<TD>height of the picture, only in the first block </TD></TR>
<TR>
<TD>bytes per line </TD>
<TD>4 </TD>
<TD>number of bytes you will send for each line. Divisible by 4, and =
only=20
in the first block </TD></TR>
<TR>
<TD>picture bytes </TD>
<TD>N </TD>
<TD>3 lines? of pixels to be displayed, every 2 bits represents a =
pixel (4=20
color greyscale) </TD></TR></TBODY></TABLE>
<P>An example would look something like the following: </P>
<P>First block: </P><PRE>0xFF 0x55 (standard header)
0x6E (length of data in this block)
0x04 (mode of the command)
0x00 0x32 (command for picture display)
0x00 0x00 (indicates the first block (block zero))
0x01 (damned if I know.. perhaps indicates that the size info for the =
picture is here)
0x00 0x78 (width of picture to be displayed)
0x00 0x40 (height of picture to be displayed)
0x00 0x00 0x00 0x20 (number of bytes you're sending for each line of the =
display - must be a multiple of 8 and has to fit the needed bits!)
The rest is a 4 color picture, with every two bits representing a pixel.
Checksum.
</PRE>
<P>Second block and every block thereafter: </P><PRE>0xFF 0x55 (standard =
header)
0x65 (length of data in this block)
0x04 (mode of the command)
0x00 0x32 (command for picture display)
0x00 0x01 (indicates the second block (increment as you go))
The rest is a 4 color picture, with every two bits representing a pixel.
Checksum.
</PRE>
<P>Any extra pixels you send outside the range of the picture size on =
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -