author | zautrix <zautrix> | 2004-10-05 11:13:51 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-05 11:13:51 (UTC) |
commit | 50ab40e1e02ad7c65c17a78d08116a808b1257aa (patch) (side-by-side diff) | |
tree | 0d1939e2297fa7bbd8e1f2030f154463854164c6 /gammu/emb/common/phone/nokia/dct3/n7110.c | |
parent | cf8616f64f20e5448d4ff644f7cc15750cf3f85f (diff) | |
download | kdepimpi-50ab40e1e02ad7c65c17a78d08116a808b1257aa.zip kdepimpi-50ab40e1e02ad7c65c17a78d08116a808b1257aa.tar.gz kdepimpi-50ab40e1e02ad7c65c17a78d08116a808b1257aa.tar.bz2 |
updated to latest gammu version
Diffstat (limited to 'gammu/emb/common/phone/nokia/dct3/n7110.c') (more/less context) (ignore whitespace changes)
-rw-r--r-- | gammu/emb/common/phone/nokia/dct3/n7110.c | 9 |
1 files changed, 7 insertions, 2 deletions
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,50 +1,53 @@ /* (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" #include "../nfunc.h" #include "../nfuncold.h" #include "n7110.h" #include "dct3func.h" static GSM_Error N7110_GetAlarm(GSM_StateMachine *s, GSM_Alarm *alarm) { return DCT3_GetAlarm(s, alarm, 0x19); } static GSM_Error N7110_SetAlarm(GSM_StateMachine *s, GSM_Alarm *alarm) { return DCT3_SetAlarm(s, alarm, 0x19); } static GSM_Error N7110_ReplyGetMemory(GSM_Protocol_Message msg, GSM_StateMachine *s) { GSM_Phone_Data *Data = &s->Phone.Data; smprintf(s, "Phonebook entry received\n"); switch (msg.Buffer[6]) { case 0x0f: return N71_65_ReplyGetMemoryError(msg.Buffer[10], s); default: return N71_65_DecodePhonebook(s, Data->Memory,Data->Bitmap,Data->SpeedDial,msg.Buffer+18,msg.Length-18,false); } return ERR_UNKNOWN; } static GSM_Error N7110_GetMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry) { unsigned char req[] = {N7110_FRAME_HEADER, 0x07, 0x01, 0x01, 0x00, 0x01, 0x02, /* memory type */ 0x05, 0x00, 0x00, /* location */ 0x00, 0x00}; @@ -481,96 +484,97 @@ static GSM_Error N7110_ReplyGetRingtone(GSM_Protocol_Message msg, GSM_StateMachi tmp=0;i=4; while (msg.Buffer[i]!=0 || msg.Buffer[i+1]!=0) { tmp++; i=i+2; if (i>msg.Length) return ERR_EMPTY; } memcpy(Data->Ringtone->Name,msg.Buffer+6,tmp*2); smprintf(s, "Name \"%s\"\n",DecodeUnicodeString(Data->Ringtone->Name)); /* Looking for end */ i=37; while (true) { if (msg.Buffer[i]==0x07 && msg.Buffer[i+1]==0x0b) { i=i+2; break; } if (msg.Buffer[i]==0x0e && msg.Buffer[i+1]==0x0b) { i=i+2; break; } i++; if (i==msg.Length) return ERR_EMPTY; } /* Copying frame */ memcpy(Data->Ringtone->NokiaBinary.Frame,msg.Buffer+37,i-37); Data->Ringtone->NokiaBinary.Length=i-37; return ERR_NONE; case 0x24: smprintf(s, "Invalid location. Too high ?\n"); return ERR_INVALIDLOCATION; } return ERR_UNKNOWNRESPONSE; } static GSM_Error N7110_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, bool PhoneRingtone) { unsigned char req[] = {N7110_FRAME_HEADER, 0x22, 0x00, 0x00}; if (PhoneRingtone) return ERR_NOTSUPPORTED; 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]); smprintf(s, "Locations :"); Priv->LastPictureImageFolder.Number=msg.Buffer[4]*256+msg.Buffer[5]; for (i=0;i<Priv->LastPictureImageFolder.Number;i++) { Priv->LastPictureImageFolder.Location[i]=msg.Buffer[6+i*2]*256+msg.Buffer[7+i*2]; smprintf(s, " %i",Priv->LastPictureImageFolder.Location[i]); } smprintf(s, "\n"); return ERR_NONE; } static GSM_Error N7110_GetPictureImageLocation(GSM_StateMachine *s, GSM_Bitmap *Bitmap, unsigned char *folder, int *location) { GSM_Phone_N7110Data *Priv = &s->Phone.Data.Priv.N7110; GSM_SMSFolders folders; GSM_Error error; int i, j = 0, count = 0; unsigned char req[] = {N6110_FRAME_HEADER, 0x96, 0x00, /* Folder ID */ 0x0f, 0x07}; error=N7110_GetSMSFolders (s, &folders); if (error!=ERR_NONE) return error; for (i=0;i<folders.Number;i++) { req[4] = (i+1) * 0x08; /* SMS folder ID */ error = GSM_WaitFor (s, req, 7, 0x14, 4, ID_GetBitmap); if (error!=ERR_NONE) return error; for (j=0;j<Priv->LastPictureImageFolder.Number;j++) { count++; if (count==Bitmap->Location) break; } if (count==Bitmap->Location) break; } if (count!=Bitmap->Location) return ERR_INVALIDLOCATION; *folder = (i+1) * 0x08; /* SMS Folder ID */ *location = Priv->LastPictureImageFolder.Location[j]; @@ -1602,123 +1606,124 @@ GSM_Phone_Functions N7110Phone = { NOKIA_GetManufacturer, DCT3DCT4_GetModel, DCT3DCT4_GetFirmware, DCT3_GetIMEI, DCT3_GetOriginalIMEI, DCT3_GetManufactureMonth, DCT3_GetProductCode, DCT3_GetHardware, DCT3_GetPPM, NOTSUPPORTED, /* GetSIMIMSI */ N71_92_GetDateTime, N71_92_SetDateTime, N7110_GetAlarm, N7110_SetAlarm, NOTSUPPORTED, /* GetLocale */ NOTSUPPORTED, /* SetLocale */ DCT3_PressKey, DCT3_Reset, N61_71_ResetPhoneSettings, NOTSUPPORTED, /* EnterSecurityCode */ NOTSUPPORTED, /* GetSecurityStatus */ NOTSUPPORTED, /* GetDisplayStatus */ NOTIMPLEMENTED, /* SetAutoNetworkLogin */ N71_92_GetBatteryCharge, N71_92_GetSignalQuality, DCT3_GetNetworkInfo, NOTSUPPORTED, /* GetCategory */ NOTSUPPORTED, /* AddCategory */ NOTSUPPORTED, /* GetCategoryStatus */ N7110_GetMemoryStatus, N7110_GetMemory, NOTIMPLEMENTED, /* GetNextMemory */ N7110_SetMemory, NOTIMPLEMENTED, /* AddMemory */ N7110_DeleteMemory, NOTIMPLEMENTED, /* DeleteAllMemory */ 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 */ NOTIMPLEMENTED, /* TransferCall */ NOTIMPLEMENTED, /* SwitchCall */ NOTSUPPORTED, /* GetCallDivert */ N7110_SetCallDivert, N7110_CancelAllDiverts, N7110_SetIncomingCall, N7110_SetIncomingUSSD, DCT3DCT4_SendDTMF, N7110_GetRingtone, N7110_SetRingtone, NOTSUPPORTED, /* GetRingtonesInfo */ NOTSUPPORTED, /* DeleteUserRingtones */ DCT3_PlayTone, DCT3_GetWAPBookmark, DCT3_SetWAPBookmark, DCT3_DeleteWAPBookmark, DCT3_GetWAPSettings, DCT3_SetWAPSettings, NOTSUPPORTED, /* GetMMSSettings */ NOTSUPPORTED, /* SetMMSSettings */ NOTSUPPORTED, /* GetSyncMLSettings */ NOTSUPPORTED, /* SetSyncMLSettings */ NOTSUPPORTED, /* GetChatSettings */ NOTSUPPORTED, /* SetChatSettings */ N7110_GetBitmap, N7110_SetBitmap, NOTSUPPORTED, /* GetToDoStatus */ NOTSUPPORTED, /* GetToDo */ NOTSUPPORTED, /* GetNextToDo */ NOTSUPPORTED, /* SetToDo */ 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 */ NOTSUPPORTED /* SetGPRSAccessPoint */ }; #endif /* How should editor hadle tabs in this file? Add editor commands here. * vim: noexpandtab sw=8 ts=8 sts=8: */ |