http://marcin-wiacek.fkn.pl/english/zips/mygnokii.tar.gz
[gnokii.git] / common / data / virtmodem.c
index fe18f6b..7c7f4e2 100644 (file)
@@ -5,8 +5,6 @@
 
   A Linux/Unix toolset and driver for Nokia mobile phones.
 
-  Copyright (C) 1999, 2000 Hugh Blemings & Pavel Janík ml.
-
   Released under the terms of the GNU GPL, see file COPYING for more details.
 
   This file provides a virtual modem interface to the GSM phone by calling
   (AT-emulator) and "online" mode where the data pump code translates data
   from/to the GSM handset and the modem data/fax stream.
 
-  $Log$
-  Revision 1.1.1.1  2001/11/25 21:59:08  short
-  :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Sun Nov 25 22:56 CET 2001
-
-  Revision 1.4  2001/04/14 23:23:43  pkot
-  Fixed problems with grantpt
-
-  Revision 1.3  2001/03/21 23:36:04  chris
-  Added the statemachine
-  This will break gnokii --identify and --monitor except for 6210/7110
-
-  Revision 1.2  2001/02/21 19:57:02  chris
-  More fiddling with the directory layout
-
-  Revision 1.1  2001/02/16 14:29:51  chris
-  Restructure of common/.  Fixed a problem in fbus-phonet.c
-  Lots of dprintfs for Marcin
-  Any size xpm can now be loaded (eg for 7110 startup logos)
-  nk7110 code detects 7110/6210 and alters startup logo size to suit
-  Moved Marcin's extended phonebook code into gnokii.c
-
-  Revision 1.5  2001/01/08 15:11:37  pkot
-  Documentation updates.
-  Fixed some bugs and removed FIXMEs.
-  We need to move some stuff from configure.in to aclocal.m4
-
-  Revision 1.4  2001/01/02 09:09:09  pkot
-  Misc fixes and updates.
-
-  Revision 1.3  2000/12/27 10:54:14  pkot
-  Added Unix98 PTYs support (Michael Mráka).
-
-  
 */
 
 #define                __virtmodem_c
@@ -84,7 +49,7 @@
 
        /* Global variables */
 
-extern bool TerminateThread;
+//extern bool TerminateThread;
 int ConnectCount;
 
        /* Local variables */
@@ -101,7 +66,7 @@ bool                 RequestTerminate;
 
        /* If initialised in debug mode, stdin/out is used instead
           of ptys for interface. */
-bool   VM_Initialise(char *model,char *port, char *initlength, GSM_ConnectionType connection, char *bindir, bool debug_mode, bool GSMInit)
+bool   VM_Initialise(char *model,char *port, char *initlength, GSM_ConnectionType connection, char *bindir, bool debug_mode, bool GSMInit,char *synchronizetime)
 {
        int             rtn;
 
@@ -120,9 +85,10 @@ bool        VM_Initialise(char *model,char *port, char *initlength, GSM_ConnectionType
 #ifdef DEBUG
          fprintf (stderr , "Initialising GSM\n");
 #endif /* DEBUG */
-         if ((VM_GSMInitialise(model, port, initlength, connection) != GE_NONE)) {
+         if ((VM_GSMInitialise(model, port, initlength, connection, synchronizetime) != GE_NONE)) {
                fprintf (stderr, _("VM_Initialise - VM_GSMInitialise failed!\n"));
                return (false);
+               
          }
        }
        GSMInit=false;
@@ -275,7 +241,7 @@ void    VM_CharHandler(void)
       /* Note that file closure etc. should have been dealt with in ThreadLoop */
       
       if (res < 0) {   
-           TerminateThread=true;
+//         TerminateThread=true;
            return;
       }
        
@@ -284,15 +250,14 @@ void    VM_CharHandler(void)
 }     
 
        /* Initialise GSM interface, returning GSM_Error as appropriate  */
-GSM_Error      VM_GSMInitialise(char *model, char *port, char *initlength, GSM_ConnectionType connection)
+GSM_Error      VM_GSMInitialise(char *model, char *port, char *initlength, GSM_ConnectionType connection, char *synchronizetime)
 {
        int             count=0;
        GSM_Error       error;
-       static GSM_Statemachine sm;
 
                /* Initialise the code for the GSM interface. */     
 
-       error = GSM_Initialise(model,port, initlength, connection, RLP_DisplayF96Frame, &sm);
+       error = GSM_Initialise(model,port, initlength, connection, RLP_DisplayF96Frame, synchronizetime);
 
        if (error != GE_NONE) {
                fprintf(stderr, _("GSM/FBUS init failed! (Unknown model ?). Quitting.\n"));