summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/phone/at/siemens.c
Unidiff
Diffstat (limited to 'gammu/emb/common/phone/at/siemens.c') (more/less context) (show whitespace changes)
-rw-r--r--gammu/emb/common/phone/at/siemens.c74
1 files changed, 35 insertions, 39 deletions
diff --git a/gammu/emb/common/phone/at/siemens.c b/gammu/emb/common/phone/at/siemens.c
index ab7dd2c..7f66cf8 100644
--- a/gammu/emb/common/phone/at/siemens.c
+++ b/gammu/emb/common/phone/at/siemens.c
@@ -15,21 +15,7 @@
15 15
16extern GSM_Error ATGEN_HandleCMSError(GSM_StateMachine *s); 16#include "atgen.h"
17#include "siemens.h"
17 18
18GSM_Error ATGEN_CMS35ReplySetFunction (GSM_Protocol_Message msg, GSM_StateMachine *s,char *function)
19{
20 if (s->Protocol.Data.AT.EditMode) {
21 s->Protocol.Data.AT.EditMode = false;
22 return ERR_NONE;
23 }
24 dbgprintf ("Written %s",function);
25 if (s->Phone.Data.Priv.ATGEN.ReplyState == AT_Reply_OK){
26 dbgprintf (" - OK\n");
27 return ERR_NONE;
28 } else {
29 dbgprintf (" - error\n");
30 return ERR_UNKNOWN;
31 }
32}
33 19
34GSM_Error GetSiemensFrame(GSM_Protocol_Message msg, GSM_StateMachine *s, char *templ, 20static GSM_Error GetSiemensFrame(GSM_Protocol_Message msg, GSM_StateMachine *s, char *templ,
35 unsigned char *buffer, int *len) 21 unsigned char *buffer, int *len)
@@ -59,3 +45,3 @@ GSM_Error GetSiemensFrame(GSM_Protocol_Message msg, GSM_StateMachine *s, char *t
59 45
60GSM_Error SetSiemensFrame (GSM_StateMachine *s, unsigned char *buff, char *templ, 46static GSM_Error SetSiemensFrame (GSM_StateMachine *s, unsigned char *buff, char *templ,
61 int Location, GSM_Phone_RequestID RequestID, int len) 47 int Location, GSM_Phone_RequestID RequestID, int len)
@@ -92,3 +78,3 @@ GSM_Error SetSiemensFrame (GSM_StateMachine *s, unsigned char *buff, char *templ
92 78
93GSM_Error ATGEN_CMS35ReplyGetBitmap(GSM_Protocol_Message msg, GSM_StateMachine *s) 79GSM_Error SIEMENS_ReplyGetBitmap(GSM_Protocol_Message msg, GSM_StateMachine *s)
94{ 80{
@@ -106,8 +92,24 @@ GSM_Error ATGEN_CMS35ReplyGetBitmap(GSM_Protocol_Message msg, GSM_StateMachine *
106 92
107GSM_Error ATGEN_CMS35ReplySetBitmap(GSM_Protocol_Message msg, GSM_StateMachine *s) 93GSM_Error SIEMENS_ReplySetFunction (GSM_Protocol_Message msg, GSM_StateMachine *s,char *function)
108{ 94{
109 return ATGEN_CMS35ReplySetFunction (msg, s, "Operator Logo"); 95 if (s->Protocol.Data.AT.EditMode) {
96 s->Protocol.Data.AT.EditMode = false;
97 return ERR_NONE;
98 }
99 dbgprintf ("Written %s",function);
100 if (s->Phone.Data.Priv.ATGEN.ReplyState == AT_Reply_OK){
101 dbgprintf (" - OK\n");
102 return ERR_NONE;
103 } else {
104 dbgprintf (" - error\n");
105 return ERR_UNKNOWN;
106 }
110} 107}
111 108
112GSM_Error ATGEN_GetBitmap(GSM_StateMachine *s, GSM_Bitmap *Bitmap) 109GSM_Error SIEMENS_ReplySetBitmap(GSM_Protocol_Message msg, GSM_StateMachine *s)
110{
111 return SIEMENS_ReplySetFunction (msg, s, "Operator Logo");
112}
113
114GSM_Error SIEMENS_GetBitmap(GSM_StateMachine *s, GSM_Bitmap *Bitmap)
113{ 115{
@@ -115,3 +117,2 @@ GSM_Error ATGEN_GetBitmap(GSM_StateMachine *s, GSM_Bitmap *Bitmap)
115 117
116 if (s->Phone.Data.Priv.ATGEN.Manufacturer!=AT_Siemens) return ERR_NOTSUPPORTED;
117 if (Bitmap->Type!=GSM_OperatorLogo) return ERR_NOTSUPPORTED; 118 if (Bitmap->Type!=GSM_OperatorLogo) return ERR_NOTSUPPORTED;
@@ -124,3 +125,3 @@ GSM_Error ATGEN_GetBitmap(GSM_StateMachine *s, GSM_Bitmap *Bitmap)
124 125
125GSM_Error ATGEN_SetBitmap(GSM_StateMachine *s, GSM_Bitmap *Bitmap) 126GSM_Error SIEMENS_SetBitmap(GSM_StateMachine *s, GSM_Bitmap *Bitmap)
126{ 127{
@@ -130,3 +131,2 @@ GSM_Error ATGEN_SetBitmap(GSM_StateMachine *s, GSM_Bitmap *Bitmap)
130 131
131 if (s->Phone.Data.Priv.ATGEN.Manufacturer!=AT_Siemens) return ERR_NOTSUPPORTED;
132 if (Bitmap->Type!=GSM_OperatorLogo) return ERR_NOTSUPPORTED; 132 if (Bitmap->Type!=GSM_OperatorLogo) return ERR_NOTSUPPORTED;
@@ -143,3 +143,3 @@ GSM_Error ATGEN_SetBitmap(GSM_StateMachine *s, GSM_Bitmap *Bitmap)
143 143
144GSM_Error ATGEN_CMS35ReplyGetRingtone(GSM_Protocol_Message msg, GSM_StateMachine *s) 144GSM_Error SIEMENS_ReplyGetRingtone(GSM_Protocol_Message msg, GSM_StateMachine *s)
145{ 145{
@@ -160,3 +160,3 @@ GSM_Error ATGEN_CMS35ReplyGetRingtone(GSM_Protocol_Message msg, GSM_StateMachine
160 160
161GSM_Error ATGEN_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, bool PhoneRingtone) 161GSM_Error SIEMENS_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, bool PhoneRingtone)
162{ 162{
@@ -164,4 +164,2 @@ GSM_Error ATGEN_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, bool Ph
164 164
165 if (s->Phone.Data.Priv.ATGEN.Manufacturer!=AT_Siemens) return ERR_NOTSUPPORTED;
166
167 s->Phone.Data.Ringtone=Ringtone; 165 s->Phone.Data.Ringtone=Ringtone;
@@ -172,8 +170,8 @@ GSM_Error ATGEN_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, bool Ph
172 170
173GSM_Error ATGEN_CMS35ReplySetRingtone(GSM_Protocol_Message msg, GSM_StateMachine *s) 171GSM_Error SIEMENS_ReplySetRingtone(GSM_Protocol_Message msg, GSM_StateMachine *s)
174{ 172{
175 return ATGEN_CMS35ReplySetFunction (msg, s, "Ringtone"); 173 return SIEMENS_ReplySetFunction (msg, s, "Ringtone");
176} 174}
177 175
178GSM_Error ATGEN_SetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, int *maxlength) 176GSM_Error SIEMENS_SetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, int *maxlength)
179{ 177{
@@ -181,4 +179,2 @@ GSM_Error ATGEN_SetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, int *ma
181 179
182 if (s->Phone.Data.Priv.ATGEN.Manufacturer!=AT_Siemens) return ERR_NOTSUPPORTED;
183
184 if (Ringtone->Location==255) Ringtone->Location=1; 180 if (Ringtone->Location==255) Ringtone->Location=1;
@@ -192,3 +188,3 @@ GSM_Error ATGEN_SetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, int *ma
192 188
193GSM_Error ATGEN_CMS35ReplyGetNextCal(GSM_Protocol_Message msg, GSM_StateMachine *s) 189GSM_Error SIEMENS_ReplyGetNextCalendar(GSM_Protocol_Message msg, GSM_StateMachine *s)
194{ 190{
@@ -237,8 +233,8 @@ GSM_Error SIEMENS_GetNextCalendar(GSM_StateMachine *s, GSM_CalendarEntry *Note,
237 233
238GSM_Error ATGEN_CMS35ReplySetCalendar(GSM_Protocol_Message msg, GSM_StateMachine *s) 234GSM_Error SIEMENS_ReplyAddCalendarNote(GSM_Protocol_Message msg, GSM_StateMachine *s)
239{ 235{
240 return ATGEN_CMS35ReplySetFunction (msg, s, "Calendar Note"); 236 return SIEMENS_ReplySetFunction (msg, s, "Calendar Note");
241} 237}
242 238
243GSM_Error ATGEN_CMS35ReplyDeleteCalendar(GSM_Protocol_Message msg, GSM_StateMachine *s) 239GSM_Error SIEMENS_ReplyDelCalendarNote(GSM_Protocol_Message msg, GSM_StateMachine *s)
244{ 240{
@@ -285,3 +281,3 @@ GSM_Error SIEMENS_AddCalendarNote(GSM_StateMachine *s, GSM_CalendarEntry *Note)
285/* (c) by Timo Teras */ 281/* (c) by Timo Teras */
286GSM_Error ATGEN_SL45ReplyGetMemory(GSM_Protocol_Message msg, GSM_StateMachine *s) 282GSM_Error SIEMENS_ReplyGetMemory(GSM_Protocol_Message msg, GSM_StateMachine *s)
287{ 283{