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 N3110 and similar
14 /* "Turn on" prototypes in n-3110.h */
18 /* System header files */
24 #include "misc_win32.h"
27 /* Various header file */
34 #include "gsm-common.h"
35 #include "files/cfgreader.h"
36 #include "newmodules/n3110.h"
37 #include "newmodules/n6110.h"
38 #include "gsm-networks.h"
40 /* Here we initialise model specific functions. */
42 GSM_Functions N3110_Functions = {
44 N3110_DispatchMessage,
103 NOTSUPPORTED, NOTSUPPORTED,
117 /* for all these Phones we support N3110 */
119 GSM_Information N3110_Information = {
120 "", /* Supported models in FBUS */
121 "",/* Supported models in MBUS */
122 "",/* Supported models in FBUS over infrared */
123 "",/* Supported models in FBUS over DLR3 */
125 "", /* Supported models in FBUS over Irda sockets */
127 "3110|3810|8110|8110i|8148|8148i", /* FBUS version 1 */
128 4, /* Max RF Level */
129 0, /* Min RF Level */
130 GRF_Arbitrary, /* RF level units */
131 4, /* Max Battery Level */
132 0, /* Min Battery Level */
133 GBU_Arbitrary, /* Battery level units */
134 GDT_None, /* No date/time support */
135 GDT_None, /* No alarm support */
136 0 /* Max alarms = 0 */
139 /* Initialise variables and state machine. */
140 GSM_Error N3110_Initialise(char *port_device, char *initlength,
141 GSM_ConnectionType connection,
142 void (*rlp_callback)(RLP_F96Frame *frame))
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 if (Protocol->Initialise(port_device,initlength,connection,rlp_callback)!=GE_NONE)
155 return GE_NOTSUPPORTED;
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);
181 if (error!=GE_NONE) return error;
183 CurrentLinkOK = true;
189 void N3110_DispatchMessage(u16 MessageLength, u8 *MessageBuffer, u8 MessageType)