Dne Sat, 8 Mar 2008 21:03:41 +0100
Philipp Kern <[EMAIL PROTECTED]> napsal(a):

> Another log attached with model in gammurc commented out.  Calendar
> still doesn't work, though.  I suspect that Motorola does something
> proprietary here, but who knows.  ):

It is possible, but according to logs Gammu even does not try
anything, so there is still some bug affecting Motorola phones. Can you
please test attached patch?

-- 
        Michal Čihař | http://cihar.com | http://blog.cihar.com
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 2129)
+++ ChangeLog	(working copy)
@@ -20,6 +20,7 @@
 [-] * Fix handling of UTF8 charset with some Motorola phones.
 [-] * Identify Motorola V635.
 [-] * Set again charset in Motorola phones after changing AT mode.
+[-] * Automatically enable OBEX for Motorola phones.
     
 20080305 - 1.19.0
 
Index: common/phone/at/atgen.c
===================================================================
--- common/phone/at/atgen.c	(revision 2129)
+++ common/phone/at/atgen.c	(working copy)
@@ -1094,9 +1094,12 @@
 	if (Data->ModelInfo->number[0] == 0)
 		Data->ModelInfo = GetModelData(s, Data->Model, NULL, NULL);
 
-	if (Data->ModelInfo->number[0] != 0) strcpy(Data->Model,Data->ModelInfo->number);
+	if (Data->ModelInfo->number[0] != 0) {
+		smprintf(s, "Unknown model, but it should still work\n");
+		strcpy(Data->Model,Data->ModelInfo->number);
+	}
 
-	smprintf(s, "[Model: %s]\n", s->Phone.Data.Model);
+	smprintf(s, "[Model data: %s]\n", Data->ModelInfo->number);
 
 	return ERR_NONE;
 }
@@ -1408,6 +1411,19 @@
 		/* We don't care about error here */
 		ATGEN_WaitFor(s, "AT+CPROT=?\r", 11, 0x00, 3, ID_SetOBEX);
 		error = ERR_NONE;
+	} else {
+		/*
+		 * Enable OBEX for Motorolas, they usually support this and
+		 * AT+OBEX can fallback to pure AT.
+		 */
+		if (!GSM_IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_NO_ATOBEX) &&
+				!GSM_IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_OBEX)
+				) {
+			smprintf(s, "Automatically enabling F_OBEX, please report bug if it causes problems\n");
+			GSM_AddPhoneFeature(s->Phone.Data.ModelInfo, F_OBEX);
+			GSM_AddPhoneFeature(s->Phone.Data.ModelInfo, F_MODE22);
+			GSM_AddPhoneFeature(s->Phone.Data.ModelInfo, F_IRMC_LEVEL_2);
+		}
 	}
 
 #ifdef GSM_ENABLE_ATOBEX
@@ -1511,7 +1527,7 @@
 				if (AT_Charsets[i].unicode && (strstr(line, AT_Charsets[i].text) != NULL)) {
 					if ((AT_Charsets[i].charset == AT_CHARSET_UTF8 ||
 						AT_Charsets[i].charset == AT_CHARSET_UTF_8) &&
-							Priv->Manufacturer != AT_Motorola) {
+							Priv->Manufacturer == AT_Motorola) {
 						IgnoredUTF8 = true;
 						smprintf(s, "Skipped %s because it is usually wrongly implemented on Motorola phones\n", AT_Charsets[i].text);
 					} else if ((AT_Charsets[i].charset != AT_CHARSET_UCS2 &&

Attachment: signature.asc
Description: PGP signature

Reply via email to