20 #include "../../gsmstate.h" 22 #ifdef GSM_ENABLE_ATOBEX 23 #ifdef GSM_ENABLE_ATGEN 28 #include "../../gsmcomon.h" 29 #include "../../misc/coding/coding.h" 30 #include "../../misc/misc.h" 32 #include "../at/atfunc.h" 33 #include "../at/sonyericsson.h" 34 #include "../obex/obexfunc.h" 62 smprintf(s,
"Changing protocol to AT\n");
107 error = ATOBEX_SetATMode(s);
109 if (error !=
ERR_NONE)
return error;
112 smprintf(s,
"Changing to OBEX mode\n");
148 if (error !=
ERR_NONE)
return error;
153 smprintf(s,
"Changing protocol to OBEX\n");
157 if (error !=
ERR_NONE)
return error;
178 smprintf(s,
"Setting service %d\n", service);
180 if (error !=
ERR_NONE)
return error;
203 if (error !=
ERR_NONE)
return error;
212 if (error !=
ERR_NONE)
return error;
235 smprintf(s,
"Guessed mode style switching\n");
260 error = ATOBEX_SetATMode(s);
261 if (error !=
ERR_NONE)
return error;
300 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
308 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
316 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
324 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
332 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
340 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
348 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
356 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
364 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
372 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
380 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
388 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
396 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
404 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
412 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
420 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
428 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
439 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
447 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
455 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
463 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
471 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
479 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
487 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
495 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
503 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
511 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
519 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
527 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
535 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
543 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
551 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
559 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
567 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
575 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
583 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
591 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
599 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
607 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
615 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
623 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
631 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
639 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
665 error = ATOBEX_SetOBEXMode(s,
OBEX_None);
752 error = ATOBEX_SetATMode(s);
773 error = ATOBEX_SetATMode(s);
794 error = ATOBEX_SetATMode(s);
815 error = ATOBEX_SetATMode(s);
836 error = ATOBEX_SetATMode(s);
857 error = ATOBEX_SetATMode(s);
869 if (ATOBEX_UseObex (s, type)) {
878 error = ATOBEX_SetATMode(s);
1167 smprintf(s,
"Date settings received\n");
1168 pos = strstr(msg->
Buffer,
"*ESDF:");
1170 format = atoi(pos + 7);
1217 smprintf(s,
"Time settings received\n");
1218 pos = strstr(msg->
Buffer,
"*ESTF:");
1220 format = atoi(pos + 7);
1242 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
1247 smprintf(s,
"Getting date format\n");
1251 smprintf(s,
"Getting time format\n");
1269 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
1281 sprintf(req,
"AT*ESDF=%i\r",format);
1282 smprintf(s,
"Setting date format\n");
1286 if (locale->
AMPMTime) { format=2; }
else { format=1; }
1287 sprintf(req,
"AT*ESTF=%i\r",format);
1288 smprintf(s,
"Setting time format\n");
1300 "*EMEM: @i, @i, @i, @i, @i",
1324 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
1333 int tmp, ncapacity, method, state;
1334 int vbat1, vbat2, vbat3, vbat4;
1339 smprintf(s,
"Battery status received, but not requested right now\n");
1342 smprintf(s,
"Battery status received\n");
1347 "*EBCA: @i, @i, @i, @i, @i, @i, @i, @i, @i, @i, @i, @i, @i, @i\xd\xa",
1407 "*EBCA: @i, @i, @i, @i, @i, @i, @i, @i, @i, @i, @i, @i, @i, @i, @i, @i, @i, @i, @i, @i, @i, @i, @i, @i, @i, @i, @i\xd\xa",
1441 }
else if (vbat3 > 0) {
1443 }
else if (vbat2 > 0) {
1445 }
else if (vbat1 > 0) {
1484 smprintf(s,
"Unsupported battery status format, you're welcome to help with implementation\n");
1497 if ((error = ATOBEX_SetATMode(s))!=
ERR_NONE)
return error;
1514 smprintf(s,
"Loop %d, error %d\n", i, error);
1540 "sonyericsson|ericsson|atobex",
1545 ATOBEX_DispatchMessage,
1547 ATOBEX_GetManufacturer,
1553 ATOBEX_GetProductCode,
1565 ATOBEX_ResetPhoneSettings,
1566 ATOBEX_EnterSecurityCode,
1567 ATOBEX_GetSecurityStatus,
1568 ATOBEX_GetDisplayStatus,
1569 ATOBEX_SetAutoNetworkLogin,
1570 ATOBEX_GetBatteryCharge,
1571 ATOBEX_GetSignalStrength,
1572 ATOBEX_GetNetworkInfo,
1576 ATOBEX_GetMemoryStatus,
1578 ATOBEX_GetNextMemory,
1581 ATOBEX_DeleteMemory,
1582 ATOBEX_DeleteAllMemory,
1587 ATOBEX_GetSMSStatus,
1594 ATOBEX_SendSavedSMS,
1595 ATOBEX_SetFastSMSSending,
1596 ATOBEX_SetIncomingSMS,
1597 ATOBEX_SetIncomingCB,
1598 ATOBEX_GetSMSFolders,
1614 ATOBEX_SetIncomingCall,
1615 ATOBEX_SetIncomingUSSD,
1637 ATOBEX_GetToDoStatus,
1643 ATOBEX_DeleteAllToDo,
1644 ATOBEX_GetCalendarStatus,
1646 ATOBEX_GetNextCalendar,
1649 ATOBEX_DeleteCalendar,
1650 ATOBEX_DeleteAllCalendar,
1653 ATOBEX_GetNoteStatus,
1659 ATOBEX_DeleteAllNotes,
1665 ATOBEX_GetNextFileFolder,
1671 ATOBEX_SendFilePart,
1672 ATOBEX_GetFileSystemStatus,
GSM_Error ATOBEX_ReplyGetTimeLocale(GSM_Protocol_Message *msg, GSM_StateMachine *s)
GSM_Error ATGEN_GetSMSC(GSM_StateMachine *s, GSM_SMSC *smsc)
GSM_Error ATGEN_GetAlarm(GSM_StateMachine *s, GSM_Alarm *Alarm)
GSM_Error ATGEN_AnswerCall(GSM_StateMachine *s, int ID, gboolean all)
GSM_Error OBEXGEN_DeleteFile(GSM_StateMachine *s, unsigned char *ID)
GSM_Error OBEXGEN_GetNextCalendar(GSM_StateMachine *s, GSM_CalendarEntry *Entry, gboolean start)
GSM_Error ATGEN_GetBatteryCharge(GSM_StateMachine *s, GSM_BatteryCharge *bat)
GSM_ChargeState ChargeState
GSM_Error ATGEN_GetManufacturer(GSM_StateMachine *s)
GSM_Error ATGEN_GetMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry)
GSM_Error ATGEN_DialService(GSM_StateMachine *s, char *number)
GSM_MemoryType MemoryType
GSM_Error ATGEN_ResetPhoneSettings(GSM_StateMachine *s, GSM_ResetSettingsType Type)
GSM_Error OBEXGEN_Connect(GSM_StateMachine *s, OBEX_Service service)
GSM_Error ATGEN_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, gboolean PhoneRingtone)
GSM_Error ATGEN_SetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, int *maxlength)
GSM_Error ATGEN_Reset(GSM_StateMachine *s, gboolean hard)
GSM_Error OBEXGEN_GetMemoryStatus(GSM_StateMachine *s, GSM_MemoryStatus *Status)
GSM_Error ATGEN_GetSMSFolders(GSM_StateMachine *s, GSM_SMSFolders *folders)
GSM_Error OBEXGEN_SetMemory(GSM_StateMachine *s, GSM_MemoryEntry *Entry)
GSM_Error ATGEN_SendDTMF(GSM_StateMachine *s, char *sequence)
GSM_Error OBEXGEN_GetFilePart(GSM_StateMachine *s, GSM_File *File, int *Handle, size_t *Size)
GSM_Error ATGEN_GetModel(GSM_StateMachine *s)
GSM_Error ATGEN_AddMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry)
GSM_Error ATGEN_DeleteSMS(GSM_StateMachine *s, GSM_SMSMessage *sms)
GSM_Error ATGEN_Terminate(GSM_StateMachine *s)
GSM_Error GSM_DispatchMessage(GSM_StateMachine *s)
GSM_Error ATGEN_SetAlarm(GSM_StateMachine *s, GSM_Alarm *Alarm)
GSM_Error OBEXGEN_GetNoteStatus(GSM_StateMachine *s, GSM_ToDoStatus *Status)
GSM_Error ATGEN_GetDisplayStatus(GSM_StateMachine *s, GSM_DisplayFeatures *features)
GSM_Error ATGEN_GetMemoryStatus(GSM_StateMachine *s, GSM_MemoryStatus *Status)
GSM_Error ATGEN_Initialise(GSM_StateMachine *s)
const char * GetLineString(const char *message, GSM_CutLines *lines, int start)
GSM_Error OBEXGEN_DeleteTodo(GSM_StateMachine *s, GSM_ToDoEntry *Entry)
GSM_Error OBEXGEN_GetNextMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry, gboolean start)
GSM_DateFormat DateFormat
GSM_Error ATGEN_SetPower(GSM_StateMachine *s, gboolean on)
GSM_Error OBEXGEN_DeleteCalendar(GSM_StateMachine *s, GSM_CalendarEntry *Entry)
GSM_Error ATGEN_SetMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry)
GSM_Error ATGEN_CancelCall(GSM_StateMachine *s, int ID, gboolean all)
GSM_FileSystemStatus * FileSystemStatus
GSM_Error ATGEN_SetFastSMSSending(GSM_StateMachine *s, gboolean enable)
GSM_Error ATGEN_SetDateTime(GSM_StateMachine *s, GSM_DateTime *date_time)
GSM_Error ATGEN_GetSMSStatus(GSM_StateMachine *s, GSM_SMSMemoryStatus *status)
GSM_Error ATGEN_GetNetworkInfo(GSM_StateMachine *s, GSM_NetworkInfo *netinfo)
GSM_Error ATGEN_DialVoice(GSM_StateMachine *s, char *number, GSM_CallShowNumber ShowNumber)
GSM_Error ATOBEX_ReplyGetBatteryCharge(GSM_Protocol_Message *msg, GSM_StateMachine *s)
GSM_PhoneModel * ModelInfo
GSM_Error OBEXGEN_AddNote(GSM_StateMachine *s, GSM_NoteEntry *Entry)
GSM_Error OBEXGEN_AddCalendar(GSM_StateMachine *s, GSM_CalendarEntry *Entry)
GSM_Error OBEXGEN_GetCalendarStatus(GSM_StateMachine *s, GSM_CalendarStatus *Status)
GSM_Error OBEXGEN_AddMemory(GSM_StateMachine *s, GSM_MemoryEntry *Entry)
GSM_Error OBEXGEN_SetCalendar(GSM_StateMachine *s, GSM_CalendarEntry *Entry)
GSM_Error(* Initialise)(GSM_StateMachine *s)
GSM_Error OBEXGEN_GetTodoStatus(GSM_StateMachine *s, GSM_ToDoStatus *Status)
GSM_Error ATGEN_GetBitmap(GSM_StateMachine *s, GSM_Bitmap *Bitmap)
GSM_Error ATGEN_AddSMS(GSM_StateMachine *s, GSM_SMSMessage *sms)
GSM_Error OBEXGEN_DeleteMemory(GSM_StateMachine *s, GSM_MemoryEntry *Entry)
GSM_Error OBEXGEN_GetMemory(GSM_StateMachine *s, GSM_MemoryEntry *Entry)
GSM_Error ATGEN_GetDateTime(GSM_StateMachine *s, GSM_DateTime *date_time)
GSM_Error ATGEN_GetSMS(GSM_StateMachine *s, GSM_MultiSMSMessage *sms)
struct GSM_Phone_Data::@2 Priv
GSM_Reply_Function ATGENReplyFunctions[]
GSM_Error OBEXGEN_DeleteAllMemory(GSM_StateMachine *, GSM_MemoryType MemoryTypes)
void OBEXGEN_FreeVars(GSM_StateMachine *s)
GSM_Error ATOBEX_ReplyGetDateLocale(GSM_Protocol_Message *msg, GSM_StateMachine *s)
GSM_Error ATGEN_ParseReply(GSM_StateMachine *s, const unsigned char *input, const char *format,...)
GSM_Error GSM_WaitFor(GSM_StateMachine *s, unsigned const char *buffer, size_t length, int type, int timeout, GSM_Phone_RequestID request)
GSM_Error OBEXGEN_DeleteAllCalendar(GSM_StateMachine *s)
GSM_Error ATGEN_DeleteAllMemory(GSM_StateMachine *s, GSM_MemoryType type)
GSM_Error ATGEN_SendSavedSMS(GSM_StateMachine *s, int Folder, int Location)
GSM_Error ATGEN_SendSMS(GSM_StateMachine *s, GSM_SMSMessage *sms)
GSM_Error ATGEN_SetIncomingCall(GSM_StateMachine *s, gboolean enable)
GSM_Error ATGEN_PressKey(GSM_StateMachine *s, GSM_KeyCode Key, gboolean Press)
GSM_Error OBEXGEN_SetNote(GSM_StateMachine *s, GSM_NoteEntry *Entry)
GSM_Error ATGEN_GetNextSMS(GSM_StateMachine *s, GSM_MultiSMSMessage *sms, gboolean start)
GSM_Error ATOBEX_ReplyGetFileSystemStatus(GSM_Protocol_Message *msg, GSM_StateMachine *s)
GSM_BatteryCharge * BatteryCharge
GSM_Error OBEXGEN_InitialiseVars(GSM_StateMachine *s)
GSM_Error ATGEN_GetSecurityStatus(GSM_StateMachine *s, GSM_SecurityCodeType *Status)
GSM_Error ATGEN_DeleteMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry)
GSM_Error ATGEN_SetAutoNetworkLogin(GSM_StateMachine *s)
GSM_MemoryType MemoryType
GSM_Error(* Terminate)(GSM_StateMachine *s)
gboolean GSM_IsPhoneFeatureAvailable(GSM_PhoneModel *model, GSM_Feature feature)
GSM_Error OBEXGEN_GetNote(GSM_StateMachine *s, GSM_NoteEntry *Entry)
GSM_Error ATGEN_SetBitmap(GSM_StateMachine *s, GSM_Bitmap *Bitmap)
GSM_Phone_Functions * Functions
GSM_Error OBEXGEN_Disconnect(GSM_StateMachine *s)
GSM_Error ATGEN_SetSMSC(GSM_StateMachine *s, GSM_SMSC *smsc)
GSM_Error OBEXGEN_DeleteNote(GSM_StateMachine *s, GSM_NoteEntry *Entry)
GSM_Error ATGEN_GetNextMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry, gboolean start)
GSM_Error OBEXGEN_GetTodo(GSM_StateMachine *s, GSM_ToDoEntry *Entry)
GSM_Error OBEXGEN_DeleteAllNotes(GSM_StateMachine *s)
GSM_Error OBEXGEN_GetNextNote(GSM_StateMachine *s, GSM_NoteEntry *Entry, gboolean start)
GSM_Error ATGEN_GetIMEI(GSM_StateMachine *s)
GSM_Reply_Function * ReplyFunctions
GSM_Error OBEXGEN_AddFolder(GSM_StateMachine *s, GSM_File *File)
GSM_Error OBEXGEN_GetNextFileFolder(GSM_StateMachine *s, GSM_File *File, gboolean start)
GSM_Protocol_Functions * Functions
GSM_Error OBEXGEN_AddFilePart(GSM_StateMachine *s, GSM_File *File, size_t *Pos, int *Handle)
GSM_Error ATGEN_DispatchMessage(GSM_StateMachine *s)
GSM_Error OBEXGEN_SendFilePart(GSM_StateMachine *s, GSM_File *File, size_t *Pos, int *Handle)
GSM_Reply_Function OBEXGENReplyFunctions[]
GSM_Error OBEXGEN_AddTodo(GSM_StateMachine *s, GSM_ToDoEntry *Entry)
GSM_Error SONYERICSSON_GetScreenshot(GSM_StateMachine *s, GSM_BinaryPicture *picture)
GSM_Error OBEXGEN_DeleteAllTodo(GSM_StateMachine *s)
char Model[GSM_MAX_MODEL_LENGTH+1]
GSM_Error ATGEN_SetIncomingCB(GSM_StateMachine *s, gboolean enable)
GSM_Error OBEXGEN_SetTodo(GSM_StateMachine *s, GSM_ToDoEntry *Entry)
GSM_Error ATGEN_GetSIMIMSI(GSM_StateMachine *s, char *IMSI)
GSM_Error ATGEN_GetSignalQuality(GSM_StateMachine *s, GSM_SignalQuality *sig)
GSM_Error OBEXGEN_GetCalendar(GSM_StateMachine *s, GSM_CalendarEntry *Entry)
GSM_Error ATGEN_SetIncomingSMS(GSM_StateMachine *s, gboolean enable)
GSM_Error ATGEN_EnterSecurityCode(GSM_StateMachine *s, GSM_SecurityCode *Code)
GSM_Error ATGEN_GetFirmware(GSM_StateMachine *s)
int smprintf(GSM_StateMachine *s, const char *format,...)
GSM_Error OBEXGEN_GetNextTodo(GSM_StateMachine *s, GSM_ToDoEntry *Entry, gboolean start)
GSM_BatteryType BatteryType
GSM_Error ATGEN_SetIncomingUSSD(GSM_StateMachine *s, gboolean enable)