+Patch for: Siemens MC35i
[www.jankratochvil.net.git] / project / mdsms / dist / mdsms-1.5.3-siemens-mc35i.patch
1 --- mdsms-1.5.3/mdsms.c-orig    2003-07-10 13:58:13.000000000 +0200
2 +++ mdsms-1.5.3/mdsms.c 2006-05-14 08:26:53.000000000 +0200
3 @@ -2303,6 +2303,29 @@
4  int gotdatawait;
5  
6                                 restore="\r\nAT+CNMI=,0";
7 +                               /*
8 +                                * FIXME: Check cross-device compatibility to accept it for the trunk.
9 +                                * Guido Sohne <guido(at)sohne.net>:
10 +                                *
11 +                                * The Siemens MC35i AT reference says for AT+CNMI
12 +                                *
13 +                                * > The write command selects the procedure how the receipt of new SMS  
14 +                                * > messages from the network is indicated
15 +                                * > to the TE when TE is active, e.g. DTR signal is ON. If TE is  
16 +                                * > inactive (e.g. DTR signal is OFF), message receiving
17 +                                * > should be done as specified in GSM03.38. If the DTR signal is not  
18 +                                * > available or the state of the signal is ignored
19 +                                * > (V.25ter command AT&D0, reliable message transfer can be assured by  
20 +                                * > using AT+CNMA acknowledgment pro-
21 +                                * > cedure. The rules <mt>=2 and <mt>=3 for storing received SM are  
22 +                                * > possible only if phase 2+ compatibility is acti-
23 +                                * > vated with AT+CSMS=1. The parameter <ds>=1 is only available in  
24 +                                * > phase 2+
25 +                                *
26 +                                * The <mt>=2 rule corresponds to the second argument for AT 
27 +                                * +CNMI=<mode>,<mt> ...
28 +                                */
29 +                               devcmd(NULL,NULL,"\r\nAT+CSMS=1");
30                                 devcmd(NULL,NULL,"\r\nAT+CNMI=,2");
31                                 devcmd(NULL,NULL,"\r\nAT+CSDH=0");
32  continue_receive:
33 @@ -2344,6 +2367,29 @@
34                                                 if (i) receive_text(s);
35                                                 }
36                                         else receive_pdu(s);
37 +                                       /*
38 +                                        * FIXME: Check cross-device compatibility to accept it for the trunk.
39 +                                        * Guido Sohne <guido(at)sohne.net>:
40 +                                        *
41 +                                        * The Siemens MC35i AT reference says for AT+CNMA
42 +                                        *
43 +                                        * > The write / execute command confirms successful receipt of a new  
44 +                                        * > message (SMS-DELIVER or SMS-STATUS-
45 +                                        * > REPORT) routed directly to the TE. TA shall not send another +CMT  
46 +                                        * > or +CDS result code to TE until previous
47 +                                        * > one is acknowledged. If ME does not receive acknowledgment within  
48 +                                        * > required time (network time-out), ME sends
49 +                                        * > RP-ERROR to the network. TA shall automatically disable routing to  
50 +                                        * > TE by setting both <mt> and <ds> values
51 +                                        * > of AT+CNMI to zero.
52 +                                        *
53 +                                        * AT+CNMA=0 needs to be issued before the TA will send another result  
54 +                                        * code for a received message. Without this command, only one message  
55 +                                        * will be received, because the modem waits for AT+CNMA=0 as an  
56 +                                        * acknowledgement of the reception of the message and will not notify  
57 +                                        * us of another message until we send this acknowledgement ...
58 +                                        */
59 +                                       devcmd(NULL,NULL,"\r\nAT+CNMA=0");
60                                         } while (datawait(0));
61                                 goto retryall;
62                                 }