summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/phone/nokia
Side-by-side diff
Diffstat (limited to 'gammu/emb/common/phone/nokia') (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/phone/nokia/dct3/dct3func.c16
-rw-r--r--gammu/emb/common/phone/nokia/dct3/dct3func.h2
-rw-r--r--gammu/emb/common/phone/nokia/dct3/n6110.c17
-rw-r--r--gammu/emb/common/phone/nokia/dct3/n7110.c9
-rw-r--r--gammu/emb/common/phone/nokia/dct3/n9210.c3
-rw-r--r--gammu/emb/common/phone/nokia/dct4/n3320.c3
-rw-r--r--gammu/emb/common/phone/nokia/dct4/n3650.c3
-rw-r--r--gammu/emb/common/phone/nokia/dct4/n6510.c168
-rw-r--r--gammu/emb/common/phone/nokia/dct4/n6510.h2
-rw-r--r--gammu/emb/common/phone/nokia/nauto.c2
-rw-r--r--gammu/emb/common/phone/nokia/nfunc.c14
11 files changed, 179 insertions, 60 deletions
diff --git a/gammu/emb/common/phone/nokia/dct3/dct3func.c b/gammu/emb/common/phone/nokia/dct3/dct3func.c
index beef33c..17cd0a4 100644
--- a/gammu/emb/common/phone/nokia/dct3/dct3func.c
+++ b/gammu/emb/common/phone/nokia/dct3/dct3func.c
@@ -1,15 +1,18 @@
/* (c) 2001-2004 by Marcin Wiacek */
-/* based on some work from Markus Plail, Pavel Janik, others and Gnokii */
/* resetting DCT4 phones settings (c) by Walek */
+/* based on some Markus Plail, Pavel Janik & others work from Gnokii (www.gnokii.org)
+ * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot
+ * GNU GPL version 2 or later
+ */
#include <string.h> /* memcpy only */
#include <stdio.h>
#include <ctype.h>
#include "../../../gsmstate.h"
#include "../../../misc/coding/coding.h"
#include "../../../service/sms/gsmsms.h"
#include "../../pfunc.h"
#include "../nfunc.h"
#include "dct3func.h"
@@ -385,24 +388,25 @@ GSM_Error DCT3_ReplyGetSMSC(GSM_Protocol_Message msg, GSM_StateMachine *s)
switch (msg.Buffer[3]) {
case 0x34:
smprintf(s, "SMSC received\n");
Data->SMSC->Format = SMS_FORMAT_Text;
switch (msg.Buffer[6]) {
case 0x00: Data->SMSC->Format = SMS_FORMAT_Text; break;
case 0x22: Data->SMSC->Format = SMS_FORMAT_Fax; break;
case 0x26: Data->SMSC->Format = SMS_FORMAT_Pager; break;
case 0x32: Data->SMSC->Format = SMS_FORMAT_Email; break;
}
Data->SMSC->Validity.Format = SMS_Validity_RelativeFormat;
Data->SMSC->Validity.Relative = msg.Buffer[8];
+ if (msg.Buffer[8] == 0x00) Data->SMSC->Validity.Relative = SMS_VALID_Max_Time;
i=33;
while (msg.Buffer[i]!=0) {i++;}
i=i-33;
if (i>GSM_MAX_SMSC_NAME_LENGTH) {
smprintf(s, "Too long name\n");
return ERR_UNKNOWNRESPONSE;
}
EncodeUnicode(Data->SMSC->Name,msg.Buffer+33,i);
smprintf(s, "Name \"%s\"\n", DecodeUnicodeString(Data->SMSC->Name));
GSM_UnpackSemiOctetNumber(Data->SMSC->DefaultNumber,msg.Buffer+9,true);
@@ -433,43 +437,43 @@ GSM_Error DCT3_GetSMSC(GSM_StateMachine *s, GSM_SMSC *smsc)
return GSM_WaitFor (s, req, 6, 0x02, 4, ID_GetSMSC);
}
GSM_Error DCT3_ReplyGetNetworkInfo(GSM_Protocol_Message msg, GSM_StateMachine *s)
{
int count;
GSM_Phone_Data *Data = &s->Phone.Data;
#ifdef DEBUG
GSM_NetworkInfo NetInfo;
char name[100];
smprintf(s, "Network info received\n");
- smprintf(s, " Status : ");
+ smprintf(s, "Status : ");
switch (msg.Buffer[8]) {
case 0x01: smprintf(s, "home network"); break;
case 0x02: smprintf(s, "roaming network"); break;
case 0x03: smprintf(s, "requesting network"); break;
case 0x04: smprintf(s, "not registered in the network"); break;
default : smprintf(s, "unknown");
}
smprintf(s, "\n");
- smprintf(s, "Network selection : %s\n", msg.Buffer[9]==1?"manual":"automatic");
+ smprintf(s, "Network selection : %s\n", msg.Buffer[9]==1?"manual":"automatic");
if (msg.Buffer[8]<0x03) {
sprintf(NetInfo.CID, "%02x%02x", msg.Buffer[10], msg.Buffer[11]);
smprintf(s, "CID : %s\n", NetInfo.CID);
sprintf(NetInfo.LAC, "%02x%02x", msg.Buffer[12], msg.Buffer[13]);
smprintf(s, "LAC : %s\n", NetInfo.LAC);
- smprintf(s, "Network code : %s\n", NetInfo.NetworkCode);
NOKIA_DecodeNetworkCode(msg.Buffer+14,NetInfo.NetworkCode);
+ smprintf(s, "Network code : %s\n", NetInfo.NetworkCode);
smprintf(s, "Network name for Gammu : %s ",
DecodeUnicodeString(GSM_GetNetworkName(NetInfo.NetworkCode)));
smprintf(s, "(%s)\n",DecodeUnicodeString(GSM_GetCountryName(NetInfo.NetworkCode)));
if (msg.Length>18) {
if (msg.Buffer[18]==0x00) {
/* In 6210 name is in "normal" Unicode */
memcpy(name,msg.Buffer+18,msg.Buffer[17]*2);
name[msg.Buffer[17]*2] =0x00;
name[msg.Buffer[17]*2+1]=0x00;
smprintf(s, "Network name for phone : %s\n",DecodeUnicodeString(name));
} else {
@@ -1199,29 +1203,29 @@ GSM_Error DCT3_SetWAPSettings(GSM_StateMachine *s, GSM_MultiWAPSettings *setting
}
error = DCT3DCT4_SetActiveConnectSet(s, settings);
if (error != ERR_NONE) return error;
return DCT3DCT4_DisableConnectionFunctions(s);
}
GSM_Error DCT3_ReplySendSMSMessage(GSM_Protocol_Message msg, GSM_StateMachine *s)
{
switch (msg.Buffer[3]) {
case 0x02:
smprintf(s, "SMS sent OK\n");
- if (s->User.SendSMSStatus!=NULL) s->User.SendSMSStatus(s->CurrentConfig->Device,0,0);
+ if (s->User.SendSMSStatus!=NULL) s->User.SendSMSStatus(s->CurrentConfig->Device,0,msg.Buffer[5]);
return ERR_NONE;
case 0x03:
smprintf(s, "Error %i\n",msg.Buffer[6]);
- if (s->User.SendSMSStatus!=NULL) s->User.SendSMSStatus(s->CurrentConfig->Device,msg.Buffer[6],0);
+ if (s->User.SendSMSStatus!=NULL) s->User.SendSMSStatus(s->CurrentConfig->Device,msg.Buffer[6],-1);
return ERR_NONE;
}
return ERR_UNKNOWNRESPONSE;
}
GSM_Error DCT3_SendSMSMessage(GSM_StateMachine *s, GSM_SMSMessage *sms)
{
int length;
GSM_Error error;
unsigned char req[256] = {N6110_FRAME_HEADER, 0x01, 0x02, 0x00};
error=PHONE_EncodeSMSFrame(s,sms,req+6,PHONE_SMSSubmit,&length, true);
diff --git a/gammu/emb/common/phone/nokia/dct3/dct3func.h b/gammu/emb/common/phone/nokia/dct3/dct3func.h
index 66b67ec..18b2026 100644
--- a/gammu/emb/common/phone/nokia/dct3/dct3func.h
+++ b/gammu/emb/common/phone/nokia/dct3/dct3func.h
@@ -1,17 +1,19 @@
/* (c) 2002-2003 by Marcin Wiacek */
#ifndef phone_nokia_dct3_h
#define phone_nokia_dct3_h
+#include "../ncommon.h"
+
GSM_Error DCT3_ReplyPressKey (GSM_Protocol_Message msg, GSM_StateMachine *s);
GSM_Error DCT3_ReplyPlayTone (GSM_Protocol_Message msg, GSM_StateMachine *s);
GSM_Error DCT3_ReplyEnableSecurity (GSM_Protocol_Message msg, GSM_StateMachine *s);
GSM_Error DCT3_ReplyGetIMEI (GSM_Protocol_Message msg, GSM_StateMachine *s);
GSM_Error DCT3_ReplyGetSMSC (GSM_Protocol_Message msg, GSM_StateMachine *s);
GSM_Error DCT3_ReplySIMLogin (GSM_Protocol_Message msg, GSM_StateMachine *s);
GSM_Error DCT3_ReplySIMLogout (GSM_Protocol_Message msg, GSM_StateMachine *s);
GSM_Error DCT3_ReplyGetDateTime (GSM_Protocol_Message msg, GSM_StateMachine *s);
GSM_Error DCT3_ReplyGetAlarm (GSM_Protocol_Message msg, GSM_StateMachine *s);
GSM_Error DCT3_ReplySetDateTime (GSM_Protocol_Message msg, GSM_StateMachine *s);
GSM_Error DCT3_ReplySetAlarm (GSM_Protocol_Message msg, GSM_StateMachine *s);
GSM_Error DCT3_ReplyDialCommand (GSM_Protocol_Message msg, GSM_StateMachine *s);
diff --git a/gammu/emb/common/phone/nokia/dct3/n6110.c b/gammu/emb/common/phone/nokia/dct3/n6110.c
index 263d12b..dac6c12 100644
--- a/gammu/emb/common/phone/nokia/dct3/n6110.c
+++ b/gammu/emb/common/phone/nokia/dct3/n6110.c
@@ -1,16 +1,18 @@
/* (c) 2001-2004 by Marcin Wiacek */
-/* based on some work from Markus Plail and Gnokii */
-/* Authentication function (c) 1999 or earlier by Pavel Janik */
/* 5210 calendar IDs by Frederick Ros */
+/* based on some Markus Plail, Pavel Janik & others work from Gnokii (www.gnokii.org)
+ * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot
+ * GNU GPL version 2 or later
+ */
#include "../../../gsmstate.h"
#ifdef GSM_ENABLE_NOKIA6110
#include <string.h>
#include "../../../../cfg/config.h"
#include "../../../misc/coding/coding.h"
#include "../../../service/sms/gsmsms.h"
#include "../../../gsmcomon.h"
#include "../../pfunc.h"
@@ -118,24 +120,25 @@ static void N6110_EncodeUnicode(GSM_StateMachine *s, unsigned char *dest, const
if (!found) {
i_len += EncodeWithUnicodeAlphabet(&src[i_len], &wc);
dest[o_len*2] = (wc >> 8) & 0xff;
dest[(o_len*2)+1] = wc & 0xff;
}
}
dest[o_len*2] = 0;
dest[(o_len*2)+1] = 0;
}
#ifndef ENABLE_LGPL
+/* Pavel Janik */
/* This function provides Nokia authentication protocol.
* Nokia authentication protocol is used in the communication between Nokia
* mobile phones (e.g. Nokia 6110) and Nokia Cellular Data Suite software,
* commercially sold by Nokia Corp.
* The authentication scheme is based on the token send by the phone to the
* software. The software does it's magic (see the function
* N6110_GetNokiaAuthentication) and returns the result back to the phone.
* If the result is correct the phone responds with the message "Accessory
* connected!" displayed on the LCD. Otherwise it will display "Accessory not
* supported" and some functions will not be available for use (?).
* The specification of the protocol is not publicly available, no comment.
*/
@@ -815,24 +818,25 @@ static GSM_Error N6110_SetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone,
memcpy(reqBin+current,DecodeUnicodeString(Ringtone->Name),UnicodeLength(Ringtone->Name));
current += UnicodeLength(Ringtone->Name);
reqBin[current++] = 0x00;
reqBin[current++] = 0x00;
reqBin[current++] = 0x00;/*xxx*/
memcpy(reqBin+current,Ringtone->NokiaBinary.Frame,Ringtone->NokiaBinary.Length);
current=current+Ringtone->NokiaBinary.Length;
reqBin[3]=Ringtone->Location-1;
if (!strcmp(s->Phone.Data.ModelInfo->model,"3210")) reqBin[5]=0x10;
smprintf(s, "Setting binary ringtone\n");
return GSM_WaitFor (s, reqBin, current, 0x40, 4, ID_SetRingtone);
case RING_MIDI:
+ case RING_MMF:
return ERR_NOTSUPPORTED;
}
return ERR_NOTSUPPORTED;
}
static GSM_Error N6110_ReplyGetOpLogo(GSM_Protocol_Message msg, GSM_StateMachine *s)
{
int count=5;
GSM_Phone_Data *Data = &s->Phone.Data;
smprintf(s, "Operator logo received\n");
NOKIA_DecodeNetworkCode(msg.Buffer+count,Data->Bitmap->NetworkCode);
@@ -1515,24 +1519,25 @@ static GSM_Error N6110_ReplyGetRingtone(GSM_Protocol_Message msg, GSM_StateMachi
}
i++;
if (i==msg.Length-3) return ERR_EMPTY;
}
/* Copying frame */
memcpy(Data->Ringtone->NokiaBinary.Frame,msg.Buffer+start,end-start);
Data->Ringtone->NokiaBinary.Length=end-start;
#ifdef DEBUG
if (di.dl == DL_TEXTALL || di.dl == DL_TEXTALLDATE) DumpMessage(di.df, di.dl, Data->Ringtone->NokiaBinary.Frame, Data->Ringtone->NokiaBinary.Length);
#endif
return ERR_NONE;
case RING_MIDI:
+ case RING_MMF:
return ERR_NOTSUPPORTED;
}
smprintf(s, "Ringtone format is %i\n",Data->Ringtone->Format);
break;
default:
smprintf(s, "Invalid location. Too high ?\n");
return ERR_INVALIDLOCATION;
}
return ERR_UNKNOWNRESPONSE;
}
static GSM_Error N6110_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, bool PhoneRingtone)
@@ -1552,24 +1557,25 @@ static GSM_Error N6110_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone,
Ringtone->Format = RING_NOKIABINARY;
}
}
switch (Ringtone->Format) {
case RING_NOTETONE:
if (!IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo,F_RING_SM)) return ERR_NOTSUPPORTED;
break;
case RING_NOKIABINARY:
if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo,F_RING_SM)) return ERR_NOTSUPPORTED;
break;
case RING_MIDI:
+ case RING_MMF:
return ERR_NOTSUPPORTED;
}
error=DCT3_EnableSecurity (s, 0x01);
if (error!=ERR_NONE) return error;
req[3]=Ringtone->Location-1;
s->Phone.Data.Ringtone=Ringtone;
smprintf(s, "Getting (binary) ringtone\n");
return GSM_WaitFor (s, req, 4, 0x40, 4, ID_GetRingtone);
}
@@ -2434,26 +2440,26 @@ static GSM_Error N6110_GetNextCalendarNote(GSM_StateMachine *s, GSM_CalendarEntr
if (error == ERR_NONE && Note->Entries[Time].Date.Year == 2090) {
error=N6110_GetDateTime(s, &date_time);
if (error == ERR_NONE) Note->Entries[Time].Date.Year = date_time.Year;
}
return error;
}
GSM_Error N6110_ReplyUSSDInfo(GSM_Protocol_Message msg, GSM_StateMachine *s)
{
unsigned char buffer[2000],buffer2[4000];
int tmp;
- tmp=GSM_UnpackEightBitsToSeven(0, 82, 82, msg.Buffer+8, buffer);
- msg.Buffer[tmp] = 0;
+ tmp=GSM_UnpackEightBitsToSeven(0, msg.Buffer[7], 82, msg.Buffer+8, buffer);
+ buffer[tmp] = 0;
smprintf(s, "USSD reply: \"%s\"\n",buffer);
if (s->Phone.Data.EnableIncomingUSSD && s->User.IncomingUSSD!=NULL) {
EncodeUnicode(buffer2,buffer,strlen(buffer));
s->User.IncomingUSSD(s->CurrentConfig->Device, buffer2);
}
return ERR_NONE;
}
GSM_Error N6110_AnswerCall(GSM_StateMachine *s, int ID, bool all)
@@ -2798,24 +2804,25 @@ GSM_Phone_Functions N6110Phone = {
N6110_GetSpeedDial,
NOTIMPLEMENTED, /* SetSpeedDial */
DCT3_GetSMSC,
DCT3_SetSMSC,
DCT3_GetSMSStatus,
N6110_GetSMSMessage,
N6110_GetNextSMSMessage,
N6110_SetSMS,
N6110_AddSMS,
N6110_DeleteSMSMessage,
DCT3_SendSMSMessage,
NOTSUPPORTED, /* SendSavedSMS */
+ NOTSUPPORTED, /* SetFastSMSSending */
NOKIA_SetIncomingSMS,
DCT3_SetIncomingCB,
PHONE_GetSMSFolders,
NOTSUPPORTED, /* AddSMSFolder */
NOTSUPPORTED, /* DeleteSMSFolder */
N6110_DialVoice,
N6110_AnswerCall,
DCT3_CancelCall,
N6110_HoldCall,
N6110_UnholdCall,
N6110_ConferenceCall,
N6110_SplitCall,
@@ -2852,25 +2859,25 @@ GSM_Phone_Functions N6110Phone = {
NOTSUPPORTED, /* AddToDo */
NOTSUPPORTED, /* DeleteToDo */
NOTSUPPORTED, /* DeleteAllToDo */
NOTIMPLEMENTED, /* GetCalendarStatus */
NOTIMPLEMENTED, /* GetCalendar */
N6110_GetNextCalendarNote,
NOTIMPLEMENTED, /* SetCalendar */
N6110_AddCalendarNote,
N6110_DeleteCalendarNote,
NOTIMPLEMENTED, /* DeleteAllCalendar */
NOTSUPPORTED, /* GetCalendarSettings */
NOTSUPPORTED, /* SetCalendarSettings */
- NOTSUPPORTED, /* GetNote */
+ NOTSUPPORTED, /* GetNextNote */
N6110_GetProfile,
N6110_SetProfile,
NOTSUPPORTED, /* GetFMStation */
NOTSUPPORTED, /* SetFMStation */
NOTSUPPORTED, /* ClearFMStations */
NOTSUPPORTED, /* GetNextFileFolder */
NOTSUPPORTED, /* GetFilePart */
NOTSUPPORTED, /* AddFile */
NOTSUPPORTED, /* GetFileSystemStatus */
NOTSUPPORTED, /* DeleteFile */
NOTSUPPORTED, /* AddFolder */
NOTSUPPORTED, /* GetGPRSAccessPoint */
diff --git a/gammu/emb/common/phone/nokia/dct3/n7110.c b/gammu/emb/common/phone/nokia/dct3/n7110.c
index 5a02c9c..b597f9b 100644
--- a/gammu/emb/common/phone/nokia/dct3/n7110.c
+++ b/gammu/emb/common/phone/nokia/dct3/n7110.c
@@ -1,14 +1,17 @@
/* (c) 2001-2004 by Marcin Wiacek */
-/* based on some work from Markus Plail and Gnokii */
+/* based on some Markus Plail work from Gnokii (www.gnokii.org)
+ * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot
+ * GNU GPL version 2 or later
+ */
#include "../../../gsmstate.h"
#ifdef GSM_ENABLE_NOKIA7110
#include <string.h>
#include <time.h>
#include "../../../misc/coding/coding.h"
#include "../../../gsmcomon.h"
#include "../../../service/gsmlogo.h"
#include "../../pfunc.h"
@@ -517,24 +520,25 @@ static GSM_Error N7110_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone,
if (Ringtone->Format == 0x00) Ringtone->Format = RING_NOKIABINARY;
switch (Ringtone->Format) {
case RING_NOTETONE:
/* In the future get binary and convert */
return ERR_NOTSUPPORTED;
case RING_NOKIABINARY:
req[5]=N7110_ReturnBinaryRingtoneLocation(s->Phone.Data.Model)+Ringtone->Location;
s->Phone.Data.Ringtone=Ringtone;
smprintf(s, "Getting binary ringtone\n");
return GSM_WaitFor (s, req, 6, 0x1f, 4, ID_GetRingtone);
case RING_MIDI:
+ case RING_MMF:
return ERR_NOTSUPPORTED;
}
return ERR_NOTSUPPORTED;
}
static GSM_Error N7110_ReplyGetPictureImageInfo(GSM_Protocol_Message msg, GSM_StateMachine *s)
{
int i;
GSM_Phone_N7110Data *Priv = &s->Phone.Data.Priv.N7110;
smprintf(s, "Received info for Picture Images\n");
smprintf(s, "Number : %i\n",msg.Buffer[4]*256+msg.Buffer[5]);
@@ -1638,24 +1642,25 @@ GSM_Phone_Functions N7110Phone = {
N7110_GetSpeedDial,
NOTIMPLEMENTED, /* SetSpeedDial */
DCT3_GetSMSC,
DCT3_SetSMSC,
N7110_GetSMSStatus,
N7110_GetSMSMessage,
N7110_GetNextSMSMessage,
N7110_SetSMS,
N7110_AddSMS,
N7110_DeleteSMS,
DCT3_SendSMSMessage,
NOTSUPPORTED, /* SendSavedSMS */
+ NOTSUPPORTED, /* SetFastSMSSending */
N7110_SetIncomingSMS,
DCT3_SetIncomingCB,
N7110_GetSMSFolders,
NOTIMPLEMENTED, /* AddSMSFolder */
NOTIMPLEMENTED, /* DeleteSMSFolder */
DCT3_DialVoice,
N7110_AnswerCall,
DCT3_CancelCall,
NOTIMPLEMENTED, /* HoldCall */
NOTIMPLEMENTED, /* UnholdCall */
NOTIMPLEMENTED, /* ConferenceCall */
NOTIMPLEMENTED, /* SplitCall */
@@ -1692,25 +1697,25 @@ GSM_Phone_Functions N7110Phone = {
NOTSUPPORTED, /* AddToDo */
NOTSUPPORTED, /* DeleteToDo */
NOTSUPPORTED, /* DeleteAllToDo */
N7110_GetCalendarStatus,
NOTIMPLEMENTED, /* GetCalendar */
N7110_GetNextCalendar,
NOTIMPLEMENTED, /* SetCalendar */
N7110_AddCalendar,
N71_65_DelCalendar,
NOTIMPLEMENTED, /* DeleteAllCalendar */
NOTSUPPORTED, /* GetCalendarSettings */
NOTSUPPORTED, /* SetCalendarSettings */
- NOTSUPPORTED, /* GetNote */
+ NOTSUPPORTED, /* GetNextNote */
N7110_GetProfile,
N7110_SetProfile,
NOTSUPPORTED, /* GetFMStation */
NOTSUPPORTED, /* SetFMStation */
NOTSUPPORTED, /* ClearFMStations */
NOTSUPPORTED, /* GetNextFileFolder */
NOTSUPPORTED, /* GetFilePart */
NOTSUPPORTED, /* AddFile */
NOTSUPPORTED, /* GetFileSystemStatus */
NOTSUPPORTED, /* DeleteFile */
NOTSUPPORTED, /* AddFolder */
NOTSUPPORTED, /* GetGPRSAccessPoint */
diff --git a/gammu/emb/common/phone/nokia/dct3/n9210.c b/gammu/emb/common/phone/nokia/dct3/n9210.c
index e82d530..ff71ad3 100644
--- a/gammu/emb/common/phone/nokia/dct3/n9210.c
+++ b/gammu/emb/common/phone/nokia/dct3/n9210.c
@@ -310,24 +310,25 @@ GSM_Phone_Functions N9210Phone = {
NOTIMPLEMENTED, /* GetSpeedDial */
NOTIMPLEMENTED, /* SetSpeedDial */
DCT3_GetSMSC,
DCT3_SetSMSC, /* FIXME: test it */
NOTIMPLEMENTED, /* GetSMSStatus */
NOTIMPLEMENTED, /* GetSMS */
NOTIMPLEMENTED, /* GetNextSMS */
NOTIMPLEMENTED, /* SetSMS */
NOTIMPLEMENTED, /* AddSMS */
NOTIMPLEMENTED, /* DeleteSMS */
DCT3_SendSMSMessage,
NOTSUPPORTED, /* SendSavedSMS */
+ NOTSUPPORTED, /* SetFastSMSSending */
N9210_SetIncomingSMS,
DCT3_SetIncomingCB,
NOTIMPLEMENTED, /* GetSMSFolders */
NOTSUPPORTED, /* AddSMSFolder */
NOTSUPPORTED, /* DeleteSMSFolder */
DCT3_DialVoice,
N9210_AnswerCall,
DCT3_CancelCall,
NOTSUPPORTED, /* HoldCall */
NOTSUPPORTED, /* UnholdCall */
NOTSUPPORTED, /* ConferenceCall */
NOTSUPPORTED, /* SplitCall */
@@ -364,25 +365,25 @@ GSM_Phone_Functions N9210Phone = {
NOTSUPPORTED, /* AddToDo */
NOTSUPPORTED, /* DeleteToDo */
NOTSUPPORTED, /* DeleteAllToDo */
NOTSUPPORTED, /* GetCalendarStatus */
NOTSUPPORTED, /* GetCalendar */
NOTSUPPORTED, /* GetNextCalendar */
NOTSUPPORTED, /* SetCalendar */
NOTSUPPORTED, /* AddCalendar */
NOTSUPPORTED, /* DeleteCalendar */
NOTSUPPORTED, /* DeleteAllCalendar */
NOTSUPPORTED, /* GetCalendarSettings */
NOTSUPPORTED, /* SetCalendarSettings */
- NOTSUPPORTED, /* GetNote */
+ NOTSUPPORTED, /* GetNextNote */
NOTIMPLEMENTED, /* GetProfile */
NOTSUPPORTED, /* SetProfile */
NOTSUPPORTED, /* GetFMStation */
NOTSUPPORTED, /* SetFMStation */
NOTSUPPORTED, /* ClearFMStations */
NOTSUPPORTED, /* GetNextFileFolder */
NOTSUPPORTED, /* GetFilePart */
NOTSUPPORTED, /* AddFile */
NOTSUPPORTED, /* GetFileSystemStatus */
NOTSUPPORTED, /* DeleteFile */
NOTSUPPORTED, /* AddFolder */
NOTSUPPORTED, /* GetGPRSAccessPoint */
diff --git a/gammu/emb/common/phone/nokia/dct4/n3320.c b/gammu/emb/common/phone/nokia/dct4/n3320.c
index 51e6f18..9b1d6cd 100644
--- a/gammu/emb/common/phone/nokia/dct4/n3320.c
+++ b/gammu/emb/common/phone/nokia/dct4/n3320.c
@@ -185,24 +185,25 @@ GSM_Phone_Functions N3320Phone = {
NOTSUPPORTED, /* GetSpeedDial */
NOTSUPPORTED, /* SetSpeedDial */
NOTSUPPORTED, /* GetSMSC */
NOTSUPPORTED, /* SetSMSC */
NOTSUPPORTED, /* GetSMSStatus */
NOTSUPPORTED, /* GetSMS */
NOTSUPPORTED, /* GetNextSMS */
NOTSUPPORTED, /* SetSMS */
NOTSUPPORTED, /* AddSMS */
NOTSUPPORTED, /* DeleteSMS */
NOTSUPPORTED, /* SendSMS */
NOTSUPPORTED, /* SendSavedSMS */
+ NOTSUPPORTED, /* SetFastSMSSending */
NOTSUPPORTED, /* SetIncomingSMS */
NOTSUPPORTED, /* SetIncomingCB */
NOTSUPPORTED, /* GetSMSFolders */
NOTSUPPORTED, /* AddSMSFolder */
NOTSUPPORTED, /* DeleteSMSFolder */
NOTIMPLEMENTED, /* DialVoice */
NOTIMPLEMENTED, /* AnswerCall */
NOTIMPLEMENTED, /* CancelCall */
NOTIMPLEMENTED, /* HoldCall */
NOTIMPLEMENTED, /* UnholdCall */
NOTIMPLEMENTED, /* ConferenceCall */
NOTIMPLEMENTED, /* SplitCall */
@@ -239,25 +240,25 @@ GSM_Phone_Functions N3320Phone = {
NOTSUPPORTED, /* AddToDo */
NOTSUPPORTED, /* DeleteToDo */
NOTSUPPORTED, /* DeleteAllToDo */
N3320_GetCalendarStatus,
NOTIMPLEMENTED, /* GetCalendar */
N3320_GetNextCalendar,
NOTIMPLEMENTED, /* SetCalendar */
NOTSUPPORTED, /* AddCalendar */
NOTSUPPORTED, /* DeleteCalendar */
NOTIMPLEMENTED, /* DeleteAllCalendar */
NOTSUPPORTED, /* GetCalendarSettings */
NOTSUPPORTED, /* SetCalendarSettings */
- NOTSUPPORTED, /* GetNote */
+ NOTSUPPORTED, /* GetNextNote */
NOTSUPPORTED, /* GetProfile */
NOTSUPPORTED, /* SetProfile */
NOTSUPPORTED, /* GetFMStation */
NOTSUPPORTED, /* SetFMStation */
NOTSUPPORTED, /* ClearFMStations */
NOTSUPPORTED, /* GetNextFileFolder */
NOTSUPPORTED, /* GetFilePart */
NOTIMPLEMENTED, /* AddFilePart */
NOTSUPPORTED, /* GetFileSystemStatus */
NOTIMPLEMENTED, /* DeleteFile */
NOTIMPLEMENTED, /* AddFolder */
NOTSUPPORTED, /* GetGPRSAccessPoint */
diff --git a/gammu/emb/common/phone/nokia/dct4/n3650.c b/gammu/emb/common/phone/nokia/dct4/n3650.c
index 2da55bf..d4746a7 100644
--- a/gammu/emb/common/phone/nokia/dct4/n3650.c
+++ b/gammu/emb/common/phone/nokia/dct4/n3650.c
@@ -306,24 +306,25 @@ GSM_Phone_Functions N3650Phone = {
NOTSUPPORTED, /* GetSpeedDial */
NOTSUPPORTED, /* SetSpeedDial */
NOTSUPPORTED, /* GetSMSC */
NOTSUPPORTED, /* SetSMSC */
NOTSUPPORTED, /* GetSMSStatus */
NOTSUPPORTED, /* GetSMS */
NOTSUPPORTED, /* GetNextSMS */
NOTSUPPORTED, /* SetSMS */
NOTSUPPORTED, /* AddSMS */
NOTSUPPORTED, /* DeleteSMS */
NOTSUPPORTED, /* SendSMS */
NOTSUPPORTED, /* SendSavedSMS */
+ NOTSUPPORTED, /* SetFastSMSSending */
NOTSUPPORTED, /* SetIncomingSMS */
NOTSUPPORTED, /* SetIncomingCB */
NOTSUPPORTED, /* GetSMSFolders */
NOTSUPPORTED, /* AddSMSFolder */
NOTSUPPORTED, /* DeleteSMSFolder */
NOTIMPLEMENTED, /* DialVoice */
NOTIMPLEMENTED, /* AnswerCall */
NOTIMPLEMENTED, /* CancelCall */
NOTIMPLEMENTED, /* HoldCall */
NOTIMPLEMENTED, /* UnholdCall */
NOTIMPLEMENTED, /* ConferenceCall */
NOTIMPLEMENTED, /* SplitCall */
@@ -360,25 +361,25 @@ GSM_Phone_Functions N3650Phone = {
NOTSUPPORTED, /* AddToDo */
NOTSUPPORTED, /* DeleteToDo */
NOTSUPPORTED, /* DeleteAllToDo */
NOTIMPLEMENTED, /* GetCalendarStatus */
NOTIMPLEMENTED, /* GetCalendar */
NOTSUPPORTED, /* GetNextCalendar */
NOTIMPLEMENTED, /* SetCalendar */
NOTSUPPORTED, /* AddCalendar */
NOTSUPPORTED, /* DeleteCalendar */
NOTIMPLEMENTED, /* DeleteAllCalendar */
NOTSUPPORTED, /* GetCalendarSettings */
NOTSUPPORTED, /* SetCalendarSettings */
- NOTSUPPORTED, /* GetNote */
+ NOTSUPPORTED, /* GetNextNote */
NOTSUPPORTED, /* GetProfile */
NOTSUPPORTED, /* SetProfile */
NOTSUPPORTED, /* GetFMStation */
NOTSUPPORTED, /* SetFMStation */
NOTSUPPORTED, /* ClearFMStations */
N3650_GetNextFileFolder,
N3650_GetFilePart,
NOTIMPLEMENTED, /* AddFilePart */
NOTSUPPORTED, /* GetFileSystemStatus */
NOTIMPLEMENTED, /* DeleteFile */
NOTIMPLEMENTED, /* AddFolder */
NOTSUPPORTED, /* GetGPRSAccessPoint */
diff --git a/gammu/emb/common/phone/nokia/dct4/n6510.c b/gammu/emb/common/phone/nokia/dct4/n6510.c
index 67fe492..2208def 100644
--- a/gammu/emb/common/phone/nokia/dct4/n6510.c
+++ b/gammu/emb/common/phone/nokia/dct4/n6510.c
@@ -1,14 +1,17 @@
/* (c) 2002-2004 by Marcin Wiacek */
-/* based on some work from Markus Plail, Pawel Kot and Gnokii */
+/* based on some Markus Plail, Pawel Kot work from Gnokii (www.gnokii.org)
+ * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot
+ * GNU GPL version 2 or later
+ */
/* function for making CRC for filesystem (c) 2003 by Michael Schroeder */
#include "../../../gsmstate.h"
#ifdef GSM_ENABLE_NOKIA6510
#include <string.h>
#include <time.h>
#include "../../../misc/coding/coding.h"
#include "../../../gsmcomon.h"
#include "../../../service/gsmlogo.h"
@@ -110,24 +113,26 @@ static GSM_Error N6510_ReplyGetSMSC(GSM_Protocol_Message msg, GSM_StateMachine *
}
memset(Data->SMSC,0,sizeof(GSM_SMSC));
Data->SMSC->Location = msg.Buffer[8];
Data->SMSC->Format = SMS_FORMAT_Text;
switch (msg.Buffer[10]) {
case 0x00: Data->SMSC->Format = SMS_FORMAT_Text; break;
case 0x22: Data->SMSC->Format = SMS_FORMAT_Fax; break;
case 0x26: Data->SMSC->Format = SMS_FORMAT_Pager; break;
case 0x32: Data->SMSC->Format = SMS_FORMAT_Email; break;
}
Data->SMSC->Validity.Format = SMS_Validity_RelativeFormat;
Data->SMSC->Validity.Relative = msg.Buffer[12];
+ if (msg.Buffer[12] == 0x00) Data->SMSC->Validity.Relative = SMS_VALID_Max_Time;
+
current = 14;
for (i=0;i<msg.Buffer[13];i++) {
switch (msg.Buffer[current]) {
case 0x81:
j=current+4;
while (msg.Buffer[j]!=0) {j++;}
j=j-33;
if (j>GSM_MAX_SMSC_NAME_LENGTH) {
smprintf(s, "Too long name\n");
return ERR_UNKNOWNRESPONSE;
}
CopyUnicodeString(Data->SMSC->Name,msg.Buffer+current+4);
@@ -256,25 +261,25 @@ static GSM_Error N6510_SetSMSC(GSM_StateMachine *s, GSM_SMSC *smsc)
smprintf(s, "Setting SMSC\n");
return GSM_WaitFor (s, req, count, 0x02, 4, ID_SetSMSC);
}
static GSM_Error N6510_ReplyGetNetworkInfo(GSM_Protocol_Message msg, GSM_StateMachine *s)
{
int current = msg.Buffer[7]+7, tmp;
GSM_Phone_Data *Data = &s->Phone.Data;
#ifdef DEBUG
char name[100];
GSM_NetworkInfo NetInfo;
- smprintf(s, "Network status: ");
+ smprintf(s, "Network status : ");
switch (msg.Buffer[8]) {
case 0x00 : smprintf(s, "home network\n"); break;
case 0x01 : smprintf(s, "roaming network\n"); break;
case 0x04 : smprintf(s, "not logged"); break;
case 0x06 : smprintf(s, "SIM card rejected\n"); break;
case 0x09 : smprintf(s, "not logged"); break;
default : smprintf(s, "unknown %i!\n",msg.Buffer[8]); break;
}
if (msg.Buffer[8]==0x00 || msg.Buffer[8] == 0x01) {
NOKIA_DecodeNetworkCode(msg.Buffer + (current + 7),NetInfo.NetworkCode);
smprintf(s, "Network code : %s\n", NetInfo.NetworkCode);
smprintf(s, "Network name for Gammu : %s ",
@@ -976,29 +981,29 @@ static GSM_Error N6510_GetBatteryCharge(GSM_StateMachine *s, GSM_BatteryCharge *
}
static GSM_Error N6510_ReplyGetWAPBookmark(GSM_Protocol_Message msg, GSM_StateMachine *s)
{
return DCT3DCT4_ReplyGetWAPBookmark (msg, s, true);
}
static GSM_Error N6510_ReplyGetOperatorLogo(GSM_Protocol_Message msg, GSM_StateMachine *s)
{
GSM_Phone_Data *Data = &s->Phone.Data;
smprintf(s, "Operator logo received\n");
+ if (msg.Length == 18) return ERR_EMPTY;
NOKIA_DecodeNetworkCode(msg.Buffer+12,Data->Bitmap->NetworkCode);
smprintf(s, "Network code %s\n",Data->Bitmap->NetworkCode);
Data->Bitmap->BitmapWidth = msg.Buffer[20];
Data->Bitmap->BitmapHeight = msg.Buffer[21];
- if (msg.Length == 18) return ERR_EMPTY;
PHONE_DecodeBitmap(GSM_Nokia6510OperatorLogo,msg.Buffer+26,Data->Bitmap);
return ERR_NONE;
}
GSM_Error N6510_ReplyDeleteMemory(GSM_Protocol_Message msg, GSM_StateMachine *s)
{
smprintf(s, "Phonebook entry deleted\n");
return ERR_NONE;
}
GSM_Error N6510_DeleteMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry)
{
@@ -1756,25 +1761,26 @@ static GSM_Error N6510_GetSyncMLSettings(GSM_StateMachine *s, GSM_SyncMLSettings
0x00, 0x00, 0x00, 0x31, 0x00,
0x01, //location
0x00, 0x00, 0x02, 0x46, 0x00, 0x00};
settings->Connection.Location = settings->Location;
error = N6510_GetConnectionSettings(s, &settings->Connection, N6510_SYNCML_SETTINGS);
if (error != ERR_NONE) return error;
settings->Active = settings->Connection.Active;
settings->Name[0] = 0;
settings->Name[1] = 0;
-// s->Phone.Data.SyncMLSettings = settings;
+ s->Phone.Data.SyncMLSettings = settings;
+
// smprintf(s, "Getting SyncML settings name\n");
// error = GSM_WaitFor (s, NameReq, 16, 0x43, 4, ID_GetSyncMLName);
// if (error != ERR_NONE) return error;
req[9] = settings->Location - 1;
smprintf(s, "Getting additional SyncML settings\n");
return GSM_WaitFor (s, req, 16, 0x43, 4, ID_GetSyncMLSettings);
}
static GSM_Error N6510_ReplyGetChatSettings(GSM_Protocol_Message msg, GSM_StateMachine *s)
{
GSM_ChatSettings *Sett = s->Phone.Data.ChatSettings;
@@ -2274,25 +2280,25 @@ static GSM_Error N6510_DeleteSMSMessage(GSM_StateMachine *s, GSM_SMSMessage *sms
}
req[6]=location / 256;
req[7]=location;
smprintf(s, "Deleting sms\n");
return GSM_WaitFor (s, req, 10, 0x14, 4, ID_DeleteSMSMessage);
}
static GSM_Error N6510_ReplySendSMSMessage(GSM_Protocol_Message msg, GSM_StateMachine *s)
{
switch (msg.Buffer[8]) {
case 0x00:
- smprintf(s, "SMS sent OK, TPMR for sent sms is %02x\n",msg.Buffer[10]);
+ smprintf(s, "SMS sent OK, TPMR for sent sms is %d\n",msg.Buffer[10]);
if (s->User.SendSMSStatus!=NULL) s->User.SendSMSStatus(s->CurrentConfig->Device,0,msg.Buffer[10]);
return ERR_NONE;
default:
smprintf(s, "SMS not sent OK, error code probably %i\n",msg.Buffer[8]);
if (s->User.SendSMSStatus!=NULL) s->User.SendSMSStatus(s->CurrentConfig->Device,msg.Buffer[8],msg.Buffer[10]);
return ERR_NONE;
}
}
static GSM_Error N6510_SendSMSMessage(GSM_StateMachine *s, GSM_SMSMessage *sms)
{
int length = 11;
@@ -2761,24 +2767,25 @@ static GSM_Error N6510_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone,
return ERR_NOTSUPPORTED;
case RING_NOKIABINARY:
s->Phone.Data.Ringtone = Ringtone;
Info.Number = 0;
error=N6510_PrivGetRingtonesInfo(s, &Info, PhoneRingtone);
if (error != ERR_NONE) return error;
if (Ringtone->Location > Info.Number) return ERR_INVALIDLOCATION;
req2[4] = Info.Ringtone[Ringtone->Location-1].ID / 256;
req2[5] = Info.Ringtone[Ringtone->Location-1].ID % 256;
smprintf(s, "Getting binary ringtone\n");
return GSM_WaitFor (s, req2, 6, 0x1f, 4, ID_GetRingtone);
case RING_MIDI:
+ case RING_MMF:
return ERR_NOTSUPPORTED;
}
return ERR_NOTSUPPORTED;
}
static GSM_Error N6510_PlayTone(GSM_StateMachine *s, int Herz, unsigned char Volume, bool start)
{
GSM_Error error;
unsigned char reqStart[] = {
0x00,0x06,0x01,0x00,0x07,0x00 };
unsigned char reqPlay[] = {
0x00,0x06,0x01,0x14,0x05,0x04,
@@ -2977,24 +2984,27 @@ static GSM_Error N6510_GetProfile(GSM_StateMachine *s, GSM_Profile *Profile)
unsigned char req[150] = {N6110_FRAME_HEADER, 0x01, 0x01, 0x0C, 0x01};
unsigned char reqActive[] = {N6110_FRAME_HEADER, 0x05};
int i, length = 7;
GSM_Error error;
/* For now !!! */
if (!strcmp(s->Phone.Data.ModelInfo->model,"3510")) {
if (s->Phone.Data.VerNum>3.37) return ERR_NOTSUPPORTED;
}
if (!strcmp(s->Phone.Data.ModelInfo->model,"6230")) {
return ERR_NOTSUPPORTED;
}
+ if (!strcmp(s->Phone.Data.ModelInfo->model,"5140")) {
+ return ERR_NOTSUPPORTED;
+ }
if (Profile->Location>5) return ERR_INVALIDLOCATION;
for (i = 0; i < 0x0a; i++) {
req[length++] = 0x04;
req[length++] = Profile->Location;
req[length++] = i;
req[length++] = 0x01;
}
req[length++] = 0x04;
req[length++] = Profile->Location;
@@ -3106,52 +3116,76 @@ static GSM_Error N6510_ReplyIncomingSMS(GSM_Protocol_Message msg, GSM_StateMachi
sms.State = SMS_UnRead;
sms.InboxFolder = true;
N6510_DecodeSMSFrame(s, &sms, msg.Buffer+10);
s->User.IncomingSMS(s->CurrentConfig->Device,sms);
}
return ERR_NONE;
}
static GSM_Error N6510_DialVoice(GSM_StateMachine *s, char *number, GSM_CallShowNumber ShowNumber)
{
+ unsigned int pos2 = 15;
unsigned int pos = 4;
+ unsigned char req2[100] = {N6110_FRAME_HEADER,0x01,
+ 0x00,0x02,0x07,0x04,
+ 0x01, // 1 - voice, 2 - data
+ 0x00,0x03,
+ 0x18, // length of rest + 1
+ 0x00,0x00,0x00};
unsigned char req[100] = {N6110_FRAME_HEADER,0x01,
0x0c}; /* Number length */
+ GSM_Error error;
+
+ /* USSD not supported */
+ if (number[0] == '*') return ERR_NOTSUPPORTED;
+ if (number[0] == '#') return ERR_NOTSUPPORTED;
req[pos++] = strlen(number);
EncodeUnicode(req+pos,number,strlen(number));
pos += strlen(number)*2;
req[pos++] = 0x05; /* call type: voice - 0x05, data - 0x01 */
req[pos++] = 0x01;
req[pos++] = 0x05;
req[pos++] = 0x00;
req[pos++] = 0x02;
req[pos++] = 0x00;
req[pos++] = 0x00;
switch (ShowNumber) {
case GSM_CALL_HideNumber:
req[pos++] = 0x02;
break;
case GSM_CALL_ShowNumber:
req[pos++] = 0x03;
break;
case GSM_CALL_DefaultNumberPresence:
req[pos++] = 0x01;
break;
}
+ smprintf(s, "Making voice call\n");
+ error = GSM_WaitFor (s, req, pos, 0x01, 4, ID_DialVoice);
+ if (error != ERR_NOTSUPPORTED) return error;
+
+ if (ShowNumber != GSM_CALL_DefaultNumberPresence) return ERR_NOTSUPPORTED;
+
+ req2[11] = strlen(number)*2+6;
+ req2[pos2++] = strlen(number);
+ EncodeUnicode(req2+pos2,number,strlen(number));
+ pos2 += strlen(number)*2;
smprintf(s, "Making voice call\n");
- return GSM_WaitFor (s, req, pos, 0x01, 4, ID_DialVoice);
+ error = GSM_WaitFor (s, req2, pos2, 0x01, 4, ID_DialVoice);
+ if (error == ERR_NOTSUPPORTED) return ERR_NONE;
+ return error;
}
/* method 3 */
static GSM_Error N6510_ReplyGetCalendarInfo3(GSM_Protocol_Message msg, GSM_StateMachine *s, GSM_NOKIACalToDoLocations *Last)
{
int i=0,j=0;
while (Last->Location[j] != 0x00) j++;
if (j >= GSM_MAXCALENDARTODONOTES) {
smprintf(s, "Increase GSM_MAXCALENDARTODONOTES\n");
return ERR_UNKNOWN;
}
@@ -3165,63 +3199,69 @@ static GSM_Error N6510_ReplyGetCalendarInfo3(GSM_Protocol_Message msg, GSM_State
smprintf(s, "%i ",Last->Location[j-1]);
i++;
}
smprintf(s, "\nNumber of Entries in frame: %i\n",i);
Last->Location[j] = 0;
smprintf(s, "\n");
if (i == 1 && msg.Buffer[12+0*4]*256+msg.Buffer[13+0*4] == 0) return ERR_EMPTY;
if (i == 0) return ERR_EMPTY;
return ERR_NONE;
}
/* method 3 */
-static GSM_Error N6510_GetCalendarInfo3(GSM_StateMachine *s, GSM_NOKIACalToDoLocations *Last, bool Calendar)
+static GSM_Error N6510_GetCalendarInfo3(GSM_StateMachine *s, GSM_NOKIACalToDoLocations *Last, char Type)
{
- GSM_Error error;
+ GSM_Error error = ERR_UNKNOWN;
int i;
unsigned char req[] = {N6110_FRAME_HEADER, 0x9E, 0xFF, 0xFF, 0x00, 0x00,
0x00, 0x00, /* First location */
- 0x00}; /* 0 = calendar, 1 = ToDo in 6610 style */
+ 0x00}; /* 0 = calendar, 1 = ToDo in 6610 style, 2 = Notes */
Last->Location[0] = 0x00;
Last->Number = 0;
- if (Calendar) {
+ req[10] = Type;
+ if (Type == 0) {
smprintf(s, "Getting locations for calendar method 3\n");
error = GSM_WaitFor (s, req, 11, 0x13, 4, ID_GetCalendarNotesInfo);
- } else {
- req[10] = 0x01;
+ } else if (Type == 1) {
smprintf(s, "Getting locations for ToDo method 2\n");
error = GSM_WaitFor (s, req, 11, 0x13, 4, ID_GetToDo);
+ } else if (Type == 2) {
+ smprintf(s, "Getting locations for Notes\n");
+ error = GSM_WaitFor (s, req, 11, 0x13, 4, ID_GetNote);
}
if (error != ERR_NONE && error != ERR_EMPTY) return error;
while (1) {
i=0;
while (Last->Location[i] != 0x00) i++;
smprintf(s, "i = %i %i\n",i,Last->Number);
if (i == Last->Number) break;
if (i != Last->Number && error == ERR_EMPTY) {
smprintf(s, "Phone doesn't support some notes with this method. Workaround\n");
Last->Number = i;
break;
}
req[8] = Last->Location[i-1] / 256;
req[9] = Last->Location[i-1] % 256;
- if (Calendar) {
+ if (Type == 0) {
smprintf(s, "Getting locations for calendar method 3\n");
error = GSM_WaitFor (s, req, 11, 0x13, 4, ID_GetCalendarNotesInfo);
- } else {
+ } else if (Type == 1) {
smprintf(s, "Getting locations for todo method 2\n");
error = GSM_WaitFor (s, req, 11, 0x13, 4, ID_GetToDo);
+ } else if (Type == 2) {
+ smprintf(s, "Getting locations for Notes\n");
+ error = GSM_WaitFor (s, req, 11, 0x13, 4, ID_GetNote);
}
if (error != ERR_NONE && error != ERR_EMPTY) return error;
}
return ERR_NONE;
}
/* method 3 */
GSM_Error N6510_ReplyGetCalendar3(GSM_Protocol_Message msg, GSM_StateMachine *s)
{
GSM_CalendarEntry *entry = s->Phone.Data.Cal;
GSM_DateTime Date;
unsigned long diff;
@@ -3341,69 +3381,75 @@ GSM_Error N6510_ReplyGetCalendar3(GSM_Protocol_Message msg, GSM_StateMachine *s)
}
if (entry->Type == GSM_CAL_MEETING) {
memcpy(entry->Entries[entry->EntriesNum].Text, msg.Buffer+(54+msg.Buffer[51]*2), msg.Buffer[52]*2);
entry->Entries[entry->EntriesNum].Text[msg.Buffer[52]*2] = 0;
entry->Entries[entry->EntriesNum].Text[msg.Buffer[52]*2+1] = 0;
entry->Entries[entry->EntriesNum].EntryType = CAL_LOCATION;
entry->EntriesNum++;
}
return ERR_NONE;
}
+static GSM_Error N6510_PrivGetGenericCalendar3(GSM_StateMachine *s, int Location, GSM_Phone_RequestID ID)
+{
+ unsigned char req[] = {N6110_FRAME_HEADER,0x7D,0x00,0x00,0x00,0x00,
+ 0x00,0x99, /* Location */
+ 0xff,0xff,0xff,0xff};
+
+ req[8] = Location / 256;
+ req[9] = Location % 256;
+
+ return GSM_WaitFor (s, req, 14, 0x13, 4, ID);
+}
+
static GSM_Error N6510_PrivGetCalendar3(GSM_StateMachine *s, GSM_CalendarEntry *Note, bool start, int *LastCalendarYear)
{
GSM_Error error;
GSM_DateTime date_time;
- unsigned char req[] = {N6110_FRAME_HEADER,0x7D,0x00,0x00,0x00,0x00,
- 0x00,0x99, /* Location */
- 0xff,0xff,0xff,0xff,0x01};
if (start) {
/* We have to get current year. It's NOT written in frame for
* Birthday
*/
error=s->Phone.Functions->GetDateTime(s,&date_time);
switch (error) {
case ERR_EMPTY:
case ERR_NOTIMPLEMENTED:
GSM_GetCurrentDateTime(&date_time);
break;
case ERR_NONE:
break;
default:
return error;
}
*LastCalendarYear = date_time.Year;
}
Note->EntriesNum = 0;
Note->Entries[0].Date.Year = *LastCalendarYear;
- req[8] = Note->Location / 256;
- req[9] = Note->Location % 256;
-
s->Phone.Data.Cal=Note;
smprintf(s, "Getting calendar note method 3\n");
- return GSM_WaitFor (s, req, 15, 0x13, 4, ID_GetCalendarNote);
+ return N6510_PrivGetGenericCalendar3(s, Note->Location, ID_GetCalendarNote);
}
/* method 3 */
GSM_Error N6510_GetNextCalendar3(GSM_StateMachine *s, GSM_CalendarEntry *Note, bool start, GSM_NOKIACalToDoLocations *LastCalendar, int *LastCalendarYear, int *LastCalendarPos)
{
GSM_Error error;
bool start2;
if (start) {
- error=N6510_GetCalendarInfo3(s,LastCalendar,true);
+ error=N6510_GetCalendarInfo3(s,LastCalendar,0);
if (error!=ERR_NONE) return error;
if (LastCalendar->Number == 0) return ERR_EMPTY;
*LastCalendarPos = 0;
} else {
(*LastCalendarPos)++;
}
error = ERR_EMPTY;
start2 = start;
while (error == ERR_EMPTY) {
if (*LastCalendarPos >= LastCalendar->Number) return ERR_EMPTY;
@@ -3468,42 +3514,42 @@ static GSM_Error N6510_FindCalendarIconID3(GSM_StateMachine *s, GSM_CalendarEntr
GSM_Error error;
bool found;
for(i=0;i<Priv->CalendarIconsNum;i++) {
if (Priv->CalendarIconsTypes[i] == Entry->Type) {
*ID = Priv->CalendarIcons[i];
return ERR_NONE;
}
}
smprintf(s, "Starting finding note ID\n");
- error=N6510_GetCalendarInfo3(s, &Priv->LastCalendar,true);
+ error=N6510_GetCalendarInfo3(s, &Priv->LastCalendar,0);
memcpy(&LastCalendar1,&Priv->LastCalendar,sizeof(GSM_NOKIACalToDoLocations));
if (error != ERR_NONE) return error;
if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_CAL35) ||
IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_CAL65) ||
IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_CAL62)) {
error=N71_65_AddCalendar2(s,Entry);
} else {
if (Entry->Type == GSM_CAL_MEETING) {
error=N71_65_AddCalendar1(s, Entry, &s->Phone.Data.Priv.N6510.FirstCalendarPos);
} else {
error=N71_65_AddCalendar2(s,Entry);
}
}
if (error != ERR_NONE) return error;
- error=N6510_GetCalendarInfo3(s, &Priv->LastCalendar,true);
+ error=N6510_GetCalendarInfo3(s, &Priv->LastCalendar,0);
memcpy(&LastCalendar2,&Priv->LastCalendar,sizeof(GSM_NOKIACalToDoLocations));
if (error != ERR_NONE) return error;
smprintf(s,"Number of entries: %i %i\n",LastCalendar1.Number,LastCalendar2.Number);
for(i=0;i<LastCalendar2.Number;i++) {
found = true;
for(j=0;j<LastCalendar1.Number;j++) {
if (LastCalendar1.Location[j] == LastCalendar2.Location[i]) {
found = false;
break;
}
@@ -3728,25 +3774,25 @@ static GSM_Error N6510_GetCalendarStatus(GSM_StateMachine *s, GSM_CalendarStatus
if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_CAL62)) {
/* Method 1 */
error=N71_65_GetCalendarInfo1(s, &s->Phone.Data.Priv.N6510.LastCalendar);
if (error!=ERR_NONE) return error;
Status->Used = s->Phone.Data.Priv.N6510.LastCalendar.Number;
return ERR_NONE;
/* Method 2 */
// return ERR_NOTSUPPORTED;
} else {
/* Method 3 */
- error=N6510_GetCalendarInfo3(s,&s->Phone.Data.Priv.N6510.LastCalendar,true);
+ error=N6510_GetCalendarInfo3(s,&s->Phone.Data.Priv.N6510.LastCalendar,0);
if (error!=ERR_NONE) return error;
Status->Used = s->Phone.Data.Priv.N6510.LastCalendar.Number;
return ERR_NONE;
}
}
static GSM_Error N6510_AddCalendar(GSM_StateMachine *s, GSM_CalendarEntry *Note)
{
#ifdef GSM_FORCE_DCT4_CALENDAR_6210
return N71_65_AddCalendar2(s,Note);
#endif
@@ -3963,24 +4009,60 @@ static GSM_Error N6510_ShowStartInfo(GSM_StateMachine *s, bool enable)
return N6510_SetLight(s,N6510_LIGHT_KEYPAD,true);
} else {
error=N6510_SetLight(s,N6510_LIGHT_DISPLAY,false);
if (error != ERR_NONE) return error;
error=N6510_SetLight(s,N6510_LIGHT_TORCH,false);
if (error != ERR_NONE) return error;
return N6510_SetLight(s,N6510_LIGHT_KEYPAD,false);
}
}
+static GSM_Error N6510_ReplyGetNoteInfo(GSM_Protocol_Message msg, GSM_StateMachine *s)
+{
+ return N6510_ReplyGetCalendarInfo3(msg, s, &s->Phone.Data.Priv.N6510.LastNote);
+}
+
+static GSM_Error N6510_ReplyGetNote(GSM_Protocol_Message msg, GSM_StateMachine *s)
+{
+ smprintf(s, "Note received\n");
+ memcpy(s->Phone.Data.Note->Text,msg.Buffer+54,(msg.Buffer[50]*256+msg.Buffer[51])*2);
+ s->Phone.Data.Note->Text[(msg.Buffer[50]*256+msg.Buffer[51])*2] = 0;
+ s->Phone.Data.Note->Text[(msg.Buffer[50]*256+msg.Buffer[51])*2+1] = 0;
+ return ERR_NONE;
+}
+
+GSM_Error N6510_GetNextNote(GSM_StateMachine *s, GSM_NoteEntry *Note, bool start)
+{
+ GSM_Error error;
+ GSM_NOKIACalToDoLocations *LastNote = &s->Phone.Data.Priv.N6510.LastNote;
+
+ if (!IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_NOTES)) return ERR_NOTSUPPORTED;
+
+ if (start) {
+ error=N6510_GetCalendarInfo3(s,LastNote,2);
+ if (error!=ERR_NONE) return error;
+ Note->Location = 1;
+ } else {
+ Note->Location++;
+ }
+
+ if (Note->Location > LastNote->Number) return ERR_EMPTY;
+
+ s->Phone.Data.Note = Note;
+ smprintf(s, "Getting note\n");
+ return N6510_PrivGetGenericCalendar3(s, LastNote->Location[Note->Location-1], ID_GetNote);
+}
+
static int N6510_FindFileCheckSum(unsigned char *ptr, int len)
{
int acc, i, accx;
accx = 0;
acc = 0xffff;
while (len--) {
accx = (accx & 0xffff00ff) | (acc & 0xff00);
acc = (acc & 0xffff00ff) | *ptr++ << 8;
for (i = 0; i < 8; i++) {
acc <<= 1;
if (acc & 0x10000) acc ^= 0x1021;
@@ -4046,25 +4128,25 @@ static GSM_Error N6510_ReplyGetFileFolderInfo(GSM_Protocol_Message msg, GSM_Stat
else if (msg.Buffer[i]==0x02 && msg.Buffer[i+2]==0x05)
File->Type = GSM_File_Image_GIF;
else if (msg.Buffer[i]==0x02 && msg.Buffer[i+2]==0x09)
File->Type = GSM_File_Image_WBMP;
else if (msg.Buffer[i]==0x04 && msg.Buffer[i+2]==0x01)
File->Type = GSM_File_Sound_AMR;
else if (msg.Buffer[i]==0x04 && msg.Buffer[i+2]==0x02)
File->Type = GSM_File_Sound_MIDI;
else if (msg.Buffer[i]==0x08 && msg.Buffer[i+2]==0x05)
File->Type = GSM_File_Video_3GP;
else if (msg.Buffer[i]==0x10 && msg.Buffer[i+2]==0x01)
File->Type = GSM_File_Java_JAR;
-#if DEVELOP
+#ifdef DEVELOP
else if (msg.Buffer[i]==0x00 && msg.Buffer[i+2]==0x01)
File->Type = GSM_File_MMS;
#endif
}
return ERR_NONE;
case 0x2F:
smprintf(s,"File or folder used bytes received\n");
File->Used = msg.Buffer[6]*256*256*256+
msg.Buffer[7]*256*256+
msg.Buffer[8]*256+
msg.Buffer[9];
return ERR_NONE;
@@ -4389,25 +4471,25 @@ static GSM_Error N6510_AddFilePart(GSM_StateMachine *s, GSM_File *File, int *Pos
0x01, 0x28}; /* length */
unsigned char end[30] = {
N7110_FRAME_HEADER, 0x40, 0x00, 0x00, 0x00, 0x01,
0x00, 0x04, /* file ID */
0x00, 0x00, 0x00, 0x00};
if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_NOFILESYSTEM)) return ERR_NOTSUPPORTED;
s->Phone.Data.File = File;
if (*Pos == 0) {
error = N6510_SearchForFileName(s,File);
- if (error == ERR_NONE) return ERR_INVALIDLOCATION;
+ if (error == ERR_NONE) return ERR_FILEALREADYEXIST;
if (error != ERR_EMPTY) return error;
Header[8] = atoi(File->ID_FullName) / 256;
Header[9] = atoi(File->ID_FullName) % 256;
memset(Header+14, 0x00, 300);
CopyUnicodeString(Header+14,File->Name);
Header[222] = File->Used / (256*256*256);
Header[223] = File->Used / (256*256);
Header[224] = File->Used / 256;
Header[225] = File->Used % 256;
switch(File->Type) {
case GSM_File_Image_JPG : Header[231]=0x02; Header[233]=0x01; break;
@@ -4805,25 +4887,25 @@ static GSM_Error N6510_GetToDoStatus1(GSM_StateMachine *s, GSM_ToDoStatus *statu
error = GSM_WaitFor (s, reqLoc, 10, 0x55, 4, ID_GetToDo);
if (error != ERR_NONE) return error;
status->Used = LastToDo->Number;
return ERR_NONE;
}
static GSM_Error N6510_GetToDoStatus2(GSM_StateMachine *s, GSM_ToDoStatus *status)
{
GSM_NOKIACalToDoLocations *LastToDo = &s->Phone.Data.Priv.N6510.LastToDo;
GSM_Error error;
- error = N6510_GetCalendarInfo3(s,LastToDo,false);
+ error = N6510_GetCalendarInfo3(s,LastToDo,1);
if (error!=ERR_NONE) return error;
status->Used = LastToDo->Number;
return ERR_NONE;
}
static GSM_Error N6510_GetToDoStatus(GSM_StateMachine *s, GSM_ToDoStatus *status)
{
status->Used = 0;
if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_TODO63)) {
return N6510_GetToDoStatus1(s, status);
@@ -4935,26 +5017,25 @@ static GSM_Error N6510_ReplyGetToDo2(GSM_Protocol_Message msg, GSM_StateMachine
Date.Minute = msg.Buffer[33];
Date.Second = 0;
Last->EntriesNum = 2;
if (msg.Buffer[45] == 0x01) {
Last->Entries[2].Number = msg.Buffer[45];
Last->Entries[2].EntryType = TODO_COMPLETED;
Last->EntriesNum++;
smprintf(s,"Completed\n");
}
- if (msg.Buffer[14] == 0xFF && msg.Buffer[15] == 0xFF && msg.Buffer[16] == 0xff && msg.Buffer[17] == 0xff)
- {
+ if (msg.Buffer[14] == 0xFF && msg.Buffer[15] == 0xFF && msg.Buffer[16] == 0xff && msg.Buffer[17] == 0xff) {
smprintf(s, "No alarm\n");
} else {
diff = ((unsigned int)msg.Buffer[14]) << 24;
diff += ((unsigned int)msg.Buffer[15]) << 16;
diff += ((unsigned int)msg.Buffer[16]) << 8;
diff += msg.Buffer[17];
memcpy(&Last->Entries[Last->EntriesNum].Date,&Date,sizeof(GSM_DateTime));
GetTimeDifference(diff, &Last->Entries[Last->EntriesNum].Date, false, 60);
smprintf(s, "Alarm date : %02i-%02i-%04i %02i:%02i:%02i\n",
Last->Entries[Last->EntriesNum].Date.Day, Last->Entries[Last->EntriesNum].Date.Month,
Last->Entries[Last->EntriesNum].Date.Year, Last->Entries[Last->EntriesNum].Date.Hour,
@@ -4969,46 +5050,38 @@ static GSM_Error N6510_ReplyGetToDo2(GSM_Protocol_Message msg, GSM_StateMachine
}
Last->EntriesNum++;
}
return ERR_NONE;
}
/* ToDo support - 6610 style */
static GSM_Error N6510_GetNextToDo2(GSM_StateMachine *s, GSM_ToDoEntry *ToDo, bool refresh)
{
GSM_Error error;
GSM_NOKIACalToDoLocations *LastToDo = &s->Phone.Data.Priv.N6510.LastToDo;
- /* The same to getting calendar method 3 */
- unsigned char req[] = {
- N6110_FRAME_HEADER,0x7D,0x00,0x00,0x00,0x00,
- 0x00,0x99, /* Location */
- 0xff,0xff,0xff,0xff,0x01};
if (refresh) {
- error=N6510_GetCalendarInfo3(s,LastToDo,false);
+ error=N6510_GetCalendarInfo3(s,LastToDo,1);
if (error!=ERR_NONE) return error;
ToDo->Location = 1;
} else {
ToDo->Location++;
}
if (ToDo->Location > LastToDo->Number) return ERR_EMPTY;
- req[8] = LastToDo->Location[ToDo->Location-1] / 256;
- req[9] = LastToDo->Location[ToDo->Location-1] % 256;
-
s->Phone.Data.ToDo = ToDo;
smprintf(s, "Getting todo method 2\n");
- return GSM_WaitFor (s, req, 15, 0x13, 4, ID_GetToDo);
+ return N6510_PrivGetGenericCalendar3(s, LastToDo->Location[ToDo->Location-1], ID_GetToDo);
}
static GSM_Error N6510_GetNextToDo(GSM_StateMachine *s, GSM_ToDoEntry *ToDo, bool refresh)
{
if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_TODO63)) {
return N6510_GetNextToDo1(s, ToDo, refresh);
} else if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_TODO66)) {
return N6510_GetNextToDo2(s, ToDo, refresh);
} else {
return ERR_NOTSUPPORTED;
}
}
@@ -5034,25 +5107,25 @@ static GSM_Error N6510_DeleteAllToDo1(GSM_StateMachine *s)
}
static GSM_Error N6510_DeleteToDo2(GSM_StateMachine *s, GSM_ToDoEntry *ToDo)
{
GSM_Error error;
GSM_NOKIACalToDoLocations *LastToDo = &s->Phone.Data.Priv.N6510.LastToDo;
GSM_CalendarEntry Note;
if (!IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_TODO66)) {
return ERR_NOTSUPPORTED;
}
- error=N6510_GetCalendarInfo3(s,LastToDo,false);
+ error=N6510_GetCalendarInfo3(s,LastToDo,1);
if (error!=ERR_NONE) return error;
smprintf(s, "Deleting ToDo method 2\n");
if (ToDo->Location > LastToDo->Number || ToDo->Location == 0) return ERR_INVALIDLOCATION;
Note.Location = LastToDo->Location[ToDo->Location-1];
return N71_65_DelCalendar(s,&Note);
}
/* ToDo support - 6310 style */
static GSM_Error N6510_ReplyGetToDoFirstLoc1(GSM_Protocol_Message msg, GSM_StateMachine *s)
@@ -5442,31 +5515,37 @@ static GSM_Reply_Function N6510ReplyFunctions[] = {
{N71_65_ReplyCallInfo, "\x01",0x03,0x02,ID_IncomingFrame },
{N71_65_ReplyCallInfo, "\x01",0x03,0x03,ID_IncomingFrame },
{N71_65_ReplyCallInfo, "\x01",0x03,0x04,ID_IncomingFrame },
{N71_65_ReplyCallInfo, "\x01",0x03,0x05,ID_IncomingFrame },
{N71_65_ReplyCallInfo, "\x01",0x03,0x07,ID_AnswerCall },
{N71_65_ReplyCallInfo, "\x01",0x03,0x07,ID_IncomingFrame },
{N71_65_ReplyCallInfo, "\x01",0x03,0x09,ID_CancelCall },
{N71_65_ReplyCallInfo, "\x01",0x03,0x09,ID_IncomingFrame },
{N71_65_ReplyCallInfo, "\x01",0x03,0x0A,ID_IncomingFrame },
{N71_65_ReplyCallInfo, "\x01",0x03,0x0B,ID_IncomingFrame },
{N71_65_ReplyCallInfo, "\x01",0x03,0x0C,ID_DialVoice },
{N71_65_ReplyCallInfo, "\x01",0x03,0x0C,ID_IncomingFrame },
+ {N71_65_ReplyCallInfo, "\x01",0x03,0x0F,ID_IncomingFrame },
+ {N71_65_ReplyCallInfo, "\x01",0x03,0x10,ID_DialVoice },
+ {N71_65_ReplyCallInfo, "\x01",0x03,0x10,ID_IncomingFrame },
{N71_65_ReplyCallInfo, "\x01",0x03,0x23,ID_IncomingFrame },
{N71_65_ReplyCallInfo, "\x01",0x03,0x25,ID_IncomingFrame },
{N71_65_ReplyCallInfo, "\x01",0x03,0x27,ID_IncomingFrame },
{N71_65_ReplySendDTMF, "\x01",0x03,0x51,ID_SendDTMF },
{N71_65_ReplyCallInfo, "\x01",0x03,0x53,ID_IncomingFrame },
{N71_65_ReplySendDTMF, "\x01",0x03,0x59,ID_SendDTMF },
{N71_65_ReplySendDTMF, "\x01",0x03,0x5E,ID_SendDTMF },
+ {N71_65_ReplyCallInfo, "\x01",0x03,0xA6,ID_IncomingFrame },
+ {N71_65_ReplyCallInfo, "\x01",0x03,0xD2,ID_IncomingFrame },
+ {N71_65_ReplyCallInfo, "\x01",0x03,0xD3,ID_IncomingFrame },
{N6510_ReplySendSMSMessage, "\x02",0x03,0x03,ID_IncomingFrame },
{N6510_ReplyIncomingSMS, "\x02",0x03,0x04,ID_IncomingFrame },
{N6510_ReplySetSMSC, "\x02",0x03,0x13,ID_SetSMSC },
{N6510_ReplyGetSMSC, "\x02",0x03,0x15,ID_GetSMSC },
{N6510_ReplyGetMemoryStatus, "\x03",0x03,0x04,ID_GetMemoryStatus },
{N6510_ReplyGetMemory, "\x03",0x03,0x08,ID_GetMemory },
{N6510_ReplyDeleteMemory, "\x03",0x03,0x10,ID_SetMemory },
{N71_65_ReplyWritePhonebook, "\x03",0x03,0x0C,ID_SetBitmap },
{N71_65_ReplyWritePhonebook, "\x03",0x03,0x0C,ID_SetMemory },
@@ -5499,31 +5578,33 @@ static GSM_Reply_Function N6510ReplyFunctions[] = {
{N71_65_ReplyDelCalendar, "\x13",0x03,0x0C,ID_DeleteCalendarNote },
{N71_65_ReplyGetNextCalendar1, "\x13",0x03,0x1A,ID_GetCalendarNote },/*method 1*/
{N6510_ReplyGetCalendarNotePos, "\x13",0x03,0x32,ID_GetCalendarNotePos },/*method 1*/
{N6510_ReplyGetCalendarInfo, "\x13",0x03,0x3B,ID_GetCalendarNotesInfo},/*method 1*/
#ifdef DEBUG
{N71_65_ReplyGetNextCalendar2, "\x13",0x03,0x3F,ID_GetCalendarNote },
#endif
{N71_65_ReplyAddCalendar2, "\x13",0x03,0x41,ID_SetCalendarNote },/*method 2*/
{N6510_ReplyAddCalendar3, "\x13",0x03,0x66,ID_SetCalendarNote },/*method 3*/
{N6510_ReplyAddToDo2, "\x13",0x03,0x66,ID_SetToDo },
{N6510_ReplyGetCalendar3, "\x13",0x03,0x7E,ID_GetCalendarNote },/*method 3*/
{N6510_ReplyGetToDo2, "\x13",0x03,0x7E,ID_GetToDo },
+ {N6510_ReplyGetNote, "\x13",0x03,0x7E,ID_GetNote },
{N6510_ReplyGetCalendarSettings, "\x13",0x03,0x86,ID_GetCalendarSettings },
{N6510_ReplyGetLocale, "\x13",0x03,0x8A,ID_GetLocale },
{N6510_ReplyGetCalendarSettings, "\x13",0x03,0x8E,ID_GetCalendarSettings },
{N6510_ReplyGetCalendarNotePos, "\x13",0x03,0x96,ID_GetCalendarNotePos },/*method 3*/
{N6510_ReplyGetToDoFirstLoc2, "\x13",0x03,0x96,ID_SetToDo },
{N6510_ReplyGetCalendarInfo, "\x13",0x03,0x9F,ID_GetCalendarNotesInfo},/*method 3*/
{N6510_ReplyGetToDoStatus2, "\x13",0x03,0x9F,ID_GetToDo },
+ {N6510_ReplyGetNoteInfo, "\x13",0x03,0x9F,ID_GetNote },
{N6510_ReplySaveSMSMessage, "\x14",0x03,0x01,ID_SaveSMSMessage },
{N6510_ReplySetPicture, "\x14",0x03,0x01,ID_SetBitmap },
{N6510_ReplyGetSMSMessage, "\x14",0x03,0x03,ID_GetSMSMessage },
{N6510_ReplyDeleteSMSMessage, "\x14",0x03,0x05,ID_DeleteSMSMessage },
{N6510_ReplyDeleteSMSMessage, "\x14",0x03,0x06,ID_DeleteSMSMessage },
{N6510_ReplyGetSMSStatus, "\x14",0x03,0x09,ID_GetSMSStatus },
{N6510_ReplyGetSMSFolderStatus, "\x14",0x03,0x0d,ID_GetSMSFolderStatus },
{N6510_ReplyGetSMSMessage, "\x14",0x03,0x0f,ID_GetSMSMessage },
{N6510_ReplyAddSMSFolder, "\x14",0x03,0x11,ID_AddSMSFolder },
{N6510_ReplyGetSMSFolders, "\x14",0x03,0x13,ID_GetSMSFolders },
{N6510_ReplySaveSMSMessage, "\x14",0x03,0x17,ID_SaveSMSMessage },
@@ -5642,25 +5723,25 @@ static GSM_Reply_Function N6510ReplyFunctions[] = {
{DCT3DCT4_ReplyGetModelFirmware, "\xD2",0x02,0x00,ID_GetModel },
{DCT3DCT4_ReplyGetModelFirmware, "\xD2",0x02,0x00,ID_GetFirmware },
/* 0xD7 - Bluetooth */
{N6510_ReplyGetRingtoneID, "\xDB",0x03,0x02,ID_SetRingtone },
{NULL, "\x00",0x00,0x00,ID_None }
};
GSM_Phone_Functions N6510Phone = {
- "1100|1100a|1100b|3100|3100b|3108|3200|3200a|3300|3510|3510i|3530|3589i|3590|3595|5100|6100|6200|6220|6230|6310|6310i|6385|6510|6610|6800|7210|7250|7250i|7600|8310|8390|8910|8910i",
+ "1100|1100a|1100b|3100|3100b|3108|3200|3200a|3300|3510|3510i|3530|3589i|3590|3595|5100|5140|6100|6200|6220|6230|6310|6310i|6385|6510|6610|6610i|6800|6810|6820|7210|7250|7250i|7600|8310|8390|8910|8910i",
N6510ReplyFunctions,
N6510_Initialise,
NONEFUNCTION, /* Terminate */
GSM_DispatchMessage,
N6510_ShowStartInfo,
NOKIA_GetManufacturer,
DCT3DCT4_GetModel,
DCT3DCT4_GetFirmware,
DCT4_GetIMEI,
N6510_GetOriginalIMEI,
N6510_GetManufactureMonth,
DCT4_GetProductCode,
@@ -5696,24 +5777,25 @@ GSM_Phone_Functions N6510Phone = {
N6510_GetSpeedDial,
NOTIMPLEMENTED, /* SetSpeedDial */
N6510_GetSMSC,
N6510_SetSMSC,
N6510_GetSMSStatus,
N6510_GetSMSMessage,
N6510_GetNextSMSMessage,
N6510_SetSMS,
N6510_AddSMS,
N6510_DeleteSMSMessage,
N6510_SendSMSMessage,
NOTSUPPORTED, /* SendSavedSMS */
+ NOTSUPPORTED, /* SetFastSMSSending */
NOKIA_SetIncomingSMS,
NOTIMPLEMENTED, /* SetIncomingCB */
N6510_GetSMSFolders,
N6510_AddSMSFolder,
NOTIMPLEMENTED, /* DeleteSMSFolder */
N6510_DialVoice,
N6510_AnswerCall,
N6510_CancelCall,
NOTIMPLEMENTED, /* HoldCall */
NOTIMPLEMENTED, /* UnholdCall */
NOTIMPLEMENTED, /* ConferenceCall */
NOTIMPLEMENTED, /* SplitCall */
@@ -5750,25 +5832,25 @@ GSM_Phone_Functions N6510Phone = {
N6510_AddToDo,
N6510_DeleteToDo2,
N6510_DeleteAllToDo1,
N6510_GetCalendarStatus,
NOTIMPLEMENTED, /* GetCalendar */
N6510_GetNextCalendar,
NOTIMPLEMENTED, /* SetCalendar */
N6510_AddCalendar,
N71_65_DelCalendar,
NOTIMPLEMENTED, /* DeleteAllCalendar */
N6510_GetCalendarSettings,
NOTSUPPORTED, /* SetCalendarSettings */
- NOTIMPLEMENTED, /* GetNote */
+ N6510_GetNextNote,
N6510_GetProfile,
N6510_SetProfile,
N6510_GetFMStation,
N6510_SetFMStation,
N6510_ClearFMStations,
N6510_GetNextFileFolder,
N6510_GetFilePart,
N6510_AddFilePart,
N6510_GetFileSystemStatus,
N6510_DeleteFile,
N6510_AddFolder,
N6510_GetGPRSAccessPoint,
diff --git a/gammu/emb/common/phone/nokia/dct4/n6510.h b/gammu/emb/common/phone/nokia/dct4/n6510.h
index 4717aeb..26623d6 100644
--- a/gammu/emb/common/phone/nokia/dct4/n6510.h
+++ b/gammu/emb/common/phone/nokia/dct4/n6510.h
@@ -25,24 +25,26 @@ typedef struct {
int LastCalendarPos;
GSM_NOKIACalToDoLocations LastCalendar;
int FirstCalendarPos;
unsigned char CalendarIcons[10];
GSM_CalendarNoteType CalendarIconsTypes[10];
int CalendarIconsNum;
GSM_NOKIASMSFolder LastSMSFolder;
GSM_SMSFolders LastSMSFolders;
GSM_NOKIACalToDoLocations LastToDo;
+ GSM_NOKIACalToDoLocations LastNote;
+
unsigned char RingtoneID; /* When set with preview */
int FilesLocations[1000];
int FilesLevels[1000];
int FilesLocationsUsed;
int FilesLocationsCurrent;
int FileToken;
int ParentID;
int FileCheckSum;
unsigned char FMStatus[4000];
int FMStatusLength;
diff --git a/gammu/emb/common/phone/nokia/nauto.c b/gammu/emb/common/phone/nokia/nauto.c
index bf74bc9..3bb53ec 100644
--- a/gammu/emb/common/phone/nokia/nauto.c
+++ b/gammu/emb/common/phone/nokia/nauto.c
@@ -112,25 +112,25 @@ GSM_Phone_Functions NAUTOPhone = {
NOTSUPPORTED, /* AddToDo */
NOTSUPPORTED, /* DeleteToDo */
NOTSUPPORTED, /* DeleteAllToDo */
NOTSUPPORTED, /* GetCalendarStatus */
NOTSUPPORTED, /* GetCalendar */
NOTSUPPORTED, /* GetNextCalendar */
NOTSUPPORTED, /* SetCalendar */
NOTSUPPORTED, /* AddCalendar */
NOTSUPPORTED, /* DeleteCalendar */
NOTSUPPORTED, /* DeleteAllCalendar */
NOTSUPPORTED, /* GetCalendarSettings */
NOTSUPPORTED, /* SetCalendarSettings */
- NOTSUPPORTED, /* GetNote */
+ NOTSUPPORTED, /* GetNextNote */
NOTSUPPORTED, /* GetProfile */
NOTSUPPORTED, /* SetProfile */
NOTSUPPORTED, /* GetFMStation */
NOTSUPPORTED, /* SetFMStation */
NOTSUPPORTED, /* ClearFMStations */
NOTSUPPORTED, /* GetNextFileFolder */
NOTSUPPORTED, /* GetFilePart */
NOTSUPPORTED, /* AddFilePart */
NOTSUPPORTED, /* GetFileSystemStatus */
NOTSUPPORTED, /* DeleteFile */
NOTSUPPORTED, /* AddFolder */
NOTSUPPORTED, /* GetGPRSAccessPoint */
diff --git a/gammu/emb/common/phone/nokia/nfunc.c b/gammu/emb/common/phone/nokia/nfunc.c
index 3acfb10..d4d8b03 100644
--- a/gammu/emb/common/phone/nokia/nfunc.c
+++ b/gammu/emb/common/phone/nokia/nfunc.c
@@ -1384,53 +1384,67 @@ GSM_Error N71_65_ReplyCallInfo(GSM_Protocol_Message msg, GSM_StateMachine *s)
smprintf(s, "Call is being released\n");
break;
case 0x0b:
smprintf(s, "Meaning not known\n");
call.CallIDAvailable = false;
break;
case 0x0c:
smprintf(s, "Audio status\n");
if (msg.Buffer[4] == 0x01) smprintf(s, "Audio enabled\n");
else smprintf(s, "Audio disabled\n");
call.CallIDAvailable = false;
break;
+ case 0x0f:
+ case 0x10:
+ smprintf(s, "Meaning not known\n");
+ call.CallIDAvailable = false;
+ break;
case 0x23:
smprintf(s, "Call held\n");
call.Status = GSM_CALL_CallHeld;
break;
case 0x25:
smprintf(s, "Call resumed\n");
call.Status = GSM_CALL_CallResumed;
break;
case 0x27:
smprintf(s, "Call switched\n");
call.Status = GSM_CALL_CallSwitched;
break;
case 0x53:
smprintf(s, "Outgoing call\n");
smprintf(s, "Call mode : %i\n",msg.Buffer[5]);//such interpretation is in gnokii
tmp = 6;
NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,buffer,false);
smprintf(s, "Number : \"%s\"\n",DecodeUnicodeString(buffer));
/* FIXME: read name from frame */
call.Status = GSM_CALL_OutgoingCall;
tmp = 6;
NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,call.PhoneNumber,false);
break;
+ case 0xA6:
+ case 0xD2:
+ case 0xD3:
+ smprintf(s, "Meaning not known\n");
+ call.CallIDAvailable = false;
+ break;
}
if (call.CallIDAvailable) smprintf(s, "Call ID : %d\n",msg.Buffer[4]);
if (s->Phone.Data.EnableIncomingCall && s->User.IncomingCall!=NULL && call.Status != 0) {
if (call.CallIDAvailable) call.CallID = msg.Buffer[4];
s->User.IncomingCall(s->CurrentConfig->Device, call);
}
+ if (s->Phone.Data.RequestID == ID_DialVoice) {
+ if (msg.Buffer[3] == 0x10) return ERR_NOTSUPPORTED;
+ }
if (s->Phone.Data.RequestID == ID_CancelCall) {
if (msg.Buffer[3] == 0x09) {
if (s->Phone.Data.CallID == msg.Buffer[4]) return ERR_NONE;
/* when we canceled call and see frame about other
* call releasing, we don't give ERR_NONE for "our"
* call release command
*/
return ERR_NEEDANOTHERANSWER;
}
}
if (s->Phone.Data.RequestID == ID_AnswerCall) {
if (msg.Buffer[3] == 0x07) {