summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/gsmstate.h
Side-by-side diff
Diffstat (limited to 'gammu/emb/common/gsmstate.h') (more/less context) (show whitespace changes)
-rw-r--r--gammu/emb/common/gsmstate.h31
1 files changed, 24 insertions, 7 deletions
diff --git a/gammu/emb/common/gsmstate.h b/gammu/emb/common/gsmstate.h
index cb17623..2b4806c 100644
--- a/gammu/emb/common/gsmstate.h
+++ b/gammu/emb/common/gsmstate.h
@@ -1,28 +1,36 @@
/* (c) 2002-2004 by Marcin Wiacek & Michal Cihar */
#ifndef __gsm_state_h
#define __gsm_state_h
#include <time.h>
#include "config.h"
#include "misc/cfg.h"
+typedef struct _GSM_StateMachine GSM_StateMachine;
+typedef struct _GSM_User GSM_User;
+typedef struct _OnePhoneModel OnePhoneModel;
+typedef struct _GSM_Reply_Function GSM_Reply_Function;
+
#ifdef GSM_ENABLE_NOKIA3320
# include "phone/nokia/dct4/n3320.h"
#endif
#ifdef GSM_ENABLE_NOKIA3650
# include "phone/nokia/dct4/n3650.h"
#endif
+#ifdef GSM_ENABLE_NOKIA650
+# include "phone/nokia/dct3/n0650.h"
+#endif
#ifdef GSM_ENABLE_NOKIA6110
# include "phone/nokia/dct3/n6110.h"
#endif
#ifdef GSM_ENABLE_NOKIA6510
# include "phone/nokia/dct4/n6510.h"
#endif
#ifdef GSM_ENABLE_NOKIA7110
# include "phone/nokia/dct3/n7110.h"
#endif
#ifdef GSM_ENABLE_NOKIA9210
# include "phone/nokia/dct3/n9210.h"
#endif
@@ -85,25 +93,25 @@
# undef GSM_ENABLE_BLUEPHONET
#endif
#ifndef GSM_USED_BLUEAT
# undef GSM_ENABLE_BLUEAT
#endif
#ifndef GSM_USED_IRDAAT
# undef GSM_ENABLE_IRDAAT
#endif
#ifndef GSM_USED_MROUTERBLUE
# undef GSM_ENABLE_MROUTERBLUE
#endif
-#if defined(GSM_ENABLE_NOKIA3320) || defined(GSM_ENABLE_NOKIA6110) || defined(GSM_ENABLE_NOKIA7110) || defined(GSM_ENABLE_NOKIA9210)
+#if defined(GSM_ENABLE_NOKIA3320) || defined(GSM_ENABLE_NOKIA650) || defined(GSM_ENABLE_NOKIA6110) || defined(GSM_ENABLE_NOKIA7110) || defined(GSM_ENABLE_NOKIA9210)
# define GSM_ENABLE_NOKIA_DCT3
#endif
#if defined(GSM_ENABLE_NOKIA3650) || defined(GSM_ENABLE_NOKIA6510)
# define GSM_ENABLE_NOKIA_DCT4
#endif
#include "protocol/protocol.h"
#if defined(GSM_ENABLE_FBUS2) || defined(GSM_ENABLE_FBUS2IRDA) || defined(GSM_ENABLE_FBUS2DLR3) || defined(GSM_ENABLE_FBUS2BLUE) || defined(GSM_ENABLE_BLUEFBUS2) || defined(GSM_ENABLE_FBUS2DKU5) || defined(GSM_ENABLE_FBUS2PL2303)
# include "protocol/nokia/fbus2.h"
#endif
#ifdef GSM_ENABLE_MBUS2
# include "protocol/nokia/mbus2.h"
@@ -190,27 +198,24 @@
#include "service/gsmring.h"
#include "service/gsmcal.h"
#include "service/gsmdata.h"
#include "service/gsmlogo.h"
#include "service/gsmmisc.h"
#include "service/gsmprof.h"
#include "service/gsmcall.h"
#include "service/sms/gsmsms.h"
#include "service/sms/gsmems.h"
#include "service/sms/gsmmulti.h"
#include "service/backup/gsmback.h"
-typedef struct _GSM_StateMachine GSM_StateMachine;
-typedef struct _GSM_User GSM_User;
-typedef struct _OnePhoneModel OnePhoneModel;
/* ------------------------- Device layer ---------------------------------- */
/**
* Device functions, each device has to provide these.
*/
typedef struct {
/**
* Opens device.
*/
GSM_Error (*OpenDevice) (GSM_StateMachine *s);
/**
@@ -362,24 +367,26 @@ typedef enum {
ID_GetFirmware,
ID_EnableSecurity,
ID_GetIMEI,
ID_GetDateTime,
ID_GetAlarm,
ID_GetMemory,
ID_GetMemoryStatus,
ID_GetSMSC,
ID_GetSMSMessage,
ID_EnableEcho,
ID_EnableErrorInfo,
ID_SetOBEX,
+ ID_SetUSSD,
+ ID_GetNote,
ID_GetSignalQuality,
ID_GetBatteryCharge,
ID_GetSMSFolders,
ID_GetSMSFolderStatus,
ID_GetSMSStatus,
ID_AddSMSFolder,
ID_GetNetworkInfo,
ID_GetRingtone,
ID_DialVoice,
ID_GetCalendarNotesInfo,
ID_GetCalendarNote,
ID_GetSecurityCode,
@@ -429,24 +436,25 @@ typedef enum {
ID_GetHardware,
ID_GetPPM,
ID_GetSMSMode,
ID_GetSMSMemories,
ID_GetManufacturer,
ID_SetMemoryType,
ID_SetMemoryCharset,
ID_GetMMSSettings,
ID_SetSMSParameters,
ID_GetFMStation,
ID_SetFMStation,
ID_GetLanguage,
+ ID_SetFastSMSSending,
ID_Reset,
ID_GetToDo,
ID_PressKey,
ID_DeleteAllToDo,
ID_SetLight,
ID_Divert,
ID_SetToDo,
ID_PlayTone,
ID_GetChatSettings,
ID_GetSyncMLSettings,
ID_GetSyncMLName,
ID_GetSecurityStatus,
@@ -660,24 +668,25 @@ typedef struct {
/**
* Used internally by phone drivers.
*/
unsigned char *Netmonitor;
/**
* Pointer to structure used internally by phone drivers.
*/
GSM_MultiCallDivert *Divert;
/**
* Pointer to structure used internally by phone drivers.
*/
GSM_ToDoEntry *ToDo;
+ GSM_NoteEntry *Note;
/**
* Used internally by phone drivers.
*/
bool PressKey;
/**
* Pointer to structure used internally by phone drivers.
*/
GSM_SecurityCodeType *SecurityStatus;
/**
* Pointer to structure used internally by phone drivers.
*/
GSM_Profile *Profile;
@@ -761,24 +770,27 @@ typedef struct {
/**
* Structure with private phone modules data.
*/
struct {
int fake;
#ifdef GSM_ENABLE_NOKIA3320
GSM_Phone_N3320Data N3320;
#endif
#ifdef GSM_ENABLE_NOKIA3650
GSM_Phone_N3650Data N3650;
#endif
+#ifdef GSM_ENABLE_NOKIA650
+ GSM_Phone_N650Data N650;
+#endif
#ifdef GSM_ENABLE_NOKIA6110
GSM_Phone_N6110Data N6110;
#endif
#ifdef GSM_ENABLE_NOKIA6510
GSM_Phone_N6510Data N6510;
#endif
#ifdef GSM_ENABLE_NOKIA7110
GSM_Phone_N7110Data N7110;
#endif
#ifdef GSM_ENABLE_ATGEN
GSM_Phone_ATGENData ATGEN;
#endif
@@ -795,49 +807,49 @@ typedef struct {
} GSM_Phone_Data;
/**
* Structure for defining reply functions.
*
* Function is called when requestID matches current operation or is
* ID_IncomingFrame and msgtype matches start message and (if msgtype is just
* one character) subtypechar is zero or subtypechar-th character of message
* matches subtype.
*
* Should be used in array with last element containing ID_None as requestID.
*/
-typedef struct {
+struct _GSM_Reply_Function {
/**
* Pointer to function that should be executed.
*/
GSM_Error (*Function) (GSM_Protocol_Message msg, GSM_StateMachine *s);
/**
* Message type, if it is longer than 1 character, it disables subtype
* checking.
*/
unsigned char *msgtype;
/**
* Which character of message should be checked as subtype. Zero to
* disable subtype checking.
*/
int subtypechar;
/**
* Subtype to be checked.
*/
unsigned char subtype;
/**
* Phone request when this can be called, use ID_IncomingFrame when
* you want to use this in any state.
*/
GSM_Phone_RequestID requestID;
-} GSM_Reply_Function;
+};
/**
* Structure defining phone functions.
*/
typedef struct {
/**
* Names of supported models separated by |. Must contain at least one
* name.
*/
char *models;
/**
* Array of reply functions for the phone, see
@@ -1050,24 +1062,25 @@ typedef struct {
/**
* Deletes SMS.
*/
GSM_Error (*DeleteSMS) (GSM_StateMachine *s, GSM_SMSMessage *sms);
/**
* Sends SMS.
*/
GSM_Error (*SendSMS) (GSM_StateMachine *s, GSM_SMSMessage *sms);
/**
* Sends SMS already saved in phone.
*/
GSM_Error (*SendSavedSMS) (GSM_StateMachine *s, int Folder, int Location);
+ GSM_Error (*SetFastSMSSending) (GSM_StateMachine *s, bool enable);
/**
* Enable/disable notification on incoming SMS.
*/
GSM_Error (*SetIncomingSMS) (GSM_StateMachine *s, bool enable);
/**
* Gets network information from phone.
*/
GSM_Error (*SetIncomingCB) (GSM_StateMachine *s, bool enable);
/**
* Returns SMS folders information.
*/
GSM_Error (*GetSMSFolders) (GSM_StateMachine *s, GSM_SMSFolders *folders);
@@ -1270,25 +1283,25 @@ typedef struct {
GSM_Error (*DeleteAllCalendar) (GSM_StateMachine *s);
/**
* Reads calendar settings.
*/
GSM_Error (*GetCalendarSettings)(GSM_StateMachine *s, GSM_CalendarSettings *settings);
/**
* Sets calendar settings.
*/
GSM_Error (*SetCalendarSettings)(GSM_StateMachine *s, GSM_CalendarSettings *settings);
/**
* Gets note.
*/
- GSM_Error (*GetNote) (GSM_StateMachine *s, GSM_NoteEntry *Note, bool refresh);
+ GSM_Error (*GetNextNote) (GSM_StateMachine *s, GSM_NoteEntry *Note, bool refresh);
/**
* Reads profile.
*/
GSM_Error (*GetProfile) (GSM_StateMachine *s, GSM_Profile *Profile);
/**
* Updates profile.
*/
GSM_Error (*SetProfile) (GSM_StateMachine *s, GSM_Profile *Profile);
/**
* Reads FM station.
*/
GSM_Error (*GetFMStation) (GSM_StateMachine *s, GSM_FMStation *FMStation);
@@ -1335,24 +1348,27 @@ typedef struct {
} GSM_Phone_Functions;
extern GSM_Phone_Functions NAUTOPhone;
#ifdef GSM_ENABLE_NOKIA3320
extern GSM_Phone_Functions N3320Phone;
#endif
#ifdef GSM_ENABLE_NOKIA3650
extern GSM_Phone_Functions N3650Phone;
#endif
#ifdef GSM_ENABLE_NOKIA6110
extern GSM_Phone_Functions N6110Phone;
#endif
+#ifdef GSM_ENABLE_NOKIA650
+ extern GSM_Phone_Functions N650Phone;
+#endif
#ifdef GSM_ENABLE_NOKIA6510
extern GSM_Phone_Functions N6510Phone;
#endif
#ifdef GSM_ENABLE_NOKIA7110
extern GSM_Phone_Functions N7110Phone;
#endif
#ifdef GSM_ENABLE_NOKIA9210
extern GSM_Phone_Functions N9210Phone;
#endif
#ifdef GSM_ENABLE_ATGEN
extern GSM_Phone_Functions ATGENPhone;
#endif
@@ -1514,24 +1530,25 @@ typedef enum {
F_NOMIDI, /* No ringtones in MIDI */
F_BLUETOOTH, /* Bluetooth support */
F_NOFILESYSTEM, /* No images, ringtones, java saved in special filesystem */
F_NOMMS, /* No MMS sets in phone */
F_NOGPRSPOINT, /* GPRS point are not useable */
F_CAL35, /* Calendar,3510 style - Reminder,Call,Birthday */
F_CAL65, /* Calendar,6510 style - CBMM, method 3 */
F_WAPMMSPROXY, /* WAP & MMS settings contains first & second proxy */
/* n6510.c && n7110.c */
F_VOICETAGS, /* Voice tags available */
F_CAL62, /* Calendar,6210 style - Call,Birthday,Memo,Meeting */
+ F_NOTES,
/* AT modules */
F_SMSONLYSENT, /* Phone supports only sent/unsent messages */
F_BROKENCPBS, /* CPBS on some memories can hang phone */
F_M20SMS, /* Siemens M20 like SMS handling */
F_SLOWWRITE, /* Use slower writing which some phone need */
F_SMSME900, /* SMS in ME start from location 900 - case of Sagem */
F_ALCATEL /* Phone supports Alcatel protocol */
} Feature;
/* For models table */
struct _OnePhoneModel {