summaryrefslogtreecommitdiff
path: root/libgammu
diff options
context:
space:
mode:
Diffstat (limited to 'libgammu')
-rw-r--r--libgammu/api.c7
-rw-r--r--libgammu/gsmphones.c2
-rw-r--r--libgammu/gsmstate.h4
-rw-r--r--libgammu/phone/alcatel/alcatel.c3
-rw-r--r--libgammu/phone/at/atgen.c4
-rw-r--r--libgammu/phone/atobex/atobex.c3
-rw-r--r--libgammu/phone/dummy/dummy.c37
-rw-r--r--libgammu/phone/nokia/dct3/n0650.c3
-rw-r--r--libgammu/phone/nokia/dct3/n6110.c3
-rw-r--r--libgammu/phone/nokia/dct3/n7110.c3
-rw-r--r--libgammu/phone/nokia/dct3/n9210.c3
-rw-r--r--libgammu/phone/nokia/dct4s40/6510/n6510.c3
-rw-r--r--libgammu/phone/nokia/dct4s40/n3320.c3
-rw-r--r--libgammu/phone/nokia/nauto.c3
-rw-r--r--libgammu/phone/nokia/wd2/n3650.c3
-rw-r--r--libgammu/phone/obex/obexgen.c3
-rw-r--r--libgammu/phone/s60/s60phone.c3
-rw-r--r--libgammu/phone/symbian/gnapgen.c3
-rw-r--r--libgammu/protocol/at/at.c1
19 files changed, 79 insertions, 15 deletions
diff --git a/libgammu/api.c b/libgammu/api.c
index 3ae8dbb..4ed04b6 100644
--- a/libgammu/api.c
+++ b/libgammu/api.c
@@ -2,6 +2,7 @@
#include <gammu.h>
#include "gsmstate.h"
+#include "gsmcomon.h"
#include "debug.h"
#ifdef __FUNCTION__WORKING
@@ -40,6 +41,12 @@
if (!GSM_IsConnected(s)) { \
return ERR_NOTCONNECTED; \
} \
+ if (s->Phone.Functions->PreAPICall != NONEFUNCTION) { \
+ err = s->Phone.Functions->PreAPICall(s); \
+ if (err != ERR_NONE) { \
+ return err; \
+ } \
+ } \
}
/**
diff --git a/libgammu/gsmphones.c b/libgammu/gsmphones.c
index 6f0c2b8..2f6a457 100644
--- a/libgammu/gsmphones.c
+++ b/libgammu/gsmphones.c
@@ -971,6 +971,7 @@ GSM_PhoneModel allmodels[] = {
{"K4511", "K4511", "", {F_SMS_LOCATION_0, F_ENCODED_USSD, F_FOUR_DIGIT_YEAR, F_RESET_AFTER_TIMEOUT, F_HUAWEI_INIT, 0}},
/* ZTE */
+ {"MF100", "MF100", "", {F_ZTE_INIT, 0}},
{"MF190", "MF190", "", {F_ZTE_INIT, 0}},
/* Ubinetics */
@@ -981,6 +982,7 @@ GSM_PhoneModel allmodels[] = {
/* Other */
{"SIMCOM_SIM300D","SIMCOM_SIM300D","", {F_ENCODED_USSD, 0}},
+ {"SIMCOM_SIM900","SIMCOM_SIM900","", {0}},
/* Qualcomm */
{"HP un2420 Mobile Broadband Module", "un2420", "", {F_NO_STOP_CUSD, 0}},
diff --git a/libgammu/gsmstate.h b/libgammu/gsmstate.h
index 2d665ea..2ca0b21 100644
--- a/libgammu/gsmstate.h
+++ b/libgammu/gsmstate.h
@@ -1311,6 +1311,10 @@ typedef struct {
* Post connect hook
*/
GSM_Error (*PostConnect) (GSM_StateMachine *s);
+ /**
+ * API action hook, executed before API call
+ */
+ GSM_Error (*PreAPICall)(GSM_StateMachine *s);
} GSM_Phone_Functions;
extern GSM_Phone_Functions NAUTOPhone;
diff --git a/libgammu/phone/alcatel/alcatel.c b/libgammu/phone/alcatel/alcatel.c
index 9ad9b44..d926f69 100644
--- a/libgammu/phone/alcatel/alcatel.c
+++ b/libgammu/phone/alcatel/alcatel.c
@@ -4204,7 +4204,8 @@ GSM_Phone_Functions ALCATELPhone = {
NOTSUPPORTED, /* SetGPRSAccessPoint */
NOTSUPPORTED, /* GetScreenshot */
NOTSUPPORTED, /* SetPower */
- NOTSUPPORTED /* PostConnect */
+ NOTSUPPORTED, /* PostConnect */
+ NONEFUNCTION /* PreAPICall */
};
#endif
diff --git a/libgammu/phone/at/atgen.c b/libgammu/phone/at/atgen.c
index 067f5d4..e13684e 100644
--- a/libgammu/phone/at/atgen.c
+++ b/libgammu/phone/at/atgen.c
@@ -6215,6 +6215,7 @@ GSM_Reply_Function ATGENReplyFunctions[] = {
{ATGEN_GenericReplyIgnore, "+ZUSIMR:" ,0x00,0x00,ID_IncomingFrame },
{ATGEN_GenericReplyIgnore, "+ZEND" ,0x00,0x00,ID_IncomingFrame },
{ATGEN_GenericReplyIgnore, "+CDSI:" ,0x00,0x00,ID_IncomingFrame },
+{ATGEN_GenericReplyIgnore, "+CLCC:" ,0x00,0x00,ID_IncomingFrame },
/* Sony Ericsson screenshot */
{SONYERICSSON_Reply_Screenshot, "AT*ZISI=?\r", 0x00,0x00,ID_Screenshot },
@@ -6407,7 +6408,8 @@ GSM_Phone_Functions ATGENPhone = {
NOTSUPPORTED, /* SetGPRSAccessPoint */
SONYERICSSON_GetScreenshot,
ATGEN_SetPower,
- ATGEN_PostConnect
+ ATGEN_PostConnect,
+ NONEFUNCTION /* PreAPICall */
};
#endif
diff --git a/libgammu/phone/atobex/atobex.c b/libgammu/phone/atobex/atobex.c
index fcf0953..b31213c 100644
--- a/libgammu/phone/atobex/atobex.c
+++ b/libgammu/phone/atobex/atobex.c
@@ -1677,7 +1677,8 @@ GSM_Phone_Functions ATOBEXPhone = {
NOTSUPPORTED, /* SetGPRSAccessPoint */
SONYERICSSON_GetScreenshot, /* GetScreenshot */
ATOBEX_SetPower,
- NOTSUPPORTED /* PostConnect */
+ NOTSUPPORTED, /* PostConnect */
+ NONEFUNCTION /* PreAPICall */
};
#endif
diff --git a/libgammu/phone/dummy/dummy.c b/libgammu/phone/dummy/dummy.c
index 778e682..e34998e 100644
--- a/libgammu/phone/dummy/dummy.c
+++ b/libgammu/phone/dummy/dummy.c
@@ -1921,6 +1921,40 @@ GSM_Error DUMMY_GetBatteryCharge(GSM_StateMachine *s, GSM_BatteryCharge *bat)
return ERR_NONE;
}
+GSM_Error DUMMY_PreAPICall(GSM_StateMachine *s)
+{
+ char *path;
+ struct stat sb;
+ GSM_Error error = ERR_NONE;
+ GSM_Call call;
+
+ /* Check for incoming call trigger */
+ if (s->Phone.Data.EnableIncomingCall && s->User.IncomingCall != NULL) {
+ path = DUMMY_GetFilePath(s, "incoming-call");
+ if (path == NULL) {
+ return ERR_MOREMEMORY;
+ }
+ if (stat(path, &sb) == 0) {
+ smprintf(s, "Incoming call!\n");
+
+ memset(&call, 0, sizeof(call));
+
+ call.Status = 0;
+ call.StatusCode = 0;
+ call.CallIDAvailable = FALSE;
+ call.Status = GSM_CALL_IncomingCall;
+ call.CallIDAvailable = TRUE;
+ EncodeUnicode(call.PhoneNumber, "+800123456", 11);
+
+ s->User.IncomingCall(s, &call, s->User.IncomingCallUserData);
+
+ unlink(path);
+ }
+ free(path);
+ }
+ return error;
+}
+
/*@}*/
GSM_Reply_Function DUMMYReplyFunctions[] = {
@@ -2068,7 +2102,8 @@ GSM_Phone_Functions DUMMYPhone = {
NOTSUPPORTED, /* SetGPRSAccessPoint */
NOTSUPPORTED, /* GetScreenshot */
NOTSUPPORTED, /* SetPower */
- NOTSUPPORTED /* PostConnect */
+ NOTSUPPORTED, /* PostConnect */
+ DUMMY_PreAPICall
};
/*@}*/
diff --git a/libgammu/phone/nokia/dct3/n0650.c b/libgammu/phone/nokia/dct3/n0650.c
index 9ec1d1c..4c1ee15 100644
--- a/libgammu/phone/nokia/dct3/n0650.c
+++ b/libgammu/phone/nokia/dct3/n0650.c
@@ -157,7 +157,8 @@ GSM_Phone_Functions N650Phone = {
NOTSUPPORTED, /* SetGPRSAccessPoint */
NOTSUPPORTED, /* GetScreenshot */
NOTSUPPORTED, /* SetPower */
- NOTSUPPORTED /* PostConnect */
+ NOTSUPPORTED, /* PostConnect */
+ NONEFUNCTION /* PreAPICall */
};
#endif
diff --git a/libgammu/phone/nokia/dct3/n6110.c b/libgammu/phone/nokia/dct3/n6110.c
index fe19b02..ee7924d 100644
--- a/libgammu/phone/nokia/dct3/n6110.c
+++ b/libgammu/phone/nokia/dct3/n6110.c
@@ -2936,7 +2936,8 @@ GSM_Phone_Functions N6110Phone = {
NOTSUPPORTED, /* SetGPRSAccessPoint */
NOTSUPPORTED, /* GetScreenshot */
NOTSUPPORTED, /* SetPower */
- NOTSUPPORTED /* PostConnect */
+ NOTSUPPORTED, /* PostConnect */
+ NONEFUNCTION /* PreAPICall */
};
#endif
diff --git a/libgammu/phone/nokia/dct3/n7110.c b/libgammu/phone/nokia/dct3/n7110.c
index a4572e6..0807a4b 100644
--- a/libgammu/phone/nokia/dct3/n7110.c
+++ b/libgammu/phone/nokia/dct3/n7110.c
@@ -1779,7 +1779,8 @@ GSM_Phone_Functions N7110Phone = {
NOTSUPPORTED, /* SetGPRSAccessPoint */
NOTSUPPORTED, /* GetScreenshot */
NOTSUPPORTED, /* SetPower */
- NOTSUPPORTED /* PostConnect */
+ NOTSUPPORTED, /* PostConnect */
+ NONEFUNCTION /* PreAPICall */
};
#endif
diff --git a/libgammu/phone/nokia/dct3/n9210.c b/libgammu/phone/nokia/dct3/n9210.c
index b1e3e3b..c0860d7 100644
--- a/libgammu/phone/nokia/dct3/n9210.c
+++ b/libgammu/phone/nokia/dct3/n9210.c
@@ -408,7 +408,8 @@ GSM_Phone_Functions N9210Phone = {
NOTSUPPORTED, /* SetGPRSAccessPoint */
NOTSUPPORTED, /* GetScreenshot */
NOTSUPPORTED, /* SetPower */
- NOTSUPPORTED /* PostConnect */
+ NOTSUPPORTED, /* PostConnect */
+ NONEFUNCTION /* PreAPICall */
};
#endif
diff --git a/libgammu/phone/nokia/dct4s40/6510/n6510.c b/libgammu/phone/nokia/dct4s40/6510/n6510.c
index cde4ff7..86f1cdc 100644
--- a/libgammu/phone/nokia/dct4s40/6510/n6510.c
+++ b/libgammu/phone/nokia/dct4s40/6510/n6510.c
@@ -4616,7 +4616,8 @@ GSM_Phone_Functions N6510Phone = {
N6510_SetGPRSAccessPoint,
DCT4_Screenshot,
NOTSUPPORTED, /* SetPower */
- NOTSUPPORTED /* PostConnect */
+ NOTSUPPORTED, /* PostConnect */
+ NONEFUNCTION /* PreAPICall */
};
#endif
diff --git a/libgammu/phone/nokia/dct4s40/n3320.c b/libgammu/phone/nokia/dct4s40/n3320.c
index e730902..3da384b 100644
--- a/libgammu/phone/nokia/dct4s40/n3320.c
+++ b/libgammu/phone/nokia/dct4s40/n3320.c
@@ -282,7 +282,8 @@ GSM_Phone_Functions N3320Phone = {
NOTSUPPORTED, /* SetGPRSAccessPoint */
NOTSUPPORTED, /* GetScreenshot */
NOTSUPPORTED, /* SetPower */
- NOTSUPPORTED /* PostConnect */
+ NOTSUPPORTED, /* PostConnect */
+ NONEFUNCTION /* PreAPICall */
};
#endif
diff --git a/libgammu/phone/nokia/nauto.c b/libgammu/phone/nokia/nauto.c
index 82ee1e7..6633723 100644
--- a/libgammu/phone/nokia/nauto.c
+++ b/libgammu/phone/nokia/nauto.c
@@ -176,7 +176,8 @@ GSM_Phone_Functions NAUTOPhone = {
NOTSUPPORTED, /* SetGPRSAccessPoint */
NOTSUPPORTED, /* GetScreenshot */
NOTSUPPORTED, /* SetPower */
- NOTSUPPORTED /* PostConnect */
+ NOTSUPPORTED, /* PostConnect */
+ NONEFUNCTION /* PreAPICall */
};
#endif
diff --git a/libgammu/phone/nokia/wd2/n3650.c b/libgammu/phone/nokia/wd2/n3650.c
index 8a68da3..e0ba708 100644
--- a/libgammu/phone/nokia/wd2/n3650.c
+++ b/libgammu/phone/nokia/wd2/n3650.c
@@ -417,7 +417,8 @@ GSM_Phone_Functions N3650Phone = {
NOTSUPPORTED, /* SetGPRSAccessPoint */
NOTSUPPORTED, /* GetScreenshot */
NOTSUPPORTED, /* SetPower */
- NOTSUPPORTED /* PostConnect */
+ NOTSUPPORTED, /* PostConnect */
+ NONEFUNCTION /* PreAPICall */
};
#endif
diff --git a/libgammu/phone/obex/obexgen.c b/libgammu/phone/obex/obexgen.c
index 4802023..e6751ae 100644
--- a/libgammu/phone/obex/obexgen.c
+++ b/libgammu/phone/obex/obexgen.c
@@ -3924,7 +3924,8 @@ GSM_Phone_Functions OBEXGENPhone = {
NOTSUPPORTED, /* SetGPRSAccessPoint */
NOTSUPPORTED, /* GetScreenshot */
NOTSUPPORTED, /* SetPower */
- NOTSUPPORTED /* PostConnect */
+ NOTSUPPORTED, /* PostConnect */
+ NONEFUNCTION /* PreAPICall */
};
#endif
diff --git a/libgammu/phone/s60/s60phone.c b/libgammu/phone/s60/s60phone.c
index 369098e..24e3882 100644
--- a/libgammu/phone/s60/s60phone.c
+++ b/libgammu/phone/s60/s60phone.c
@@ -2191,7 +2191,8 @@ GSM_Phone_Functions S60Phone = {
NOTSUPPORTED, /* SetGPRSAccessPoint */
S60_GetScreenshot,
NOTSUPPORTED, /* SetPower */
- NOTSUPPORTED /* PostConnect */
+ NOTSUPPORTED, /* PostConnect */
+ NONEFUNCTION /* PreAPICall */
};
#endif
diff --git a/libgammu/phone/symbian/gnapgen.c b/libgammu/phone/symbian/gnapgen.c
index feeec5d..5b0f0e6 100644
--- a/libgammu/phone/symbian/gnapgen.c
+++ b/libgammu/phone/symbian/gnapgen.c
@@ -1984,7 +1984,8 @@ GSM_Phone_Functions GNAPGENPhone = {
NOTSUPPORTED, /* SetGPRSAccessPoint */
NOTSUPPORTED, /* GetScreenshot */
NOTSUPPORTED, /* SetPower */
- NOTSUPPORTED /* PostConnect */
+ NOTSUPPORTED, /* PostConnect */
+ NONEFUNCTION /* PreAPICall */
};
#endif
diff --git a/libgammu/protocol/at/at.c b/libgammu/protocol/at/at.c
index 620bd62..a0713a7 100644
--- a/libgammu/protocol/at/at.c
+++ b/libgammu/protocol/at/at.c
@@ -96,6 +96,7 @@ GSM_Error AT_StateMachine(GSM_StateMachine *s, unsigned char rx_char)
{"+CLIP" ,1, ID_All},
{"+CRING" ,1, ID_All},
{"+CCWA" ,1, ID_All},
+ {"+CLCC" ,1, ID_All},
/* Standard AT */
{"RING" ,1, ID_All},