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 N3110 and similar
\r
14 /* "Turn on" prototypes in n-3110.h */
\r
18 /* System header files */
\r
24 #include "misc_win32.h"
27 /* Various header file */
\r
33 #include "gsm-api.h"
\r
34 #include "gsm-common.h"
\r
35 #include "files/cfgreader.h"
\r
36 #include "newmodules/n3110.h"
\r
37 #include "newmodules/n6110.h"
\r
38 #include "gsm-networks.h"
\r
40 /* Here we initialise model specific functions. */
\r
42 GSM_Functions N3110_Functions = {
\r
44 N3110_DispatchMessage,
\r
103 NOTSUPPORTED,
\r NOTSUPPORTED,
117 /* for all these Phones we support N3110 */
\r
119 GSM_Information N3110_Information = {
\r
120 "", /* Supported models in FBUS */
\r
121 "",/* Supported models in MBUS */
\r
122 "",/* Supported models in FBUS over infrared */
\r
123 "",/* Supported models in FBUS over DLR3 */
\r
125 "", /* Supported models in FBUS over Irda sockets */
127 "3110|3810|8110|8110i|8148|8148i", /* FBUS version 1 */
128 4, /* Max RF Level */
\r
129 0, /* Min RF Level */
\r
130 GRF_Arbitrary, /* RF level units */
\r
131 4, /* Max Battery Level */
\r
132 0, /* Min Battery Level */
\r
133 GBU_Arbitrary, /* Battery level units */
\r
134 GDT_None, /* No date/time support */
\r
135 GDT_None, /* No alarm support */
\r
136 0 /* Max alarms = 0 */
\r
139 /* Initialise variables and state machine. */
\r
140 GSM_Error N3110_Initialise(char *port_device, char *initlength,
\r
141 GSM_ConnectionType connection,
\r
142 void (*rlp_callback)(RLP_F96Frame *frame))
\r
144 u8 init[20]={0x02, 0x01, 0x07, 0xa2, 0x88, 0x81, 0x21, 0x55, 0x63, 0xa8,
145 0x00, 0x00, 0x07, 0xa3, 0xb8, 0x81, 0x20, 0x15, 0x63, 0x80};
147 unsigned char init_char = N6110_SYNC_BYTE;
153 \r if (Protocol->Initialise(port_device,initlength,connection,rlp_callback)!=GE_NONE)
\r
155 return GE_NOTSUPPORTED;
\r
158 InitLength = atoi(initlength);
160 if ((strcmp(initlength, "default") == 0) || (InitLength == 0)) {
161 InitLength = 250; /* This is the usual value, lower may work. */
165 fprintf(stdout,_("Writing init chars...."));
168 /* Initialise link with phone or what have you */
169 /* Send init string to phone, this is a bunch of 0x55 characters. Timing is
171 for (count = 0; count < InitLength; count ++) {
173 Protocol->WritePhone(1,&init_char);
177 fprintf(stdout,_("Done\n"));
180 error=NULL_SendMessageSequence (200, &CurrentGetIMEIError, 20, 0x15, init);
\r
181 if (error!=GE_NONE) return error;
\r
183 CurrentLinkOK = true;
\r
189 void N3110_DispatchMessage(u16 MessageLength, u8 *MessageBuffer, u8 MessageType)