5 A Linux/Unix toolset and driver for Nokia mobile phones.
\r
7 Released under the terms of the GNU GPL, see file COPYING for more details.
\r
9 This file provides an API for accessing functions on the sniff and similar
\r
14 /* "Turn on" prototypes in n-sniff.h */
\r
16 #define __n_sniff_c
\r
18 /* System header files */
\r
25 #include "devices/device.h"
\r
29 /* Various header file */
\r
34 #include "gsm-api.h"
\r
35 #include "gsm-common.h"
\r
36 #include "files/cfgreader.h"
\r
37 #include "newmodules/sniff/sniff.h"
\r
38 #include "newmodules/n6110.h"
\r
39 #include "newmodules/n7110.h"
\r
40 #include "gsm-networks.h"
\r
42 /* Global variables used by code in gsm-api.c to expose the functions
\r
43 supported by this model of phone. */
\r
46 static char *realmodel; /* Model from .gnokiirc file. */
47 static char *Port; /* Port from .gnokiirc file */
48 static char *Initlength; /* Init length from .gnokiirc file */
49 static char *Connection; /* Connection type from .gnokiirc file */
50 static char *SynchronizeTime; /* If we set date and time from computer to phone (from .gnokiirc file) */
51 static char *BinDir; /* Binaries directory from .gnokiirc file - not used here yet */
52 static GSM_ConnectionType connectiontype;
60 /* Here we initialise model specific functions. */
\r
62 GSM_Functions Nsniff_Functions = {
\r
64 Nsniff_DispatchMessage,
\r
123 NOTSUPPORTED,
\r NOTSUPPORTED,
137 /* for all these Phones we support sniff */
\r
139 GSM_Information Nsniff_Information = {
\r
140 "3210sniff|3310sniff|3330sniff|5110sniff|5130sniff|5190sniff|6110sniff|6130sniff|6150sniff|6190sniff|8210sniff|8850sniff|6210sniff|6250sniff|7110sniff",
\r
141 /* Supported models in FBUS */
\r
142 "3210sniff|3310sniff|3330sniff|5110sniff|5130sniff|5190sniff|6110sniff|6130sniff|6150sniff|6190sniff|8210sniff|8850sniff|6210sniff|6250sniff|7110sniff",
\r
143 /* Supported models in MBUS */
\r
145 /* Supported models in FBUS over infrared */
\r
147 /* Supported models in FBUS over DLR3 */
\r
149 "6210decode|6250decode|7110decode", /* Supported models in FBUS over Irda sockets */
151 4, /* Max RF Level */
\r
152 0, /* Min RF Level */
\r
153 GRF_Arbitrary, /* RF level units */
\r
154 4, /* Max Battery Level */
\r
155 0, /* Min Battery Level */
\r
156 GBU_Arbitrary, /* Battery level units */
\r
157 GDT_None, /* No date/time support */
\r
158 GDT_None, /* No alarm support */
\r
159 0 /* Max alarms = 0 */
\r
162 /* Initialise variables and state machine. */
\r
163 GSM_Error Nsniff_Initialise(char *port_device, char *initlength,
\r
164 GSM_ConnectionType connection,
\r
165 void (*rlp_callback)(RLP_F96Frame *frame))
\r
168 GSM_PhonebookEntry phonebook;
\r
169 GSM_SpeedDial speed;
\r
170 GSM_SMSMessage sms;
\r
171 GSM_MemoryStatus status;
\r
172 GSM_NetworkInfo netinfo;
\r
173 GSM_SMSStatus smsstatus;
\r
174 GSM_SMSFolders folders;
175 GSM_MessageCenter smsc;
\r
177 GSM_SecurityCode seccode;
\r
179 GSM_DateTime alarm;
\r
180 GSM_CalendarNote note;
\r
183 GSM_Profile profile;
\r
185 GSM_Network netname;
\r
186 GSM_BinRingtone binring;
187 GSM_AllSimlocks siml;
\r \r if (Protocol->Initialise(port_device,initlength,connection,rlp_callback)!=GE_NONE)
\r
189 return GE_NOTSUPPORTED;
\r
192 CurrentLinkOK = true;
\r
194 CurrentPhonebookEntry=&phonebook;
\r
195 CurrentSpeedDialEntry=&speed;
\r
196 CurrentSMSMessage=&sms;
\r
197 CurrentMemoryStatus=&status;
\r
198 CurrentNetworkInfo=&netinfo;
\r
199 CurrentSMSStatus=&smsstatus;
\r
200 CurrentSMSFolders=&folders;
201 CurrentMessageCenter=&smsc;
\r
202 CurrentSecurityCodeStatus=&secstatus;
\r
203 CurrentSecurityCode=&seccode;
\r
204 CurrentDateTime=&date;
\r
205 CurrentAlarm=&alarm;
\r
206 CurrentCalendarNote=¬e;
\r
207 CurrentNetmonitor=&netmon;
\r
208 CurrentGetBitmap=&logo;
\r
209 CurrentProfile=&profile;
\r
210 CurrentCBMessage=&cb;
\r
211 CurrentGetOperatorNameNetwork=&netname;
\r
212 CurrentGetBinRingtone=&binring;
213 CurrentSimLock=⪝
\r \r
215 /* Read config file, once again to get real model */
216 if (CFG_ReadConfig(&realmodel, &Port, &Initlength, &Connection, &BinDir, &SynchronizeTime,false) < 0) {
220 connectiontype = GetConnectionTypeFromString(Connection);
225 void Nsniff_DispatchMessage(u16 MessageLength, u8 *MessageBuffer, u8 MessageType)
228 /* switch to real Model */
229 if (CheckModel (N6110_Information, realmodel, connectiontype))
230 N6110_DispatchMessage( MessageLength, MessageBuffer, MessageType);
232 if (CheckModel (N7110_Information, realmodel, connectiontype))
233 N7110_DispatchMessage( MessageLength, MessageBuffer, MessageType);