문제

I have my iPod Touch (4G, jailbroken, iOS 5.0) connected to a docking station (Made for iPod) that sends commands via the dock connector (most likely using the Apple Accessory Protocol) to the iPod, e.g. to start and stop playback. As the iPod is jailbroken, I can see the commands coming in when I'm ssh'd to the iPod, as follows (here pressing the play/pause button on the docking station repeatedly, each line equals one button press):

iPod Touch:~ mobile$ od /dev/tty.iap
0000000 102000 177020 004017 000360 004017 000360 144204 004317
0000020 000340 002020 000376 004017 177430 002010 000376 000440
0000040 147730 160010 004377 147740 160010 020000 154001 102000
0000060 177020 020400 177000 102000 177710 160010 007400 014010
0000100 000377 004417 177430 007400 014011 000377 002020 020400
0000120 177000 004000 000300 140010 004377 000340 000440 000344

What I don't understand is why the input here is always different. As I'm pressing the same button, I would expect each line of input to be the same (obviously ignoring the offset marker at the beginning). The play/pause button otherwise works as expected (when this od command isn't running).

So my question is: Is there a better way of calling od or another utility I can use so that I will be able to see the request correctly? Or do I need to change the baud rate or something like that?

EDIT: Every once in a while two lines of input for one button press are displayed instead of just one. Could that be an alignment/buffering problem?

도움이 되었습니까?

해결책

Apparently the problem was with the baud rate, which was (by default) at 9600 for /dev/tty.iap. With a small C program (don't know how to set the baud rate for od or hexdump or change it for the serial port directly) that changed the baud rate to 19200 using cfsetspeed, the input for commands from the external accessory were consistently identical.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top