X-Git-Url: https://git.jankratochvil.net/?p=gnokii.git;a=blobdiff_plain;f=common%2Fnewmodules%2Fn3110.c;h=21a4bb9146af7d79a9a7b67d26d8438f2ed5af28;hp=e250180aadcc52178ef14c22fd8c906678c401a7;hb=89539dc60f84e3f8811a470d5c2e0ddb607d744b;hpb=c70d730109945bd20579579213102ae02c764e21 diff --git a/common/newmodules/n3110.c b/common/newmodules/n3110.c index e250180..21a4bb9 100644 --- a/common/newmodules/n3110.c +++ b/common/newmodules/n3110.c @@ -1,106 +1,106 @@ -/* - - G N O K I I - - A Linux/Unix toolset and driver for Nokia mobile phones. - - Released under the terms of the GNU GPL, see file COPYING for more details. - - This file provides an API for accessing functions on the N3110 and similar - phones. - -*/ - -/* "Turn on" prototypes in n-3110.h */ - -#define __n_3110_c - -/* System header files */ -#include -#include -#include - +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + This file provides an API for accessing functions on the N3110 and similar + phones. + +*/ + +/* "Turn on" prototypes in n-3110.h */ + +#define __n_3110_c + +/* System header files */ +#include +#include +#include + #ifdef WIN32 #include "misc_win32.h" #endif -/* Various header file */ -#ifndef VC6 - #include "config.h" -#endif - -#include "misc.h" -#include "gsm-api.h" -#include "gsm-common.h" -#include "files/cfgreader.h" -#include "newmodules/n3110.h" -#include "newmodules/n6110.h" -#include "gsm-networks.h" - -/* Here we initialise model specific functions. */ - -GSM_Functions N3110_Functions = { - N3110_Initialise, - N3110_DispatchMessage, - NULL_Terminate, - NULL_KeepAlive, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, - NOTSUPPORTED, NOTSUPPORTED, +/* Various header file */ +#ifndef VC6 + #include "config.h" +#endif + +#include "misc.h" +#include "gsm-api.h" +#include "gsm-common.h" +#include "files/cfgreader.h" +#include "newmodules/n3110.h" +#include "newmodules/n6110.h" +#include "gsm-networks.h" + +/* Here we initialise model specific functions. */ + +GSM_Functions N3110_Functions = { + N3110_Initialise, + N3110_DispatchMessage, + NULL_Terminate, + NULL_KeepAlive, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, NOTSUPPORTED, NOTSUPPORTED, NOTSUPPORTED, NOTSUPPORTED, @@ -110,37 +110,37 @@ GSM_Functions N3110_Functions = { NOTSUPPORTED, NOTSUPPORTED, NOTSUPPORTED -}; - +}; -/* for all these Phones we support N3110 */ - -GSM_Information N3110_Information = { - "", /* Supported models in FBUS */ - "",/* Supported models in MBUS */ - "",/* Supported models in FBUS over infrared */ - "",/* Supported models in FBUS over DLR3 */ + +/* for all these Phones we support N3110 */ + +GSM_Information N3110_Information = { + "", /* Supported models in FBUS */ + "",/* Supported models in MBUS */ + "",/* Supported models in FBUS over infrared */ + "",/* Supported models in FBUS over DLR3 */ "", "", /* Supported models in FBUS over Irda sockets */ "", "3110|3810|8110|8110i|8148|8148i", /* FBUS version 1 */ - 4, /* Max RF Level */ - 0, /* Min RF Level */ - GRF_Arbitrary, /* RF level units */ - 4, /* Max Battery Level */ - 0, /* Min Battery Level */ - GBU_Arbitrary, /* Battery level units */ - GDT_None, /* No date/time support */ - GDT_None, /* No alarm support */ - 0 /* Max alarms = 0 */ -}; - -/* Initialise variables and state machine. */ -GSM_Error N3110_Initialise(char *port_device, char *initlength, - GSM_ConnectionType connection, - void (*rlp_callback)(RLP_F96Frame *frame)) -{ + 4, /* Max RF Level */ + 0, /* Min RF Level */ + GRF_Arbitrary, /* RF level units */ + 4, /* Max Battery Level */ + 0, /* Min Battery Level */ + GBU_Arbitrary, /* Battery level units */ + GDT_None, /* No date/time support */ + GDT_None, /* No alarm support */ + 0 /* Max alarms = 0 */ +}; + +/* Initialise variables and state machine. */ +GSM_Error N3110_Initialise(char *port_device, char *initlength, + GSM_ConnectionType connection, + void (*rlp_callback)(RLP_F96Frame *frame)) +{ u8 init[20]={0x02, 0x01, 0x07, 0xa2, 0x88, 0x81, 0x21, 0x55, 0x63, 0xa8, 0x00, 0x00, 0x07, 0xa3, 0xb8, 0x81, 0x20, 0x15, 0x63, 0x80}; @@ -150,10 +150,10 @@ GSM_Error N3110_Initialise(char *port_device, char *initlength, int InitLength; GSM_Error error; - if (Protocol->Initialise(port_device,initlength,connection,rlp_callback)!=GE_NONE) - { - return GE_NOTSUPPORTED; - } + if (Protocol->Initialise(port_device,initlength,connection,rlp_callback)!=GE_NONE) + { + return GE_NOTSUPPORTED; + } InitLength = atoi(initlength); @@ -177,14 +177,14 @@ GSM_Error N3110_Initialise(char *port_device, char *initlength, fprintf(stdout,_("Done\n")); #endif - error=NULL_SendMessageSequence (200, &CurrentGetIMEIError, 20, 0x15, init); - if (error!=GE_NONE) return error; - - CurrentLinkOK = true; - - return (GE_NONE); -} - + error=NULL_SendMessageSequence (200, &CurrentGetIMEIError, 20, 0x15, init); + if (error!=GE_NONE) return error; + + CurrentLinkOK = true; + + return (GE_NONE); +} + void N3110_DispatchMessage(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) {