Patch for iTegno GSM modem failure
Yulianto Z <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi all, I have some iTegno GSM modem that behave very strange. It suppose to work in PDU mode after first AT+CMGS=0. But this modem was reset to text mode (AT+CMGS=1) after first SMS being read/sent. So I though it would be safe to initiate PDU mode right before sending/reading SMS. Small patch will do. At the time I send this patch, I'm not sure yet any other AT cmd that shall be patch as well. Still in hurry to finish the project. Anyway, attached the patch. -- A diplomatic husband said to his wife, "How do you expect me to remember your birthday when you never look any older?" GPG fingerprint: 7198 CFCC 255D BF14 6435 62BD CCF4 1929 467E 8019 GPG Public key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x467E8019
PDU-safe.diff
(text/x-patch, 1.2 KB)
Index: gw/smsc/smsc_at.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsc/smsc_at.c,v
retrieving revision 1.28
diff -u -r1.28 smsc_at.c
--- gw/smsc/smsc_at.c 15 Sep 2005 19:43:42 -0000 1.28
+++ gw/smsc/smsc_at.c 16 Mar 2006 11:20:36 -0000
@@ -770,7 +770,8 @@
char cmd[20];
int message_count = 0;
- sprintf(cmd, "AT+CMGR=%d", message_number);
+ /* yulianto: make it safe by set it to PDU mode before read the message */
+ sprintf(cmd, "AT+CMGF=0;+CMGR=%d", message_number);
/* read one message from memory */
at2_write_line(privdata, cmd);
if (at2_wait_modem_command(privdata, 0, 0, &message_count) != 0) {
@@ -1945,7 +1946,8 @@
/*
* send the initial command and then wait for >
*/
- sprintf(command, "AT+CMGS=%ld", octstr_len(pdu) / 2);
+ /* yulianto: make it safe by set it to PDU mode before send the message */
+ sprintf(command, "AT+CMGF=0;+CMGS=%ld", octstr_len(pdu) / 2);
ret = at2_send_modem_command(privdata, command, 5, 1);
debug("bb.smsc.at2", 0, "AT2[%s]: send command status: %d",
signature.asc
(application/pgp-signature, 191 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQBEGUqKzPQZKUZ+gBkRAqi9AJ9k8cNftLGC6Xs/MgSlKYBnP73CbACdEUSM pNWWwASePt0gnH1/E+0PJSw= =Gl3i -----END PGP SIGNATURE-----