summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMichal Čihař <michal@cihar.com>2010-07-12 13:59:03 +0200
committerMichal Čihař <michal@cihar.com>2010-07-12 13:59:03 +0200
commit451335d49caec7fe444116f419788777232470cb (patch)
tree7f92d1839d1a3cd79a5522118f55fc3d4115d0cb /docs
parent3a164601a15bc5d6c4cd507bff402e0c60b3af3a (diff)
Imported Upstream version 1.28.0
Diffstat (limited to 'docs')
-rw-r--r--docs/develop/c/examples.rst6
-rw-r--r--docs/develop/examples/long-sms.c189
-rw-r--r--docs/develop/formats/backup.rst6
-rw-r--r--docs/develop/formats/index.rst11
-rw-r--r--docs/develop/formats/smsbackup.rst10
-rw-r--r--docs/develop/index.rst1
-rw-r--r--docs/develop/python/examples.rst6
-rw-r--r--docs/user/cs/gammu-smsdrc.52
-rw-r--r--docs/user/cs/gammu.114
-rw-r--r--docs/user/cs/gammurc.59
-rw-r--r--docs/user/gammu.114
-rw-r--r--docs/user/gammurc.59
12 files changed, 250 insertions, 27 deletions
diff --git a/docs/develop/c/examples.rst b/docs/develop/c/examples.rst
index cdf68df..386d6e8 100644
--- a/docs/develop/c/examples.rst
+++ b/docs/develop/c/examples.rst
@@ -22,6 +22,12 @@ Sending SMS message
.. literalinclude:: ../examples/sms-send.c
:language: c
+Sending Long SMS message
+------------------------
+
+.. literalinclude:: ../examples/long-sms.c
+ :language: c
+
SMSD example
------------
diff --git a/docs/develop/examples/long-sms.c b/docs/develop/examples/long-sms.c
new file mode 100644
index 0000000..19e388c
--- /dev/null
+++ b/docs/develop/examples/long-sms.c
@@ -0,0 +1,189 @@
+#include <gammu.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <signal.h>
+
+GSM_StateMachine *s;
+INI_Section *cfg;
+GSM_Error error;
+volatile GSM_Error sms_send_status;
+volatile gboolean gshutdown = FALSE;
+
+/* Handler for SMS send reply */
+void send_sms_callback (GSM_StateMachine *sm, int status, int MessageReference, void * user_data)
+{
+ printf("Sent SMS on device: \"%s\"\n", GSM_GetConfig(sm, -1)->Device);
+ if (status==0) {
+ printf("..OK");
+ sms_send_status = ERR_NONE;
+ } else {
+ printf("..error %i", status);
+ sms_send_status = ERR_UNKNOWN;
+ }
+ printf(", message reference=%d\n", MessageReference);
+}
+
+/* Function to handle errors */
+void error_handler(void)
+{
+ if (error != ERR_NONE) {
+ printf("ERROR: %s\n", GSM_ErrorString(error));
+ if (GSM_IsConnected(s))
+ GSM_TerminateConnection(s);
+ exit(error);
+ }
+}
+
+/* Interrupt signal handler */
+void interrupt(int sign)
+{
+ signal(sign, SIG_IGN);
+ gshutdown = TRUE;
+}
+
+int main(int argc UNUSED, char **argv UNUSED)
+{
+ GSM_MultiSMSMessage SMS;
+ int i;
+ GSM_MultiPartSMSInfo SMSInfo;
+ GSM_SMSC PhoneSMSC;
+ char recipient_number[] = "+1234567890";
+ char message_text[] = "Very long example Gammu message to show how to construct contatenated messages using libGammu. Very long example Gammu message to show how to construct contatenated messages using libGammu.";
+ unsigned char message_unicode[(sizeof(message_text) + 1) * 2];
+ GSM_Debug_Info *debug_info;
+ int return_value = 0;
+
+ /* Register signal handler */
+ signal(SIGINT, interrupt);
+ signal(SIGTERM, interrupt);
+
+ /*
+ * We don't need gettext, but need to set locales so that
+ * charset conversion works.
+ */
+ GSM_InitLocales(NULL);
+
+ /* Enable global debugging to stderr */
+ debug_info = GSM_GetGlobalDebug();
+ GSM_SetDebugFileDescriptor(stderr, TRUE, debug_info);
+ GSM_SetDebugLevel("textall", debug_info);
+
+ /*
+ * Fill in SMS infor structure which will be used to generate
+ * messages.
+ */
+ GSM_ClearMultiPartSMSInfo(&SMSInfo);
+ /* Class 1 message (normal) */
+ SMSInfo.Class = 1;
+ /* Message will be consist of one part */
+ SMSInfo.EntriesNum = 1;
+ /* No unicode */
+ SMSInfo.UnicodeCoding = FALSE;
+ /* The part has type long text */
+ SMSInfo.Entries[0].ID = SMS_ConcatenatedTextLong;
+ /* Encode message text */
+ EncodeUnicode(message_unicode, message_text, strlen(message_text));
+ SMSInfo.Entries[0].Buffer = message_unicode;
+
+ printf("%s\n", DecodeUnicodeConsole(SMSInfo.Entries[0].Buffer));
+
+ /* Encode message into PDU parts */
+ error = GSM_EncodeMultiPartSMS(debug_info, &SMSInfo, &SMS);
+ error_handler();
+
+ /* Allocates state machine */
+ s = GSM_AllocStateMachine();
+ if (s == NULL)
+ return 3;
+
+ /*
+ * Enable state machine debugging to stderr
+ * Same could be achieved by just using global debug config.
+ */
+ debug_info = GSM_GetDebug(s);
+ GSM_SetDebugGlobal(FALSE, debug_info);
+ GSM_SetDebugFileDescriptor(stderr, TRUE, debug_info);
+ GSM_SetDebugLevel("textall", debug_info);
+
+ /*
+ * Find configuration file (first command line parameter or
+ * defaults)
+ */
+ error = GSM_FindGammuRC(&cfg, argc == 2 ? argv[1] : NULL);
+ error_handler();
+
+ /* Read it */
+ error = GSM_ReadConfig(cfg, GSM_GetConfig(s, 0), 0);
+ error_handler();
+
+ /* Free config file structures */
+ INI_Free(cfg);
+
+ /* We have one valid configuration */
+ GSM_SetConfigNum(s, 1);
+
+ /* Connect to phone */
+ /* 3 means number of replies you want to wait for */
+ error = GSM_InitConnection(s, 3);
+ error_handler();
+
+ /* Set callback for message sending */
+ /* This needs to be done after initiating connection */
+ GSM_SetSendSMSStatusCallback(s, send_sms_callback, NULL);
+
+ /* We need to know SMSC number */
+ PhoneSMSC.Location = 1;
+ error = GSM_GetSMSC(s, &PhoneSMSC);
+ error_handler();
+
+ /* Send message parts */
+ for (i = 0; i < SMS.Number; i++) {
+ /* Set SMSC number in message */
+ CopyUnicodeString(SMS.SMS[i].SMSC.Number, PhoneSMSC.Number);
+
+ /* Prepare message */
+ /* Encode recipient number */
+ EncodeUnicode(SMS.SMS[i].Number, recipient_number, strlen(recipient_number));
+ /* We want to submit message */
+ SMS.SMS[i].PDU = SMS_Submit;
+
+ /*
+ * Set flag before callind SendSMS, some phones might give
+ * instant response
+ */
+ sms_send_status = ERR_TIMEOUT;
+
+ /* Send message */
+ error = GSM_SendSMS(s, &SMS.SMS[i]);
+ error_handler();
+
+ /* Wait for network reply */
+ while (!gshutdown) {
+ GSM_ReadDevice(s, TRUE);
+ if (sms_send_status == ERR_NONE) {
+ /* Message sent OK */
+ return_value = 0;
+ break;
+ }
+ if (sms_send_status != ERR_TIMEOUT) {
+ /* Message sending failed */
+ return_value = 100;
+ break;
+ }
+ }
+ }
+
+ /* Terminate connection */
+ error = GSM_TerminateConnection(s);
+ error_handler();
+
+ /* Free up used memory */
+ GSM_FreeStateMachine(s);
+
+ return return_value;
+}
+
+/* Editor configuration
+ * vim: noexpandtab sw=8 ts=8 sts=8 tw=72:
+ */
diff --git a/docs/develop/formats/backup.rst b/docs/develop/formats/backup.rst
new file mode 100644
index 0000000..5cf7d5a
--- /dev/null
+++ b/docs/develop/formats/backup.rst
@@ -0,0 +1,6 @@
+Backup Format
+=============
+
+The backup format is text file encoded in either ASCII or UCS-2-BE encodings. The
+syntax is standard INI file, with both ``;`` and ``#`` used for comments.
+
diff --git a/docs/develop/formats/index.rst b/docs/develop/formats/index.rst
new file mode 100644
index 0000000..b0623b5
--- /dev/null
+++ b/docs/develop/formats/index.rst
@@ -0,0 +1,11 @@
+File formats used by Gammu
+==========================
+
+Gammu understands wide range of standard formats as well as introduces own
+formats for storing some data.
+
+.. toctree::
+ :maxdepth: 2
+
+ smsbackup
+ backup
diff --git a/docs/develop/formats/smsbackup.rst b/docs/develop/formats/smsbackup.rst
new file mode 100644
index 0000000..4dd1a25
--- /dev/null
+++ b/docs/develop/formats/smsbackup.rst
@@ -0,0 +1,10 @@
+SMS Backup Format
+=================
+
+The SMS backup format is text file encoded in current encoding of platform
+where Gammu is running. The syntax is standard INI file, with both ``;`` and
+``#`` used for comments.
+
+The file consists of unlimited number of sections, each is for one message and
+it's name is formatted like ``SMSBackup001``. The numbering of messages must
+be consistent - Gammu stops to read the file on first skipped number.
diff --git a/docs/develop/index.rst b/docs/develop/index.rst
index 8ff58ce..a215867 100644
--- a/docs/develop/index.rst
+++ b/docs/develop/index.rst
@@ -19,6 +19,7 @@ Contents
python/index
c/index
internal/index
+ formats/index
smsd/index
testing/index
protocol/index
diff --git a/docs/develop/python/examples.rst b/docs/develop/python/examples.rst
index b42a71c..a8568e3 100644
--- a/docs/develop/python/examples.rst
+++ b/docs/develop/python/examples.rst
@@ -10,6 +10,12 @@ Sending a message
.. literalinclude:: ../../../python/examples/sendsms.py
:language: python
+Sending a long message
+----------------------
+
+.. literalinclude:: ../../../python/examples/sendlongsms.py
+ :language: python
+
Initiating a voice call
-----------------------
diff --git a/docs/user/cs/gammu-smsdrc.5 b/docs/user/cs/gammu-smsdrc.5
index d74ebc9..87b2bc2 100644
--- a/docs/user/cs/gammu-smsdrc.5
+++ b/docs/user/cs/gammu-smsdrc.5
@@ -286,7 +286,7 @@ How many times will SMSD backend retry operation.
The implementation on different backends is different, for database backends
it generally means how many times it will try to reconnect to the server.
-Default is 10.
+Výchozí je 10.
.SS "Parametry pro služby používající databázi"
diff --git a/docs/user/cs/gammu.1 b/docs/user/cs/gammu.1
index 56cf329..3cc5868 100644
--- a/docs/user/cs/gammu.1
+++ b/docs/user/cs/gammu.1
@@ -3,7 +3,7 @@
.\" This file was generated with po4a. Translate the source file.
.\"
.\"*******************************************************************
-.TH GAMMU 1 "12. Květen 2010" "Gammu 1.27.94" "Dokumentace Gammu"
+.TH GAMMU 1 "Jul 1 2010" "Gammu 1.27.96" "Dokumentace Gammu"
.SH JMÉNO
@@ -2495,15 +2495,6 @@ není nastaven čas a datum.
.SS "Informace o telefonu"
.TP
-\fBcheckfirmware\fP
-
-Gammu se připojí na www.gammu.org a zkontroluje poslední dostupnou verzi
-firmware pro váš telefon. Stáhne se soubor
-<http://www.gammu.org/support/phones/phonedbxml.php?model=x> a
-načtou se z něj informace o telefonu. Nejsou odesílána žádná soukromá
-data. Musí být povolen přístup na www.gammu.org na portu 80.
-
-.TP
\fBgetdisplaystatus\fP
.TP
@@ -2617,9 +2608,6 @@ Tato volba je dostupná jen pokud bylo Gammu zkompilováno s ladicím kódem a
umožní dekódovat odposlechy komunikace s některými telefony. Více detailů
naleznete v \fIdocs/develop/develop.txt\fP.
-.TP
-\fBmakeconverttable\fP\fI file\fP
-
.SS "Fuknce, které se nevešly jinam"
.TP
diff --git a/docs/user/cs/gammurc.5 b/docs/user/cs/gammurc.5
index 9c25c59..7755812 100644
--- a/docs/user/cs/gammurc.5
+++ b/docs/user/cs/gammurc.5
@@ -106,6 +106,15 @@ na FreeBSD nebo COM1: na Windows). Speciální výjjímkou jsou DKU\-2 a DKU\-5
kabely na Windows, kde je zařízení automaticky zjištěno z informací ovladače
a tento parametr je ignorován.
+For USB connections (currently only fbususb and dku2 on Linux), you can
+specify to which USB device Gammu should connect. You can either provide
+vendor/product IDs or device address on USB:
+
+ Device = 0x1234:0x5678 # Match device by vendor and product id
+ Device = 0x1234:\-1 # Match device by vendor id
+ Device = 1.10 # Match device by usb bus and device address
+ Device = 10 # Match device by usb device address
+
Při připojení přes Bluetooth musíte zadat Bluetooth adresu vašeho telefonu
(na Linuxu můžete zjistit seznam zařízení v dosahu pomocí příkazu "hcitool
scan"). Volitelně můžete Gammu přinutit používat jiný kanál zadáním jeho
diff --git a/docs/user/gammu.1 b/docs/user/gammu.1
index 4913217..983f9e2 100644
--- a/docs/user/gammu.1
+++ b/docs/user/gammu.1
@@ -1,4 +1,4 @@
-.TH "GAMMU" "1" "May 12 2010" "Gammu 1.27.94" "Gammu Documentation"
+.TH "GAMMU" "1" "Jul 1 2010" "Gammu 1.27.96" "Gammu Documentation"
.SH "NAME"
@@ -2402,15 +2402,6 @@ be done, when phone doesn't have set clock inside.
.SS "Phone information"
.TP
-.BI "checkfirmware"
-
-Gammu connects to www.gammu.org and checks for latest firmware versions
-available for the device. The file
-<http://www.gammu.org/support/phones/phonedbxml.php?model=x> will be
-downloaded and all phone details will be read from it. No private data are
-sent to server. Internet connection to www.gammu.org on port 80 required.
-
-.TP
.BI "getdisplaystatus"
.TP
@@ -2520,9 +2511,6 @@ This option is available only if Gammu was compiled with debuging options.
Option available only, if Gammu was compiled with debug. Allows to decode
sniffs. See \fI/docs/develop/develop.txt\fR for more details.
-.TP
-.BI "makeconverttable" " file"
-
.SS "Functions that don't fit elsewhere"
.TP
diff --git a/docs/user/gammurc.5 b/docs/user/gammurc.5
index 12ff212..d4de987 100644
--- a/docs/user/gammurc.5
+++ b/docs/user/gammurc.5
@@ -96,6 +96,15 @@ FreeBSD or COM1: on Windows). The special exception are DKU-2 and DKU-5 cables
on Windows, where the device is automatically detected from driver information
and this parameters is ignored.
+For USB connections (currently only fbususb and dku2 on Linux), you can
+specify to which USB device Gammu should connect. You can either provide
+vendor/product IDs or device address on USB:
+
+ Device = 0x1234:0x5678 # Match device by vendor and product id
+ Device = 0x1234:-1 # Match device by vendor id
+ Device = 1.10 # Match device by usb bus and device address
+ Device = 10 # Match device by usb device address
+
For Bluetooth connection you have to enter Bluetooth address of your phone
(you can list Bluetooth devices in range on Linux using "hcitool scan"
command). Optionally you can also force Gammu to use specified channel by