summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/phone/alcatel/alcatel.c
Side-by-side diff
Diffstat (limited to 'gammu/emb/common/phone/alcatel/alcatel.c') (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/phone/alcatel/alcatel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gammu/emb/common/phone/alcatel/alcatel.c b/gammu/emb/common/phone/alcatel/alcatel.c
index b75077f..718d91e 100644
--- a/gammu/emb/common/phone/alcatel/alcatel.c
+++ b/gammu/emb/common/phone/alcatel/alcatel.c
@@ -1,251 +1,251 @@
/* (c) 2002-2004 by Michal Cihar */
/*
* High level functions for communication with Alcatel One Touch 501 and
* compatible mobile phone.
*
* This code implements functions to communicate with Alcatel phones,
* currently seem to work:
* - BE5 series (501/701)
* - BF5 series (715)
* - BH4 series (535/735)
* For some functions it uses normal AT mode (not implemented here, look at
* ../at/atgen.[ch]) for others it switches into binary mode and initialises
* underlaying protocol (see ../../protocol/alcatel/alcabus.[ch]) and
* communicates over it. Don't ask me why Alcatel uses such silly thing...
*
* Notes for future features:
* - max phone number length is 61 (BE5)
* - max name length is 50 (BE5)
*/
#include "../../gsmstate.h"
#ifdef GSM_ENABLE_ALCATEL
#ifdef GSM_ENABLE_ATGEN
#include <string.h>
#include <time.h>
#include "../../gsmcomon.h"
#include "../../misc/coding/coding.h"
#include "../../misc/misc.h"
#include "../../service/sms/gsmsms.h"
#include "../pfunc.h"
#include "alcatel.h"
/* Timeout for GSM_WaitFor calls. */
#define ALCATEL_TIMEOUT 64
/* Some magic numbers for protocol follow */
/* synchronisation types (for everything except begin transfer): */
#define ALCATEL_SYNC_TYPE_CALENDAR 0x64
#define ALCATEL_SYNC_TYPE_TODO 0x68
#define ALCATEL_SYNC_TYPE_CONTACTS 0x6C
/* synchronisation types (for begin transfer): */
#define ALCATEL_BEGIN_SYNC_CALENDAR 0x00
#define ALCATEL_BEGIN_SYNC_TODO 0x02
#define ALCATEL_BEGIN_SYNC_CONTACTS 0x01
/* category types */
#define ALCATEL_LIST_TODO_CAT 0x9B
#define ALCATEL_LIST_CONTACTS_CAT 0x96
/* We need lot of ATGEN functions, because Alcatel is an AT device. */
-extern GSM_Reply_Function ALCATELReplyFunctions[];
+static GSM_Reply_Function ALCATELReplyFunctions[];
extern GSM_Reply_Function ATGENReplyFunctions[];
extern GSM_Error ATGEN_Initialise (GSM_StateMachine *s);
extern GSM_Error ATGEN_Terminate (GSM_StateMachine *s);
extern GSM_Error ATGEN_GetIMEI (GSM_StateMachine *s);
extern GSM_Error ATGEN_GetFirmware (GSM_StateMachine *s);
extern GSM_Error ATGEN_GetModel (GSM_StateMachine *s);
extern GSM_Error ATGEN_GetDateTime (GSM_StateMachine *s, GSM_DateTime *date_time);
extern GSM_Error ATGEN_GetMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry);
extern GSM_Error ATGEN_GetNextMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry, bool start);
extern GSM_Error ATGEN_SetMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry);
extern GSM_Error ATGEN_AddMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry);
extern GSM_Error ATGEN_DeleteMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry);
extern GSM_Error ATGEN_GetMemoryStatus (GSM_StateMachine *s, GSM_MemoryStatus *Status);
extern GSM_Error ATGEN_GetSMSC (GSM_StateMachine *s, GSM_SMSC *smsc);
extern GSM_Error ATGEN_SetSMSC (GSM_StateMachine *s, GSM_SMSC *smsc);
extern GSM_Error ATGEN_GetSMSFolders (GSM_StateMachine *s, GSM_SMSFolders *folders);
extern GSM_Error ATGEN_GetSMSStatus (GSM_StateMachine *s, GSM_SMSMemoryStatus *status);
extern GSM_Error ATGEN_GetSMS (GSM_StateMachine *s, GSM_MultiSMSMessage *sms);
extern GSM_Error ATGEN_GetNextSMS (GSM_StateMachine *s, GSM_MultiSMSMessage *sms, bool start);
extern GSM_Error ATGEN_SendSavedSMS (GSM_StateMachine *s, int Folder, int Location);
extern GSM_Error ATGEN_SendSMS (GSM_StateMachine *s, GSM_SMSMessage *sms);
extern GSM_Error ATGEN_DeleteSMS (GSM_StateMachine *s, GSM_SMSMessage *sms);
extern GSM_Error ATGEN_AddSMS (GSM_StateMachine *s, GSM_SMSMessage *sms);
extern GSM_Error ATGEN_GetBatteryCharge (GSM_StateMachine *s, GSM_BatteryCharge *bat);
extern GSM_Error ATGEN_GetSignalQuality (GSM_StateMachine *s, GSM_SignalQuality *sig);
extern GSM_Error ATGEN_DialVoice (GSM_StateMachine *s, char *number, GSM_CallShowNumber ShowNumber);
extern GSM_Error ATGEN_AnswerCall (GSM_StateMachine *s, int ID, bool all);
extern GSM_Error ATGEN_CancelCall (GSM_StateMachine *s, int ID, bool all);
extern GSM_Error ATGEN_SetDateTime (GSM_StateMachine *s, GSM_DateTime *date_time);
extern GSM_Error ATGEN_EnterSecurityCode (GSM_StateMachine *s, GSM_SecurityCode Code);
extern GSM_Error ATGEN_GetSecurityStatus (GSM_StateMachine *s, GSM_SecurityCodeType *Status);
extern GSM_Error ATGEN_ResetPhoneSettings (GSM_StateMachine *s, GSM_ResetSettingsType Type);
extern GSM_Error ATGEN_SendDTMF (GSM_StateMachine *s, char *sequence);
extern GSM_Error ATGEN_GetSIMIMSI (GSM_StateMachine *s, char *IMSI);
extern GSM_Error ATGEN_HandleCMSError (GSM_StateMachine *s);
extern GSM_Error ATGEN_GetNetworkInfo (GSM_StateMachine *s, GSM_NetworkInfo *netinfo);
extern GSM_Error ATGEN_Reset (GSM_StateMachine *s, bool hard);
extern GSM_Error ATGEN_PressKey (GSM_StateMachine *s, GSM_KeyCode Key, bool Press);
extern GSM_Error ATGEN_GetDisplayStatus (GSM_StateMachine *s, GSM_DisplayFeatures *features);
extern GSM_Error ATGEN_SetAutoNetworkLogin (GSM_StateMachine *s);
extern GSM_Error ATGEN_DeleteAllMemory (GSM_StateMachine *s, GSM_MemoryType type);
extern GSM_Error ATGEN_DispatchMessage (GSM_StateMachine *s);
extern GSM_Error ATGEN_SetFastSMSSending (GSM_StateMachine *s, bool enable);
extern GSM_Error ATGEN_SetIncomingCB (GSM_StateMachine *s, bool enable);
extern GSM_Error ATGEN_SetIncomingSMS (GSM_StateMachine *s, bool enable);
/**
* Alcatel uses some 8-bit characters in contacts, calendar etc.. This table
* attempts to decode it, it is probably not complete, here are just chars
* that I found...
*/
unsigned char GSM_AlcatelAlphabet[] =
{
/* in phone unicode description */
0x80, 0x00,0x20, /* empty */
0x81, 0x00,0x20, /* empty */
0x82, 0x00,0x20, /* empty */
0x83, 0x00,0x20, /* empty */
0x84, 0x00,0xe7, /* c cedilla */
0x85, 0x20,0x26, /* ... */
0x86, 0x03,0xc0, /* pi */
0x87, 0x01,0x3e, /* l caron */
0x88, 0x00,0xc0, /* A grave */
0x89, 0x00,0xc1, /* A acute */
0x8a, 0x00,0xc2, /* A circumflex */
0x8b, 0x00,0xc3, /* A tilde */
0x8c, 0x00,0xc8, /* E grave */
0x8d, 0x00,0xca, /* E circumflex */
0x8e, 0x00,0xcb, /* E diaresis */
0x8f, 0x00,0xcc, /* I grave */
0x90, 0x00,0xcd, /* I acute */
0x91, 0x00,0xd0, /* ETH */
0x92, 0x00,0xd2, /* O grave */
0x93, 0x00,0xd3, /* O acute */
0x94, 0x00,0xd4, /* O circumflex */
0x95, 0x00,0xd5, /* O tilde */
0x96, 0x00,0xd9, /* U grave */
0x97, 0x00,0xda, /* U acute */
0x98, 0x00,0xe1, /* a acute */
0x99, 0x00,0xe2, /* a circumflex */
0x9a, 0x00,0xe3, /* a tilde */
0x9b, 0x00,0xea, /* e circumflex */
0x9c, 0x00,0xeb, /* e diaresis */
0x9d, 0x00,0xed, /* i acute */
0x9e, 0x00,0xee, /* i circumflex */
0x9f, 0x00,0xef, /* i diaresis */
0xa0, 0x00,0xf3, /* o acute */
0xa1, 0x00,0xf4, /* o circumflex */
0xa2, 0x00,0xf5, /* o tilde */
0xa3, 0x00,0xfa, /* u acute */
0xa4, 0x00,0xa2, /* cent */
0xa5, 0x00,0x5b, /* [ */
0xa6, 0x01,0x59, /* r caron */
0xa7, 0x01,0x0d, /* c caron */
0xa8, 0x01,0x61, /* s caron */
0xa9, 0x01,0x1b, /* e caron */
0xaa, 0x01,0x6f, /* u ring */
0xab, 0x00,0xfd, /* y acute */
0xac, 0x00,0xf0, /* eth */
0xad, 0x01,0x07, /* c acute */
0xae, 0x01,0x19, /* e ogonek */
0xaf, 0x01,0x05, /* a ogonek */
0xb0, 0x01,0x7c, /* z dot */
0xb1, 0x01,0x7a, /* z acute */
0xb2, 0x01,0x5b, /* s acute */
0xb3, 0x01,0x44, /* n acute */
0xb4, 0x01,0x42, /* l stroke */
0xb5, 0x00,0x20, /* empty */
0xb6, 0x01,0x48, /* n caron */
0xb7, 0x01,0x65, /* t caron */
0xb8, 0x00,0x20, /* empty */
0xb9, 0x01,0x7e, /* z caron */
0xba, 0x01,0xe7, /* g caron */
0xbb, 0x00,0x20, /* empty */
0xbc, 0x00,0x20, /* empty */
0xbd, 0x1e,0x20, /* G macron */
0xbe, 0x1e,0x21, /* g macron */
0xbf, 0x01,0x5e, /* S cedilla */
0xc0, 0x01,0x5f, /* s cedilla */
0xc1, 0x01,0x2f, /* i ogonek */ /* FIXME: not sure with this, it look like normal i */
0xc2, 0x01,0x31, /* i dotless */
0xc3, 0x01,0x68, /* U tilde */
0xc4, 0x01,0x50, /* O dbl acute */
0xc5, 0x01,0x69, /* u tilde */
0xc6, 0x01,0x51, /* o dbl acute */
0xc7, 0x27,0xa9, /* => */
0xc8, 0x27,0xa8, /* filled => */
0xc9, 0x00,0xd7, /* x */
0xca, 0x00,0x5d, /* ] */
0xcb, 0x26,0x0f, /* phone */
0xcc, 0x01,0x0f, /* d caron */
0xcd, 0x00,0x20, /* empty */
0xce, 0x00,0x7e, /* ~ */
0xcf, 0x00,0x5c, /* \ */
0xd0, 0x00,0x5e, /* ^ */
0xd1, 0x00,0x20, /* empty */
0xd2, 0x00,0x7b, /* { */
0xd3, 0x00,0x7c, /* | */
0xd4, 0x00,0x7d, /* } */
0xd5, 0x00,0x20, /* empty */
0xd6, 0x01,0x63, /* t cedilla */
0xd7, 0x00,0x20, /* empty */
0xd8, 0x00,0x20, /* empty */
0xd9, 0x00,0x20, /* empty */
0xda, 0x00,0x20, /* empty */
0xdb, 0x00,0x20, /* empty */
0xdc, 0x00,0x20, /* empty */
0xdd, 0x00,0x20, /* empty */
0xde, 0x00,0x20, /* empty */
0xdf, 0x00,0x20, /* empty */
0xe0, 0x00,0x20, /* empty */
0xe1, 0x00,0x20, /* two candles */ /* FIXME */
0xe2, 0x00,0x20, /* empty */
0xe3, 0x00,0x20, /* empty */
0xe4, 0x00,0x20, /* empty */
0xe5, 0x01,0xce, /* a caron */
0xe6, 0x01,0x01, /* a macron */
0xe7, 0x01,0x13, /* e macron */
0xe8, 0x01,0x2b, /* i macron */
0xe9, 0x01,0x4d, /* o macron */
0xea, 0x01,0x6b, /* u macron */
0xeb, 0x00,0x41, /* A */
0xec, 0x00,0x40, /* @ */
0xed, 0x00,0x20, /* some strange char :-) */ /* FIXME */
0xee, 0x00,0x20, /* big key stroken */ /* FIXME */
0xef, 0x00,0x20, /* big key */ /* FIXME */
0xf0, 0x00,0x20, /* empty */
0xf1, 0x00,0x31, /* 1 */
0xf2, 0x00,0x21, /* bold ! */
0xf3, 0x26,0x0e, /* black phone */