summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/iap.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/iap.c b/apps/iap.c
index dcdb0fbb91..11b57bb606 100644
--- a/apps/iap.c
+++ b/apps/iap.c
@@ -312,7 +312,12 @@ static void iap_handlepkt_mode0(void)
312 { 312 {
313 cmd_ok_mode0(cmd); 313 cmd_ok_mode0(cmd);
314 314
315 if (serbuf[6] == 0x35) 315 uint32_t lingoes = (serbuf[3] << 24) |
316 (serbuf[4] << 16) |
317 (serbuf[5] << 8) |
318 (serbuf[6] << 0);
319
320 if (lingoes == 0x35)
316 /* FM transmitter sends this: */ 321 /* FM transmitter sends this: */
317 /* FF 55 0E 00 13 00 00 00 35 00 00 00 04 00 00 00 00 A6 (??)*/ 322 /* FF 55 0E 00 13 00 00 00 35 00 00 00 04 00 00 00 00 A6 (??)*/
318 { 323 {
@@ -323,12 +328,11 @@ static void iap_handlepkt_mode0(void)
323 unsigned char data3[] = {0x05, 0x02}; 328 unsigned char data3[] = {0x05, 0x02};
324 iap_send_pkt(data3, sizeof(data3)); 329 iap_send_pkt(data3, sizeof(data3));
325 } 330 }
326
327 else 331 else
328 { 332 {
329 /* ipod fm remote sends this: */ 333 /* ipod fm remote sends this: */
330 /* FF 55 0E 00 13 00 00 00 8D 00 00 00 0E 00 00 00 03 41 */ 334 /* FF 55 0E 00 13 00 00 00 8D 00 00 00 0E 00 00 00 03 41 */
331 if (serbuf[6] |= 0x80) 335 if (lingoes & (1 << 7)) /* bit 7 = RF tuner lingo */
332 radio_present = 1; 336 radio_present = 1;
333 /* GetDevAuthenticationInfo */ 337 /* GetDevAuthenticationInfo */
334 unsigned char data4[] = {0x00, 0x14}; 338 unsigned char data4[] = {0x00, 0x14};