From 16e793f5d1d626e6506f2b172efa03f46fb0ed39 Mon Sep 17 00:00:00 2001 From: Bertrik Sikken Date: Sat, 30 Apr 2011 10:40:05 +0000 Subject: iap: update handling of IdentifyDeviceLingoes command and fix RF tuner detection code git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29797 a1c6a512-1295-4272-9138-f99709370657 --- apps/iap.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'apps/iap.c') 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) { cmd_ok_mode0(cmd); - if (serbuf[6] == 0x35) + uint32_t lingoes = (serbuf[3] << 24) | + (serbuf[4] << 16) | + (serbuf[5] << 8) | + (serbuf[6] << 0); + + if (lingoes == 0x35) /* FM transmitter sends this: */ /* FF 55 0E 00 13 00 00 00 35 00 00 00 04 00 00 00 00 A6 (??)*/ { @@ -323,12 +328,11 @@ static void iap_handlepkt_mode0(void) unsigned char data3[] = {0x05, 0x02}; iap_send_pkt(data3, sizeof(data3)); } - else { /* ipod fm remote sends this: */ /* FF 55 0E 00 13 00 00 00 8D 00 00 00 0E 00 00 00 03 41 */ - if (serbuf[6] |= 0x80) + if (lingoes & (1 << 7)) /* bit 7 = RF tuner lingo */ radio_present = 1; /* GetDevAuthenticationInfo */ unsigned char data4[] = {0x00, 0x14}; -- cgit v1.2.3