7 A Linux/Unix toolset and driver for mobile phones.
9 Copyright 2001 Manfred Jonsson <manfred.jonsson@gmx.de>
11 Released under the terms of the GNU GPL, see file COPYING for more details.
13 This file provides functions specific to at commands on ericsson
14 phones. See README for more details on supported mobile phones.
17 Revision 1.1.1.1 2001/11/25 21:59:14 short
18 :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Sun Nov 25 22:56 CET 2001
20 Revision 1.1 2001/11/19 13:03:18 pkot
30 #include "gsm-common.h"
31 #include "gsm-statemachine.h"
32 #include "phones/generic.h"
33 #include "phones/atgen.h"
34 #include "phones/ateric.h"
35 #include "links/atbus.h"
36 #include "links/cbus.h"
39 static GSM_Error GetMemoryStatus(GSM_Data *data, GSM_Statemachine *state)
44 ret = AT_SetMemoryType(data->MemoryStatus->MemoryType, state);
47 sprintf(req, "AT+CPBR=?\r\n");
48 if (SM_SendMessage(state, 11, GOP_GetMemoryStatus, req) != GE_NONE)
50 ret = SM_Block(state, data, GOP_GetMemoryStatus);
55 static GSM_Error ReplyMemoryStatus(int messagetype, unsigned char *buffer, int length, GSM_Data *data)
63 if (buf.line1 == NULL)
64 return GE_INVALIDMEMORYTYPE;
65 if (data->MemoryStatus) {
66 if (strstr(buf.line2,"+CPBR")) {
67 pos = strchr(buf.line2, '-');
69 data->MemoryStatus->Used = atoi(++pos);
70 data->MemoryStatus->Free = 0;
72 return GE_NOTSUPPORTED;
80 void AT_InitEricsson(GSM_Statemachine *state, char *foundmodel, char *setupmodel) {
81 AT_InsertRecvFunction(GOP_GetMemoryStatus, ReplyMemoryStatus);
82 AT_InsertSendFunction(GOP_GetMemoryStatus, GetMemoryStatus);