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