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
16 /* "Turn on" prototypes in n-sniff.h */
20 /* System header files */
27 #include "devices/device.h"
31 /* Various header file */
37 #include "gsm-common.h"
38 #include "files/cfgreader.h"
39 #include "newmodules/sniff/sniff.h"
40 #include "newmodules/n6110.h"
41 #include "newmodules/n7110.h"
42 #include "gsm-networks.h"
44 /* Global variables used by code in gsm-api.c to expose the functions
45 supported by this model of phone. */
48 static char *realmodel; /* Model from .gnokiirc file. */
49 static char *Port; /* Port from .gnokiirc file */
50 static char *Initlength; /* Init length from .gnokiirc file */
51 static char *Connection; /* Connection type from .gnokiirc file */
52 static char *SynchronizeTime; /* If we set date and time from computer to phone (from .gnokiirc file) */
53 static char *BinDir; /* Binaries directory from .gnokiirc file - not used here yet */
54 static GSM_ConnectionType connectiontype;
62 /* Here we initialise model specific functions. */
64 GSM_Functions Nsniff_Functions = {
66 Nsniff_DispatchMessage,
125 NOTSUPPORTED, NOTSUPPORTED,
139 /* for all these Phones we support sniff */
141 GSM_Information Nsniff_Information = {
142 "3210sniff|3310sniff|3330sniff|5110sniff|5130sniff|5190sniff|6110sniff|6130sniff|6150sniff|6190sniff|8210sniff|8850sniff|6210sniff|6250sniff|7110sniff",
143 /* Supported models in FBUS */
144 "3210sniff|3310sniff|3330sniff|5110sniff|5130sniff|5190sniff|6110sniff|6130sniff|6150sniff|6190sniff|8210sniff|8850sniff|6210sniff|6250sniff|7110sniff",
145 /* Supported models in MBUS */
147 /* Supported models in FBUS over infrared */
149 /* Supported models in FBUS over DLR3 */
151 "6210decode|6250decode|7110decode", /* Supported models in FBUS over Irda sockets */
153 4, /* Max RF Level */
154 0, /* Min RF Level */
155 GRF_Arbitrary, /* RF level units */
156 4, /* Max Battery Level */
157 0, /* Min Battery Level */
158 GBU_Arbitrary, /* Battery level units */
159 GDT_None, /* No date/time support */
160 GDT_None, /* No alarm support */
161 0 /* Max alarms = 0 */
164 /* Initialise variables and state machine. */
165 GSM_Error Nsniff_Initialise(char *port_device, char *initlength,
166 GSM_ConnectionType connection,
167 void (*rlp_callback)(RLP_F96Frame *frame))
170 GSM_PhonebookEntry phonebook;
173 GSM_MemoryStatus status;
174 GSM_NetworkInfo netinfo;
175 GSM_SMSStatus smsstatus;
176 GSM_SMSFolders folders;
177 GSM_MessageCenter smsc;
179 GSM_SecurityCode seccode;
182 GSM_CalendarNote note;
188 GSM_BinRingtone binring;
189 GSM_AllSimlocks siml; if (Protocol->Initialise(port_device,initlength,connection,rlp_callback)!=GE_NONE)
191 return GE_NOTSUPPORTED;
194 CurrentLinkOK = true;
196 CurrentPhonebookEntry=&phonebook;
197 CurrentSpeedDialEntry=&speed;
198 CurrentSMSMessage=&sms;
199 CurrentMemoryStatus=&status;
200 CurrentNetworkInfo=&netinfo;
201 CurrentSMSStatus=&smsstatus;
202 CurrentSMSFolders=&folders;
203 CurrentMessageCenter=&smsc;
204 CurrentSecurityCodeStatus=&secstatus;
205 CurrentSecurityCode=&seccode;
206 CurrentDateTime=&date;
208 CurrentCalendarNote=¬e;
209 CurrentNetmonitor=&netmon;
210 CurrentGetBitmap=&logo;
211 CurrentProfile=&profile;
212 CurrentCBMessage=&cb;
213 CurrentGetOperatorNameNetwork=&netname;
214 CurrentGetBinRingtone=&binring;
215 CurrentSimLock=⪝
217 /* Read config file, once again to get real model */
218 if (CFG_ReadConfig(&realmodel, &Port, &Initlength, &Connection, &BinDir, &SynchronizeTime,false) < 0) {
222 connectiontype = GetConnectionTypeFromString(Connection);
227 void Nsniff_DispatchMessage(u16 MessageLength, u8 *MessageBuffer, u8 MessageType)
230 /* switch to real Model */
231 if (CheckModel (N6110_Information, realmodel, connectiontype))
232 N6110_DispatchMessage( MessageLength, MessageBuffer, MessageType);
234 if (CheckModel (N7110_Information, realmodel, connectiontype))
235 N7110_DispatchMessage( MessageLength, MessageBuffer, MessageType);