supported by this model of phone. */
-
-
-
-
-
/* Here we initialise model specific functions. */
GSM_Functions N6110_Functions = {
N6110_Initialise,
NULL_KeepAlive,
N6110_GetMemoryLocation,
N6110_WritePhonebookLocation,
-#ifndef UCLINUX
N6110_GetSpeedDial,
N6110_SetSpeedDial,
-#else /* UCLINUX */
- NULL,
- NULL,
-#endif /* UCLINUX */
N6110_GetMemoryStatus,
#ifndef UCLINUX
N6110_GetSMSStatus,
N6110_EnterSecurityCode,
N6110_GetSecurityCodeStatus,
N6110_GetSecurityCode,
+#else /* UCLINUX */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+#endif /* UCLINUX */
N6110_GetIMEI,
N6110_GetRevision,
N6110_GetModel,
+#ifndef UCLINUX
N6110_GetDateTime,
N6110_SetDateTime,
N6110_GetAlarm,
NULL,
NULL,
NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
#endif /* UCLINUX */
N6110_DialData,
#ifndef UCLINUX
#ifndef UCLINUX
N6110_GetProfile,
N6110_SetProfile,
- N6110_SendRLPFrame,
#else /* UCLINUX */
NULL,
NULL,
- NULL,
#endif /* UCLINUX */
+ N6110_SendRLPFrame,
N6110_CancelCall,
#ifndef UCLINUX
N6110_PressKey,
static void N6110_ReplyGetAuthentication(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) {
+ LIVE;
+
#if defined WIN32 || !defined HAVE_SNPRINTF
sprintf(Current_IMEI, "%s", MessageBuffer+9);
sprintf(Current_Model, "%s", MessageBuffer+25);
0x00, 0x00, 0x00, 0x00};
+ unsigned char req3_55[] = { N6110_FRAME_HEADER, 0x42,0x05,0x01,
+ 0x07,0xa2,0x88,0x81,0x21,0x55,0x63,0xa8,0x00,0x00,
+ 0x07,0xa3,0xb8,0x81,0x20,0x15,0x63,0x80 };
+ unsigned char req3[] = { N6110_FRAME_HEADER, 0x42,0x05,0x01,
+ 0x07,0xa2,0x88,0x81,0x21,0x15,0x63,0xa8,0x00,0x00,
+ 0x07,0xa3,0xb8,0x81,0x20,0x15,0x63,0x80 };
+ unsigned char unknown_05[] = {N6110_FRAME_HEADER, 0x05};
+
#ifdef DEBUG
fprintf(stdout,_("Making authentication!\n"));
#endif
usleep(100); Protocol->SendMessage(5, 0x02, connect2);
usleep(100); Protocol->SendMessage(7, 0x02, connect3);
+ usleep(100); Protocol->SendMessage(sizeof(req3_55), 0x01, req3_55); /* Lace */
+
CurrentMagicError = GE_BUSY;
usleep(100); Protocol->SendMessage(4, 0x64, connect4);
+
+ usleep(100); Protocol->SendMessage(sizeof(req3_55), 0x01, req3_55); /* Lace */
+ usleep(100); Protocol->SendMessage(sizeof(req3), 0x01, req3); /* Lace */
+
if (NULL_WaitUntil(50,&CurrentMagicError)!=GE_NONE) return GE_TIMEOUT;
N6110_GetNokiaAuth(Current_IMEI, MagicBytes, magic_connect+4);
Protocol->SendMessage(45, 0x64, magic_connect);
+ usleep(100); Protocol->SendMessage(4, 0x04, unknown_05); /* Lace */
+
#ifdef DEBUG
fprintf(stdout,_("End of authentication!\n"));
#endif
After making it phone display "Accessory connected"
and probably give access to some function (I'm not too sure about it !)
Anyway, I make it now for N51xx/61xx */
- if (GetModelFeature (FN_AUTHENTICATION)!=0) {
+#if 1
+ if (GetModelFeature (FN_AUTHENTICATION)!=0)
+#else
+ if (0/*Lace-hack:GetModelFeature (FN_AUTHENTICATION)!=0*/)
+#endif
+ {
if (N6110_Authentication()!=GE_NONE) return GE_TIMEOUT;
} else { /* No authentication */
if (N6110_SendIMEIFrame()!=GE_NONE) return GE_TIMEOUT;
return (GE_NONE);
}
+#endif /* UCLINUX */
+
bool N6110_SendRLPFrame(RLP_F96Frame *frame, bool out_dtx)
{
u8 req[60] = { 0x00, 0xd9 };
return (Protocol->SendFrame(32, 0xf0, req));
}
+#ifndef UCLINUX
+
void N6110_ReplyGetCalendarNote(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) {
int i, j;
switch (type) {
case 0:
+ usleep(100); Protocol->SendMessage(sizeof(req3), 0x01, req3); /* Lace */
+ usleep(100);
req_end = req_end0;
size = sizeof(req_end0);
break;
case 1:
Protocol->SendMessage(sizeof(req3), 0x01, req3);
+ usleep(1000000);
Protocol->SendMessage(sizeof(req4), 0x01, req4);
+ usleep(1000000);
req_end = req_end1;
size = sizeof(req_end1);
break;
memcpy(req + 5 + strlen(Number), req_end, size);
Protocol->SendMessage(5 + size + strlen(Number), 0x01, req);
+ usleep(1000000);
+
+#if 0
if (type != 1) Protocol->SendMessage(26, 0x01, req2);
+#endif
return (GE_NONE);
}
return GE_NONE;
}
+#endif /* UCLINUX */
+
GSM_Error N6110_GetIMEI(char *imei)
{
if (strlen(Current_IMEI)>0) {
return (GE_TRYAGAIN);
}
-#endif /* UCLINUX */
-
static GSM_Error N6110_GetModel(char *model)
{
if (strlen(Current_Model)>0) {
sleep(1);
if (GetModelFeature (FN_PHONEBOOK)==F_PBK33) {//pbk with Unicode
+#ifndef UCLINUX
DecodeUnicode (CurrentPhonebookEntry->Name, MessageBuffer+6, count/2);
CurrentPhonebookEntry->Name[count/2] = 0x00;
+#else /* UCLINUX */
+ fprintf(stderr,"FATAL ERROR: DecodeUnicode disabled!\n");
+ exit(1);
+#endif /* UCLINUX */
} else {
memcpy(CurrentPhonebookEntry->Name, MessageBuffer + 6, count);
CurrentPhonebookEntry->Name[count] = 0x00;
current=7;
if (GetModelFeature (FN_PHONEBOOK)==F_PBK33) {
+#ifndef UCLINUX
req[6] = strlen(entry->Name)*2;
}
current+=strlen(entry->Name)*2;
+
+#else /* UCLINUX */
+
+ fprintf(stderr,"FATAL ERROR: EncodeUnicode disabled!\n");
+ exit(1);
+
+#endif /* UCLINUX */
} else {
req[6] = strlen(entry->Name);
(20, &CurrentSendDTMFError, 5+length, 0x01, req);
}
-void N6110_ReplyGetSpeedDial(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) {
+#endif /* UCLINUX */
+
+static void N6110_ReplyGetSpeedDial(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) {
switch (MessageBuffer[3]) {
(20, &CurrentSpeedDialError, 5, 0x03, req);
}
-void N6110_ReplySetSpeedDial(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) {
+static void N6110_ReplySetSpeedDial(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) {
switch (MessageBuffer[3]) {
(20, &CurrentSpeedDialError, 7, 0x03, req);
}
+#ifndef UCLINUX
+
/* This function finds parts of SMS in frame used in new Nokia phones
in internal protocols (they're coded according to GSM 03.40), copies them
to GSM_ETSISMSMessage and calls GSM_DecodeETSISMS to decode
}
}
-#endif /* UCLINUX */
-
static void N6110_Dispatch0x09Message(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) {
switch (MessageBuffer[3]) {
}
}
-#ifndef UCLINUX
-
static void N6110_Dispatch0x13Message(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) {
switch(MessageBuffer[3]) {
case 0x06:N6110_ReplyWritePhonebookLocation(MessageLength,MessageBuffer,MessageType);break;
case 0x08:
case 0x09:N6110_ReplyGetMemoryStatus(MessageLength,MessageBuffer,MessageType);break;
-#ifndef UCLINUX
case 0x17:
case 0x18:N6110_ReplyGetSpeedDial(MessageLength,MessageBuffer,MessageType);break;
case 0x1a:
case 0x1b:N6110_ReplySetSpeedDial(MessageLength,MessageBuffer,MessageType);break;
+#ifndef UCLINUX
default :N6110_Dispatch0x03Message(MessageLength,MessageBuffer,MessageType);break;
#endif /* UCLINUX */
}
default :N6110_ReplyEnterSecurityCode (MessageLength,MessageBuffer,MessageType);break;
}
break;
-#endif /* UCLINUX */
/* SIM login */
case 0x09:
N6110_Dispatch0x09Message(MessageLength, MessageBuffer, MessageType);
break;
-#ifndef UCLINUX
/* Network info */
case 0x0a:
switch (MessageBuffer[3]) {