Hi

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

> Will do, in a separate mail.

It looks like another non standard Motorola thing connected with their
more modes of modem. Can you please try to recompile Gammu with attached
patch?

With it maybe even calendar will work for you, but it is just wild
guess.

-- 
        Michal Čihař | http://cihar.com | http://blog.cihar.com
Index: common/phone/at/atgen.c
===================================================================
--- common/phone/at/atgen.c	(revision 2126)
+++ common/phone/at/atgen.c	(working copy)
@@ -1608,6 +1608,9 @@
 		} else {
 			cset = Priv->IRACharset;
 		}
+	} else if (Prefer == AT_PREF_CHARSET_RESET) {
+		cset = Priv->Charset;
+		Priv->Charset = 0;
 	} else {
 		return ERR_BUG;
 	}
@@ -1625,7 +1628,8 @@
 
 	/* Should not happen! */
 	if (AT_Charsets[i].charset == 0) {
-		smprintf(s, "Could not find string representation for charset!\n");
+		smprintf(s, "Could not find string representation for charset (%d)!\n",
+				cset);
 		return ERR_BUG;
 	}
 
Index: common/phone/at/atgen.h
===================================================================
--- common/phone/at/atgen.h	(revision 2126)
+++ common/phone/at/atgen.h	(working copy)
@@ -165,6 +165,11 @@
 	 * some transmitted characters is not possible to GSM.
 	 */
 	AT_PREF_CHARSET_IRA,
+	/**
+	 * This option just sets again charset in phone. Useful after
+	 * something what resets this information in phone.
+	 */
+	AT_PREF_CHARSET_RESET,
 } GSM_AT_Charset_Preference;
 
 typedef enum {
@@ -398,6 +403,16 @@
  */
 GSM_Error ATGEN_ParseReply(GSM_StateMachine *s, const unsigned char *input, const char *format, ...);
 
+/**
+ * Sets charset in phone according to preference.
+ *
+ * \param s State machine structure.
+ * \param Prefer What charset setting is prefered.
+ *
+ * \return Error code.
+ */
+GSM_Error ATGEN_SetCharset(GSM_StateMachine *s, GSM_AT_Charset_Preference Prefer);
+
 #endif
 /[EMAIL PROTECTED]/
 /[EMAIL PROTECTED]/
Index: common/phone/at/atfunc.h
===================================================================
--- common/phone/at/atfunc.h	(revision 2126)
+++ common/phone/at/atfunc.h	(working copy)
@@ -63,8 +63,6 @@
 extern GSM_Error ATGEN_GetBitmap(GSM_StateMachine *s, GSM_Bitmap *Bitmap);
 extern GSM_Error ATGEN_SetBitmap(GSM_StateMachine *s, GSM_Bitmap *Bitmap);
 
-extern GSM_Error ATGEN_SetCharset(GSM_StateMachine *s, GSM_AT_Charset_Preference Prefer);
-
 #endif
 
 /* How should editor hadle tabs in this file? Add editor commands here.
Index: common/phone/at/motorola.c
===================================================================
--- common/phone/at/motorola.c	(revision 2126)
+++ common/phone/at/motorola.c	(working copy)
@@ -135,6 +135,10 @@
 	/* On succes we remember it */
 	if (error == ERR_NONE) {
 		Priv->CurrentMode = cmd->Mode;
+		/* We might need to restore charset as phone resets it */
+		if (cmd->Mode == 2) {
+			error = ATGEN_SetCharset(s, AT_PREF_CHARSET_RESET);
+		}
 	}
 
 	return error;

Attachment: signature.asc
Description: PGP signature

Reply via email to