18 #ifdef GSM_ENABLE_ATGEN 20 #include "../../gsmcomon.h" 21 #include "../../gsmstate.h" 22 #include "../../service/gsmpbk.h" 25 #include "../../../helper/string.h" 30 } MOTOROLA_CommandInfo;
37 MOTOROLA_CommandInfo Commands[] = {
106 if (strstr(
GetLineString(msg->Buffer, &Priv->
Lines, 2),
"Unkown mode value") != NULL) {
125 MOTOROLA_CommandInfo *cmd;
137 if (strncasecmp(command,
"AT", 2) != 0) {
142 realcmd = command + 2;
145 for (cmd = Commands; cmd->Command[0] != 0; cmd++) {
146 if (strncasecmp(realcmd, cmd->Command, strlen(cmd->Command)) == 0) {
152 if (cmd->Command[0] == 0) {
153 smprintf(s,
"Nothing known about %s command, using current mode\n", command);
159 smprintf(s,
"Already in mode %d\n", cmd->Mode);
164 smprintf(s,
"Switching to mode %d\n", cmd->Mode);
165 len = sprintf(buffer,
"AT+MODE=%d\r", cmd->Mode);
172 if (cmd->Mode == 2) {
173 smprintf(s,
"Waiting for banner...\n");
184 smprintf(s,
"Failed to set mode 2!\n");
249 int number_type, entry_type;
253 smprintf(s,
"Phonebook entry received\n");
269 if (strcmp(str,
"OK") == 0)
return ERR_EMPTY;
277 "+MPBR: @i, @p, @i, @s, @i, @0",
284 switch (entry_type) {
391 "+MDBR: @i, @i, @i, @i, @i",
397 if (error !=
ERR_NONE)
return error;
418 int duration, repeat, has_time, has_alarm;
446 "+MDBR: @i, @s, @i, @i, @d, @i, @d, @i",
456 if (!has_time && !has_alarm) {
458 }
else if (!has_alarm) {
460 }
else if (!has_time) {
522 if (strcmp(
"OK", line) == 0) {
526 error = MOTOROLA_ParseCalendarSimple(s, line);
548 smprintf(s,
"Getting calendar entry\n");
560 error = MOTOROLA_GetCalendar(s, Note);
574 error = MOTOROLA_LockCalendar(s);
579 len = sprintf(req,
"AT+MDBR=%d\r", Note->
Location - 1);
582 MOTOROLA_UnlockCalendar(s);
597 error = MOTOROLA_LockCalendar(s);
600 len = sprintf(req,
"AT+MDBWE=%d,0,0\r", Note->
Location);
603 MOTOROLA_UnlockCalendar(s);
611 error = MOTOROLA_LockCalendar(s);
614 MOTOROLA_UnlockCalendar(s);
622 error = MOTOROLA_LockCalendar(s);
625 MOTOROLA_UnlockCalendar(s);
635 smprintf(s,
"Memory status received\n");
void GSM_TweakInternationalNumber(unsigned char *Number, const GSM_NumberType numType)
GSM_Error ATGEN_SetCharset(GSM_StateMachine *s, GSM_AT_Charset_Preference Prefer)
GSM_Error ATGEN_HandleCMEError(GSM_StateMachine *s)
GSM_Error ATGEN_HandleCMSError(GSM_StateMachine *s)
const char * GetLineString(const char *message, GSM_CutLines *lines, int start)
#define ATGEN_WaitForAutoLen(s, cmd, type, time, request)
GSM_Error GSM_WaitForOnce(GSM_StateMachine *s, unsigned const char *buffer, size_t length, int type, int timeout)
GSM_CalendarStatus * CalStatus
unsigned char Text[(GSM_PHONEBOOK_TEXT_LENGTH+1) *2]
GSM_CalendarNoteType Type
struct GSM_Phone_Data::@2 Priv
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 ATGEN_WaitFor(GSM_StateMachine *s, const char *cmd, size_t len, int type, int time, GSM_Phone_RequestID request)
GSM_CalendarType EntryType
GSM_SubCalendarEntry Entries[GSM_CALENDAR_ENTRIES]
GSM_EntryLocation Location
GSM_CalendarStatus CalendarStatus
int MotorolaFirstMemoryEntry
GSM_AT_Reply_State ReplyState
unsigned char Text[(GSM_MAX_CALENDAR_TEXT_LENGTH+1) *2]
int smprintf(GSM_StateMachine *s, const char *format,...)
GSM_SubMemoryEntry Entries[GSM_PHONEBOOK_ENTRIES]