summaryrefslogtreecommitdiffabout
path: root/gammu
authorzautrix <zautrix>2006-02-24 19:41:06 (UTC)
committer zautrix <zautrix>2006-02-24 19:41:06 (UTC)
commit4e2553b95b2787ed7917073f6b628819b1f017c3 (patch) (unidiff)
treeda5cb746bf3373cb2a368afda082999e6c22751f /gammu
parent08605356c77351d64e14e0fdd69bdb769f933909 (diff)
downloadkdepimpi-4e2553b95b2787ed7917073f6b628819b1f017c3.zip
kdepimpi-4e2553b95b2787ed7917073f6b628819b1f017c3.tar.gz
kdepimpi-4e2553b95b2787ed7917073f6b628819b1f017c3.tar.bz2
gcc4 fixes
Diffstat (limited to 'gammu') (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/phone/alcatel/alcatel.c2
-rw-r--r--gammu/emb/gammu/depend/nokia/dct3.c2
-rw-r--r--gammu/emb/gammu/depend/nokia/dct3trac/wmx.c2
-rw-r--r--gammu/emb/gammu/depend/nokia/dct4.c2
-rw-r--r--gammu/emb/gammu/depend/siemens/dsiemens.c2
5 files changed, 5 insertions, 5 deletions
diff --git a/gammu/emb/common/phone/alcatel/alcatel.c b/gammu/emb/common/phone/alcatel/alcatel.c
index b75077f..718d91e 100644
--- a/gammu/emb/common/phone/alcatel/alcatel.c
+++ b/gammu/emb/common/phone/alcatel/alcatel.c
@@ -1,443 +1,443 @@
1/* (c) 2002-2004 by Michal Cihar */ 1/* (c) 2002-2004 by Michal Cihar */
2 2
3/* 3/*
4 * High level functions for communication with Alcatel One Touch 501 and 4 * High level functions for communication with Alcatel One Touch 501 and
5 * compatible mobile phone. 5 * compatible mobile phone.
6 * 6 *
7 * This code implements functions to communicate with Alcatel phones, 7 * This code implements functions to communicate with Alcatel phones,
8 * currently seem to work: 8 * currently seem to work:
9 * - BE5 series (501/701) 9 * - BE5 series (501/701)
10 * - BF5 series (715) 10 * - BF5 series (715)
11 * - BH4 series (535/735) 11 * - BH4 series (535/735)
12 * For some functions it uses normal AT mode (not implemented here, look at 12 * For some functions it uses normal AT mode (not implemented here, look at
13 * ../at/atgen.[ch]) for others it switches into binary mode and initialises 13 * ../at/atgen.[ch]) for others it switches into binary mode and initialises
14 * underlaying protocol (see ../../protocol/alcatel/alcabus.[ch]) and 14 * underlaying protocol (see ../../protocol/alcatel/alcabus.[ch]) and
15 * communicates over it. Don't ask me why Alcatel uses such silly thing... 15 * communicates over it. Don't ask me why Alcatel uses such silly thing...
16 * 16 *
17 * Notes for future features: 17 * Notes for future features:
18 * - max phone number length is 61 (BE5) 18 * - max phone number length is 61 (BE5)
19 * - max name length is 50 (BE5) 19 * - max name length is 50 (BE5)
20 */ 20 */
21 21
22#include "../../gsmstate.h" 22#include "../../gsmstate.h"
23 23
24#ifdef GSM_ENABLE_ALCATEL 24#ifdef GSM_ENABLE_ALCATEL
25#ifdef GSM_ENABLE_ATGEN 25#ifdef GSM_ENABLE_ATGEN
26 26
27#include <string.h> 27#include <string.h>
28#include <time.h> 28#include <time.h>
29 29
30#include "../../gsmcomon.h" 30#include "../../gsmcomon.h"
31#include "../../misc/coding/coding.h" 31#include "../../misc/coding/coding.h"
32#include "../../misc/misc.h" 32#include "../../misc/misc.h"
33#include "../../service/sms/gsmsms.h" 33#include "../../service/sms/gsmsms.h"
34#include "../pfunc.h" 34#include "../pfunc.h"
35#include "alcatel.h" 35#include "alcatel.h"
36 36
37/* Timeout for GSM_WaitFor calls. */ 37/* Timeout for GSM_WaitFor calls. */
38 #define ALCATEL_TIMEOUT 64 38 #define ALCATEL_TIMEOUT 64
39 39
40/* Some magic numbers for protocol follow */ 40/* Some magic numbers for protocol follow */
41 41
42/* synchronisation types (for everything except begin transfer): */ 42/* synchronisation types (for everything except begin transfer): */
43 #define ALCATEL_SYNC_TYPE_CALENDAR0x64 43 #define ALCATEL_SYNC_TYPE_CALENDAR0x64
44 #define ALCATEL_SYNC_TYPE_TODO 0x68 44 #define ALCATEL_SYNC_TYPE_TODO 0x68
45 #define ALCATEL_SYNC_TYPE_CONTACTS0x6C 45 #define ALCATEL_SYNC_TYPE_CONTACTS0x6C
46 46
47/* synchronisation types (for begin transfer): */ 47/* synchronisation types (for begin transfer): */
48 #define ALCATEL_BEGIN_SYNC_CALENDAR0x00 48 #define ALCATEL_BEGIN_SYNC_CALENDAR0x00
49 #define ALCATEL_BEGIN_SYNC_TODO 0x02 49 #define ALCATEL_BEGIN_SYNC_TODO 0x02
50 #define ALCATEL_BEGIN_SYNC_CONTACTS0x01 50 #define ALCATEL_BEGIN_SYNC_CONTACTS0x01
51 51
52/* category types */ 52/* category types */
53 #define ALCATEL_LIST_TODO_CAT 0x9B 53 #define ALCATEL_LIST_TODO_CAT 0x9B
54 #define ALCATEL_LIST_CONTACTS_CAT0x96 54 #define ALCATEL_LIST_CONTACTS_CAT0x96
55 55
56 56
57/* We need lot of ATGEN functions, because Alcatel is an AT device. */ 57/* We need lot of ATGEN functions, because Alcatel is an AT device. */
58 58
59extern GSM_Reply_Function ALCATELReplyFunctions[]; 59static GSM_Reply_Function ALCATELReplyFunctions[];
60extern GSM_Reply_Function ATGENReplyFunctions[]; 60extern GSM_Reply_Function ATGENReplyFunctions[];
61 61
62 extern GSM_Error ATGEN_Initialise (GSM_StateMachine *s); 62 extern GSM_Error ATGEN_Initialise (GSM_StateMachine *s);
63 extern GSM_Error ATGEN_Terminate (GSM_StateMachine *s); 63 extern GSM_Error ATGEN_Terminate (GSM_StateMachine *s);
64 extern GSM_Error ATGEN_GetIMEI (GSM_StateMachine *s); 64 extern GSM_Error ATGEN_GetIMEI (GSM_StateMachine *s);
65 extern GSM_Error ATGEN_GetFirmware (GSM_StateMachine *s); 65 extern GSM_Error ATGEN_GetFirmware (GSM_StateMachine *s);
66 extern GSM_Error ATGEN_GetModel (GSM_StateMachine *s); 66 extern GSM_Error ATGEN_GetModel (GSM_StateMachine *s);
67 extern GSM_Error ATGEN_GetDateTime (GSM_StateMachine *s, GSM_DateTime *date_time); 67 extern GSM_Error ATGEN_GetDateTime (GSM_StateMachine *s, GSM_DateTime *date_time);
68 extern GSM_Error ATGEN_GetMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry); 68 extern GSM_Error ATGEN_GetMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry);
69 extern GSM_Error ATGEN_GetNextMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry, bool start); 69 extern GSM_Error ATGEN_GetNextMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry, bool start);
70 extern GSM_Error ATGEN_SetMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry); 70 extern GSM_Error ATGEN_SetMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry);
71 extern GSM_Error ATGEN_AddMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry); 71 extern GSM_Error ATGEN_AddMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry);
72 extern GSM_Error ATGEN_DeleteMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry); 72 extern GSM_Error ATGEN_DeleteMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry);
73 extern GSM_Error ATGEN_GetMemoryStatus (GSM_StateMachine *s, GSM_MemoryStatus *Status); 73 extern GSM_Error ATGEN_GetMemoryStatus (GSM_StateMachine *s, GSM_MemoryStatus *Status);
74 extern GSM_Error ATGEN_GetSMSC (GSM_StateMachine *s, GSM_SMSC *smsc); 74 extern GSM_Error ATGEN_GetSMSC (GSM_StateMachine *s, GSM_SMSC *smsc);
75 extern GSM_Error ATGEN_SetSMSC (GSM_StateMachine *s, GSM_SMSC *smsc); 75 extern GSM_Error ATGEN_SetSMSC (GSM_StateMachine *s, GSM_SMSC *smsc);
76 extern GSM_Error ATGEN_GetSMSFolders (GSM_StateMachine *s, GSM_SMSFolders *folders); 76 extern GSM_Error ATGEN_GetSMSFolders (GSM_StateMachine *s, GSM_SMSFolders *folders);
77 extern GSM_Error ATGEN_GetSMSStatus (GSM_StateMachine *s, GSM_SMSMemoryStatus *status); 77 extern GSM_Error ATGEN_GetSMSStatus (GSM_StateMachine *s, GSM_SMSMemoryStatus *status);
78 extern GSM_Error ATGEN_GetSMS (GSM_StateMachine *s, GSM_MultiSMSMessage *sms); 78 extern GSM_Error ATGEN_GetSMS (GSM_StateMachine *s, GSM_MultiSMSMessage *sms);
79 extern GSM_Error ATGEN_GetNextSMS (GSM_StateMachine *s, GSM_MultiSMSMessage *sms, bool start); 79 extern GSM_Error ATGEN_GetNextSMS (GSM_StateMachine *s, GSM_MultiSMSMessage *sms, bool start);
80 extern GSM_Error ATGEN_SendSavedSMS (GSM_StateMachine *s, int Folder, int Location); 80 extern GSM_Error ATGEN_SendSavedSMS (GSM_StateMachine *s, int Folder, int Location);
81 extern GSM_Error ATGEN_SendSMS (GSM_StateMachine *s, GSM_SMSMessage *sms); 81 extern GSM_Error ATGEN_SendSMS (GSM_StateMachine *s, GSM_SMSMessage *sms);
82 extern GSM_Error ATGEN_DeleteSMS (GSM_StateMachine *s, GSM_SMSMessage *sms); 82 extern GSM_Error ATGEN_DeleteSMS (GSM_StateMachine *s, GSM_SMSMessage *sms);
83 extern GSM_Error ATGEN_AddSMS (GSM_StateMachine *s, GSM_SMSMessage *sms); 83 extern GSM_Error ATGEN_AddSMS (GSM_StateMachine *s, GSM_SMSMessage *sms);
84 extern GSM_Error ATGEN_GetBatteryCharge (GSM_StateMachine *s, GSM_BatteryCharge *bat); 84 extern GSM_Error ATGEN_GetBatteryCharge (GSM_StateMachine *s, GSM_BatteryCharge *bat);
85 extern GSM_Error ATGEN_GetSignalQuality (GSM_StateMachine *s, GSM_SignalQuality *sig); 85 extern GSM_Error ATGEN_GetSignalQuality (GSM_StateMachine *s, GSM_SignalQuality *sig);
86 extern GSM_Error ATGEN_DialVoice (GSM_StateMachine *s, char *number, GSM_CallShowNumber ShowNumber); 86 extern GSM_Error ATGEN_DialVoice (GSM_StateMachine *s, char *number, GSM_CallShowNumber ShowNumber);
87 extern GSM_Error ATGEN_AnswerCall (GSM_StateMachine *s, int ID, bool all); 87 extern GSM_Error ATGEN_AnswerCall (GSM_StateMachine *s, int ID, bool all);
88 extern GSM_Error ATGEN_CancelCall (GSM_StateMachine *s, int ID, bool all); 88 extern GSM_Error ATGEN_CancelCall (GSM_StateMachine *s, int ID, bool all);
89 extern GSM_Error ATGEN_SetDateTime (GSM_StateMachine *s, GSM_DateTime *date_time); 89 extern GSM_Error ATGEN_SetDateTime (GSM_StateMachine *s, GSM_DateTime *date_time);
90 extern GSM_Error ATGEN_EnterSecurityCode(GSM_StateMachine *s, GSM_SecurityCode Code); 90 extern GSM_Error ATGEN_EnterSecurityCode(GSM_StateMachine *s, GSM_SecurityCode Code);
91 extern GSM_Error ATGEN_GetSecurityStatus(GSM_StateMachine *s, GSM_SecurityCodeType *Status); 91 extern GSM_Error ATGEN_GetSecurityStatus(GSM_StateMachine *s, GSM_SecurityCodeType *Status);
92 extern GSM_Error ATGEN_ResetPhoneSettings(GSM_StateMachine *s, GSM_ResetSettingsType Type); 92 extern GSM_Error ATGEN_ResetPhoneSettings(GSM_StateMachine *s, GSM_ResetSettingsType Type);
93 extern GSM_Error ATGEN_SendDTMF (GSM_StateMachine *s, char *sequence); 93 extern GSM_Error ATGEN_SendDTMF (GSM_StateMachine *s, char *sequence);
94 extern GSM_Error ATGEN_GetSIMIMSI (GSM_StateMachine *s, char *IMSI); 94 extern GSM_Error ATGEN_GetSIMIMSI (GSM_StateMachine *s, char *IMSI);
95 extern GSM_Error ATGEN_HandleCMSError (GSM_StateMachine *s); 95 extern GSM_Error ATGEN_HandleCMSError (GSM_StateMachine *s);
96 extern GSM_Error ATGEN_GetNetworkInfo (GSM_StateMachine *s, GSM_NetworkInfo *netinfo); 96 extern GSM_Error ATGEN_GetNetworkInfo (GSM_StateMachine *s, GSM_NetworkInfo *netinfo);
97 extern GSM_Error ATGEN_Reset (GSM_StateMachine *s, bool hard); 97 extern GSM_Error ATGEN_Reset (GSM_StateMachine *s, bool hard);
98 extern GSM_Error ATGEN_PressKey (GSM_StateMachine *s, GSM_KeyCode Key, bool Press); 98 extern GSM_Error ATGEN_PressKey (GSM_StateMachine *s, GSM_KeyCode Key, bool Press);
99 extern GSM_Error ATGEN_GetDisplayStatus (GSM_StateMachine *s, GSM_DisplayFeatures *features); 99 extern GSM_Error ATGEN_GetDisplayStatus (GSM_StateMachine *s, GSM_DisplayFeatures *features);
100 extern GSM_Error ATGEN_SetAutoNetworkLogin(GSM_StateMachine *s); 100 extern GSM_Error ATGEN_SetAutoNetworkLogin(GSM_StateMachine *s);
101 extern GSM_Error ATGEN_DeleteAllMemory (GSM_StateMachine *s, GSM_MemoryType type); 101 extern GSM_Error ATGEN_DeleteAllMemory (GSM_StateMachine *s, GSM_MemoryType type);
102 102
103 extern GSM_Error ATGEN_DispatchMessage (GSM_StateMachine *s); 103 extern GSM_Error ATGEN_DispatchMessage (GSM_StateMachine *s);
104 extern GSM_Error ATGEN_SetFastSMSSending(GSM_StateMachine *s, bool enable); 104 extern GSM_Error ATGEN_SetFastSMSSending(GSM_StateMachine *s, bool enable);
105 extern GSM_Error ATGEN_SetIncomingCB (GSM_StateMachine *s, bool enable); 105 extern GSM_Error ATGEN_SetIncomingCB (GSM_StateMachine *s, bool enable);
106 extern GSM_Error ATGEN_SetIncomingSMS (GSM_StateMachine *s, bool enable); 106 extern GSM_Error ATGEN_SetIncomingSMS (GSM_StateMachine *s, bool enable);
107 107
108/** 108/**
109 * Alcatel uses some 8-bit characters in contacts, calendar etc.. This table 109 * Alcatel uses some 8-bit characters in contacts, calendar etc.. This table
110 * attempts to decode it, it is probably not complete, here are just chars 110 * attempts to decode it, it is probably not complete, here are just chars
111 * that I found... 111 * that I found...
112 */ 112 */
113unsigned char GSM_AlcatelAlphabet[] = 113unsigned char GSM_AlcatelAlphabet[] =
114{ 114{
115 /* in phone unicode description*/ 115 /* in phone unicode description*/
116 0x80, 0x00,0x20, /* empty */ 116 0x80, 0x00,0x20, /* empty */
117 0x81, 0x00,0x20, /* empty*/ 117 0x81, 0x00,0x20, /* empty*/
118 0x82, 0x00,0x20, /* empty*/ 118 0x82, 0x00,0x20, /* empty*/
119 0x83, 0x00,0x20, /* empty*/ 119 0x83, 0x00,0x20, /* empty*/
120 120
121 0x84, 0x00,0xe7, /* c cedilla*/ 121 0x84, 0x00,0xe7, /* c cedilla*/
122 0x85, 0x20,0x26, /* ... */ 122 0x85, 0x20,0x26, /* ... */
123 0x86, 0x03,0xc0, /* pi */ 123 0x86, 0x03,0xc0, /* pi */
124 0x87, 0x01,0x3e, /* l caron*/ 124 0x87, 0x01,0x3e, /* l caron*/
125 0x88, 0x00,0xc0, /* A grave*/ 125 0x88, 0x00,0xc0, /* A grave*/
126 0x89, 0x00,0xc1, /* A acute*/ 126 0x89, 0x00,0xc1, /* A acute*/
127 0x8a, 0x00,0xc2, /* A circumflex*/ 127 0x8a, 0x00,0xc2, /* A circumflex*/
128 0x8b, 0x00,0xc3, /* A tilde*/ 128 0x8b, 0x00,0xc3, /* A tilde*/
129 0x8c, 0x00,0xc8, /* E grave*/ 129 0x8c, 0x00,0xc8, /* E grave*/
130 0x8d, 0x00,0xca, /* E circumflex*/ 130 0x8d, 0x00,0xca, /* E circumflex*/
131 0x8e, 0x00,0xcb, /* E diaresis*/ 131 0x8e, 0x00,0xcb, /* E diaresis*/
132 0x8f, 0x00,0xcc, /* I grave*/ 132 0x8f, 0x00,0xcc, /* I grave*/
133 0x90, 0x00,0xcd, /* I acute*/ 133 0x90, 0x00,0xcd, /* I acute*/
134 0x91, 0x00,0xd0, /* ETH */ 134 0x91, 0x00,0xd0, /* ETH */
135 0x92, 0x00,0xd2, /* O grave*/ 135 0x92, 0x00,0xd2, /* O grave*/
136 0x93, 0x00,0xd3, /* O acute*/ 136 0x93, 0x00,0xd3, /* O acute*/
137 0x94, 0x00,0xd4, /* O circumflex*/ 137 0x94, 0x00,0xd4, /* O circumflex*/
138 0x95, 0x00,0xd5, /* O tilde*/ 138 0x95, 0x00,0xd5, /* O tilde*/
139 0x96, 0x00,0xd9, /* U grave*/ 139 0x96, 0x00,0xd9, /* U grave*/
140 0x97, 0x00,0xda, /* U acute*/ 140 0x97, 0x00,0xda, /* U acute*/
141 0x98, 0x00,0xe1, /* a acute*/ 141 0x98, 0x00,0xe1, /* a acute*/
142 0x99, 0x00,0xe2, /* a circumflex*/ 142 0x99, 0x00,0xe2, /* a circumflex*/
143 0x9a, 0x00,0xe3, /* a tilde*/ 143 0x9a, 0x00,0xe3, /* a tilde*/
144 0x9b, 0x00,0xea, /* e circumflex*/ 144 0x9b, 0x00,0xea, /* e circumflex*/
145 0x9c, 0x00,0xeb, /* e diaresis*/ 145 0x9c, 0x00,0xeb, /* e diaresis*/
146 0x9d, 0x00,0xed, /* i acute*/ 146 0x9d, 0x00,0xed, /* i acute*/
147 0x9e, 0x00,0xee, /* i circumflex*/ 147 0x9e, 0x00,0xee, /* i circumflex*/
148 0x9f, 0x00,0xef, /* i diaresis*/ 148 0x9f, 0x00,0xef, /* i diaresis*/
149 0xa0, 0x00,0xf3, /* o acute*/ 149 0xa0, 0x00,0xf3, /* o acute*/
150 0xa1, 0x00,0xf4, /* o circumflex*/ 150 0xa1, 0x00,0xf4, /* o circumflex*/
151 0xa2, 0x00,0xf5, /* o tilde*/ 151 0xa2, 0x00,0xf5, /* o tilde*/
152 0xa3, 0x00,0xfa, /* u acute*/ 152 0xa3, 0x00,0xfa, /* u acute*/
153 0xa4, 0x00,0xa2, /* cent */ 153 0xa4, 0x00,0xa2, /* cent */
154 0xa5, 0x00,0x5b, /* [ */ 154 0xa5, 0x00,0x5b, /* [ */
155 0xa6, 0x01,0x59, /* r caron*/ 155 0xa6, 0x01,0x59, /* r caron*/
156 0xa7, 0x01,0x0d, /* c caron*/ 156 0xa7, 0x01,0x0d, /* c caron*/
157 0xa8, 0x01,0x61, /* s caron*/ 157 0xa8, 0x01,0x61, /* s caron*/
158 0xa9, 0x01,0x1b, /* e caron*/ 158 0xa9, 0x01,0x1b, /* e caron*/
159 0xaa, 0x01,0x6f, /* u ring*/ 159 0xaa, 0x01,0x6f, /* u ring*/
160 0xab, 0x00,0xfd, /* y acute*/ 160 0xab, 0x00,0xfd, /* y acute*/
161 0xac, 0x00,0xf0, /* eth */ 161 0xac, 0x00,0xf0, /* eth */
162 0xad, 0x01,0x07, /* c acute*/ 162 0xad, 0x01,0x07, /* c acute*/
163 0xae, 0x01,0x19, /* e ogonek*/ 163 0xae, 0x01,0x19, /* e ogonek*/
164 0xaf, 0x01,0x05, /* a ogonek*/ 164 0xaf, 0x01,0x05, /* a ogonek*/
165 0xb0, 0x01,0x7c, /* z dot*/ 165 0xb0, 0x01,0x7c, /* z dot*/
166 0xb1, 0x01,0x7a, /* z acute*/ 166 0xb1, 0x01,0x7a, /* z acute*/
167 0xb2, 0x01,0x5b, /* s acute*/ 167 0xb2, 0x01,0x5b, /* s acute*/
168 0xb3, 0x01,0x44, /* n acute*/ 168 0xb3, 0x01,0x44, /* n acute*/
169 0xb4, 0x01,0x42, /* l stroke*/ 169 0xb4, 0x01,0x42, /* l stroke*/
170 170
171 0xb5, 0x00,0x20, /* empty*/ 171 0xb5, 0x00,0x20, /* empty*/
172 172
173 0xb6, 0x01,0x48, /* n caron*/ 173 0xb6, 0x01,0x48, /* n caron*/
174 0xb7, 0x01,0x65, /* t caron*/ 174 0xb7, 0x01,0x65, /* t caron*/
175 175
176 0xb8, 0x00,0x20, /* empty*/ 176 0xb8, 0x00,0x20, /* empty*/
177 177
178 0xb9, 0x01,0x7e, /* z caron*/ 178 0xb9, 0x01,0x7e, /* z caron*/
179 0xba, 0x01,0xe7, /* g caron*/ 179 0xba, 0x01,0xe7, /* g caron*/
180 180
181 0xbb, 0x00,0x20, /* empty*/ 181 0xbb, 0x00,0x20, /* empty*/
182 0xbc, 0x00,0x20, /* empty*/ 182 0xbc, 0x00,0x20, /* empty*/
183 183
184 0xbd, 0x1e,0x20, /* G macron*/ 184 0xbd, 0x1e,0x20, /* G macron*/
185 0xbe, 0x1e,0x21, /* g macron*/ 185 0xbe, 0x1e,0x21, /* g macron*/
186 0xbf, 0x01,0x5e, /* S cedilla*/ 186 0xbf, 0x01,0x5e, /* S cedilla*/
187 0xc0, 0x01,0x5f, /* s cedilla*/ 187 0xc0, 0x01,0x5f, /* s cedilla*/
188 0xc1, 0x01,0x2f, /* i ogonek*/ /* FIXME: not sure with this, it look like normal i */ 188 0xc1, 0x01,0x2f, /* i ogonek*/ /* FIXME: not sure with this, it look like normal i */
189 0xc2, 0x01,0x31, /* i dotless*/ 189 0xc2, 0x01,0x31, /* i dotless*/
190 0xc3, 0x01,0x68, /* U tilde*/ 190 0xc3, 0x01,0x68, /* U tilde*/
191 0xc4, 0x01,0x50, /* O dbl acute*/ 191 0xc4, 0x01,0x50, /* O dbl acute*/
192 0xc5, 0x01,0x69, /* u tilde*/ 192 0xc5, 0x01,0x69, /* u tilde*/
193 0xc6, 0x01,0x51, /* o dbl acute*/ 193 0xc6, 0x01,0x51, /* o dbl acute*/
194 0xc7, 0x27,0xa9, /* => */ 194 0xc7, 0x27,0xa9, /* => */
195 0xc8, 0x27,0xa8, /* filled =>*/ 195 0xc8, 0x27,0xa8, /* filled =>*/
196 0xc9, 0x00,0xd7, /* x */ 196 0xc9, 0x00,0xd7, /* x */
197 0xca, 0x00,0x5d, /* ] */ 197 0xca, 0x00,0x5d, /* ] */
198 0xcb, 0x26,0x0f, /* phone*/ 198 0xcb, 0x26,0x0f, /* phone*/
199 0xcc, 0x01,0x0f, /* d caron*/ 199 0xcc, 0x01,0x0f, /* d caron*/
200 200
201 0xcd, 0x00,0x20, /* empty*/ 201 0xcd, 0x00,0x20, /* empty*/
202 202
203 0xce, 0x00,0x7e, /* ~ */ 203 0xce, 0x00,0x7e, /* ~ */
204 0xcf, 0x00,0x5c, /* \ */ 204 0xcf, 0x00,0x5c, /* \ */
205 0xd0, 0x00,0x5e, /* ^ */ 205 0xd0, 0x00,0x5e, /* ^ */
206 206
207 0xd1, 0x00,0x20, /* empty*/ 207 0xd1, 0x00,0x20, /* empty*/
208 208
209 0xd2, 0x00,0x7b, /* { */ 209 0xd2, 0x00,0x7b, /* { */
210 0xd3, 0x00,0x7c, /* | */ 210 0xd3, 0x00,0x7c, /* | */
211 0xd4, 0x00,0x7d, /* } */ 211 0xd4, 0x00,0x7d, /* } */
212 212
213 0xd5, 0x00,0x20, /* empty*/ 213 0xd5, 0x00,0x20, /* empty*/
214 214
215 0xd6, 0x01,0x63, /* t cedilla*/ 215 0xd6, 0x01,0x63, /* t cedilla*/
216 216
217 0xd7, 0x00,0x20, /* empty*/ 217 0xd7, 0x00,0x20, /* empty*/
218 0xd8, 0x00,0x20, /* empty*/ 218 0xd8, 0x00,0x20, /* empty*/
219 0xd9, 0x00,0x20, /* empty*/ 219 0xd9, 0x00,0x20, /* empty*/
220 0xda, 0x00,0x20, /* empty*/ 220 0xda, 0x00,0x20, /* empty*/
221 0xdb, 0x00,0x20, /* empty*/ 221 0xdb, 0x00,0x20, /* empty*/
222 0xdc, 0x00,0x20, /* empty*/ 222 0xdc, 0x00,0x20, /* empty*/
223 0xdd, 0x00,0x20, /* empty*/ 223 0xdd, 0x00,0x20, /* empty*/
224 0xde, 0x00,0x20, /* empty*/ 224 0xde, 0x00,0x20, /* empty*/
225 0xdf, 0x00,0x20, /* empty*/ 225 0xdf, 0x00,0x20, /* empty*/
226 0xe0, 0x00,0x20, /* empty*/ 226 0xe0, 0x00,0x20, /* empty*/
227 227
228 0xe1, 0x00,0x20, /* two candles*/ /* FIXME */ 228 0xe1, 0x00,0x20, /* two candles*/ /* FIXME */
229 229
230 0xe2, 0x00,0x20, /* empty*/ 230 0xe2, 0x00,0x20, /* empty*/
231 0xe3, 0x00,0x20, /* empty*/ 231 0xe3, 0x00,0x20, /* empty*/
232 0xe4, 0x00,0x20, /* empty*/ 232 0xe4, 0x00,0x20, /* empty*/
233 233
234 0xe5, 0x01,0xce, /* a caron*/ 234 0xe5, 0x01,0xce, /* a caron*/
235 0xe6, 0x01,0x01, /* a macron*/ 235 0xe6, 0x01,0x01, /* a macron*/
236 0xe7, 0x01,0x13, /* e macron*/ 236 0xe7, 0x01,0x13, /* e macron*/
237 0xe8, 0x01,0x2b, /* i macron*/ 237 0xe8, 0x01,0x2b, /* i macron*/
238 0xe9, 0x01,0x4d, /* o macron*/ 238 0xe9, 0x01,0x4d, /* o macron*/
239 0xea, 0x01,0x6b, /* u macron*/ 239 0xea, 0x01,0x6b, /* u macron*/
240 0xeb, 0x00,0x41, /* A */ 240 0xeb, 0x00,0x41, /* A */
241 0xec, 0x00,0x40, /* @ */ 241 0xec, 0x00,0x40, /* @ */
242 0xed, 0x00,0x20,/* some strange char :-) */ /* FIXME */ 242 0xed, 0x00,0x20,/* some strange char :-) */ /* FIXME */
243 243
244 0xee, 0x00,0x20, /* big key stroken*/ /* FIXME */ 244 0xee, 0x00,0x20, /* big key stroken*/ /* FIXME */
245 0xef, 0x00,0x20, /* big key*/ /* FIXME */ 245 0xef, 0x00,0x20, /* big key*/ /* FIXME */
246 246
247 0xf0, 0x00,0x20, /* empty*/ 247 0xf0, 0x00,0x20, /* empty*/
248 248
249 0xf1, 0x00,0x31, /* 1 */ 249 0xf1, 0x00,0x31, /* 1 */
250 0xf2, 0x00,0x21, /* bold !*/ 250 0xf2, 0x00,0x21, /* bold !*/
251 0xf3, 0x26,0x0e, /* black phone*/ 251 0xf3, 0x26,0x0e, /* black phone*/
252 0xf4, 0x00,0x26, /* & */ 252 0xf4, 0x00,0x26, /* & */
253 0xf5, 0x23,0x7e, /* bell */ 253 0xf5, 0x23,0x7e, /* bell */
254 0xf6, 0x26,0x6a, /* note */ 254 0xf6, 0x26,0x6a, /* note */
255 255
256 0xf7, 0x27,0x13, /* okay inv*/ /* FIXME */ 256 0xf7, 0x27,0x13, /* okay inv*/ /* FIXME */
257 0xf8, 0x27,0x13, /* okay */ 257 0xf8, 0x27,0x13, /* okay */
258 258
259 0xf9, 0x00,0x20, /* empty*/ 259 0xf9, 0x00,0x20, /* empty*/
260 260
261 0xfa, 0x00,0x20, /* key */ /* FIXME */ 261 0xfa, 0x00,0x20, /* key */ /* FIXME */
262 262
263 0xfb, 0x00,0x20, /* empty*/ 263 0xfb, 0x00,0x20, /* empty*/
264 264
265 0xfc, 0x20,0xac, /* Euro */ 265 0xfc, 0x20,0xac, /* Euro */
266 0xfd, 0x21,0x97, /* NE arrow*/ 266 0xfd, 0x21,0x97, /* NE arrow*/
267 0xfe, 0x21,0x98, /* SE arrow*/ 267 0xfe, 0x21,0x98, /* SE arrow*/
268 268
269 0xff, 0x00,0x20, /* empty*/ 269 0xff, 0x00,0x20, /* empty*/
270 270
271 0x00, 0x00,0x00 271 0x00, 0x00,0x00
272}; 272};
273 273
274/* This is being called from atgen */ 274/* This is being called from atgen */
275 GSM_Error ALCATEL_ProtocolVersionReply(GSM_Protocol_Message msg, GSM_StateMachine *s) 275 GSM_Error ALCATEL_ProtocolVersionReply(GSM_Protocol_Message msg, GSM_StateMachine *s)
276{ 276{
277 char *str, *str2; 277 char *str, *str2;
278/* 278/*
279 * Reply received here looks like: 279 * Reply received here looks like:
280 * 1 "AT+CPROT=?" 280 * 1 "AT+CPROT=?"
281 * 2 "+CPROT: 0,"V1.0",1" 281 * 2 "+CPROT: 0,"V1.0",1"
282 * 3 "+CPROT: 16,"V1.1",16" 282 * 3 "+CPROT: 16,"V1.1",16"
283 * 4 "OK" 283 * 4 "OK"
284 */ 284 */
285 switch (s->Phone.Data.Priv.ATGEN.ReplyState) { 285 switch (s->Phone.Data.Priv.ATGEN.ReplyState) {
286 case AT_Reply_OK: 286 case AT_Reply_OK:
287 str = strstr(msg.Buffer, "\"V"); 287 str = strstr(msg.Buffer, "\"V");
288 if (str == NULL) return ERR_UNKNOWNRESPONSE; 288 if (str == NULL) return ERR_UNKNOWNRESPONSE;
289 str += 2; 289 str += 2;
290 while((str2 = strstr(str, "\"V")) != NULL) str = str2 + 2; 290 while((str2 = strstr(str, "\"V")) != NULL) str = str2 + 2;
291 if (strncmp(str, "1.0", 3) == 0) { 291 if (strncmp(str, "1.0", 3) == 0) {
292 s->Phone.Data.Priv.ALCATEL.ProtocolVersion = V_1_0; 292 s->Phone.Data.Priv.ALCATEL.ProtocolVersion = V_1_0;
293 } else if (strncmp(str, "1.1", 3) == 0) { 293 } else if (strncmp(str, "1.1", 3) == 0) {
294 s->Phone.Data.Priv.ALCATEL.ProtocolVersion = V_1_1; 294 s->Phone.Data.Priv.ALCATEL.ProtocolVersion = V_1_1;
295 } else { 295 } else {
296 smprintf(s, "Unknown protocol version. Please send debug log and phone info to author.\n"); 296 smprintf(s, "Unknown protocol version. Please send debug log and phone info to author.\n");
297 return ERR_NOTIMPLEMENTED; 297 return ERR_NOTIMPLEMENTED;
298 } 298 }
299 return ERR_NONE; 299 return ERR_NONE;
300 case AT_Reply_Error: 300 case AT_Reply_Error:
301 case AT_Reply_CMSError: 301 case AT_Reply_CMSError:
302 return ATGEN_HandleCMSError(s); 302 return ATGEN_HandleCMSError(s);
303 default: 303 default:
304 return ERR_UNKNOWNRESPONSE; 304 return ERR_UNKNOWNRESPONSE;
305 } 305 }
306} 306}
307 307
308static GSM_Error ALCATEL_SetBinaryMode(GSM_StateMachine *s) 308static GSM_Error ALCATEL_SetBinaryMode(GSM_StateMachine *s)
309{ 309{
310 GSM_Phone_ALCATELData*Priv = &s->Phone.Data.Priv.ALCATEL; 310 GSM_Phone_ALCATELData*Priv = &s->Phone.Data.Priv.ALCATEL;
311 GSM_Error error; 311 GSM_Error error;
312 312
313 if (Priv->Mode == ModeBinary) return ERR_NONE; 313 if (Priv->Mode == ModeBinary) return ERR_NONE;
314 314
315 dbgprintf ("Changing to binary mode\n"); 315 dbgprintf ("Changing to binary mode\n");
316 316
317 error=GSM_WaitFor (s, "AT+IFC=2,2\r", 11, 0x02, 4, ID_SetFlowControl); 317 error=GSM_WaitFor (s, "AT+IFC=2,2\r", 11, 0x02, 4, ID_SetFlowControl);
318 if (error != ERR_NONE) return error; 318 if (error != ERR_NONE) return error;
319 319
320 error=GSM_WaitFor (s, "AT+CPROT=?\r", 11, 0x02, 4, ID_AlcatelProtocol); 320 error=GSM_WaitFor (s, "AT+CPROT=?\r", 11, 0x02, 4, ID_AlcatelProtocol);
321 if (error != ERR_NONE) return error; 321 if (error != ERR_NONE) return error;
322 322
323 if (Priv->ProtocolVersion == V_1_0) { 323 if (Priv->ProtocolVersion == V_1_0) {
324 error=GSM_WaitFor (s, "AT+CPROT=16,\"V1.0\",16\r", 22, 0x00, 4, ID_AlcatelConnect); 324 error=GSM_WaitFor (s, "AT+CPROT=16,\"V1.0\",16\r", 22, 0x00, 4, ID_AlcatelConnect);
325 } else { 325 } else {
326 error=GSM_WaitFor (s, "AT+CPROT=16,\"V1.1\",16\r", 22, 0x00, 4, ID_AlcatelConnect); 326 error=GSM_WaitFor (s, "AT+CPROT=16,\"V1.1\",16\r", 22, 0x00, 4, ID_AlcatelConnect);
327 } 327 }
328 328
329 if (error == ERR_TIMEOUT && s->Speed != 19200) { 329 if (error == ERR_TIMEOUT && s->Speed != 19200) {
330 smprintf(s, "HINT: Try changing speed to 19200, it is sometimes needed for Alcatel binary mode.\n"); 330 smprintf(s, "HINT: Try changing speed to 19200, it is sometimes needed for Alcatel binary mode.\n");
331 } 331 }
332 332
333 if (error != ERR_NONE) return error; 333 if (error != ERR_NONE) return error;
334 334
335 dbgprintf ("Changing protocol to Alcabus\n"); 335 dbgprintf ("Changing protocol to Alcabus\n");
336 336
337 s->Protocol.Functions = &ALCABUSProtocol; 337 s->Protocol.Functions = &ALCABUSProtocol;
338 error = s->Protocol.Functions->Initialise(s); 338 error = s->Protocol.Functions->Initialise(s);
339 if (error != ERR_NONE) { 339 if (error != ERR_NONE) {
340 s->Protocol.Functions = &ATProtocol; 340 s->Protocol.Functions = &ATProtocol;
341 return error; 341 return error;
342 } 342 }
343 s->Phone.Functions->ReplyFunctions= ALCATELReplyFunctions; 343 s->Phone.Functions->ReplyFunctions= ALCATELReplyFunctions;
344 Priv->Mode = ModeBinary; 344 Priv->Mode = ModeBinary;
345 Priv->BinaryItem = 0; 345 Priv->BinaryItem = 0;
346 Priv->BinaryType = 0; 346 Priv->BinaryType = 0;
347 Priv->BinaryState = StateAttached; 347 Priv->BinaryState = StateAttached;
348 return ERR_NONE; 348 return ERR_NONE;
349} 349}
350 350
351static GSM_Error ALCATEL_GoToBinaryState(GSM_StateMachine *s, GSM_Alcatel_BinaryState state, GSM_Alcatel_BinaryType type, int item) { 351static GSM_Error ALCATEL_GoToBinaryState(GSM_StateMachine *s, GSM_Alcatel_BinaryState state, GSM_Alcatel_BinaryType type, int item) {
352 GSM_Phone_ALCATELData*Priv = &s->Phone.Data.Priv.ALCATEL; 352 GSM_Phone_ALCATELData*Priv = &s->Phone.Data.Priv.ALCATEL;
353 GSM_Error error; 353 GSM_Error error;
354 unsigned char attach_buffer[] = {0x00, 0x00, 0x7C ,0x20}; 354 unsigned char attach_buffer[] = {0x00, 0x00, 0x7C ,0x20};
355 unsigned char detach_buffer[] = {0x00, 0x01, 0x7C ,0x00}; 355 unsigned char detach_buffer[] = {0x00, 0x01, 0x7C ,0x00};
356 unsigned char start_buffer[] = 356 unsigned char start_buffer[] =
357 {0x00, 0x04, 0x7C, 0x80, /* 4 byte database id follows */ 357 {0x00, 0x04, 0x7C, 0x80, /* 4 byte database id follows */
358 0x12, 0x34, 0x56, 0x78}; 358 0x12, 0x34, 0x56, 0x78};
359 unsigned char end_buffer[] = 359 unsigned char end_buffer[] =
360 {0x00, 0x04, 0x7C, 0x82, 360 {0x00, 0x04, 0x7C, 0x82,
361 0x00, /* type */ 361 0x00, /* type */
362 0x00, 0x00, 0x00, 0x00}; /* TimeStamp */ 362 0x00, 0x00, 0x00, 0x00}; /* TimeStamp */
363 unsigned char close_buffer[] = 363 unsigned char close_buffer[] =
364 {0x00, 0x04, 364 {0x00, 0x04,
365 0x00, /*type */ 365 0x00, /*type */
366 0x23, 0x01}; 366 0x23, 0x01};
367 unsigned char select1_buffer[] = 367 unsigned char select1_buffer[] =
368 {0x00, 0x00, 368 {0x00, 0x00,
369 0x00, /*type */ 369 0x00, /*type */
370 0x20}; 370 0x20};
371 unsigned char select2_buffer[] = 371 unsigned char select2_buffer[] =
372 {0x00, 0x04, 372 {0x00, 0x04,
373 0x00, /*type */ 373 0x00, /*type */
374 0x22, 0x01, 0x00}; 374 0x22, 0x01, 0x00};
375 unsigned char begin_buffer[] = 375 unsigned char begin_buffer[] =
376 {0x00, 0x04, 0x7C, 0x81, 376 {0x00, 0x04, 0x7C, 0x81,
377 0x00, /*type */ 377 0x00, /*type */
378 0x00, 0x85, 0x00}; 378 0x00, 0x85, 0x00};
379 unsigned char commit_buffer[] = 379 unsigned char commit_buffer[] =
380 {0x00, 0x04, 380 {0x00, 0x04,
381 0x00, /*type */ 381 0x00, /*type */
382 0x20, 0x01}; 382 0x20, 0x01};
383 383
384 smprintf(s, "Alcatel state switcher: %d -> %d, %d -> %d, %d -> %d\n", Priv->BinaryState, state, Priv->BinaryType, type, Priv->BinaryItem, item); 384 smprintf(s, "Alcatel state switcher: %d -> %d, %d -> %d, %d -> %d\n", Priv->BinaryState, state, Priv->BinaryType, type, Priv->BinaryItem, item);
385 error = ALCATEL_SetBinaryMode(s); 385 error = ALCATEL_SetBinaryMode(s);
386 if (error != ERR_NONE) return error; 386 if (error != ERR_NONE) return error;
387 387
388 /* Do we need to do anything? */ 388 /* Do we need to do anything? */
389 if ((state == Priv->BinaryState) && (type == Priv->BinaryType) && (item == Priv->BinaryItem)) return ERR_NONE; 389 if ((state == Priv->BinaryState) && (type == Priv->BinaryType) && (item == Priv->BinaryItem)) return ERR_NONE;
390 390
391 /* We're editing, but the next state is not the same. so commit editing */ 391 /* We're editing, but the next state is not the same. so commit editing */
392 if (Priv->BinaryState == StateEdit) { 392 if (Priv->BinaryState == StateEdit) {
393 /* Something has changed, we will have to reread fields! */ 393 /* Something has changed, we will have to reread fields! */
394 Priv->CurrentFieldsItem = -1; 394 Priv->CurrentFieldsItem = -1;
395 switch (Priv->BinaryType) { 395 switch (Priv->BinaryType) {
396 case TypeCalendar: 396 case TypeCalendar:
397 commit_buffer[2] = ALCATEL_SYNC_TYPE_CALENDAR; 397 commit_buffer[2] = ALCATEL_SYNC_TYPE_CALENDAR;
398 break; 398 break;
399 case TypeContacts: 399 case TypeContacts:
400 commit_buffer[2] = ALCATEL_SYNC_TYPE_CONTACTS; 400 commit_buffer[2] = ALCATEL_SYNC_TYPE_CONTACTS;
401 break; 401 break;
402 case TypeToDo: 402 case TypeToDo:
403 commit_buffer[2] = ALCATEL_SYNC_TYPE_TODO; 403 commit_buffer[2] = ALCATEL_SYNC_TYPE_TODO;
404 break; 404 break;
405 } 405 }
406 dbgprintf ("Commiting edited record\n"); 406 dbgprintf ("Commiting edited record\n");
407 error=GSM_WaitFor (s, commit_buffer, 5, 0x02, ALCATEL_TIMEOUT, ID_AlcatelCommit); 407 error=GSM_WaitFor (s, commit_buffer, 5, 0x02, ALCATEL_TIMEOUT, ID_AlcatelCommit);
408 if (error != ERR_NONE) return error; 408 if (error != ERR_NONE) return error;
409 error=GSM_WaitFor (s, 0, 0, 0x00, ALCATEL_TIMEOUT, ID_AlcatelCommit2); 409 error=GSM_WaitFor (s, 0, 0, 0x00, ALCATEL_TIMEOUT, ID_AlcatelCommit2);
410 if (error != ERR_NONE) return error; 410 if (error != ERR_NONE) return error;
411 Priv->BinaryState = StateSession; 411 Priv->BinaryState = StateSession;
412 Priv->BinaryItem = 0; 412 Priv->BinaryItem = 0;
413 } 413 }
414 414
415 /* Do we want to edit something of same type? */ 415 /* Do we want to edit something of same type? */
416 if ((state == StateEdit) && (type == Priv->BinaryType)) { 416 if ((state == StateEdit) && (type == Priv->BinaryType)) {
417 /* Edit state doesn't need any switching, it is needed only for 417 /* Edit state doesn't need any switching, it is needed only for
418 * indication that e have to commit record before we switch to other 418 * indication that e have to commit record before we switch to other
419 * mode. 419 * mode.
420 */ 420 */
421 Priv->BinaryState = StateEdit; 421 Priv->BinaryState = StateEdit;
422 Priv->BinaryItem = item; 422 Priv->BinaryItem = item;
423 return ERR_NONE; 423 return ERR_NONE;
424 } 424 }
425 425
426 /* Now we can be only in Attached or Session state, so if states and types matches, just keep them as they are */ 426 /* Now we can be only in Attached or Session state, so if states and types matches, just keep them as they are */
427 if ((state == Priv->BinaryState) && (type == Priv->BinaryType)) { 427 if ((state == Priv->BinaryState) && (type == Priv->BinaryType)) {
428 return ERR_NONE; 428 return ERR_NONE;
429 } 429 }
430 430
431 /* Do we need to close session? */ 431 /* Do we need to close session? */
432 if (Priv->BinaryState == StateSession) { 432 if (Priv->BinaryState == StateSession) {
433 dbgprintf ("Ending session\n"); 433 dbgprintf ("Ending session\n");
434 switch (Priv->BinaryType) { 434 switch (Priv->BinaryType) {
435 case TypeCalendar: 435 case TypeCalendar:
436 end_buffer[4] = ALCATEL_BEGIN_SYNC_CALENDAR; 436 end_buffer[4] = ALCATEL_BEGIN_SYNC_CALENDAR;
437 break; 437 break;
438 case TypeContacts: 438 case TypeContacts:
439 end_buffer[4] = ALCATEL_BEGIN_SYNC_CONTACTS; 439 end_buffer[4] = ALCATEL_BEGIN_SYNC_CONTACTS;
440 break; 440 break;
441 case TypeToDo: 441 case TypeToDo:
442 end_buffer[4] = ALCATEL_BEGIN_SYNC_TODO; 442 end_buffer[4] = ALCATEL_BEGIN_SYNC_TODO;
443 break; 443 break;
diff --git a/gammu/emb/gammu/depend/nokia/dct3.c b/gammu/emb/gammu/depend/nokia/dct3.c
index b9e47ea..bda7532 100644
--- a/gammu/emb/gammu/depend/nokia/dct3.c
+++ b/gammu/emb/gammu/depend/nokia/dct3.c
@@ -1,402 +1,402 @@
1/* (c) 2002-2004 by Marcin Wiacek */ 1/* (c) 2002-2004 by Marcin Wiacek */
2/* MSID by Walek */ 2/* MSID by Walek */
3 3
4#include "../../../common/gsmstate.h" 4#include "../../../common/gsmstate.h"
5 5
6#ifdef GSM_ENABLE_NOKIA_DCT3 6#ifdef GSM_ENABLE_NOKIA_DCT3
7 7
8#include <string.h> 8#include <string.h>
9#include <signal.h> 9#include <signal.h>
10 10
11#include "../../../common/misc/coding/coding.h" 11#include "../../../common/misc/coding/coding.h"
12#include "../../../common/gsmcomon.h" 12#include "../../../common/gsmcomon.h"
13#include "../../../common/service/gsmpbk.h" 13#include "../../../common/service/gsmpbk.h"
14#include "../../../common/phone/nokia/dct3/dct3func.h" 14#include "../../../common/phone/nokia/dct3/dct3func.h"
15#include "../../../common/phone/pfunc.h" 15#include "../../../common/phone/pfunc.h"
16#include "../../gammu.h" 16#include "../../gammu.h"
17 17
18extern GSM_Reply_Function UserReplyFunctions3[]; 18static GSM_Reply_Function UserReplyFunctions3[];
19 19
20/* ------- some usefull functions ----------------------------------------- */ 20/* ------- some usefull functions ----------------------------------------- */
21 21
22GSM_Error CheckDCT3Only() 22GSM_Error CheckDCT3Only()
23{ 23{
24 bool found = false; 24 bool found = false;
25 25
26 /* Checking if phone is DCT3 */ 26 /* Checking if phone is DCT3 */
27#ifdef GSM_ENABLE_NOKIA6110 27#ifdef GSM_ENABLE_NOKIA6110
28 if (strstr(N6110Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true; 28 if (strstr(N6110Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true;
29#endif 29#endif
30#ifdef GSM_ENABLE_NOKIA7110 30#ifdef GSM_ENABLE_NOKIA7110
31 if (strstr(N7110Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true; 31 if (strstr(N7110Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true;
32#endif 32#endif
33#ifdef GSM_ENABLE_NOKIA9210 33#ifdef GSM_ENABLE_NOKIA9210
34 if (strstr(N9210Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true; 34 if (strstr(N9210Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true;
35#endif 35#endif
36 if (!found) return ERR_NOTSUPPORTED; 36 if (!found) return ERR_NOTSUPPORTED;
37 37
38 if (s.ConnectionType!=GCT_MBUS2 && s.ConnectionType!=GCT_FBUS2 && 38 if (s.ConnectionType!=GCT_MBUS2 && s.ConnectionType!=GCT_FBUS2 &&
39 s.ConnectionType!=GCT_FBUS2DLR3 && s.ConnectionType!=GCT_FBUS2BLUE && 39 s.ConnectionType!=GCT_FBUS2DLR3 && s.ConnectionType!=GCT_FBUS2BLUE &&
40 s.ConnectionType!=GCT_FBUS2IRDA && s.ConnectionType!=GCT_IRDAPHONET && 40 s.ConnectionType!=GCT_FBUS2IRDA && s.ConnectionType!=GCT_IRDAPHONET &&
41 s.ConnectionType!=GCT_BLUEFBUS2) { 41 s.ConnectionType!=GCT_BLUEFBUS2) {
42 return ERR_OTHERCONNECTIONREQUIRED; 42 return ERR_OTHERCONNECTIONREQUIRED;
43 } 43 }
44 return ERR_NONE; 44 return ERR_NONE;
45} 45}
46 46
47static void CheckDCT3() 47static void CheckDCT3()
48{ 48{
49 GSM_Error error; 49 GSM_Error error;
50 50
51 error = CheckDCT3Only(); 51 error = CheckDCT3Only();
52 switch (error) { 52 switch (error) {
53 case ERR_NOTSUPPORTED: 53 case ERR_NOTSUPPORTED:
54 Print_Error(ERR_NOTSUPPORTED); 54 Print_Error(ERR_NOTSUPPORTED);
55 break; 55 break;
56 case ERR_OTHERCONNECTIONREQUIRED: 56 case ERR_OTHERCONNECTIONREQUIRED:
57 printf("Can't do it with current phone protocol\n"); 57 printf("Can't do it with current phone protocol\n");
58 GSM_TerminateConnection(&s); 58 GSM_TerminateConnection(&s);
59 exit(-1); 59 exit(-1);
60 default: 60 default:
61 break; 61 break;
62 } 62 }
63} 63}
64 64
65static bool answer_yes3(char *text) 65static bool answer_yes3(char *text)
66{ 66{
67 int len; 67 int len;
68 char ans[99]; 68 char ans[99];
69 69
70 while (1) { 70 while (1) {
71 printf("%s (yes/no) ? ",text); 71 printf("%s (yes/no) ? ",text);
72 len=GetLine(stdin, ans, 99); 72 len=GetLine(stdin, ans, 99);
73 if (len==-1) exit(-1); 73 if (len==-1) exit(-1);
74 if (mystrncasecmp(ans, "yes",0)) return true; 74 if (mystrncasecmp(ans, "yes",0)) return true;
75 if (mystrncasecmp(ans, "no" ,0)) return false; 75 if (mystrncasecmp(ans, "no" ,0)) return false;
76 } 76 }
77} 77}
78 78
79/* ------------------- functions ------------------------------------------- */ 79/* ------------------- functions ------------------------------------------- */
80 80
81static FILE *DCT3T9File; 81static FILE *DCT3T9File;
82 82
83static GSM_Error DCT3_ReplyGetT9(GSM_Protocol_Message msg, GSM_StateMachine *s) 83static GSM_Error DCT3_ReplyGetT9(GSM_Protocol_Message msg, GSM_StateMachine *s)
84{ 84{
85 int DCT3T9Size; 85 int DCT3T9Size;
86 86
87 DCT3T9Size = msg.Length - 6; 87 DCT3T9Size = msg.Length - 6;
88 fwrite(msg.Buffer+6,1,DCT3T9Size,DCT3T9File); 88 fwrite(msg.Buffer+6,1,DCT3T9Size,DCT3T9File);
89 return ERR_NONE; 89 return ERR_NONE;
90} 90}
91 91
92void DCT3GetT9(int argc, char *argv[]) 92void DCT3GetT9(int argc, char *argv[])
93{ 93{
94 int i; 94 int i;
95 unsigned char req[] = {0x00, 0x01, 0xAE, 0x02, 0x00, 95 unsigned char req[] = {0x00, 0x01, 0xAE, 0x02, 0x00,
96 0x00};/* Part number */ 96 0x00};/* Part number */
97 97
98//"00 01 AE 00" gets some control values 98//"00 01 AE 00" gets some control values
99 99
100 if (CheckDCT3Only()!=ERR_NONE) return; 100 if (CheckDCT3Only()!=ERR_NONE) return;
101 101
102 DCT3T9File = fopen("T9", "w"); 102 DCT3T9File = fopen("T9", "w");
103 if (DCT3T9File == NULL) return; 103 if (DCT3T9File == NULL) return;
104 104
105 s.User.UserReplyFunctions=UserReplyFunctions3; 105 s.User.UserReplyFunctions=UserReplyFunctions3;
106 106
107 for (i=0;i<5;i++) { 107 for (i=0;i<5;i++) {
108 req[5] = i; 108 req[5] = i;
109 error=GSM_WaitFor (&s, req, 6, 0x40, 4, ID_User3); 109 error=GSM_WaitFor (&s, req, 6, 0x40, 4, ID_User3);
110 Print_Error(error); 110 Print_Error(error);
111 } 111 }
112 112
113 fclose(DCT3T9File); 113 fclose(DCT3T9File);
114} 114}
115 115
116void DCT3VibraTest(int argc, char *argv[]) 116void DCT3VibraTest(int argc, char *argv[])
117{ 117{
118 unsigned char ans[200]; 118 unsigned char ans[200];
119 unsigned char SetLevel[4] = {0x00, 0x01, 0xA3, 119 unsigned char SetLevel[4] = {0x00, 0x01, 0xA3,
120 0xff};/* Level */ 120 0xff};/* Level */
121 121
122 if (CheckDCT3Only()!=ERR_NONE) return; 122 if (CheckDCT3Only()!=ERR_NONE) return;
123 123
124 s.User.UserReplyFunctions=UserReplyFunctions3; 124 s.User.UserReplyFunctions=UserReplyFunctions3;
125 125
126 error=DCT3_EnableSecurity (&s, 0x01); 126 error=DCT3_EnableSecurity (&s, 0x01);
127 Print_Error(error); 127 Print_Error(error);
128 128
129 error=GSM_WaitFor (&s, SetLevel, 4, 0x40, 4, ID_User3); 129 error=GSM_WaitFor (&s, SetLevel, 4, 0x40, 4, ID_User3);
130 Print_Error(error); 130 Print_Error(error);
131 131
132 printf("Press any key to continue...\n"); 132 printf("Press any key to continue...\n");
133 GetLine(stdin, ans, 99); 133 GetLine(stdin, ans, 99);
134 134
135 SetLevel[3] = 0x00; 135 SetLevel[3] = 0x00;
136 error=GSM_WaitFor (&s, SetLevel, 4, 0x40, 4, ID_User3); 136 error=GSM_WaitFor (&s, SetLevel, 4, 0x40, 4, ID_User3);
137} 137}
138 138
139static GSM_Error DCT3_ReplyPhoneTests(GSM_Protocol_Message msg, GSM_StateMachine *s) 139static GSM_Error DCT3_ReplyPhoneTests(GSM_Protocol_Message msg, GSM_StateMachine *s)
140{ 140{
141 int i; 141 int i;
142 142
143 for (i=0;i<msg.Buffer[3];i++) { 143 for (i=0;i<msg.Buffer[3];i++) {
144 switch (i) { 144 switch (i) {
145 case 0: printf("Unknown(%02i) ",i);break; 145 case 0: printf("Unknown(%02i) ",i);break;
146 case 1: printf("MCU ROM checksum (startup)");break; 146 case 1: printf("MCU ROM checksum (startup)");break;
147 case 2: printf("MCU RAM interface (startup)");break; 147 case 2: printf("MCU RAM interface (startup)");break;
148 case 3: printf("MCU RAM component ");break; 148 case 3: printf("MCU RAM component ");break;
149 case 4: printf("MCU EEPROM interface (startup)");break; 149 case 4: printf("MCU EEPROM interface (startup)");break;
150 case 5: printf("MCU EEPROM component ");break; 150 case 5: printf("MCU EEPROM component ");break;
151 case 6: printf("Real Time Clock battery (startup)");break; 151 case 6: printf("Real Time Clock battery (startup)");break;
152 case 7: printf("CCONT interface (startup)");break; 152 case 7: printf("CCONT interface (startup)");break;
153 case 8: printf("AD converter (startup)");break; 153 case 8: printf("AD converter (startup)");break;
154 case 9: printf("SW Reset ");break; 154 case 9: printf("SW Reset ");break;
155 case 10:printf("Power Off ");break; 155 case 10:printf("Power Off ");break;
156 case 11:printf("Security Data ");break; 156 case 11:printf("Security Data ");break;
157 case 12:printf("EEPROM Tune checksum (startup)");break; 157 case 12:printf("EEPROM Tune checksum (startup)");break;
158 case 13:printf("PPM checksum (startup)");break; 158 case 13:printf("PPM checksum (startup)");break;
159 case 14:printf("MCU download DSP (startup)");break; 159 case 14:printf("MCU download DSP (startup)");break;
160 case 15:printf("DSP alive (startup)");break; 160 case 15:printf("DSP alive (startup)");break;
161 case 16:printf("COBBA serial (startup)");break; 161 case 16:printf("COBBA serial (startup)");break;
162 case 17:printf("COBBA paraller (startup)");break; 162 case 17:printf("COBBA paraller (startup)");break;
163 case 18:printf("EEPROM security checksum (startup)");break; 163 case 18:printf("EEPROM security checksum (startup)");break;
164 case 19:printf("PPM validity (startup)");break; 164 case 19:printf("PPM validity (startup)");break;
165 case 20:printf("Warranty state (startup)");break; 165 case 20:printf("Warranty state (startup)");break;
166 case 21:printf("Simlock check/SW version (startup)");break; 166 case 21:printf("Simlock check/SW version (startup)");break;
167 case 22:printf("IMEI check? ");break;/*from PC-Locals1.3.is OK?*/ 167 case 22:printf("IMEI check? ");break;/*from PC-Locals1.3.is OK?*/
168 default:printf("Unknown(%02i) ",i);break; 168 default:printf("Unknown(%02i) ",i);break;
169 } 169 }
170 switch (msg.Buffer[4+i]) { 170 switch (msg.Buffer[4+i]) {
171 case 0: printf(" : passed"); break; 171 case 0: printf(" : passed"); break;
172 case 0xff:printf(" : not executed"); break; 172 case 0xff:printf(" : not executed"); break;
173 case 254: printf(" : fail"); break; 173 case 254: printf(" : fail"); break;
174 default: printf(" : result unknown(%i)",msg.Buffer[4+i]);break; 174 default: printf(" : result unknown(%i)",msg.Buffer[4+i]);break;
175 } 175 }
176 printf("\n"); 176 printf("\n");
177 } 177 }
178 178
179 return ERR_NONE; 179 return ERR_NONE;
180} 180}
181 181
182void DCT3SelfTests(int argc, char *argv[]) 182void DCT3SelfTests(int argc, char *argv[])
183{ 183{
184 unsigned char buffer[3] = {0x00,0x01,0xcf}; 184 unsigned char buffer[3] = {0x00,0x01,0xcf};
185 unsigned char buffer3[8] = {0x00,0x01,0xce,0x1d,0xfe,0x23,0x00,0x00}; 185 unsigned char buffer3[8] = {0x00,0x01,0xce,0x1d,0xfe,0x23,0x00,0x00};
186 int i; 186 int i;
187 187
188 if (CheckDCT3Only()!=ERR_NONE) return; 188 if (CheckDCT3Only()!=ERR_NONE) return;
189 189
190 error=DCT3_EnableSecurity (&s, 0x01); 190 error=DCT3_EnableSecurity (&s, 0x01);
191 Print_Error(error); 191 Print_Error(error);
192 192
193 if (answer_yes3("Run all tests now ?")) { 193 if (answer_yes3("Run all tests now ?")) {
194 /* make almost all tests */ 194 /* make almost all tests */
195 error = s.Protocol.Functions->WriteMessage(&s, buffer3, 8, 0x40); 195 error = s.Protocol.Functions->WriteMessage(&s, buffer3, 8, 0x40);
196 Print_Error(error); 196 Print_Error(error);
197 197
198 GSM_Terminate(); 198 GSM_Terminate();
199 199
200 while (!false) { 200 while (!false) {
201 GSM_Init(false); 201 GSM_Init(false);
202 if (error==ERR_NONE) break; 202 if (error==ERR_NONE) break;
203 GSM_Terminate(); 203 GSM_Terminate();
204 } 204 }
205 205
206 my_sleep(400); 206 my_sleep(400);
207 } 207 }
208 208
209 s.User.UserReplyFunctions=UserReplyFunctions3; 209 s.User.UserReplyFunctions=UserReplyFunctions3;
210 210
211 for (i=0;i<10;i++) { 211 for (i=0;i<10;i++) {
212 error=GSM_WaitFor (&s, buffer, 3, 0x40, 4, ID_User1); 212 error=GSM_WaitFor (&s, buffer, 3, 0x40, 4, ID_User1);
213 if (error == ERR_NONE) break; 213 if (error == ERR_NONE) break;
214 } 214 }
215} 215}
216 216
217struct DCT3ADCInfo { 217struct DCT3ADCInfo {
218 char *name; 218 char *name;
219 char *unit; 219 char *unit;
220 int x; 220 int x;
221 intpos1; 221 intpos1;
222 intpos2; 222 intpos2;
223}; 223};
224 224
225static struct DCT3ADCInfo DCT3ADC[] = { 225static struct DCT3ADCInfo DCT3ADC[] = {
226 {"Battery voltage:", "mV", 1, 3, 2}, 226 {"Battery voltage:", "mV", 1, 3, 2},
227 // {"Charger voltage:", "mV", 1, -1, 7}, 227 // {"Charger voltage:", "mV", 1, -1, 7},
228 // {"Charger current:", "mA", 1, -1, 5}, 228 // {"Charger current:", "mA", 1, -1, 5},
229 {"Battery type:", "mAh", 1, 4, 3}, 229 {"Battery type:", "mAh", 1, 4, 3},
230 {"Battery temperature:", "mK", 10, 5, 4}, 230 {"Battery temperature:", "mK", 10, 5, 4},
231 // {"Accessory detection:", "mV", 1, -1, -1}, 231 // {"Accessory detection:", "mV", 1, -1, -1},
232 {"RSSI:", "", 1, 2, -1}, 232 {"RSSI:", "", 1, 2, -1},
233 // {"VCXO temperature:", "mV", 1, -1, -1}, 233 // {"VCXO temperature:", "mV", 1, -1, -1},
234 // {"Hook information:", "mV", 1, -1, -1}, 234 // {"Hook information:", "mV", 1, -1, -1},
235 235
236 {"", "", 1, -1, -1} 236 {"", "", 1, -1, -1}
237}; 237};
238 238
239 unsigned char DCT3ADCBuf[200]; 239 unsigned char DCT3ADCBuf[200];
240 int DCT3ADCInt; 240 int DCT3ADCInt;
241 241
242static GSM_Error DCT3_ReplyGetADC(GSM_Protocol_Message msg, GSM_StateMachine *s) 242static GSM_Error DCT3_ReplyGetADC(GSM_Protocol_Message msg, GSM_StateMachine *s)
243{ 243{
244 switch (msg.Buffer[2]) { 244 switch (msg.Buffer[2]) {
245 case 0x68: 245 case 0x68:
246 memcpy(DCT3ADCBuf,msg.Buffer+4,msg.Length-4); 246 memcpy(DCT3ADCBuf,msg.Buffer+4,msg.Length-4);
247 return ERR_NONE; 247 return ERR_NONE;
248 case 0x91: 248 case 0x91:
249 DCT3ADCInt = msg.Buffer[4]*256+msg.Buffer[5]; 249 DCT3ADCInt = msg.Buffer[4]*256+msg.Buffer[5];
250 return ERR_NONE; 250 return ERR_NONE;
251 } 251 }
252 return ERR_UNKNOWNRESPONSE; 252 return ERR_UNKNOWNRESPONSE;
253} 253}
254 254
255void DCT3GetADC(int argc, char *argv[]) 255void DCT3GetADC(int argc, char *argv[])
256{ 256{
257 int i = 0; 257 int i = 0;
258 unsigned charGetRaw[] = {0x00, 0x01, 0x68}; 258 unsigned charGetRaw[] = {0x00, 0x01, 0x68};
259 unsigned charGetUnit[] = {0x00, 0x01, 0x91, 259 unsigned charGetUnit[] = {0x00, 0x01, 0x91,
260 0x02}; /* Test number */ 260 0x02}; /* Test number */
261 261
262 if (CheckDCT3Only()!=ERR_NONE) return; 262 if (CheckDCT3Only()!=ERR_NONE) return;
263 263
264 s.User.UserReplyFunctions=UserReplyFunctions3; 264 s.User.UserReplyFunctions=UserReplyFunctions3;
265 265
266 error=DCT3_EnableSecurity (&s, 0x02); 266 error=DCT3_EnableSecurity (&s, 0x02);
267 Print_Error(error); 267 Print_Error(error);
268 268
269 error=GSM_WaitFor (&s, GetRaw, 3, 0x40, 6, ID_User3); 269 error=GSM_WaitFor (&s, GetRaw, 3, 0x40, 6, ID_User3);
270 Print_Error(error); 270 Print_Error(error);
271 271
272 while (1) { 272 while (1) {
273 printf(" %30s ",DCT3ADC[i].name); 273 printf(" %30s ",DCT3ADC[i].name);
274 if (DCT3ADC[i].pos1 != -1) { 274 if (DCT3ADC[i].pos1 != -1) {
275 printf("raw "); 275 printf("raw ");
276 printf("%10i ", 276 printf("%10i ",
277 DCT3ADCBuf[(DCT3ADC[i].pos1-1)*2]*256+ 277 DCT3ADCBuf[(DCT3ADC[i].pos1-1)*2]*256+
278 DCT3ADCBuf[(DCT3ADC[i].pos1-1)*2+1]); 278 DCT3ADCBuf[(DCT3ADC[i].pos1-1)*2+1]);
279 } 279 }
280 if (DCT3ADC[i].pos2 != -1) { 280 if (DCT3ADC[i].pos2 != -1) {
281 printf("unit result "); 281 printf("unit result ");
282 GetUnit[3] = DCT3ADC[i].pos2; 282 GetUnit[3] = DCT3ADC[i].pos2;
283 error=GSM_WaitFor (&s, GetUnit, 6, 0x40, 4, ID_User3); 283 error=GSM_WaitFor (&s, GetUnit, 6, 0x40, 4, ID_User3);
284 Print_Error(error); 284 Print_Error(error);
285 printf("%10i ",DCT3ADCInt*DCT3ADC[i].x); 285 printf("%10i ",DCT3ADCInt*DCT3ADC[i].x);
286 printf("%s\n",DCT3ADC[i].unit); 286 printf("%s\n",DCT3ADC[i].unit);
287 } 287 }
288 i++; 288 i++;
289 if (DCT3ADC[i].name[0] == 0x00) break; 289 if (DCT3ADC[i].name[0] == 0x00) break;
290 } 290 }
291 291
292 error=DCT3_EnableSecurity (&s, 0x01); 292 error=DCT3_EnableSecurity (&s, 0x01);
293 Print_Error(error); 293 Print_Error(error);
294} 294}
295 295
296void DCT3DisplayTest(int argc, char *argv[]) 296void DCT3DisplayTest(int argc, char *argv[])
297{ 297{
298 unsigned char ans[200]; 298 unsigned char ans[200];
299 unsigned char req[] = {0x00, 0x01, 0xD3, 299 unsigned char req[] = {0x00, 0x01, 0xD3,
300 0x03, /* 3=set, 2=clear */ 300 0x03, /* 3=set, 2=clear */
301 0x03}; /* test number */ 301 0x03}; /* test number */
302 302
303 if (CheckDCT3Only()!=ERR_NONE) return; 303 if (CheckDCT3Only()!=ERR_NONE) return;
304 304
305 if (atoi(argv[2]) != 1 && atoi(argv[2]) != 2) { 305 if (atoi(argv[2]) != 1 && atoi(argv[2]) != 2) {
306 printf("Give 1 or 2 as test number\n"); 306 printf("Give 1 or 2 as test number\n");
307 } 307 }
308 308
309 s.User.UserReplyFunctions=UserReplyFunctions3; 309 s.User.UserReplyFunctions=UserReplyFunctions3;
310 310
311 req[4] = atoi(argv[2]); 311 req[4] = atoi(argv[2]);
312 s.Protocol.Functions->WriteMessage(&s, req, 5, 0x40); 312 s.Protocol.Functions->WriteMessage(&s, req, 5, 0x40);
313 313
314 printf("Press any key to continue...\n"); 314 printf("Press any key to continue...\n");
315 GetLine(stdin, ans, 99); 315 GetLine(stdin, ans, 99);
316 316
317 req[3] = 0x02; 317 req[3] = 0x02;
318 req[4] = 0x03; 318 req[4] = 0x03;
319 s.Protocol.Functions->WriteMessage(&s, req, 5, 0x40); 319 s.Protocol.Functions->WriteMessage(&s, req, 5, 0x40);
320 320
321 error=DCT3_EnableSecurity (&s, 0x03); 321 error=DCT3_EnableSecurity (&s, 0x03);
322 Print_Error(error); 322 Print_Error(error);
323} 323}
324 324
325void DCT3netmonitor(int argc, char *argv[]) 325void DCT3netmonitor(int argc, char *argv[])
326{ 326{
327 char value[100]; 327 char value[100];
328 328
329 GSM_Init(true); 329 GSM_Init(true);
330 330
331 CheckDCT3(); 331 CheckDCT3();
332 332
333 error=DCT3_Netmonitor(&s, atoi(argv[2]), value); 333 error=DCT3_Netmonitor(&s, atoi(argv[2]), value);
334 Print_Error(error); 334 Print_Error(error);
335 335
336 printf("%s\n",value); 336 printf("%s\n",value);
337#ifdef GSM_ENABLE_BEEP 337#ifdef GSM_ENABLE_BEEP
338 if (atoi(argv[2]) == 243) GSM_PhoneBeep(); 338 if (atoi(argv[2]) == 243) GSM_PhoneBeep();
339#endif 339#endif
340 GSM_Terminate(); 340 GSM_Terminate();
341} 341}
342 342
343static GSM_Error DCT3_ReplyGetMSID(GSM_Protocol_Message msg, GSM_StateMachine *s) 343static GSM_Error DCT3_ReplyGetMSID(GSM_Protocol_Message msg, GSM_StateMachine *s)
344{ 344{
345 int i; 345 int i;
346 346
347 printf("MSID : "); 347 printf("MSID : ");
348 for (i=5;i<18;i++) printf("%02x",msg.Buffer[i]); 348 for (i=5;i<18;i++) printf("%02x",msg.Buffer[i]);
349 printf("\n"); 349 printf("\n");
350 return ERR_NONE; 350 return ERR_NONE;
351} 351}
352 352
353static GSM_Error DCT3_ReplyGetDSPROM(GSM_Protocol_Message msg, GSM_StateMachine *s) 353static GSM_Error DCT3_ReplyGetDSPROM(GSM_Protocol_Message msg, GSM_StateMachine *s)
354{ 354{
355 printf("DSP ROM : %c\n",msg.Buffer[5]); 355 printf("DSP ROM : %c\n",msg.Buffer[5]);
356 return ERR_NONE; 356 return ERR_NONE;
357} 357}
358 358
359static GSM_Error DCT3_ReplySimlockInfo(GSM_Protocol_Message msg, GSM_StateMachine *s) 359static GSM_Error DCT3_ReplySimlockInfo(GSM_Protocol_Message msg, GSM_StateMachine *s)
360{ 360{
361 inti, j; 361 inti, j;
362 charuni[100], buffer[50]; 362 charuni[100], buffer[50];
363 363
364 j=0; 364 j=0;
365 for (i=0; i < 12; i++) { 365 for (i=0; i < 12; i++) {
366 if (j<24) { 366 if (j<24) {
367 uni[j]='0' + (msg.Buffer[9+i] >> 4); 367 uni[j]='0' + (msg.Buffer[9+i] >> 4);
368 j++; 368 j++;
369 } 369 }
370 if (j!=15) { 370 if (j!=15) {
371 if (j<24) { 371 if (j<24) {
372 uni[j]='0' + (msg.Buffer[9+i] & 0x0f); 372 uni[j]='0' + (msg.Buffer[9+i] & 0x0f);
373 j++; 373 j++;
374 } 374 }
375 } else j++; 375 } else j++;
376 } 376 }
377 377
378 strncpy(buffer,uni,5); 378 strncpy(buffer,uni,5);
379 buffer[5]=0; 379 buffer[5]=0;
380 printf("Simlock 1 : MCC+MNC %10s, %s, %s, counter %i\n", 380 printf("Simlock 1 : MCC+MNC %10s, %s, %s, counter %i\n",
381 buffer, 381 buffer,
382 ((msg.Buffer[6] & 1) == 1)==0?"opened":"CLOSED", 382 ((msg.Buffer[6] & 1) == 1)==0?"opened":"CLOSED",
383 ((msg.Buffer[5] & 1) != 1)==0?"user ":"factory", 383 ((msg.Buffer[5] & 1) != 1)==0?"user ":"factory",
384 msg.Buffer[21]); 384 msg.Buffer[21]);
385 385
386 strncpy(buffer,uni+16,4); 386 strncpy(buffer,uni+16,4);
387 buffer[4]=0; 387 buffer[4]=0;
388 printf("Simlock 2 : GID1 %10s, %s, %s, counter %i\n", 388 printf("Simlock 2 : GID1 %10s, %s, %s, counter %i\n",
389 buffer, 389 buffer,
390 ((msg.Buffer[6] & 4) == 4)==0?"opened":"CLOSED", 390 ((msg.Buffer[6] & 4) == 4)==0?"opened":"CLOSED",
391 ((msg.Buffer[5] & 4) != 4)==0?"user ":"factory", 391 ((msg.Buffer[5] & 4) != 4)==0?"user ":"factory",
392 msg.Buffer[23]); 392 msg.Buffer[23]);
393 393
394 strncpy(buffer,uni+20,4); 394 strncpy(buffer,uni+20,4);
395 buffer[4]=0; 395 buffer[4]=0;
396 printf("Simlock 3 : GID2 %10s, %s, %s, counter %i\n", 396 printf("Simlock 3 : GID2 %10s, %s, %s, counter %i\n",
397 buffer, 397 buffer,
398 ((msg.Buffer[6] & 8) == 8)==0?"opened":"CLOSED", 398 ((msg.Buffer[6] & 8) == 8)==0?"opened":"CLOSED",
399 ((msg.Buffer[5] & 8) != 8)==0?"user ":"factory", 399 ((msg.Buffer[5] & 8) != 8)==0?"user ":"factory",
400 msg.Buffer[24]); 400 msg.Buffer[24]);
401 401
402 strncpy(buffer,uni+5,10); 402 strncpy(buffer,uni+5,10);
diff --git a/gammu/emb/gammu/depend/nokia/dct3trac/wmx.c b/gammu/emb/gammu/depend/nokia/dct3trac/wmx.c
index 64eda37..e46d9dd 100644
--- a/gammu/emb/gammu/depend/nokia/dct3trac/wmx.c
+++ b/gammu/emb/gammu/depend/nokia/dct3trac/wmx.c
@@ -1,415 +1,415 @@
1/** 1/**
2 * Nokia DCT3 Firmware Debug Trace Monitor 2 * Nokia DCT3 Firmware Debug Trace Monitor
3 * wumpus 2003 -- www.blacksphere.tk 3 * wumpus 2003 -- www.blacksphere.tk
4 * SIM stuff by The Monty 4 * SIM stuff by The Monty
5 * 5 *
6 * Command line arguments: 6 * Command line arguments:
7 * gammu --nokiadebug v00-0F,20,21 7 * gammu --nokiadebug v00-0F,20,21
8 * (v=verbose) 8 * (v=verbose)
9 */ 9 */
10 10
11#include "../../../../common/gsmstate.h" 11#include "../../../../common/gsmstate.h"
12 12
13#ifdef GSM_ENABLE_NOKIA_DCT3 13#ifdef GSM_ENABLE_NOKIA_DCT3
14 14
15#include <string.h> 15#include <string.h>
16#include <signal.h> 16#include <signal.h>
17 17
18#include "../../../../common/misc/coding/coding.h" 18#include "../../../../common/misc/coding/coding.h"
19#include "../../../../common/gsmcomon.h" 19#include "../../../../common/gsmcomon.h"
20#include "../../../../common/gsmstate.h" 20#include "../../../../common/gsmstate.h"
21#include "../../../../common/service/gsmpbk.h" 21#include "../../../../common/service/gsmpbk.h"
22#include "../../../../common/phone/nokia/dct3/dct3func.h" 22#include "../../../../common/phone/nokia/dct3/dct3func.h"
23#include "../../../gammu.h" 23#include "../../../gammu.h"
24#include "../dct3.h" 24#include "../dct3.h"
25#include "wmx.h" 25#include "wmx.h"
26#include "wmx-util.h" 26#include "wmx-util.h"
27#include "wmx-gsm.h" 27#include "wmx-gsm.h"
28#include "wmx-sim.h" 28#include "wmx-sim.h"
29#include "wmx-list.h" 29#include "wmx-list.h"
30 30
31extern GSM_Reply_Function UserReplyFunctionsX[]; 31static GSM_Reply_Function UserReplyFunctionsX[];
32 32
33/* Global variables suck */ 33/* Global variables suck */
34 GSMDecoder *gsmdec; 34 GSMDecoder *gsmdec;
35 struct wmx_tracestruct *traces; 35 struct wmx_tracestruct *traces;
36 36
37static GSM_Error DCT3_ReplySwitchDebug(GSM_Protocol_Message msg, GSM_StateMachine *s) 37static GSM_Error DCT3_ReplySwitchDebug(GSM_Protocol_Message msg, GSM_StateMachine *s)
38{ 38{
39 switch(msg.Buffer[2]) { 39 switch(msg.Buffer[2]) {
40 case 0x70: 40 case 0x70:
41 printf("Debug Trace Enabled\n"); 41 printf("Debug Trace Enabled\n");
42 break; 42 break;
43 case 0x71: 43 case 0x71:
44 printf("Debug Trace Disabled\n"); 44 printf("Debug Trace Disabled\n");
45 break; 45 break;
46 } 46 }
47 return ERR_NONE; 47 return ERR_NONE;
48} 48}
49 49
50/** 50/**
51 * RPC confirmation/reply 51 * RPC confirmation/reply
52 */ 52 */
53static GSM_Error DCT3_ReplyRPC(GSM_Protocol_Message msg, GSM_StateMachine *s) 53static GSM_Error DCT3_ReplyRPC(GSM_Protocol_Message msg, GSM_StateMachine *s)
54{ 54{
55 printf("RPC Reply "); 55 printf("RPC Reply ");
56 printf("call=%02x rettype=%02x data=", msg.Buffer[2], msg.Buffer[3]); 56 printf("call=%02x rettype=%02x data=", msg.Buffer[2], msg.Buffer[3]);
57 if(msg.Buffer[3] == 3) { 57 if(msg.Buffer[3] == 3) {
58 /* string */ 58 /* string */
59 printf("%s", &msg.Buffer[4]); 59 printf("%s", &msg.Buffer[4]);
60 } else { 60 } else {
61 dumpraw("RPC Reply data", &msg.Buffer[4], msg.Length-4); 61 dumpraw("RPC Reply data", &msg.Buffer[4], msg.Length-4);
62 } 62 }
63 printf("\n"); 63 printf("\n");
64 return ERR_NONE; 64 return ERR_NONE;
65} 65}
66 66
67/* disassemble mdisnd (0x18xx) packet */ 67/* disassemble mdisnd (0x18xx) packet */
68static void mdisnd_data(unsigned char type, unsigned char *buffer, size_t length) 68static void mdisnd_data(unsigned char type, unsigned char *buffer, size_t length)
69{ 69{
70 GSMDecoder_l1l2data dat; 70 GSMDecoder_l1l2data dat;
71 size_t x; 71 size_t x;
72 int ch; 72 int ch;
73 73
74 if(type==0x1B && length>2) { 74 if(type==0x1B && length>2) {
75 /* channel packet */ 75 /* channel packet */
76 ch = buffer[1]; 76 ch = buffer[1];
77 dat.tx = GSMDECODER_SEND; 77 dat.tx = GSMDECODER_SEND;
78 dat.ch = ch; 78 dat.ch = ch;
79 printf("%02X ch=%02X ",buffer[0],ch); 79 printf("%02X ch=%02X ",buffer[0],ch);
80 if (ch == 0x80 || ch == 0xB0) { 80 if (ch == 0x80 || ch == 0xB0) {
81 printf("\n"); 81 printf("\n");
82 GSMDecoder_L2packet(gsmdec, &dat, &buffer[2], length-2); 82 GSMDecoder_L2packet(gsmdec, &dat, &buffer[2], length-2);
83 } else if (ch == 0x70) { 83 } else if (ch == 0x70) {
84 dumpraw("MDI send ch70 prefix", &buffer[2], 2); 84 dumpraw("MDI send ch70 prefix", &buffer[2], 2);
85 printf("\n"); 85 printf("\n");
86 GSMDecoder_L2packet(gsmdec, &dat, &buffer[4], length-4); 86 GSMDecoder_L2packet(gsmdec, &dat, &buffer[4], length-4);
87 } else { 87 } else {
88 dumpraw("MDI recv 1B packet", &buffer[2], length-2); 88 dumpraw("MDI recv 1B packet", &buffer[2], length-2);
89 } 89 }
90 } else { 90 } else {
91 /* hex */ 91 /* hex */
92 for(x=0; x<length; x++) { 92 for(x=0; x<length; x++) {
93 printf("%02x ",buffer[x]&0xFF); 93 printf("%02x ",buffer[x]&0xFF);
94 } 94 }
95 } 95 }
96} 96}
97 97
98/* disassemble mdircv (0x19xx) packet */ 98/* disassemble mdircv (0x19xx) packet */
99static void mdircv_data(unsigned char type, unsigned char *buffer, size_t length) 99static void mdircv_data(unsigned char type, unsigned char *buffer, size_t length)
100{ 100{
101 size_t x; 101 size_t x;
102 int ch; 102 int ch;
103 GSMDecoder_l1l2data dat; 103 GSMDecoder_l1l2data dat;
104 104
105 if (type==0x80 && length>1) { 105 if (type==0x80 && length>1) {
106 // buffer[0] channel 106 // buffer[0] channel
107 // buffer[1] flag1 107 // buffer[1] flag1
108 // buffer[2] flag2 108 // buffer[2] flag2
109 // buffer[3..5] timestamp 109 // buffer[3..5] timestamp
110 // buffer[6..7] unknown_hw1 110 // buffer[6..7] unknown_hw1
111 // buffer[8..9] unknown_hw2 111 // buffer[8..9] unknown_hw2
112 ch = buffer[0]; 112 ch = buffer[0];
113 dat.tx = GSMDECODER_RECEIVE; 113 dat.tx = GSMDECODER_RECEIVE;
114 dat.ch = ch; 114 dat.ch = ch;
115 dat.bsic = buffer[1]; 115 dat.bsic = buffer[1];
116 dat.err = buffer[2]; 116 dat.err = buffer[2];
117 dat.seq = (buffer[3]<<16)|(buffer[4]<<8)|(buffer[5]); 117 dat.seq = (buffer[3]<<16)|(buffer[4]<<8)|(buffer[5]);
118 dat.arfcn = (buffer[6]<<8)|buffer[7]; 118 dat.arfcn = (buffer[6]<<8)|buffer[7];
119 dat.timeshift = (buffer[8]<<8)|buffer[9]; 119 dat.timeshift = (buffer[8]<<8)|buffer[9];
120 120
121 printf("ch=%02X bsic=%i err=%i t=%06X arfcn=%i shift=%i", 121 printf("ch=%02X bsic=%i err=%i t=%06X arfcn=%i shift=%i",
122 ch, buffer[1], buffer[2], 122 ch, buffer[1], buffer[2],
123 dat.seq, dat.arfcn, dat.timeshift 123 dat.seq, dat.arfcn, dat.timeshift
124 ); 124 );
125 125
126 //dumpraw("MDI recv 80 header", &buffer[6], 4); 126 //dumpraw("MDI recv 80 header", &buffer[6], 4);
127 printf(" "); 127 printf(" ");
128 if(buffer[2] == 0) { /* unencrypted */ 128 if(buffer[2] == 0) { /* unencrypted */
129 if(ch == 0x70) { 129 if(ch == 0x70) {
130 /* Normal header + 2b prefix */ 130 /* Normal header + 2b prefix */
131 dumpraw("MDI recv ch70 prefix", &buffer[10], 2); 131 dumpraw("MDI recv ch70 prefix", &buffer[10], 2);
132 printf("\n"); 132 printf("\n");
133 GSMDecoder_L2packet(gsmdec, &dat, &buffer[12], length-12); 133 GSMDecoder_L2packet(gsmdec, &dat, &buffer[12], length-12);
134 } else if (ch == 0x80 || ch == 0xB0) { 134 } else if (ch == 0x80 || ch == 0xB0) {
135 /* Normal header */ 135 /* Normal header */
136 printf("\n"); 136 printf("\n");
137 GSMDecoder_L2packet(gsmdec, &dat, &buffer[10], length-10); 137 GSMDecoder_L2packet(gsmdec, &dat, &buffer[10], length-10);
138 } else if (ch == 0x50 || ch == 0x60) { 138 } else if (ch == 0x50 || ch == 0x60) {
139 /* Short header */ 139 /* Short header */
140 140
141 printf("\n"); 141 printf("\n");
142 GSMDecoder_L2short_packet(gsmdec, &dat, &buffer[10], length-10); 142 GSMDecoder_L2short_packet(gsmdec, &dat, &buffer[10], length-10);
143 } else { 143 } else {
144 dumpraw("MDI send 80 packet", &buffer[10], length-10); 144 dumpraw("MDI send 80 packet", &buffer[10], length-10);
145 } 145 }
146 } else { 146 } else {
147 /* Encrypted (?) */ 147 /* Encrypted (?) */
148 dumpraw("MDI send err 80", &buffer[10], length-10); 148 dumpraw("MDI send err 80", &buffer[10], length-10);
149 } 149 }
150 } else { 150 } else {
151 /* hex */ 151 /* hex */
152 for(x=0; x<length; x++) { 152 for(x=0; x<length; x++) {
153 printf("%02x ",buffer[x]&0xFF); 153 printf("%02x ",buffer[x]&0xFF);
154 } 154 }
155 } 155 }
156} 156}
157 157
158static GSM_Error DCT3_ReplyDebugTrace(GSM_Protocol_Message msg, GSM_StateMachine *s) 158static GSM_Error DCT3_ReplyDebugTrace(GSM_Protocol_Message msg, GSM_StateMachine *s)
159{ 159{
160 int x; 160 int x;
161 int id,timestamp,number,length; 161 int id,timestamp,number,length;
162 struct wmx_tracetype *minor; 162 struct wmx_tracetype *minor;
163 char *desc; 163 char *desc;
164 164
165 //printf("Debug Trace Received\n"); 165 //printf("Debug Trace Received\n");
166 /* parse frame 166 /* parse frame
167 Debug trace packet: 167 Debug trace packet:
168 packet type 0x00 168 packet type 0x00
169 source subsystem 0x01 (LOCAL) 169 source subsystem 0x01 (LOCAL)
170 verder formaat zie notebook 170 verder formaat zie notebook
171 0x08 ID (payload=offset 0x02 here) 171 0x08 ID (payload=offset 0x02 here)
172 0x0A timestamp 172 0x0A timestamp
173 0x0C seq nr 173 0x0C seq nr
174 0x0D .. parameters 174 0x0D .. parameters
175 */ 175 */
176 id = ((msg.Buffer[2]&0xFF)<<8)|(msg.Buffer[3]&0xFF); 176 id = ((msg.Buffer[2]&0xFF)<<8)|(msg.Buffer[3]&0xFF);
177 timestamp = ((msg.Buffer[4]&0xFF)<<8)|(msg.Buffer[5]&0xFF); 177 timestamp = ((msg.Buffer[4]&0xFF)<<8)|(msg.Buffer[5]&0xFF);
178 number = msg.Buffer[6]&0xFF; 178 number = msg.Buffer[6]&0xFF;
179 length = msg.Buffer[7]&0xFF; 179 length = msg.Buffer[7]&0xFF;
180 180
181 /* filter */ 181 /* filter */
182 //if((id&0xFF00)==0x1900 && id != 0x1980) 182 //if((id&0xFF00)==0x1900 && id != 0x1980)
183 //return GE_NONE; 183 //return GE_NONE;
184 //printf("%02x\n",msg.Buffer[10]); 184 //printf("%02x\n",msg.Buffer[10]);
185 //if(msg.Buffer[10]!=0x40) 185 //if(msg.Buffer[10]!=0x40)
186 //return GE_NONE; 186 //return GE_NONE;
187 /* Query trace type name */ 187 /* Query trace type name */
188 desc = "Unknown"; 188 desc = "Unknown";
189 if(traces != NULL) { 189 if(traces != NULL) {
190 minor = wmx_tracestruct_queryminor(traces, id); 190 minor = wmx_tracestruct_queryminor(traces, id);
191 if(minor != NULL) desc = minor->desc; 191 if(minor != NULL) desc = minor->desc;
192 } 192 }
193 printf("<%04X> %s\n", id, desc); 193 printf("<%04X> %s\n", id, desc);
194 printf("t=%04x nr=%02x: ", timestamp, number); 194 printf("t=%04x nr=%02x: ", timestamp, number);
195 195
196 /* TODO -- decode debug types on phone type */ 196 /* TODO -- decode debug types on phone type */
197 switch(id>>8) { 197 switch(id>>8) {
198 case 0x33: 198 case 0x33:
199 case 0x34: 199 case 0x34:
200 case 0x35: 200 case 0x35:
201 case 0x37: 201 case 0x37:
202 case 0x38: 202 case 0x38:
203 case 0x39: 203 case 0x39:
204 case 0x3A: 204 case 0x3A:
205 case 0x3B: 205 case 0x3B:
206 case 0x3C: 206 case 0x3C:
207 case 0x5F: 207 case 0x5F:
208 /* text */ 208 /* text */
209 /* skip length byte */ 209 /* skip length byte */
210 printf("\""); 210 printf("\"");
211 for(x=8; x<msg.Length; x++) { 211 for(x=8; x<msg.Length; x++) {
212 printf("%c",msg.Buffer[x]&0xFF); 212 printf("%c",msg.Buffer[x]&0xFF);
213 } 213 }
214 printf("\""); 214 printf("\"");
215 break; 215 break;
216 /* 216 /*
217 case 0x6801: 217 case 0x6801:
218 for(x=8; x<msg.Length; x++) { 218 for(x=8; x<msg.Length; x++) {
219 printf("%02x%c ",msg.Buffer[x]&0xFF,msg.Buffer[x]&0xFF); 219 printf("%02x%c ",msg.Buffer[x]&0xFF,msg.Buffer[x]&0xFF);
220 } 220 }
221 break; 221 break;
222 */ 222 */
223 case 0x18: /* MDISND */ 223 case 0x18: /* MDISND */
224 224
225 /* skip these: 225 /* skip these:
226 +00 length 226 +00 length
227 +01 type (also xx in 0x18xx) 227 +01 type (also xx in 0x18xx)
228 */ 228 */
229 if(msg.Length<10 || msg.Buffer[9]!=(id&0xFF)) { 229 if(msg.Length<10 || msg.Buffer[9]!=(id&0xFF)) {
230 printf("C %02X: param:%02x", id&0xFF, msg.Buffer[8]); 230 printf("C %02X: param:%02x", id&0xFF, msg.Buffer[8]);
231 } else { 231 } else {
232 //printf("D %02X: ", id&0xFF); 232 //printf("D %02X: ", id&0xFF);
233 printf("D %02X: ", id&0xFF); 233 printf("D %02X: ", id&0xFF);
234 mdisnd_data((unsigned char)(id&0xFF), (unsigned char*)&msg.Buffer[10], msg.Length-10); 234 mdisnd_data((unsigned char)(id&0xFF), (unsigned char*)&msg.Buffer[10], msg.Length-10);
235 } 235 }
236 break; 236 break;
237 case 0x19: /* MDIRCV */ 237 case 0x19: /* MDIRCV */
238 if(msg.Length<10 || msg.Buffer[9]!=(id&0xFF)) { 238 if(msg.Length<10 || msg.Buffer[9]!=(id&0xFF)) {
239 printf("C %02X: param:%02x", id&0xFF, msg.Buffer[8]); 239 printf("C %02X: param:%02x", id&0xFF, msg.Buffer[8]);
240 } else { 240 } else {
241 printf("D %02X: ", id&0xFF); 241 printf("D %02X: ", id&0xFF);
242 mdircv_data((unsigned char)(id&0xFF), (unsigned char*)&msg.Buffer[10], msg.Length-10); 242 mdircv_data((unsigned char)(id&0xFF), (unsigned char*)&msg.Buffer[10], msg.Length-10);
243 //dumpraw((unsigned char*)&msg.Buffer[10], msg.Length-10); 243 //dumpraw((unsigned char*)&msg.Buffer[10], msg.Length-10);
244 } 244 }
245 break; 245 break;
246 case 0x20: /* 0x25 SIM commands */ 246 case 0x20: /* 0x25 SIM commands */
247 /* 247 /*
248 for(x=8;x<msg.Length;x++) 248 for(x=8;x<msg.Length;x++)
249 printf("%02x ", msg.Buffer[x]&0xFF); 249 printf("%02x ", msg.Buffer[x]&0xFF);
250 */ 250 */
251 printf("SIM command "); 251 printf("SIM command ");
252 if(msg.Buffer[8]==0xa0) { // check if valid (class=a0) 252 if(msg.Buffer[8]==0xa0) { // check if valid (class=a0)
253 simCommand_data(msg.Buffer[9], (unsigned char)(id&0xFF), (unsigned char*)&msg.Buffer[10], msg.Length-10); 253 simCommand_data(msg.Buffer[9], (unsigned char)(id&0xFF), (unsigned char*)&msg.Buffer[10], msg.Length-10);
254 // TODO: pass the msg.Buffer[9] and skip 1rst arg 254 // TODO: pass the msg.Buffer[9] and skip 1rst arg
255 } else { 255 } else {
256 printf("Unknown 0x25 packet (NOT SIM cmd): "); 256 printf("Unknown 0x25 packet (NOT SIM cmd): ");
257 for(x=8;x<msg.Length;x++) printf("%02x ", msg.Buffer[x]&0xFF); 257 for(x=8;x<msg.Length;x++) printf("%02x ", msg.Buffer[x]&0xFF);
258 printf("\n"); 258 printf("\n");
259 } 259 }
260 break; 260 break;
261 case 0x22: /* 0x27 SIM answer to command (error/ok/etc..) */ 261 case 0x22: /* 0x27 SIM answer to command (error/ok/etc..) */
262 if(msg.Length<10) { 262 if(msg.Length<10) {
263 // Unknown response 263 // Unknown response
264 for(x=0;x<msg.Length-10;x++) printf("%02x ", msg.Buffer[x]&0xFF); 264 for(x=0;x<msg.Length-10;x++) printf("%02x ", msg.Buffer[x]&0xFF);
265 printf(" (Unknown 0x27 packet ? ? )\n"); 265 printf(" (Unknown 0x27 packet ? ? )\n");
266 } else { 266 } else {
267 simAnswer_Process((unsigned char)(id&0xFF), (unsigned char*)&msg.Buffer[8], length); 267 simAnswer_Process((unsigned char)(id&0xFF), (unsigned char*)&msg.Buffer[8], length);
268 } 268 }
269 break; 269 break;
270 case 0x23: /* 0x28 SIM response data to commands */ 270 case 0x23: /* 0x28 SIM response data to commands */
271 if(msg.Length<10) { 271 if(msg.Length<10) {
272 // Unknown response 272 // Unknown response
273 for(x=0;x<msg.Length-10;x++) printf("%02x ", msg.Buffer[x]&0xFF); 273 for(x=0;x<msg.Length-10;x++) printf("%02x ", msg.Buffer[x]&0xFF);
274 printf(" (Unknown 0x28 packet)\n"); 274 printf(" (Unknown 0x28 packet)\n");
275 } else { 275 } else {
276 simResponse_Process((unsigned char)(id&0xFF), (unsigned char*)&msg.Buffer[8], length); 276 simResponse_Process((unsigned char)(id&0xFF), (unsigned char*)&msg.Buffer[8], length);
277 } 277 }
278 break; 278 break;
279 default: 279 default:
280 /* hex */ 280 /* hex */
281 for(x=8; x<msg.Length; x++) { 281 for(x=8; x<msg.Length; x++) {
282 printf("%02x ",msg.Buffer[x]&0xFF); 282 printf("%02x ",msg.Buffer[x]&0xFF);
283 } 283 }
284 break; 284 break;
285 } 285 }
286 printf("\n"); 286 printf("\n");
287 return ERR_NONE; 287 return ERR_NONE;
288} 288}
289 289
290 290
291static GSM_Error DCT3_ReplyMyPacket(GSM_Protocol_Message msg, GSM_StateMachine *s) 291static GSM_Error DCT3_ReplyMyPacket(GSM_Protocol_Message msg, GSM_StateMachine *s)
292{ 292{
293 int x; 293 int x;
294 294
295 printf("MyPacket "); 295 printf("MyPacket ");
296 for(x=0; x<msg.Length; x++) { 296 for(x=0; x<msg.Length; x++) {
297 printf("%02x ",msg.Buffer[x]&0xFF); 297 printf("%02x ",msg.Buffer[x]&0xFF);
298 } 298 }
299 printf("\n"); 299 printf("\n");
300 return ERR_NONE; 300 return ERR_NONE;
301} 301}
302 302
303#define ID_DebugTrace 0x666 303#define ID_DebugTrace 0x666
304#define ID_DebugSwitch 0x667 304#define ID_DebugSwitch 0x667
305 #define ID_RPC 0x668 305 #define ID_RPC 0x668
306 306
307void DCT3SetDebug(int argc, char *argv[]) 307void DCT3SetDebug(int argc, char *argv[])
308 { 308 {
309 int x,count; 309 int x,count;
310 unsigned int y; 310 unsigned int y;
311 unsigned char reqDisable[] = {0x01, 0x01, 0x71}; 311 unsigned char reqDisable[] = {0x01, 0x01, 0x71};
312 // unsigned char reqTest[] = {0x01, 0x01, 0x96, 0xFF, 0xFF}; 312 // unsigned char reqTest[] = {0x01, 0x01, 0x96, 0xFF, 0xFF};
313 313
314 /* RPC testing packets: */ 314 /* RPC testing packets: */
315 315
316 /* RPC: Get version */ 316 /* RPC: Get version */
317 //unsigned char reqTest2[] = {0x01, 0x01, 0x00, 0x03, 0x00}; 317 //unsigned char reqTest2[] = {0x01, 0x01, 0x00, 0x03, 0x00};
318 /* RPC: read I/O 0x6D mask 0xFF */ 318 /* RPC: read I/O 0x6D mask 0xFF */
319 //unsigned char reqTest2[] = {0x01, 0x01, 0x02, 0x01, 0x02, 0x6D, 0xFF}; /* */ 319 //unsigned char reqTest2[] = {0x01, 0x01, 0x02, 0x01, 0x02, 0x6D, 0xFF}; /* */
320 /* RPC: write I/O 0x03 mask 0xFF value 0x31 */ 320 /* RPC: write I/O 0x03 mask 0xFF value 0x31 */
321 //unsigned char reqTest2[] = {0x01, 0x01, 0x01, 0x01, 0x07, 0x03, 0xFF, 0x31}; /* write I/O */ 321 //unsigned char reqTest2[] = {0x01, 0x01, 0x01, 0x01, 0x07, 0x03, 0xFF, 0x31}; /* write I/O */
322 322
323 /* RPC: write forged FBUS packet to MDISND */ 323 /* RPC: write forged FBUS packet to MDISND */
324 // unsigned char reqTest2[] = {0x01, 0x01, 0x16, 0x01, 0x06, 324 // unsigned char reqTest2[] = {0x01, 0x01, 0x16, 0x01, 0x06,
325 //0x14, // R0 -- length 325 //0x14, // R0 -- length
326 //0x05, // R1 -- MDI type identifier 0x05(FBUS) 326 //0x05, // R1 -- MDI type identifier 0x05(FBUS)
327 //0x1e, 0x0c, 0x00, 0x66, 327 //0x1e, 0x0c, 0x00, 0x66,
328 //0x00, 0x0e, 0x01, 0x01, 328 //0x00, 0x0e, 0x01, 0x01,
329 //0x66, 0x55, 0x44, 0x33, 329 //0x66, 0x55, 0x44, 0x33,
330 //0x0d, 0x01, 0x01, 0x01, 330 //0x0d, 0x01, 0x01, 0x01,
331 //0x1b, 0x58, 0x01, 0x44}; 331 //0x1b, 0x58, 0x01, 0x44};
332 //1805 t=cb37 nr=e2 :D 05: 332 //1805 t=cb37 nr=e2 :D 05:
333 333
334 /* debug enable packet */ 334 /* debug enable packet */
335 unsigned char reqEnable[] = { 335 unsigned char reqEnable[] = {
336 0x00, 0x01, 0x70, 336 0x00, 0x01, 0x70,
337 /* Debug bits 337 /* Debug bits
338 byte[bit>>3]&(1<<(7-(bit&7))) 338 byte[bit>>3]&(1<<(7-(bit&7)))
339 */ 339 */
340 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00 */ 340 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00 */
341 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40 */ 341 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40 */
342 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80 */ 342 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80 */
343 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0 */ 343 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0 */
344 /* Debug verbose bits 344 /* Debug verbose bits
345 byte[bit>>3]&(1<<(7-(bit&7))) 345 byte[bit>>3]&(1<<(7-(bit&7)))
346 */ 346 */
347 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 347 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
348 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 348 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
349 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 349 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
350 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 350 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
351 }; 351 };
352 352
353 #define ENABLE_BIT(bit,verbose) reqEnable[3 + (bit>>3)] |= 1<<(7-(bit&7)); if(verbose){reqEnable[3 + 32 + (bit>>3)] |= 1<<(7-(bit&7));} 353 #define ENABLE_BIT(bit,verbose) reqEnable[3 + (bit>>3)] |= 1<<(7-(bit&7)); if(verbose){reqEnable[3 + 32 + (bit>>3)] |= 1<<(7-(bit&7));}
354 354
355 /* Enable some bit 355 /* Enable some bit
356 TODO command line or GUI interface 356 TODO command line or GUI interface
357 */ 357 */
358 //ENABLE_BIT(0x18, 1);/* Enable MDISND debugging */ 358 //ENABLE_BIT(0x18, 1);/* Enable MDISND debugging */
359 //ENABLE_BIT(0x19, 1);/* Enable MDIRCV debugging */ 359 //ENABLE_BIT(0x19, 1);/* Enable MDIRCV debugging */
360 //ENABLE_BIT(0x31, 1); 360 //ENABLE_BIT(0x31, 1);
361 361
362 gsmdec = GSMDecoder_new(); 362 gsmdec = GSMDecoder_new();
363 /* Open XML file .. needs to be argument */ 363 /* Open XML file .. needs to be argument */
364 { 364 {
365 FILE *xout = fopen("out.xml", "w"); 365 FILE *xout = fopen("out.xml", "w");
366 GSMDecoder_xmlout(gsmdec, xout); 366 GSMDecoder_xmlout(gsmdec, xout);
367 } 367 }
368 printf("Debug Trace Mode -- wumpus 2003\n"); 368 printf("Debug Trace Mode -- wumpus 2003\n");
369 traces = wmx_tracestruct_load(argv[2]); 369 traces = wmx_tracestruct_load(argv[2]);
370 if(traces == NULL) 370 if(traces == NULL)
371 printf("Warning: could not load trace description file %s\n", argv[2]); 371 printf("Warning: could not load trace description file %s\n", argv[2]);
372 printf("Activating ranges:\n"); 372 printf("Activating ranges:\n");
373 count = 0; 373 count = 0;
374 for(x=3; x<argc; x++) { 374 for(x=3; x<argc; x++) {
375 char *ptr = argv[x]; 375 char *ptr = argv[x];
376 unsigned from,to,verbose; 376 unsigned from,to,verbose;
377 377
378 while(*ptr) { 378 while(*ptr) {
379 verbose = 0; 379 verbose = 0;
380 if(*ptr == 'v') { 380 if(*ptr == 'v') {
381 verbose = 1; 381 verbose = 1;
382 ptr++; 382 ptr++;
383 } 383 }
384 to = from = strtol(ptr, &ptr, 16); 384 to = from = strtol(ptr, &ptr, 16);
385 if(*ptr == '-') { 385 if(*ptr == '-') {
386 ptr ++; 386 ptr ++;
387 to = strtol(ptr, &ptr, 16); 387 to = strtol(ptr, &ptr, 16);
388 } 388 }
389 if(*ptr != ',' && *ptr != 0) { 389 if(*ptr != ',' && *ptr != 0) {
390 printf("Invalid parameter '%s'\n", argv[x]); 390 printf("Invalid parameter '%s'\n", argv[x]);
391 return; 391 return;
392 } 392 }
393 if(*ptr == ',') 393 if(*ptr == ',')
394 ptr++; 394 ptr++;
395 if(from > 0xFF) from=0xFF; 395 if(from > 0xFF) from=0xFF;
396 if(to > 0xFF) to=0xFF; 396 if(to > 0xFF) to=0xFF;
397 printf(" %02x-%02x verbose=%i\n",from,to,verbose); 397 printf(" %02x-%02x verbose=%i\n",from,to,verbose);
398 for(y=from; y<=to; y++) { 398 for(y=from; y<=to; y++) {
399 ENABLE_BIT(y, verbose); 399 ENABLE_BIT(y, verbose);
400 count++; 400 count++;
401 } 401 }
402 } 402 }
403 } 403 }
404 if(count == 0) { 404 if(count == 0) {
405 printf("Nothing activated -- bailing out\n"); 405 printf("Nothing activated -- bailing out\n");
406 return; 406 return;
407 } 407 }
408 //ENABLE_BIT(0x20, 1); /* SIM commands (literal) */ 408 //ENABLE_BIT(0x20, 1); /* SIM commands (literal) */
409 //ENABLE_BIT(0x21, 1); /* SIML2 commands (literal) */ 409 //ENABLE_BIT(0x21, 1); /* SIML2 commands (literal) */
410 //ENABLE_BIT(0x22, 1); /* SIM commands (literal) */ 410 //ENABLE_BIT(0x22, 1); /* SIM commands (literal) */
411 //ENABLE_BIT(0x3B, 1);/* PHCTRL state */ 411 //ENABLE_BIT(0x3B, 1);/* PHCTRL state */
412 412
413 GSM_Init(true); 413 GSM_Init(true);
414 414
415 /* We Need DCT3 */ 415 /* We Need DCT3 */
diff --git a/gammu/emb/gammu/depend/nokia/dct4.c b/gammu/emb/gammu/depend/nokia/dct4.c
index 4bf958d..43d8f09 100644
--- a/gammu/emb/gammu/depend/nokia/dct4.c
+++ b/gammu/emb/gammu/depend/nokia/dct4.c
@@ -1,400 +1,400 @@
1/* (c) 2002-2004 by Marcin Wiacek */ 1/* (c) 2002-2004 by Marcin Wiacek */
2 2
3#include "../../../common/gsmstate.h" 3#include "../../../common/gsmstate.h"
4 4
5#ifdef GSM_ENABLE_NOKIA_DCT4 5#ifdef GSM_ENABLE_NOKIA_DCT4
6 6
7#include <string.h> 7#include <string.h>
8 8
9#include "dct4.h" 9#include "dct4.h"
10#include "../../gammu.h" 10#include "../../gammu.h"
11#include "../../../common/phone/pfunc.h" 11#include "../../../common/phone/pfunc.h"
12#include "../../../common/phone/nokia/nfunc.h" 12#include "../../../common/phone/nokia/nfunc.h"
13#include "../../../common/phone/nokia/dct4/dct4func.h" 13#include "../../../common/phone/nokia/dct4/dct4func.h"
14#include "../../../common/misc/coding/coding.h" 14#include "../../../common/misc/coding/coding.h"
15 15
16extern GSM_Reply_Function UserReplyFunctions4[]; 16static GSM_Reply_Function UserReplyFunctions4[];
17 17
18/* ------- some usefull functions ----------------------------------------- */ 18/* ------- some usefull functions ----------------------------------------- */
19 19
20GSM_Error CheckDCT4Only() 20GSM_Error CheckDCT4Only()
21{ 21{
22 bool found = false; 22 bool found = false;
23 23
24 /* Checking if phone is DCT4 */ 24 /* Checking if phone is DCT4 */
25#ifdef GSM_ENABLE_NOKIA3650 25#ifdef GSM_ENABLE_NOKIA3650
26 if (strstr(N3650Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true; 26 if (strstr(N3650Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true;
27#endif 27#endif
28#ifdef GSM_ENABLE_NOKIA6510 28#ifdef GSM_ENABLE_NOKIA6510
29 if (strstr(N6510Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true; 29 if (strstr(N6510Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true;
30#endif 30#endif
31#ifdef GSM_ENABLE_NOKIA3320 31#ifdef GSM_ENABLE_NOKIA3320
32 if (strstr(N3320Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true; 32 if (strstr(N3320Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true;
33#endif 33#endif
34 if (!found) return ERR_NOTSUPPORTED; 34 if (!found) return ERR_NOTSUPPORTED;
35 35
36 if (s.ConnectionType!=GCT_MBUS2 && s.ConnectionType!=GCT_FBUS2 && 36 if (s.ConnectionType!=GCT_MBUS2 && s.ConnectionType!=GCT_FBUS2 &&
37 s.ConnectionType!=GCT_FBUS2DLR3 && s.ConnectionType!=GCT_PHONETBLUE && 37 s.ConnectionType!=GCT_FBUS2DLR3 && s.ConnectionType!=GCT_PHONETBLUE &&
38 s.ConnectionType!=GCT_IRDAPHONET && s.ConnectionType!=GCT_BLUEPHONET && 38 s.ConnectionType!=GCT_IRDAPHONET && s.ConnectionType!=GCT_BLUEPHONET &&
39 s.ConnectionType!=GCT_FBUS2DKU5) { 39 s.ConnectionType!=GCT_FBUS2DKU5) {
40 return ERR_OTHERCONNECTIONREQUIRED; 40 return ERR_OTHERCONNECTIONREQUIRED;
41 } 41 }
42 return ERR_NONE; 42 return ERR_NONE;
43} 43}
44 44
45static void CheckDCT4() 45static void CheckDCT4()
46{ 46{
47 GSM_Error error; 47 GSM_Error error;
48 48
49 error = CheckDCT4Only(); 49 error = CheckDCT4Only();
50 switch (error) { 50 switch (error) {
51 case ERR_NOTSUPPORTED: 51 case ERR_NOTSUPPORTED:
52 Print_Error(ERR_NOTSUPPORTED); 52 Print_Error(ERR_NOTSUPPORTED);
53 break; 53 break;
54 case ERR_OTHERCONNECTIONREQUIRED: 54 case ERR_OTHERCONNECTIONREQUIRED:
55 printf("Can't do it with current phone protocol\n"); 55 printf("Can't do it with current phone protocol\n");
56 GSM_TerminateConnection(&s); 56 GSM_TerminateConnection(&s);
57 exit(-1); 57 exit(-1);
58 default: 58 default:
59 break; 59 break;
60 } 60 }
61} 61}
62 62
63static bool answer_yes2(char *text) 63static bool answer_yes2(char *text)
64{ 64{
65 int len; 65 int len;
66 char ans[99]; 66 char ans[99];
67 67
68 while (1) { 68 while (1) {
69 printf("%s (yes/no) ? ",text); 69 printf("%s (yes/no) ? ",text);
70 len=GetLine(stdin, ans, 99); 70 len=GetLine(stdin, ans, 99);
71 if (len==-1) exit(-1); 71 if (len==-1) exit(-1);
72 if (mystrncasecmp(ans, "yes",0)) return true; 72 if (mystrncasecmp(ans, "yes",0)) return true;
73 if (mystrncasecmp(ans, "no" ,0)) return false; 73 if (mystrncasecmp(ans, "no" ,0)) return false;
74 } 74 }
75} 75}
76 76
77/* ------------------- functions ------------------------------------------- */ 77/* ------------------- functions ------------------------------------------- */
78 78
79static DCT4_Feature DCT4Features[] = { 79static DCT4_Feature DCT4Features[] = {
80 {DCT4_ALWAYS_ONLINE, "GPRS Always Online", {{0,"on (Context)"},{1,"off (Attach)"},{0,""}}},///?? 80 {DCT4_ALWAYS_ONLINE, "GPRS Always Online", {{0,"on (Context)"},{1,"off (Attach)"},{0,""}}},///??
81 {DCT4_GPRS_PCCH, "PCCH support for GPRS", {{1,"on"},{0,"off"},{0,""}}}, 81 {DCT4_GPRS_PCCH, "PCCH support for GPRS", {{1,"on"},{0,"off"},{0,""}}},
82 {DCT4_GEA1, "GEA1 support indication", {{1,"on"},{0,"off"},{0,""}}}, 82 {DCT4_GEA1, "GEA1 support indication", {{1,"on"},{0,"off"},{0,""}}},
83 {DCT4_EOTD, "EOTD support", {{1,"on"},{0,"off"},{0,""}}}, 83 {DCT4_EOTD, "EOTD support", {{1,"on"},{0,"off"},{0,""}}},
84 {DCT4_WAP_PUSH, "WAP push", {{1,"on"},{0,"off"},{0,""}}}, 84 {DCT4_WAP_PUSH, "WAP push", {{1,"on"},{0,"off"},{0,""}}},
85 {DCT4_USE_PREF_SIM_NET, "Use SIM preffered network list",{{1,"on"},{0,"off"},{0,""}}}, 85 {DCT4_USE_PREF_SIM_NET, "Use SIM preffered network list",{{1,"on"},{0,"off"},{0,""}}},
86 {DCT4_JAVA_TCK, "Java TCK support", {{1,"on"},{0,"off"},{0,""}}}, 86 {DCT4_JAVA_TCK, "Java TCK support", {{1,"on"},{0,"off"},{0,""}}},
87 87
88 {DCT4_ALS, "Alternate Line Service (ALS)", {{1,"on"},{0,"off"},{0,""}}}, 88 {DCT4_ALS, "Alternate Line Service (ALS)", {{1,"on"},{0,"off"},{0,""}}},
89 {DCT4_A52, "Ciphering alghoritm A52", {{1,"on"},{0,"off"},{0,""}}}, 89 {DCT4_A52, "Ciphering alghoritm A52", {{1,"on"},{0,"off"},{0,""}}},
90 {DCT4_CSP, "Customer Service Profile", {{0,"off"},{1,"on"},{0,""}}}, 90 {DCT4_CSP, "Customer Service Profile", {{0,"off"},{1,"on"},{0,""}}},
91 {DCT4_EONS, "EONS support", {{1,"on"},{0,"off"},{0,""}}}, 91 {DCT4_EONS, "EONS support", {{1,"on"},{0,"off"},{0,""}}},
92 {DCT4_3GINDICATOR, "3G indicator", {{1,"on"},{0,"off"},{0,""}}}, 92 {DCT4_3GINDICATOR, "3G indicator", {{1,"on"},{0,"off"},{0,""}}},
93 {DCT4_DISPLAY_PHONE_NAME, "Display both number and name for incoming calls",{{1,"on"},{0,"off"},{0,""}}}, 93 {DCT4_DISPLAY_PHONE_NAME, "Display both number and name for incoming calls",{{1,"on"},{0,"off"},{0,""}}},
94 {DCT4_DISPLAY_WAP_PROFILE, "Display selected WAP profile name instead of Home option menu in Services",{{1,"on"},{0,"off"},{0,""}}}, 94 {DCT4_DISPLAY_WAP_PROFILE, "Display selected WAP profile name instead of Home option menu in Services",{{1,"on"},{0,"off"},{0,""}}},
95 95
96 {DCT4_GAMES_WAP_DOWNLOAD, "Games WAP download", {{1,"on"},{0,"off"},{0,""}}}, 96 {DCT4_GAMES_WAP_DOWNLOAD, "Games WAP download", {{1,"on"},{0,"off"},{0,""}}},
97 {DCT4_GAMES_SCORE_SEND, "Games WAP score send", {{1,"on"},{0,"off"},{0,""}}}, 97 {DCT4_GAMES_SCORE_SEND, "Games WAP score send", {{1,"on"},{0,"off"},{0,""}}},
98 {DCT4_GAMES_URL_CHECK, "Games URL check", {{1,"on"},{0,"off"},{0,""}}}, 98 {DCT4_GAMES_URL_CHECK, "Games URL check", {{1,"on"},{0,"off"},{0,""}}},
99 99
100 {DCT4_BLUETOOTH_MENU, "Bluetooth menu", {{1,"on"},{0,"off"},{0,""}}}, 100 {DCT4_BLUETOOTH_MENU, "Bluetooth menu", {{1,"on"},{0,"off"},{0,""}}},
101 {DCT4_WAP_BOOKMARKS_MENU, "Bookmarks menu in Services", {{1,"on"},{0,"off"},{0,""}}}, 101 {DCT4_WAP_BOOKMARKS_MENU, "Bookmarks menu in Services", {{1,"on"},{0,"off"},{0,""}}},
102 {DCT4_WAP_BOOKMARKS_MENU2, "Bookmarks menu in Services", {{3,"bookmarks & download"},{0,"off"},{0,""}}}, 102 {DCT4_WAP_BOOKMARKS_MENU2, "Bookmarks menu in Services", {{3,"bookmarks & download"},{0,"off"},{0,""}}},
103 {DCT4_WAP_GOTO_MENU, "GoTo menu in Services", {{0,"on"},{1,"off"},{0,""}}}, 103 {DCT4_WAP_GOTO_MENU, "GoTo menu in Services", {{0,"on"},{1,"off"},{0,""}}},
104 {DCT4_WAP_SETTINGS_MENU, "Profiles menu in Services", {{0,"on"},{1,"off"},{0,""}}}, 104 {DCT4_WAP_SETTINGS_MENU, "Profiles menu in Services", {{0,"on"},{1,"off"},{0,""}}},
105 {DCT4_SERVICES_GAMES_APP_GALLERY,"Services menu in Games/Apps/Gallery",{{1,"on"},{0,"off"},{0,""}}}, 105 {DCT4_SERVICES_GAMES_APP_GALLERY,"Services menu in Games/Apps/Gallery",{{1,"on"},{0,"off"},{0,""}}},
106 {DCT4_JAVA_GAMES_MENU, "Java games menu in Games", {{1,"on"},{0,"off"},{0,""}}}, 106 {DCT4_JAVA_GAMES_MENU, "Java games menu in Games", {{1,"on"},{0,"off"},{0,""}}},
107 {DCT4_SAT_CONFIRM_MENU, "Can use confirming SIM service actions", {{1,"on"},{0,"off"},{0,""}}}, 107 {DCT4_SAT_CONFIRM_MENU, "Can use confirming SIM service actions", {{1,"on"},{0,"off"},{0,""}}},
108 {DCT4_INSTANT_MESS_MENU, "Instant Messaging in Messages",{{1,"on"},{0,"off"},{0,""}}}, 108 {DCT4_INSTANT_MESS_MENU, "Instant Messaging in Messages",{{1,"on"},{0,"off"},{0,""}}},
109 {DCT4_CONFIRM_ALS, "Confirm using ALS", {{1,"on"},{0,"off"},{0,""}}}, 109 {DCT4_CONFIRM_ALS, "Confirm using ALS", {{1,"on"},{0,"off"},{0,""}}},
110 {DCT4_BOOKMARK_GOTO_MENU, "Bookmarks in GoTo menu", {{1,"on"},{0,"off"},{0,""}}}, 110 {DCT4_BOOKMARK_GOTO_MENU, "Bookmarks in GoTo menu", {{1,"on"},{0,"off"},{0,""}}},
111 111
112 {DCT4_5100_IDENTIFY, "Phone identification", {{1,"NPM-6U"},{0,"NPM-6"},{0,""}}}, 112 {DCT4_5100_IDENTIFY, "Phone identification", {{1,"NPM-6U"},{0,"NPM-6"},{0,""}}},
113 113
114#ifdef DEBUG 114#ifdef DEBUG
115 {DCT4_TEST,"",{{1,"1"},{0,"0"}}}, 115 {DCT4_TEST,"",{{1,"1"},{0,"0"}}},
116#endif 116#endif
117 117
118 {0, "", {{0,""}}} 118 {0, "", {{0,""}}}
119}; 119};
120 120
121static DCT4_Phone_Features DCT4PhoneFeatures[] = { 121static DCT4_Phone_Features DCT4PhoneFeatures[] = {
122 /*3100*/ {"RH-19",{{DCT4_ALS,1},{DCT4_A52,3},{DCT4_CSP,4},{DCT4_GPRS_PCCH,8}, 122 /*3100*/ {"RH-19",{{DCT4_ALS,1},{DCT4_A52,3},{DCT4_CSP,4},{DCT4_GPRS_PCCH,8},
123 {DCT4_GEA1,9},{DCT4_ALWAYS_ONLINE,11},{DCT4_EOTD,12}, 123 {DCT4_GEA1,9},{DCT4_ALWAYS_ONLINE,11},{DCT4_EOTD,12},
124 {DCT4_DISPLAY_PHONE_NAME,17},{DCT4_WAP_GOTO_MENU,18}, 124 {DCT4_DISPLAY_PHONE_NAME,17},{DCT4_WAP_GOTO_MENU,18},
125 {DCT4_WAP_SETTINGS_MENU,19},{DCT4_SERVICES_GAMES_APP_GALLERY,22}, 125 {DCT4_WAP_SETTINGS_MENU,19},{DCT4_SERVICES_GAMES_APP_GALLERY,22},
126 {DCT4_DISPLAY_WAP_PROFILE,26},{DCT4_SAT_CONFIRM_MENU,27}, 126 {DCT4_DISPLAY_WAP_PROFILE,26},{DCT4_SAT_CONFIRM_MENU,27},
127 {DCT4_EONS,28},{DCT4_3GINDICATOR,30},{DCT4_INSTANT_MESS_MENU,33}, 127 {DCT4_EONS,28},{DCT4_3GINDICATOR,30},{DCT4_INSTANT_MESS_MENU,33},
128 {DCT4_CONFIRM_ALS,35}, 128 {DCT4_CONFIRM_ALS,35},
129 {0,0}}}, 129 {0,0}}},
130 /*3200*/ {"RH-30",{{DCT4_ALS,2},{DCT4_A52,4},{DCT4_CSP,5},{DCT4_GPRS_PCCH,14}, 130 /*3200*/ {"RH-30",{{DCT4_ALS,2},{DCT4_A52,4},{DCT4_CSP,5},{DCT4_GPRS_PCCH,14},
131 {DCT4_GEA1,15},{DCT4_EOTD,18},{DCT4_WAP_SETTINGS_MENU,20}, 131 {DCT4_GEA1,15},{DCT4_EOTD,18},{DCT4_WAP_SETTINGS_MENU,20},
132 {DCT4_DISPLAY_PHONE_NAME,21},{DCT4_WAP_GOTO_MENU,23}, 132 {DCT4_DISPLAY_PHONE_NAME,21},{DCT4_WAP_GOTO_MENU,23},
133 {DCT4_SERVICES_GAMES_APP_GALLERY,26},{DCT4_3GINDICATOR,28}, 133 {DCT4_SERVICES_GAMES_APP_GALLERY,26},{DCT4_3GINDICATOR,28},
134 {DCT4_DISPLAY_WAP_PROFILE,31},{DCT4_SAT_CONFIRM_MENU,33}, 134 {DCT4_DISPLAY_WAP_PROFILE,31},{DCT4_SAT_CONFIRM_MENU,33},
135 {DCT4_CONFIRM_ALS,34},{DCT4_EONS,40},{DCT4_ALWAYS_ONLINE,45}, 135 {DCT4_CONFIRM_ALS,34},{DCT4_EONS,40},{DCT4_ALWAYS_ONLINE,45},
136 {0,0}}}, 136 {0,0}}},
137 /*3200*/ {"RH-31",{{DCT4_ALS,2},{DCT4_A52,4},{DCT4_CSP,5},{DCT4_GPRS_PCCH,14}, 137 /*3200*/ {"RH-31",{{DCT4_ALS,2},{DCT4_A52,4},{DCT4_CSP,5},{DCT4_GPRS_PCCH,14},
138 {DCT4_GEA1,15},{DCT4_EOTD,18},{DCT4_WAP_SETTINGS_MENU,20}, 138 {DCT4_GEA1,15},{DCT4_EOTD,18},{DCT4_WAP_SETTINGS_MENU,20},
139 {DCT4_DISPLAY_PHONE_NAME,21},{DCT4_WAP_GOTO_MENU,23}, 139 {DCT4_DISPLAY_PHONE_NAME,21},{DCT4_WAP_GOTO_MENU,23},
140 {DCT4_SERVICES_GAMES_APP_GALLERY,26},{DCT4_3GINDICATOR,28}, 140 {DCT4_SERVICES_GAMES_APP_GALLERY,26},{DCT4_3GINDICATOR,28},
141 {DCT4_DISPLAY_WAP_PROFILE,31},{DCT4_SAT_CONFIRM_MENU,33}, 141 {DCT4_DISPLAY_WAP_PROFILE,31},{DCT4_SAT_CONFIRM_MENU,33},
142 {DCT4_CONFIRM_ALS,34},{DCT4_EONS,40},{DCT4_ALWAYS_ONLINE,45}, 142 {DCT4_CONFIRM_ALS,34},{DCT4_EONS,40},{DCT4_ALWAYS_ONLINE,45},
143 {0,0}}}, 143 {0,0}}},
144 /*3300*/ {"NEM-1",{{DCT4_ALS,1},{DCT4_CSP,4},{DCT4_GAMES_URL_CHECK,5},{DCT4_GPRS_PCCH,8}, 144 /*3300*/ {"NEM-1",{{DCT4_ALS,1},{DCT4_CSP,4},{DCT4_GAMES_URL_CHECK,5},{DCT4_GPRS_PCCH,8},
145 {DCT4_GEA1,9},{DCT4_ALWAYS_ONLINE,11},{DCT4_EOTD,12}, 145 {DCT4_GEA1,9},{DCT4_ALWAYS_ONLINE,11},{DCT4_EOTD,12},
146 {DCT4_DISPLAY_PHONE_NAME,17},{DCT4_WAP_GOTO_MENU,18}, 146 {DCT4_DISPLAY_PHONE_NAME,17},{DCT4_WAP_GOTO_MENU,18},
147 {DCT4_WAP_SETTINGS_MENU,19},{DCT4_SERVICES_GAMES_APP_GALLERY,22}, 147 {DCT4_WAP_SETTINGS_MENU,19},{DCT4_SERVICES_GAMES_APP_GALLERY,22},
148 {DCT4_DISPLAY_WAP_PROFILE,26},{DCT4_SAT_CONFIRM_MENU,27}, 148 {DCT4_DISPLAY_WAP_PROFILE,26},{DCT4_SAT_CONFIRM_MENU,27},
149 /*MORE*/ {0,0}}}, 149 /*MORE*/ {0,0}}},
150 /*3510*/ {"NHM-8",{{DCT4_ALS,1},{DCT4_A52,3},{DCT4_CSP,6}, 150 /*3510*/ {"NHM-8",{{DCT4_ALS,1},{DCT4_A52,3},{DCT4_CSP,6},
151 {DCT4_GAMES_WAP_DOWNLOAD,7},{DCT4_GAMES_SCORE_SEND,8}, 151 {DCT4_GAMES_WAP_DOWNLOAD,7},{DCT4_GAMES_SCORE_SEND,8},
152 {DCT4_GAMES_URL_CHECK,9},{DCT4_GPRS_PCCH,13}, 152 {DCT4_GAMES_URL_CHECK,9},{DCT4_GPRS_PCCH,13},
153 {DCT4_GEA1,15},{DCT4_ALWAYS_ONLINE,18},{0,0}}}, 153 {DCT4_GEA1,15},{DCT4_ALWAYS_ONLINE,18},{0,0}}},
154 /*3510i*/{"RH-9",{{DCT4_ALS,1},{DCT4_A52,3},{DCT4_CSP,4},{DCT4_GPRS_PCCH,9}, 154 /*3510i*/{"RH-9",{{DCT4_ALS,1},{DCT4_A52,3},{DCT4_CSP,4},{DCT4_GPRS_PCCH,9},
155 {DCT4_DISPLAY_PHONE_NAME,14},{DCT4_WAP_GOTO_MENU,15}, 155 {DCT4_DISPLAY_PHONE_NAME,14},{DCT4_WAP_GOTO_MENU,15},
156 {DCT4_WAP_SETTINGS_MENU,16},{DCT4_SERVICES_GAMES_APP_GALLERY,19}, 156 {DCT4_WAP_SETTINGS_MENU,16},{DCT4_SERVICES_GAMES_APP_GALLERY,19},
157 {DCT4_DISPLAY_WAP_PROFILE,25},{0,0}}}, 157 {DCT4_DISPLAY_WAP_PROFILE,25},{0,0}}},
158 /*3650*/ {"NHL-8",{{DCT4_ALS,1},{0,0}}}, 158 /*3650*/ {"NHL-8",{{DCT4_ALS,1},{0,0}}},
159 /*5100*/ {"NPM-6",{{DCT4_ALS,1},{DCT4_CSP,4},{DCT4_GAMES_URL_CHECK,5},{DCT4_GPRS_PCCH,8}, 159 /*5100*/ {"NPM-6",{{DCT4_ALS,1},{DCT4_CSP,4},{DCT4_GAMES_URL_CHECK,5},{DCT4_GPRS_PCCH,8},
160 {DCT4_GEA1,9},{DCT4_ALWAYS_ONLINE,11},{DCT4_EOTD,12}, 160 {DCT4_GEA1,9},{DCT4_ALWAYS_ONLINE,11},{DCT4_EOTD,12},
161 {DCT4_DISPLAY_PHONE_NAME,17},{DCT4_WAP_GOTO_MENU,18}, 161 {DCT4_DISPLAY_PHONE_NAME,17},{DCT4_WAP_GOTO_MENU,18},
162 {DCT4_WAP_SETTINGS_MENU,19},{DCT4_SERVICES_GAMES_APP_GALLERY,22}, 162 {DCT4_WAP_SETTINGS_MENU,19},{DCT4_SERVICES_GAMES_APP_GALLERY,22},
163 {DCT4_DISPLAY_WAP_PROFILE,26},{DCT4_SAT_CONFIRM_MENU,27}, 163 {DCT4_DISPLAY_WAP_PROFILE,26},{DCT4_SAT_CONFIRM_MENU,27},
164 {DCT4_EONS,28}, 164 {DCT4_EONS,28},
165 // {DCT4_5100_IDENTIFY,10}, 165 // {DCT4_5100_IDENTIFY,10},
166 {0,0}}}, 166 {0,0}}},
167 /*5100*/ {"NPM-6U",{{DCT4_ALS,1},{DCT4_CSP,4},{DCT4_GAMES_URL_CHECK,5},{DCT4_GPRS_PCCH,8}, 167 /*5100*/ {"NPM-6U",{{DCT4_ALS,1},{DCT4_CSP,4},{DCT4_GAMES_URL_CHECK,5},{DCT4_GPRS_PCCH,8},
168 {DCT4_GEA1,9},{DCT4_ALWAYS_ONLINE,11},{DCT4_EOTD,12}, 168 {DCT4_GEA1,9},{DCT4_ALWAYS_ONLINE,11},{DCT4_EOTD,12},
169 {DCT4_DISPLAY_PHONE_NAME,17},{DCT4_WAP_GOTO_MENU,18}, 169 {DCT4_DISPLAY_PHONE_NAME,17},{DCT4_WAP_GOTO_MENU,18},
170 {DCT4_WAP_SETTINGS_MENU,19},{DCT4_SERVICES_GAMES_APP_GALLERY,22}, 170 {DCT4_WAP_SETTINGS_MENU,19},{DCT4_SERVICES_GAMES_APP_GALLERY,22},
171 {DCT4_DISPLAY_WAP_PROFILE,26},{DCT4_SAT_CONFIRM_MENU,27}, 171 {DCT4_DISPLAY_WAP_PROFILE,26},{DCT4_SAT_CONFIRM_MENU,27},
172 {DCT4_EONS,28}, 172 {DCT4_EONS,28},
173 // {DCT4_5100_IDENTIFY,10}, 173 // {DCT4_5100_IDENTIFY,10},
174 {0,0}}}, 174 {0,0}}},
175 /*6100*/ {"NPL-2",{{DCT4_ALS,1},{DCT4_CSP,4},{DCT4_GAMES_URL_CHECK,5},{DCT4_GPRS_PCCH,8}, 175 /*6100*/ {"NPL-2",{{DCT4_ALS,1},{DCT4_CSP,4},{DCT4_GAMES_URL_CHECK,5},{DCT4_GPRS_PCCH,8},
176 {DCT4_GEA1,9},{DCT4_ALWAYS_ONLINE,11},{DCT4_EOTD,12}, 176 {DCT4_GEA1,9},{DCT4_ALWAYS_ONLINE,11},{DCT4_EOTD,12},
177 {DCT4_DISPLAY_PHONE_NAME,17},{DCT4_WAP_GOTO_MENU,18}, 177 {DCT4_DISPLAY_PHONE_NAME,17},{DCT4_WAP_GOTO_MENU,18},
178 {DCT4_WAP_SETTINGS_MENU,19},{DCT4_SERVICES_GAMES_APP_GALLERY,22}, 178 {DCT4_WAP_SETTINGS_MENU,19},{DCT4_SERVICES_GAMES_APP_GALLERY,22},
179 {DCT4_DISPLAY_WAP_PROFILE,26},{DCT4_SAT_CONFIRM_MENU,27}, 179 {DCT4_DISPLAY_WAP_PROFILE,26},{DCT4_SAT_CONFIRM_MENU,27},
180 {0,0}}}, 180 {0,0}}},
181 /*6220*/ {"RH-20",{{DCT4_ALS,1},{DCT4_A52,3},{DCT4_CSP,4}, 181 /*6220*/ {"RH-20",{{DCT4_ALS,1},{DCT4_A52,3},{DCT4_CSP,4},
182 {DCT4_GEA1,14},{DCT4_EOTD,17},{DCT4_WAP_SETTINGS_MENU,19}, 182 {DCT4_GEA1,14},{DCT4_EOTD,17},{DCT4_WAP_SETTINGS_MENU,19},
183 {DCT4_DISPLAY_PHONE_NAME,20},{DCT4_WAP_GOTO_MENU,22}, 183 {DCT4_DISPLAY_PHONE_NAME,20},{DCT4_WAP_GOTO_MENU,22},
184 {DCT4_WAP_BOOKMARKS_MENU2,24},{DCT4_SERVICES_GAMES_APP_GALLERY,25}, 184 {DCT4_WAP_BOOKMARKS_MENU2,24},{DCT4_SERVICES_GAMES_APP_GALLERY,25},
185 {DCT4_3GINDICATOR,27},{DCT4_DISPLAY_WAP_PROFILE,30},{DCT4_SAT_CONFIRM_MENU,32}, 185 {DCT4_3GINDICATOR,27},{DCT4_DISPLAY_WAP_PROFILE,30},{DCT4_SAT_CONFIRM_MENU,32},
186 {DCT4_CONFIRM_ALS,33},{DCT4_JAVA_TCK,36},{DCT4_BOOKMARK_GOTO_MENU,37}, 186 {DCT4_CONFIRM_ALS,33},{DCT4_JAVA_TCK,36},{DCT4_BOOKMARK_GOTO_MENU,37},
187 {0,0}}}, 187 {0,0}}},
188 /*6310*/ {"NPE-4",{{DCT4_ALS,1},{DCT4_A52,3},{DCT4_CSP,6},{DCT4_GAMES_WAP_DOWNLOAD,7}, 188 /*6310*/ {"NPE-4",{{DCT4_ALS,1},{DCT4_A52,3},{DCT4_CSP,6},{DCT4_GAMES_WAP_DOWNLOAD,7},
189 {DCT4_GAMES_SCORE_SEND,8},{DCT4_GAMES_URL_CHECK,9},{DCT4_BLUETOOTH_MENU,10}, 189 {DCT4_GAMES_SCORE_SEND,8},{DCT4_GAMES_URL_CHECK,9},{DCT4_BLUETOOTH_MENU,10},
190 {DCT4_GPRS_PCCH,13},{DCT4_GEA1,15},{DCT4_ALWAYS_ONLINE,18},{0,0}}}, 190 {DCT4_GPRS_PCCH,13},{DCT4_GEA1,15},{DCT4_ALWAYS_ONLINE,18},{0,0}}},
191 /*6310i*/{"NPL-1",{{DCT4_ALS,1},{DCT4_A52,3},{DCT4_CSP,6},{DCT4_GAMES_WAP_DOWNLOAD,7}, 191 /*6310i*/{"NPL-1",{{DCT4_ALS,1},{DCT4_A52,3},{DCT4_CSP,6},{DCT4_GAMES_WAP_DOWNLOAD,7},
192 {DCT4_GAMES_SCORE_SEND,8},{DCT4_GAMES_URL_CHECK,9}, 192 {DCT4_GAMES_SCORE_SEND,8},{DCT4_GAMES_URL_CHECK,9},
193 {DCT4_BLUETOOTH_MENU,10},{DCT4_USE_PREF_SIM_NET,11}, 193 {DCT4_BLUETOOTH_MENU,10},{DCT4_USE_PREF_SIM_NET,11},
194 {DCT4_GPRS_PCCH,13},{DCT4_GEA1,15},{DCT4_EOTD,16}, 194 {DCT4_GPRS_PCCH,13},{DCT4_GEA1,15},{DCT4_EOTD,16},
195 {DCT4_ALWAYS_ONLINE,17},{DCT4_JAVA_GAMES_MENU,18}, 195 {DCT4_ALWAYS_ONLINE,17},{DCT4_JAVA_GAMES_MENU,18},
196 {DCT4_WAP_BOOKMARKS_MENU,20},{DCT4_WAP_SETTINGS_MENU,21}, 196 {DCT4_WAP_BOOKMARKS_MENU,20},{DCT4_WAP_SETTINGS_MENU,21},
197 {DCT4_WAP_PUSH,28},{DCT4_WAP_GOTO_MENU,29},{0,0}}}, 197 {DCT4_WAP_PUSH,28},{DCT4_WAP_GOTO_MENU,29},{0,0}}},
198 /*6510*/ {"NPM-9",{{DCT4_ALS,1},{DCT4_A52,3},{DCT4_CSP,6},{DCT4_GAMES_WAP_DOWNLOAD,7}, 198 /*6510*/ {"NPM-9",{{DCT4_ALS,1},{DCT4_A52,3},{DCT4_CSP,6},{DCT4_GAMES_WAP_DOWNLOAD,7},
199 {DCT4_GAMES_SCORE_SEND,8},{DCT4_GAMES_URL_CHECK,9}, 199 {DCT4_GAMES_SCORE_SEND,8},{DCT4_GAMES_URL_CHECK,9},
200 {DCT4_GPRS_PCCH,13},{DCT4_GEA1,15},{DCT4_ALWAYS_ONLINE,18},{0,0}}}, 200 {DCT4_GPRS_PCCH,13},{DCT4_GEA1,15},{DCT4_ALWAYS_ONLINE,18},{0,0}}},
201 /*6610*/ {"NHL-4U",{{DCT4_ALS,1},{DCT4_CSP,4},{DCT4_GAMES_URL_CHECK,5},{DCT4_GPRS_PCCH,8}, 201 /*6610*/ {"NHL-4U",{{DCT4_ALS,1},{DCT4_CSP,4},{DCT4_GAMES_URL_CHECK,5},{DCT4_GPRS_PCCH,8},
202 {DCT4_GEA1,9},{DCT4_ALWAYS_ONLINE,11},{DCT4_EOTD,12}, 202 {DCT4_GEA1,9},{DCT4_ALWAYS_ONLINE,11},{DCT4_EOTD,12},
203 {DCT4_DISPLAY_PHONE_NAME,17},{DCT4_WAP_GOTO_MENU,18}, 203 {DCT4_DISPLAY_PHONE_NAME,17},{DCT4_WAP_GOTO_MENU,18},
204 {DCT4_WAP_SETTINGS_MENU,19},{DCT4_SERVICES_GAMES_APP_GALLERY,22}, 204 {DCT4_WAP_SETTINGS_MENU,19},{DCT4_SERVICES_GAMES_APP_GALLERY,22},
205 {DCT4_DISPLAY_WAP_PROFILE,26},{DCT4_SAT_CONFIRM_MENU,27}, 205 {DCT4_DISPLAY_WAP_PROFILE,26},{DCT4_SAT_CONFIRM_MENU,27},
206 {0,0}}}, 206 {0,0}}},
207 /*6800*/ {"NHL-6",{{DCT4_ALS,1},{DCT4_CSP,4},{DCT4_GAMES_URL_CHECK,5},{DCT4_GPRS_PCCH,8}, 207 /*6800*/ {"NHL-6",{{DCT4_ALS,1},{DCT4_CSP,4},{DCT4_GAMES_URL_CHECK,5},{DCT4_GPRS_PCCH,8},
208 {DCT4_GEA1,9},{DCT4_ALWAYS_ONLINE,11},{DCT4_EOTD,12}, 208 {DCT4_GEA1,9},{DCT4_ALWAYS_ONLINE,11},{DCT4_EOTD,12},
209 {DCT4_DISPLAY_PHONE_NAME,17},{DCT4_WAP_GOTO_MENU,18}, 209 {DCT4_DISPLAY_PHONE_NAME,17},{DCT4_WAP_GOTO_MENU,18},
210 {DCT4_WAP_SETTINGS_MENU,19},{DCT4_SERVICES_GAMES_APP_GALLERY,22}, 210 {DCT4_WAP_SETTINGS_MENU,19},{DCT4_SERVICES_GAMES_APP_GALLERY,22},
211 {DCT4_DISPLAY_WAP_PROFILE,26},{DCT4_SAT_CONFIRM_MENU,27}, 211 {DCT4_DISPLAY_WAP_PROFILE,26},{DCT4_SAT_CONFIRM_MENU,27},
212 /*MORE*/ {0,0}}}, 212 /*MORE*/ {0,0}}},
213 /*7210*/ {"NHL-4",{{DCT4_ALS,1},{DCT4_CSP,4},{DCT4_GAMES_URL_CHECK,5},{DCT4_GPRS_PCCH,8}, 213 /*7210*/ {"NHL-4",{{DCT4_ALS,1},{DCT4_CSP,4},{DCT4_GAMES_URL_CHECK,5},{DCT4_GPRS_PCCH,8},
214 {DCT4_GEA1,9},{DCT4_ALWAYS_ONLINE,11},{DCT4_EOTD,12}, 214 {DCT4_GEA1,9},{DCT4_ALWAYS_ONLINE,11},{DCT4_EOTD,12},
215 {DCT4_DISPLAY_PHONE_NAME,17},{DCT4_WAP_GOTO_MENU,18}, 215 {DCT4_DISPLAY_PHONE_NAME,17},{DCT4_WAP_GOTO_MENU,18},
216 {DCT4_WAP_SETTINGS_MENU,19},{DCT4_SERVICES_GAMES_APP_GALLERY,22}, 216 {DCT4_WAP_SETTINGS_MENU,19},{DCT4_SERVICES_GAMES_APP_GALLERY,22},
217 {DCT4_DISPLAY_WAP_PROFILE,26},{DCT4_SAT_CONFIRM_MENU,27}, 217 {DCT4_DISPLAY_WAP_PROFILE,26},{DCT4_SAT_CONFIRM_MENU,27},
218 {0,0}}}, 218 {0,0}}},
219 /*7250*/ {"NHL-4J",{{DCT4_ALS,1},{DCT4_CSP,4},{DCT4_GAMES_URL_CHECK,5},{DCT4_GPRS_PCCH,8}, 219 /*7250*/ {"NHL-4J",{{DCT4_ALS,1},{DCT4_CSP,4},{DCT4_GAMES_URL_CHECK,5},{DCT4_GPRS_PCCH,8},
220 {DCT4_GEA1,9},{DCT4_ALWAYS_ONLINE,11},{DCT4_EOTD,12}, 220 {DCT4_GEA1,9},{DCT4_ALWAYS_ONLINE,11},{DCT4_EOTD,12},
221 {DCT4_DISPLAY_PHONE_NAME,17},{DCT4_WAP_GOTO_MENU,18}, 221 {DCT4_DISPLAY_PHONE_NAME,17},{DCT4_WAP_GOTO_MENU,18},
222 {DCT4_WAP_SETTINGS_MENU,19},{DCT4_SERVICES_GAMES_APP_GALLERY,22}, 222 {DCT4_WAP_SETTINGS_MENU,19},{DCT4_SERVICES_GAMES_APP_GALLERY,22},
223 {DCT4_DISPLAY_WAP_PROFILE,26},{DCT4_SAT_CONFIRM_MENU,27}, 223 {DCT4_DISPLAY_WAP_PROFILE,26},{DCT4_SAT_CONFIRM_MENU,27},
224 {0,0}}}, 224 {0,0}}},
225 /*7250i*/{"NHL-4JX",{{DCT4_ALS,1},{DCT4_CSP,4},{DCT4_GAMES_URL_CHECK,5},{DCT4_GPRS_PCCH,8}, 225 /*7250i*/{"NHL-4JX",{{DCT4_ALS,1},{DCT4_CSP,4},{DCT4_GAMES_URL_CHECK,5},{DCT4_GPRS_PCCH,8},
226 {DCT4_GEA1,9},{DCT4_ALWAYS_ONLINE,11},{DCT4_EOTD,12}, 226 {DCT4_GEA1,9},{DCT4_ALWAYS_ONLINE,11},{DCT4_EOTD,12},
227 {DCT4_DISPLAY_PHONE_NAME,17},{DCT4_WAP_GOTO_MENU,18}, 227 {DCT4_DISPLAY_PHONE_NAME,17},{DCT4_WAP_GOTO_MENU,18},
228 {DCT4_WAP_SETTINGS_MENU,19},{DCT4_SERVICES_GAMES_APP_GALLERY,22}, 228 {DCT4_WAP_SETTINGS_MENU,19},{DCT4_SERVICES_GAMES_APP_GALLERY,22},
229 {DCT4_DISPLAY_WAP_PROFILE,26},{DCT4_SAT_CONFIRM_MENU,27}, 229 {DCT4_DISPLAY_WAP_PROFILE,26},{DCT4_SAT_CONFIRM_MENU,27},
230 /*MORE*/ {0,0}}}, 230 /*MORE*/ {0,0}}},
231 /*8310*/{"NHM-7",{{DCT4_ALS,1},{DCT4_CSP,6},{DCT4_GAMES_WAP_DOWNLOAD,7}, 231 /*8310*/{"NHM-7",{{DCT4_ALS,1},{DCT4_CSP,6},{DCT4_GAMES_WAP_DOWNLOAD,7},
232 {DCT4_GAMES_SCORE_SEND,8},{DCT4_GAMES_URL_CHECK,9},{DCT4_GPRS_PCCH,13}, 232 {DCT4_GAMES_SCORE_SEND,8},{DCT4_GAMES_URL_CHECK,9},{DCT4_GPRS_PCCH,13},
233 {DCT4_ALWAYS_ONLINE,18},{0,0}}}, 233 {DCT4_ALWAYS_ONLINE,18},{0,0}}},
234 {"", {{0,0}}} 234 {"", {{0,0}}}
235}; 235};
236 236
237static GSM_Error DCT4_ReplySetPPS(GSM_Protocol_Message msg, GSM_StateMachine *s) 237static GSM_Error DCT4_ReplySetPPS(GSM_Protocol_Message msg, GSM_StateMachine *s)
238{ 238{
239 printf("Setting done OK\n"); 239 printf("Setting done OK\n");
240 return ERR_NONE; 240 return ERR_NONE;
241} 241}
242 242
243void DCT4SetPhoneMenus(int argc, char *argv[]) 243void DCT4SetPhoneMenus(int argc, char *argv[])
244{ 244{
245 int current = 10,i=0,j,z; 245 int current = 10,i=0,j,z;
246 unsigned char reqSet[200] = { 246 unsigned char reqSet[200] = {
247 N7110_FRAME_HEADER,0x04,0x00,0x01,0x47,0x48,0x02, 247 N7110_FRAME_HEADER,0x04,0x00,0x01,0x47,0x48,0x02,
248 0x00}; /* Number of changed features */ 248 0x00}; /* Number of changed features */
249 249
250 if (CheckDCT4Only()!=ERR_NONE) return; 250 if (CheckDCT4Only()!=ERR_NONE) return;
251 251
252 s.User.UserReplyFunctions=UserReplyFunctions4; 252 s.User.UserReplyFunctions=UserReplyFunctions4;
253 253
254 while (DCT4PhoneFeatures[i].Model[0] != 0x00) { 254 while (DCT4PhoneFeatures[i].Model[0] != 0x00) {
255 if (!strcmp(DCT4PhoneFeatures[i].Model,s.Phone.Data.Model)) { 255 if (!strcmp(DCT4PhoneFeatures[i].Model,s.Phone.Data.Model)) {
256 j = 0; 256 j = 0;
257 while (DCT4PhoneFeatures[i].Features[j].Name != 0x00) { 257 while (DCT4PhoneFeatures[i].Features[j].Name != 0x00) {
258 z = 0; 258 z = 0;
259 while (DCT4Features[z].Name != 0x00) { 259 while (DCT4Features[z].Name != 0x00) {
260 if (DCT4Features[z].Name == DCT4PhoneFeatures[i].Features[j].Name) { 260 if (DCT4Features[z].Name == DCT4PhoneFeatures[i].Features[j].Name) {
261 printf("%s : %s\n",DCT4Features[z].Text,DCT4Features[z].Values[0].Text); 261 printf("%s : %s\n",DCT4Features[z].Text,DCT4Features[z].Values[0].Text);
262 reqSet[9]++; /* Number of features */ 262 reqSet[9]++; /* Number of features */
263 reqSet[current++] = DCT4PhoneFeatures[i].Features[j].Number; /* Feature number */ 263 reqSet[current++] = DCT4PhoneFeatures[i].Features[j].Number; /* Feature number */
264 reqSet[current++] = DCT4Features[z].Values[0].Value; /* Value */ 264 reqSet[current++] = DCT4Features[z].Values[0].Value; /* Value */
265 break; 265 break;
266 } 266 }
267 z++; 267 z++;
268 } 268 }
269 j++; 269 j++;
270 } 270 }
271 } 271 }
272 i++; 272 i++;
273 } 273 }
274 274
275 if (current == 10) { 275 if (current == 10) {
276 printf("Sorry, but configuration matrix for this model is not added yet. Please report\n"); 276 printf("Sorry, but configuration matrix for this model is not added yet. Please report\n");
277 return; 277 return;
278 } 278 }
279 279
280 reqSet[current++] = 0x00; 280 reqSet[current++] = 0x00;
281 reqSet[current++] = 0x00; 281 reqSet[current++] = 0x00;
282 282
283 error=GSM_WaitFor (&s, reqSet, current, 0x1b, 4, ID_User1); 283 error=GSM_WaitFor (&s, reqSet, current, 0x1b, 4, ID_User1);
284 Print_Error(error); 284 Print_Error(error);
285} 285}
286 286
287DCT4_Phone_Tests DCT4Tests; 287DCT4_Phone_Tests DCT4Tests;
288 288
289static GSM_Error DCT4_ReplyTestsNames(GSM_Protocol_Message msg, GSM_StateMachine *s) 289static GSM_Error DCT4_ReplyTestsNames(GSM_Protocol_Message msg, GSM_StateMachine *s)
290{ 290{
291 int i,pos; 291 int i,pos;
292 292
293 DCT4Tests.Num = msg.Buffer[5]; 293 DCT4Tests.Num = msg.Buffer[5];
294 pos = 6; 294 pos = 6;
295 295
296 smprintf(s,"%i names for phone tests received\n",msg.Buffer[5]); 296 smprintf(s,"%i names for phone tests received\n",msg.Buffer[5]);
297 for (i=0;i<msg.Buffer[5];i++) { 297 for (i=0;i<msg.Buffer[5];i++) {
298 strcpy(DCT4Tests.Tests[i].Name,msg.Buffer+pos+4); 298 strcpy(DCT4Tests.Tests[i].Name,msg.Buffer+pos+4);
299 DCT4Tests.Tests[i].ID = msg.Buffer[pos+2]; 299 DCT4Tests.Tests[i].ID = msg.Buffer[pos+2];
300 smprintf(s,"%x.\"%s\"\n",DCT4Tests.Tests[i].ID,DCT4Tests.Tests[i].Name); 300 smprintf(s,"%x.\"%s\"\n",DCT4Tests.Tests[i].ID,DCT4Tests.Tests[i].Name);
301 pos+=msg.Buffer[pos+1]; 301 pos+=msg.Buffer[pos+1];
302 } 302 }
303 303
304 return ERR_NONE; 304 return ERR_NONE;
305} 305}
306 306
307static GSM_Error DCT4_ReplyTestsStartup(GSM_Protocol_Message msg, GSM_StateMachine *s) 307static GSM_Error DCT4_ReplyTestsStartup(GSM_Protocol_Message msg, GSM_StateMachine *s)
308{ 308{
309 int i,pos,j; 309 int i,pos,j;
310 bool found; 310 bool found;
311 311
312 pos = 10; 312 pos = 10;
313 313
314 for (i=0;i<msg.Buffer[8];i++) { 314 for (i=0;i<msg.Buffer[8];i++) {
315 found = false; 315 found = false;
316 for (j=0;j<DCT4Tests.Num;j++) { 316 for (j=0;j<DCT4Tests.Num;j++) {
317 if (DCT4Tests.Tests[j].ID == msg.Buffer[pos]) { 317 if (DCT4Tests.Tests[j].ID == msg.Buffer[pos]) {
318 DCT4Tests.Tests[j].Startup = true; 318 DCT4Tests.Tests[j].Startup = true;
319 found = true; 319 found = true;
320 break; 320 break;
321 } 321 }
322 } 322 }
323 if (!found) printf("%x ",msg.Buffer[pos]); 323 if (!found) printf("%x ",msg.Buffer[pos]);
324 pos++; 324 pos++;
325 } 325 }
326 326
327 return ERR_NONE; 327 return ERR_NONE;
328} 328}
329 329
330static GSM_Error DCT4_ReplyTestsStatus(GSM_Protocol_Message msg, GSM_StateMachine *s) 330static GSM_Error DCT4_ReplyTestsStatus(GSM_Protocol_Message msg, GSM_StateMachine *s)
331{ 331{
332 int i,pos,j; 332 int i,pos,j;
333 333
334 pos = 6; 334 pos = 6;
335 335
336 smprintf(s,"%i status entries for phone tests received\n",msg.Buffer[5]); 336 smprintf(s,"%i status entries for phone tests received\n",msg.Buffer[5]);
337 for (i=0;i<msg.Buffer[5];i++) { 337 for (i=0;i<msg.Buffer[5];i++) {
338 for (j=0;j<DCT4Tests.Num;j++) { 338 for (j=0;j<DCT4Tests.Num;j++) {
339 if (DCT4Tests.Tests[j].ID == msg.Buffer[pos+2]) { 339 if (DCT4Tests.Tests[j].ID == msg.Buffer[pos+2]) {
340 printf("\"%40s\" : ",DCT4Tests.Tests[j].Name); 340 printf("\"%40s\" : ",DCT4Tests.Tests[j].Name);
341 switch(msg.Buffer[pos+3]) { 341 switch(msg.Buffer[pos+3]) {
342 case 0x00: printf("Passed"); break; 342 case 0x00: printf("Passed"); break;
343 case 0x01: printf("Fail"); break; 343 case 0x01: printf("Fail"); break;
344 case 0x03: printf("Not executed"); break; 344 case 0x03: printf("Not executed"); break;
345 case 0x06: printf("No signal"); break; 345 case 0x06: printf("No signal"); break;
346 case 0x0D: printf("Timeout"); break; 346 case 0x0D: printf("Timeout"); break;
347 default : printf("Unknown (%x)",msg.Buffer[pos+3]); 347 default : printf("Unknown (%x)",msg.Buffer[pos+3]);
348 } 348 }
349 if (DCT4Tests.Tests[j].Startup) printf(" (startup)"); 349 if (DCT4Tests.Tests[j].Startup) printf(" (startup)");
350 printf("\n"); 350 printf("\n");
351 break; 351 break;
352 } 352 }
353 } 353 }
354 pos+=msg.Buffer[pos+1]; 354 pos+=msg.Buffer[pos+1];
355 } 355 }
356 356
357 return ERR_NONE; 357 return ERR_NONE;
358} 358}
359 359
360void DCT4SelfTests(int argc, char *argv[]) 360void DCT4SelfTests(int argc, char *argv[])
361{ 361{
362 int j; 362 int j;
363 unsigned char GetDoneST[6] = {0x00, 0x08, 0x01, 0x04, 0x01, 0x00}; 363 unsigned char GetDoneST[6] = {0x00, 0x08, 0x01, 0x04, 0x01, 0x00};
364 unsigned char GetDoneST2[6] = {0x00, 0x08, 0x02, 0x04, 0x02, 0x00}; 364 unsigned char GetDoneST2[6] = {0x00, 0x08, 0x02, 0x04, 0x02, 0x00};
365 unsigned char GetNames[6] = {0x00, 0x08, 0x03, 0x06, 0x03, 0x00}; 365 unsigned char GetNames[6] = {0x00, 0x08, 0x03, 0x06, 0x03, 0x00};
366 unsigned char GetStatus[6] = {0x00, 0x08, 0x04, 0x02, 0x03, 0x00}; 366 unsigned char GetStatus[6] = {0x00, 0x08, 0x04, 0x02, 0x03, 0x00};
367 367
368 unsigned char RunALL[6] = {0x00, 0x06, 0x04, 0x00, 0x03, 0x00}; 368 unsigned char RunALL[6] = {0x00, 0x06, 0x04, 0x00, 0x03, 0x00};
369 369
370 //unsigned char GetID[6] = {0x00, 0x08, 0x00, 0x04, 0x03, 0x00};//tests ID 370 //unsigned char GetID[6] = {0x00, 0x08, 0x00, 0x04, 0x03, 0x00};//tests ID
371 371
372 if (CheckDCT4Only()!=ERR_NONE) return; 372 if (CheckDCT4Only()!=ERR_NONE) return;
373 373
374 s.User.UserReplyFunctions=UserReplyFunctions4; 374 s.User.UserReplyFunctions=UserReplyFunctions4;
375 375
376 if (answer_yes2("Run all tests now ?")) { 376 if (answer_yes2("Run all tests now ?")) {
377 error=GSM_WaitFor (&s, RunALL, 6, 0x35, 4, ID_User1); 377 error=GSM_WaitFor (&s, RunALL, 6, 0x35, 4, ID_User1);
378 Print_Error(error); 378 Print_Error(error);
379 } 379 }
380 380
381 error=GSM_WaitFor (&s, GetNames, 6, 0x35, 4, ID_User1); 381 error=GSM_WaitFor (&s, GetNames, 6, 0x35, 4, ID_User1);
382 Print_Error(error); 382 Print_Error(error);
383 383
384 for (j=0;j<DCT4Tests.Num;j++) DCT4Tests.Tests[j].Startup = false; 384 for (j=0;j<DCT4Tests.Num;j++) DCT4Tests.Tests[j].Startup = false;
385 385
386 error=GSM_WaitFor (&s, GetDoneST, 6, 0x35, 4, ID_User3); 386 error=GSM_WaitFor (&s, GetDoneST, 6, 0x35, 4, ID_User3);
387 Print_Error(error); 387 Print_Error(error);
388 388
389 error=GSM_WaitFor (&s, GetDoneST2, 6, 0x35, 4, ID_User3); 389 error=GSM_WaitFor (&s, GetDoneST2, 6, 0x35, 4, ID_User3);
390 Print_Error(error); 390 Print_Error(error);
391 391
392 error=GSM_WaitFor (&s, GetStatus, 6, 0x35, 4, ID_User2); 392 error=GSM_WaitFor (&s, GetStatus, 6, 0x35, 4, ID_User2);
393 Print_Error(error); 393 Print_Error(error);
394} 394}
395 395
396static GSM_Error DCT4_ReplyVibra(GSM_Protocol_Message msg, GSM_StateMachine *s) 396static GSM_Error DCT4_ReplyVibra(GSM_Protocol_Message msg, GSM_StateMachine *s)
397{ 397{
398#ifdef DEBUG 398#ifdef DEBUG
399 switch (msg.Buffer[3]) { 399 switch (msg.Buffer[3]) {
400 case 0x0D : dbgprintf("Vibra state set OK\n"); break; 400 case 0x0D : dbgprintf("Vibra state set OK\n"); break;
diff --git a/gammu/emb/gammu/depend/siemens/dsiemens.c b/gammu/emb/gammu/depend/siemens/dsiemens.c
index dc54102..a34bc3b 100644
--- a/gammu/emb/gammu/depend/siemens/dsiemens.c
+++ b/gammu/emb/gammu/depend/siemens/dsiemens.c
@@ -1,363 +1,363 @@
1/* (c) by Walek */ 1/* (c) by Walek */
2 2
3#include "../../../common/gsmstate.h" 3#include "../../../common/gsmstate.h"
4 4
5#ifdef GSM_ENABLE_ATGEN 5#ifdef GSM_ENABLE_ATGEN
6 6
7#include <string.h> 7#include <string.h>
8 8
9#include "../../../common/misc/coding/coding.h" 9#include "../../../common/misc/coding/coding.h"
10#include "../../../common/gsmcomon.h" 10#include "../../../common/gsmcomon.h"
11#include "../../../common/service/gsmnet.h" 11#include "../../../common/service/gsmnet.h"
12#include "../../../common/phone/at/atgen.h" 12#include "../../../common/phone/at/atgen.h"
13#include "../../gammu.h" 13#include "../../gammu.h"
14#include "dsiemens.h" 14#include "dsiemens.h"
15#include "chiffre.h" 15#include "chiffre.h"
16 16
17extern GSM_Error ATGEN_GetSIMIMSI (GSM_StateMachine *s, char *IMSI); 17extern GSM_Error ATGEN_GetSIMIMSI (GSM_StateMachine *s, char *IMSI);
18extern GSM_Error ATGEN_GetMemoryStatus (GSM_StateMachine *s, GSM_MemoryStatus *status); 18extern GSM_Error ATGEN_GetMemoryStatus (GSM_StateMachine *s, GSM_MemoryStatus *status);
19extern GSM_Error ATGEN_SetMemory (GSM_StateMachine *s, GSM_MemoryEntry *pbk); 19extern GSM_Error ATGEN_SetMemory (GSM_StateMachine *s, GSM_MemoryEntry *pbk);
20extern GSM_Reply_Function UserReplyFunctionsAtS[]; 20static GSM_Reply_Function UserReplyFunctionsAtS[];
21 21
22 bool new_variable; 22 bool new_variable;
23GSM_Error CheckSiemens() 23GSM_Error CheckSiemens()
24{ 24{
25 if (s.Phone.Data.Priv.ATGEN.Manufacturer != AT_Siemens) return ERR_NOTSUPPORTED; 25 if (s.Phone.Data.Priv.ATGEN.Manufacturer != AT_Siemens) return ERR_NOTSUPPORTED;
26 return ERR_NONE; 26 return ERR_NONE;
27} 27}
28 28
29GSM_Error ATSIEMENS_Reply_GetSAT(GSM_Protocol_Message msg, GSM_StateMachine *s) 29GSM_Error ATSIEMENS_Reply_GetSAT(GSM_Protocol_Message msg, GSM_StateMachine *s)
30{ 30{
31 GSM_Phone_ATGENData *Priv = &s->Phone.Data.Priv.ATGEN; 31 GSM_Phone_ATGENData *Priv = &s->Phone.Data.Priv.ATGEN;
32 GSM_SAT_Measure_results MeasureResult; 32 GSM_SAT_Measure_results MeasureResult;
33 unsigned char buf[256]; 33 unsigned char buf[256];
34 int length,i,rep,ChNo=1,j=0,result=0,origARFCN=0; 34 int length,i,rep,ChNo=1,j=0,result=0,origARFCN=0;
35 int freq_tmp,frequency[24]; 35 int freq_tmp,frequency[24];
36 GSM_NetworkInfo Network; 36 GSM_NetworkInfo Network;
37 37
38 if (Priv->ReplyState!=AT_Reply_OK) return ERR_UNKNOWN; 38 if (Priv->ReplyState!=AT_Reply_OK) return ERR_UNKNOWN;
39 if (s->Protocol.Data.AT.EditMode) s->Protocol.Data.AT.EditMode = false; 39 if (s->Protocol.Data.AT.EditMode) s->Protocol.Data.AT.EditMode = false;
40 if (strstr(GetLineString(msg.Buffer,Priv->Lines,2),"SSTK")) { 40 if (strstr(GetLineString(msg.Buffer,Priv->Lines,2),"SSTK")) {
41 length = strlen(GetLineString(msg.Buffer,Priv->Lines,2))-7; 41 length = strlen(GetLineString(msg.Buffer,Priv->Lines,2))-7;
42 DecodeHexBin(buf, GetLineString(msg.Buffer,Priv->Lines,2)+7,length); 42 DecodeHexBin(buf, GetLineString(msg.Buffer,Priv->Lines,2)+7,length);
43 if (buf[0]==0x7f) { 43 if (buf[0]==0x7f) {
44 new_variable=true; 44 new_variable=true;
45 return ERR_NONE; 45 return ERR_NONE;
46 } 46 }
47 else return ERR_UNKNOWN; 47 else return ERR_UNKNOWN;
48 } 48 }
49 if (!strstr(GetLineString(msg.Buffer,Priv->Lines,3),"SSTK")) return ERR_UNKNOWN; 49 if (!strstr(GetLineString(msg.Buffer,Priv->Lines,3),"SSTK")) return ERR_UNKNOWN;
50 50
51 length = strlen(GetLineString(msg.Buffer,Priv->Lines,3))-7; 51 length = strlen(GetLineString(msg.Buffer,Priv->Lines,3))-7;
52 DecodeHexBin(buf, GetLineString(msg.Buffer,Priv->Lines,3)+7,length); 52 DecodeHexBin(buf, GetLineString(msg.Buffer,Priv->Lines,3)+7,length);
53 53
54 if (buf[3]!=0x26) return ERR_UNKNOWN; 54 if (buf[3]!=0x26) return ERR_UNKNOWN;
55 55
56#ifdef DEBUG 56#ifdef DEBUG
57 dbgprintf ("SAT command: Provide Local Information\nFunction: "); 57 dbgprintf ("SAT command: Provide Local Information\nFunction: ");
58 switch (buf[4]) { 58 switch (buf[4]) {
59 case 00: dbgprintf ("Loc Info\n"); break; 59 case 00: dbgprintf ("Loc Info\n"); break;
60 case 01: dbgprintf ("IMEI\n"); break; 60 case 01: dbgprintf ("IMEI\n"); break;
61 case 02: dbgprintf ("Network Measure\n"); break; 61 case 02: dbgprintf ("Network Measure\n"); break;
62 case 03: dbgprintf ("Date time and timezone\n");break; 62 case 03: dbgprintf ("Date time and timezone\n");break;
63 case 04: dbgprintf ("Language setting\n"); break; 63 case 04: dbgprintf ("Language setting\n"); break;
64 case 05: dbgprintf ("Timing advance\n"); break; 64 case 05: dbgprintf ("Timing advance\n"); break;
65 } 65 }
66#endif 66#endif
67 /* Loc Info (MCC, MNC, LAC, Cell ID) */ 67 /* Loc Info (MCC, MNC, LAC, Cell ID) */
68 if (buf[4]==00) { 68 if (buf[4]==00) {
69 DecodeBCD (Network.NetworkCode,buf+14,2); 69 DecodeBCD (Network.NetworkCode,buf+14,2);
70 Network.NetworkCode[3] = ' '; 70 Network.NetworkCode[3] = ' ';
71 DecodeBCD (Network.NetworkCode+4,buf+16,1); 71 DecodeBCD (Network.NetworkCode+4,buf+16,1);
72 EncodeHexBin (Network.LAC,buf+17,2); 72 EncodeHexBin (Network.LAC,buf+17,2);
73 EncodeHexBin (Network.CID,buf+19,2); 73 EncodeHexBin (Network.CID,buf+19,2);
74 74
75 printf(" Network code : %s\n",Network.NetworkCode); 75 printf(" Network code : %s\n",Network.NetworkCode);
76 printf(" Network name for Gammu : %s\n", 76 printf(" Network name for Gammu : %s\n",
77 DecodeUnicodeString(GSM_GetNetworkName(Network.NetworkCode))); 77 DecodeUnicodeString(GSM_GetNetworkName(Network.NetworkCode)));
78 printf(" CID : %s\n",Network.CID); 78 printf(" CID : %s\n",Network.CID);
79 printf(" LAC : %s\n",Network.LAC); 79 printf(" LAC : %s\n",Network.LAC);
80 } 80 }
81 81
82 /* Network Measure */ 82 /* Network Measure */
83 if (buf[4]==02) { 83 if (buf[4]==02) {
84 84
85 for (i=0;i<24;i++) frequency[i]=0; 85 for (i=0;i<24;i++) frequency[i]=0;
86 if (!new_variable) { 86 if (!new_variable) {
87 GetBufferI(buf+32,&j,&result,7); 87 GetBufferI(buf+32,&j,&result,7);
88 result &= 0x67; 88 result &= 0x67;
89 if (result !=0x47) return ERR_NOTSUPPORTED; 89 if (result !=0x47) return ERR_NOTSUPPORTED;
90 } 90 }
91#ifdef DEBUG 91#ifdef DEBUG
92 if (new_variable)dbgprintf ("New variable Bitmap format\n"); 92 if (new_variable)dbgprintf ("New variable Bitmap format\n");
93 else dbgprintf ("Old variable Bitmap format\n"); 93 else dbgprintf ("Old variable Bitmap format\n");
94#endif 94#endif
95 GetBufferI(buf+32,&j,&origARFCN,10); 95 GetBufferI(buf+32,&j,&origARFCN,10);
96 /* 10 bit origin ARFCN or first frequency (new variable format) */ 96 /* 10 bit origin ARFCN or first frequency (new variable format) */
97#ifdef DEBUG 97#ifdef DEBUG
98 dbgprintf("Origin BCCH = %i\n",origARFCN); 98 dbgprintf("Origin BCCH = %i\n",origARFCN);
99#endif 99#endif
100 rep = buf[31]*8; 100 rep = buf[31]*8;
101 if (!new_variable ){ 101 if (!new_variable ){
102 for (i=0;i<rep;i++){ 102 for (i=0;i<rep;i++){
103 result = 0; 103 result = 0;
104 GetBufferI(buf+32,&j,&result,1); 104 GetBufferI(buf+32,&j,&result,1);
105 if (result) { 105 if (result) {
106 frequency[ChNo]=i+origARFCN+1; 106 frequency[ChNo]=i+origARFCN+1;
107 ChNo++; 107 ChNo++;
108 } 108 }
109 } 109 }
110 } 110 }
111 else { 111 else {
112 frequency[ChNo++]=origARFCN; 112 frequency[ChNo++]=origARFCN;
113 for (i=0; i<rep; i+=10){ 113 for (i=0; i<rep; i+=10){
114 result = 0; 114 result = 0;
115 GetBufferI(buf+32,&j,&result,10); 115 GetBufferI(buf+32,&j,&result,10);
116 if (!result) break; 116 if (!result) break;
117 frequency[ChNo++]=result; 117 frequency[ChNo++]=result;
118 } 118 }
119 j=1; 119 j=1;
120 while (j) { 120 while (j) {
121 j=0; 121 j=0;
122 for (i=0; i<ChNo-1; i++){ 122 for (i=0; i<ChNo-1; i++){
123 if (frequency[i] > frequency[i+1]){ 123 if (frequency[i] > frequency[i+1]){
124 freq_tmp=frequency[i]; 124 freq_tmp=frequency[i];
125 frequency[i]=frequency[i+1]; 125 frequency[i]=frequency[i+1];
126 frequency[i+1]=freq_tmp; 126 frequency[i+1]=freq_tmp;
127 j=1; 127 j=1;
128 } 128 }
129 } 129 }
130 } 130 }
131 }; 131 };
132#ifdef DEBUG 132#ifdef DEBUG
133 dbgprintf("Neighbor BCCH list: "); 133 dbgprintf("Neighbor BCCH list: ");
134 for (i=1;i<ChNo;i++) dbgprintf ("%d ",frequency[i]); 134 for (i=1;i<ChNo;i++) dbgprintf ("%d ",frequency[i]);
135 dbgprintf ("\n"); 135 dbgprintf ("\n");
136#endif 136#endif
137 j= 0; 137 j= 0;
138 result= 0; 138 result= 0;
139 GetBufferI(buf+14,&j,&result,1); 139 GetBufferI(buf+14,&j,&result,1);
140 if (result) MeasureResult.BA_used=true; 140 if (result) MeasureResult.BA_used=true;
141 else MeasureResult.BA_used=false; 141 else MeasureResult.BA_used=false;
142 142
143 result= 0; 143 result= 0;
144 GetBufferI(buf+14,&j,&result,1); 144 GetBufferI(buf+14,&j,&result,1);
145 if (result) MeasureResult.DTX_used=true; 145 if (result) MeasureResult.DTX_used=true;
146 else MeasureResult.DTX_used=false; 146 else MeasureResult.DTX_used=false;
147 147
148 result= 0; 148 result= 0;
149 GetBufferI(buf+14,&j,&result,6); 149 GetBufferI(buf+14,&j,&result,6);
150 MeasureResult.RXLEV_FullServicingCell=result-110; 150 MeasureResult.RXLEV_FullServicingCell=result-110;
151 151
152 j++;//skip spare bit 152 j++;//skip spare bit
153 result= 0; 153 result= 0;
154 GetBufferI(buf+14,&j,&result,1); 154 GetBufferI(buf+14,&j,&result,1);
155 if (result) MeasureResult.MeasValid=true; 155 if (result) MeasureResult.MeasValid=true;
156 else MeasureResult.MeasValid=false; 156 else MeasureResult.MeasValid=false;
157 157
158 result= 0; 158 result= 0;
159 GetBufferI(buf+14,&j,&result,6); 159 GetBufferI(buf+14,&j,&result,6);
160 MeasureResult.RXLEV_SubServicingCell=result-110; 160 MeasureResult.RXLEV_SubServicingCell=result-110;
161 161
162 j++;//skip spare bit 162 j++;//skip spare bit
163 result= 0; 163 result= 0;
164 GetBufferI(buf+14,&j,&result,3); 164 GetBufferI(buf+14,&j,&result,3);
165 MeasureResult.RXQUAL_FullServicingCell=result; 165 MeasureResult.RXQUAL_FullServicingCell=result;
166 166
167 result= 0; 167 result= 0;
168 GetBufferI(buf+14,&j,&result,3); 168 GetBufferI(buf+14,&j,&result,3);
169 MeasureResult.RXQUAL_SubServicingCell=result; 169 MeasureResult.RXQUAL_SubServicingCell=result;
170 170
171 printf ("RX Level FULL Servicing Cell = %i\n",MeasureResult.RXLEV_FullServicingCell); 171 printf ("RX Level FULL Servicing Cell = %i\n",MeasureResult.RXLEV_FullServicingCell);
172 printf ("RX Level Sub Servicing Cell = %i\n",MeasureResult.RXLEV_FullServicingCell); 172 printf ("RX Level Sub Servicing Cell = %i\n",MeasureResult.RXLEV_FullServicingCell);
173 173
174 printf ("RX Quality Full Servicing Cell = %i\n",MeasureResult.RXQUAL_FullServicingCell); 174 printf ("RX Quality Full Servicing Cell = %i\n",MeasureResult.RXQUAL_FullServicingCell);
175 printf ("RX Quality Sub Servicing Cell = %i\n",MeasureResult.RXQUAL_SubServicingCell); 175 printf ("RX Quality Sub Servicing Cell = %i\n",MeasureResult.RXQUAL_SubServicingCell);
176 176
177 result= 0; 177 result= 0;
178 GetBufferI(buf+14,&j,&result,3); 178 GetBufferI(buf+14,&j,&result,3);
179 MeasureResult.NO_NCELL_M=result; 179 MeasureResult.NO_NCELL_M=result;
180 180
181 rep=MeasureResult.NO_NCELL_M; 181 rep=MeasureResult.NO_NCELL_M;
182 182
183 for (i=0;i<MeasureResult.NO_NCELL_M;i++) { 183 for (i=0;i<MeasureResult.NO_NCELL_M;i++) {
184 result= 0; 184 result= 0;
185 GetBufferI(buf+14,&j,&result,6); 185 GetBufferI(buf+14,&j,&result,6);
186 MeasureResult.NeighbourCell[i].RxLev = result-110; 186 MeasureResult.NeighbourCell[i].RxLev = result-110;
187 187
188 result= 0; 188 result= 0;
189 GetBufferI(buf+14,&j,&result,5); 189 GetBufferI(buf+14,&j,&result,5);
190 if (new_variable) 190 if (new_variable)
191 MeasureResult.NeighbourCell[i].ChFreq = frequency[result+1]; 191 MeasureResult.NeighbourCell[i].ChFreq = frequency[result+1];
192 else MeasureResult.NeighbourCell[i].ChFreq = frequency[result]; 192 else MeasureResult.NeighbourCell[i].ChFreq = frequency[result];
193 193
194 result= 0; 194 result= 0;
195 GetBufferI(buf+14,&j,&result,3); 195 GetBufferI(buf+14,&j,&result,3);
196 MeasureResult.NeighbourCell[i].NB = 10 * result; 196 MeasureResult.NeighbourCell[i].NB = 10 * result;
197 result= 0; 197 result= 0;
198 GetBufferI(buf+14,&j,&result,3); 198 GetBufferI(buf+14,&j,&result,3);
199 MeasureResult.NeighbourCell[i].NB += result; 199 MeasureResult.NeighbourCell[i].NB += result;
200 200
201 if (MeasureResult.NeighbourCell[i].ChFreq) 201 if (MeasureResult.NeighbourCell[i].ChFreq)
202 printf("CH = %i,\t",MeasureResult.NeighbourCell[i].ChFreq); 202 printf("CH = %i,\t",MeasureResult.NeighbourCell[i].ChFreq);
203 else 203 else
204 printf("CH = Unknown\t"); 204 printf("CH = Unknown\t");
205 printf("RX Lev = %i dBm\t",MeasureResult.NeighbourCell[i].RxLev); 205 printf("RX Lev = %i dBm\t",MeasureResult.NeighbourCell[i].RxLev);
206 printf("BSIC CELL = %i\n",MeasureResult.NeighbourCell[i].NB); 206 printf("BSIC CELL = %i\n",MeasureResult.NeighbourCell[i].NB);
207 } 207 }
208 } 208 }
209#ifdef DEBUG 209#ifdef DEBUG
210 if (buf[4]==05) { //Timing Advance 210 if (buf[4]==05) { //Timing Advance
211 if (buf[11]) dbgprintf ("Unknown Timing Advance\n"); 211 if (buf[11]) dbgprintf ("Unknown Timing Advance\n");
212 else dbgprintf ("Timing Advance = %i\n",buf[14] & 0x3f); 212 else dbgprintf ("Timing Advance = %i\n",buf[14] & 0x3f);
213 } 213 }
214#endif 214#endif
215 return ERR_NONE; 215 return ERR_NONE;
216} 216}
217 217
218GSM_Error ATSIEMENS_Reply_GetNetmon(GSM_Protocol_Message msg, GSM_StateMachine *s) 218GSM_Error ATSIEMENS_Reply_GetNetmon(GSM_Protocol_Message msg, GSM_StateMachine *s)
219{ 219{
220 GSM_Phone_ATGENData*Priv = &s->Phone.Data.Priv.ATGEN; 220 GSM_Phone_ATGENData*Priv = &s->Phone.Data.Priv.ATGEN;
221 int i=2; 221 int i=2;
222 222
223 if (!strstr(GetLineString(msg.Buffer,Priv->Lines,1),"AT^S^MI")) return ERR_UNKNOWN; 223 if (!strstr(GetLineString(msg.Buffer,Priv->Lines,1),"AT^S^MI")) return ERR_UNKNOWN;
224 while (strlen(GetLineString(msg.Buffer,Priv->Lines,i+1))) 224 while (strlen(GetLineString(msg.Buffer,Priv->Lines,i+1)))
225 printf("%s\n",GetLineString(msg.Buffer,Priv->Lines,i++)); 225 printf("%s\n",GetLineString(msg.Buffer,Priv->Lines,i++));
226 printf("\n"); 226 printf("\n");
227 return ERR_NONE; 227 return ERR_NONE;
228} 228}
229 229
230GSM_Error ATSIEMENS_GetSAT(GSM_StateMachine *s) 230GSM_Error ATSIEMENS_GetSAT(GSM_StateMachine *s)
231{ 231{
232 GSM_Phone_ATGENData*Priv = &s->Phone.Data.Priv.ATGEN; 232 GSM_Phone_ATGENData*Priv = &s->Phone.Data.Priv.ATGEN;
233 GSM_Error error; 233 GSM_Error error;
234 unsigned char *reqSAT[]= {"D009810301260082028182", 234 unsigned char *reqSAT[]= {"D009810301260082028182",
235 "D009810301260282028182", 235 "D009810301260282028182",
236 "D009810301260582028182"},req[32]; 236 "D009810301260582028182"},req[32];
237 int i,len; 237 int i,len;
238 238
239 if (Priv->Manufacturer!=AT_Siemens) return ERR_NOTSUPPORTED; 239 if (Priv->Manufacturer!=AT_Siemens) return ERR_NOTSUPPORTED;
240 240
241 sprintf(req, "AT^SSTK=?\r"); 241 sprintf(req, "AT^SSTK=?\r");
242 error = GSM_WaitFor (s, req, strlen(req), 0x00, 3, ID_User1); 242 error = GSM_WaitFor (s, req, strlen(req), 0x00, 3, ID_User1);
243 243
244 for (i=0;i<3;i++){ 244 for (i=0;i<3;i++){
245 len = strlen(reqSAT[i]); 245 len = strlen(reqSAT[i]);
246 s->Protocol.Data.AT.EditMode = true; 246 s->Protocol.Data.AT.EditMode = true;
247 sprintf(req, "AT^SSTK=%i,1\r",len/2); 247 sprintf(req, "AT^SSTK=%i,1\r",len/2);
248 error = GSM_WaitFor (s, req, strlen(req), 0x00, 3, ID_User1); 248 error = GSM_WaitFor (s, req, strlen(req), 0x00, 3, ID_User1);
249 s->Phone.Data.DispatchError= ERR_TIMEOUT; 249 s->Phone.Data.DispatchError= ERR_TIMEOUT;
250 s->Phone.Data.RequestID = ID_User1; 250 s->Phone.Data.RequestID = ID_User1;
251 error = s->Protocol.Functions->WriteMessage(s, reqSAT[i], len, 0x00); 251 error = s->Protocol.Functions->WriteMessage(s, reqSAT[i], len, 0x00);
252 if (error!=ERR_NONE) return error; 252 if (error!=ERR_NONE) return error;
253 error = s->Protocol.Functions->WriteMessage(s, "\x1A", 1, 0x00); 253 error = s->Protocol.Functions->WriteMessage(s, "\x1A", 1, 0x00);
254 if (error!=ERR_NONE) return error; 254 if (error!=ERR_NONE) return error;
255 error = GSM_WaitForOnce (s, NULL,0x00, 0x00, 4); 255 error = GSM_WaitForOnce (s, NULL,0x00, 0x00, 4);
256 if (error!=ERR_NONE) return error; 256 if (error!=ERR_NONE) return error;
257 } 257 }
258 return ERR_NONE; 258 return ERR_NONE;
259} 259}
260 260
261GSM_Error ATSIEMENS_GetNetmon(GSM_StateMachine *s,int test_no) 261GSM_Error ATSIEMENS_GetNetmon(GSM_StateMachine *s,int test_no)
262{ 262{
263 GSM_Phone_ATGENData*Priv = &s->Phone.Data.Priv.ATGEN; 263 GSM_Phone_ATGENData*Priv = &s->Phone.Data.Priv.ATGEN;
264 unsigned char req[32]; 264 unsigned char req[32];
265 265
266 if (Priv->Manufacturer!=AT_Siemens) return ERR_NOTSUPPORTED; 266 if (Priv->Manufacturer!=AT_Siemens) return ERR_NOTSUPPORTED;
267 sprintf(req, "AT^S^MI=%d\r",test_no); 267 sprintf(req, "AT^S^MI=%d\r",test_no);
268 printf ("Siemens NetMonitor test #%i\n",test_no); 268 printf ("Siemens NetMonitor test #%i\n",test_no);
269 return GSM_WaitFor(s, req, strlen(req), 0x00, 3, ID_User2); 269 return GSM_WaitFor(s, req, strlen(req), 0x00, 3, ID_User2);
270} 270}
271 271
272GSM_Error ATSIEMENS_ActivateNetmon (GSM_StateMachine *s,int netmon_type) 272GSM_Error ATSIEMENS_ActivateNetmon (GSM_StateMachine *s,int netmon_type)
273{ 273{
274 GSM_Phone_ATGENData*Priv = &s->Phone.Data.Priv.ATGEN; 274 GSM_Phone_ATGENData*Priv = &s->Phone.Data.Priv.ATGEN;
275 unsigned char req[32]; 275 unsigned char req[32];
276 276
277 if (Priv->Manufacturer!=AT_Siemens) return ERR_NOTSUPPORTED; 277 if (Priv->Manufacturer!=AT_Siemens) return ERR_NOTSUPPORTED;
278 278
279 sprintf(req, "AT\r"); 279 sprintf(req, "AT\r");
280 printf ("Activate Siemens NetMonitor\n"); 280 printf ("Activate Siemens NetMonitor\n");
281 siemens_code (req,req,2); 281 siemens_code (req,req,2);
282 282
283 return GSM_WaitFor(s, req, strlen(req), 0x00, 3, ID_User2); 283 return GSM_WaitFor(s, req, strlen(req), 0x00, 3, ID_User2);
284} 284}
285 285
286void ATSIEMENSActivateNetmon(int argc, char *argv[]) 286void ATSIEMENSActivateNetmon(int argc, char *argv[])
287{ 287{
288 GSM_MemoryStatus status; 288 GSM_MemoryStatus status;
289 GSM_MemoryEntry pbk; 289 GSM_MemoryEntry pbk;
290 int netmon_type, pbk_maxlocation; 290 int netmon_type, pbk_maxlocation;
291 char imsi[15], NetMonCode[32]; 291 char imsi[15], NetMonCode[32];
292 292
293 GSM_Init(true); 293 GSM_Init(true);
294 if (CheckSiemens()==ERR_NOTSUPPORTED) Print_Error(ERR_NOTSUPPORTED); 294 if (CheckSiemens()==ERR_NOTSUPPORTED) Print_Error(ERR_NOTSUPPORTED);
295 s.User.UserReplyFunctions=UserReplyFunctionsAtS; 295 s.User.UserReplyFunctions=UserReplyFunctionsAtS;
296 296
297 printf ("Activate NetMonitor...\n"); 297 printf ("Activate NetMonitor...\n");
298 netmon_type = atoi(argv[2]); 298 netmon_type = atoi(argv[2]);
299 299
300 if ((netmon_type==1) || (netmon_type==2)) { 300 if ((netmon_type==1) || (netmon_type==2)) {
301 error = ATGEN_GetSIMIMSI (&s,imsi); 301 error = ATGEN_GetSIMIMSI (&s,imsi);
302 Print_Error(error); 302 Print_Error(error);
303 siemens_code(imsi,NetMonCode,netmon_type); 303 siemens_code(imsi,NetMonCode,netmon_type);
304 304
305 status.MemoryType = MEM_SM; 305 status.MemoryType = MEM_SM;
306 error = ATGEN_GetMemoryStatus (&s,&status); 306 error = ATGEN_GetMemoryStatus (&s,&status);
307 Print_Error(error); 307 Print_Error(error);
308 308
309 pbk_maxlocation = status.MemoryUsed+status.MemoryFree; 309 pbk_maxlocation = status.MemoryUsed+status.MemoryFree;
310 pbk.MemoryType = MEM_SM; 310 pbk.MemoryType = MEM_SM;
311 pbk.Location = pbk_maxlocation; 311 pbk.Location = pbk_maxlocation;
312 pbk.EntriesNum = 2; 312 pbk.EntriesNum = 2;
313 pbk.Entries[0].EntryType = PBK_Number_General; 313 pbk.Entries[0].EntryType = PBK_Number_General;
314 EncodeUnicode (pbk.Entries[0].Text,NetMonCode,strlen(NetMonCode)); 314 EncodeUnicode (pbk.Entries[0].Text,NetMonCode,strlen(NetMonCode));
315 pbk.Entries[1].EntryType = PBK_Text_Name; 315 pbk.Entries[1].EntryType = PBK_Text_Name;
316 sprintf (NetMonCode,"Net Monitor"); 316 sprintf (NetMonCode,"Net Monitor");
317 EncodeUnicode (pbk.Entries[1].Text,NetMonCode,strlen(NetMonCode)); 317 EncodeUnicode (pbk.Entries[1].Text,NetMonCode,strlen(NetMonCode));
318 error = ATGEN_SetMemory (&s, &pbk); 318 error = ATGEN_SetMemory (&s, &pbk);
319 Print_Error(error); 319 Print_Error(error);
320 } 320 }
321 else printf ("NetMonitor type should be:\n1 - full Netmon\n2 - simple NetMon\n"); 321 else printf ("NetMonitor type should be:\n1 - full Netmon\n2 - simple NetMon\n");
322 322
323 GSM_Terminate(); 323 GSM_Terminate();
324} 324}
325 325
326void ATSIEMENSSATNetmon(int argc, char *argv[]) 326void ATSIEMENSSATNetmon(int argc, char *argv[])
327{ 327{
328 GSM_Init(true); 328 GSM_Init(true);
329 if (CheckSiemens()==ERR_NOTSUPPORTED) Print_Error(ERR_NOTSUPPORTED); 329 if (CheckSiemens()==ERR_NOTSUPPORTED) Print_Error(ERR_NOTSUPPORTED);
330 s.User.UserReplyFunctions=UserReplyFunctionsAtS; 330 s.User.UserReplyFunctions=UserReplyFunctionsAtS;
331 331
332 printf ("Getting Siemens Sim Aplication Toolkit NetMonitor...\n"); 332 printf ("Getting Siemens Sim Aplication Toolkit NetMonitor...\n");
333 333
334 error=ATSIEMENS_GetSAT(&s); 334 error=ATSIEMENS_GetSAT(&s);
335 Print_Error(error); 335 Print_Error(error);
336 GSM_Terminate(); 336 GSM_Terminate();
337} 337}
338 338
339void ATSIEMENSNetmonitor(int argc, char *argv[]) 339void ATSIEMENSNetmonitor(int argc, char *argv[])
340{ 340{
341 int test_no; 341 int test_no;
342 342
343 GSM_Init(true); 343 GSM_Init(true);
344 if (CheckSiemens()==ERR_NOTSUPPORTED) Print_Error(ERR_NOTSUPPORTED); 344 if (CheckSiemens()==ERR_NOTSUPPORTED) Print_Error(ERR_NOTSUPPORTED);
345 s.User.UserReplyFunctions=UserReplyFunctionsAtS; 345 s.User.UserReplyFunctions=UserReplyFunctionsAtS;
346 346
347 printf ("Getting Siemens NetMonitor...\n"); 347 printf ("Getting Siemens NetMonitor...\n");
348 test_no = atoi(argv[2]); 348 test_no = atoi(argv[2]);
349 error = ATSIEMENS_GetNetmon (&s,test_no+1); 349 error = ATSIEMENS_GetNetmon (&s,test_no+1);
350 Print_Error(error); 350 Print_Error(error);
351 GSM_Terminate(); 351 GSM_Terminate();
352} 352}
353 353
354static GSM_Reply_Function UserReplyFunctionsAtS[] = { 354static GSM_Reply_Function UserReplyFunctionsAtS[] = {
355 {ATSIEMENS_Reply_GetSAT, "AT^SSTK", 0x00,0x00,ID_User1}, 355 {ATSIEMENS_Reply_GetSAT, "AT^SSTK", 0x00,0x00,ID_User1},
356 {ATSIEMENS_Reply_GetNetmon, "AT^S^MI", 0x00,0x00,ID_User2}, 356 {ATSIEMENS_Reply_GetNetmon, "AT^S^MI", 0x00,0x00,ID_User2},
357 {NULL, "\x00", 0x00,0x00,ID_None} 357 {NULL, "\x00", 0x00,0x00,ID_None}
358}; 358};
359#endif 359#endif
360 360
361/* How should editor hadle tabs in this file? Add editor commands here. 361/* How should editor hadle tabs in this file? Add editor commands here.
362 * vim: noexpandtab sw=8 ts=8 sts=8: 362 * vim: noexpandtab sw=8 ts=8 sts=8:
363 */ 363 */