Branch update for mygnokii2002_03_17_19_29nl
[gnokii.git] / include / newmodules / n7110.h
1 /*
2
3   G N O K I I
4
5   A Linux/Unix toolset and driver for Nokia mobile phones.
6
7   Released under the terms of the GNU GPL, see file COPYING for more details.
8
9   Header file for the various functions, definitions etc. used to implement
10   the handset interface.  See fbus-7110.c for more details.
11
12 */
13
14 #ifndef __n_7110_h
15 #define __n_7110_h
16
17 #include "gsm-api.h"
18
19 /* Entry Types of 7110 for enhanced phonebook */
20 #define N7110_ENTRYTYPE_SPEEDDIAL 0x04 /* Speed dial */
21 #define N7110_ENTRYTYPE_NAME      0x07 /* Name always the only one */
22 #define N7110_ENTRYTYPE_EMAIL     0x08 /* Email Adress (TEXT) */
23 #define N7110_ENTRYTYPE_POSTAL    0x09 /* Postal Address (Text) */
24 #define N7110_ENTRYTYPE_NOTE      0x0a /* Note (Text) */
25 #define N7110_ENTRYTYPE_NUMBER    0x0b /* Phonenumber */
26 #define N7110_ENTRYTYPE_RINGTONE  0x0c /* Ringtone number */
27 #define N7110_ENTRYTYPE_DATE      0x13 /* Date for a Called List */
28 #define N7110_ENTRYTYPE_GROUPLOGO 0x1b /* Caller group logo */
29 #define N7110_ENTRYTYPE_LOGOON    0x1c /* Logo On? */
30 #define N7110_ENTRYTYPE_GROUP     0x1e /* Group number for phonebook entry */
31
32 /* Alternate defines for memory types.  Two letter codes follow GSM 07.07
33    release 6.2.0, AT+CPBS "Select Phonebook Memory Storage" */
34 #define N7110_MEMORY_DC 0x01 /* ME dialled calls list */
35 #define N7110_MEMORY_MC 0x02 /* ME missed (unanswered received) calls list */
36 #define N7110_MEMORY_RC 0x03 /* ME received calls list */
37 #define N7110_MEMORY_FD 0x04 /* ?? SIM fixdialling-phonebook */
38 #define N7110_MEMORY_ME 0x05 /* ME (Mobile Equipment) phonebook */
39 #define N7110_MEMORY_SM 0x06 /* SIM phonebook */
40 #define N7110_MEMORY_ON 0x07 /* ?? SIM (or ME) own numbers list */
41 #define N7110_MEMORY_EN 0x08 /* ?? SIM (or ME) emergency number */
42 #define N7110_MEMORY_VM 0x09 /* voice mailbox */
43 #define N7110_MEMORY_SD 0x0e /* speed dials */
44 #define N7110_MEMORY_CG 0x10 /* Caller groups */
45
46 /* Every (well, almost every) frame from the computer starts with this
47    sequence. */
48 #define N7110_FRAME_HEADER 0x00, 0x01, 0x01
49
50 /* some 6210/7110 folder stuff */
51 #define N7110_MAXSMSINFOLDER 160
52
53 /* Datatype for action in HandleSMSLocation */
54 typedef enum {
55   GSH_GET,   /* Get SMS location */
56   GSH_SAVE,  /* want to save at SMS location */
57   GSH_INIT,  /* init folder table */
58   GSH_DELETE /* Delete SMS location */
59 } GSM_SMSHandleAction;
60
61 /* Global variables */
62 extern bool            N7110_LinkOK;
63 extern GSM_Functions   N7110_Functions;
64 extern GSM_Information N7110_Information;
65
66 /* Prototypes for the functions designed to be used externally. */
67 GSM_Error N7110_Initialise(char *port_device, char *initlength,
68                           GSM_ConnectionType connection,
69                           void (*rlp_callback)(RLP_F96Frame *frame));
70
71 void      N7110_DispatchMessage(u16 MessageLength, u8 *MessageBuffer,
72                               u8 MessageType);
73
74 int N7110_GetMemoryType(GSM_MemoryType memory_type);
75
76 GSM_Error N7110_GetVoiceMailbox ( GSM_PhonebookEntry *entry);
77
78 GSM_Error N7110_GetMemoryStatus(GSM_MemoryStatus *Status);
79
80 GSM_Error N7110_GetProfile(GSM_Profile *Profile);
81
82 GSM_Error N7110_GetCalendarNote(GSM_CalendarNote *CalendarNote);
83 GSM_Error N7110_WriteCalendarNote(GSM_CalendarNote *CalendarNote);
84 GSM_Error N7110_DeleteCalendarNote(GSM_CalendarNote *CalendarNote);
85
86 GSM_Error N7110_GetRFLevel(GSM_RFUnits *units, float *level);
87 GSM_Error N7110_GetBatteryLevel(GSM_BatteryUnits *units, float *level);
88
89 GSM_Error N7110_DialVoice(char *Number);
90
91 GSM_Error N7110_GetSecurityCode(GSM_SecurityCode *SecurityCode);
92
93 GSM_Error N7110_GetDateTime(GSM_DateTime *date_time);
94 GSM_Error N7110_SetDateTime(GSM_DateTime *date_time);
95
96 GSM_Error N7110_GetAlarm(int alarm_number, GSM_DateTime *date_time);
97 GSM_Error N7110_SetAlarm(int alarm_number, GSM_DateTime *date_time);
98
99 GSM_Error N7110_GetSMSStatus(GSM_SMSStatus *Status);
100 GSM_Error N7110_DeleteSMSMessage(GSM_SMSMessage *Message);
101 GSM_Error N7110_SaveSMSMessage(GSM_SMSMessage *SMS);
102
103 GSM_Error N7110_GetMemoryLocation(GSM_PhonebookEntry *entry);
104 void N7110_DecodePhonebookFrame(GSM_PhonebookEntry *entry,u8 *MessageBuffer,u16 MessageLength);
105 GSM_Error N7110_WritePhonebookLocation(GSM_PhonebookEntry *entry);
106 int N7110_EncodePhonebookFrame(unsigned char *req, GSM_PhonebookEntry entry, int *block);
107 GSM_Error N7110_DeletePhonebookLocation(GSM_PhonebookEntry *entry);
108 GSM_Error N7110_WriteGroupDataLocation(GSM_Bitmap *bitmap);
109
110 GSM_Error N7110_SendDTMF(char *String);
111
112 GSM_Error N7110_GetSpeedDial(GSM_SpeedDial *entry);
113 GSM_Error N7110_SetSpeedDial(GSM_SpeedDial *entry);
114
115 GSM_Error N7110_GetSMSMessage(GSM_SMSMessage *message);
116
117 GSM_Error N7110_SetBitmap(GSM_Bitmap *Bitmap);
118 GSM_Error N7110_GetBitmap(GSM_Bitmap *Bitmap);
119
120 GSM_Error N7110_SetRingTone(GSM_Ringtone *ringtone, int *maxlength);
121
122 GSM_Error N7110_GetBinRingTone(GSM_BinRingtone *ringtone);
123 GSM_Error N7110_SetBinRingTone(GSM_BinRingtone *ringtone);
124
125 GSM_Error N7110_GetCalendarNotesInfo(GSM_NotesInfo *NotesInfo);
126
127 GSM_Error N7110_FirstCalendarFreePos(int *FirstFreePos);
128
129 GSM_Error N7110_GetSMSFolders (GSM_SMSFolders *folders);
130
131 GSM_Error N7110_GetWAPBookmark (GSM_WAPBookmark *bookmark);
132
133 GSM_Error N7110_SetWAPBookmark (GSM_WAPBookmark *bookmark);
134
135 GSM_Error N7110_GetWAPSettings (GSM_WAPSettings *settings);
136
137 GSM_Error N7110_HandleSMSLocation (int smsnum, u8 *folderid, int *location, GSM_SMSMessage *message, GSM_SMSHandleAction action);
138
139 void N7110_ReplyEnableWAPCommands(u16 MessageLength,u8 *MessageBuffer,u8 MessageType);
140 void N7110_ReplyGetWAPBookmark   (u16 MessageLength,u8 *MessageBuffer,u8 MessageType);
141 void N7110_ReplySetWAPBookmark   (u16 MessageLength, u8 *MessageBuffer, u8 MessageType);
142 void N7110_ReplyGetWAPSettings   (u16 MessageLength,u8 *MessageBuffer,u8 MessageType);
143
144 void N7110_Fake2SMSLocation(int smsnum, u8 *folder, int *location);
145 void N7110_SMS2FakeLocation(int *smsnum, u8 folder, int location);
146
147 #endif /* __n_7110_h */