summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/config/CMakeLists.txt11
-rw-r--r--docs/config/gammurc173
-rw-r--r--docs/config/smsdrc80
-rw-r--r--docs/examples/CMakeLists.txt21
-rw-r--r--docs/examples/Makefile16
-rw-r--r--docs/examples/README9
-rw-r--r--docs/examples/custom-config.c108
-rw-r--r--docs/examples/long-sms.c189
-rw-r--r--docs/examples/phone-info.c100
-rw-r--r--docs/examples/sms-read.c132
-rw-r--r--docs/examples/sms-send.c170
-rw-r--r--docs/examples/smsd.c46
-rw-r--r--docs/man/CMakeLists.txt53
-rw-r--r--docs/man/gammu-backup.5141
-rw-r--r--docs/man/gammu-config.170
-rw-r--r--docs/man/gammu-detect.1179
-rw-r--r--docs/man/gammu-smsbackup.5198
-rw-r--r--docs/man/gammu-smsd-dbi.7272
-rw-r--r--docs/man/gammu-smsd-files.7133
-rw-r--r--docs/man/gammu-smsd-inject.1202
-rw-r--r--docs/man/gammu-smsd-monitor.1110
-rw-r--r--docs/man/gammu-smsd-mysql.7571
-rw-r--r--docs/man/gammu-smsd-null.765
-rw-r--r--docs/man/gammu-smsd-odbc.7127
-rw-r--r--docs/man/gammu-smsd-pgsql.7371
-rw-r--r--docs/man/gammu-smsd-run.7292
-rw-r--r--docs/man/gammu-smsd-sql.7724
-rw-r--r--docs/man/gammu-smsd-tables.7759
-rw-r--r--docs/man/gammu-smsd.1332
-rw-r--r--docs/man/gammu-smsdrc.51049
-rw-r--r--docs/man/gammu.12639
-rw-r--r--docs/man/gammurc.5771
-rw-r--r--docs/man/jadmaker.170
-rw-r--r--docs/manual/CMakeLists.txt51
-rw-r--r--docs/manual/Gammu.htm460
-rw-r--r--docs/manual/c/api.rst32
-rw-r--r--docs/manual/c/backup.rst22
-rw-r--r--docs/manual/c/bitmap.rst21
-rw-r--r--docs/manual/c/calendar.rst59
-rw-r--r--docs/manual/c/call.rst28
-rw-r--r--docs/manual/c/callback.rst13
-rw-r--r--docs/manual/c/category.rst11
-rw-r--r--docs/manual/c/datetime.rst19
-rw-r--r--docs/manual/c/debug.rst15
-rw-r--r--docs/manual/c/error.rst6
-rw-r--r--docs/manual/c/examples.rst42
-rw-r--r--docs/manual/c/file.rst22
-rw-r--r--docs/manual/c/hints.rst202
-rw-r--r--docs/manual/c/index.rst21
-rw-r--r--docs/manual/c/info.rst40
-rw-r--r--docs/manual/c/inifile.rst17
-rw-r--r--docs/manual/c/keys.rst6
-rw-r--r--docs/manual/c/limits.rst3
-rw-r--r--docs/manual/c/memory.rst30
-rw-r--r--docs/manual/c/message.rst91
-rw-r--r--docs/manual/c/misc.rst11
-rw-r--r--docs/manual/c/nokia.rst5
-rw-r--r--docs/manual/c/porting.rst51
-rw-r--r--docs/manual/c/ringtone.rst43
-rw-r--r--docs/manual/c/security.rst8
-rw-r--r--docs/manual/c/settings.rst39
-rw-r--r--docs/manual/c/smsd.rst13
-rw-r--r--docs/manual/c/statemachine.rst32
-rw-r--r--docs/manual/c/types.rst5
-rw-r--r--docs/manual/c/unicode.rst24
-rw-r--r--docs/manual/c/wap.rst17
-rw-r--r--docs/manual/conf.py424
-rw-r--r--docs/manual/config/index.rst421
-rw-r--r--docs/manual/configext.py156
-rw-r--r--docs/manual/contents.rst29
-rw-r--r--docs/manual/faq/config.rst130
-rw-r--r--docs/manual/faq/general.rst115
-rw-r--r--docs/manual/faq/index.rst13
-rw-r--r--docs/manual/faq/phone.rst72
-rw-r--r--docs/manual/faq/python.rst19
-rw-r--r--docs/manual/faq/smsd.rst89
-rw-r--r--docs/manual/formats/backup.rst56
-rw-r--r--docs/manual/formats/index.rst14
-rw-r--r--docs/manual/formats/ini.rst31
-rw-r--r--docs/manual/formats/smsbackup.rst129
-rw-r--r--docs/manual/gammu/index.rst1988
-rw-r--r--docs/manual/glossary.rst8
-rw-r--r--docs/manual/index.rst37
-rw-r--r--docs/manual/internal/index.rst15
-rw-r--r--docs/manual/internal/new-phone.rst173
-rw-r--r--docs/manual/internal/reply.rst117
-rw-r--r--docs/manual/internal/state-machine.rst29
-rw-r--r--docs/manual/project/about.rst16
-rw-r--r--docs/manual/project/coding-style.rst54
-rw-r--r--docs/manual/project/contributing.rst52
-rw-r--r--docs/manual/project/directories.rst204
-rw-r--r--docs/manual/project/documentation.rst57
-rw-r--r--docs/manual/project/index.rst19
-rw-r--r--docs/manual/project/install.rst587
-rw-r--r--docs/manual/project/localization.rst42
-rw-r--r--docs/manual/project/motivation.rst52
-rw-r--r--docs/manual/project/roadmap.rst61
-rw-r--r--docs/manual/project/testing.rst8
-rw-r--r--docs/manual/project/versioning.rst9
-rw-r--r--docs/manual/protocol/carkit.rst698
-rw-r--r--docs/manual/protocol/discovering.rst82
-rw-r--r--docs/manual/protocol/gnapplet.rst62
-rw-r--r--docs/manual/protocol/index.rst28
-rw-r--r--docs/manual/protocol/m-obex.rst440
-rw-r--r--docs/manual/protocol/mtk.rst41
-rw-r--r--docs/manual/protocol/n6110.rst798
-rw-r--r--docs/manual/protocol/n6510.rst806
-rw-r--r--docs/manual/protocol/n7110.rst717
-rw-r--r--docs/manual/protocol/nokia-s40-sms-scratch.txt151
-rw-r--r--docs/manual/protocol/nokia-s40-sms.rst74
-rw-r--r--docs/manual/protocol/nokia.rst317
-rw-r--r--docs/manual/protocol/s60-download-qr.pngbin0 -> 286 bytes
-rw-r--r--docs/manual/protocol/s60.rst167
-rw-r--r--docs/manual/protocol/samsung-gt.rst168
-rw-r--r--docs/manual/protocol/samsung.rst304
-rw-r--r--docs/manual/protocol/sonim.rst37
-rw-r--r--docs/manual/protocol/tdma_5120.rst121
-rw-r--r--docs/manual/python/data.rst42
-rw-r--r--docs/manual/python/examples.rst190
-rw-r--r--docs/manual/python/exceptions.rst375
-rw-r--r--docs/manual/python/gammu.rst1375
-rw-r--r--docs/manual/python/index.rst51
-rw-r--r--docs/manual/python/objects.rst879
-rw-r--r--docs/manual/python/smsd.rst90
-rw-r--r--docs/manual/python/worker.rst162
-rw-r--r--docs/manual/quick/index.rst200
-rw-r--r--docs/manual/requirements.txt1
-rw-r--r--docs/manual/smsd/backends.rst20
-rw-r--r--docs/manual/smsd/code.rst201
-rw-r--r--docs/manual/smsd/config.rst828
-rw-r--r--docs/manual/smsd/dbi.rst78
-rw-r--r--docs/manual/smsd/files.rst81
-rw-r--r--docs/manual/smsd/index.rst15
-rw-r--r--docs/manual/smsd/inject.rst113
-rw-r--r--docs/manual/smsd/manual.rst9
-rw-r--r--docs/manual/smsd/monitor.rst63
-rw-r--r--docs/manual/smsd/mysql.rst94
-rw-r--r--docs/manual/smsd/null.rst25
-rw-r--r--docs/manual/smsd/odbc.rst90
-rw-r--r--docs/manual/smsd/overview.rst81
-rw-r--r--docs/manual/smsd/pgsql.rst58
-rw-r--r--docs/manual/smsd/run.rst168
-rw-r--r--docs/manual/smsd/smsd-interactions.dia949
-rw-r--r--docs/manual/smsd/smsd-interactions.pngbin0 -> 29711 bytes
-rw-r--r--docs/manual/smsd/smsd.rst271
-rw-r--r--docs/manual/smsd/sql.rst469
-rw-r--r--docs/manual/smsd/tables.rst625
-rw-r--r--docs/manual/smsd/usage.rst61
-rw-r--r--docs/manual/testing/dummy-driver.rst88
-rw-r--r--docs/manual/testing/index.rst11
-rw-r--r--docs/manual/testing/testsuite.rst165
-rw-r--r--docs/manual/utils/gammu-config.rst33
-rw-r--r--docs/manual/utils/gammu-detect.rst124
-rw-r--r--docs/manual/utils/index.rst12
-rw-r--r--docs/manual/utils/jadmaker.rst34
-rw-r--r--docs/sql/CMakeLists.txt14
-rw-r--r--docs/sql/mysql-strict.sql180
-rw-r--r--docs/sql/mysql.sql234
-rw-r--r--docs/sql/pgsql.sql270
-rw-r--r--docs/sql/sqlite.sql147
160 files changed, 30855 insertions, 0 deletions
diff --git a/docs/config/CMakeLists.txt b/docs/config/CMakeLists.txt
new file mode 100644
index 0000000..2f57b19
--- /dev/null
+++ b/docs/config/CMakeLists.txt
@@ -0,0 +1,11 @@
+# cmake <http://www.cmake.org> build file for Gammu docs
+# Copyright (c) 2007 - 2017 Michal Cihar
+# vim: expandtab sw=4 ts=4 sts=4:
+
+project (Gammu-doc-config C)
+
+install (
+ FILES gammurc smsdrc
+ DESTINATION "${INSTALL_DOC_DIR}/examples/config"
+ COMPONENT "examples"
+ )
diff --git a/docs/config/gammurc b/docs/config/gammurc
new file mode 100644
index 0000000..71e50d6
--- /dev/null
+++ b/docs/config/gammurc
@@ -0,0 +1,173 @@
+; This is a sample ~/.gammurc file.
+; In Unix/Linux copy it into your home directory and name it .gammurc
+; or into /etc and name it gammurc
+; In Win32 copy it into directory with Gammu.exe and name gammurc
+; More about parameters later
+; Anything behind ; or # is comment.
+; -----------------------------------------------------------------------------
+
+[gammu]
+
+device = com8:
+connection = irdaphonet
+; Do not use model configuration unless you really need it
+;model = 6110
+;synchronizetime = yes
+;logfile = gammulog
+;logformat = textall
+;use_locking = yes
+;gammuloc = locfile
+;startinfo = yes
+;gammucoding = utf8
+;usephonedb = yes
+
+[gammu1]
+
+device = com8:
+;model = 6110
+connection = fbusblue
+;synchronizetime = yes
+;logfile = gammulog
+;logformat = textall
+;use_locking = yes
+;gammuloc = locfile
+;startinfo = yes
+;gammucoding = utf8
+
+; Step 1. Please find required Connection parameter and look into assigned
+; with it device type. With some Connection you must set concrete model
+
+; ================================================================ cables =====
+; New Nokia protocol for FBUS/DAU9P
+; Connection "fbus", device type serial
+; New Nokia protocol for DLR3/DLR3P
+; Connection "fbusdlr3"/"dlr3", device type serial
+; New Nokia protocol for DKU2 (and phone with USB converter on phone mainboard
+; like 6230)
+; Connection "dku2phonet"/"dku2", device type dku2 on Windows
+; Connection "fbususb" on Linux
+; New Nokia protocol for DKU5 (and phone without USB converter on phone
+; mainboard like 5100)
+; Connection "dku5fbus"/"dku5", device type dku5
+; New Nokia protocol for PL2303 USB cable (and phone without USB converter
+; on phone mainboard like 5100)
+; Connection "fbuspl2303", device type usb
+; Old Nokia protocol for MBUS/DAU9P
+; Connection "mbus", device type serial
+; Variants:
+; You can modify a bit behaviour of connection using additional flags
+; specified just after connection name like connection-variant.
+; If you're using ARK3116 cable (or any other which does not like dtr
+; handling), you might need -nodtr variant of connection, eg. dlr3-nodtr.
+; If cable you use is not powered over DTR/RTS, try using -nopower variant of
+; connection, eg. fbus-nopower.
+; -----------------------------------------------------------------------------
+; AT commands for DLR3, DKU5 or other AT compatible cable (8 bits, None
+; parity, no flow control, 1 stop bit). Used with Nokia, Alcatel, Siemens, etc.
+; Connection "at19200"/"at115200"/.., device type serial
+; AT commands for DKU2 cable
+; Connection "dku2at", device type dku2
+; ============================================================== infrared =====
+; Nokia protocol for infrared with Nokia 6110/6130/6150
+; Connection "fbusirda"/"infrared", device type serial
+; Nokia protocol for infrared with other Nokia models
+; Connection "irdaphonet"/"irda", device type irda
+; -----------------------------------------------------------------------------
+; AT commands for infrared. Used with Nokia, Alcatel, Siemens, etc.
+; Connection "irdaat", device type irda
+; -----------------------------------------------------------------------------
+; OBEX for infrared
+; Connection "irdaobex", device type irda.
+; ============================================================= Bluetooth =====
+; Nokia protocol with serial device set in BT stack (WidComm, other) from
+; adequate service and Nokia 6210
+; Connection "fbusblue", device type serial
+; Nokia protocol with serial device set in BT stack (WidComm, other) from
+; adequate service and other Nokia models
+; Connection "phonetblue", device type serial
+; -----------------------------------------------------------------------------
+; Nokia protocol for Bluetooth stack with Nokia 6210
+; Connection "bluerffbus", device type BT
+; Nokia protocol for Bluetooth stack with DCT4 Nokia models, which don't inform
+; about services correctly (6310, 6310i with firmware lower than 5.50, 8910,..)
+; Connection "bluerfphonet", device type BT
+; Nokia protocol for Bluetooth stack with other DCT4 Nokia models
+; Connection "bluephonet", device type BT
+; -----------------------------------------------------------------------------
+; AT commands for Bluetooth stack and 6210 / DCT4 Nokia models, which don't
+; inform about BT services correctly (6310, 6310i with firmware lower
+; than 5.50, 8910,..)
+; Connection "bluerfat", device type BT
+; AT commands for Bluetooth stack with other phones (Siemens, other Nokia,etc.)
+; Connection "blueat", device type BT
+; -----------------------------------------------------------------------------
+; OBEX for Bluetooth stack with DCT4 Nokia models, which don't inform about
+; BT services correctly (6310, 6310i with firmware lower than 5.50, 8910,...)
+; Connection "bluerfobex", device type BT
+; OBEX for Bluetooth stack with other phones (Siemens, other Nokia, etc.)
+; Connection "blueobex", device type BT.
+; -----------------------------------------------------------------------------
+; Connection "bluerfgnapbus", device type BT, model "gnap"
+; Connection "irdagnapbus", device type irda, model "gnap"
+
+; Step2. According to device type from Step1 and used OS set Port parameter
+
+; -----------------------------------------------------------------------------
+; Port type | "Port" parameter in Windows/DOS | "Port" parameter in Linux/Unix
+; ----------|---------------------------------|--------------------------------
+; serial | "com*:" | "/dev/ttyS*"
+; | (example "com1:") | (example "/dev/ttyS1")
+; | | or "/dev/tts/**" (with DevFS)
+; | | virtual serial ports like
+; | | "/dev/ircomm*" or "/dev/rfcomm*"
+; ----------|---------------------------------|--------------------------------
+; irda | ignored (can be empty) | ignored (can be empty)
+; ----------|---------------------------------|--------------------------------
+; BT | Bluetooth device address (example "00:11:22:33:44:55").
+; | Optionally you can also include channel after slash
+; | (example "00:11:22:33:44:55/12"). Can be also empty.
+; ----------|---------------------------------|--------------------------------
+; dku2 | ignored (can be empty) | /dev/ttyUSB* or /dev/ttyACM*
+; ----------|---------------------------------|--------------------------------
+; dku5 | ignored (can be empty) | connection with it not possible
+; ----------|---------------------------------|--------------------------------
+; usb | connection with it not possible | "/dev/ttyUSB*"
+
+; Step3. Set other config parameters
+
+; -----------------------------------------------------------------------------
+; Parameter name | Description
+; ----------------|------------------------------------------------------------
+; Model | Should not be used unless you have a good reason to do so.
+; | If Gammu doesn't recognize your phone model, put it here.
+; | Example values: "6110", "6150", "6210", "8210"
+; SynchronizeTime | if you want to set time from computer to phone during
+; | starting connection. Do not rather use this option when
+; | when to reset phone during connection (in some phones need
+; | to set time again after restart)
+; GammuLoc | name of localisation file
+; StartInfo | this option allows one to set, that you want (setting "yes")
+; | to see message on the phone screen or phone should enable
+; | light for a moment during starting connection. Phone
+; | WON'T beep during starting connection with this option.
+; GammuCoding | forces using specified codepage (in win32 - for example
+; | "1250" will force CP1250) or UTF8 (in Linux - "utf8")
+; ----------------|------------------------------------------------------------
+; Logfile | Use, when want to have logfile from communication.
+; Logformat | What debug info and format should be used:
+; | "nothing" - no debug level (default)
+; | "text" - transmission dump in text format
+; | "textall" - all possible info in text format
+; | "errors" - errors in text format
+; | "binary" - transmission dump in binary format
+; ----------------|------------------------------------------------------------
+; Features | Custom features for phone. This can be used as override
+; | when values coded in common/gsmphones.c are bad or
+; | missing. Consult include/gammu-info.h for possible values
+; | (all Feature values without leading F_ prefix).
+; | Please report correct values to Gammu authors.
+; ----------------|------------------------------------------------------------
+; Use_Locking | under Unix/Linux use "yes", if want to lock used device
+; | to prevent using it by other applications. In win32 ignored
+
+; vim: et ts=4 sw=4 sts=4 tw=78 spell spelllang=en_us
diff --git a/docs/config/smsdrc b/docs/config/smsdrc
new file mode 100644
index 0000000..0b93366
--- /dev/null
+++ b/docs/config/smsdrc
@@ -0,0 +1,80 @@
+# This is a sample Gammu SMSD configuration file. It's required for gammu-smsd,
+# see gammu-smsdrc(5) for documentation.
+
+# Gammu configuration, this section is like section "gammu" in "gammurc" file,
+# see gammurc(5) for documentation.
+[gammu]
+#device = /dev/ttyS1
+#model = 6110
+#connection = dlr3
+#synchronizetime = yes
+#logfile = gammulog # this is not used at all in SMSD mode
+#logformat = textall
+#use_locking = yes
+#gammuloc = gammu.us
+#startinfo = yes
+
+# When uncomment this section and insert numbers here, smsd will process
+# incoming sms only from numbers written here (incoming sms from all other
+# numbers will be deleted)
+#[include_numbers]
+#number1 = 1234
+
+# When uncomment this section and insert numbers here, smsd will process
+# incoming sms from all numbers not written here (incoming sms from numbers
+# written here will be deleted). This is "black" list.
+# Note: after using "include_numbers" section this one will be ignored
+#[exclude_numbers]
+#number1 = 1234
+
+# General SMSD settings, see gammu-smsdrc(5) for detailed description.
+[smsd]
+# SMSD service to use, one of FILES, MYSQL, PGSQL, DBI
+service = files
+# PIN for SIM card
+PIN = 1234
+# File (or stderr, syslog, eventlog) where information will be logged
+logfile = smsdlog
+# Amount of information being logged, each bit mean one level
+debuglevel = 0
+# Configuration for using more phones on same database
+#phoneid = MyPhone1
+# Script to be executed when new message has been received
+#runonreceive = /some/script
+# Commication frequency settings
+commtimeout = 30
+sendtimeout = 30
+#receivefrequency = 0
+
+# Phone communication settings
+#checksecurity = 1
+#resetfrequency = 0
+
+# Delivery report configuration
+#deliveryreport = no
+#deliveryreportdelay = 10
+
+# Ignoring broken SMSC
+#skipsmscnumber = +48602123456
+
+# Database backends congfiguration
+user = gammu
+password = gammupassword
+pc = localhost
+# pc can also contain port or socket path after colon (eg. localhost:/path/to/socket)
+database = sms
+
+# DBI configuration
+driver = sqlite
+# driverspath = /usr/lib/dbd/
+# Database directory for sqlite
+# dbdir = /var/lib/smsd
+
+# Files backend configuration
+#inboxpath = /var/spool/sms/inbox/
+#outboxpath = /var/spool/sms/outbox/
+#sentsmspath = /var/spool/sms/sent/
+#errorsmspath = /var/spool/sms/error/
+#inboxformat = unicode
+#transmitformat = auto
+#outboxformat = detail
diff --git a/docs/examples/CMakeLists.txt b/docs/examples/CMakeLists.txt
new file mode 100644
index 0000000..fe4e287
--- /dev/null
+++ b/docs/examples/CMakeLists.txt
@@ -0,0 +1,21 @@
+project (Gammu-doc-examples C)
+
+set (EXAMPLES
+ Makefile
+ phone-info.c
+ sms-send.c
+ smsd.c
+ sms-read.c
+ long-sms.c
+ custom-config.c
+ )
+
+foreach (DOC ${EXAMPLES})
+ get_filename_component(DIRNAME ${DOC} PATH)
+ install (
+ FILES ${DOC}
+ DESTINATION "${INSTALL_DOC_DIR}/examples/${DIRNAME}"
+ COMPONENT "manual"
+ )
+endforeach (DOC)
+
diff --git a/docs/examples/Makefile b/docs/examples/Makefile
new file mode 100644
index 0000000..9150989
--- /dev/null
+++ b/docs/examples/Makefile
@@ -0,0 +1,16 @@
+# Path to directory, where is gammu built
+GAMMU_BUILD=../../../build-configure/
+
+CFLAGS=$(shell PKG_CONFIG_PATH=$(GAMMU_BUILD)/pkgconfig pkg-config --cflags --libs gammu-smsd) $(shell PKG_CONFIG_PATH=$(GAMMU_BUILD)/pkgconfig pkg-config --cflags --libs gammu) -Wall
+
+ALL=phone-info sms-send smsd
+
+.PHONY: all clean
+
+all: $(ALL)
+
+clean:
+ rm -f $(ALL)
+
+%:%.c
+ $(CC) $< $(CFLAGS) -o $@
diff --git a/docs/examples/README b/docs/examples/README
new file mode 100644
index 0000000..b137d8f
--- /dev/null
+++ b/docs/examples/README
@@ -0,0 +1,9 @@
+Examples for libGammu usage
+===========================
+
+This directory contains few examples for libGammu usage from C. You will
+probably need to set GAMMU_BUILD variable before invoking make, it
+should point to place where you have built gammu. You can ignore this if
+you have properly installed Gammu on your system.
+
+# vim: et ts=4 sw=4 sts=4 tw=72
diff --git a/docs/examples/custom-config.c b/docs/examples/custom-config.c
new file mode 100644
index 0000000..a805042
--- /dev/null
+++ b/docs/examples/custom-config.c
@@ -0,0 +1,108 @@
+/*
+ * libGammu example to show how to set configuration manually instead
+ * of parsing ~/.gammurc
+ */
+#include <gammu.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+GSM_StateMachine *s;
+GSM_Error error;
+char buffer[100];
+
+/* 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);
+ }
+}
+
+int main(int argc, char **argv)
+{
+ GSM_Debug_Info *debug_info;
+ GSM_Config *cfg;
+
+ if (argc != 4) {
+ printf("Usage: custom-config DEVICE CONNECTION MODEL\n");
+ }
+
+ /*
+ * 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, FALSE, debug_info);
+ GSM_SetDebugLevel("textall", debug_info);
+
+ /* Allocates state machine */
+ s = GSM_AllocStateMachine();
+ if (s == NULL)
+ return 3;
+
+ /*
+ * Enable state machine debugging to same config as global one.
+ */
+ debug_info = GSM_GetDebug(s);
+ GSM_SetDebugGlobal(TRUE, debug_info);
+
+ /*
+ * Get pointer to config structure.
+ */
+ cfg = GSM_GetConfig(s, 0);
+
+ /*
+ * Set configuration, first freeing old values.
+ */
+ free(cfg->Device);
+ cfg->Device = strdup(argv[1]);
+ free(cfg->Connection);
+ cfg->Connection = strdup(argv[2]);
+ /* For historical reasons this is not a pointer */
+ strcpy(cfg->Model, argv[3]);
+
+ /* We have one valid configuration */
+ GSM_SetConfigNum(s, 1);
+
+ /* Connect to phone */
+ /* 1 means number of replies you want to wait for */
+ error = GSM_InitConnection(s, 1);
+ error_handler();
+
+ /* Here you can do some stuff with phone... */
+
+ /* As an example we read some information about phone: */
+
+ /* Manufacturer name */
+ error = GSM_GetManufacturer(s, buffer);
+ error_handler();
+ printf("Manufacturer : %s\n", buffer);
+
+ /* Model name */
+ error = GSM_GetModel(s, buffer);
+ error_handler();
+ printf("Model : %s (%s)\n",
+ GSM_GetModelInfo(s)->model,
+ buffer);
+
+ /* Terminate connection */
+ error = GSM_TerminateConnection(s);
+ error_handler();
+
+ /* Free up used memory */
+ GSM_FreeStateMachine(s);
+
+ return 0;
+}
+
+/* Editor configuration
+ * vim: noexpandtab sw=8 ts=8 sts=8 tw=72:
+ */
+
diff --git a/docs/examples/long-sms.c b/docs/examples/long-sms.c
new file mode 100644
index 0000000..da3fd53
--- /dev/null
+++ b/docs/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 info 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 */
+ /* 1 means number of replies you want to wait for */
+ error = GSM_InitConnection(s, 1);
+ 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/examples/phone-info.c b/docs/examples/phone-info.c
new file mode 100644
index 0000000..4ff3ad2
--- /dev/null
+++ b/docs/examples/phone-info.c
@@ -0,0 +1,100 @@
+#include <gammu.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+GSM_StateMachine *s;
+INI_Section *cfg;
+GSM_Error error;
+char buffer[100];
+
+/* 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);
+ }
+}
+
+int main(int argc UNUSED, char **argv UNUSED)
+{
+ GSM_Debug_Info *debug_info;
+
+ /*
+ * 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, FALSE, debug_info);
+ GSM_SetDebugLevel("textall", debug_info);
+
+ /* 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, FALSE, 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 */
+ /* 1 means number of replies you want to wait for */
+ error = GSM_InitConnection(s, 1);
+ error_handler();
+
+ /* Here you can do some stuff with phone... */
+
+ /* As an example we read some information about phone: */
+
+ /* Manufacturer name */
+ error = GSM_GetManufacturer(s, buffer);
+ error_handler();
+ printf("Manufacturer : %s\n", buffer);
+
+ /* Model name */
+ error = GSM_GetModel(s, buffer);
+ error_handler();
+ printf("Model : %s (%s)\n",
+ GSM_GetModelInfo(s)->model,
+ buffer);
+
+ /* Terminate connection */
+ error = GSM_TerminateConnection(s);
+ error_handler();
+
+ /* Free up used memory */
+ GSM_FreeStateMachine(s);
+
+ return 0;
+}
+
+/* Editor configuration
+ * vim: noexpandtab sw=8 ts=8 sts=8 tw=72:
+ */
diff --git a/docs/examples/sms-read.c b/docs/examples/sms-read.c
new file mode 100644
index 0000000..42103e3
--- /dev/null
+++ b/docs/examples/sms-read.c
@@ -0,0 +1,132 @@
+#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;
+
+/* 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_Debug_Info *debug_info;
+ gboolean start;
+ GSM_MultiSMSMessage sms;
+ int i;
+
+ /* 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);
+
+ /* 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 */
+ /* 1 means number of replies you want to wait for */
+ error = GSM_InitConnection(s, 1);
+ error_handler();
+
+ /* Read all messages */
+ error = ERR_NONE;
+ start = TRUE;
+ sms.Number = 0;
+ sms.SMS[0].Location = 0;
+ sms.SMS[0].Folder = 0;
+ while (error == ERR_NONE && !gshutdown) {
+ error = GSM_GetNextSMS(s, &sms, start);
+ if (error == ERR_EMPTY) break;
+ error_handler();
+ start = FALSE;
+
+ /* Now we can do something with the message */
+ for (i = 0; i < sms.Number; i++) {
+ printf("Location: %d, Folder: %d\n", sms.SMS[i].Location, sms.SMS[i].Folder);
+ printf("Number: \"%s\"\n", DecodeUnicodeConsole(sms.SMS[i].Number));
+ /*
+ * Decoding with GSM_DecodeMultiPartSMS is also an option here,
+ * but for simplicity we use this approach which will handle only
+ * text messages.
+ */
+ if (sms.SMS[i].Coding == SMS_Coding_8bit) {
+ printf("8-bit message, can not display\n");
+ } else {
+ printf("Text: \"%s\"\n", DecodeUnicodeConsole(sms.SMS[i].Text));
+ }
+ printf("\n");
+ }
+ }
+
+ /* Terminate connection */
+ error = GSM_TerminateConnection(s);
+ error_handler();
+
+ /* Free up used memory */
+ GSM_FreeStateMachine(s);
+
+ return 0;
+}
+
+/* Editor configuration
+ * vim: noexpandtab sw=8 ts=8 sts=8 tw=72:
+ */
+
diff --git a/docs/examples/sms-send.c b/docs/examples/sms-send.c
new file mode 100644
index 0000000..578c360
--- /dev/null
+++ b/docs/examples/sms-send.c
@@ -0,0 +1,170 @@
+#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_SMSMessage sms;
+ GSM_SMSC PhoneSMSC;
+ char recipient_number[] = "+1234567890";
+ char message_text[] = "Sample Gammu message";
+ 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);
+
+ /* Prepare message */
+ /* Cleanup the structure */
+ memset(&sms, 0, sizeof(sms));
+ /* Encode message text */
+ EncodeUnicode(sms.Text, message_text, strlen(message_text));
+ /* Encode recipient number */
+ EncodeUnicode(sms.Number, recipient_number, strlen(recipient_number));
+ /* We want to submit message */
+ sms.PDU = SMS_Submit;
+ /* No UDH, just a plain message */
+ sms.UDH.Type = UDH_NoUDH;
+ /* We used default coding for text */
+ sms.Coding = SMS_Coding_Default_No_Compression;
+ /* Class 1 message (normal) */
+ sms.Class = 1;
+
+ /* 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 */
+ /* 1 means number of replies you want to wait for */
+ error = GSM_InitConnection(s, 1);
+ 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();
+
+ /* Set SMSC number in message */
+ CopyUnicodeString(sms.SMSC.Number, PhoneSMSC.Number);
+
+ /*
+ * Set flag before callind SendSMS, some phones might give
+ * instant response
+ */
+ sms_send_status = ERR_TIMEOUT;
+
+ /* Send message */
+ error = GSM_SendSMS(s, &sms);
+ 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/examples/smsd.c b/docs/examples/smsd.c
new file mode 100644
index 0000000..619f778
--- /dev/null
+++ b/docs/examples/smsd.c
@@ -0,0 +1,46 @@
+/* Simple C program to start SMSD without all magic normal gammu-smsd does */
+#include <gammu-smsd.h>
+#include <assert.h>
+
+int main(int argc UNUSED, char **argv UNUSED)
+{
+ GSM_SMSDConfig *config;
+ GSM_Error error;
+ char *config_file = NULL; /* Use default compiled in path */
+
+ /*
+ * We don't need gettext, but need to set locales so that
+ * charset conversion works.
+ */
+ GSM_InitLocales(NULL);
+
+ /* Initalize configuration with program name */
+ config = SMSD_NewConfig("smsd-example");
+ assert(config != NULL);
+
+ /* Read configuration file */
+ error = SMSD_ReadConfig(config_file, config, TRUE);
+ if (error != ERR_NONE) {
+ printf("Failed to read config!\n");
+ SMSD_FreeConfig(config);
+ return 2;
+ }
+
+ /* Start main SMSD loop which processes messages */
+ /*
+ * This normally never terminates, you need to signal it
+ * by SMSD_Shutdown(config); (for example from signal handler)
+ * to make it stop.
+ */
+ error = SMSD_MainLoop(config, FALSE, 0);
+ if (error != ERR_NONE) {
+ printf("Failed to run SMSD!\n");
+ SMSD_FreeConfig(config);
+ return 2;
+ }
+
+ /* Free configuration structure */
+ SMSD_FreeConfig(config);
+
+ return 0;
+}
diff --git a/docs/man/CMakeLists.txt b/docs/man/CMakeLists.txt
new file mode 100644
index 0000000..16299e7
--- /dev/null
+++ b/docs/man/CMakeLists.txt
@@ -0,0 +1,53 @@
+project (Gammu-user-docs C)
+
+file(GLOB MAN1_PAGES "*.1")
+
+install (
+ FILES ${MAN1_PAGES}
+ DESTINATION "${INSTALL_MAN_DIR}/man1"
+ COMPONENT "manpages"
+ )
+
+file(GLOB MAN5_PAGES "*.5")
+
+install (
+ FILES ${MAN5_PAGES}
+ DESTINATION "${INSTALL_MAN_DIR}/man5"
+ COMPONENT "manpages"
+ )
+
+file(GLOB MAN5_PAGES "*.7")
+
+install (
+ FILES ${MAN5_PAGES}
+ DESTINATION "${INSTALL_MAN_DIR}/man7"
+ COMPONENT "manpages"
+ )
+
+# This should match list in admin/po4a.config
+foreach(LANG cs de es fr id it pl ru zh_CN af bg ca el et fi gl he hu ko nl pt_BR sk sv zh_TW da sw en_GB tr ar)
+
+ file(GLOB MAN1_PAGES "${LANG}/*.1")
+
+ install (
+ FILES ${MAN1_PAGES}
+ DESTINATION "${INSTALL_MAN_DIR}/${LANG}/man1"
+ COMPONENT "manpages"
+ )
+
+ file(GLOB MAN5_PAGES "${LANG}/*.5")
+
+ install (
+ FILES ${MAN5_PAGES}
+ DESTINATION "${INSTALL_MAN_DIR}/${LANG}/man5"
+ COMPONENT "manpages"
+ )
+
+ file(GLOB MAN5_PAGES "${LANG}/*.7")
+
+ install (
+ FILES ${MAN5_PAGES}
+ DESTINATION "${INSTALL_MAN_DIR}/${LANG}/man7"
+ COMPONENT "manpages"
+ )
+endforeach(LANG)
diff --git a/docs/man/gammu-backup.5 b/docs/man/gammu-backup.5
new file mode 100644
index 0000000..0128262
--- /dev/null
+++ b/docs/man/gammu-backup.5
@@ -0,0 +1,141 @@
+.\" Man page generated from reStructuredText.
+.
+.TH "GAMMU-BACKUP" "5" "Oct 16, 2017" "1.38.5" "Gammu"
+.SH NAME
+gammu-backup \- gammu(1) backup file format.
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.sp
+The backup format is text file encoded in either ASCII or UCS\-2\-BE encodings.
+.sp
+This file use ini file syntax, see ini\&.
+.SH EXAMPLES
+.sp
+If you will backup settings to Gammu text file, it will be possible to edit
+it. It’s easy: many things in this file will be written double \- once in Unicode,
+once in ASCII. When you will remove Unicode version Gammu will use ASCII
+on fBrestorefR (and you can easy edit ASCII text) and will convert it
+according to your OS locale. When will be available Unicode version of text,
+it will be used instead of ASCII (useful with Unicode phones \- it isn’t important,
+what locale is set in computer and no conversion Unicode \-> ASCII and ASCII \->
+Unicode is done).
+.sp
+You can use any editor with regular expressions function to edit backup text
+file. Examples of such editors can be \fI\%vim\fP or
+\fI\%TextPad\fP which both do support regular expressions.
+.sp
+Remove info about voice tags
+.sp
+Find:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+^Entry\e([0\-9][0\-9]\e)VoiceTag = \e(.*\e)\en
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Replace:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+<blank>
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Change all numbers starting from +3620, +3630, +3660, +3670 to +3620
+.sp
+Find:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Type = NumberGeneral\enEntry\e([0\-9][0\-9]\e)Text = "\e+36\e(20\e|30\e|60\e|70\e)\en
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Replace:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Type = NumberMobile\enEntry\e1Text = "\e+3620
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Change phone numbers type to mobile for numbers starting from +3620, +3630,… and removing the corresponding TextUnicode line
+.sp
+Find:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Type = NumberGeneral\enEntry\e([0\-9][0\-9]\e)Text = "\e+36\e([2367]0\e)\e([^\e"]*\e)"\enEntry\e([0\-9][0\-9]\e)TextUnicode = \e([^\en]*\e)\en
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Replace:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+Type = NumberMobile\enEntry\e1Text = "\e+36\e2\e3"\en
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+\fBSEE ALSO:\fP
+.INDENT 0.0
+.INDENT 3.5
+converting\-formats
+.UNINDENT
+.UNINDENT
+.SH AUTHOR
+Michal ÄŒihaÅ™ <michal@cihar.com>
+.SH COPYRIGHT
+2009-2015, Michal ÄŒihaÅ™ <michal@cihar.com>
+.\" Generated by docutils manpage writer.
+.
diff --git a/docs/man/gammu-config.1 b/docs/man/gammu-config.1
new file mode 100644
index 0000000..4c5bb3d
--- /dev/null
+++ b/docs/man/gammu-config.1
@@ -0,0 +1,70 @@
+.\" Man page generated from reStructuredText.
+.
+.TH "GAMMU-CONFIG" "1" "Oct 16, 2017" "1.38.5" "Gammu"
+.SH NAME
+gammu-config \- Gammu configurator
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu\-config [\-f|\-\-force] [\-c|\-\-config CONFIG]
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH DESCRIPTION
+.sp
+Script to help configuring gammu\&.
+.sp
+This program follows the usual GNU command line syntax, with long options
+starting with two dashes (\fB\-\fP). A summary of options is included below.
+.INDENT 0.0
+.TP
+.B \-h, \-\-help
+Show summary of options.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-f, \-\-force
+Force configuring even if config already exists.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-c, \-\-config CONFIG
+Define which configuration file to use.
+.UNINDENT
+.SH AUTHOR
+Michal ÄŒihaÅ™ <michal@cihar.com>
+.SH COPYRIGHT
+2009-2015, Michal ÄŒihaÅ™ <michal@cihar.com>
+.\" Generated by docutils manpage writer.
+.
diff --git a/docs/man/gammu-detect.1 b/docs/man/gammu-detect.1
new file mode 100644
index 0000000..0d9a649
--- /dev/null
+++ b/docs/man/gammu-detect.1
@@ -0,0 +1,179 @@
+.\" Man page generated from reStructuredText.
+.
+.TH "GAMMU-DETECT" "1" "Oct 16, 2017" "1.38.5" "Gammu"
+.SH NAME
+gammu-detect \- Gammu device detection
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.sp
+New in version 1.28.95.
+
+.SH SYNOPSIS
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu\-detect [OPTIONS]
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH DESCRIPTION
+.sp
+Script to detect available devices, which might be suitable for gammu\&.
+.sp
+\fBNOTE:\fP
+.INDENT 0.0
+.INDENT 3.5
+This program lists all devices, which might be suitable, it does not do
+any probing on devices them self.
+.UNINDENT
+.UNINDENT
+.sp
+Currently it supports following devices:
+.INDENT 0.0
+.IP \(bu 2
+USB devices using udev
+.IP \(bu 2
+Serial ports using udev
+.IP \(bu 2
+Serial ports on Windows
+.IP \(bu 2
+Bluetooth devices using Bluez
+.UNINDENT
+.sp
+\fBNOTE:\fP
+.INDENT 0.0
+.INDENT 3.5
+Supported devices depend on platform you are using and compiled in
+features. You can find out what is actually compiled in by running
+\fI\%gammu\-detect \-v\fP\&.
+.UNINDENT
+.UNINDENT
+.sp
+This program follows the usual GNU command line syntax, with long options
+starting with two dashes (\fB\-\-\fP). A summary of options is included below.
+.INDENT 0.0
+.TP
+.B \-h, \-\-help
+Show summary of options.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-d, \-\-debug
+Show debugging output for detecting devices.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-v, \-\-version
+Show version information and compiled in features.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-u, \-\-no\-udev
+Disables scanning of udev.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-b, \-\-no\-bluez
+Disables scanning using Bluez.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-w, \-\-no\-win32\-serial
+Disables scanning of Windows serial ports.
+.UNINDENT
+.SH OUTPUT
+.sp
+The output of \fI\%gammu\-detect\fP is configuration file for Gammu (see
+gammurc) with configuration section for every device which might be
+used with gammu\&.
+.sp
+\fBNOTE:\fP
+.INDENT 0.0
+.INDENT 3.5
+You can choose which section to use in gammu by \fI\%gammu \-s\fP\&.
+.UNINDENT
+.UNINDENT
+.sp
+When invoked as \fI\%gammu\-detect \-d\fP, also all examined devices are
+listed as comments in the output.
+.SH EXAMPLE
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+; Configuration file generated by gammu\-detect.
+; Please check The Gammu Manual for more information.
+
+[gammu]
+device = /dev/ttyACM0
+name = Nokia E52
+connection = at
+
+[gammu1]
+device = /dev/ttyACM1
+name = Nokia E52
+connection = at
+
+[gammu2]
+device = /dev/ttyS0
+name = Phone on serial port 0
+connection = at
+
+[gammu3]
+device = /dev/ttyS1
+name = Phone on serial port 1
+connection = at
+
+[gammu4]
+device = /dev/ttyS2
+name = Phone on serial port 2
+connection = at
+
+[gammu5]
+device = /dev/ttyS3
+name = Phone on serial port 3
+connection = at
+
+[gammu6]
+device = 5C:57:C8:BB:BB:BB
+name = Nokia E52
+connection = bluephonet
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH AUTHOR
+Michal ÄŒihaÅ™ <michal@cihar.com>
+.SH COPYRIGHT
+2009-2015, Michal ÄŒihaÅ™ <michal@cihar.com>
+.\" Generated by docutils manpage writer.
+.
diff --git a/docs/man/gammu-smsbackup.5 b/docs/man/gammu-smsbackup.5
new file mode 100644
index 0000000..cbf8033
--- /dev/null
+++ b/docs/man/gammu-smsbackup.5
@@ -0,0 +1,198 @@
+.\" Man page generated from reStructuredText.
+.
+.TH "GAMMU-SMSBACKUP" "5" "Oct 16, 2017" "1.38.5" "Gammu"
+.SH NAME
+gammu-smsbackup \- gammu(1) SMS backup file format.
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.sp
+The SMS backup format is text file encoded in current encoding of platform
+where Gammu is running.
+.sp
+This file use ini file syntax, see ini\&.
+.SH SECTIONS
+.sp
+The file consists of sections, whose name starts with \fBSMSBackup\fP\&. When
+creating the backup file, three digits are appended to this text defining
+order. While reading the backup, any part after \fBSMSBackup\fP text is ignored
+and everything which begins with this is processed. So you can as well give
+the section name \fBSMSBackupFoo\fP and it will be processed.
+.sp
+The number of messages in backup file is currently limited by
+\fBGSM_BACKUP_MAX_SMS\fP (100000 at time of writing this document).
+.SS \fBSMSBackup\fP section
+.sp
+Each section interprets one physical SMS message (eg. one message part in case
+of multipart messages).
+.SS Decoded text
+.sp
+For SMS backups created by Gammu, there is a decoded text as a comment just
+after the section name:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[SMSBackup001]
+; This is message text
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+The text can be split to more lines if it is too long or of original message
+included new lines.
+.sp
+\fBNOTE:\fP
+.INDENT 0.0
+.INDENT 3.5
+This is easiest way to get message text, however also the least reliable
+one, because it is stored in the comments in the file.
+.UNINDENT
+.UNINDENT
+.SS Variables
+.sp
+The following variables can be defined for each SMS:
+.INDENT 0.0
+.TP
+.B \fBSMSC\fP
+Text representation of SMSC number, not used by Gammu if \fBSMSCUnicode\fP
+exists.
+.TP
+.B \fBSMSCUnicode\fP
+Hex encoded UCS\-2 string with SMSC number.
+.TP
+.B \fBClass\fP
+Message class.
+.TP
+.B \fBSent\fP
+Timestamp, when message has been sent.
+.TP
+.B \fBPDU\fP
+Message type, one of:
+.INDENT 7.0
+.IP \(bu 2
+\fBDeliver\fP \- received message
+.IP \(bu 2
+\fBSubmit\fP \- message to send
+.IP \(bu 2
+\fBStatus_Report\fP \- message to send with delivery report
+.UNINDENT
+.TP
+.B \fBDateTime\fP
+Timestamp of message (sent or received).
+.TP
+.B \fBRejectDuplicates\fP
+Whether receiver should reject duplicates.
+.TP
+.B \fBReplaceMessage\fP
+ID of message to replace.
+.TP
+.B \fBMessageReference\fP
+Message reference number as generated by network.
+.TP
+.B \fBState\fP
+State of the message:
+.INDENT 7.0
+.IP \(bu 2
+\fBRead\fP
+.IP \(bu 2
+\fBUnRead\fP
+.IP \(bu 2
+\fBSent\fP
+.IP \(bu 2
+\fBUnSent\fP
+.UNINDENT
+.TP
+.B \fBNumber\fP
+Recipient number.
+.TP
+.B \fBName\fP
+Name of the message.
+.TP
+.B \fBLength\fP
+Length of message text.
+.TP
+.B \fBCoding\fP
+Coding of the message:
+.INDENT 7.0
+.IP \(bu 2
+\fB8bit\fP \- binary message
+.IP \(bu 2
+\fBDefault\fP \- GSM encoding, up to 160 chars in message
+.IP \(bu 2
+\fBUnicode\fP \- Unicode encoding, up to 70 chars in message
+.UNINDENT
+.TP
+.B \fBText00\fP … \fBTextNN\fP
+Numbered parts of the message payload.
+.TP
+.B \fBFolder\fP
+ID of folder where the message was saved.
+.TP
+.B \fBUDH\fP
+User defined header of the message.
+.UNINDENT
+.SH EXAMPLE
+.sp
+The backup of message can look like following:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[SMSBackup000]
+#ABCDEFGHIJKLMNOPQRSTUVWXYZ
+#
+SMSC = "+4540590000"
+SMSCUnicode = 002B0034003500340030003500390030003000300030
+Sent = 20021201T025023
+State = UnRead
+Number = "+4522706947"
+NumberUnicode = 002B0034003500320032003700300036003900340037
+Name = ""
+NameUnicode =
+Text00 = 004100420043004400450046004700480049004A004B004C004D004E004F0050005100520053005400550056005700580059005A000A
+Coding = Default
+Folder = 1
+Length = 27
+Class = \-1
+ReplySMSC = False
+RejectDuplicates = True
+ReplaceMessage = 0
+MessageReference = 0
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH AUTHOR
+Michal ÄŒihaÅ™ <michal@cihar.com>
+.SH COPYRIGHT
+2009-2015, Michal ÄŒihaÅ™ <michal@cihar.com>
+.\" Generated by docutils manpage writer.
+.
diff --git a/docs/man/gammu-smsd-dbi.7 b/docs/man/gammu-smsd-dbi.7
new file mode 100644
index 0000000..4a0db5e
--- /dev/null
+++ b/docs/man/gammu-smsd-dbi.7
@@ -0,0 +1,272 @@
+.\" Man page generated from reStructuredText.
+.
+.TH "GAMMU-SMSD-DBI" "7" "Oct 16, 2017" "1.38.5" "Gammu"
+.SH NAME
+gammu-smsd-dbi \- gammu-smsd(1) backend using DBI abstraction layer to use any supported database as a message storage
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH DESCRIPTION
+.sp
+DBI backend stores all data in any database supported by \fI\%libdbi\fP, which
+parameters are defined by configuration (see gammu\-smsdrc for description of
+configuration options).
+.sp
+For tables description see gammu\-smsd\-tables\&.
+.sp
+This backend is based on gammu\-smsd\-sql\&.
+.sp
+\fBNOTE:\fP
+.INDENT 0.0
+.INDENT 3.5
+The DBI driver is currently not supported on Windows because libdbi
+library does not support this platform.
+.UNINDENT
+.UNINDENT
+.SH CONFIGURATION
+.sp
+Before running gammu\-smsd you need to create necessary tables in the
+database. You can use examples given in database specific backends parts of
+this manual to do that.
+.sp
+The configuration file then can look like:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[smsd]
+service = sql
+driver = DBI_DRIVER
+host = localhost
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+\fBSEE ALSO:\fP
+.INDENT 0.0
+.INDENT 3.5
+gammu\-smsdrc
+.UNINDENT
+.UNINDENT
+.SH SUPPORTED DRIVERS
+.sp
+For complete list of drivers for \fI\%libdbi\fP see \fI\%libdbi\-drivers\fP project. The
+drivers for example include:
+.INDENT 0.0
+.IP \(bu 2
+\fBsqlite3\fP \- for SQLite 3
+.IP \(bu 2
+\fBmysql\fP \- for MySQL
+.IP \(bu 2
+\fBpgsql\fP \- for PostgeSQL
+.IP \(bu 2
+\fBfreetds\fP \- for MS SQL Server or Sybase
+.UNINDENT
+.SH CREATING TABLES FOR SQLITE
+.sp
+SQL script for creating tables in SQLite database:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+CREATE TABLE gammu (
+ Version INTEGER NOT NULL DEFAULT \(aq0\(aq PRIMARY KEY
+);
+
+INSERT INTO gammu (Version) VALUES (17);
+
+CREATE TABLE inbox (
+ UpdatedInDB NUMERIC NOT NULL DEFAULT (datetime(\(aqnow\(aq)),
+ ReceivingDateTime NUMERIC NOT NULL DEFAULT (datetime(\(aqnow\(aq)),
+ Text TEXT NOT NULL,
+ SenderNumber TEXT NOT NULL DEFAULT \(aq\(aq,
+ Coding TEXT NOT NULL DEFAULT \(aqDefault_No_Compression\(aq,
+ UDH TEXT NOT NULL,
+ SMSCNumber TEXT NOT NULL DEFAULT \(aq\(aq,
+ Class INTEGER NOT NULL DEFAULT \(aq\-1\(aq,
+ TextDecoded TEXT NOT NULL DEFAULT \(aq\(aq,
+ ID INTEGER PRIMARY KEY AUTOINCREMENT,
+ RecipientID TEXT NOT NULL,
+ Processed TEXT NOT NULL DEFAULT \(aqfalse\(aq,
+ Status INTEGER NOT NULL DEFAULT \(aq\-1\(aq,
+ CHECK (Coding IN
+ (\(aqDefault_No_Compression\(aq,\(aqUnicode_No_Compression\(aq,\(aq8bit\(aq,\(aqDefault_Compression\(aq,\(aqUnicode_Compression\(aq))
+);
+
+CREATE TRIGGER update_inbox_time UPDATE ON inbox
+ BEGIN
+ UPDATE inbox SET UpdatedInDB = datetime(\(aqnow\(aq) WHERE ID = old.ID;
+ END;
+
+CREATE TABLE outbox (
+ UpdatedInDB NUMERIC NOT NULL DEFAULT (datetime(\(aqnow\(aq)),
+ InsertIntoDB NUMERIC NOT NULL DEFAULT (datetime(\(aqnow\(aq)),
+ SendingDateTime NUMERIC NOT NULL DEFAULT (datetime(\(aqnow\(aq)),
+ SendBefore time NOT NULL DEFAULT \(aq23:59:59\(aq,
+ SendAfter time NOT NULL DEFAULT \(aq00:00:00\(aq,
+ Text TEXT,
+ DestinationNumber TEXT NOT NULL DEFAULT \(aq\(aq,
+ Coding TEXT NOT NULL DEFAULT \(aqDefault_No_Compression\(aq,
+ UDH TEXT,
+ Class INTEGER DEFAULT \(aq\-1\(aq,
+ TextDecoded TEXT NOT NULL DEFAULT \(aq\(aq,
+ ID INTEGER PRIMARY KEY AUTOINCREMENT,
+ MultiPart TEXT NOT NULL DEFAULT \(aqfalse\(aq,
+ RelativeValidity INTEGER DEFAULT \(aq\-1\(aq,
+ SenderID TEXT,
+ SendingTimeOut NUMERIC NOT NULL DEFAULT (datetime(\(aqnow\(aq)),
+ DeliveryReport TEXT DEFAULT \(aqdefault\(aq,
+ CreatorID TEXT NOT NULL,
+ Retries INTEGER DEFAULT \(aq0\(aq,
+ Priority INTEGER DEFAULT \(aq0\(aq,
+ Status TEXT NOT NULL DEFAULT \(aqReserved\(aq,
+ StatusCode INTEGER NOT NULL DEFAULT \(aq\-1\(aq,
+ CHECK (Coding IN
+ (\(aqDefault_No_Compression\(aq,\(aqUnicode_No_Compression\(aq,\(aq8bit\(aq,\(aqDefault_Compression\(aq,\(aqUnicode_Compression\(aq)),
+ CHECK (DeliveryReport IN (\(aqdefault\(aq,\(aqyes\(aq,\(aqno\(aq)),
+ CHECK (Status IN
+ (\(aqSendingOK\(aq,\(aqSendingOKNoReport\(aq,\(aqSendingError\(aq,\(aqDeliveryOK\(aq,\(aqDeliveryFailed\(aq,\(aqDeliveryPending\(aq,
+ \(aqDeliveryUnknown\(aq,\(aqError\(aq,\(aqReserved\(aq))
+);
+
+CREATE INDEX outbox_date ON outbox(SendingDateTime, SendingTimeOut);
+CREATE INDEX outbox_sender ON outbox(SenderID);
+
+CREATE TRIGGER update_outbox_time UPDATE ON outbox
+ BEGIN
+ UPDATE outbox SET UpdatedInDB = datetime(\(aqnow\(aq) WHERE ID = old.ID;
+ END;
+
+CREATE TABLE outbox_multipart (
+ Text TEXT,
+ Coding TEXT NOT NULL DEFAULT \(aqDefault_No_Compression\(aq,
+ UDH TEXT,
+ Class INTEGER DEFAULT \(aq\-1\(aq,
+ TextDecoded TEXT DEFAULT NULL,
+ ID INTEGER,
+ SequencePosition INTEGER NOT NULL DEFAULT \(aq1\(aq,
+ Status TEXT NOT NULL DEFAULT \(aqReserved\(aq,
+ StatusCode INTEGER NOT NULL DEFAULT \(aq\-1\(aq,
+ CHECK (Coding IN
+ (\(aqDefault_No_Compression\(aq,\(aqUnicode_No_Compression\(aq,\(aq8bit\(aq,\(aqDefault_Compression\(aq,\(aqUnicode_Compression\(aq)),
+ CHECK (Status IN
+ (\(aqSendingOK\(aq,\(aqSendingOKNoReport\(aq,\(aqSendingError\(aq,\(aqDeliveryOK\(aq,\(aqDeliveryFailed\(aq,\(aqDeliveryPending\(aq,
+ \(aqDeliveryUnknown\(aq,\(aqError\(aq,\(aqReserved\(aq)),
+ PRIMARY KEY (ID, SequencePosition)
+);
+
+CREATE TABLE phones (
+ ID TEXT NOT NULL,
+ UpdatedInDB NUMERIC NOT NULL DEFAULT (datetime(\(aqnow\(aq)),
+ InsertIntoDB NUMERIC NOT NULL DEFAULT (datetime(\(aqnow\(aq)),
+ TimeOut NUMERIC NOT NULL DEFAULT (datetime(\(aqnow\(aq)),
+ Send TEXT NOT NULL DEFAULT \(aqno\(aq,
+ Receive TEXT NOT NULL DEFAULT \(aqno\(aq,
+ IMEI TEXT PRIMARY KEY NOT NULL,
+ IMSI TEXT NOT NULL,
+ NetCode TEXT DEFAULT \(aqERROR\(aq,
+ NetName TEXT DEFAULT \(aqERROR\(aq,
+ Client TEXT NOT NULL,
+ Battery INTEGER NOT NULL DEFAULT \-1,
+ Signal INTEGER NOT NULL DEFAULT \-1,
+ Sent INTEGER NOT NULL DEFAULT 0,
+ Received INTEGER NOT NULL DEFAULT 0
+);
+
+CREATE TRIGGER update_phones_time UPDATE ON phones
+ BEGIN
+ UPDATE phones SET UpdatedInDB = datetime(\(aqnow\(aq) WHERE IMEI = old.IMEI;
+ END;
+
+CREATE TABLE sentitems (
+ UpdatedInDB NUMERIC NOT NULL DEFAULT (datetime(\(aqnow\(aq)),
+ InsertIntoDB NUMERIC NOT NULL DEFAULT (datetime(\(aqnow\(aq)),
+ SendingDateTime NUMERIC NOT NULL DEFAULT (datetime(\(aqnow\(aq)),
+ DeliveryDateTime NUMERIC NULL,
+ Text TEXT NOT NULL,
+ DestinationNumber TEXT NOT NULL DEFAULT \(aq\(aq,
+ Coding TEXT NOT NULL DEFAULT \(aqDefault_No_Compression\(aq,
+ UDH TEXT NOT NULL,
+ SMSCNumber TEXT NOT NULL DEFAULT \(aq\(aq,
+ Class INTEGER NOT NULL DEFAULT \(aq\-1\(aq,
+ TextDecoded TEXT NOT NULL DEFAULT \(aq\(aq,
+ ID INTEGER,
+ SenderID TEXT NOT NULL,
+ SequencePosition INTEGER NOT NULL DEFAULT \(aq1\(aq,
+ Status TEXT NOT NULL DEFAULT \(aqSendingOK\(aq,
+ StatusError INTEGER NOT NULL DEFAULT \(aq\-1\(aq,
+ TPMR INTEGER NOT NULL DEFAULT \(aq\-1\(aq,
+ RelativeValidity INTEGER NOT NULL DEFAULT \(aq\-1\(aq,
+ CreatorID TEXT NOT NULL,
+ StatusCode INTEGER NOT NULL DEFAULT \(aq\-1\(aq,
+ CHECK (Status IN
+ (\(aqSendingOK\(aq,\(aqSendingOKNoReport\(aq,\(aqSendingError\(aq,\(aqDeliveryOK\(aq,\(aqDeliveryFailed\(aq,\(aqDeliveryPending\(aq,
+ \(aqDeliveryUnknown\(aq,\(aqError\(aq)),
+ CHECK (Coding IN
+ (\(aqDefault_No_Compression\(aq,\(aqUnicode_No_Compression\(aq,\(aq8bit\(aq,\(aqDefault_Compression\(aq,\(aqUnicode_Compression\(aq)) ,
+ PRIMARY KEY (ID, SequencePosition)
+);
+
+CREATE INDEX sentitems_date ON sentitems(DeliveryDateTime);
+CREATE INDEX sentitems_tpmr ON sentitems(TPMR);
+CREATE INDEX sentitems_dest ON sentitems(DestinationNumber);
+CREATE INDEX sentitems_sender ON sentitems(SenderID);
+
+CREATE TRIGGER update_sentitems_time UPDATE ON sentitems
+ BEGIN
+ UPDATE sentitems SET UpdatedInDB = datetime(\(aqnow\(aq) WHERE ID = old.ID;
+ END;
+
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+\fBNOTE:\fP
+.INDENT 0.0
+.INDENT 3.5
+You can find the script in \fBdocs/sql/sqlite.sql\fP as well. There are
+also scripts for other databases in same folder.
+.UNINDENT
+.UNINDENT
+.SH UPGRADING TABLES
+.sp
+The easiest way to upgrade database structure is to backup old one and start
+with creating new one based on example above.
+.sp
+For upgrading existing database, you can use changes described in
+smsd\-tables\-history and then manually update \fBVersion\fP field in
+\fBgammu\fP table.
+.SH AUTHOR
+Michal ÄŒihaÅ™ <michal@cihar.com>
+.SH COPYRIGHT
+2009-2015, Michal ÄŒihaÅ™ <michal@cihar.com>
+.\" Generated by docutils manpage writer.
+.
diff --git a/docs/man/gammu-smsd-files.7 b/docs/man/gammu-smsd-files.7
new file mode 100644
index 0000000..bee1efa
--- /dev/null
+++ b/docs/man/gammu-smsd-files.7
@@ -0,0 +1,133 @@
+.\" Man page generated from reStructuredText.
+.
+.TH "GAMMU-SMSD-FILES" "7" "Oct 16, 2017" "1.38.5" "Gammu"
+.SH NAME
+gammu-smsd-files \- gammu-smsd(1) backend using filesystem as a message storage
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH DESCRIPTION
+.sp
+FILES backend stores all data on a filesystem in folders defined by
+configuration (see gammu\-smsdrc for description of configuration options).
+.SH RECEIVING OF MESSAGES
+.sp
+Received messages are stored in a folder defined by configuration. The
+filename will be \fBIN<date>_<time>_<serial>_<sender>_<sequence>.<ext>\fP,
+for example \fBIN20021130_021531_00_+45409000931640979_00.txt\fP\&.
+.sp
+Explanation of fields:
+.INDENT 0.0
+.TP
+.B \fB<date>\fP
+date in format \fBYYYYMMDD\fP
+.TP
+.B \fB<time>\fP
+time in format \fBHHMMSS\fP
+.TP
+.B \fB<sender>\fP
+sender number
+.TP
+.B \fB<serial>\fP
+order of a message (in case more messages were received at same time), in format \fBNN\fP
+.TP
+.B \fB<sequence>\fP
+part of the message for multipart messages, in format \fBNN\fP
+.TP
+.B \fB<ext>\fP
+\fBtxt\fP for text message, 8\-bit messages are stored with \fBbin\fP extension, \fBsmsbackup\fP for gammu\-smsbackup
+.UNINDENT
+.sp
+The content of the file is content of the message and the format is defined by
+configuration directive \fBInboxFormat\fP (see gammu\-smsdrc).
+.SH TRANSMITTING OF MESSAGES
+.sp
+Transmitted messages are read from a folder defined by configuration. The
+filename should be one of the following formats:
+.INDENT 0.0
+.IP \(bu 2
+\fBOUT<recipient>.<ext>\fP
+.IP \(bu 2
+\fBOUT<priority>_<recipient>_<serial>.<ext>\fP
+.IP \(bu 2
+\fBOUT<priority><date>_<time>_<serial>_<recipient>_<note>.<ext>\fP
+.UNINDENT
+.sp
+Explanation of fields:
+.INDENT 0.0
+.TP
+.B \fB<recipient>\fP
+recipient number where to send message
+.TP
+.B \fB<priority>\fP
+an alphabetic character (A\-Z) A = highest priority
+.TP
+.B \fB<ext>\fP
+\fBtxt\fP for normal text SMS, \fBsmsbackup\fP for gammu\-smsbackup
+.TP
+.B \fB<note>\fP
+any arbitrary text which is ignored
+.UNINDENT
+.sp
+For text messages, you can additionally append flags to extension:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.TP
+.B \fBd\fP
+delivery report requested
+.TP
+.B \fBf\fP
+flash SMS
+.TP
+.B \fBb\fP
+WAP bookmark as name,URL
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.sp
+Other fields are same as for received messages.
+.sp
+For example OUTG20040620_193810_123_+4512345678_xpq.txtdf is a flash text SMS
+requesting delivery reports.
+.sp
+SMSes will be transmitted sequentially based on the file name. The contents of
+the file is the SMS to be transmitted (in Unicode or standard character set).
+.sp
+The contents of the file is the SMS to be transmitted (in Unicode or standard
+character set), for WAP bookmarks it is split on as Name,URL, for text
+messages whole file content is used.
+.sp
+Please note that if file is not in Unicode, encoding is detected based on
+locales, which do not have to be configured if SMSD is running from init
+script. If this is your case, please add locales definition to init script.
+.SH AUTHOR
+Michal ÄŒihaÅ™ <michal@cihar.com>
+.SH COPYRIGHT
+2009-2015, Michal ÄŒihaÅ™ <michal@cihar.com>
+.\" Generated by docutils manpage writer.
+.
diff --git a/docs/man/gammu-smsd-inject.1 b/docs/man/gammu-smsd-inject.1
new file mode 100644
index 0000000..89056d3
--- /dev/null
+++ b/docs/man/gammu-smsd-inject.1
@@ -0,0 +1,202 @@
+.\" Man page generated from reStructuredText.
+.
+.TH "GAMMU-SMSD-INJECT" "1" "Oct 16, 2017" "1.38.5" "Gammu"
+.SH NAME
+gammu-smsd-inject \- Inject messages into queue of SMS daemon for Gammu
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu\-smsd\-inject [OPTION]... MESSAGETYPE RECIPIENT [MESSAGE_PARAMETER]...
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH DESCRIPTION
+.sp
+This manual page documents briefly the \fBgammu\-smsd\-inject\fP command.
+.sp
+\fBgammu\-smsd\-inject\fP is a program that enqueues message in Gammu SMS
+Daemon, which will be later sent by the daemon using connected GSM modem.
+.sp
+Support for this program depends on features available in currently used SMSD
+service backend, however currently it is supported by all of them.
+.sp
+Program accepts following options (please note that long options might be not
+accepted on some platforms):
+.INDENT 0.0
+.TP
+.B \-h, \-\-help
+Shows help.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-v, \-\-version
+Shows version information and compiled in features.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-c, \-\-config=file
+Configuration file to use, default is /etc/gammu\-smsdrc, on Windows there
+is no default and configuration file path has to be always specified.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-l, \-\-use\-log
+Use logging as configured in config file.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-L, \-\-no\-use\-log
+Do not use logging as configured in config file (default).
+.UNINDENT
+.sp
+For description of message types and their parameters, please check documentation
+for \fBgammu savesms\fP\&.
+.SH EXAMPLES
+.sp
+To check it out, you need to have configuration file for SMSD, see
+gammu\-smsdrc for more details about it.
+.sp
+Inject text message up to standard 160 chars:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+echo "All your base are belong to us" | gammu\-smsd\-inject TEXT 123456
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+or
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu\-smsd\-inject TEXT 123456 \-text "All your base are belong to us"
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Inject unicode text message:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu\-smsd\-inject TEXT 123456 \-unicode \-text "Zkouška sirén"
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Inject long text message:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+echo "All your base are belong to us" | gammu\-smsd\-inject TEXT 123456 \-len 400
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+or
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu\-smsd\-inject TEXT 123456 \-len 400 \-text "All your base are belong to us"
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+or
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu\-smsd\-inject EMS 123456 \-text "All your base are belong to us"
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Inject some funky message with predefined sound and animation from 2 bitmaps:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu\-smsd\-inject EMS 123456 \-text "Greetings" \-defsound 1 \-text "from Gammu" \-tone10 axelf.txt \-animation 2 file1.bmp file2.bmp
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Inject protected message with ringtone:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu\-smsd\-inject EMS 123456 \-protected 2 \-variablebitmaplong ala.bmp \-toneSElong axelf.txt \-toneSE ring.txt
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Inject USSD query:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu\-smsd\-inject USSD \(aq*101#\(aq
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH AUTHOR
+Michal ÄŒihaÅ™ <michal@cihar.com>
+.SH COPYRIGHT
+2009-2015, Michal ÄŒihaÅ™ <michal@cihar.com>
+.\" Generated by docutils manpage writer.
+.
diff --git a/docs/man/gammu-smsd-monitor.1 b/docs/man/gammu-smsd-monitor.1
new file mode 100644
index 0000000..35e7189
--- /dev/null
+++ b/docs/man/gammu-smsd-monitor.1
@@ -0,0 +1,110 @@
+.\" Man page generated from reStructuredText.
+.
+.TH "GAMMU-SMSD-MONITOR" "1" "Oct 16, 2017" "1.38.5" "Gammu"
+.SH NAME
+gammu-smsd-monitor \- Monitor state of SMS daemon for Gammu
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu\-smsd\-monitor [OPTION]...
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH DESCRIPTION
+.sp
+This manual page documents briefly the \fBgammu\-smsd\-monitor\fP command.
+.sp
+\fBgammu\-smsd\-monitor\fP is a program that monitors state of Gammu SMS
+Daemon. It periodically displays information about phone and number of
+processed messages.
+.sp
+Program accepts following options (please note that long options might be not
+accepted on some platforms):
+.INDENT 0.0
+.TP
+.B \-h, \-\-help
+Shows help.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-v, \-\-version
+Shows version information and compiled in features.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-c, \-\-config=file
+Configuration file to use, default is /etc/gammu\-smsdrc, on Windows there
+is no default and configuration file path has to be always specified.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-n, \-\-loops=count
+Number of loops, by default monitor loops infinitely.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-d, \-\-delay=seconds
+Delay between polling SMSD state, default is 20 seconds.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-C, \-\-csv
+Print output in comma separated values format:
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+client;phone ID;IMEI;sent;received;failed;battery;signal
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-l, \-\-use\-log
+Use logging as configured in config file.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-L, \-\-no\-use\-log
+Do not use logging as configured in config file (default).
+.UNINDENT
+.SH AUTHOR
+Michal ÄŒihaÅ™ <michal@cihar.com>
+.SH COPYRIGHT
+2009-2015, Michal ÄŒihaÅ™ <michal@cihar.com>
+.\" Generated by docutils manpage writer.
+.
diff --git a/docs/man/gammu-smsd-mysql.7 b/docs/man/gammu-smsd-mysql.7
new file mode 100644
index 0000000..e82213a
--- /dev/null
+++ b/docs/man/gammu-smsd-mysql.7
@@ -0,0 +1,571 @@
+.\" Man page generated from reStructuredText.
+.
+.TH "GAMMU-SMSD-MYSQL" "7" "Oct 16, 2017" "1.38.5" "Gammu"
+.SH NAME
+gammu-smsd-mysql \- gammu-smsd(1) backend using MySQL database server as a message storage
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH DESCRIPTION
+.sp
+MYSQL backend stores all data in a \fI\%MySQL\fP database server, which parameters are
+defined by configuration (see gammu\-smsdrc for description of configuration
+options).
+.sp
+For tables description see gammu\-smsd\-tables\&.
+.sp
+This backend is based on gammu\-smsd\-sql\&.
+.SH CONFIGURATION
+.sp
+Before running gammu\-smsd you need to create necessary tables in the
+database, which is described below.
+.sp
+The configuration file then can look like:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[smsd]
+service = sql
+driver = native_mysql
+host = localhost
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+\fBSEE ALSO:\fP
+.INDENT 0.0
+.INDENT 3.5
+gammu\-smsdrc
+.UNINDENT
+.UNINDENT
+.SH PRIVILEGES
+.sp
+The user accessing the database does not need much privileges, the following
+privileges should be enough:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+GRANT USAGE ON *.* TO \(aqsmsd\(aq@\(aqlocalhost\(aq IDENTIFIED BY \(aqpassword\(aq;
+
+GRANT SELECT, INSERT, UPDATE, DELETE ON \(gasmsd\(ga.* TO \(aqsmsd\(aq@\(aqlocalhost\(aq;
+
+CREATE DATABASE smsd;
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+\fBNOTE:\fP
+.INDENT 0.0
+.INDENT 3.5
+For creating the SQL tables you need more privileges, especially for
+creating triggers, which are used for some functionality.
+.UNINDENT
+.UNINDENT
+.SH CREATING TABLES FOR MYSQL
+.sp
+Depending on MySQL version and settings please choose best fitting
+script to create tables:
+.INDENT 0.0
+.IP \(bu 2
+\fBmysql\-strict.sql\fP can be used in strict mode, but requires MySQL 5.6.5
+or newer
+.IP \(bu 2
+\fBmysql.sql\fP supports all MySQL versions, but requires neither of
+\fINO_ZERO_DATE\fP, \fIANSI\fP or \fISTRICT\fP modes to be set in the server
+.UNINDENT
+.sp
+SQL script \fBmysql.sql\fP for creating tables in MySQL database:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+\-\-
+\-\- Database for Gammu SMSD
+\-\-
+\-\- In case you get errors about not supported charset, please
+\-\- replace utf8mb4 with utf8.
+
+\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+\-\-
+\-\- Table structure for table \(gagammu\(ga
+\-\-
+
+CREATE TABLE \(gagammu\(ga (
+ \(gaVersion\(ga integer NOT NULL default \(aq0\(aq PRIMARY KEY
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+
+\-\-
+\-\- Dumping data for table \(gagammu\(ga
+\-\-
+
+INSERT INTO \(gagammu\(ga (\(gaVersion\(ga) VALUES (17);
+
+\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+\-\-
+\-\- Table structure for table \(gainbox\(ga
+\-\-
+
+CREATE TABLE \(gainbox\(ga (
+ \(gaUpdatedInDB\(ga timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ \(gaReceivingDateTime\(ga timestamp NOT NULL default \(aq0000\-00\-00 00:00:00\(aq,
+ \(gaText\(ga text NOT NULL,
+ \(gaSenderNumber\(ga varchar(20) NOT NULL default \(aq\(aq,
+ \(gaCoding\(ga enum(\(aqDefault_No_Compression\(aq,\(aqUnicode_No_Compression\(aq,\(aq8bit\(aq,\(aqDefault_Compression\(aq,\(aqUnicode_Compression\(aq) NOT NULL default \(aqDefault_No_Compression\(aq,
+ \(gaUDH\(ga text NOT NULL,
+ \(gaSMSCNumber\(ga varchar(20) NOT NULL default \(aq\(aq,
+ \(gaClass\(ga integer NOT NULL default \(aq\-1\(aq,
+ \(gaTextDecoded\(ga text NOT NULL,
+ \(gaID\(ga integer unsigned NOT NULL auto_increment,
+ \(gaRecipientID\(ga text NOT NULL,
+ \(gaProcessed\(ga enum(\(aqfalse\(aq,\(aqtrue\(aq) NOT NULL default \(aqfalse\(aq,
+ \(gaStatus\(ga integer NOT NULL default \(aq\-1\(aq,
+ PRIMARY KEY \(gaID\(ga (\(gaID\(ga)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
+
+\-\-
+\-\- Dumping data for table \(gainbox\(ga
+\-\-
+
+
+\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+\-\-
+\-\- Table structure for table \(gaoutbox\(ga
+\-\-
+
+CREATE TABLE \(gaoutbox\(ga (
+ \(gaUpdatedInDB\(ga timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ \(gaInsertIntoDB\(ga timestamp NOT NULL default \(aq0000\-00\-00 00:00:00\(aq,
+ \(gaSendingDateTime\(ga timestamp NOT NULL default \(aq0000\-00\-00 00:00:00\(aq,
+ \(gaSendBefore\(ga time NOT NULL DEFAULT \(aq23:59:59\(aq,
+ \(gaSendAfter\(ga time NOT NULL DEFAULT \(aq00:00:00\(aq,
+ \(gaText\(ga text,
+ \(gaDestinationNumber\(ga varchar(20) NOT NULL default \(aq\(aq,
+ \(gaCoding\(ga enum(\(aqDefault_No_Compression\(aq,\(aqUnicode_No_Compression\(aq,\(aq8bit\(aq,\(aqDefault_Compression\(aq,\(aqUnicode_Compression\(aq) NOT NULL default \(aqDefault_No_Compression\(aq,
+ \(gaUDH\(ga text,
+ \(gaClass\(ga integer default \(aq\-1\(aq,
+ \(gaTextDecoded\(ga text NOT NULL,
+ \(gaID\(ga integer unsigned NOT NULL auto_increment,
+ \(gaMultiPart\(ga enum(\(aqfalse\(aq,\(aqtrue\(aq) default \(aqfalse\(aq,
+ \(gaRelativeValidity\(ga integer default \(aq\-1\(aq,
+ \(gaSenderID\(ga varchar(255),
+ \(gaSendingTimeOut\(ga timestamp NULL default \(aq0000\-00\-00 00:00:00\(aq,
+ \(gaDeliveryReport\(ga enum(\(aqdefault\(aq,\(aqyes\(aq,\(aqno\(aq) default \(aqdefault\(aq,
+ \(gaCreatorID\(ga text NOT NULL,
+ \(gaRetries\(ga int(3) default 0,
+ \(gaPriority\(ga integer default 0,
+ \(gaStatus\(ga enum(\(aqSendingOK\(aq,\(aqSendingOKNoReport\(aq,\(aqSendingError\(aq,\(aqDeliveryOK\(aq,\(aqDeliveryFailed\(aq,\(aqDeliveryPending\(aq,\(aqDeliveryUnknown\(aq,\(aqError\(aq,\(aqReserved\(aq) NOT NULL default \(aqReserved\(aq,
+ \(gaStatusCode\(ga integer NOT NULL default \(aq\-1\(aq,
+ PRIMARY KEY \(gaID\(ga (\(gaID\(ga)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+
+CREATE INDEX outbox_date ON outbox(SendingDateTime, SendingTimeOut);
+CREATE INDEX outbox_sender ON outbox(SenderID(250));
+
+\-\-
+\-\- Dumping data for table \(gaoutbox\(ga
+\-\-
+
+
+\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+\-\-
+\-\- Table structure for table \(gaoutbox_multipart\(ga
+\-\-
+
+CREATE TABLE \(gaoutbox_multipart\(ga (
+ \(gaText\(ga text,
+ \(gaCoding\(ga enum(\(aqDefault_No_Compression\(aq,\(aqUnicode_No_Compression\(aq,\(aq8bit\(aq,\(aqDefault_Compression\(aq,\(aqUnicode_Compression\(aq) NOT NULL default \(aqDefault_No_Compression\(aq,
+ \(gaUDH\(ga text,
+ \(gaClass\(ga integer default \(aq\-1\(aq,
+ \(gaTextDecoded\(ga text,
+ \(gaID\(ga integer unsigned NOT NULL default \(aq0\(aq,
+ \(gaSequencePosition\(ga integer NOT NULL default \(aq1\(aq,
+ \(gaStatus\(ga enum(\(aqSendingOK\(aq,\(aqSendingOKNoReport\(aq,\(aqSendingError\(aq,\(aqDeliveryOK\(aq,\(aqDeliveryFailed\(aq,\(aqDeliveryPending\(aq,\(aqDeliveryUnknown\(aq,\(aqError\(aq,\(aqReserved\(aq) NOT NULL default \(aqReserved\(aq,
+ \(gaStatusCode\(ga integer NOT NULL default \(aq\-1\(aq,
+ PRIMARY KEY (\(gaID\(ga, \(gaSequencePosition\(ga)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+
+\-\-
+\-\- Dumping data for table \(gaoutbox_multipart\(ga
+\-\-
+
+\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+\-\-
+\-\- Table structure for table \(gaphones\(ga
+\-\-
+
+CREATE TABLE \(gaphones\(ga (
+ \(gaID\(ga text NOT NULL,
+ \(gaUpdatedInDB\(ga timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ \(gaInsertIntoDB\(ga timestamp NOT NULL default \(aq0000\-00\-00 00:00:00\(aq,
+ \(gaTimeOut\(ga timestamp NOT NULL default \(aq0000\-00\-00 00:00:00\(aq,
+ \(gaSend\(ga enum(\(aqyes\(aq,\(aqno\(aq) NOT NULL default \(aqno\(aq,
+ \(gaReceive\(ga enum(\(aqyes\(aq,\(aqno\(aq) NOT NULL default \(aqno\(aq,
+ \(gaIMEI\(ga varchar(35) NOT NULL,
+ \(gaIMSI\(ga varchar(35) NOT NULL,
+ \(gaNetCode\(ga varchar(10) default \(aqERROR\(aq,
+ \(gaNetName\(ga varchar(35) default \(aqERROR\(aq,
+ \(gaClient\(ga text NOT NULL,
+ \(gaBattery\(ga integer NOT NULL DEFAULT \-1,
+ \(gaSignal\(ga integer NOT NULL DEFAULT \-1,
+ \(gaSent\(ga int NOT NULL DEFAULT 0,
+ \(gaReceived\(ga int NOT NULL DEFAULT 0,
+ PRIMARY KEY (\(gaIMEI\(ga)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+
+\-\-
+\-\- Dumping data for table \(gaphones\(ga
+\-\-
+
+\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+\-\-
+\-\- Table structure for table \(gasentitems\(ga
+\-\-
+
+CREATE TABLE \(gasentitems\(ga (
+ \(gaUpdatedInDB\(ga timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ \(gaInsertIntoDB\(ga timestamp NOT NULL default \(aq0000\-00\-00 00:00:00\(aq,
+ \(gaSendingDateTime\(ga timestamp NOT NULL default \(aq0000\-00\-00 00:00:00\(aq,
+ \(gaDeliveryDateTime\(ga timestamp NULL,
+ \(gaText\(ga text NOT NULL,
+ \(gaDestinationNumber\(ga varchar(20) NOT NULL default \(aq\(aq,
+ \(gaCoding\(ga enum(\(aqDefault_No_Compression\(aq,\(aqUnicode_No_Compression\(aq,\(aq8bit\(aq,\(aqDefault_Compression\(aq,\(aqUnicode_Compression\(aq) NOT NULL default \(aqDefault_No_Compression\(aq,
+ \(gaUDH\(ga text NOT NULL,
+ \(gaSMSCNumber\(ga varchar(20) NOT NULL default \(aq\(aq,
+ \(gaClass\(ga integer NOT NULL default \(aq\-1\(aq,
+ \(gaTextDecoded\(ga text NOT NULL,
+ \(gaID\(ga integer unsigned NOT NULL default \(aq0\(aq,
+ \(gaSenderID\(ga varchar(255) NOT NULL,
+ \(gaSequencePosition\(ga integer NOT NULL default \(aq1\(aq,
+ \(gaStatus\(ga enum(\(aqSendingOK\(aq,\(aqSendingOKNoReport\(aq,\(aqSendingError\(aq,\(aqDeliveryOK\(aq,\(aqDeliveryFailed\(aq,\(aqDeliveryPending\(aq,\(aqDeliveryUnknown\(aq,\(aqError\(aq) NOT NULL default \(aqSendingOK\(aq,
+ \(gaStatusError\(ga integer NOT NULL default \(aq\-1\(aq,
+ \(gaTPMR\(ga integer NOT NULL default \(aq\-1\(aq,
+ \(gaRelativeValidity\(ga integer NOT NULL default \(aq\-1\(aq,
+ \(gaCreatorID\(ga text NOT NULL,
+ \(gaStatusCode\(ga integer NOT NULL default \(aq\-1\(aq,
+ PRIMARY KEY (\(gaID\(ga, \(gaSequencePosition\(ga)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+
+CREATE INDEX sentitems_date ON sentitems(DeliveryDateTime);
+CREATE INDEX sentitems_tpmr ON sentitems(TPMR);
+CREATE INDEX sentitems_dest ON sentitems(DestinationNumber);
+CREATE INDEX sentitems_sender ON sentitems(SenderID(250));
+
+\-\-
+\-\- Dumping data for table \(gasentitems\(ga
+\-\-
+
+
+\-\-
+\-\- Triggers for setting default timestamps
+\-\-
+
+DELIMITER //
+
+CREATE TRIGGER inbox_timestamp BEFORE INSERT ON inbox
+FOR EACH ROW
+BEGIN
+ IF NEW.ReceivingDateTime = \(aq0000\-00\-00 00:00:00\(aq THEN
+ SET NEW.ReceivingDateTime = CURRENT_TIMESTAMP();
+ END IF;
+END;//
+
+CREATE TRIGGER outbox_timestamp BEFORE INSERT ON outbox
+FOR EACH ROW
+BEGIN
+ IF NEW.InsertIntoDB = \(aq0000\-00\-00 00:00:00\(aq THEN
+ SET NEW.InsertIntoDB = CURRENT_TIMESTAMP();
+ END IF;
+ IF NEW.SendingDateTime = \(aq0000\-00\-00 00:00:00\(aq THEN
+ SET NEW.SendingDateTime = CURRENT_TIMESTAMP();
+ END IF;
+ IF NEW.SendingTimeOut = \(aq0000\-00\-00 00:00:00\(aq THEN
+ SET NEW.SendingTimeOut = CURRENT_TIMESTAMP();
+ END IF;
+END;//
+
+CREATE TRIGGER phones_timestamp BEFORE INSERT ON phones
+FOR EACH ROW
+BEGIN
+ IF NEW.InsertIntoDB = \(aq0000\-00\-00 00:00:00\(aq THEN
+ SET NEW.InsertIntoDB = CURRENT_TIMESTAMP();
+ END IF;
+ IF NEW.TimeOut = \(aq0000\-00\-00 00:00:00\(aq THEN
+ SET NEW.TimeOut = CURRENT_TIMESTAMP();
+ END IF;
+END;//
+
+CREATE TRIGGER sentitems_timestamp BEFORE INSERT ON sentitems
+FOR EACH ROW
+BEGIN
+ IF NEW.InsertIntoDB = \(aq0000\-00\-00 00:00:00\(aq THEN
+ SET NEW.InsertIntoDB = CURRENT_TIMESTAMP();
+ END IF;
+ IF NEW.SendingDateTime = \(aq0000\-00\-00 00:00:00\(aq THEN
+ SET NEW.SendingDateTime = CURRENT_TIMESTAMP();
+ END IF;
+END;//
+
+DELIMITER ;
+
+
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+\fBNOTE:\fP
+.INDENT 0.0
+.INDENT 3.5
+You can find the script in \fBdocs/sql/mysql.sql\fP as well.
+.UNINDENT
+.UNINDENT
+.sp
+SQL script \fBmysql\-strict.sql\fP for creating tables in MySQL database:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+\-\-
+\-\- Database for Gammu SMSD
+\-\-
+\-\- In case you get errors about not supported charset, please
+\-\- replace utf8mb4 with utf8.
+
+\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+\-\-
+\-\- Table structure for table \(gagammu\(ga
+\-\-
+
+CREATE TABLE \(gagammu\(ga (
+ \(gaVersion\(ga integer NOT NULL default \(aq0\(aq PRIMARY KEY
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+
+\-\-
+\-\- Dumping data for table \(gagammu\(ga
+\-\-
+
+INSERT INTO \(gagammu\(ga (\(gaVersion\(ga) VALUES (17);
+
+\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+\-\-
+\-\- Table structure for table \(gainbox\(ga
+\-\-
+
+CREATE TABLE \(gainbox\(ga (
+ \(gaUpdatedInDB\(ga timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ \(gaReceivingDateTime\(ga timestamp NOT NULL default CURRENT_TIMESTAMP,
+ \(gaText\(ga text NOT NULL,
+ \(gaSenderNumber\(ga varchar(20) NOT NULL default \(aq\(aq,
+ \(gaCoding\(ga enum(\(aqDefault_No_Compression\(aq,\(aqUnicode_No_Compression\(aq,\(aq8bit\(aq,\(aqDefault_Compression\(aq,\(aqUnicode_Compression\(aq) NOT NULL default \(aqDefault_No_Compression\(aq,
+ \(gaUDH\(ga text NOT NULL,
+ \(gaSMSCNumber\(ga varchar(20) NOT NULL default \(aq\(aq,
+ \(gaClass\(ga integer NOT NULL default \(aq\-1\(aq,
+ \(gaTextDecoded\(ga text NOT NULL,
+ \(gaID\(ga integer unsigned NOT NULL auto_increment,
+ \(gaRecipientID\(ga text NOT NULL,
+ \(gaProcessed\(ga enum(\(aqfalse\(aq,\(aqtrue\(aq) NOT NULL default \(aqfalse\(aq,
+ \(gaStatus\(ga integer NOT NULL default \(aq\-1\(aq,
+ PRIMARY KEY \(gaID\(ga (\(gaID\(ga)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
+
+\-\-
+\-\- Dumping data for table \(gainbox\(ga
+\-\-
+
+
+\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+\-\-
+\-\- Table structure for table \(gaoutbox\(ga
+\-\-
+
+CREATE TABLE \(gaoutbox\(ga (
+ \(gaUpdatedInDB\(ga timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ \(gaInsertIntoDB\(ga timestamp NOT NULL default CURRENT_TIMESTAMP,
+ \(gaSendingDateTime\(ga timestamp NOT NULL default CURRENT_TIMESTAMP,
+ \(gaSendBefore\(ga time NOT NULL DEFAULT \(aq23:59:59\(aq,
+ \(gaSendAfter\(ga time NOT NULL DEFAULT \(aq00:00:00\(aq,
+ \(gaText\(ga text,
+ \(gaDestinationNumber\(ga varchar(20) NOT NULL default \(aq\(aq,
+ \(gaCoding\(ga enum(\(aqDefault_No_Compression\(aq,\(aqUnicode_No_Compression\(aq,\(aq8bit\(aq,\(aqDefault_Compression\(aq,\(aqUnicode_Compression\(aq) NOT NULL default \(aqDefault_No_Compression\(aq,
+ \(gaUDH\(ga text,
+ \(gaClass\(ga integer default \(aq\-1\(aq,
+ \(gaTextDecoded\(ga text NOT NULL,
+ \(gaID\(ga integer unsigned NOT NULL auto_increment,
+ \(gaMultiPart\(ga enum(\(aqfalse\(aq,\(aqtrue\(aq) default \(aqfalse\(aq,
+ \(gaRelativeValidity\(ga integer default \(aq\-1\(aq,
+ \(gaSenderID\(ga varchar(255),
+ \(gaSendingTimeOut\(ga timestamp NULL default CURRENT_TIMESTAMP,
+ \(gaDeliveryReport\(ga enum(\(aqdefault\(aq,\(aqyes\(aq,\(aqno\(aq) default \(aqdefault\(aq,
+ \(gaCreatorID\(ga text NOT NULL,
+ \(gaRetries\(ga int(3) default 0,
+ \(gaPriority\(ga integer default 0,
+ \(gaStatus\(ga enum(\(aqSendingOK\(aq,\(aqSendingOKNoReport\(aq,\(aqSendingError\(aq,\(aqDeliveryOK\(aq,\(aqDeliveryFailed\(aq,\(aqDeliveryPending\(aq,\(aqDeliveryUnknown\(aq,\(aqError\(aq,\(aqReserved\(aq) NOT NULL default \(aqReserved\(aq,
+ \(gaStatusCode\(ga integer NOT NULL default \(aq\-1\(aq,
+ PRIMARY KEY \(gaID\(ga (\(gaID\(ga)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+
+CREATE INDEX outbox_date ON outbox(SendingDateTime, SendingTimeOut);
+CREATE INDEX outbox_sender ON outbox(SenderID(250));
+
+\-\-
+\-\- Dumping data for table \(gaoutbox\(ga
+\-\-
+
+
+\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+\-\-
+\-\- Table structure for table \(gaoutbox_multipart\(ga
+\-\-
+
+CREATE TABLE \(gaoutbox_multipart\(ga (
+ \(gaText\(ga text,
+ \(gaCoding\(ga enum(\(aqDefault_No_Compression\(aq,\(aqUnicode_No_Compression\(aq,\(aq8bit\(aq,\(aqDefault_Compression\(aq,\(aqUnicode_Compression\(aq) NOT NULL default \(aqDefault_No_Compression\(aq,
+ \(gaUDH\(ga text,
+ \(gaClass\(ga integer default \(aq\-1\(aq,
+ \(gaTextDecoded\(ga text,
+ \(gaID\(ga integer unsigned NOT NULL default \(aq0\(aq,
+ \(gaSequencePosition\(ga integer NOT NULL default \(aq1\(aq,
+ \(gaStatus\(ga enum(\(aqSendingOK\(aq,\(aqSendingOKNoReport\(aq,\(aqSendingError\(aq,\(aqDeliveryOK\(aq,\(aqDeliveryFailed\(aq,\(aqDeliveryPending\(aq,\(aqDeliveryUnknown\(aq,\(aqError\(aq,\(aqReserved\(aq) NOT NULL default \(aqReserved\(aq,
+ \(gaStatusCode\(ga integer NOT NULL default \(aq\-1\(aq,
+ PRIMARY KEY (\(gaID\(ga, \(gaSequencePosition\(ga)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+
+\-\-
+\-\- Dumping data for table \(gaoutbox_multipart\(ga
+\-\-
+
+\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+\-\-
+\-\- Table structure for table \(gaphones\(ga
+\-\-
+
+CREATE TABLE \(gaphones\(ga (
+ \(gaID\(ga text NOT NULL,
+ \(gaUpdatedInDB\(ga timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ \(gaInsertIntoDB\(ga timestamp NOT NULL default CURRENT_TIMESTAMP,
+ \(gaTimeOut\(ga timestamp NOT NULL default CURRENT_TIMESTAMP,
+ \(gaSend\(ga enum(\(aqyes\(aq,\(aqno\(aq) NOT NULL default \(aqno\(aq,
+ \(gaReceive\(ga enum(\(aqyes\(aq,\(aqno\(aq) NOT NULL default \(aqno\(aq,
+ \(gaIMEI\(ga varchar(35) NOT NULL,
+ \(gaIMSI\(ga varchar(35) NOT NULL,
+ \(gaNetCode\(ga varchar(10) default \(aqERROR\(aq,
+ \(gaNetName\(ga varchar(35) default \(aqERROR\(aq,
+ \(gaClient\(ga text NOT NULL,
+ \(gaBattery\(ga integer NOT NULL DEFAULT \-1,
+ \(gaSignal\(ga integer NOT NULL DEFAULT \-1,
+ \(gaSent\(ga int NOT NULL DEFAULT 0,
+ \(gaReceived\(ga int NOT NULL DEFAULT 0,
+ PRIMARY KEY (\(gaIMEI\(ga)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+
+\-\-
+\-\- Dumping data for table \(gaphones\(ga
+\-\-
+
+\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+\-\-
+\-\- Table structure for table \(gasentitems\(ga
+\-\-
+
+CREATE TABLE \(gasentitems\(ga (
+ \(gaUpdatedInDB\(ga timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ \(gaInsertIntoDB\(ga timestamp NOT NULL default CURRENT_TIMESTAMP,
+ \(gaSendingDateTime\(ga timestamp NOT NULL default CURRENT_TIMESTAMP,
+ \(gaDeliveryDateTime\(ga timestamp NULL,
+ \(gaText\(ga text NOT NULL,
+ \(gaDestinationNumber\(ga varchar(20) NOT NULL default \(aq\(aq,
+ \(gaCoding\(ga enum(\(aqDefault_No_Compression\(aq,\(aqUnicode_No_Compression\(aq,\(aq8bit\(aq,\(aqDefault_Compression\(aq,\(aqUnicode_Compression\(aq) NOT NULL default \(aqDefault_No_Compression\(aq,
+ \(gaUDH\(ga text NOT NULL,
+ \(gaSMSCNumber\(ga varchar(20) NOT NULL default \(aq\(aq,
+ \(gaClass\(ga integer NOT NULL default \(aq\-1\(aq,
+ \(gaTextDecoded\(ga text NOT NULL,
+ \(gaID\(ga integer unsigned NOT NULL default \(aq0\(aq,
+ \(gaSenderID\(ga varchar(255) NOT NULL,
+ \(gaSequencePosition\(ga integer NOT NULL default \(aq1\(aq,
+ \(gaStatus\(ga enum(\(aqSendingOK\(aq,\(aqSendingOKNoReport\(aq,\(aqSendingError\(aq,\(aqDeliveryOK\(aq,\(aqDeliveryFailed\(aq,\(aqDeliveryPending\(aq,\(aqDeliveryUnknown\(aq,\(aqError\(aq) NOT NULL default \(aqSendingOK\(aq,
+ \(gaStatusError\(ga integer NOT NULL default \(aq\-1\(aq,
+ \(gaTPMR\(ga integer NOT NULL default \(aq\-1\(aq,
+ \(gaRelativeValidity\(ga integer NOT NULL default \(aq\-1\(aq,
+ \(gaCreatorID\(ga text NOT NULL,
+ \(gaStatusCode\(ga integer NOT NULL default \(aq\-1\(aq,
+ PRIMARY KEY (\(gaID\(ga, \(gaSequencePosition\(ga)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+
+CREATE INDEX sentitems_date ON sentitems(DeliveryDateTime);
+CREATE INDEX sentitems_tpmr ON sentitems(TPMR);
+CREATE INDEX sentitems_dest ON sentitems(DestinationNumber);
+CREATE INDEX sentitems_sender ON sentitems(SenderID(250));
+
+\-\-
+\-\- Dumping data for table \(gasentitems\(ga
+\-\-
+
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+\fBNOTE:\fP
+.INDENT 0.0
+.INDENT 3.5
+You can find the script in \fBdocs/sql/mysql\-strict.sql\fP as well.
+.UNINDENT
+.UNINDENT
+.SH UPGRADING TABLES
+.sp
+The easiest way to upgrade database structure is to backup old one and start
+with creating new one based on example above.
+.sp
+For upgrading existing database, you can use changes described in
+smsd\-tables\-history and then manually update \fBVersion\fP field in
+\fBgammu\fP table.
+.SH AUTHOR
+Michal ÄŒihaÅ™ <michal@cihar.com>
+.SH COPYRIGHT
+2009-2015, Michal ÄŒihaÅ™ <michal@cihar.com>
+.\" Generated by docutils manpage writer.
+.
diff --git a/docs/man/gammu-smsd-null.7 b/docs/man/gammu-smsd-null.7
new file mode 100644
index 0000000..0b30981
--- /dev/null
+++ b/docs/man/gammu-smsd-null.7
@@ -0,0 +1,65 @@
+.\" Man page generated from reStructuredText.
+.
+.TH "GAMMU-SMSD-NULL" "7" "Oct 16, 2017" "1.38.5" "Gammu"
+.SH NAME
+gammu-smsd-null \- gammu-smsd(1) backend not storing messages
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH DESCRIPTION
+.sp
+NULL backend does not store data at all. It could be useful in case you
+don’t want to store messages at all and you want to process then in
+\fBRunOnReceive\fP handler.
+.SH CONFIGURATION
+.sp
+The configuration file then can look like:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[smsd]
+Service = null
+RunOnReceive = /usr/local/bin/process\-sms
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+\fBSEE ALSO:\fP
+.INDENT 0.0
+.INDENT 3.5
+gammu\-smsdrc
+.UNINDENT
+.UNINDENT
+.SH AUTHOR
+Michal ÄŒihaÅ™ <michal@cihar.com>
+.SH COPYRIGHT
+2009-2015, Michal ÄŒihaÅ™ <michal@cihar.com>
+.\" Generated by docutils manpage writer.
+.
diff --git a/docs/man/gammu-smsd-odbc.7 b/docs/man/gammu-smsd-odbc.7
new file mode 100644
index 0000000..ba8051d
--- /dev/null
+++ b/docs/man/gammu-smsd-odbc.7
@@ -0,0 +1,127 @@
+.\" Man page generated from reStructuredText.
+.
+.TH "GAMMU-SMSD-ODBC" "7" "Oct 16, 2017" "1.38.5" "Gammu"
+.SH NAME
+gammu-smsd-odbc \- gammu-smsd(1) backend using ODBC abstraction layer to use any supported database as a message storage
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH DESCRIPTION
+.sp
+New in version 1.29.92.
+
+.sp
+ODBC backend stores all data in any database supported by \fI\%ODBC\fP, which
+parameters are defined by configuration (see gammu\-smsdrc for description of
+configuration options).
+.sp
+For tables description see gammu\-smsd\-tables\&.
+.sp
+This backend is based on gammu\-smsd\-sql\&.
+.SH SUPPORTED DRIVERS
+.sp
+On Microsoft Windows, Gammu uses native ODBC, on other platforms, \fI\%unixODBC\fP
+can be used.
+.SH LIMITATIONS
+.sp
+Due to limits of the ODBC interface, Gammu can not reliably detect which SQL
+engine it is connected to.
+.sp
+In most cases this can be solved by setting \fBSQL\fP setting to
+correct dialect.
+.sp
+If that fails, you can also tweak the SQL queries to work in used SQL server,
+see SQL Queries for more details. Still you should set
+\fBSQL\fP to closest matching SQL dialect.
+.SH CONFIGURATION
+.sp
+Before running gammu\-smsd you need to create necessary tables in the
+database. You can use examples given in database specific backends parts of
+this manual to do that.
+.sp
+You specify data source name (DSN) as \fBHost\fP in
+gammu\-smsdrc\&. The data source is configured depending on your platform.
+.sp
+\fBNOTE:\fP
+.INDENT 0.0
+.INDENT 3.5
+Please remember that SMSD might be running in different context than your
+user (separate account on Linux or as as service on Windows), so the ODBC
+DSN needs to be configured as system wide in this case (system DSN on
+Windows or in global configuration on Linux).
+.UNINDENT
+.UNINDENT
+.sp
+On Microsoft Windows, you can find instructions on Microsoft website:
+\fI\%https://support.microsoft.com/kb/305599\fP
+.sp
+For unixODBC this is documented in the user manual:
+\fI\%http://www.unixodbc.org/doc/UserManual/\fP
+.SH CREATING TABLES
+.sp
+Prior to starting SMSD you have to create tables it will use. Gammu ships SQL
+scripts for several databases to do that:
+.INDENT 0.0
+.IP \(bu 2
+mysql\-create
+.IP \(bu 2
+pgsql\-create
+.IP \(bu 2
+sqlite\-create
+.UNINDENT
+.SH EXAMPLE
+.sp
+Example configuration:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[smsd]
+service = sql
+driver = odbc
+host = dsn_of_your_database
+sql = sql_variant_to_use
+user = username
+password = password
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+\fBSEE ALSO:\fP
+.INDENT 0.0
+.INDENT 3.5
+gammu\-smsdrc
+.UNINDENT
+.UNINDENT
+.SH AUTHOR
+Michal ÄŒihaÅ™ <michal@cihar.com>
+.SH COPYRIGHT
+2009-2015, Michal ÄŒihaÅ™ <michal@cihar.com>
+.\" Generated by docutils manpage writer.
+.
diff --git a/docs/man/gammu-smsd-pgsql.7 b/docs/man/gammu-smsd-pgsql.7
new file mode 100644
index 0000000..02c8d12
--- /dev/null
+++ b/docs/man/gammu-smsd-pgsql.7
@@ -0,0 +1,371 @@
+.\" Man page generated from reStructuredText.
+.
+.TH "GAMMU-SMSD-PGSQL" "7" "Oct 16, 2017" "1.38.5" "Gammu"
+.SH NAME
+gammu-smsd-pgsql \- gammu-smsd(1) backend using PostgreSQL database server as a message storage
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH DESCRIPTION
+.sp
+PGSQL backend stores all data in a \fI\%PostgreSQL\fP database server, which
+parameters are defined by configuration (see gammu\-smsdrc for description of
+configuration options).
+.sp
+For tables description see gammu\-smsd\-tables\&.
+.sp
+This backend is based on gammu\-smsd\-sql\&.
+.SH CONFIGURATION
+.sp
+Before running gammu\-smsd you need to create necessary tables in the
+database, which is described below.
+.sp
+The configuration file then can look like:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[smsd]
+service = sql
+driver = native_pgsql
+host = localhost
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+\fBSEE ALSO:\fP
+.INDENT 0.0
+.INDENT 3.5
+gammu\-smsdrc
+.UNINDENT
+.UNINDENT
+.SH CREATING TABLES FOR POSTGRESQL
+.sp
+SQL script for creating tables in PostgreSQL database:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+\-\-
+\-\- Database: "smsd"
+\-\-
+\-\- CREATE USER "smsd" WITH NOCREATEDB NOCREATEUSER;
+\-\- CREATE DATABASE "smsd" WITH OWNER = "smsd" ENCODING = \(aqUTF8\(aq;
+\-\- \econnect "smsd" "smsd"
+\-\- COMMENT ON DATABASE "smsd" IS \(aqGammu SMSD Database\(aq;
+
+\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+\-\-
+\-\- Function declaration for updating timestamps
+\-\-
+CREATE LANGUAGE plpgsql;
+CREATE OR REPLACE FUNCTION update_timestamp() RETURNS trigger AS $update_timestamp$
+ BEGIN
+ NEW."UpdatedInDB" := LOCALTIMESTAMP(0);
+ RETURN NEW;
+ END;
+$update_timestamp$ LANGUAGE plpgsql;
+
+\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+\-\-
+\-\- Sequence declarations for tables\(aq primary keys
+\-\-
+
+\-\-CREATE SEQUENCE inbox_ID_seq;
+
+\-\-CREATE SEQUENCE outbox_ID_seq;
+
+\-\-CREATE SEQUENCE outbox_multipart_ID_seq;
+
+\-\-CREATE SEQUENCE sentitems_ID_seq;
+
+\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+\-\-
+\-\- Index declarations for tables\(aq primary keys
+\-\-
+
+\-\-CREATE UNIQUE INDEX inbox_pkey ON inbox USING btree ("ID");
+
+\-\-CREATE UNIQUE INDEX outbox_pkey ON outbox USING btree ("ID");
+
+\-\-CREATE UNIQUE INDEX outbox_multipart_pkey ON outbox_multipart USING btree ("ID");
+
+\-\-CREATE UNIQUE INDEX sentitems_pkey ON sentitems USING btree ("ID");
+
+\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+\-\-
+\-\- Table structure for table "gammu"
+\-\-
+
+CREATE TABLE gammu (
+ "Version" smallint NOT NULL DEFAULT \(aq0\(aq PRIMARY KEY
+);
+
+\-\-
+\-\- Dumping data for table "gammu"
+\-\-
+
+INSERT INTO gammu ("Version") VALUES (17);
+
+\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+\-\-
+\-\- Table structure for table "inbox"
+\-\-
+
+CREATE TABLE inbox (
+ "UpdatedInDB" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0),
+ "ReceivingDateTime" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0),
+ "Text" text NOT NULL,
+ "SenderNumber" varchar(20) NOT NULL DEFAULT \(aq\(aq,
+ "Coding" varchar(255) NOT NULL DEFAULT \(aqDefault_No_Compression\(aq,
+ "UDH" text NOT NULL,
+ "SMSCNumber" varchar(20) NOT NULL DEFAULT \(aq\(aq,
+ "Class" integer NOT NULL DEFAULT \(aq\-1\(aq,
+ "TextDecoded" text NOT NULL DEFAULT \(aq\(aq,
+ "ID" serial PRIMARY KEY,
+ "RecipientID" text NOT NULL,
+ "Processed" boolean NOT NULL DEFAULT \(aqfalse\(aq,
+ "Status" integer NOT NULL DEFAULT \(aq\-1\(aq,
+ CHECK ("Coding" IN
+ (\(aqDefault_No_Compression\(aq,\(aqUnicode_No_Compression\(aq,\(aq8bit\(aq,\(aqDefault_Compression\(aq,\(aqUnicode_Compression\(aq))
+);
+
+\-\-
+\-\- Dumping data for table "inbox"
+\-\-
+
+\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+\-\-
+\-\- Create trigger for table "inbox"
+\-\-
+
+CREATE TRIGGER update_timestamp BEFORE UPDATE ON inbox FOR EACH ROW EXECUTE PROCEDURE update_timestamp();
+
+\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+\-\-
+\-\- Table structure for table "outbox"
+\-\-
+
+CREATE TABLE outbox (
+ "UpdatedInDB" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0),
+ "InsertIntoDB" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0),
+ "SendingDateTime" timestamp NOT NULL DEFAULT LOCALTIMESTAMP(0),
+ "SendBefore" time NOT NULL DEFAULT \(aq23:59:59\(aq,
+ "SendAfter" time NOT NULL DEFAULT \(aq00:00:00\(aq,
+ "Text" text,
+ "DestinationNumber" varchar(20) NOT NULL DEFAULT \(aq\(aq,
+ "Coding" varchar(255) NOT NULL DEFAULT \(aqDefault_No_Compression\(aq,
+ "UDH" text,
+ "Class" integer DEFAULT \(aq\-1\(aq,
+ "TextDecoded" text NOT NULL DEFAULT \(aq\(aq,
+ "ID" serial PRIMARY KEY,
+ "MultiPart" boolean NOT NULL DEFAULT \(aqfalse\(aq,
+ "RelativeValidity" integer DEFAULT \(aq\-1\(aq,
+ "SenderID" varchar(255),
+ "SendingTimeOut" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0),
+ "DeliveryReport" varchar(10) DEFAULT \(aqdefault\(aq,
+ "CreatorID" text NOT NULL,
+ "Retries" integer DEFAULT \(aq0\(aq,
+ "Priority" integer DEFAULT \(aq0\(aq,
+ "Status" varchar(255) NOT NULL DEFAULT \(aqReserved\(aq,
+ "StatusCode" integer NOT NULL DEFAULT \(aq\-1\(aq,
+ CHECK ("Coding" IN
+ (\(aqDefault_No_Compression\(aq,\(aqUnicode_No_Compression\(aq,\(aq8bit\(aq,\(aqDefault_Compression\(aq,\(aqUnicode_Compression\(aq)),
+ CHECK ("DeliveryReport" IN (\(aqdefault\(aq,\(aqyes\(aq,\(aqno\(aq)),
+ CHECK ("Status" IN
+ (\(aqSendingOK\(aq,\(aqSendingOKNoReport\(aq,\(aqSendingError\(aq,\(aqDeliveryOK\(aq,\(aqDeliveryFailed\(aq,\(aqDeliveryPending\(aq,
+ \(aqDeliveryUnknown\(aq,\(aqError\(aq,\(aqReserved\(aq))
+);
+
+CREATE INDEX outbox_date ON outbox("SendingDateTime", "SendingTimeOut");
+CREATE INDEX outbox_sender ON outbox("SenderID");
+
+\-\-
+\-\- Dumping data for table "outbox"
+\-\-
+
+\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+\-\-
+\-\- Create trigger for table "outbox"
+\-\-
+
+CREATE TRIGGER update_timestamp BEFORE UPDATE ON outbox FOR EACH ROW EXECUTE PROCEDURE update_timestamp();
+
+\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+\-\-
+\-\- Table structure for table "outbox_multipart"
+\-\-
+
+CREATE TABLE outbox_multipart (
+ "Text" text,
+ "Coding" varchar(255) NOT NULL DEFAULT \(aqDefault_No_Compression\(aq,
+ "UDH" text,
+ "Class" integer DEFAULT \(aq\-1\(aq,
+ "TextDecoded" text DEFAULT NULL,
+ "ID" serial,
+ "SequencePosition" integer NOT NULL DEFAULT \(aq1\(aq,
+ "Status" varchar(255) NOT NULL DEFAULT \(aqReserved\(aq,
+ "StatusCode" integer NOT NULL DEFAULT \(aq\-1\(aq,
+ PRIMARY KEY ("ID", "SequencePosition"),
+ CHECK ("Coding" IN
+ (\(aqDefault_No_Compression\(aq,\(aqUnicode_No_Compression\(aq,\(aq8bit\(aq,\(aqDefault_Compression\(aq,\(aqUnicode_Compression\(aq)),
+ CHECK ("Status" IN
+ (\(aqSendingOK\(aq,\(aqSendingOKNoReport\(aq,\(aqSendingError\(aq,\(aqDeliveryOK\(aq,\(aqDeliveryFailed\(aq,\(aqDeliveryPending\(aq,
+ \(aqDeliveryUnknown\(aq,\(aqError\(aq,\(aqReserved\(aq))
+);
+
+\-\-
+\-\- Dumping data for table "outbox_multipart"
+\-\-
+
+
+\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+\-\-
+\-\- Table structure for table "phones"
+\-\-
+
+CREATE TABLE phones (
+ "ID" text NOT NULL,
+ "UpdatedInDB" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0),
+ "InsertIntoDB" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0),
+ "TimeOut" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0),
+ "Send" boolean NOT NULL DEFAULT \(aqno\(aq,
+ "Receive" boolean NOT NULL DEFAULT \(aqno\(aq,
+ "IMEI" varchar(35) PRIMARY KEY NOT NULL,
+ "IMSI" varchar(35) NOT NULL,
+ "NetCode" varchar(10) DEFAULT \(aqERROR\(aq,
+ "NetName" varchar(35) DEFAULT \(aqERROR\(aq,
+ "Client" text NOT NULL,
+ "Battery" integer NOT NULL DEFAULT \-1,
+ "Signal" integer NOT NULL DEFAULT \-1,
+ "Sent" integer NOT NULL DEFAULT 0,
+ "Received" integer NOT NULL DEFAULT 0
+);
+
+\-\-
+\-\- Dumping data for table "phones"
+\-\-
+
+\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+\-\-
+\-\- Create trigger for table "phones"
+\-\-
+
+CREATE TRIGGER update_timestamp BEFORE UPDATE ON phones FOR EACH ROW EXECUTE PROCEDURE update_timestamp();
+
+\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+\-\-
+\-\- Table structure for table "sentitems"
+\-\-
+
+CREATE TABLE sentitems (
+ "UpdatedInDB" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0),
+ "InsertIntoDB" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0),
+ "SendingDateTime" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0),
+ "DeliveryDateTime" timestamp(0) WITHOUT time zone NULL,
+ "Text" text NOT NULL,
+ "DestinationNumber" varchar(20) NOT NULL DEFAULT \(aq\(aq,
+ "Coding" varchar(255) NOT NULL DEFAULT \(aqDefault_No_Compression\(aq,
+ "UDH" text NOT NULL,
+ "SMSCNumber" varchar(20) NOT NULL DEFAULT \(aq\(aq,
+ "Class" integer NOT NULL DEFAULT \(aq\-1\(aq,
+ "TextDecoded" text NOT NULL DEFAULT \(aq\(aq,
+ "ID" serial,
+ "SenderID" varchar(255) NOT NULL,
+ "SequencePosition" integer NOT NULL DEFAULT \(aq1\(aq,
+ "Status" varchar(255) NOT NULL DEFAULT \(aqSendingOK\(aq,
+ "StatusError" integer NOT NULL DEFAULT \(aq\-1\(aq,
+ "TPMR" integer NOT NULL DEFAULT \(aq\-1\(aq,
+ "RelativeValidity" integer NOT NULL DEFAULT \(aq\-1\(aq,
+ "CreatorID" text NOT NULL,
+ "StatusCode" integer NOT NULL DEFAULT \(aq\-1\(aq,
+ CHECK ("Status" IN
+ (\(aqSendingOK\(aq,\(aqSendingOKNoReport\(aq,\(aqSendingError\(aq,\(aqDeliveryOK\(aq,\(aqDeliveryFailed\(aq,\(aqDeliveryPending\(aq,
+ \(aqDeliveryUnknown\(aq,\(aqError\(aq)),
+ CHECK ("Coding" IN
+ (\(aqDefault_No_Compression\(aq,\(aqUnicode_No_Compression\(aq,\(aq8bit\(aq,\(aqDefault_Compression\(aq,\(aqUnicode_Compression\(aq)),
+ PRIMARY KEY ("ID", "SequencePosition")
+);
+
+CREATE INDEX sentitems_date ON sentitems("DeliveryDateTime");
+CREATE INDEX sentitems_tpmr ON sentitems("TPMR");
+CREATE INDEX sentitems_dest ON sentitems("DestinationNumber");
+CREATE INDEX sentitems_sender ON sentitems("SenderID");
+
+\-\-
+\-\- Dumping data for table "sentitems"
+\-\-
+
+\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+\-\-
+\-\- Create trigger for table "sentitems"
+\-\-
+
+CREATE TRIGGER update_timestamp BEFORE UPDATE ON sentitems FOR EACH ROW EXECUTE PROCEDURE update_timestamp();
+
+
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+\fBNOTE:\fP
+.INDENT 0.0
+.INDENT 3.5
+You can find the script in \fBdocs/sql/pgsql.sql\fP as well.
+.UNINDENT
+.UNINDENT
+.SH UPGRADING TABLES
+.sp
+The easiest way to upgrade database structure is to backup old one and start
+with creating new one based on example above.
+.sp
+For upgrading existing database, you can use changes described in
+smsd\-tables\-history and then manually update \fBVersion\fP field in
+\fBgammu\fP table.
+.SH AUTHOR
+Michal ÄŒihaÅ™ <michal@cihar.com>
+.SH COPYRIGHT
+2009-2015, Michal ÄŒihaÅ™ <michal@cihar.com>
+.\" Generated by docutils manpage writer.
+.
diff --git a/docs/man/gammu-smsd-run.7 b/docs/man/gammu-smsd-run.7
new file mode 100644
index 0000000..b551468
--- /dev/null
+++ b/docs/man/gammu-smsd-run.7
@@ -0,0 +1,292 @@
+.\" Man page generated from reStructuredText.
+.
+.TH "GAMMU-SMSD-RUN" "7" "Oct 16, 2017" "1.38.5" "Gammu"
+.SH NAME
+gammu-smsd-run \- documentation for RunOnReceive directive
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH DESCRIPTION
+.sp
+Gammu SMSD can be configured by \fBRunOnReceive\fP directive (see
+gammu\-smsdrc for details) to run defined program after receiving
+every message. It can receive single message or more messages, which are parts
+of one multipart message.
+.sp
+This parameter is executed through shell, so you might need to escape some
+special characters and you can include any number of parameters. Additionally
+parameters with identifiers of received messages are appended to the command
+line. The identifiers depend on used service backend, typically it is ID of
+inserted row for database backends or file name for file based backends.
+.sp
+Gammu SMSD waits for the script to terminate. If you make some time consuming
+there, it will make SMSD not receive new messages. However to limit breakage
+from this situation, the waiting time is limited to two minutes. After this
+time SMSD will continue in normal operation and might execute your script
+again.
+.sp
+\fBNOTE:\fP
+.INDENT 0.0
+.INDENT 3.5
+All input and output file descriptors are closed when this program is
+invoked, so you have to ensure to open files on your own.
+.UNINDENT
+.UNINDENT
+.SH ENVIRONMENT
+.sp
+New in version 1.28.0.
+
+.sp
+Program is executed with environment which contains lot of information about
+the message. You can use it together with NULL service (see
+gammu\-smsd\-null) to implement completely own processing of messages.
+.SS Global variables
+.INDENT 0.0
+.TP
+.B SMS_MESSAGES
+Number of physical messages received.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B DECODED_PARTS
+Number of decoded message parts.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B PHONE_ID
+New in version 1.38.2.
+
+.sp
+Value of \fBPhoneID\fP\&. Useful when running multiple instances
+(see smsd\-multi).
+.UNINDENT
+.SS Per message variables
+.sp
+The variables further described as \fBSMS_1_...\fP are generated for each physical
+message, where 1 is replaced by current number of message.
+.INDENT 0.0
+.TP
+.B SMS_1_CLASS
+Class of message.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B SMS_1_NUMBER
+Sender number.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B SMS_1_TEXT
+Message text. Text is not available for 8\-bit binary messages.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B SMS_1_REFERENCE
+New in version 1.38.5.
+
+.sp
+Message Reference. If delivery status received, this variable contains TPMR of original message
+.UNINDENT
+.SS Per part variables
+.sp
+The variables further described as \fBDECODED_1_...\fP are generated for each message
+part, where 1 is replaced by current number of part. Set are only those
+variables whose content is present in the message.
+.INDENT 0.0
+.TP
+.B DECODED_1_TEXT
+Decoded long message text.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B DECODED_1_MMS_SENDER
+Sender of MMS indication message.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B DECODED_1_MMS_TITLE
+title of MMS indication message.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B DECODED_1_MMS_ADDRESS
+Address (URL) of MMS from MMS indication message.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B DECODED_1_MMS_SIZE
+Size of MMS as specified in MMS indication message.
+.UNINDENT
+.SH EXAMPLES
+.SS Activating RunOnReceive
+.sp
+To activate this feature you need to set \fBRunOnReceive\fP in
+the gammu\-smsdrc\&.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[smsd]
+RunOnReceive = /path/to/script.sh
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Processing messages from the files backend
+.sp
+Following script (if used as \fBRunOnReceive\fP handler) passes
+message data to other program. This works only with the gammu\-smsd\-files\&.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+#!/bin/sh
+INBOX=/path/to/smsd/inbox
+PROGRAM=/bin/cat
+for ID in "$@" ; do
+ $PROGRAM < $INBOX/$ID
+done
+
+
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Invoking commands based on message text
+.sp
+Following script (if used as \fBRunOnReceive\fP handler) executes
+given programs based on message text.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+#!/bin/sh
+
+# Check for sender number
+if [ "$SMS_1_NUMBER" != "+420123456789" ] ; then
+ exit
+fi
+
+# Handle commands
+case "$SMS_1_TEXT" in
+ "DMS A")
+ /usr/bin/dms\-a
+ ;;
+ "DMS B")
+ /usr/bin/dms\-b
+ ;;
+esac
+
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Passing message text to program
+.sp
+Following script (if used as \fBRunOnReceive\fP handler) passes
+message text and sender to external program.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+#!/bin/sh
+PROGRAM=/bin/echo
+for i in \(gaseq $SMS_MESSAGES\(ga ; do
+ eval "$PROGRAM \e"\e${SMS_${i}_NUMBER}\e" \e"\e${SMS_${i}_TEXT}\e""
+done
+
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Passing MMS indication parameters to external program
+.sp
+Following script (if used as \fBRunOnReceive\fP handler) will write
+information about each received MMS indication to the log file. Just replace
+echo command with your own program to do custom processing.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+#!/bin/sh
+if [ $DECODED_PARTS \-eq 0 ] ; then
+ # No decoded parts, nothing to process
+ exit
+fi
+if [ "$DECODED_1_MMS_ADDRESS" ] ; then
+ echo "$DECODED_1_MMS_ADDRESS" "$DECODED_1_MMS_SENDER" "$DECODED_1_MMS_TITLE" >> /tmp/smsd\-mms.log
+fi
+
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Processing message text in Python
+.sp
+Following script (if used as \fBRunOnReceive\fP handler) written
+in Python will concatenate all text from received message:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+#!/usr/bin/env python
+from __future__ import print_function
+import os
+import sys
+
+numparts = int(os.environ[\(aqDECODED_PARTS\(aq])
+
+text = \(aq\(aq
+# Are there any decoded parts?
+if numparts == 0:
+ text = os.environ[\(aqSMS_1_TEXT\(aq]
+# Get all text parts
+else:
+ for i in range(0, numparts):
+ varname = \(aqDECODED_%d_TEXT\(aq % i
+ if varname in os.environ:
+ text = text + os.environ[varname]
+
+# Do something with the text
+print(\(aqNumber %s have sent text: %s\(aq % (os.environ[\(aqSMS_1_NUMBER\(aq], text))
+
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH AUTHOR
+Michal ÄŒihaÅ™ <michal@cihar.com>
+.SH COPYRIGHT
+2009-2015, Michal ÄŒihaÅ™ <michal@cihar.com>
+.\" Generated by docutils manpage writer.
+.
diff --git a/docs/man/gammu-smsd-sql.7 b/docs/man/gammu-smsd-sql.7
new file mode 100644
index 0000000..5add4f0
--- /dev/null
+++ b/docs/man/gammu-smsd-sql.7
@@ -0,0 +1,724 @@
+.\" Man page generated from reStructuredText.
+.
+.TH "GAMMU-SMSD-SQL" "7" "Oct 16, 2017" "1.38.5" "Gammu"
+.SH NAME
+gammu-smsd-sql \- gammu-smsd(1) backend using SQL abstraction layer to use any supported database as a message storage
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH DESCRIPTION
+.sp
+SQL service stores all its data in database. It can use one of these SQL backends
+(configuration option \fBDriver\fP in smsd section):
+.INDENT 0.0
+.IP \(bu 2
+\fBnative_mysql\fP for gammu\-smsd\-mysql
+.IP \(bu 2
+\fBnative_pgsql\fP for gammu\-smsd\-pgsql
+.IP \(bu 2
+\fBodbc\fP for gammu\-smsd\-odbc
+.IP \(bu 2
+.INDENT 2.0
+.TP
+.B drivers supported by DBI for gammu\-smsd\-dbi, which include:
+.INDENT 7.0
+.IP \(bu 2
+\fBsqlite3\fP \- for SQLite 3
+.IP \(bu 2
+\fBmysql\fP \- for MySQL
+.IP \(bu 2
+\fBpgsql\fP \- for PostgeSQL
+.IP \(bu 2
+\fBfreetds\fP \- for MS SQL Server or Sybase
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.SH SQL CONNECTION PARAMETERS
+.sp
+Common for all backends:
+.INDENT 0.0
+.IP \(bu 2
+\fBUser\fP \- user connecting to database
+.IP \(bu 2
+\fBPassword\fP \- password for connecting to database
+.IP \(bu 2
+\fBHost\fP \- database host or data source name
+.IP \(bu 2
+\fBDatabase\fP \- database name
+.IP \(bu 2
+\fBDriver\fP \- \fBnative_mysql\fP, \fBnative_pgsql\fP, \fBodbc\fP or DBI one
+.IP \(bu 2
+\fBSQL\fP \- SQL dialect to use
+.UNINDENT
+.sp
+Specific for DBI:
+.INDENT 0.0
+.IP \(bu 2
+\fBDriversPath\fP \- path to DBI drivers
+.IP \(bu 2
+\fBDBDir\fP \- sqlite/sqlite3 directory with database
+.UNINDENT
+.sp
+\fBSEE ALSO:\fP
+.INDENT 0.0
+.INDENT 3.5
+The variables are fully described in gammurc documentation.
+.UNINDENT
+.UNINDENT
+.SH TABLES
+.sp
+New in version 1.37.1.
+
+.sp
+You can customize name of all tables in the \fB[tables]\fP\&. The SQL
+queries will reflect this, so it’s enough to change table name in this section.
+.INDENT 0.0
+.TP
+.B gammu
+Name of the gammu\-table table.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B inbox
+Name of the inbox table.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B sentitems
+Name of the sentitems table.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B outbox
+Name of the outbox table.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B outbox_multipart
+Name of the outbox_multipart table.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B phones
+Name of the phones table.
+.UNINDENT
+.sp
+You can change any table name using these:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[tables]
+inbox = special_inbox
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH SQL QUERIES
+.sp
+Almost all queries are configurable. You can edit them in
+\fB[sql]\fP section. There are several variables used in SQL
+queries. We can separate them into three groups:
+.INDENT 0.0
+.IP \(bu 2
+phone specific, which can be used in every query, see \fI\%Phone Specific Parameters\fP
+.IP \(bu 2
+SMS specific, which can be used in queries which works with SMS messages, see \fI\%SMS Specific Parameters\fP
+.IP \(bu 2
+query specific, which are numeric and are specific only for given query (or set of queries), see \fI\%Configurable queries\fP
+.UNINDENT
+.SS Phone Specific Parameters
+.INDENT 0.0
+.TP
+.B \fB%I\fP
+IMEI of phone
+.TP
+.B \fB%S\fP
+SIM IMSI
+.TP
+.B \fB%P\fP
+PHONE ID (hostname)
+.TP
+.B \fB%N\fP
+client name (eg. Gammu 1.12.3)
+.TP
+.B \fB%O\fP
+network code
+.TP
+.B \fB%M\fP
+network name
+.UNINDENT
+.SS SMS Specific Parameters
+.INDENT 0.0
+.TP
+.B \fB%R\fP
+remote number [1]
+.TP
+.B \fB%C\fP
+delivery datetime
+.TP
+.B \fB%e\fP
+delivery status on receiving or status error on sending
+.TP
+.B \fB%t\fP
+message reference
+.TP
+.B \fB%d\fP
+receiving datetime for received sms
+.TP
+.B \fB%E\fP
+encoded text of SMS
+.TP
+.B \fB%c\fP
+SMS coding (ie 8bit or UnicodeNoCompression)
+.TP
+.B \fB%F\fP
+sms centre number
+.TP
+.B \fB%u\fP
+UDH header
+.TP
+.B \fB%x\fP
+class
+.TP
+.B \fB%T\fP
+decoded SMS text
+.TP
+.B \fB%A\fP
+CreatorID of SMS (sending sms)
+.TP
+.B \fB%V\fP
+relative validity
+.UNINDENT
+.IP [1] 5
+Sender number for received messages (insert to inbox or delivery notifications), destination otherwise.
+.SH CONFIGURABLE QUERIES
+.sp
+All configurable queries can be set in \fB[sql]\fP section. Sequence of rows in selects are mandatory.
+.sp
+All default queries noted here are noted for MySQL. Actual time and time addition
+are selected for default queries during initialization.
+.INDENT 0.0
+.TP
+.B delete_phone
+Deletes phone from database.
+.sp
+Default value:
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+DELETE FROM phones WHERE IMEI = %I
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B insert_phone
+Inserts phone to database.
+.sp
+Default value:
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+INSERT INTO phones (IMEI, ID, Send, Receive, InsertIntoDB, TimeOut, Client, Battery, Signal)
+VALUES (%I, %P, %1, %2, NOW(), (NOW() + INTERVAL 10 SECOND) + 0, %N, \-1, \-1)
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Query specific parameters:
+.INDENT 7.0
+.TP
+.B \fB%1\fP
+enable send (yes or no) \- configuration option Send
+.TP
+.B \fB%2\fP
+enable receive (yes or no) \- configuration option Receive
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B save_inbox_sms_select
+Select message for update delivery status.
+.sp
+Default value:
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+SELECT ID, Status, SendingDateTime, DeliveryDateTime, SMSCNumber FROM sentitems
+WHERE DeliveryDateTime IS NULL AND SenderID = %P AND TPMR = %t AND DestinationNumber = %R
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B save_inbox_sms_update_delivered
+Update message delivery status if message was delivered.
+.sp
+Default value:
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+UPDATE sentitems SET DeliveryDateTime = %C, Status = %1, StatusError = %e WHERE ID = %2 AND TPMR = %t
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Query specific parameters:
+.INDENT 7.0
+.TP
+.B \fB%1\fP
+delivery status returned by GSM network
+.TP
+.B \fB%2\fP
+ID of message
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B save_inbox_sms_update
+Update message if there is an delivery error.
+.sp
+Default value:
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+UPDATE sentitems SET Status = %1, StatusError = %e WHERE ID = %2 AND TPMR = %t
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Query specific parameters:
+.INDENT 7.0
+.TP
+.B \fB%1\fP
+delivery status returned by GSM network
+.TP
+.B \fB%2\fP
+ID of message
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B save_inbox_sms_insert
+Insert received message.
+.sp
+Default value:
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+INSERT INTO inbox (ReceivingDateTime, Text, SenderNumber, Coding, SMSCNumber, UDH,
+Class, TextDecoded, RecipientID) VALUES (%d, %E, %R, %c, %F, %u, %x, %T, %P)
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B update_received
+Update statistics after receiving message.
+.sp
+Default value:
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+UPDATE phones SET Received = Received + 1 WHERE IMEI = %I
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B refresh_send_status
+Update messages in outbox.
+.sp
+Default value:
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+UPDATE outbox SET SendingTimeOut = (NOW() + INTERVAL 60 SECOND) + 0
+WHERE ID = %1 AND (SendingTimeOut < NOW() OR SendingTimeOut IS NULL)
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+The default query calculates sending timeout based on \fBLoopSleep\fP
+value.
+.sp
+Query specific parameters:
+.INDENT 7.0
+.TP
+.B \fB%1\fP
+ID of message
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B find_outbox_sms_id
+Find sms messages for sending.
+.sp
+Default value:
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+SELECT ID, InsertIntoDB, SendingDateTime, SenderID FROM outbox
+WHERE SendingDateTime < NOW() AND SendingTimeOut < NOW() AND
+SendBefore >= CURTIME() AND SendAfter <= CURTIME() AND
+( SenderID is NULL OR SenderID = \(aq\(aq OR SenderID = %P ) ORDER BY InsertIntoDB ASC LIMIT %1
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Query specific parameters:
+.INDENT 7.0
+.TP
+.B \fB%1\fP
+limit of sms messages sended in one walk in loop
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B find_outbox_body
+Select body of message.
+.sp
+Default value:
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+SELECT Text, Coding, UDH, Class, TextDecoded, ID, DestinationNumber, MultiPart,
+RelativeValidity, DeliveryReport, CreatorID FROM outbox WHERE ID=%1
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Query specific parameters:
+.INDENT 7.0
+.TP
+.B \fB%1\fP
+ID of message
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B find_outbox_multipart
+Select remaining parts of sms message.
+.sp
+Default value:
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+SELECT Text, Coding, UDH, Class, TextDecoded, ID, SequencePosition
+FROM outbox_multipart WHERE ID=%1 AND SequencePosition=%2
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Query specific parameters:
+.INDENT 7.0
+.TP
+.B \fB%1\fP
+ID of message
+.TP
+.B \fB%2\fP
+Number of multipart message
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B delete_outbox
+Remove messages from outbox after threir successful send.
+.sp
+Default value:
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+DELETE FROM outbox WHERE ID=%1
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Query specific parameters:
+.INDENT 7.0
+.TP
+.B \fB%1\fP
+ID of message
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B delete_outbox_multipart
+Remove messages from outbox_multipart after threir successful send.
+.sp
+Default value:
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+DELETE FROM outbox_multipart WHERE ID=%1
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Query specific parameters:
+.INDENT 7.0
+.TP
+.B \fB%1\fP
+ID of message
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B create_outbox
+Create message (insert to outbox).
+.sp
+Default value:
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+INSERT INTO outbox (CreatorID, SenderID, DeliveryReport, MultiPart,
+InsertIntoDB, Text, DestinationNumber, RelativeValidity, Coding, UDH, Class,
+TextDecoded) VALUES (%1, %P, %2, %3, NOW(), %E, %R, %V, %c, %u, %x, %T)
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Query specific parameters:
+.INDENT 7.0
+.TP
+.B \fB%1\fP
+creator of message
+.TP
+.B \fB%2\fP
+delivery status report \- yes/default
+.TP
+.B \fB%3\fP
+multipart \- FALSE/TRUE
+.TP
+.B \fB%4\fP
+Part (part number)
+.TP
+.B \fB%5\fP
+ID of message
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B create_outbox_multipart
+Create message remaining parts.
+.sp
+Default value:
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+INSERT INTO outbox_multipart (SequencePosition, Text, Coding, UDH, Class,
+TextDecoded, ID) VALUES (%4, %E, %c, %u, %x, %T, %5)
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Query specific parameters:
+.INDENT 7.0
+.TP
+.B \fB%1\fP
+creator of message
+.TP
+.B \fB%2\fP
+delivery status report \- yes/default
+.TP
+.B \fB%3\fP
+multipart \- FALSE/TRUE
+.TP
+.B \fB%4\fP
+Part (part number)
+.TP
+.B \fB%5\fP
+ID of message
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B add_sent_info
+Insert to sentitems.
+.sp
+Default value:
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+INSERT INTO sentitems (CreatorID,ID,SequencePosition,Status,SendingDateTime,
+SMSCNumber, TPMR, SenderID,Text,DestinationNumber,Coding,UDH,Class,TextDecoded,
+InsertIntoDB,RelativeValidity)
+VALUES (%A, %1, %2, %3, NOW(), %F, %4, %P, %E, %R, %c, %u, %x, %T, %5, %V)
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Query specific parameters:
+.INDENT 7.0
+.TP
+.B \fB%1\fP
+ID of sms message
+.TP
+.B \fB%2\fP
+part number (for multipart sms)
+.TP
+.B \fB%3\fP
+message state (SendingError, Error, SendingOK, SendingOKNoReport)
+.TP
+.B \fB%4\fP
+message reference (TPMR)
+.TP
+.B \fB%5\fP
+time when inserted in db
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B update_sent
+Update sent statistics after sending message.
+.sp
+Default value:
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+UPDATE phones SET Sent= Sent + 1 WHERE IMEI = %I
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B refresh_phone_status
+Update phone status (battery, signal).
+.sp
+Default value:
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+UPDATE phones SET TimeOut= (NOW() + INTERVAL 10 SECOND) + 0,
+Battery = %1, Signal = %2 WHERE IMEI = %I
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Query specific parameters:
+.INDENT 7.0
+.TP
+.B \fB%1\fP
+battery percent
+.TP
+.B \fB%2\fP
+signal percent
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B update_retries
+Update number of retries for outbox message.
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+UPDATE outbox SET SendngTimeOut = (NOW() + INTERVAL 600 SECOND) + 0,
+Retries = %2 WHERE ID = %1
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Query specific parameters:
+.INDENT 7.0
+.TP
+.B \fB%1\fP
+message ID
+.TP
+.B \fB%2\fP
+number of retries
+.UNINDENT
+.UNINDENT
+.SH AUTHOR
+Michal ÄŒihaÅ™ <michal@cihar.com>
+.SH COPYRIGHT
+2009-2015, Michal ÄŒihaÅ™ <michal@cihar.com>
+.\" Generated by docutils manpage writer.
+.
diff --git a/docs/man/gammu-smsd-tables.7 b/docs/man/gammu-smsd-tables.7
new file mode 100644
index 0000000..fa586b4
--- /dev/null
+++ b/docs/man/gammu-smsd-tables.7
@@ -0,0 +1,759 @@
+.\" Man page generated from reStructuredText.
+.
+.TH "GAMMU-SMSD-TABLES" "7" "Oct 16, 2017" "1.38.5" "Gammu"
+.SH NAME
+gammu-smsd-tables \- description of tables for database backends of gammu-smsd(1)
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.sp
+The backends themselves are described in their sections, this document
+describes general database structure and required tables.
+.sp
+More SMS daemons can share single database. If you do not specify PhoneID in
+their configuration, all are treated equally and you have no guarantee which
+one sends outgoing message. If you configure PhoneID and use it when inserting
+message to the \fBoutbox\fP table (gammu\-smsd\-inject does this), each SMS
+daemon will have separate outbox queue. See also smsd\-multi\&.
+.SH RECEIVING OF MESSAGES
+.sp
+Received messages are stored in \fI\%inbox\fP table.
+.SH TRANSMITTING OF MESSAGES
+.sp
+Transmitted messages are read from table \fI\%outbox\fP and possible subsequent parts
+of the same message from \fI\%outbox_multipart\fP\&.
+.SH DESCRIPTION OF TABLES
+.SS gammu
+.sp
+Table holding single field \fBVersion\fP \- version of a database schema. See
+\fI\%History of database structure\fP for details what has changed.
+.SS inbox
+.sp
+Table where received messages will be stored.
+.sp
+Fields description:
+.INDENT 0.0
+.TP
+.B \fBUpdatedInDB\fP (timestamp)
+when somebody (daemon, user, etc.) updated it
+.TP
+.B \fBReceivingDateTime\fP (timestamp)
+when SMS was received
+.TP
+.B \fBText\fP (text)
+encoded SMS text (for all SMS)
+.TP
+.B \fBSenderNumber\fP (varchar(20))
+decoded SMS sender number
+.TP
+.B \fBCoding\fP (enum(‘Default_No_Compression’, ‘Unicode_No_Compression’, ‘8bit’, ‘Default_Compression’, ‘Unicode_Compression’))
+SMS text coding
+.TP
+.B \fBUDH\fP (text)
+encoded User Data Header text
+.TP
+.B \fBSMSCNumber\fP (varchar(20))
+decoded SMSC number
+.TP
+.B \fBClass\fP (integer)
+SMS class or \-1 (0 is flash SMS, 1 is normal one, 127 is USSD)
+.TP
+.B \fBTextDecoded\fP (varchar(160))
+decoded SMS text (for Default Alphabet/Unicode SMS)
+.TP
+.B \fBID\fP (integer unsigned)
+SMS identificator (for using with external applications)
+.TP
+.B \fBRecipientID\fP (text)
+which Gammu daemon has added it
+.TP
+.B \fBProcessed\fP (enum(‘false’, ‘true’))
+you can use for marking, whether SMS was processed or not
+.TP
+.B \fBStatus\fP (integer)
+Status of incoming message. Currently only used for
+\fBClass\fP 127 (USSD) messages with following meaning:
+.INDENT 7.0
+.TP
+.B \fB1\fP
+Unknown status.
+.TP
+.B \fB2\fP
+No action is needed, maybe network initiated USSD.
+.TP
+.B \fB3\fP
+Reply is expected.
+.TP
+.B \fB4\fP
+USSD dialog terminated.
+.TP
+.B \fB5\fP
+Another client replied.
+.TP
+.B \fB6\fP
+Operation not supported.
+.TP
+.B \fB7\fP
+Network timeout.
+.UNINDENT
+.sp
+New in version 1.38.5.
+
+.UNINDENT
+.SS outbox
+.sp
+Messages enqueued for sending should be placed in this table. If message
+is multipart, subsequent parts are stored in table \fI\%outbox_multipart\fP\&.
+.sp
+Fields description:
+.INDENT 0.0
+.TP
+.B \fBUpdatedInDB\fP (timestamp)
+when somebody (daemon, user, etc.) updated it
+.TP
+.B \fBInsertIntoDB\fP (timestamp)
+when message was inserted into database
+.TP
+.B \fBSendingDateTime\fP (timestamp)
+set it to some value, when want to force sending after some planned time
+.TP
+.B \fBSendBefore\fP (time)
+Send message before specified time, can be used to limit messages from
+being sent in night. Default value is 23:59:59
+.sp
+New in version 1.29.90.
+
+.TP
+.B \fBSendAfter\fP (time)
+Send message after specified time, can be used to limit messages from
+being sent in night. Default value is 00:00:00
+.sp
+New in version 1.29.90.
+
+.TP
+.B \fBText\fP (text)
+SMS text encoded using hex values in proper coding. If you want to use
+TextDecoded field, keep this NULL (or empty).
+.TP
+.B \fBDestinationNumber\fP (varchar(20))
+recipient number
+.TP
+.B \fBCoding\fP (enum(‘Default_No_Compression’, ‘Unicode_No_Compression’, ‘8bit’, ‘Default_Compression’, ‘Unicode_Compression’))
+SMS text coding
+.TP
+.B \fBUDH\fP (text)
+User Data Header encoded using hex values which will be used for constructing
+the message. Without this, message will be sent as plain text.
+.TP
+.B \fBClass\fP (integer)
+SMS class or \-1 (0 is normal SMS, 1 is flash one, 127 is USSD)
+.TP
+.B \fBTextDecoded\fP (varchar(160))
+SMS text in “human readable†form
+.TP
+.B \fBID\fP (integer unsigned)
+SMS/SMS sequence ID
+.sp
+Please note that this number has to be unique also for sentitems table, so
+reusing message IDs might not be a good idea.
+.TP
+.B \fBMultiPart\fP (enum(‘false’,’true’))
+info, whether there are more SMS from this sequence in outbox_multipart
+.TP
+.B \fBRelativeValidity\fP (integer)
+SMS relative validity like encoded using GSM specs
+.TP
+.B \fBSenderID\fP (text)
+which SMSD instance should send this one sequence, see
+\fBPhoneID\fP and smsd\-multi\&. If blank, first SMSD who
+sees this message first will process it.
+.TP
+.B \fBSendingTimeOut\fP (timestamp)
+used by SMSD instance for own targets
+.TP
+.B \fBDeliveryReport\fP (enum(‘default’,’yes’,’no’))
+when default is used, Delivery Report is used or not according to SMSD instance settings; yes forces Delivery Report.
+.TP
+.B \fBCreatorID\fP (text)
+identification of program created the message
+.TP
+.B \fBRetries\fP (integer)
+number of attempted retries when sending this message
+.TP
+.B \fBPriority\fP (integer)
+priority of message, messages with higher priority are processed first
+.TP
+.B \fBStatus\fP (enum(‘SendingOK’, ‘SendingOKNoReport’, ‘SendingError’, ‘DeliveryOK’, ‘DeliveryFailed’, ‘DeliveryPending’, ‘DeliveryUnknown’, ‘Error’, ‘Reserved’))
+Status of message sending. SendingError means that phone failed to send the
+message, Error indicates some other error while processing message.
+.INDENT 7.0
+.TP
+.B \fBSendingOK\fP
+Message has been sent, waiting for delivery report.
+.TP
+.B \fBSendingOKNoReport\fP
+Message has been sent without asking for delivery report.
+.TP
+.B \fBSendingError\fP
+Sending has failed.
+.TP
+.B \fBDeliveryOK\fP
+Delivery report arrived and reported success.
+.TP
+.B \fBDeliveryFailed\fP
+Delivery report arrived and reports failure.
+.TP
+.B \fBDeliveryPending\fP
+Delivery report announced pending deliver.
+.TP
+.B \fBDeliveryUnknown\fP
+Delivery report reported unknown status.
+.TP
+.B \fBError\fP
+Some other error happened during sending (usually bug in SMSD).
+.TP
+.B \fBReserved\fP
+Initial value, meaning the status has not been set.
+.UNINDENT
+.sp
+New in version 1.38.5.
+
+.TP
+.B \fBStatusCode\fP (integer)
+GSM status code
+.sp
+New in version 1.38.5.
+
+.UNINDENT
+.SS outbox_multipart
+.sp
+Data for outgoing multipart messages.
+.sp
+Fields description:
+.INDENT 0.0
+.TP
+.B \fBID\fP (integer unsigned)
+the same meaning as values in outbox table
+.TP
+.B \fBText\fP (text)
+the same meaning as values in outbox table
+.TP
+.B \fBCoding\fP (enum(‘Default_No_Compression’, ‘Unicode_No_Compression’, ‘8bit’, ‘Default_Compression’, ‘Unicode_Compression’))
+the same meaning as values in outbox table
+.TP
+.B \fBUDH\fP (text)
+the same meaning as values in outbox table
+.TP
+.B \fBClass\fP (integer)
+the same meaning as values in outbox table
+.TP
+.B \fBTextDecoded\fP (varchar(160))
+the same meaning as values in outbox table
+.TP
+.B \fBID\fP (integer unsigned)
+the same meaning as values in outbox table
+.TP
+.B \fBSequencePosition\fP (integer)
+info, what is SMS number in SMS sequence (start at 2, first part is in \fI\%outbox\fP
+table).
+.TP
+.B \fBStatus\fP (enum(‘SendingOK’, ‘SendingOKNoReport’, ‘SendingError’, ‘DeliveryOK’, ‘DeliveryFailed’, ‘DeliveryPending’, ‘DeliveryUnknown’, ‘Error’, ‘Reserved’))
+Status of message sending. SendingError means that phone failed to send the
+message, Error indicates some other error while processing message.
+.INDENT 7.0
+.TP
+.B \fBSendingOK\fP
+Message has been sent, waiting for delivery report.
+.TP
+.B \fBSendingOKNoReport\fP
+Message has been sent without asking for delivery report.
+.TP
+.B \fBSendingError\fP
+Sending has failed.
+.TP
+.B \fBDeliveryOK\fP
+Delivery report arrived and reported success.
+.TP
+.B \fBDeliveryFailed\fP
+Delivery report arrived and reports failure.
+.TP
+.B \fBDeliveryPending\fP
+Delivery report announced pending deliver.
+.TP
+.B \fBDeliveryUnknown\fP
+Delivery report reported unknown status.
+.TP
+.B \fBError\fP
+Some other error happened during sending (usually bug in SMSD).
+.TP
+.B \fBReserved\fP
+Initial value, meaning the status has not been set.
+.UNINDENT
+.sp
+New in version 1.38.5.
+
+.TP
+.B \fBStatusCode\fP (integer)
+GSM status code
+.sp
+New in version 1.38.5.
+
+.UNINDENT
+.SS phones
+.sp
+Information about connected phones. This table is periodically refreshed and
+you can get information such as battery or signal level from here.
+.sp
+Fields description:
+.INDENT 0.0
+.TP
+.B \fBID\fP (text)
+PhoneID value
+.TP
+.B \fBUpdatedInDB\fP (timestamp)
+when this record has been updated
+.TP
+.B \fBInsertIntoDB\fP (timestamp)
+when this record has been created (when phone has been connected)
+.TP
+.B \fBTimeOut\fP (timestamp)
+when this record expires
+.TP
+.B \fBSend\fP (boolean)
+indicates whether SMSD is sending messages, depends on configuration directive \fBSend\fP
+.TP
+.B \fBReceive\fP (boolean)
+indicates whether SMSD is receiving messages, depends on configuration directive \fBReceive\fP
+.TP
+.B \fBIMEI\fP (text)
+IMEI of phone
+.TP
+.B \fBIMSI\fP (text)
+SIM IMSI
+.TP
+.B \fBClient\fP (text)
+client name, usually string Gammu with version
+.TP
+.B \fBBattery\fP (integer)
+battery level in percent (or \-1 if unknown)
+.TP
+.B \fBSignal\fP (integer)
+signal level in percent (or \-1 if unknown)
+.TP
+.B \fBSent\fP (integer)
+Number of sent SMS messages (SMSD does not reset this counter, so it might
+overflow).
+.TP
+.B \fBReceived\fP (integer)
+Number of received SMS messages (SMSD does not reset this counter, so it might
+overflow).
+.UNINDENT
+.SS sentitems
+.sp
+Log of sent messages (and unsent ones with error code). Also if delivery
+reports are enabled, message state is updated after receiving delivery report.
+.sp
+Fields description:
+.INDENT 0.0
+.TP
+.B \fBUpdatedInDB\fP (timestamp)
+when somebody (daemon, user, etc.) updated it
+.TP
+.B \fBInsertIntoDB\fP (timestamp)
+when message was inserted into database
+.TP
+.B \fBSendingDateTime\fP (timestamp)
+when message has been sent
+.TP
+.B \fBDeliveryDateTime\fP (timestamp)
+Time of receiving delivery report (if it has been enabled).
+.TP
+.B \fBStatus\fP (enum(‘SendingOK’, ‘SendingOKNoReport’, ‘SendingError’, ‘DeliveryOK’, ‘DeliveryFailed’, ‘DeliveryPending’, ‘DeliveryUnknown’, ‘Error’))
+Status of message sending. SendingError means that phone failed to send the
+message, Error indicates some other error while processing message.
+.INDENT 7.0
+.TP
+.B \fBSendingOK\fP
+Message has been sent, waiting for delivery report.
+.TP
+.B \fBSendingOKNoReport\fP
+Message has been sent without asking for delivery report.
+.TP
+.B \fBSendingError\fP
+Sending has failed.
+.TP
+.B \fBDeliveryOK\fP
+Delivery report arrived and reported success.
+.TP
+.B \fBDeliveryFailed\fP
+Delivery report arrived and reports failure.
+.TP
+.B \fBDeliveryPending\fP
+Delivery report announced pending deliver.
+.TP
+.B \fBDeliveryUnknown\fP
+Delivery report reported unknown status.
+.TP
+.B \fBError\fP
+Some other error happened during sending (usually bug in SMSD).
+.UNINDENT
+.TP
+.B \fBStatusError\fP (integer)
+Status of delivery from delivery report message, codes are defined in GSM
+specification 03.40 section 9.2.3.15 (TP\-Status).
+.TP
+.B \fBText\fP (text)
+SMS text encoded using hex values
+.TP
+.B \fBDestinationNumber\fP (varchar(20))
+decoded destination number for SMS
+.TP
+.B \fBCoding\fP (enum(‘Default_No_Compression’, ‘Unicode_No_Compression’, ‘8bit’, ‘Default_Compression’, ‘Unicode_Compression’))
+SMS text coding
+.TP
+.B \fBUDH\fP (text)
+User Data Header encoded using hex values
+.TP
+.B \fBSMSCNumber\fP (varchar(20))
+decoded number of SMSC, which sent SMS
+.TP
+.B \fBClass\fP (integer)
+SMS class or \-1 (0 is normal SMS, 1 is flash one, 127 is USSD)
+.TP
+.B \fBTextDecoded\fP (varchar(160))
+SMS text in “human readable†form
+.TP
+.B \fBID\fP (integer unsigned)
+SMS ID
+.TP
+.B \fBSenderID\fP (text)
+which SMSD instance sent this one sequence, see \fBPhoneID\fP
+.TP
+.B \fBSequencePosition\fP (integer)
+SMS number in SMS sequence
+.TP
+.B \fBTPMR\fP (integer)
+Message Reference like in GSM specs
+.TP
+.B \fBRelativeValidity\fP (integer)
+SMS relative validity like encoded using GSM specs
+.TP
+.B \fBCreatorID\fP (text)
+copied from CreatorID from outbox table
+.TP
+.B \fBStatusCode\fP (integer)
+GSM status code
+.sp
+New in version 1.38.5.
+
+.UNINDENT
+.SH HISTORY OF DATABASE STRUCTURE
+.sp
+\fBNOTE:\fP
+.INDENT 0.0
+.INDENT 3.5
+Testing versions (see versioning) do not have to keep same table
+structure as final releases. Below mentioned versions are for
+informational purposes only, you should always use stable versions in
+production environment.
+.UNINDENT
+.UNINDENT
+.sp
+History of schema versions:
+.sp
+17
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP \(bu 2
+Added \fBStatus\fP field to \fI\%outbox\fP and \fI\%outbox_multipart\fP\&.
+.IP \(bu 2
+Added \fBStatusCode\fP field to \fI\%sentitems\fP, \fI\%outbox\fP and \fI\%outbox_multipart\fP\&.
+.IP \(bu 2
+Added \fBStatus\fP field to \fI\%inbox\fP\&.
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.sp
+Changed in version 1.38.5.
+
+.UNINDENT
+.UNINDENT
+.sp
+16
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP \(bu 2
+Removed unused \fBdaemons\fP, \fBpbk\fP and \fBpbk_groups\fP tables.
+.IP \(bu 2
+Added primary key to the \fBgammu\fP table.
+.IP \(bu 2
+Added \fBPriority\fP field to the \fI\%outbox\fP\&.
+.IP \(bu 2
+Added \fBIMSI\fP field to the \fI\%phones\fP\&.
+.UNINDENT
+.sp
+Changed in version 1.37.90.
+
+.UNINDENT
+.UNINDENT
+.sp
+15
+.INDENT 0.0
+.INDENT 3.5
+Added \fBRetries\fP field to the \fI\%outbox\fP\&.
+.sp
+Changed in version 1.36.7.
+
+.UNINDENT
+.UNINDENT
+.sp
+14
+.INDENT 0.0
+.INDENT 3.5
+Added \fBNetCode\fP and \fBNetName\fP fields.
+.sp
+Changed in version 1.34.0.
+
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B 13
+Added \fBSendBefore\fP and \fBSendAfter\fP fields.
+.sp
+Changed in version 1.29.90.
+
+.sp
+Also PostgreSQL fields are now case sensitive (same as other backends).
+.sp
+Changed in version 1.29.93.
+
+.TP
+.B 12
+the changes only affect MySQL structure changing default values for
+timestamps from \fB0000\-00\-00 00:00:00\fP to \fBCURRENT_TIMESTAMP()\fP by
+using triggers, to update to this version, just execute triggers
+definition at the end of SQL file.
+.sp
+Changed in version 1.28.94.
+
+.TP
+.B 11
+all fields for storing message text are no longer limited to 160 chars,
+but are arbitrary length text fields.
+.sp
+Changed in version 1.25.92.
+
+.TP
+.B 10
+\fBDeliveryDateTime\fP is now NULL when message is not delivered, added several
+indexes
+.sp
+Changed in version 1.22.95.
+
+.TP
+.B 9
+added sent/received counters to phones table
+.sp
+Changed in version 1.22.93.
+
+.TP
+.B 8
+Signal and battery state are now stored in database.
+.sp
+Changed in version 1.20.94.
+
+.TP
+.B 7
+Added \fBCreatorID\fP to several tables.
+.sp
+Changed in version 1.07.00.
+
+.TP
+.B 6
+Many fields in outbox can now be NULL.
+.sp
+Changed in version 1.06.00.
+
+.TP
+.B 5
+Introduced daemons table and various other changes.
+.sp
+Changed in version 1.03.00.
+
+.TP
+.B 3
+Introduced phones table and various other changes.
+.sp
+Changed in version 0.98.0.
+
+.UNINDENT
+.SH EXAMPLES
+.SS Creating tables
+.sp
+SQL scripts to create all needed tables for most databases are included in
+Gammu documentation (docs/sql). As well as some PHP scripts interacting with
+the database.
+.sp
+For example to create SQLite tables, issue following command:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+sqlite3 smsd.db < docs/sql/sqlite.sql
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Injecting a message using SQL
+.sp
+To send a message, you can either use gammu\-smsd\-inject, which does all the
+magic for you, or you can insert the message manually. The simplest example is
+short text message:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+INSERT INTO outbox (
+ DestinationNumber,
+ TextDecoded,
+ CreatorID,
+ Coding
+) VALUES (
+ \(aq800123465\(aq,
+ \(aqThis is a SQL test message\(aq,
+ \(aqProgram\(aq,
+ \(aqDefault_No_Compression\(aq
+);
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Please note usage of \fBTextDecoded\fP field, for \fBText\fP field, you would have
+to hex encode the unicode text:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+INSERT INTO outbox (
+ DestinationNumber,
+ Text,
+ CreatorID,
+ Coding
+) VALUES (
+ \(aq800123465\(aq,
+ \(aq005400680069007300200069007300200061002000530051004c002000740065007300740020006d006500730073006100670065\(aq,
+ \(aqProgram\(aq,
+ \(aqDefault_No_Compression\(aq
+);
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Injecting long message using SQL
+.sp
+Inserting multipart messages is a bit more tricky, you need to construct also
+UDH header and store it hexadecimally written into UDH field. Unless you have a
+good reason to do this manually, use gammu\-smsd\-inject, C library
+(\fBSMSD_InjectSMS()\fP) or Python library
+(\fBgammu.smsd.SMSD.InjectSMS()\fP).
+.sp
+For long text message, the UDH starts with \fB050003\fP followed by byte as a
+message reference (you can put any hex value there, but it should be \fBdifferent
+for each message\fP, \fBD3\fP in following example), byte for number of messages
+(\fB02\fP in example, it should be unique for each message you send to same phone
+number) and byte for number of current message (\fB01\fP for first message,
+\fB02\fP for second, etc.).
+.sp
+I most cases, the mutlipart message has to be class 1.
+.sp
+For example long text message of two parts could look like following:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+INSERT INTO outbox (
+ CreatorID,
+ MultiPart,
+ DestinationNumber,
+ UDH,
+ TextDecoded,
+ Coding,
+ Class
+) VALUES (
+ \(aqGammu 1.23.91\(aq,
+ \(aqtrue\(aq,
+ \(aq123465\(aq,
+ \(aq050003D30201\(aq,
+ \(aqMqukqirip ya konej eqniu rejropocejor hugiygydewl tfej nrupxujob xuemymiyliralj. Te tvyjuh qaxumur ibewfoiws zuucoz tdygu gelum L ejqigqesykl kya jdytbez\(aq,
+ \(aqDefault_No_Compression\(aq,
+ 1
+)
+
+INSERT INTO outbox_multipart (
+ SequencePosition,
+ UDH,
+ Class,
+ TextDecoded,
+ ID,
+ Coding,
+ Class
+) VALUES (
+ 2,
+ \(aq050003D30202\(aq,
+ \(aqu xewz qisubevumxyzk ufuylehyzc. Nse xobq dfolizygqysj t bvowsyhyhyemim ovutpapeaempye giuuwbib.\(aq,
+ <ID_OF_INSERTED_RECORD_IN_OUBOX_TABLE>,
+ \(aqDefault_No_Compression\(aq,
+ 1
+)
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+\fBNOTE:\fP
+.INDENT 0.0
+.INDENT 3.5
+Adding UDH means that you have less space for text, in above example you
+can use only 153 characters in single message.
+.UNINDENT
+.UNINDENT
+.SH AUTHOR
+Michal ÄŒihaÅ™ <michal@cihar.com>
+.SH COPYRIGHT
+2009-2015, Michal ÄŒihaÅ™ <michal@cihar.com>
+.\" Generated by docutils manpage writer.
+.
diff --git a/docs/man/gammu-smsd.1 b/docs/man/gammu-smsd.1
new file mode 100644
index 0000000..4919693
--- /dev/null
+++ b/docs/man/gammu-smsd.1
@@ -0,0 +1,332 @@
+.\" Man page generated from reStructuredText.
+.
+.TH "GAMMU-SMSD" "1" "Oct 16, 2017" "1.38.5" "Gammu"
+.SH NAME
+gammu-smsd \- SMS daemon for Gammu
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu\-smsd [OPTION]...
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH DESCRIPTION
+.sp
+This manual page documents briefly the \fBgammu\-smsd\fP command.
+.sp
+\fBgammu\-smsd\fP is a program that periodically scans GSM modem for
+received messages, stores them in defined storage and also sends messages
+enqueued in this storage.
+.sp
+The daemon can reload configuration file after sending hangup signal (SIGHUP)
+and properly terminates itself on SIGINT and SIGTERM.
+.sp
+Program accepts following options (please note that long options might be not
+accepted on some platforms):
+.INDENT 0.0
+.TP
+.B \-h, \-\-help
+Shows help.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-v, \-\-version
+Shows version information and compiled in features.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-c, \-\-config=file
+Configuration file to use, default is /etc/gammu\-smsdrc, on Windows there
+is no default and configuration file path has to be always specified.
+.sp
+If you run SMSD as a system daemon (or service), it is recommended to use
+absolute path to configuration file as startup directory might be
+different than you expect.
+.sp
+See gammu\-smsdrc for configuration file documentation.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-p, \-\-pid=file
+Lock file for storing pid, empty for no locking. Not supported on Windows.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-U, \-\-user=user
+Drop daemon privileges to chosen user after starting.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-G, \-\-group=group
+Drop daemon privileges to chosen group after starting.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-d, \-\-daemon
+Daemonize program on startup. Not supported on Windows.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-i, \-\-install\-service
+Installs SMSD as a Windows service.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-u, \-\-uninstall\-service
+Uninstalls SMSD as a Windows service.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-s, \-\-start\-service
+Starts SMSD Windows service.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-k, \-\-stop\-service
+Stops SMSD Windows service.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-f, \-\-max\-failures=count
+Terminate after defined number of failures. Use 0 to not terminate (this is default).
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-X, \-\-suicide=seconds
+Kills itself after number of seconds.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-S, \-\-run\-service
+Runs pogram as SMSD Windows service. This should not be used manually, but
+only Windows Service manager should use this command.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-n, \-\-service\-name=name
+Defines name of a Windows service. Each service requires an unique name,
+so if you want to run several SMSD instances, you have to name each
+service differently. Default is “GammuSMSDâ€.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-l, \-\-use\-log
+Use logging as configured in config file (default).
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-L, \-\-no\-use\-log
+Do not use logging as configured in config file.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-e, \-\-install\-event\-log
+Installs Windows EventLog description to registry.
+.sp
+New in version 1.31.90.
+
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-E, \-\-uninstall\-event\-log
+Uninstalls Windows EventLog description to registry.
+.sp
+New in version 1.31.90.
+
+.UNINDENT
+.SH SIGNALS
+.sp
+SMSD can be controlled using following POSIX signals (if your platform supports this):
+.INDENT 0.0
+.TP
+.B SIGHUP
+Reload configuration and reconnect to phone.
+.TP
+.B SIGINT, SIGTERM
+Gracefully shutdown the daemon.
+.TP
+.B SIGALRM
+Used internally for \fI\%gammu\-smsd \-X\fP
+.TP
+.B SIGUSR1
+Suspends SMSD operation, closing connection to phone and database.
+.TP
+.B SIGUSR2
+Resumes SMSD operation (after previous suspend).
+.UNINDENT
+.sp
+Changed in version 1.22.91: Added support for SIGHUP.
+
+.sp
+Changed in version 1.22.95: Added support for SIGALRM.
+
+.sp
+Changed in version 1.31.90: Added support for SIGUSR1 and SIGUSR2.
+
+.SH EXAMPLES
+.SS Linux/Unix Examples
+.sp
+Start SMSD as a daemon on Linux:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu\-smsd \-\-config /etc/gammu\-smsdrc \-\-pid /var/run/gammu\-smsd.pid \-\-daemon
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Start SMSD as a daemon on Linux with reduced privileges:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu\-smsd \-\-config /etc/gammu\-smsdrc \-\-pid /var/run/gammu\-smsd.pid \-\-daemon \-\-user gammu \-\-group gammu
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS SMSD as a system wide daemon
+.sp
+To use SMSD as a daemon, you might want to use init script which is shipped
+with Gammu in contrib/init directory. It is not installed by default, either
+install it manually or check INSTALL file for instructions.
+.sp
+Under Windows 7 you might need to disable UAC (user account control) before
+you will be able to install SMSD service.
+.SS Windows Service Examples
+.sp
+Install Gammu SMSD Windows service:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu\-smsd.exe \-c c:\eGammu\esmsdrc \-i
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Install two instances of SMSD Windows service:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu\-smsd.exe \-c c:\eGammu\esmsdrc\-1 \-n Gammu\-first\-phone \-i
+
+gammu\-smsd.exe \-c c:\eGammu\esmsdrc\-2 \-n Gammu\-second\-phone \-i
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+To uninstall a Windows service:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu\-smsd.exe \-u
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Troubleshooting Windows Service
+.sp
+If Gammu fails to start as a Windows service (you will usually get “Error
+1053: The service did not respond to the start or control request in a timely
+fashionâ€), first check your SMSD logs. If they do not contain any useful hint,
+try starting SMSD manually with exactly same parameters as you installed the
+service (without \-i).
+.sp
+For example the command line can look like:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu\-smsd.exe \-c smsdrc
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+You now should be able to get errors from SMSD even if it fails to start as a
+service.
+.SS Invoking Gammu and suspending SMSD
+.sp
+As you can not run Gammu and Gammu SMSD at same time on signle device, you can
+workaround this limitation by suspending SMSD temporarily using \fISIGUSR1\fP and
+\fISIGUSR2\fP signals (see also \fI\%Signals\fP):
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+SMSD_PID=\(gapidof gammu\-smsd\(ga
+if [ \-z "$SMSD_PID" ] ; then
+ echo "Failed to figure out SMSD PID!"
+else
+ kill \-SIGUSR1 $SMSD_PID
+ gammu identify
+ kill \-SIGUSR2 $SMSD_PID
+fi
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Or even create a \fIgammu\-safe\fP script:
+.SH KNOWN LIMITATIONS
+.sp
+You can not use same phone by more programs in same time. However in case you
+did not enable locking in \fB[gammu]\fP section, it might be able
+to start the communication with phone from more programs. In this case neither
+of the programs will probably work, see \fI\%Invoking Gammu and suspending SMSD\fP for
+workaround.
+.sp
+There is no way to detect that SMS message is reply to another by looking at
+message headers. The only way to achieve this is to add some token to the
+message and let the user include it in the message on reply.
+.SH AUTHOR
+Michal ÄŒihaÅ™ <michal@cihar.com>
+.SH COPYRIGHT
+2009-2015, Michal ÄŒihaÅ™ <michal@cihar.com>
+.\" Generated by docutils manpage writer.
+.
diff --git a/docs/man/gammu-smsdrc.5 b/docs/man/gammu-smsdrc.5
new file mode 100644
index 0000000..746be70
--- /dev/null
+++ b/docs/man/gammu-smsdrc.5
@@ -0,0 +1,1049 @@
+.\" Man page generated from reStructuredText.
+.
+.TH "GAMMU-SMSDRC" "5" "Oct 16, 2017" "1.38.5" "Gammu"
+.SH NAME
+gammu-smsdrc \- gammu-smsd(1) configuration file
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH DESCRIPTION
+.sp
+gammu\-smsd reads configuration from a config file. It’s location can be
+specified on command line, otherwise default path \fB/etc/gammu\-smsdrc\fP
+is used.
+.sp
+This file use ini file syntax, see ini\&.
+.sp
+Configuration file of gammu\-smsd consists of at least two sections \-
+\fB[gammu]\fP and \fI\%[smsd]\fP\&. For gammu\-smsd\-sql
+you can also use \fI\%[sql]\fP and \fI\%[tables]\fP\&.
+.sp
+The \fB[gammu]\fP section is configuration of a phone connection
+and is same as described in gammurc with the only exception that
+\fI\%LogFile\fP is ignored and common logging for gammu library and
+SMS daemon is used. However the \fBLogFormat\fP directive still
+configures how much messages gammu emits.
+.INDENT 0.0
+.TP
+.B [smsd]
+The \fI\%[smsd]\fP section configures SMS daemon itself, which are described in
+following subsections. First general parameters of SMS daemon are listed and
+then specific parameters for storage backends.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B [include_numbers]
+List of numbers from which accept messages, see \fI\%Message filtering\fP\&.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B [exclude_numbers]
+List of numbers from which reject messages, see \fI\%Message filtering\fP\&.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B [include_smsc]
+List of SMSC numbers from which accept messages, see \fI\%Message filtering\fP\&.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B [exclude_smsc]
+List of SMSC numbers from which reject messages, see \fI\%Message filtering\fP\&.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B [sql]
+Configure SQL queries used by gammu\-smsd\-sql, you usually don’t have to modify them.
+.sp
+\fBSEE ALSO:\fP
+.INDENT 7.0
+.INDENT 3.5
+Configurable queries
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B [tables]
+Configure SQL table names used by gammu\-smsd\-sql, you usually don’t have to modify them.
+.sp
+\fBSEE ALSO:\fP
+.INDENT 7.0
+.INDENT 3.5
+Configurable tables
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.SH GENERAL PARAMETERS OF SMS DAEMON
+.INDENT 0.0
+.TP
+.B Service
+SMSD service to use, one of following choices:
+.INDENT 7.0
+.TP
+.B \fBFILES\fP
+Stores messages in files, see gammu\-smsd\-files for details.
+.TP
+.B \fBNULL\fP
+Does not store messages at all, see gammu\-smsd\-null for details.
+.TP
+.B \fBSQL\fP
+Stores messages in SQL database, see gammu\-smsd\-sql for details,
+choose database type to use by \fI\%Driver\fP\&.
+.sp
+New in version 1.28.93.
+
+.TP
+.B \fBMYSQL\fP
+Deprecated since version 1.28.93: Use \fI\%Service\fP = \fBSQL\fP and \fI\%Driver\fP = \fBnative_mysql\fP instead.
+
+.sp
+Compatibility option for older configuration files, stores messages in
+MySQL database, see gammu\-smsd\-mysql for details.
+.TP
+.B \fBPGSQL\fP
+Deprecated since version 1.28.93: Use \fI\%Service\fP = \fBSQL\fP and \fI\%Driver\fP = \fBnative_pgsql\fP instead.
+
+.sp
+Compatibility option for older configuration files, stores messages in
+PostgreSQL database, see gammu\-smsd\-pgsql for details.
+.TP
+.B \fBDBI\fP
+Deprecated since version 1.28.93: Use \fI\%Service\fP = \fBSQL\fP and \fI\%Driver\fP = DBI driver instead.
+
+.sp
+Compatibility option for older configuration files, stores messages in
+any database supported by libdbi, see gammu\-smsd\-dbi for details.
+.UNINDENT
+.sp
+\fBNOTE:\fP
+.INDENT 7.0
+.INDENT 3.5
+Availability of backends depends on platform and compile time configuration.
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B PIN
+PIN for SIM card. This is optional, but you should set it if your phone after
+power on requires PIN.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B NetworkCode
+Network personalisation password. This is optional, but some phones require it
+after power on.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B PhoneCode
+Phone lock password. This is optional, but some phones require it after power
+on.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B LogFile
+File where SMSD actions are being logged. You can also use special value
+\fBsyslog\fP which will send all messages to syslog daemon. On Windows another
+special value \fBeventlog\fP exists, which will send logs to Windows Event Log.
+.sp
+If you run SMSD as a system daemon (or service), it is recommended to use
+absolute path to log file as startup directory might be different than you
+expect.
+.sp
+Default is to provide no logging.
+.sp
+\fBNOTE:\fP
+.INDENT 7.0
+.INDENT 3.5
+For logging to Windows Event Log, it is recommended to install Event Log
+source by invoking \fI\%gammu\-smsd \-e\fP (this is automatically done during
+installation of Gammu).
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B LogFacility
+Facility to use on logging backends which support it (currently only
+syslog). One of following chouces:
+.INDENT 7.0
+.IP \(bu 2
+\fBDAEMON\fP (default)
+.IP \(bu 2
+\fBUSER\fP
+.IP \(bu 2
+\fBLOCAL0\fP
+.IP \(bu 2
+\fBLOCAL1\fP
+.IP \(bu 2
+\fBLOCAL2\fP
+.IP \(bu 2
+\fBLOCAL3\fP
+.IP \(bu 2
+\fBLOCAL4\fP
+.IP \(bu 2
+\fBLOCAL5\fP
+.IP \(bu 2
+\fBLOCAL6\fP
+.IP \(bu 2
+\fBLOCAL7\fP
+.UNINDENT
+.sp
+New in version 1.30.91.
+
+.UNINDENT
+.INDENT 0.0
+.TP
+.B DebugLevel
+Debug level for SMSD. The integer value should be sum of all flags you
+want to enable.
+.INDENT 7.0
+.TP
+.B 1
+enables basic debugging information
+.TP
+.B 2
+enables logging of SQL queries of service backends
+.TP
+.B 4
+enables logging of gammu debug information
+.UNINDENT
+.sp
+Generally to get as much debug information as possible, use 255.
+.sp
+Default is 0, what should mean no extra information.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B CommTimeout
+How many seconds should SMSD wait after there is no message in outbox
+before scanning it again.
+.sp
+Default is 30.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B SendTimeout
+Shows how many seconds SMSD should wait for network answer during sending
+sms. If nothing happen during this time, sms will be resent.
+.sp
+Default is 30.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B MaxRetries
+How many times will SMSD try to resend message if sending fails. This
+is tracked per message and currently supported only with SQL backends.
+.sp
+Default is 1.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B ReceiveFrequency
+The number of seconds between testing for received SMSes, when the phone is
+busy sending SMSes. Normally a test for received SMSes is done every
+\fI\%CommTimeout\fP seconds and after each sent SMS.
+.sp
+Default is 15.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B StatusFrequency
+The number of seconds between refreshing phone status (battery, signal) stored
+in shared memory and possibly in service backends. Use 0 to disable.
+.sp
+You might want to increase this for higher throughput.
+.sp
+Default is 60.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B LoopSleep
+The number of seconds how long will SMSD sleep before checking for some
+activity. Please note that setting this to higher value than 1 will have
+effects to other time based configurations, because they will be effectively
+rounded to multiply of this value.
+.sp
+Setting this to 0 disables sleeping. Please note this might cause Gammu to
+consume quite a lot of CPU power as it will effectively do busy loop.
+.sp
+This sleep is utilized only if the main loop (sending and receiving
+messages) takes less than defined time. For example if you set LoopSleep to
+5 seconds and sending messages take 10 seconds, no sleep will be done in
+the iteration which is sending messages. Also the sleep time is lowered by
+the already processed time.
+.sp
+Default is 1.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B MultipartTimeout
+The number of seconds how long will SMSD wait for all parts of multipart
+message. If all parts won’t arrive in time, parts will be processed as separate
+messages.
+.sp
+Default is 600 (10 minutes).
+.UNINDENT
+.INDENT 0.0
+.TP
+.B CheckSecurity
+Whether to check if phone wants to enter PIN.
+.sp
+Default is 1 (enabled).
+.UNINDENT
+.INDENT 0.0
+.TP
+.B HangupCalls
+New in version 1.34.0.
+
+.sp
+Whether to automatically hangup any incoming calls.
+.sp
+Default is 0 (disabled).
+.UNINDENT
+.INDENT 0.0
+.TP
+.B CheckBattery
+Whether to check phone battery state periodically.
+.sp
+Default is 1 (enabled).
+.UNINDENT
+.INDENT 0.0
+.TP
+.B CheckSignal
+Whether to check signal level periodically.
+.sp
+Default is 1 (enabled).
+.UNINDENT
+.INDENT 0.0
+.TP
+.B CheckNetwork
+New in version 1.37.90.
+
+.sp
+Whether to check network status periodically.
+.sp
+If phone is reported to be not on the network, SMSD
+tries to power it on.
+.sp
+Default is 1 (enabled).
+.UNINDENT
+.INDENT 0.0
+.TP
+.B ResetFrequency
+The number of seconds between performing a preventive soft reset in order to
+minimize the cases of hanging phones e.g. Nokia 5110 will sometimes freeze to
+a state when only after unmounting the battery the phone will be functional
+again.
+.sp
+Default is 0 (not used).
+.UNINDENT
+.INDENT 0.0
+.TP
+.B HardResetFrequency
+New in version 1.28.92.
+
+.sp
+\fBWARNING:\fP
+.INDENT 7.0
+.INDENT 3.5
+For some phones hard reset means deleting all data in it. Use
+\fI\%ResetFrequency\fP instead, unless you know what you are
+doing.
+.UNINDENT
+.UNINDENT
+.sp
+The number of seconds between performing a preventive hard reset in order to
+minimize the cases of hanging phones.
+.sp
+Default is 0 (not used).
+.UNINDENT
+.INDENT 0.0
+.TP
+.B DeliveryReport
+Whether delivery reports should be used, one of \fBno\fP, \fBlog\fP, \fBsms\fP\&.
+.INDENT 7.0
+.TP
+.B \fBlog\fP
+one line log entry,
+.TP
+.B \fBsms\fP
+store in inbox as a received SMS
+.TP
+.B \fBno\fP
+no delivery reports
+.UNINDENT
+.sp
+Default is \fBno\fP\&.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B DeliveryReportDelay
+Delay in seconds how long is still delivery report considered valid. This
+depends on brokenness of your network (delivery report should have same
+timestamp as sent message). Increase this if delivery reports are not paired
+with sent messages.
+.sp
+Default is 600 (10 minutes).
+.UNINDENT
+.INDENT 0.0
+.TP
+.B PhoneID
+String with info about phone used for sending/receiving. This can be useful if
+you want to run several SMS daemons (see \fI\%Multiple modems\fP).
+.sp
+When you set PhoneID, all messages (including injected ones) will be marked
+by this string (stored as SenderID in the database) and it allows more SMS
+daemons to share a single database.
+.sp
+SMSD daemon will in such case send outbox messages only with
+matching or empty SenderID.
+.sp
+This option has actually no effect with gammu\-smsd\-files\&.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B SMSC
+New in version 1.36.2.
+
+.sp
+SMSC number to use for sending messages if not specified in the message
+(see options of gammu\-smsd\-inject).
+.sp
+In most cases you don’t need this settings as Gammu tries to read correct
+SMSC from phone, but sometimes this fails (try \fBgammu getsmsc\fP).
+.UNINDENT
+.INDENT 0.0
+.TP
+.B RunOnReceive
+Executes a program after receiving message.
+.sp
+This parameter is executed through shell, so you might need to escape some
+special characters and you can include any number of parameters. Additionally
+parameters with identifiers of received messages are appended to the command
+line. The identifiers depend on used service backend, typically it is ID of
+inserted row for database backends or file name for file based backends.
+.sp
+Gammu SMSD waits for the script to terminate. If you make some time consuming
+there, it will make SMSD not receive new messages. However to limit breakage
+from this situation, the waiting time is limited to two minutes. After this
+time SMSD will continue in normal operation and might execute your script
+again.
+.sp
+The process has available lot of information about received message in
+environment, check gammu\-smsd\-run for more details.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B RunOnFailure
+New in version 1.28.93.
+
+.sp
+Executes a program on failure.
+.sp
+This can be used to proactively react on some failures or to interactively
+detect failure of sending message.
+.sp
+The program will receive optional parameter, which can currently be either
+\fBINIT\fP (meaning failure during phone initialization) or message ID,
+which would indicate error while sending the message.
+.sp
+\fBNOTE:\fP
+.INDENT 7.0
+.INDENT 3.5
+The environment with message (as is in \fI\%RunOnReceive\fP) is not passed to the command.
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B RunOnSent
+New in version 1.36.4.
+
+.sp
+Executes a program after sending message.
+.sp
+The program will receive optional parameter a message ID and environment
+with message details as described in gammu\-smsd\-run\&.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B RunOnIncomingCall
+New in version 1.38.5.
+
+.sp
+Executes a program after cancelling incoming call.
+.sp
+The program will receive a parameter with a phone number of the call.
+This requires \fI\%HangupCalls\fP to be enabled.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B IncludeNumbersFile
+File with list of numbers which are accepted by SMSD. The file contains one
+number per line, blank lines are ignored. The file is read at startup and is
+reread only when configuration is being reread. See Message filtering for
+details.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B ExcludeNumbersFile
+File with list of numbers which are not accepted by SMSD. The file contains
+one number per line, blank lines are ignored. The file is read at startup and
+is reread only when configuration is being reread. See Message filtering for
+details.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B IncludeSMSCFile
+File with list of SMSC numbers which are accepted by SMSD. The file contains
+one number per line, blank lines are ignored. The file is read at startup and
+is reread only when configuration is being reread. See Message filtering for
+details.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B ExcludeSMSCFile
+File with list of SMSC numbers which are not accepted by SMSD. The file
+contains one number per line, blank lines are ignored. The file is read at
+startup and is reread only when configuration is being reread. See Message
+filtering for details.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B BackendRetries
+How many times will SMSD backend retry operation.
+.sp
+The implementation on different backends is different, for database backends
+it generally means how many times it will try to reconnect to the server.
+.sp
+Default is 10.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B Send
+New in version 1.28.91.
+
+.sp
+Whether to enable sending of messages.
+.sp
+Default is True.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B Receive
+New in version 1.28.91.
+
+.sp
+Whether to enable receiving of messages.
+.sp
+Default is True.
+.UNINDENT
+.SH DATABASE BACKENDS OPTIONS
+.sp
+All DBI, ODBC, MYSQL and PGSQL backends (see gammu\-smsd\-mysql,
+gammu\-smsd\-odbc, gammu\-smsd\-pgsql, gammu\-smsd\-dbi for
+their documentation) supports same options for configuring connection to a
+database:
+.INDENT 0.0
+.TP
+.B User
+User name used for connection to a database.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B Password
+Password used for connection to a database.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B Host
+Database server address. It can also contain port or socket path after
+semicolon, for example \fBlocalhost:/path/to/socket\fP or
+\fB192.168.1.1:8000\fP\&.
+.sp
+For ODBC this is used as Data source name.
+.sp
+\fBNOTE:\fP
+.INDENT 7.0
+.INDENT 3.5
+Some database servers differentiate usage of \fBlocalhost\fP (to use
+local socket) and \fB127.0.0.1\fP (to use locat TCP/IP connection).
+Please make sure your SMSD settings match the database server ones.
+.UNINDENT
+.UNINDENT
+.sp
+New in version 1.28.92.
+
+.UNINDENT
+.INDENT 0.0
+.TP
+.B PC
+Deprecated since version 1.28.92: Please use \fI\%Host\fP instead.
+
+.sp
+Synonym for \fI\%Host\fP, kept for backwards compatibility.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B Database
+Name of database (or schema) to use and where SMSD can find it’s tables.
+.sp
+Please note that you should create tables in this database before using
+gammu\-smsd. SQL files for creating needed tables are included in
+documentation for individual database backends: gammu\-smsd\-mysql,
+gammu\-smsd\-odbc, gammu\-smsd\-pgsql, gammu\-smsd\-dbi
+.UNINDENT
+.INDENT 0.0
+.TP
+.B SkipSMSCNumber
+When you send sms from some SMS centers you can have delivery reports from
+other SMSC number. You can set here number of this SMSC used by you and Gammu
+will not check it’s number during assigning reports to sent SMS.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B Driver
+SQL driver to use, Gammu supports several native drivers and generic
+interface using ODBC and DBI. Availability of the backends depends on
+compile time options.
+.sp
+Available drivers:
+.sp
+\fBodbc\fP
+.INDENT 7.0
+.INDENT 3.5
+Connects to the database using ODBC, see gammu\-smsd\-odbc\&.
+.UNINDENT
+.UNINDENT
+.sp
+\fBnative_mysql\fP
+.INDENT 7.0
+.INDENT 3.5
+Stores messages in MySQL database, see gammu\-smsd\-mysql for
+details.
+.UNINDENT
+.UNINDENT
+.sp
+\fBnative_pgsql\fP
+.INDENT 7.0
+.INDENT 3.5
+Stores messages in PostgreSQL database, see gammu\-smsd\-pgsql for
+details.
+.UNINDENT
+.UNINDENT
+.sp
+\fBdb2\fP, \fBfirebird\fP, \fBfreetds\fP, \fBingres\fP, \fBmsql\fP, \fBmysql\fP, \fBoracle\fP, \fBpgsql\fP, \fBsqlite\fP, \fBsqlite3\fP
+.INDENT 7.0
+.INDENT 3.5
+Stores messages using DBI library in given backend. You need to have
+installed appropriate DBI driver to make it work. See
+gammu\-smsd\-dbi for details.
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B SQL
+SQL dialect to use. This is specially useful with gammu\-smsd\-odbc where SMSD
+does not know which server it is actually talking to.
+.sp
+Possible values:
+.INDENT 7.0
+.IP \(bu 2
+\fBmysql\fP \- MySQL
+.IP \(bu 2
+\fBpgsql\fP \- PostgreSQL
+.IP \(bu 2
+\fBsqlite\fP \- SQLite
+.IP \(bu 2
+\fBmssql\fP \- Microsoft SQL Server
+.IP \(bu 2
+\fBsybase\fP \- Sybase
+.IP \(bu 2
+\fBaccess\fP \- Microsoft Access
+.IP \(bu 2
+\fBoracle\fP \- Oracle
+.IP \(bu 2
+\fBodbc\fP \- Generic ODBC
+.UNINDENT
+.sp
+New in version 1.28.93.
+
+.sp
+\fBSEE ALSO:\fP
+.INDENT 7.0
+.INDENT 3.5
+You can also completely customize SQL queries used as described in SQL Queries\&.
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B DriversPath
+Path, where DBI drivers are stored, this usually does not have to be set if
+you have properly installed drivers.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B DBDir
+Database directory for some (currently only sqlite) DBI drivers. Set here path
+where sqlite database files are stored.
+.UNINDENT
+.SS Files backend options
+.sp
+The FILES backend accepts following configuration options. See
+gammu\-smsd\-files for more detailed service backend description. Please note
+that all path should contain trailing path separator (/ on Unix systems):
+.INDENT 0.0
+.TP
+.B InboxPath
+Where the received SMSes are stored.
+.sp
+Default is current directory.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B OutboxPath
+Where SMSes to be sent should be placed.
+.sp
+Default is current directory.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B SentSMSPath
+Where the transmitted SMSes are placed, if same as \fI\%OutboxPath\fP transmitted
+messages are deleted.
+.sp
+Default is to delete transmitted messages.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B ErrorSMSPath
+Where SMSes with error in transmission is placed.
+.sp
+Default is same as \fI\%SentSMSPath\fP\&.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B InboxFormat
+The format in which the SMS will be stored: \fBdetail\fP, \fBunicode\fP, \fBstandard\fP\&.
+.INDENT 7.0
+.TP
+.B \fBdetail\fP
+format used for message backup by gammu, see gammu\-smsbackup\&.
+.TP
+.B \fBunicode\fP
+message text stored in unicode (UTF\-16)
+.TP
+.B \fBstandard\fP
+message text stored in system charset
+.UNINDENT
+.sp
+The \fBstandard\fP and \fBunicode\fP settings do not apply for 8\-bit messages, which
+are always written raw as they are received with extension .bin.
+.sp
+Default is \fBunicode\fP\&.
+.sp
+\fBNOTE:\fP
+.INDENT 7.0
+.INDENT 3.5
+In \fBdetail\fP format, all message parts are stored into signle file,
+for all others each message part is saved separately.
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B OutboxFormat
+The format in which messages created by gammu\-smsd\-inject will be stored,
+it accepts same values as InboxFormat.
+.sp
+Default is \fBdetail\fP if Gammu is compiled in with backup functions, \fBunicode\fP
+otherwise.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B TransmitFormat
+The format for transmitting the SMS: \fBauto\fP, \fBunicode\fP, \fB7bit\fP\&.
+.sp
+This option is used only if \fI\%OutboxFormat\fP is not set to
+\fBdetail\fP\&. In such case encoding specified in the message is used (you can
+specify it to gammu\-smsd\-inject).
+.sp
+Default is \fBauto\fP\&.
+.UNINDENT
+.SH MESSAGE FILTERING
+.sp
+SMSD allows one to process only limited subset of incoming messages. You can define
+filters for sender number in \fI\%[include_numbers]\fP and
+\fI\%[exclude_numbers]\fP sections or using
+\fI\%IncludeNumbersFile\fP and \fI\%ExcludeNumbersFile\fP
+directives.
+.sp
+If \fI\%[include_numbers]\fP section exists, all values (keys are
+ignored) from it are used as allowed phone numbers and no other message is
+processed. On the other side, in \fI\%[exclude_numbers]\fP you can
+specify numbers which you want to skip.
+.sp
+Lists from both sources are merged together. If there is any number in include
+list, only include list is used and only messages in this list are being
+accepted. If include list is empty, exclude list can be used to ignore
+messages from some numbers. If both lists are empty, all messages are
+accepted.
+.sp
+Similar filtering rules can be used for SMSC number filtering, they just use
+different set of configuration options \- \fI\%[include_smsc]\fP and
+\fI\%[exclude_smsc]\fP sections or \fI\%IncludeSMSCFile\fP
+and \fI\%ExcludeSMSCFile\fP directives.
+.SH EXAMPLES
+.sp
+There is more complete example available in Gammu documentation. Please note
+that for simplicity following examples do not include \fB[gammu]\fP
+section, you can look into gammurc for some examples how it can look like.
+.SS Files service
+.sp
+SMSD configuration file for FILES backend could look like:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[smsd]
+Service = files
+PIN = 1234
+LogFile = syslog
+InboxPath = /var/spool/sms/inbox/
+OutboxPath = /var/spool/sms/outbox/
+SentSMSPath = /var/spool/sms/sent/
+ErrorSMSPath = /var/spool/sms/error/
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS MySQL service
+.sp
+If you want to use MYSQL backend, you will need something like this:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[smsd]
+Service = sql
+Driver = native_mysql
+PIN = 1234
+LogFile = syslog
+User = smsd
+Password = smsd
+PC = localhost
+Database = smsd
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS DBI service using SQLite
+.sp
+For gammu\-smsd\-dbi backend, in this particular case SQLite:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[smsd]
+Service = sql
+Driver = sqlite3
+DBDir = /var/lib/sqlite3
+Database = smsd.db
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS ODBC service using MySQL
+.sp
+For gammu\-smsd\-odbc backend, in this particular case using DSN \fBsmsd\fP server:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[smsd]
+Service = sql
+Driver = odbc
+Host = smsd
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+The DSN definition (in \fB~/.odbc.ini\fP on UNIX) for using MySQL server would look like:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[smsd]
+Description = MySQL
+Driver = MySQL
+Server = 127.0.0.1
+Database = smsd
+Port =
+Socket =
+Option =
+Stmt =
+
+[smsdsuse]
+Driver = MySQL ODBC 3.51.27r695 Driver
+DATABASE = smsd
+SERVER = 127.0.0.1
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Numbers filtering
+.sp
+Process only messages from 123456 number:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[include_numbers]
+number1 = 123456
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Do not process messages from evil number 666:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[exclude_numbers]
+number1 = 666
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Debugging
+.sp
+Enabling debugging:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[smsd]
+debuglevel = 255
+logfile = smsd.log
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Multiple modems
+.sp
+You can run any number of SMSD instances and they can even share same backend
+database. For routing the messages, you need to set different
+\fI\%PhoneID\fP for each instance and set \fBSenderID\fP column in
+outbox table.
+.sp
+Following example shows configuration for two modems, but you can have any
+number of SMSD instances. The only limitation is performance of your hardware,
+especially if all modems are connected using USB.
+.sp
+Configuration for first SMSD:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[gammu]
+device = /dev/ttyACM0
+connection = at
+
+[smsd]
+Service = sql
+Driver = native_mysql
+PIN = 1234
+LogFile = syslog
+User = smsd
+Password = smsd
+PC = localhost
+Database = smsd
+PhoneID = first
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Configuration for second SMSD:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[gammu]
+device = /dev/ttyACM1
+connection = at
+
+[smsd]
+Service = sql
+Driver = native_mysql
+PIN = 1234
+LogFile = syslog
+User = smsd
+Password = smsd
+PC = localhost
+Database = smsd
+PhoneID = second
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+You can then start two separate instances of SMSD:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu\-smsd \-c /path/to/first\-smsdrc
+gammu\-smsd \-c /path/to/second\-smsdrc
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH AUTHOR
+Michal ÄŒihaÅ™ <michal@cihar.com>
+.SH COPYRIGHT
+2009-2015, Michal ÄŒihaÅ™ <michal@cihar.com>
+.\" Generated by docutils manpage writer.
+.
diff --git a/docs/man/gammu.1 b/docs/man/gammu.1
new file mode 100644
index 0000000..e9437f2
--- /dev/null
+++ b/docs/man/gammu.1
@@ -0,0 +1,2639 @@
+.\" Man page generated from reStructuredText.
+.
+.TH "GAMMU" "1" "Oct 16, 2017" "1.38.5" "Gammu"
+.SH NAME
+gammu \- Does some neat things with your cellular phone or modem.
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu [parameters] <command> [options]
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Commands actually indicate which operation should Gammu perform. They can be
+specified with or without a leading \fB\-\-\fP\&.
+.SH DESCRIPTION
+.sp
+This program is a tool for mobile phones. Many vendors and phones
+are supported, for actual listing see \fI\%Gammu Phones Database\fP\&.
+.SS Options
+.sp
+Parameters before command configure gammu behaviour:
+.INDENT 0.0
+.TP
+.B \-c, \-\-config <filename>
+name of configuration file (see gammurc)
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-s, \-\-section <confign>
+section of config file to use, eg. 42
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-d, \-\-debug <level>
+debug level (see \fBLogFormat\fP in gammurc for possible values)
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-f, \-\-debug\-file <filename>
+file for logging debug messages
+.UNINDENT
+.SS Call commands
+.INDENT 0.0
+.TP
+.B answercall [id]
+Answer incoming call.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B cancelcall [id]
+Cancel incoming call
+.UNINDENT
+.INDENT 0.0
+.TP
+.B canceldiverts
+Cancel all existing call diverts.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B conferencecall id
+Initiates a conference call.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B dialvoice number [show|hide]
+Make voice call from SIM card line set in phone.
+.sp
+\fBshow|hide\fP \- optional parameter whether to disable call number indication.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B divert get|set all|busy|noans|outofreach all|voice|fax|data [number timeout]
+Manage or display call diverts.
+.INDENT 7.0
+.TP
+.B \fBget\fP or \fBset\fP
+whether to get divert information or to set it.
+.TP
+.B \fBall\fP or \fBbusy\fP or \fBnoans\fP or \fBoutofreach\fP
+condition when apply divert
+.TP
+.B \fBall\fP or \fBvoice\fP or \fBfax\fP or \fBdata\fP
+call type when apply divert
+.TP
+.B number
+number where to divert
+.TP
+.B timeout
+timeout when the diversion will happen
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getussd code
+Retrieves USSD information \- dials a service number and reads response.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B holdcall id
+Holds call.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B maketerminatedcall number length [show|hide]
+Make voice call from SIM card line set in phone which will
+be terminated after \fBlength\fP seconds.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B senddtmf sequence
+Plays DTMF sequence. In some phones available only during calls
+.UNINDENT
+.INDENT 0.0
+.TP
+.B splitcall id
+Splits call.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B switchcall [id]
+Switches call.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B transfercall [id]
+Transfers call.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B unholdcall id
+Unholds call.
+.UNINDENT
+.SS SMS and EMS commands
+.sp
+Sending messages might look a bit complicated on first attempt to use.
+But be patient, the command line has been written in order to allow
+almost every usage. See EXAMPLE section for some hints on usage.
+.sp
+There is also an option to use gammu\-smsd when you want to send or
+receive more messages and process them automatically.
+.SS Introduction to SMS formats
+.sp
+Gammu has support for many SMS formats like:
+.INDENT 0.0
+.TP
+.B Nokia Smart Messaging
+used for monochromatic picture images, downloadable profiles, monochromatic operator logos, monochromatic caller logos and monophonic ringtones
+.TP
+.B Linked SMS
+both with 8 and 16\-bit identification numbers in headers
+.TP
+.B EMS
+this is SMS format used for saving monochromatic images, monophonic ringtones, animations, text formatting and others
+.TP
+.B MMS notifications
+contains links where phone should download MMS
+.TP
+.B Alcatel logo messages
+proprietary format for logos
+.UNINDENT
+.sp
+You need to ensure that the target phone supports message type you want to
+send. Otherwise the phone will not be able to display it or will even crash,
+because firmware of phone did not expect this possibility.
+.SS Encoding chars in SMS text
+.sp
+Text in SMS can be coded using two ways:
+.SS GSM Default Alphabet
+.sp
+With \fIGSM Default Alphabet\fP you can fit at most 160 chars into single SMS
+(Gammu doesn’t support compressing such texts according to GSM standards, but
+it isn’t big limit, because there are no phones supporting them), but they’re
+from limited set:
+.INDENT 0.0
+.IP \(bu 2
+all Latin small and large
+.IP \(bu 2
+all digits
+.IP \(bu 2
+some Greek
+.IP \(bu 2
+some other national
+.IP \(bu 2
+some symbols like @\ ! †# & / ( )\ % * + = \- , .\ :\ ; < >\ ?
+.IP \(bu 2
+few others
+.UNINDENT
+.SS Unicode
+.sp
+With \fIUnicode\fP single SMS can contain at most 70 chars, but these can be
+any chars including all national and special ones.
+.sp
+\fBWARNING:\fP
+.INDENT 0.0
+.INDENT 3.5
+Please note, that some older phones might have problems displaying such
+message.
+.UNINDENT
+.UNINDENT
+.SS Conversion
+.sp
+Gammu tries to do the best to handle non ASCII characters in your message.
+Everything is internally handled in Unicode (the input is converted depending
+on your locales configuration) and in case message uses Unicode the text will
+be given as such to the message.
+.sp
+Should the message be sent in GSM Default Alphabet, Gammu will try to convert
+all characters to keep message readable. Gammu does support multi byte
+encoding for some characters in GSM Default Alphabet (it is needed for \fB^\fP \fB{\fP \fB}\fP
+\fB\e\fP \fB[\fP \fB]\fP \fB~\fP \fB|\fP). The characters which are not present in GSM Default Alphabet
+are transliterated to closest ASCII equivalent (accents are removed).
+Remaining not known characters are replaced by question mark.
+.SS SMS commands
+.INDENT 0.0
+.TP
+.B addsmsfolder name
+.UNINDENT
+.INDENT 0.0
+.TP
+.B deleteallsms folder
+Delete all SMS from specified SMS folder.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B deletesms folder start [stop]
+Delete SMS from phone. See description for \fBgammu getsms\fP for info about
+sms folders naming convention.
+.sp
+Locations are numerated from 1.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B displaysms ... (options like in sendsms)
+Displays PDU data of encoded SMS messages. It accepts same parameters and
+behaves same like sendsms.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getallsms \-pbk
+Get all SMS from phone. In some phones you will have also SMS templates
+and info about locations used to save Picture Images. With each sms you
+will see location. If you want to get such sms from phone alone, use
+\fBgammu getsms\fP\&.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B geteachsms \-pbk
+Similiary to \fBgammu getallsms\fP\&. Difference is, that
+links all concatenated sms
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getsms folder start [stop]
+Get SMS.
+.sp
+Locations are numerated from 1.
+.sp
+Folder 0 means that sms is being read from “flat†memory (all sms from all
+folders have unique numbers). It’s sometimes emulated by Gammu. You
+can use it with all phones.
+.sp
+Other folders like 1, 2, etc. match folders in phone such as Inbox, Outbox, etc.
+and each sms has unique number in his folder. Name of folders can
+depend on your phone (the most often 1=â€Inboxâ€, 2=â€Outboxâ€, etc.).
+This method is not supported by all phones (for example, not supported
+by Nokia 3310, 5110, 6110). If work with your phone, use
+\fBgammu getsmsfolders\fP to get folders list.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getsmsc [start [stop]]
+Get SMSC settings from SIM card.
+.sp
+Locations are numerated from 1.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getsmsfolders
+Get names for SMS folders in phone
+.UNINDENT
+.INDENT 0.0
+.TP
+.B savesms TYPE [type parameters] [type options] [\-folder id] [\-unread] [\-read] [\-unsent] [\-sent] [\-sender number] [\-smsname name] [\-smscset number] [\-smscnumber number] [\-reply] [\-maxsms num]
+Saves SMS to phone, see below for \fBTYPE\fP options.
+.INDENT 7.0
+.INDENT 3.5
+.INDENT 0.0
+.TP
+.B \-smscset number
+SMSC number will be taken from phone stored SMSC configuration \fBnumber\fP\&.
+.sp
+Default: 1
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-smscnumber number
+SMSC number
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-reply
+reply SMSC is set
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-folder number
+save to specified folder.
+.sp
+Folders are numerated from 1.
+.sp
+The most often folder 1 = “Inboxâ€, 2 = “Outboxâ€,etc. Use \fBgammu getsmsfolders\fP to get folder list.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-unread
+makes message unread. In some phones (like 6210) you won’t see
+unread sms envelope after saving such sms. In some phones with internal
+SMS memory (like 6210) after using it with folder 1 SIM SMS memory will be used
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-read
+makes message read. In some phones with internal
+SMS memory (like 6210) after using it with folder 1 SIM SMS memory will be used
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-unsent
+makes message unsent
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-sent
+makes message sent
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-smsname name
+set message name
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-sender number
+set sender number (default: \fBGammu\fP)
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-maxsms num
+Limit maximum number of messages which will be
+created. If there are more messages, Gammu will terminate with failure.
+.UNINDENT
+.sp
+Types of messages:
+.INDENT 0.0
+.TP
+.B ANIMATION frames file1 file2...
+Save an animation as a SMS. You need to give
+number of frames and picture for each frame. Each picture can be in any
+picture format which Gammu supports (B/W bmp, gif, wbmp, nol, nlm…).
+.UNINDENT
+.INDENT 0.0
+.TP
+.B BOOKMARK file location
+Read WAP bookmark from file created by \fBgammu backup\fP command and saves in
+Nokia format as SMS
+.UNINDENT
+.INDENT 0.0
+.TP
+.B CALENDAR file location
+Read calendar note from file created by \fBgammu backup\fP command and saves in
+VCALENDAR 1.0 format as SMS. The location identifies position of calendar item
+to be read in backup file (usually 1, but can be useful in case the backup contains
+more items).
+.UNINDENT
+.INDENT 0.0
+.TP
+.B CALLER file
+Save caller logo as sms in Nokia (Smart Messaging)
+format \- size 72x14, two colors.
+.sp
+\fBWARNING:\fP
+.INDENT 7.0
+.INDENT 3.5
+Please note, that it isn’t designed for colour logos available for
+example in DCT4/TIKU \- you need to put bitmap file there inside
+phone using filesystem commands.
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B USSD
+Send USSD query instead of SMS.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B EMS [\-unicode] [\-16bit] [\-format lcrasbiut] [\-text text] [\-unicodefiletext file] [\-defsound ID] [\-defanimation ID] [\-tone10 file] [\-tone10long file] [\-tone12 file] [\-tone12long file] [\-toneSE file] [\-toneSElong file] [\-fixedbitmap file] [\-variablebitmap file] [\-variablebitmaplong file] [\-animation frames file1 ...] [\-protected number]
+Saves EMS sequence. All format specific parameters (like \fB\-defsound\fP) can be used few times.
+.INDENT 7.0
+.TP
+.B \-text
+adds text
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-unicodefiletext
+adds text from Unicode file
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-defanimation
+adds default animation with ID specified by user. ID for different phones are different.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-animation
+adds “frames†frames read from file1, file2, etc.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-defsound
+adds default sound with ID specified by user. ID for different phones are different.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-tone10
+adds IMelody version 1.0 read from RTTL or other compatible file
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-tone10long
+IMelody version 1.0 saved in one of few SMS with UPI. Phones
+compatible with UPI (like Sony\-Ericsson phones) will read such
+ringtone as one
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-tone12
+adds IMelody version 1.2 read from RTTL or other compatible file
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-tone12long
+IMelody version 1.2 saved in one of few SMS with UPI. Phones
+compatible with UPI (like Sony\-Ericsson phones) will read such
+ringtone as one
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-toneSE
+adds IMelody in “short†form supported by Sony\-Ericsson phones
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-toneSElong
+add Sony\-Ericsson IMelody saved in one or few SMS with UPI
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-variablebitmap
+bitmap in any size saved in one SMS
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-variablebitmaplong
+bitmap with maximum size 96x128 saved in one or few sms
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-fixedbitmap
+bitmap 16x16 or 32x32
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-protected
+all ringtones and bitmaps after this parameter (excluding default
+ringtones and logos) will be “protected†(in phones compatible with
+ODI like SonyEricsson products it won’t be possible to forward them
+from phone menu)
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-16bit
+Gammu uses SMS headers with 16\-bit numbers for saving linking info
+in SMS (it means less chars available for user in each SMS)
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-format lcrasbiut
+last text will be formatted. You can use combinations of chars:
+.TS
+center;
+|l|l|.
+_
+T{
+Character
+T} T{
+Formating
+T}
+_
+T{
+\fBl\fP
+T} T{
+left aligned
+T}
+_
+T{
+\fBc\fP
+T} T{
+centered
+T}
+_
+T{
+\fBr\fP
+T} T{
+right aligned
+T}
+_
+T{
+\fBa\fP
+T} T{
+large font
+T}
+_
+T{
+\fBs\fP
+T} T{
+small font
+T}
+_
+T{
+\fBb\fP
+T} T{
+bold font
+T}
+_
+T{
+\fBi\fP
+T} T{
+italic font
+T}
+_
+T{
+\fBu\fP
+T} T{
+underlined font
+T}
+_
+T{
+\fBt\fP
+T} T{
+strikethrough font
+T}
+_
+.TE
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B MMSINDICATOR URL Title Sender
+Creates a MMS indication SMS. It contains URL where the actual MMS
+payload is stored which needs to be SMIL encoded. The phone usually
+downloads the MMS data using special APN, which does not count to
+transmitted data, however there might be limitations which URLs can
+be accessed.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B MMSSETTINGS file location
+Saves a message with MMS configuration. The
+configuration will be read from Gammu backup file from given location.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B OPERATOR file [\-netcode netcode] [\-biglogo]
+Save operator logo as sms in Nokia (Smart Messaging) format \- size
+72x14 in two colors.
+.INDENT 7.0
+.TP
+.B \-biglogo
+Use 78x21 formatted logo instead of standard 72x14.
+.UNINDENT
+.sp
+\fBNOTE:\fP
+.INDENT 7.0
+.INDENT 3.5
+This isn’t designed for colour logos available for example in newer
+phones \- you need to put bitmap file there inside phone using
+filesystem commands.
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B PICTURE file [\-text text] [\-unicode] [\-alcatelbmmi]
+Read bitmap from 2 colors file (bmp, nlm, nsl, ngg, nol, wbmp, etc.), format
+into bitmap in Smart Messaging (72x28, 2 colors, called often Picture Image
+and saved with text) or Alcatel format and send/save over SMS.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B PROFILE [\-name name] [\-bitmap bitmap] [\-ringtone ringtone]
+Read ringtone (RTTL) format, bitmap (Picture Image size) and name, format into
+Smart Messaging profile and send/save as SMS.
+.sp
+\fBWARNING:\fP
+.INDENT 7.0
+.INDENT 3.5
+Please note, that this format is abandoned by Nokia and supported
+by some (older) devices only like Nokia 3310.
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B RINGTONE file [\-long] [\-scale]
+Read RTTL ringtone from file and save as SMS
+into SIM/phone memory. Ringtone is saved in Nokia (Smart Messaging) format.
+.INDENT 7.0
+.TP
+.B \-long
+ringtone is saved using Profile style. It can be longer (and saved
+in 2 SMS), but decoded only by newer phones (like 33xx)
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-scale
+ringtone will have Scale info for each note. It will allow one to edit
+it correctly later in phone composer (for example, in 33xx)
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B SMSTEMPLATE [\-unicode] [\-text text] [\-unicodefiletext file] [\-defsound ID] [\-defanimation ID] [\-tone10 file] [\-tone10long file] [\-tone12 file] [\-tone12long file] [\-toneSE file] [\-toneSElong file] [\-variablebitmap file] [\-variablebitmaplong file] [\-animation frames file1 ...]
+Saves a SMS template (for Alcatel phones).
+.UNINDENT
+.INDENT 0.0
+.TP
+.B TEXT [\-inputunicode] [\-16bit] [\-flash] [\-len len] [\-autolen len] [\-unicode] [\-enablevoice] [\-disablevoice] [\-enablefax] [\-disablefax] [\-enableemail] [\-disableemail] [\-voidsms] [\-replacemessages ID] [\-replacefile file] [\-text msgtext] [\-textutf8 msgtext]
+Take text from stdin (or commandline if \-text
+specified) and save as text SMS into SIM/phone memory.
+.INDENT 7.0
+.TP
+.B \-flash
+Class 0 SMS (should be displayed after receiving on recipients’ phone display after receiving without entering Inbox)
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-len len
+specify, how many chars will be read. When use this option and text
+will be longer than 1 SMS, will be split into more linked SMS
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-autolen len
+specify, how many chars will be read. When use this option and text
+will be longer than 1 SMS, will be split into more linked
+SMS.Coding type (SMS default alphabet/Unicode) is set according to
+input text
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-enablevoice
+sms will set voice mail indicator. Text will be cut to 1 sms.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-disablevoice
+sms will not set voice mail indicator. Text will be cut to 1 sms.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-enablefax
+sms will set fax indicator. Text will be cut to 1 sms.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-disablefax
+sms will not set fax indicator. Text will be cut to 1 sms.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-enableemail
+sms will set email indicator. Text will be cut to 1 sms.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-disableemail
+sms will not set email indicator. Text will be cut to 1 sms.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-voidsms
+many phones after receiving it won’t display anything, only beep,
+vibrate or turn on light. Text will be cut to 1 sms.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-unicode
+SMS will be saved in Unicode format
+.sp
+\fBNOTE:\fP
+.INDENT 7.0
+.INDENT 3.5
+The \fB~\fP char in SMS text and \fB\-unicode\fP option
+(Unicode coding required) can cause text of SMS after \fB~\fP
+char blink in some phones (like Nokia 33xx).
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-inputunicode
+input text is in Unicode.
+.sp
+\fBNOTE:\fP
+.INDENT 7.0
+.INDENT 3.5
+You can create Unicode file using WordPad in Windows (during
+saving select “Unicode Text Document†format). In Unix can use
+for example YUdit or vim.
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-text
+get text from command line instead of stdin.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-textutf8
+get text in UTF\-8 from command line instead of stdin.
+.sp
+\fBNOTE:\fP
+.INDENT 7.0
+.INDENT 3.5
+Gammu detects your locales and uses by default encoding based
+on this. Use this option only when you know the input will be
+in UTF\-8 in all cases.
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-16bit
+Gammu uses SMS headers with 16\-bit numbers for saving linking info
+in SMS (it means less chars available for user in each SMS)
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-replacemessages ID
+\fBID\fP can be 1..7. When you will use option and send more single
+SMS to one recipient with the same ID, each another SMS will
+replace each previous with the same ID
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-replacefile file
+File with replacement table in unicode (UCS\-2), preferably with
+byte order mark (BOM). It contains pairs of chars, first one is to
+replace, second is replacement one. The replacement is done after
+reading text for the message.
+.sp
+For example replacement \fB1\fP (0x0061) with \fBa\fP (0x0031) would
+be done by file with following content (hex dump, first two bytes
+is BOM):
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+ff fe 61 00 31 00
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B TODO file location
+Saves a message with a todo entry. The content will
+be read from any backup format which Gammu supports and from given location.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B VCARD10|VCARD21 file SM|ME location [\-nokia]
+Read phonebook entry from file created by \fBgammu backup\fP
+command and saves in VCARD 1.0 (only name and default number) or VCARD
+2.1 (all entry details with all numbers, text and name) format as SMS.
+The location identifies position of contact item to be read in backup
+file (usually 1, but can be useful in case the backup contains more
+items).
+.UNINDENT
+.INDENT 0.0
+.TP
+.B WAPINDICATOR URL Title
+Saves a SMS with a WAP indication for given
+URL and title.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B WAPSETTINGS file location DATA|GPRS
+Read WAP settings from file created by \fBgammu backup\fP command
+and saves in Nokia format as SMS
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B sendsms TYPE destination [type parameters] [type options] [\-smscset number] [\-smscnumber number] [\-reply] [\-report] [\-validity HOUR|6HOURS|DAY|3DAYS|WEEK|MAX] [\-save [\-folder number]]
+Sends a message to a \fBdestination\fP number, most parameters are same as for \fBgammu savesms\fP\&.
+.INDENT 7.0
+.TP
+.B \-save
+will also save message which is being sent
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-report
+request delivery report for message
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-validity HOUR|6HOURS|DAY|3DAYS|WEEK|MAX
+sets how long will be the
+message valid (SMSC will the discard the message after this time if it could
+not deliver it).
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B setsmsc location number
+Set SMSC settings on SIM card. This keeps all SMSC configuration
+intact, it just changes the SMSC number.
+.sp
+Locations are numerated from 1.
+.UNINDENT
+.SS Memory (phonebooks and calls) commands
+.SS Memory types
+.sp
+Gammu recognizes following memory types:
+.INDENT 0.0
+.TP
+.B \fBDC\fP
+Dialled calls
+.TP
+.B \fBMC\fP
+Missed calls
+.TP
+.B \fBRC\fP
+Received calls
+.TP
+.B \fBON\fP
+Own numbers
+.TP
+.B \fBVM\fP
+voice mailbox
+.TP
+.B \fBSM\fP
+SIM phonebook
+.TP
+.B \fBME\fP
+phone internal phonebook
+.TP
+.B \fBFD\fP
+fixed dialling
+.TP
+.B \fBSL\fP
+sent SMS log
+.UNINDENT
+.SS Memory commands
+.INDENT 0.0
+.TP
+.B deleteallmemory DC|MC|RC|ON|VM|SM|ME|MT|FD|SL
+Deletes all entries from specified memory type.
+.sp
+For memory types description see \fI\%Memory types\fP\&.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B deletememory DC|MC|RC|ON|VM|SM|ME|MT|FD|SL start [stop]
+Deletes entries in specified range from specified memory type.
+.sp
+For memory types description see \fI\%Memory types\fP\&.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getallmemory DC|MC|RC|ON|VM|SM|ME|MT|FD|SL
+Get all memory locations from phone.
+.sp
+For memory types description see \fI\%Memory types\fP\&.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getmemory DC|MC|RC|ON|VM|SM|ME|MT|FD|SL start [stop [\-nonempty]]
+Get memory location from phone.
+.sp
+For memory types description see \fI\%Memory types\fP\&.
+.sp
+Locations are numerated from 1.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getspeeddial start [stop]
+Gets speed dial choices.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B searchmemory text
+Scans all memory entries for given text. It performs
+case insensitive substring lookup. You can interrupt searching by pressing
+\fBCtrl+C\fP\&.
+.UNINDENT
+.SS Filesystem commands
+.sp
+Gammu allows one to access phones using native protocol (Nokias) or OBEX. Your
+phone can also support usb storage, which is handled on the operating system
+level and Gammu does not use that.
+.INDENT 0.0
+.TP
+.B addfile folderID name [\-type JAR|BMP|PNG|GIF|JPG|MIDI|WBMP|AMR|3GP|NRT] [\-readonly] [\-protected] [\-system] [\-hidden] [\-newtime]
+Add file with specified name to folder with specified folder ID.
+.INDENT 7.0
+.TP
+.B \-type
+File type was required for filesystem 1 in Nokia phones (current filesystem 2 doesn’t need this).
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-readonly
+Sets the read only attribute.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-protected
+Sets the protected attribute (file can’t be for example forwarded
+from phone menu).
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-system
+Sets the system attribute.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-hidden
+Sets the hidden attribute (file is hidden from phone menu).
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-newtime
+After using it date/time of file modification will be set to moment of uploading.
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B addfolder parentfolderID name
+Create a folder in phone with specified name in a
+folder with specified folder ID.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B deletefiles fileID
+Delete files with given IDs.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B deletefolder name
+Delete folder with given ID.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getfilefolder fileID, fileID
+Retrieve files or all files from folder with given IDs from a phone filesytem.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getfiles fileID, fileID
+Retrieve files with given IDs from a phone filesytem.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getfilesystem [\-flatall|\-flat]
+Display info about all folders and files in phone memory/memory card. By default there is tree displayed, you can change it:
+.INDENT 7.0
+.TP
+.B \-flatall
+there are displayed full file/folder details like ID (first parameter in line)
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-flat
+.UNINDENT
+.sp
+\fBNOTE:\fP
+.INDENT 7.0
+.INDENT 3.5
+In some phones (like N6230) content of some folders (with more files) can be cut (only part of files will be displayed) for example on infrared connection. This is not Gammu issue, but phone firmware problem.
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getfilesystemstatus
+Display info filesystem status \- number of
+bytes available, used or used by some specific content.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getfolderlisting folderID
+Display files and folders available in folder with given folder ID. You can get ID’s using getfilesystem \-flatall.
+.sp
+\fBWARNING:\fP
+.INDENT 7.0
+.INDENT 3.5
+Please note, that in some phones (like N6230) content of some folders
+(with more files) can be cut (only part of files will be displayed) for
+example on infrared connection. This is not Gammu issue, but phone
+firmware problem.
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getrootfolders
+Display info about drives available in phone/memory card.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B sendfile name
+Sends file to a phone. It’s up to phone to decide where
+to store this file and how to handle it (for example when you send vCard or
+vCalendar, most of phones will offer you to import it.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B setfileattrib folderID [\-system] [\-readonly] [\-hidden] [\-protected]
+.UNINDENT
+.SS Logo and pictures commands
+.sp
+These options are mainly (there are few exceptions) for monochromatic logos and
+images available in older phones. Recognized file formats: xpm (only saving),
+2\-colors bmp, nlm, nsl, ngg, nol, wbmp, gif (for Samsung).
+.sp
+In new models all bitmaps are saved in filesystem and should go into filesystem section
+.INDENT 0.0
+.TP
+.B copybitmap inputfile [outputfile [OPERATOR|PICTURE|STARTUP|CALLER]]
+Allow one to convert logos files to another. When give ONLY inputfile, output will
+be written to stdout using ASCII art. When give output file and format, in
+some file formats (like NLM) will be set indicator informing about logo type
+to given.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getbitmap TYPE [type options]
+Reads bitmap from phone, following types are supported:
+.INDENT 7.0
+.TP
+.B CALLER location [file]
+Get caller group logo from phone. Locations 1\-5.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B DEALER
+In some models it’s possible to save dealer welcome note \- text displayed
+during enabling phone, which can’t be edited from phone menu. Here you can
+get it.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B OPERATOR [file]
+Get operator logo (picture displayed instead of operator name) from phone.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B PICTURE location [file]
+Get Picture Image from phone.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B STARTUP [file]
+Get static startup logo from phone. Allow one to save it in file.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B TEXT
+Get startup text from phone.
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B setbitmap TYPE [type options]
+Sets bitmap in phone, following types are supported:
+.INDENT 7.0
+.TP
+.B CALLER location [file]
+Set caller logo.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B COLOUROPERATOR [fileID [netcode]]
+Sets color operator logo in phone.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B COLOURSTARTUP [fileID]
+.UNINDENT
+.INDENT 7.0
+.TP
+.B DEALER text
+Sets welcome message configured by dealer, which usually can not be changed in phone menus.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B OPERATOR [file [netcode]]
+Set operator logo in phone. When won’t give file and netcode, operator logo
+will be removed from phone. When will give only filename, operator logo will
+be displayed for your current GSM operator. When you give additionally network
+code, it will be displayed for this operator.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B PICTURE file location [text]
+Sets picture image in phone.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B STARTUP file|1|2|3
+Set startup logo in phone. It can be static (then you will have to give file
+name) or one of predefined animated (only some phones like Nokia 3310 or 3330
+supports it, use location 1, 2 or 3 for these).
+.UNINDENT
+.INDENT 7.0
+.TP
+.B TEXT text
+Sets startup text in phone.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B WALLPAPER fileID
+Sets wallpaper in phone.
+.UNINDENT
+.UNINDENT
+.SS Ringtones commands
+.sp
+Ringtones are mostly supported only for older phones. For recent phones you
+usually just upload them to some folder in phone filesystem.
+.sp
+There are recognized various file formats by options described below: rttl,
+binary format created for Gammu, mid (saving), re (reading), ott, communicator,
+ringtones format found in fkn.pl, wav (saving), ime/imy (saving), rng, mmf (for
+Samsung).
+.INDENT 0.0
+.TP
+.B copyringtone source destination [RTTL|BINARY]
+Copy source ringtone to destination.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getphoneringtone location [file]
+Get one of “default†ringtones and saves into file
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getringtone location [file]
+Get ringtone from phone in RTTL or BINARY format.
+.sp
+Locations are numerated from 1.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getringtoneslist
+.UNINDENT
+.INDENT 0.0
+.TP
+.B playringtone file
+Play approximation of ringtone over phone buzzer. File can be in RTTL or BINARY (Nokia DCT3) format.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B playsavedringtone number
+Play one of built\-in ringtones. This option is available for DCT4 phones.
+For getting ringtones list use \fBgammu getringtoneslist\fP\&.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B setringtone file [\-location location] [\-scale] [\-name name]
+Set ringtone in phone. When don’t give location, it will be written
+“with preview†(in phones supporting this feature like 61xx or 6210).
+.INDENT 7.0
+.TP
+.B \-scale
+Scale information will be added to each note of RTTL ringtone. It will
+avoid scale problems available during editing ringtone in composer
+from phone menu (for example, in Nokia 33xx).
+.UNINDENT
+.sp
+\fBNOTE:\fP
+.INDENT 7.0
+.INDENT 3.5
+When use \fB~\fP char in ringtone name, in some phones (like 33xx) name
+will blink later in phone menus.
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.SS Calendar notes commands
+.sp
+In Nokia 3310, 3315 and 3330 these are named “Reminders†and have some limitations (depending on phone firmware version).
+.INDENT 0.0
+.TP
+.B deletecalendar start [stop]
+Deletes selected calendar entries in phone.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getallcalendar
+Retrieves all calendar entries from phone.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getcalendar start [stop]
+Retrieves selected calendar entries from phone.
+.UNINDENT
+.SS To do list commands
+.INDENT 0.0
+.TP
+.B deletetodo start [stop]
+Deletes selected todo entries in phone.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getalltodo
+Retrieves all todo entries from phone.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B gettodo start [stop]
+Retrieves selected todo entries from phone.
+.UNINDENT
+.SS Notes commands
+.INDENT 0.0
+.TP
+.B getallnotes
+Reads all notes from the phone.
+.sp
+\fBNOTE:\fP
+.INDENT 7.0
+.INDENT 3.5
+Not all phones supports this function, especially most Sony Ericsson
+phones even if they have notes inside phone.
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.SS Date, time and alarm commands
+.INDENT 0.0
+.TP
+.B getalarm [start]
+Get alarm from phone, if no location is specified,
+1 is used.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getdatetime
+Get date and time from phone
+.UNINDENT
+.INDENT 0.0
+.TP
+.B setalarm hour minute
+Sets repeating alarm in phone on selected time.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B setdatetime [HH:MM[:SS]] [YYYY/MM/DD]
+Set date and time in phone to date and time set in computer. Please
+note, that this option doesn’t show clock on phone screen. It only set
+date and time.
+.sp
+\fBNOTE:\fP
+.INDENT 7.0
+.INDENT 3.5
+You can make such synchronization each time, when will connect your
+phone and use Gammu. See \fBSynchronizeTime\fP in gammurc for details.
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.SS Categories commands
+.sp
+\fBNOTE:\fP
+.INDENT 0.0
+.INDENT 3.5
+Categories are supported only on few phones (Alcatel).
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B addcategory TODO|PHONEBOOK text
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getallcategory TODO|PHONEBOOK
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getcategory TODO|PHONEBOOK start [stop]
+.UNINDENT
+.INDENT 0.0
+.TP
+.B listmemorycategory text|number
+.UNINDENT
+.INDENT 0.0
+.TP
+.B listtodocategory text|number
+.UNINDENT
+.SS Backing up and restoring commands
+.INDENT 0.0
+.TP
+.B addnew file [\-yes] [\-memory ME|SM|..]
+Adds data written in file created using \fBgammu backup\fP command. All things
+backed up \fBgammu backup\fP can be restored (when made backup to Gammu text
+file).
+.sp
+Please note that this adds all content of backup file to phone and
+does not care about current data in the phone (no duplicates are
+detected).
+.sp
+Use \-yes parameter to answer yes to all questions (you want to automatically
+restore all data).
+.sp
+Use \-memory parameter to force usage of defined memory type for storing entries
+regardless what backup format says.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B addsms folder file [\-yes]
+Adds SMSes from file (format like \fBgammu backupsms\fP uses) to
+selected folder in phone.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B backup file [\-yes]
+Backup your phone to file. It’s possible to backup (depends on phone and backup format):
+.INDENT 7.0
+.IP \(bu 2
+phonebook from SIM and phone memory
+.IP \(bu 2
+calendar notes
+.IP \(bu 2
+SMSC settings
+.IP \(bu 2
+operator logo
+.IP \(bu 2
+startup (static) logo or startup text
+.IP \(bu 2
+WAP bookmarks
+.IP \(bu 2
+WAP settings
+.IP \(bu 2
+caller logos and groups
+.IP \(bu 2
+user ringtones
+.UNINDENT
+.sp
+There are various backup formats supported and the backup format is guessed
+based on file extension:
+.INDENT 7.0
+.IP \(bu 2
+\fB\&.lmb\fP \- Nokia backup, supports contacts, caller logos and startup logo.
+.IP \(bu 2
+\fB\&.vcs\fP \- vCalendar, supports calendar and todo.
+.IP \(bu 2
+\fB\&.vcf\fP \- vCard, supports contacts.
+.IP \(bu 2
+\fB\&.ldif\fP \- LDAP import, supports contacts.
+.IP \(bu 2
+\fB\&.ics\fP \- iCalendar, supports calendar and todo.
+.IP \(bu 2
+Any other extension is Gammu backup file and it supports all data mentioned above, see gammu\-backup for more details.
+.UNINDENT
+.sp
+By default this command is interactive and asks which items tou want to backup.
+.sp
+Use \-yes for answering yes to all questions.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B backupsms file [\-yes|\-all]
+Stores all SMSes from phone to file into gammu\-smsbackup\&.
+.sp
+By default this command is interactive and asks which folders you want
+to backup and whether you want to remove messages from phone afterwards.
+.sp
+Use \-yes for answering yes to all questions (backup all messages and
+delete them from phone), or \-all to just backup all folders while keeping
+messages in phone.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B restore file [\-yes]
+.sp
+\fBWARNING:\fP
+.INDENT 7.0
+.INDENT 3.5
+Please note that restoring deletes all current content in phone. If you
+want only to add entries to phone, use \fBgammu addnew\fP\&.
+.UNINDENT
+.UNINDENT
+.sp
+Restore settings written in file created using \fBgammu backup\fP command.
+.sp
+In some phones restoring calendar notes will not show error, but won’t
+be done, when phone doesn’t have set clock inside.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B restoresms file [\-yes]
+.sp
+\fBWARNING:\fP
+.INDENT 7.0
+.INDENT 3.5
+Please note that this overwrites existing messages in phone (if it supports it).
+.UNINDENT
+.UNINDENT
+.sp
+Restores SMSes from file (format like \fBgammu backupsms\fP uses) to
+selected folder in phone.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B savefile TYPE [type options]
+Converts between various file formats supported by Gammu, following types
+are supported:
+.INDENT 7.0
+.TP
+.B BOOKMARK target.url file location
+Converts backup format supported by
+Gammu to vBookmark file.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B CALENDAR target.vcs file location
+Allows one to convert between various backup formats which gammu
+supports for calendar events. The file type is guessed (for input file
+guess is based on extension and file content, for output solely on
+extension).
+.UNINDENT
+.INDENT 7.0
+.TP
+.B TODO target.vcs file location
+Allows one to convert between various backup formats which gammu
+supports for todo events. The file type is guessed (for input file
+guess is based on extension and file content, for output solely on
+extension).
+.UNINDENT
+.INDENT 7.0
+.TP
+.B VCARD10|VCARD21 target.vcf file SM|ME location
+Allows one to convert between various backup formats which gammu
+supports for phonebook events. The file type is guessed (for input file
+guess is based on extension and file content, for output solely on
+extension).
+.UNINDENT
+.sp
+\fBSEE ALSO:\fP
+.INDENT 7.0
+.INDENT 3.5
+\fBgammu convertbackup\fP
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B convertbackup source.file output.file
+New in version 1.28.94.
+
+.sp
+Converts backup between formats supported by Gammu. Unlike
+\fBgammu savefile\fP, this does not give you any options what to
+convert, it simply takes converts all what can be saved into output file.
+.sp
+\fBSEE ALSO:\fP
+.INDENT 7.0
+.INDENT 3.5
+\fBgammu savefile\fP
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.SS Nokia specific commands
+.INDENT 0.0
+.TP
+.B nokiaaddfile TYPE [type options]
+Uploads file to phone to specific location for the type:
+.INDENT 7.0
+.TP
+.B APPLICATION|GAME file [\-readonly] [\-overwrite] [\-overwriteall]
+Install the \fB*.jar/*.jad\fP file pair of a midlet in the application or
+game menu of the phone. You need to specify filename without the jar/jad
+suffix, both will be added automatically.
+.INDENT 7.0
+.TP
+.B \-overwrite
+Delete the application’s .jad and .jar files before installing, but
+doesn’t delete the application data.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B \-overwriteall
+Delete the application (same as \fB\-overwrite\fP) and all it’s
+data.
+.UNINDENT
+.sp
+You can use jadmaker to generate a .jad file from a .jar file.
+.UNINDENT
+.INDENT 7.0
+.TP
+.B GALLERY|GALLERY2|CAMERA|TONES|TONES2|RECORDS|VIDEO|PLAYLIST|MEMORYCARD file [\-name name] [\-protected] [\-readonly] [\-system] [\-hidden] [\-newtime]
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B nokiaaddplaylists
+Goes through phone memory and generated playlist for all music files found.
+.sp
+To manually manage playlists:
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu addfile a:\e\epredefplaylist filename.m3u
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Will add playlist filename.m3u
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu getfilesystem
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Will get list of all files (including names of files with playlists)
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu deletefiles a:\e\epredefplaylist\e\efilename.m3u
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Will delete playlist filename.m3u
+.sp
+Format of m3u playlist is easy (standard mp3 playlist):
+.sp
+First line is \fB#EXTM3U\fP, next lines contain names of files (\fBb:\efile1.mp3\fP,
+\fBb:\efolder1\efile2.mp3\fP, etc.). File needs t have \fB\er\en\fP terminated lines. So
+just run \fBunix2dos\fP on the resulting file before uploading it your your phone.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B nokiacomposer file
+Show, how to enter RTTL ringtone in composer existing in many Nokia phones
+(and how should it look like).
+.UNINDENT
+.INDENT 0.0
+.TP
+.B nokiadebug filename [[v11\-22] [,v33\-44]...]
+.UNINDENT
+.INDENT 0.0
+.TP
+.B nokiadisplayoutput
+.UNINDENT
+.INDENT 0.0
+.TP
+.B nokiadisplaytest number
+.UNINDENT
+.INDENT 0.0
+.TP
+.B nokiagetadc
+.UNINDENT
+.INDENT 0.0
+.TP
+.B nokiagetoperatorname
+6110.c phones have place for name for one GSM network (of course, with flashing it’s
+possible to change all names, but Gammu is not flasher ;\-)). You can get this
+name using this option.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B nokiagetpbkfeatures memorytype
+.UNINDENT
+.INDENT 0.0
+.TP
+.B nokiagett9
+This option should display T9 dictionary content from
+DCT4 phones.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B nokiagetvoicerecord location
+Get voice record from location and save to WAV file. File is
+coded using GSM 6.10 codec (available for example in win32). Name
+of file is like name of voice record in phone.
+.sp
+Created WAV files require GSM 6.10 codec to be played. In Win XP it’s included
+by Microsoft. If you deleted it by accident in this operating system, make such
+steps:
+.INDENT 7.0
+.IP 1. 4
+Control Panel
+.IP 2. 4
+Add hardware
+.IP 3. 4
+click Next
+.IP 4. 4
+select “Yes. I have already connected the hardware
+.IP 5. 4
+select “Add a new hardware device
+.IP 6. 4
+select “Install the hardware that I manually select from a list
+.IP 7. 4
+select “Sound, video and game controllers
+.IP 8. 4
+select “Audio codecs
+.IP 9. 4
+select “windows\esystem32†directory and file “mmdriver.inf
+.IP 10. 4
+if You will be asked for file msgsm32.acm, it should unpacked from Windows CD
+.IP 11. 4
+now You can be asked if want to install unsigned driver (YES), about select codec configuration (select what you want) and rebotting PC (make it)
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B nokiamakecamerashoot
+.UNINDENT
+.INDENT 0.0
+.TP
+.B nokianetmonitor test
+Takes output or set netmonitor for Nokia DCT3 phones.
+.sp
+\fBSEE ALSO:\fP
+.INDENT 7.0
+.INDENT 3.5
+For more info about this option, please visit
+\fI\%Marcin’s page\fP and read netmonitor manual
+there.
+.UNINDENT
+.UNINDENT
+.sp
+\fBNOTE:\fP
+.INDENT 7.0
+.INDENT 3.5
+test \fB243\fP enables all tests (after using command
+\fBgammu nokianetmonitor 243\fP in some phones like 6210 or 9210 have to reboot
+them to see netmonitor menu)
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B nokianetmonitor36
+Reset counters from netmonitor test 36 in Nokia DCT3 phones.
+.sp
+\fBSEE ALSO:\fP
+.INDENT 7.0
+.INDENT 3.5
+For more info about this option, please visit
+\fI\%Marcin’s page\fP and read netmonitor manual
+there.
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B nokiasecuritycode
+Get/reset to “12345†security code
+.UNINDENT
+.INDENT 0.0
+.TP
+.B nokiaselftests
+Perform tests for Nokia DCT3 phones.
+.sp
+\fBNOTE:\fP
+.INDENT 7.0
+.INDENT 3.5
+EEPROM test can show an error when your phone has an EEPROM in flash
+(like 82xx/7110/62xx/33xx). The clock test will show an error when the
+phone doesn’t have an internal battery for the clock (like 3xxx).
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B nokiasetlights keypad|display|torch on|off
+.UNINDENT
+.INDENT 0.0
+.TP
+.B nokiasetoperatorname [networkcode name]
+.UNINDENT
+.INDENT 0.0
+.TP
+.B nokiasetphonemenus
+Enable all (?) possible menus for DCT3 Nokia phones:
+.INDENT 7.0
+.IP 1. 3
+ALS (Alternative Line Service) option menu
+.IP 2. 3
+vibra menu for 3210
+.IP 3. 3
+3315 features in 3310 5.45 and higher
+.IP 4. 3
+two additional games (React and Logic) for 3210 5.31 and higher
+.IP 5. 3
+WellMate menu for 6150
+.IP 6. 3
+NetMonitor
+.UNINDENT
+.sp
+and for DCT4:
+.INDENT 7.0
+.IP 1. 3
+ALS (Alternative Line Service) option menu
+.IP 2. 3
+Bluetooth, WAP bookmarks and settings menu, … (6310i)
+.IP 3. 3
+GPRS Always Online
+.IP 4. 3
+and others…
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B nokiasetvibralevel level
+Set vibra power to “level†(given in percent)
+.UNINDENT
+.INDENT 0.0
+.TP
+.B nokiatuneradio
+.UNINDENT
+.INDENT 0.0
+.TP
+.B nokiavibratest
+.UNINDENT
+.SS Siemens specific commands
+.INDENT 0.0
+.TP
+.B siemensnetmonact netmon_type
+Enables network monitor in Siemens phone. Currently known values for type
+are 1 for full and 2 for simple mode.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B siemensnetmonitor test
+.UNINDENT
+.INDENT 0.0
+.TP
+.B siemenssatnetmon
+.UNINDENT
+.SS Network commands
+.INDENT 0.0
+.TP
+.B getgprspoint start [stop]
+.UNINDENT
+.INDENT 0.0
+.TP
+.B listnetworks [country]
+Show names/codes of GSM networks known for Gammu
+.UNINDENT
+.INDENT 0.0
+.TP
+.B networkinfo
+Show information about network status from the phone.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B setautonetworklogin
+.UNINDENT
+.SS WAP settings and bookmarks commands
+.INDENT 0.0
+.TP
+.B deletewapbookmark start [stop]
+Delete WAP bookmarks from phone.
+.sp
+Locations are numerated from 1.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getchatsettings start [stop]
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getsyncmlsettings start [stop]
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getwapbookmark start [stop]
+Get WAP bookmarks from phone.
+.sp
+Locations are numerated from 1.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getwapsettings start [stop]
+Get WAP settings from phone.
+.sp
+Locations are numerated from 1.
+.UNINDENT
+.SS MMS and MMS settings commands
+.INDENT 0.0
+.TP
+.B getallmms [\-save]
+.UNINDENT
+.INDENT 0.0
+.TP
+.B geteachmms [\-save]
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getmmsfolders
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getmmssettings start [stop]
+.UNINDENT
+.INDENT 0.0
+.TP
+.B readmmsfile file [\-save]
+.UNINDENT
+.SS FM radio commands
+.INDENT 0.0
+.TP
+.B getfmstation start [stop]
+Show info about FM stations in phone
+.UNINDENT
+.SS Phone information commands
+.INDENT 0.0
+.TP
+.B battery
+Displays information about battery and power source.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getdisplaystatus
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getsecuritystatus
+Show, if phone wait for security code (like PIN, PUK, etc.) or not
+.UNINDENT
+.INDENT 0.0
+.TP
+.B identify
+Show the most important phone data.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B monitor [times]
+Retrieves phone status and writes it continuously to standard output. Press
+\fBCtrl+C\fP to interrupt this command.
+.sp
+If no parameter is given, the program runs until interrupted, otherwise
+only given number of iterations is performed.
+.sp
+This command outputs almost all information Gammu supports:
+.INDENT 7.0
+.IP \(bu 2
+Number of contacts, calendar and todo entries, messages, calls, etc.
+.IP \(bu 2
+Signal strength.
+.IP \(bu 2
+Battery state.
+.IP \(bu 2
+Currently used network.
+.IP \(bu 2
+Notifications of incoming messages and calls.
+.UNINDENT
+.UNINDENT
+.SS Phone settings commands
+.INDENT 0.0
+.TP
+.B getcalendarsettings
+Displays calendar settings like first day of
+week or automatic deleting of old entries.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B getprofile start [stop]
+.UNINDENT
+.INDENT 0.0
+.TP
+.B resetphonesettings PHONE|DEV|UIF|ALL|FACTORY
+.sp
+\fBWARNING:\fP
+.INDENT 7.0
+.INDENT 3.5
+This will delete user data, be careful.
+.UNINDENT
+.UNINDENT
+.sp
+Reset phone settings.
+.INDENT 7.0
+.TP
+.B \fBPHONE\fP
+Clear phone settings.
+.TP
+.B \fBDEV\fP
+Clear device settings.
+.TP
+.B \fBALL\fP
+Clear user settings.
+.INDENT 7.0
+.IP \(bu 2
+removes or set logos to default
+.IP \(bu 2
+set default phonebook and other menu settings
+.IP \(bu 2
+clear T9 words,
+.IP \(bu 2
+clear call register info
+.IP \(bu 2
+set default profiles settings
+.IP \(bu 2
+clear user ringtones
+.UNINDENT
+.TP
+.B \fBUIF\fP
+Clear user settings and disables hidden menus.
+.INDENT 7.0
+.IP \(bu 2
+changes like after \fBALL\fP
+.IP \(bu 2
+disables netmon and PPS (all “hidden†menus)
+.UNINDENT
+.TP
+.B \fBFACTORY\fP
+Reset to factory defaults.
+.INDENT 7.0
+.IP \(bu 2
+changes like after \fBUIF\fP
+.IP \(bu 2
+clear date/time
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.SS Dumps decoding commands
+.sp
+\fBNOTE:\fP
+.INDENT 0.0
+.INDENT 3.5
+These commands are available only if Gammu was compiled with debugging options.
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B decodebinarydump file [phonemodel]
+Decodes a dump made by Gammu with
+\fBLogFormat\fP set to \fBbinary\fP\&.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B decodesniff MBUS2|IRDA file [phonemodel]
+Allows one to decode sniffs. See Discovering protocol for more details.
+.UNINDENT
+.SS Other commands
+.INDENT 0.0
+.TP
+.B entersecuritycode PIN|PUK|PIN2|PUK2|PHONE|NETWORK code|\- [newpin|\-]
+Allow one to enter security code from PC. When code is \fB\-\fP, it is read from stdin.
+.sp
+In case entering PUK, some phones require you to set new PIN as well.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B presskeysequence mMnNpPuUdD+\-123456789*0#gGrR<>[]hHcCjJfFoOmMdD@
+Press specified key sequence on phone keyboard
+.INDENT 7.0
+.TP
+.B \fBmM\fP
+Menu
+.TP
+.B \fBnN\fP
+Names key
+.TP
+.B \fBpP\fP
+Power
+.TP
+.B \fBuU\fP
+Up
+.TP
+.B \fBdD\fP
+Down
+.TP
+.B \fB+\-\fP
++\-
+.TP
+.B \fBgG\fP
+Green
+.TP
+.B \fBrR\fP
+Red
+.TP
+.B \fB123456789*0#\fP
+numeric keyboard
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B reset SOFT|HARD
+Make phone reset:
+.INDENT 7.0
+.TP
+.B \fBSOFT\fP
+without asking for PIN
+.TP
+.B \fBHARD\fP
+with asking for PIN
+.UNINDENT
+.sp
+\fBNOTE:\fP
+.INDENT 7.0
+.INDENT 3.5
+Some phones will ask for PIN even with \fBSOFT\fP option.
+.UNINDENT
+.UNINDENT
+.sp
+\fBWARNING:\fP
+.INDENT 7.0
+.INDENT 3.5
+Some phones will reset user data on \fBHARD\fP reset.
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B setpower ON|OFF
+New in version 1.33.90.
+
+.sp
+Turns off or on the phone.
+.sp
+\fBNOTE:\fP
+.INDENT 7.0
+.INDENT 3.5
+This is usually required for built in modules in notebooks.
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B screenshot filename
+Captures phone screenshot and saves it as filename. The extension is
+automatically appended to filename based on what data phone provides.
+.UNINDENT
+.SS Batch mode commands
+.INDENT 0.0
+.TP
+.B batch [file]
+Starts Gammu in a batch mode. In this mode you can issue
+several commands each on one line. Lines starting with # are treated as a
+comments.
+.sp
+By default, commands are read from standard input, but you can optionally
+specify a file from where they would be read (special case \fB\-\fP means standard
+input).
+.UNINDENT
+.SS Configuration commands
+.INDENT 0.0
+.TP
+.B searchphone [\-debug]
+Attempts to search for a connected phone.
+.sp
+\fBWARNING:\fP
+.INDENT 7.0
+.INDENT 3.5
+Please note that this can take a very long time, but in case you have
+no clue how to configure phone connection, this is a convenient way to
+find working setup for Gammu.
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B install [\-minimal]
+Installs applet for currently configured connection to the phone.
+.sp
+You can configure search path for installation files by
+\fBDataPath\fP\&.
+.sp
+The \-minimal parameter forces installation of applet only without possible
+support libraries, this can be useful for updates.
+.UNINDENT
+.SS Gammu information commands
+.INDENT 0.0
+.TP
+.B checkversion [STABLE]
+Checks whether there is newer Gammu version
+available online (if Gammu has been compiled with CURL). If you pass
+additional parameter \fBSTABLE\fP, only stable versions will be checked.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B features
+Print information about compiled in features.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B help [topic]
+Print help. By default general help is printed, but you can
+also specify a help category to get more detailed help on some topic.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B version
+Print version information and license.
+.UNINDENT
+.SH RETURN VALUES
+.sp
+gammu returns 0 on success. In case of failure non zero code is
+returned.
+.INDENT 0.0
+.TP
+.B 1
+Out of memory or other critical error.
+.TP
+.B 2
+Invalid command line parameters.
+.TP
+.B 3
+Failed to open file specified on command line.
+.TP
+.B 4
+Program was interrupted.
+.TP
+.B 98
+Gammu library version mismatch.
+.TP
+.B 99
+Functionality has been moved. For example to gammu\-smsd\&.
+.UNINDENT
+.sp
+Errors codes greater than 100 map to the GSM_Error
+values increased by 100:
+.INDENT 0.0
+.TP
+.B 101
+No error.
+.TP
+.B 102
+Error opening device. Unknown, busy or no permissions.
+.TP
+.B 103
+Error opening device, it is locked.
+.TP
+.B 104
+Error opening device, it doesn’t exist.
+.TP
+.B 105
+Error opening device, it is already opened by other application.
+.TP
+.B 106
+Error opening device, you don’t have permissions.
+.TP
+.B 107
+Error opening device. No required driver in operating system.
+.TP
+.B 108
+Error opening device. Some hardware not connected/wrongly configured.
+.TP
+.B 109
+Error setting device DTR or RTS.
+.TP
+.B 110
+Error setting device speed. Maybe speed not supported.
+.TP
+.B 111
+Error writing to the device.
+.TP
+.B 112
+Error during reading from the device.
+.TP
+.B 113
+Can’t set parity on the device.
+.TP
+.B 114
+No response in specified timeout. Probably phone not connected.
+.TP
+.B 115
+Frame not requested right now. See <\fI\%https://wammu.eu/support/bugs/\fP> for information how to report it.
+.TP
+.B 116
+Unknown response from phone. See <\fI\%https://wammu.eu/support/bugs/\fP> for information how to report it.
+.TP
+.B 117
+Unknown frame. See <\fI\%https://wammu.eu/support/bugs/\fP> for information how to report it.
+.TP
+.B 118
+Unknown connection type string. Check config file.
+.TP
+.B 119
+Unknown model type string. Check config file.
+.TP
+.B 120
+Some functions not available for your system (disabled in config or not implemented).
+.TP
+.B 121
+Function not supported by phone.
+.TP
+.B 122
+Entry is empty.
+.TP
+.B 123
+Security error. Maybe no PIN?
+.TP
+.B 124
+Invalid location. Maybe too high?
+.TP
+.B 125
+Functionality not implemented. You are welcome to help authors with it.
+.TP
+.B 126
+Memory full.
+.TP
+.B 127
+Unknown error.
+.TP
+.B 128
+Can not open specified file.
+.TP
+.B 129
+More memory required…
+.TP
+.B 130
+Operation not allowed by phone.
+.TP
+.B 131
+No SMSC number given. Provide it manually or use the one configured in phone.
+.TP
+.B 132
+You’re inside phone menu (maybe editing?). Leave it and try again.
+.TP
+.B 133
+Phone is not connected.
+.TP
+.B 134
+Function is currently being implemented. If you want to help, please contact authors.
+.TP
+.B 135
+Phone is disabled and connected to charger.
+.TP
+.B 136
+File format not supported by Gammu.
+.TP
+.B 137
+Nobody is perfect, some bug appeared in protocol implementation. Please contact authors.
+.TP
+.B 138
+Transfer was canceled by phone, maybe you pressed cancel on phone.
+.TP
+.B 139
+Phone module need to send another answer frame.
+.TP
+.B 140
+Current connection type doesn’t support called function.
+.TP
+.B 141
+CRC error.
+.TP
+.B 142
+Invalid date or time specified.
+.TP
+.B 143
+Phone memory error, maybe it is read only.
+.TP
+.B 144
+Invalid data given to phone.
+.TP
+.B 145
+File with specified name already exists.
+.TP
+.B 146
+File with specified name doesn’t exist.
+.TP
+.B 147
+You have to give folder name and not file name.
+.TP
+.B 148
+You have to give file name and not folder name.
+.TP
+.B 149
+Can not access SIM card.
+.TP
+.B 150
+Wrong GNAPPLET version in phone. Use version from currently used Gammu.
+.TP
+.B 151
+Only part of folder has been listed.
+.TP
+.B 152
+Folder must be empty.
+.TP
+.B 153
+Data were converted.
+.TP
+.B 154
+Gammu is not configured.
+.TP
+.B 155
+Wrong folder used.
+.TP
+.B 156
+Internal phone error.
+.TP
+.B 157
+Error writing file to disk.
+.TP
+.B 158
+No such section exists.
+.TP
+.B 159
+Using default values.
+.TP
+.B 160
+Corrupted data returned by phone.
+.TP
+.B 161
+Bad feature string in configuration.
+.TP
+.B 162
+Desired functionality has been disabled on compile time.
+.TP
+.B 163
+Bluetooth configuration requires channel option.
+.TP
+.B 164
+Service is not running.
+.TP
+.B 165
+Service configuration is missing.
+.TP
+.B 166
+Command rejected because device was busy. Wait and restart.
+.TP
+.B 167
+Could not connect to the server.
+.TP
+.B 168
+Could not resolve the host name.
+.TP
+.B 169
+Failed to get SMSC number from phone.
+.TP
+.B 170
+Operation aborted.
+.TP
+.B 171
+Installation data not found, please consult debug log and/or documentation for more details.
+.TP
+.B 172
+Entry is read only.
+.UNINDENT
+.SH EXAMPLES
+.SS Configuration
+.sp
+To check it out, you need to have configuration file for gammu, see
+gammurc for more details about it.
+.SS Sending messages
+.sp
+\fBNOTE:\fP
+.INDENT 0.0
+.INDENT 3.5
+All messages below are sent to number 123456, replace it with proper destination.
+.UNINDENT
+.UNINDENT
+.sp
+Send text message up to standard 160 chars:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+echo "All your base are belong to us" | gammu sendsms TEXT 123456
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+or
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu sendsms TEXT 123456 \-text "All your base are belong to us"
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Send long text message:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+echo "All your base are belong to us" | gammu sendsms TEXT 123456 \-len 400
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+or
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu sendsms TEXT 123456 \-len 400 \-text "All your base are belong to us"
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+or
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu sendsms EMS 123456 \-text "All your base are belong to us"
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Send some funky message with predefined sound and animation from 2 bitmaps:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu sendsms EMS 123456 \-text "Greetings" \-defsound 1 \-text "from Gammu \-tone10 axelf.txt \-animation 2 file1.bmp file2.bmp
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Send protected message with ringtone:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu sendsms EMS 123456 \-protected 2 \-variablebitmaplong ala.bmp \-toneSElong axelf.txt \-toneSE ring.txt
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Retrieving USSD replies
+.sp
+For example for retrieving prepaid card status or retrieving various network info:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu getussd \(aq#555#\(aq
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Uploading files to Nokia
+.sp
+Add Alien to applications in your phone (you need to have files Alien.JAD and Alien.JAR in current directory):
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu nokiaaddfile APPLICATION Alien
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Add file.mid to ringtones folder:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu nokiaaddfile TONES file.mid
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Setting operator logo
+.sp
+Set logo for network \fB230 03\fP (Vodafone CZ):
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu setbitmap OPERATOR ala.bmp "230 03"
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Converting file formats
+.sp
+The formats conversion can done using \fBgammu savefile\fP or
+\fBgammu convertbackup\fP commands.
+.sp
+Convert single entry (at position 260) from gammu\-backup to vCalendar:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu savefile CALENDAR output.vcs myCalendar.backup 260
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Convert first phonebook entry from gammu\-backup to vCard:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu savefile VCARD21 output.vcf phone.backup ME 1
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Convert all contacts from backup to vCard:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu convertbackup phone.backup output.vcf
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Reporting bugs
+.sp
+There are definitely many bugs, reporting to author is welcome. Please include
+some useful information when sending bug reports (especially debug logs,
+operating system, it’s version and phone information are needed).
+.sp
+To generate debug log, enable it in gammurc:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[gammu]
+YOUR CONNECTION SETTINGS
+logfile = /tmp/gammu.log
+logformat = textall
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Alternatively you can specify logging on command line:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+gammu \-d textall \-f /tmp/gammu.log ...
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+With this settings, Gammu generates /tmp/gammu.log on each connection to
+phone and stores dump of communication there. You can also find some
+hints for improving support for your phone in this log.
+.sp
+See <\fI\%https://wammu.eu/support/bugs/\fP> for more information on reporting bugs.
+.sp
+Please report bugs to \fI\%Gammu bug tracker\fP\&.
+.SH AUTHOR
+Michal ÄŒihaÅ™ <michal@cihar.com>
+.SH COPYRIGHT
+2009-2015, Michal ÄŒihaÅ™ <michal@cihar.com>
+.\" Generated by docutils manpage writer.
+.
diff --git a/docs/man/gammurc.5 b/docs/man/gammurc.5
new file mode 100644
index 0000000..ef0a5c2
--- /dev/null
+++ b/docs/man/gammurc.5
@@ -0,0 +1,771 @@
+.\" Man page generated from reStructuredText.
+.
+.TH "GAMMURC" "5" "Oct 16, 2017" "1.38.5" "Gammu"
+.SH NAME
+gammurc \- gammu(1) configuration file
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+On Linux, MacOS X, BSD and other Unix\-like systems, the config file is
+searched in following order:
+.INDENT 0.0
+.IP 1. 3
+\fB$XDG_CONFIG_HOME/gammu/config\fP
+.IP 2. 3
+\fB~/.config/gammu/config\fP
+.IP 3. 3
+\fB~/.gammurc\fP
+.IP 4. 3
+\fB/etc/gammurc\fP
+.UNINDENT
+.sp
+On Microsoft Windows:
+.INDENT 0.0
+.IP 1. 3
+\fB%PROFILE%\eApplication Data\egammurc\fP
+.IP 2. 3
+\fB\&.\egammurc\fP
+.UNINDENT
+.SH DESCRIPTION
+.sp
+Gammu requires configuration to be able to properly talk to your phone.
+gammu reads configuration from a config file. It’s location is determined
+on runtime, see above for search paths.
+.sp
+You can use gammu\-config or gammu\-detect to generate
+configuration file or start from \fI\%Fully documented example\fP\&.
+.sp
+For hints about configuring your phone, you can check Gammu Phone
+Database <\fI\%https://wammu.eu/phones/\fP> to see what user users
+experienced.
+.sp
+This file use ini file syntax, see ini\&.
+.sp
+Configuration file for gammu can contain several sections \- \fB[gammu]\fP, \fB[gammu1]\fP,
+\fB[gammuN]\fP, … Each section configures one connection setup and in default mode
+gammu tries all of them in numerical order. You can also specify which
+configuration section to use by giving it’s number (\fI\%[gammu]\fP has number 0) as a
+parameter to gammu and it will then use only this section.
+.INDENT 0.0
+.TP
+.B [gammu]
+.UNINDENT
+.sp
+This section is read by default unless you specify other on command line.
+.SS Device connection parameters
+.INDENT 0.0
+.TP
+.B Connection
+Protocol which will be used to talk to your phone.
+.sp
+For Nokia cables you want to use one of following:
+.INDENT 7.0
+.TP
+.B \fBfbus\fP
+serial FBUS connection
+.TP
+.B \fBdlr3\fP
+DLR\-3 and compatible cables
+.TP
+.B \fBdku2\fP
+DKU\-2 and compatible cables
+.TP
+.B \fBdku5\fP
+DKU\-5 and compatible cables
+.TP
+.B \fBmbus\fP
+serial MBUS connection
+.UNINDENT
+.sp
+If you use some non original cable, you might need to append \fB\-nodtr\fP (eg. for
+ARK3116 based cables) or \fB\-nopower\fP, but Gammu should be able to detect this
+automatically.
+.sp
+For non\-Nokia phones connected using cable you generally want:
+.INDENT 7.0
+.TP
+.B \fBat\fP
+generic AT commands based connection
+.UNINDENT
+.sp
+You can optionally specify speed of the connection, eg. \fBat19200\fP, but it is
+not needed for modern USB cables.
+.sp
+For IrDA connections use one of following:
+.INDENT 7.0
+.TP
+.B \fBirdaphonet\fP
+Phonet connection for Nokia phones.
+.TP
+.B \fBirdaat\fP
+AT commands connection for most of phones (this is not supported on Linux).
+.TP
+.B \fBirdaobex\fP
+OBEX (IrMC or file transfer) connection for most of phones.
+.TP
+.B \fBirdagnapbus\fP
+GNapplet based connection for Symbian phones, see gnapplet\&.
+.UNINDENT
+.sp
+For Bluetooth connection use one of following:
+.INDENT 7.0
+.TP
+.B \fBbluephonet\fP
+Phonet connection for Nokia phones.
+.TP
+.B \fBbluefbus\fP
+FBUS connection for Nokia phones.
+.TP
+.B \fBblueat\fP
+AT commands connection for most of phones.
+.TP
+.B \fBblueobex\fP
+OBEX (IrMC or file transfer) connection for most of phones.
+.TP
+.B \fBbluerfgnapbus\fP
+GNapplet based connection for Symbian phones, see gnapplet\&.
+.TP
+.B \fBblues60\fP
+Connection to Series60 applet in S60 phones, see s60\&.
+.sp
+New in version 1.29.90.
+
+.UNINDENT
+.sp
+New in version 1.36.7: Gammu now supports connecting using proxy command.
+
+.sp
+You can also proxy the connection using shell command, for example to
+different host. This can be done using proxy connections:
+.INDENT 7.0
+.TP
+.B \fBproxyphonet\fP
+Phonet connection for Nokia phones.
+.TP
+.B \fBproxyfbus\fP
+FBUS connection for Nokia phones.
+.TP
+.B \fBproxyat\fP
+AT commands connection for most of phones.
+.TP
+.B \fBproxyobex\fP
+OBEX (IrMC or file transfer) connection for most of phones.
+.TP
+.B \fBproxygnapbus\fP
+GNapplet based connection for Symbian phones, see gnapplet\&.
+.TP
+.B \fBproxys60\fP
+Connection to Series60 applet in S60 phones, see s60\&.
+.UNINDENT
+.sp
+\fBSEE ALSO:\fP
+.INDENT 7.0
+.INDENT 3.5
+faq\-config
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B Device
+New in version 1.27.95.
+
+.sp
+Device node or address of phone. It depends on used connection.
+.sp
+For \fBcables\fP or emulated serial ports, you enter device name (for example
+\fB/dev/ttyS0\fP, \fB/dev/ttyACM0\fP, \fB/dev/ircomm0\fP, \fB/dev/rfcomm0\fP on Linux,
+\fB/dev/cuad0\fP on FreeBSD or \fBCOM1:\fP 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.
+.sp
+\fBNOTE:\fP
+.INDENT 7.0
+.INDENT 3.5
+Some USB modems expose several interfaces, in such cases Gammu works best
+with “User†one, you can find more information on
+<\fI\%http://www.dd\-wrt.com/wiki/index.php/Mobile_Broadband\fP>.
+.UNINDENT
+.UNINDENT
+.sp
+For \fBUSB\fP 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:
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+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
+Device = serial:123456 # Match device by serial string
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+\fBNOTE:\fP
+.INDENT 7.0
+.INDENT 3.5
+On Linux systems, you might lack permissions for some device nodes.
+You might need to be member of some group (eg. \fBplugdev\fP or
+\fBdialout\fP) or or add special udev rules to enable you access
+these devices as non\-root.
+.sp
+For Nokia phones you can put following file (also available in sources
+as \fBcontrib/udev/69\-gammu\-acl.rules\fP) as
+\fB/etc/udev/rules.d/69\-gammu\-acl.rules\fP:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+#
+# udev rule to give users access to USB device to be used by Gammu
+#
+
+ACTION!="add|change", GOTO="gammu_acl_rules_end"
+
+KERNEL!="ttyACM[0\-9]*", GOTO="gammu_acl_rules_end"
+SUBSYSTEM!="tty", GOTO="gammu_acl_rules_end"
+
+# Nokia devices
+ATTRS{manufacturer}=="Nokia", TAG+="uaccess"
+
+# Example for Sony Ericsson J108i Cedar
+# ATTRS{idVendor}=="0fce", ATTRS{idProduct}=="d14e", TAG+="uaccess"
+
+LABEL="gammu_acl_rules_end"
+
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.sp
+In case your USB device appears as the serial port in the system (eg.
+\fB/dev/ttyACM0\fP on Linux or \fBCOM5:\fP on Windows), just use same setup as
+with serial port.
+.sp
+For \fBBluetooth\fP connection you have to enter Bluetooth address of your phone
+(you can list Bluetooth devices in range on Linux using \fBhcitool scan\fP
+command). Optionally you can also force Gammu to use specified channel by
+including channel number after slash.
+.sp
+Before using Gammu, your device should be paired with computer or you should
+have set up automatic pairing.
+.sp
+For \fBProxy\fP connections, you need to specify command which should be
+executed. It is supposed to pass bidirectional communication from Gammu to
+the device. This can happen for example over network.
+.sp
+For \fBIrDA\fP connections, this parameters is not used at all.
+.sp
+If IrDA does not work on Linux, you might need to bring up the interface and
+enable discovery (you need to run these commands as root):
+.INDENT 7.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+ip l s dev irda0 up # Enables irda0 device
+sysctl net.irda.discovery=1 # Enables device discovery on IrDA
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+\fBNOTE:\fP
+.INDENT 7.0
+.INDENT 3.5
+Native IrDA is not supported on Linux, you need to setup virtual
+serial port for it (eg. \fB/dev/ircomm0\fP) and use it same way as cable.
+This can be usually achieved by loading modules \fBircomm\-tty\fP and \fBirtty\-sir\fP:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+modprobe ircomm\-tty
+modprobe irtty\-sir
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.sp
+\fBSEE ALSO:\fP
+.INDENT 7.0
+.INDENT 3.5
+faq\-config
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B Port
+Deprecated since version 1.27.95: Please use \fI\%Device\fP instead.
+
+.sp
+Alias for \fI\%Device\fP, kept for backward compatibility.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B Model
+Do not use this parameter unless really needed! The only use case for this is
+when Gammu does not know your phone and misdetects it’s features.
+.sp
+The only special case for using model is to force special type of OBEX
+connection instead of letting Gammu try the best suited for selected
+operation:
+.INDENT 7.0
+.TP
+.B \fBobexfs\fP
+force using of file browsing service (file system support)
+.TP
+.B \fBobexirmc\fP
+force using of IrMC service (contacts, calendar and notes support)
+.TP
+.B \fBobexnone\fP
+none service chosen, this has only limited use for sending file (\fBgammu sendfile\fP command)
+.TP
+.B \fBmobex\fP
+m\-obex service for Samsung phones
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B Use_Locking
+On Posix systems, you might want to lock serial device when it is being used
+using UUCP\-style lock files. Enabling this option (setting to yes) will make
+Gammu honor these locks and create it on startup. On most distributions you
+need additional privileges to use locking (eg. you need to be member of uucp
+group).
+.sp
+This option has no meaning on Windows.
+.UNINDENT
+.SS Connection options
+.INDENT 0.0
+.TP
+.B SynchronizeTime
+If you want to set time from computer to phone during starting connection.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B StartInfo
+This option allows one to set, that you want (setting \fByes\fP) to see
+message on the phone screen or phone should enable light for a moment
+during starting connection. Phone will not beep during starting connection
+with this option. This works only with some Nokia phones.
+.UNINDENT
+.SS Debugging options
+.INDENT 0.0
+.TP
+.B LogFile
+Path to file where information about communication will be stored.
+.sp
+\fBNOTE:\fP
+.INDENT 7.0
+.INDENT 3.5
+For most debug levels (excluding \fBerrors\fP) the log file is overwritten on
+each execution.
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B LogFormat
+Determines what all will be logged to \fBLogFile\fP\&. Possible values are:
+.INDENT 7.0
+.TP
+.B \fBnothing\fP
+no debug level
+.TP
+.B \fBtext\fP
+transmission dump in text format
+.TP
+.B \fBtextall\fP
+all possible info in text format
+.TP
+.B \fBtextalldate\fP
+all possible info in text format, with time stamp
+.TP
+.B \fBerrors\fP
+errors in text format
+.TP
+.B \fBerrorsdate\fP
+errors in text format, with time stamp
+.TP
+.B \fBbinary\fP
+transmission dump in binary format
+.UNINDENT
+.sp
+For debugging use either \fBtextalldate\fP or \fBtextall\fP, it contains all
+needed information to diagnose problems.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B Features
+Custom features for phone. This can be used as override when values coded
+in \fBcommon/gsmphones.c\fP are bad or missing. Consult
+\fBinclude/gammu\-info.h\fP for possible values (all \fBGSM_Feature\fP values
+without leading \fBF_\fP prefix). Please report correct values to Gammu
+authors.
+.UNINDENT
+.SS Locales and character set options
+.INDENT 0.0
+.TP
+.B GammuCoding
+Forces using specified codepage (for example \fB1250\fP will force CP\-1250 or
+\fButf8\fP for UTF\-8). This should not be needed, Gammu detects it according
+to your locales.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B GammuLoc
+Path to directory with localisation files (the directory should contain
+\fBLANG/LC_MESSAGES/gammu.mo\fP). If gammu is properly installed it should find
+these files automatically.
+.UNINDENT
+.SS Other options
+.INDENT 0.0
+.TP
+.B DataPath
+Additional path where to search for data files. The default path is
+configured on build time (and defaults to \fB/usr/share/data/gammu\fP on Unix
+systems). Currently it is used only for searching files to upload to phone
+using \fBgammu install\fP\&.
+.UNINDENT
+.SH EXAMPLES
+.sp
+There is more complete example available in Gammu documentation, see gammu\&.
+.SS Connection examples
+.sp
+Gammu configuration for Nokia phone using DLR\-3 cable:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[gammu]
+device = /dev/ttyACM0
+connection = dlr3
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Gammu configuration for Sony\-Ericsson phone (or any other AT compatible
+phone) connected using USB cable:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[gammu]
+device = /dev/ttyACM0
+connection = at
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Gammu configuration for Sony\-Ericsson (or any other AT compatible
+phone) connected using bluetooth:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[gammu]
+device = B0:0B:00:00:FA:CE
+connection = blueat
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Gammu configuration for phone which needs to manually adjust Bluetooth channel to use channel 42:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[gammu]
+device = B0:0B:00:00:FA:CE/42
+connection = blueat
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Working with multiple phones
+.sp
+Gammu can be configured for multiple phones (however only one connection
+is used at one time, you can choose which one to use with \fI\%gammu \-s\fP
+parameter). Configuration for phones on three serial ports would look
+like following:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[gammu]
+device = /dev/ttyS0
+connection = at
+
+[gammmu1]
+device = /dev/ttyS1
+connection = at
+
+[gammmu2]
+device = /dev/ttyS2
+connection = at
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Connecting to remote phone
+.sp
+New in version 1.36.7.
+
+.sp
+You can connect using Gammu to phone running on different host. This can be
+achieved using proxy connection, which executes command to forward
+bi\-directional communication with the phone.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+[gammu]
+device = ssh root@my.router /usr/local/bin/myscript /dev/ttyUSB0
+connection = proxyat
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+You can find sample script which can be used on the remote side in
+\fBcontrib/proxy/gammu\-backend\fP\&.
+.SS Fully documented example
+.sp
+You can find this sample file as \fBdocs/config/gammurc\fP in Gammu sources.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+; This is a sample ~/.gammurc file.
+; In Unix/Linux copy it into your home directory and name it .gammurc
+; or into /etc and name it gammurc
+; In Win32 copy it into directory with Gammu.exe and name gammurc
+; More about parameters later
+; Anything behind ; or # is comment.
+; \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+
+[gammu]
+
+device = com8:
+connection = irdaphonet
+; Do not use model configuration unless you really need it
+;model = 6110
+;synchronizetime = yes
+;logfile = gammulog
+;logformat = textall
+;use_locking = yes
+;gammuloc = locfile
+;startinfo = yes
+;gammucoding = utf8
+;usephonedb = yes
+
+[gammu1]
+
+device = com8:
+;model = 6110
+connection = fbusblue
+;synchronizetime = yes
+;logfile = gammulog
+;logformat = textall
+;use_locking = yes
+;gammuloc = locfile
+;startinfo = yes
+;gammucoding = utf8
+
+; Step 1. Please find required Connection parameter and look into assigned
+; with it device type. With some Connection you must set concrete model
+
+; ================================================================ cables =====
+; New Nokia protocol for FBUS/DAU9P
+; Connection "fbus", device type serial
+; New Nokia protocol for DLR3/DLR3P
+; Connection "fbusdlr3"/"dlr3", device type serial
+; New Nokia protocol for DKU2 (and phone with USB converter on phone mainboard
+; like 6230)
+; Connection "dku2phonet"/"dku2", device type dku2 on Windows
+; Connection "fbususb" on Linux
+; New Nokia protocol for DKU5 (and phone without USB converter on phone
+; mainboard like 5100)
+; Connection "dku5fbus"/"dku5", device type dku5
+; New Nokia protocol for PL2303 USB cable (and phone without USB converter
+; on phone mainboard like 5100)
+; Connection "fbuspl2303", device type usb
+; Old Nokia protocol for MBUS/DAU9P
+; Connection "mbus", device type serial
+; Variants:
+; You can modify a bit behaviour of connection using additional flags
+; specified just after connection name like connection\-variant.
+; If you\(aqre using ARK3116 cable (or any other which does not like dtr
+; handling), you might need \-nodtr variant of connection, eg. dlr3\-nodtr.
+; If cable you use is not powered over DTR/RTS, try using \-nopower variant of
+; connection, eg. fbus\-nopower.
+; \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+; AT commands for DLR3, DKU5 or other AT compatible cable (8 bits, None
+; parity, no flow control, 1 stop bit). Used with Nokia, Alcatel, Siemens, etc.
+; Connection "at19200"/"at115200"/.., device type serial
+; AT commands for DKU2 cable
+; Connection "dku2at", device type dku2
+; ============================================================== infrared =====
+; Nokia protocol for infrared with Nokia 6110/6130/6150
+; Connection "fbusirda"/"infrared", device type serial
+; Nokia protocol for infrared with other Nokia models
+; Connection "irdaphonet"/"irda", device type irda
+; \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+; AT commands for infrared. Used with Nokia, Alcatel, Siemens, etc.
+; Connection "irdaat", device type irda
+; \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+; OBEX for infrared
+; Connection "irdaobex", device type irda.
+; ============================================================= Bluetooth =====
+; Nokia protocol with serial device set in BT stack (WidComm, other) from
+; adequate service and Nokia 6210
+; Connection "fbusblue", device type serial
+; Nokia protocol with serial device set in BT stack (WidComm, other) from
+; adequate service and other Nokia models
+; Connection "phonetblue", device type serial
+; \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+; Nokia protocol for Bluetooth stack with Nokia 6210
+; Connection "bluerffbus", device type BT
+; Nokia protocol for Bluetooth stack with DCT4 Nokia models, which don\(aqt inform
+; about services correctly (6310, 6310i with firmware lower than 5.50, 8910,..)
+; Connection "bluerfphonet", device type BT
+; Nokia protocol for Bluetooth stack with other DCT4 Nokia models
+; Connection "bluephonet", device type BT
+; \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+; AT commands for Bluetooth stack and 6210 / DCT4 Nokia models, which don\(aqt
+; inform about BT services correctly (6310, 6310i with firmware lower
+; than 5.50, 8910,..)
+; Connection "bluerfat", device type BT
+; AT commands for Bluetooth stack with other phones (Siemens, other Nokia,etc.)
+; Connection "blueat", device type BT
+; \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+; OBEX for Bluetooth stack with DCT4 Nokia models, which don\(aqt inform about
+; BT services correctly (6310, 6310i with firmware lower than 5.50, 8910,...)
+; Connection "bluerfobex", device type BT
+; OBEX for Bluetooth stack with other phones (Siemens, other Nokia, etc.)
+; Connection "blueobex", device type BT.
+; \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+; Connection "bluerfgnapbus", device type BT, model "gnap"
+; Connection "irdagnapbus", device type irda, model "gnap"
+
+; Step2. According to device type from Step1 and used OS set Port parameter
+
+; \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+; Port type | "Port" parameter in Windows/DOS | "Port" parameter in Linux/Unix
+; \-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+; serial | "com*:" | "/dev/ttyS*"
+; | (example "com1:") | (example "/dev/ttyS1")
+; | | or "/dev/tts/**" (with DevFS)
+; | | virtual serial ports like
+; | | "/dev/ircomm*" or "/dev/rfcomm*"
+; \-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+; irda | ignored (can be empty) | ignored (can be empty)
+; \-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+; BT | Bluetooth device address (example "00:11:22:33:44:55").
+; | Optionally you can also include channel after slash
+; | (example "00:11:22:33:44:55/12"). Can be also empty.
+; \-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+; dku2 | ignored (can be empty) | /dev/ttyUSB* or /dev/ttyACM*
+; \-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+; dku5 | ignored (can be empty) | connection with it not possible
+; \-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+; usb | connection with it not possible | "/dev/ttyUSB*"
+
+; Step3. Set other config parameters
+
+; \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+; Parameter name | Description
+; \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+; Model | Should not be used unless you have a good reason to do so.
+; | If Gammu doesn\(aqt recognize your phone model, put it here.
+; | Example values: "6110", "6150", "6210", "8210"
+; SynchronizeTime | if you want to set time from computer to phone during
+; | starting connection. Do not rather use this option when
+; | when to reset phone during connection (in some phones need
+; | to set time again after restart)
+; GammuLoc | name of localisation file
+; StartInfo | this option allows one to set, that you want (setting "yes")
+; | to see message on the phone screen or phone should enable
+; | light for a moment during starting connection. Phone
+; | WON\(aqT beep during starting connection with this option.
+; GammuCoding | forces using specified codepage (in win32 \- for example
+; | "1250" will force CP1250) or UTF8 (in Linux \- "utf8")
+; \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+; Logfile | Use, when want to have logfile from communication.
+; Logformat | What debug info and format should be used:
+; | "nothing" \- no debug level (default)
+; | "text" \- transmission dump in text format
+; | "textall" \- all possible info in text format
+; | "errors" \- errors in text format
+; | "binary" \- transmission dump in binary format
+; \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+; Features | Custom features for phone. This can be used as override
+; | when values coded in common/gsmphones.c are bad or
+; | missing. Consult include/gammu\-info.h for possible values
+; | (all Feature values without leading F_ prefix).
+; | Please report correct values to Gammu authors.
+; \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
+; Use_Locking | under Unix/Linux use "yes", if want to lock used device
+; | to prevent using it by other applications. In win32 ignored
+
+; vim: et ts=4 sw=4 sts=4 tw=78 spell spelllang=en_us
+
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH AUTHOR
+Michal ÄŒihaÅ™ <michal@cihar.com>
+.SH COPYRIGHT
+2009-2015, Michal ÄŒihaÅ™ <michal@cihar.com>
+.\" Generated by docutils manpage writer.
+.
diff --git a/docs/man/jadmaker.1 b/docs/man/jadmaker.1
new file mode 100644
index 0000000..eddea94
--- /dev/null
+++ b/docs/man/jadmaker.1
@@ -0,0 +1,70 @@
+.\" Man page generated from reStructuredText.
+.
+.TH "JADMAKER" "1" "Oct 16, 2017" "1.38.5" "Gammu"
+.SH NAME
+jadmaker \- JAD File Generator
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+jadmaker [\-f|\-\-force] [\-u|\-\-url URL] <filename.jar>...
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH DESCRIPTION
+.sp
+Script to generate JAD file from JAR file.
+.sp
+This program follows the usual GNU command line syntax, with long options
+starting with two dashes (\fB\-\fP). A summary of options is included below.
+.INDENT 0.0
+.TP
+.B \-h, \-\-help
+Show summary of options.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-f, \-\-force
+Force rewriting of JAD file even if exists.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-u, \-\-url URL
+Define URL to be included in JAD file.
+.UNINDENT
+.SH AUTHOR
+Michal ÄŒihaÅ™ <michal@cihar.com>
+.SH COPYRIGHT
+2009-2015, Michal ÄŒihaÅ™ <michal@cihar.com>
+.\" Generated by docutils manpage writer.
+.
diff --git a/docs/manual/CMakeLists.txt b/docs/manual/CMakeLists.txt
new file mode 100644
index 0000000..f803bef
--- /dev/null
+++ b/docs/manual/CMakeLists.txt
@@ -0,0 +1,51 @@
+# cmake <http://www.cmake.org> build file for Gammu docs
+# Copyright (c) 2007 - 2017 Michal Cihar
+# vim: expandtab sw=4 ts=4 sts=4:
+
+project (Gammu-doc-devel C)
+
+file(GLOB_RECURSE DOCSRC RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.rst")
+
+set (DEVELDOCS
+ ${DOCSRC}
+ )
+
+foreach (DOC ${DEVELDOCS})
+ get_filename_component(DIRNAME ${DOC} PATH)
+ install (
+ FILES ${DOC}
+ DESTINATION "${INSTALL_DOC_DIR}/manual/${DIRNAME}"
+ COMPONENT "manual"
+ )
+endforeach (DOC)
+
+find_program(SPHINX_BUILD_EXECUTABLE NAMES sphinx-build
+ DOC "Sphinx tool for generating Gammu documentation <http://sphinx.pocoo.org/>")
+
+if (SPHINX_BUILD_EXECUTABLE)
+ set (SPHINX_PAPER_SIZE "a4" CACHE STRING "Paper size for Sphinx LaTeX/PDF/PS output")
+ configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/conf.py" "${CMAKE_CURRENT_BINARY_DIR}/conf.py" @ONLY)
+ macro(sphinxdoc _format)
+ add_custom_target (manual-${_format} ${PYTHON_EXECUTABLE} ${SPHINX_BUILD_EXECUTABLE}
+ -c ${CMAKE_CURRENT_BINARY_DIR}/
+ -n
+ -b ${_format}
+ -D latex_paper_size=${SPHINX_PAPER_SIZE}
+ ${CMAKE_CURRENT_SOURCE_DIR}/
+ ${CMAKE_CURRENT_BINARY_DIR}/${_format}
+ COMMENT "Generating Sphinx documentation (${_format})")
+ add_dependencies(manual-${_format} apidoc)
+ endmacro(sphinxdoc _format)
+ sphinxdoc(html)
+ sphinxdoc(htmlhelp)
+ sphinxdoc(latex)
+ sphinxdoc(man)
+ add_custom_target(manual-pdf
+ yes '' | make all-pdf
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/latex)
+ add_custom_target(manual-ps
+ yes '' | make all-ps
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/latex)
+ add_dependencies(manual-pdf manual-latex)
+ add_dependencies(manual-ps manual-latex)
+endif (SPHINX_BUILD_EXECUTABLE)
diff --git a/docs/manual/Gammu.htm b/docs/manual/Gammu.htm
new file mode 100644
index 0000000..768830a
--- /dev/null
+++ b/docs/manual/Gammu.htm
@@ -0,0 +1,460 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <title>Gammu internals</title>
+</head>
+<body>
+<h2>&nbsp;Gammu internals</h2>
+<h3> gammurc Configuration file</h3>
+When started, Gammu looks for the file “gammurc”, which contains
+startup definitions in a Windows INI manner. For a 6210 on COM1, the
+file may looks like this:
+<p><tt>[gammu]</tt> <br>
+<tt>model = 6210</tt> <br>
+<tt>port=com1:</tt> <br>
+<tt>connection=dlr3</tt> </p>
+<p>Though Gammu has support for automatically identifying the connected
+ device, still port number and connection type need to be specified.
+Including the model definition speeds up things since the identifying
+process is skipped. </p>
+<p>These are the currently possible values for connection: <br>
+&nbsp;
+<table border="1">
+ <tbody>
+ <tr>
+ <td><b>Connection</b></td>
+ <td><b>Details</b></td>
+ </tr>
+ <tr>
+ <td><tt>at19200</tt> <br>
+ <tt>at115200</tt></td>
+ <td>AT commands over serial ports</td>
+ </tr>
+ <tr>
+ <td><tt>fbus</tt> <br>
+ <tt>mbus</tt></td>
+ <td>Nokia’s proprietary wiring and protocols</td>
+ </tr>
+ <tr>
+ <td><tt>dlr3</tt></td>
+ <td>Nokia fbus protocol over DLR3 cable</td>
+ </tr>
+ <tr>
+ <td><tt>Irda</tt> <br>
+ <tt>infrared</tt></td>
+ <td>Infrared with irDA standard or Nokia fbus</td>
+ </tr>
+ <tr>
+ <td><tt>atblue</tt></td>
+ <td>AT over Bluetooth</td>
+ </tr>
+ <tr>
+ <td><tt>dlr3blue</tt></td>
+ <td>Nokia fbus over Bluetooth (init using method from DLR3 cable)</td>
+ </tr>
+ </tbody>
+</table>
+</p>
+<h3> Architecture</h3>
+Marcin Wiacek, author of Gammu, did a very good job at abstracting the
+various levels he uses, enabling developers to add new features very
+quickly. We could, for example, add definitions for a new phone and
+for the most part it wouldn’t matter whether it’s connected locally,
+via infrared, or (evolving) via Bluetooth.
+<p>These are the different abstraction levels: <br>
+&nbsp;
+<table border="1">
+ <tbody>
+ <tr>
+ <td><b>Title</b></td>
+ <td><b>Description</b></td>
+ <td><b>Defined in…</b></td>
+ </tr>
+ <tr>
+ <td>Configuration parser</td>
+ <td>Parses gammurc file</td>
+ <td>cfg</td>
+ </tr>
+ <tr>
+ <td>Connections</td>
+ <td>Provides interfaces for serial, infrared and Bluetooth
+communications</td>
+ <td>common\device</td>
+ </tr>
+ <tr>
+ <td>Protocols</td>
+ <td>Defines protocols for Nokia, AT and Alcatel phones</td>
+ <td>common\protocol</td>
+ </tr>
+ <tr>
+ <td>Phones</td>
+ <td>Specific and general implementations for the supported phone
+series</td>
+ <td>common\phone</td>
+ </tr>
+ <tr>
+ <td>Service</td>
+ <td>Provides access to the phone functions – main point of
+interest for application development</td>
+ <td>common\service</td>
+ </tr>
+ </tbody>
+</table>
+</p>
+<h3> Phone function reference</h3>
+The following phone functions are possible, support varies by phone: <br>
+&nbsp;
+<table border="1">
+ <tbody>
+ <tr>
+ <td><b>Name</b></td>
+ <td><b>Description</b></td>
+ </tr>
+ <tr>
+ <td>AnswerCall</td>
+ <td>Accept currently incoming call</td>
+ </tr>
+ <tr>
+ <td>CancelCall</td>
+ <td>Deny currently incoming call</td>
+ </tr>
+ <tr>
+ <td>DialVoice</td>
+ <td>Call number and establish voice call</td>
+ </tr>
+ <tr>
+ <td>EnterSecurityCode</td>
+ <td>Allow to "enter" pin/puk/pin2/puk2, when phone prompts for it
+on screen</td>
+ </tr>
+ <tr>
+ <td>Get/Set/DeleteWAPBookmark</td>
+ <td>Obvious</td>
+ </tr>
+ <tr>
+ <td>Get/Set/SendSMSMessage GetNextSMSMessage DeleteSMS</td>
+ <td>Obvious</td>
+ </tr>
+ <tr>
+ <td>Get/SetAlarm</td>
+ <td>Obvious</td>
+ </tr>
+ <tr>
+ <td>Get/SetBitmap</td>
+ <td>Obvious</td>
+ </tr>
+ <tr>
+ <td>Get/SetCalendarNote DeleteCalendarNote</td>
+ <td>Obvious</td>
+ </tr>
+ <tr>
+ <td>Get/SetDateTime</td>
+ <td>Obvious</td>
+ </tr>
+ <tr>
+ <td>Get/SetMemory</td>
+ <td>Retrieve and set various telephone numbers, like phonebook
+entries in the internal memory and on the SIM card,
+dialed/missed/received logs as well as the phone’s own number</td>
+ </tr>
+ <tr>
+ <td>Get/SetProfile</td>
+ <td>Profile data such as ringtone volume, key sound etc.</td>
+ </tr>
+ <tr>
+ <td>Get/SetRingtone</td>
+ <td>Obvious</td>
+ </tr>
+ <tr>
+ <td>Get/SetSMSC</td>
+ <td>Get/Set the number of the SMS Service Center</td>
+ </tr>
+ <tr>
+ <td>Get/SetSpeedDial</td>
+ <td>a.k.a. dialing shortcuts</td>
+ </tr>
+ <tr>
+ <td>Get/SetTodo DeleteAllTodo</td>
+ <td>Obvious</td>
+ </tr>
+ <tr>
+ <td>Get/SetWAPSettings</td>
+ <td>Dial-up settings</td>
+ </tr>
+ <tr>
+ <td>GetBatteryLevel</td>
+ <td>Obvious</td>
+ </tr>
+ <tr>
+ <td>GetDisplayStatus</td>
+ <td>See on-screen notification icons (new SMS etc.)</td>
+ </tr>
+ <tr>
+ <td>GetHardware</td>
+ <td>Get hardware info</td>
+ </tr>
+ <tr>
+ <td>GetIMEI</td>
+ <td>Retrieve the International Mobile Equipment Identity number</td>
+ </tr>
+ <tr>
+ <td>GetManufactureMonth</td>
+ <td>Obvious</td>
+ </tr>
+ <tr>
+ <td>GetManufacturer</td>
+ <td>Obvious</td>
+ </tr>
+ <tr>
+ <td>GetMemoryStatus</td>
+ <td>Retrieve information about capacity and usage of specific
+memory</td>
+ </tr>
+ <tr>
+ <td>GetNetworkInfo</td>
+ <td>Retrieve network name, code, current cell, location area
+code, net status (home/roaming/searching network/no network)</td>
+ </tr>
+ <tr>
+ <td>GetNetworkLevel</td>
+ <td>Network signal strength</td>
+ </tr>
+ <tr>
+ <td>GetOriginalIMEI</td>
+ <td>Obvious</td>
+ </tr>
+ <tr>
+ <td>GetPPM</td>
+ <td>Get name of phone’s language package (Nokia)</td>
+ </tr>
+ <tr>
+ <td>GetProductCode</td>
+ <td>Manufacturer-specific</td>
+ </tr>
+ <tr>
+ <td>GetRingtonesInfo</td>
+ <td>Get ringtone names</td>
+ </tr>
+ <tr>
+ <td>GetSecurityStatus</td>
+ <td>Figure out what code (PIN, Security Code, PIN2, PUK, PUK2),
+is being prompted by the phone, if any</td>
+ </tr>
+ <tr>
+ <td>GetSIMIMSI</td>
+ <td>International Mobile Subscriber Identity number assigned to
+SIM card</td>
+ </tr>
+ <tr>
+ <td>GetSMSFolders</td>
+ <td>Retrieve names of SMS folders</td>
+ </tr>
+ <tr>
+ <td>GetSMSStatus</td>
+ <td>Statistics about SMS memory usage</td>
+ </tr>
+ <tr>
+ <td>PlayTone</td>
+ <td>Play tone on phone…</td>
+ </tr>
+ <tr>
+ <td>PressKey</td>
+ <td>Simulate any key push to phone!</td>
+ </tr>
+ <tr>
+ <td>Reset</td>
+ <td>Soft/hard phone reset</td>
+ </tr>
+ <tr>
+ <td>ResetPhoneSettings</td>
+ <td>Obvious</td>
+ </tr>
+ <tr>
+ <td>SendDTMF</td>
+ <td>Numeric key tones</td>
+ </tr>
+ <tr>
+ <td>SetAutoNetworkLogin</td>
+ <td>Obvious</td>
+ </tr>
+ <tr>
+ <td>SetIncomingCall</td>
+ <td>Trigger notification for incoming calls</td>
+ </tr>
+ <tr>
+ <td>SetIncomingCB</td>
+ <td>Trigger notification for incoming CB messages</td>
+ </tr>
+ <tr>
+ <td>SetIncomingSMS</td>
+ <td>Trigger notification for incoming SMS messages</td>
+ </tr>
+ </tbody>
+</table>
+<h3> Services</h3>
+Furthermore, Gammu offers the following “services” (see first table): <br>
+&nbsp;
+<table border="1">
+ <tbody>
+ <tr>
+ <td><b>Title</b></td>
+ <td><b>Description</b></td>
+ <td><b>Defined in…</b></td>
+ </tr>
+ <tr>
+ <td>Backup</td>
+ <td>Complete backup/restore of phone data</td>
+ <td>gsmbackup.c</td>
+ </tr>
+ <tr>
+ <td>Logo</td>
+ <td>Functions to read, write, resize and convert bitmaps and
+operator logos and animations</td>
+ <td>gsmlogo.c</td>
+ </tr>
+ <tr>
+ <td>Networks</td>
+ <td>Pretty extensive table to link GSM operator network codes to
+the actual operator names</td>
+ <td>gsmnet.c</td>
+ </tr>
+ <tr>
+ <td>Phonebook</td>
+ <td>VCard support (currently minimal)</td>
+ <td>gsmpbk.c</td>
+ </tr>
+ <tr>
+ <td>Calendar</td>
+ <td>VCalendar support</td>
+ <td>gsmcal.c</td>
+ </tr>
+ <tr>
+ <td>Ringtones</td>
+ <td>Functions to read, write and convert ringtone data in various
+formats</td>
+ <td>gsmring.c</td>
+ </tr>
+ <tr>
+ <td>SMS</td>
+ <td>Encode and decode various SMS formats, including multi-part
+messages</td>
+ <td>gsmsms.c</td>
+ </tr>
+ <tr>
+ <td>WAP bookmarks</td>
+ <td>Encoding support for Nokia WAP bookmarks</td>
+ <td>gsmwap.c</td>
+ </tr>
+ </tbody>
+</table>
+<p>Be sure to also take a look at gammu.c, which offers additional
+functionality such as data message composition/sending (wap settings –
+no gprs/syncml; vcards, calendar items, ringtones, logos, sms center
+settings, bookmarks). Check out the Readme in the docs/ directory. </p>
+<h2> Writing code based on Gammu</h2>
+Though Gammu is meant to be a single application, one can simply import
+ all its classes and headers and make use of them. The easiest way to do
+ this is to copy all the includes and global variables (s, *Phone, etc.,
+ see below for details) from the main class gammu.c. into one’s own main
+ class. When using Gammu in a C++ project, it is mandatory to use extern
+ “C” when including its files:
+<p><tt>extern "C" {</tt> </p>
+<p><tt>#include "gammu/gammu/gammu.h"</tt> </p>
+<p><tt>..............</tt> </p>
+<p><tt>}</tt> </p>
+<h3> Global variables</h3>
+gammu.c uses the following global variables, I recommend their
+adoption:
+<table border="1">
+ <tbody>
+ <tr>
+ <td><b>Variable</b></td>
+ <td><b>Details</b></td>
+ </tr>
+ <tr>
+ <td>GSM_StateMachine s</td>
+ <td>Basic layer to the phone connection</td>
+ </tr>
+ <tr>
+ <td>GSM_Phone_Functions *Phone</td>
+ <td>Interface to the phone (see phone functions above)</td>
+ </tr>
+ <tr>
+ <td>static CFG_Header *cfg</td>
+ <td>Configuration settings retrieved from gammurc</td>
+ </tr>
+ <tr>
+ <td>GSM_Error error</td>
+ <td>Current errorlevel. Important values are GE_NONE=1 and
+GE_NOTIMPLEMENTED=19</td>
+ </tr>
+ </tbody>
+</table>
+<h3> Basic procedure</h3>
+In order to work with Gammu, follow the following procedure observed in
+ gammu.c: <br>
+&nbsp;
+<table border="1">
+ <tbody>
+ <tr>
+ <td><b>Step</b></td>
+ <td><b>Description</b></td>
+ <td><b>Command</b></td>
+ </tr>
+ <tr>
+ <td>1</td>
+ <td>(optional): Find and parse out the “gammurc” configuration
+file</td>
+ <td>cfg=CFG_FindGammuRC();</td>
+ </tr>
+ <tr>
+ <td>2</td>
+ <td>Load configuration settings</td>
+ <td>CFG_ReadConfig(cfg, &amp;s.Config);</td>
+ </tr>
+ <tr>
+ <td>3</td>
+ <td>Connect to phone</td>
+ <td>GSM_Init(false);</td>
+ </tr>
+ <tr>
+ <td colspan="3">
+ <center>....</center>
+ </td>
+ </tr>
+ <tr>
+ <td>4</td>
+ <td>Interface phone</td>
+ <td>For example: error=Phone-&gt;GetRingtone(&amp;s,
+&amp;ringtonebin,0);</td>
+ </tr>
+ <tr>
+ <td colspan="3">
+ <center>....</center>
+ </td>
+ </tr>
+ <tr>
+ <td>5</td>
+ <td>Terminate connection</td>
+ <td>GSM_Terminate();</td>
+ </tr>
+ </tbody>
+</table>
+<p>Note: The functions GSM_Init and GSM_Terminate are located in
+gammu.c. </p>
+<h3> Working without a gammurc</h3>
+When Gammu can’t find the gammurc, it will fall back to its defaults
+which are entered in the function CFG_ReadConfig in common/gsmring.c.
+<h3> DLL or not?</h3>
+Starting with release 0.64, there is a DLL version of Gammu included in
+ the distribution. As of now, it mostly acts as a demonstration on how
+to use Gammu routines in other environments (Delphi) and encapsulates
+only a few of its functions, none of the ones I needed (which were
+functions for ringtone, contact, calendar, wap data access).
+<p>Thus, the DLL would have to be adjusted with every new release of
+Gammu in the same manner as with the current implementation, defying
+the independent nature of a DLL, so I decided not to use this DLL as a
+base for now. Still, I assume that the DLL will soon encapsulate all
+Gammu functions, making it an interesting option for the future. </p>
+</body>
+</html>
diff --git a/docs/manual/c/api.rst b/docs/manual/c/api.rst
new file mode 100644
index 0000000..1e23e2d
--- /dev/null
+++ b/docs/manual/c/api.rst
@@ -0,0 +1,32 @@
+libGammu C API
+==============
+
+.. toctree::
+ :maxdepth: 3
+
+ backup
+ bitmap
+ calendar
+ callback
+ call
+ category
+ datetime
+ debug
+ error
+ file
+ info
+ inifile
+ keys
+ limits
+ memory
+ message
+ misc
+ nokia
+ ringtone
+ security
+ settings
+ smsd
+ statemachine
+ types
+ unicode
+ wap
diff --git a/docs/manual/c/backup.rst b/docs/manual/c/backup.rst
new file mode 100644
index 0000000..f39de87
--- /dev/null
+++ b/docs/manual/c/backup.rst
@@ -0,0 +1,22 @@
+Backup
+======
+
+.. doxygenfunction:: GSM_ReadSMSBackupFile
+.. doxygenfunction:: GSM_AddSMSBackupFile
+.. doxygenfunction:: GSM_ClearSMSBackup
+.. doxygenfunction:: GSM_FreeSMSBackup
+.. doxygenfunction:: GSM_SaveBackupFile
+.. doxygenfunction:: GSM_GuessBackupFormat
+.. doxygenfunction:: GSM_ReadBackupFile
+.. doxygenfunction:: GSM_ClearBackup
+.. doxygenfunction:: GSM_FreeBackup
+.. doxygenfunction:: GSM_GetBackupFormatFeatures
+.. doxygenfunction:: GSM_GetBackupFileFeatures
+.. doxygenstruct:: GSM_SMS_Backup
+ :members:
+.. doxygenstruct:: GSM_Backup
+ :members:
+.. doxygenenum:: GSM_BackupFormat
+.. doxygenstruct:: GSM_Backup_Info
+ :members:
+.. doxygendefine:: GSM_BACKUP_MAX_SMS
diff --git a/docs/manual/c/bitmap.rst b/docs/manual/c/bitmap.rst
new file mode 100644
index 0000000..0a7cb31
--- /dev/null
+++ b/docs/manual/c/bitmap.rst
@@ -0,0 +1,21 @@
+Bitmap
+======
+
+.. doxygenfunction:: GSM_GetBitmap
+.. doxygenfunction:: GSM_SetBitmap
+.. doxygenfunction:: GSM_PrintBitmap
+.. doxygenfunction:: GSM_SaveBitmapFile
+.. doxygenfunction:: GSM_ReadBitmapFile
+.. doxygenfunction:: GSM_IsPointBitmap
+.. doxygenfunction:: GSM_SetPointBitmap
+.. doxygenfunction:: GSM_ClearPointBitmap
+.. doxygenfunction:: GSM_ClearBitmap
+.. doxygenenum:: GSM_BinaryPicture_Types
+.. doxygenstruct:: GSM_BinaryPicture
+ :members:
+.. doxygenenum:: GSM_Bitmap_Types
+.. doxygenstruct:: GSM_Bitmap
+ :members:
+.. doxygenstruct:: GSM_MultiBitmap
+ :members:
+.. doxygenfunction:: GSM_GetScreenshot
diff --git a/docs/manual/c/calendar.rst b/docs/manual/c/calendar.rst
new file mode 100644
index 0000000..df90c60
--- /dev/null
+++ b/docs/manual/c/calendar.rst
@@ -0,0 +1,59 @@
+Calendar
+========
+
+.. doxygenfunction:: GSM_CalendarFindDefaultTextTimeAlarmPhone
+.. doxygenfunction:: GSM_EncodeVTODO
+.. doxygenfunction:: GSM_EncodeVCALENDAR
+.. doxygenfunction:: GSM_DecodeVNOTE
+.. doxygenfunction:: GSM_EncodeVNTFile
+.. doxygenfunction:: GSM_DecodeVCALENDAR_VTODO
+.. doxygenfunction:: GSM_IsCalendarNoteFromThePast
+.. doxygenfunction:: GSM_GetAlarm
+.. doxygenfunction:: GSM_SetAlarm
+.. doxygenfunction:: GSM_GetToDoStatus
+.. doxygenfunction:: GSM_GetToDo
+.. doxygenfunction:: GSM_GetNextToDo
+.. doxygenfunction:: GSM_SetToDo
+.. doxygenfunction:: GSM_AddToDo
+.. doxygenfunction:: GSM_DeleteToDo
+.. doxygenfunction:: GSM_DeleteAllToDo
+.. doxygenfunction:: GSM_GetCalendarStatus
+.. doxygenfunction:: GSM_GetCalendar
+.. doxygenfunction:: GSM_GetNextCalendar
+.. doxygenfunction:: GSM_SetCalendar
+.. doxygenfunction:: GSM_AddCalendar
+.. doxygenfunction:: GSM_DeleteCalendar
+.. doxygenfunction:: GSM_DeleteAllCalendar
+.. doxygenfunction:: GSM_GetCalendarSettings
+.. doxygenfunction:: GSM_SetCalendarSettings
+.. doxygenfunction:: GSM_GetNotesStatus
+.. doxygenfunction:: GSM_GetNote
+.. doxygenfunction:: GSM_GetNextNote
+.. doxygenfunction:: GSM_SetNote
+.. doxygenfunction:: GSM_AddNote
+.. doxygenfunction:: GSM_DeleteNote
+.. doxygenfunction:: GSM_DeleteAllNotes
+.. doxygenstruct:: GSM_CalendarSettings
+ :members:
+.. doxygenstruct:: GSM_ToDoStatus
+ :members:
+.. doxygenstruct:: GSM_CalendarStatus
+ :members:
+.. doxygenenum:: GSM_CalendarNoteType
+.. doxygenenum:: GSM_CalendarType
+.. doxygenstruct:: GSM_SubCalendarEntry
+ :members:
+.. doxygenstruct:: GSM_CalendarEntry
+ :members:
+.. doxygenenum:: GSM_ToDoType
+.. doxygenenum:: GSM_ToDo_Priority
+.. doxygenstruct:: GSM_SubToDoEntry
+ :members:
+.. doxygenstruct:: GSM_ToDoEntry
+ :members:
+.. doxygenstruct:: GSM_NoteEntry
+ :members:
+.. doxygenstruct:: GSM_Alarm
+ :members:
+.. doxygenenum:: GSM_VToDoVersion
+.. doxygenenum:: GSM_VCalendarVersion
diff --git a/docs/manual/c/call.rst b/docs/manual/c/call.rst
new file mode 100644
index 0000000..ca51ac2
--- /dev/null
+++ b/docs/manual/c/call.rst
@@ -0,0 +1,28 @@
+Call
+====
+
+.. doxygenfunction:: GSM_DialVoice
+.. doxygenfunction:: GSM_DialService
+.. doxygenfunction:: GSM_AnswerCall
+.. doxygenfunction:: GSM_CancelCall
+.. doxygenfunction:: GSM_HoldCall
+.. doxygenfunction:: GSM_UnholdCall
+.. doxygenfunction:: GSM_ConferenceCall
+.. doxygenfunction:: GSM_SplitCall
+.. doxygenfunction:: GSM_TransferCall
+.. doxygenfunction:: GSM_SwitchCall
+.. doxygenfunction:: GSM_GetCallDivert
+.. doxygenfunction:: GSM_SetCallDivert
+.. doxygenfunction:: GSM_CancelAllDiverts
+.. doxygenfunction:: GSM_SetIncomingCall
+.. doxygenfunction:: GSM_SendDTMF
+.. doxygenenum:: GSM_CallStatus
+.. doxygenstruct:: GSM_Call
+ :members:
+.. doxygenenum:: GSM_Divert_DivertTypes
+.. doxygenenum:: GSM_Divert_CallTypes
+.. doxygenstruct:: GSM_CallDivert
+ :members:
+.. doxygenstruct:: GSM_MultiCallDivert
+ :members:
+.. doxygenenum:: GSM_CallShowNumber
diff --git a/docs/manual/c/callback.rst b/docs/manual/c/callback.rst
new file mode 100644
index 0000000..ec91076
--- /dev/null
+++ b/docs/manual/c/callback.rst
@@ -0,0 +1,13 @@
+Callback
+========
+
+.. doxygenfunction:: GSM_SetIncomingCallCallback
+.. doxygenfunction:: GSM_SetIncomingSMSCallback
+.. doxygenfunction:: GSM_SetIncomingCBCallback
+.. doxygenfunction:: GSM_SetIncomingUSSDCallback
+.. doxygenfunction:: GSM_SetSendSMSStatusCallback
+.. doxygentypedef:: IncomingCallCallback
+.. doxygentypedef:: IncomingSMSCallback
+.. doxygentypedef:: IncomingCBCallback
+.. doxygentypedef:: IncomingUSSDCallback
+.. doxygentypedef:: SendSMSStatusCallback
diff --git a/docs/manual/c/category.rst b/docs/manual/c/category.rst
new file mode 100644
index 0000000..8177626
--- /dev/null
+++ b/docs/manual/c/category.rst
@@ -0,0 +1,11 @@
+Category
+========
+
+.. doxygenfunction:: GSM_GetCategory
+.. doxygenfunction:: GSM_AddCategory
+.. doxygenfunction:: GSM_GetCategoryStatus
+.. doxygenenum:: GSM_CategoryType
+.. doxygenstruct:: GSM_Category
+ :members:
+.. doxygenstruct:: GSM_CategoryStatus
+ :members:
diff --git a/docs/manual/c/datetime.rst b/docs/manual/c/datetime.rst
new file mode 100644
index 0000000..4319dca
--- /dev/null
+++ b/docs/manual/c/datetime.rst
@@ -0,0 +1,19 @@
+Date and time
+=============
+
+.. doxygenfunction:: DayOfWeek
+.. doxygenfunction:: GSM_GetCurrentDateTime
+.. doxygenfunction:: Fill_Time_T
+.. doxygenfunction:: GSM_GetLocalTimezoneOffset
+.. doxygenfunction:: Fill_GSM_DateTime
+.. doxygenfunction:: GSM_DateTimeFromTimestamp
+.. doxygenfunction:: OSDateTime
+.. doxygenfunction:: OSDate
+.. doxygenfunction:: CheckDate
+.. doxygenfunction:: CheckTime
+.. doxygenfunction:: GSM_GetDateTime
+.. doxygenfunction:: GSM_SetDateTime
+.. doxygenstruct:: GSM_DateTime
+ :members:
+.. doxygenstruct:: GSM_DeltaTime
+ :members:
diff --git a/docs/manual/c/debug.rst b/docs/manual/c/debug.rst
new file mode 100644
index 0000000..f84fcbd
--- /dev/null
+++ b/docs/manual/c/debug.rst
@@ -0,0 +1,15 @@
+Debug
+=====
+
+.. doxygenfunction:: GSM_SetDebugFunction
+.. doxygenfunction:: GSM_SetDebugFile
+.. doxygenfunction:: GSM_SetDebugFileDescriptor
+.. doxygenfunction:: GSM_GetGlobalDebug
+.. doxygenfunction:: GSM_GetDebug
+.. doxygenfunction:: GSM_GetDI
+.. doxygenfunction:: GSM_SetDebugLevel
+.. doxygenfunction:: GSM_SetDebugCoding
+.. doxygenfunction:: GSM_SetDebugGlobal
+.. doxygenfunction:: GSM_LogError
+.. doxygenfunction:: smprintf
+.. doxygentypedef:: GSM_Debug_Info
diff --git a/docs/manual/c/error.rst b/docs/manual/c/error.rst
new file mode 100644
index 0000000..7e238ae
--- /dev/null
+++ b/docs/manual/c/error.rst
@@ -0,0 +1,6 @@
+Error handling
+==============
+
+.. doxygenfunction:: GSM_ErrorString
+.. doxygenfunction:: GSM_ErrorName
+.. doxygenenum:: GSM_Error
diff --git a/docs/manual/c/examples.rst b/docs/manual/c/examples.rst
new file mode 100644
index 0000000..789c18c
--- /dev/null
+++ b/docs/manual/c/examples.rst
@@ -0,0 +1,42 @@
+Examples
+========
+
+All these examples are also available in docs/examples/
+directory in Gammu sources.
+
+Getting phone information
+-------------------------
+
+.. literalinclude:: ../../examples/phone-info.c
+ :language: c
+
+Reading SMS message
+-------------------
+
+.. literalinclude:: ../../examples/sms-read.c
+ :language: c
+
+Sending SMS message
+-------------------
+
+.. literalinclude:: ../../examples/sms-send.c
+ :language: c
+
+Sending Long SMS message
+------------------------
+
+.. literalinclude:: ../../examples/long-sms.c
+ :language: c
+
+SMSD example
+------------
+
+.. literalinclude:: ../../examples/smsd.c
+ :language: c
+
+Custom configuration
+--------------------
+
+.. literalinclude:: ../../examples/custom-config.c
+ :language: c
+
diff --git a/docs/manual/c/file.rst b/docs/manual/c/file.rst
new file mode 100644
index 0000000..6586043
--- /dev/null
+++ b/docs/manual/c/file.rst
@@ -0,0 +1,22 @@
+File
+====
+
+.. doxygenfunction:: GSM_JADFindData
+.. doxygenfunction:: GSM_ReadFile
+.. doxygenfunction:: GSM_IdentifyFileFormat
+.. doxygenfunction:: GSM_GetNextFileFolder
+.. doxygenfunction:: GSM_GetFolderListing
+.. doxygenfunction:: GSM_GetNextRootFolder
+.. doxygenfunction:: GSM_SetFileAttributes
+.. doxygenfunction:: GSM_GetFilePart
+.. doxygenfunction:: GSM_AddFilePart
+.. doxygenfunction:: GSM_SendFilePart
+.. doxygenfunction:: GSM_GetFileSystemStatus
+.. doxygenfunction:: GSM_DeleteFile
+.. doxygenfunction:: GSM_AddFolder
+.. doxygenfunction:: GSM_DeleteFolder
+.. doxygenstruct:: GSM_FileSystemStatus
+ :members:
+.. doxygenenum:: GSM_FileType
+.. doxygenstruct:: GSM_File
+ :members:
diff --git a/docs/manual/c/hints.rst b/docs/manual/c/hints.rst
new file mode 100644
index 0000000..0012097
--- /dev/null
+++ b/docs/manual/c/hints.rst
@@ -0,0 +1,202 @@
+Hints for libGammu Novices
+==========================
+
+This is very short overview of libGammu usage. You will probably need to study
+:doc:`api` to find out what functions you want to use.
+
+
+Basic library usage
+-------------------
+
+You need to include main header file:
+
+.. code-block:: c
+
+ #include <gammu.h>
+
+To compile you need to pass flags from pkg-config::
+
+ pkg-config --cflags gammu
+
+To link you need to pass from pkg-config::
+
+ pkg-config --libs gammu
+
+
+Gammu stores all its data in a :c:type:`GSM_StateMachine`. This structure is not
+public, so all you can define is a pointer to it:
+
+.. code-block:: c
+
+ GSM_StateMachine *state_machine;
+
+You'll want to check for errors from time to time. Do it using a
+function something like this with help of :c:func:`GSM_ErrorString`:
+
+.. code-block:: c
+
+ void check_error(GSM_Error err)
+ {
+ if (err == ERR_NONE) {
+ return;
+ }
+ fprintf(stderr, "Gammu failure: %s\n", GSM_ErrorString(error));
+ exit(1);
+ }
+
+As libGammu does interact with strings in your local encoding, it is good idea
+to initialize locales subsystem first (otherwise you would get broken non
+ASCII characters) by calling :c:func:`GSM_InitLocales`:
+
+.. code-block:: c
+
+ GSM_InitLocales(NULL);
+
+You first need to allocate a state machine structure
+using :c:func:`GSM_AllocStateMachine`:
+
+.. code-block:: c
+
+ state_machine = GSM_AllocStateMachine();
+
+Now think about the configuration file. To use the default
+:file:`~/.gammurc`, do this:
+
+.. code-block:: c
+
+ INI_Section *cfg;
+
+ /* Find it */
+ error = GSM_FindGammuRC(&cfg, NULL);
+ check_error(error);
+
+ /* Read it */
+ error = GSM_ReadConfig(cfg, GSM_GetConfig(state_machine, 0), 0);
+ check_error(error);
+
+ /* Free allocated memory */
+ INI_Free(cfg);
+
+ /* We care onlu about first configuration */
+ GSM_SetConfigNum(s, 1);
+
+OK, now initialise the connection (1 means number of replies you want to wait
+for in case of failure) by :c:func:`GSM_InitConnection`:
+
+.. code-block:: c
+
+ error = GSM_InitConnection(s, 1);
+ check_error(error);
+
+Now you are ready to communicate with the phone, for example you can read
+manufacturer name by :c:func:`GSM_GetManufacturer`:
+
+.. code-block:: c
+
+ error = GSM_GetManufacturer(s, buffer);
+ check_error(error);
+
+When you're finished, you need to disconnect and free allocated memory
+using :c:func:`GSM_FreeStateMachine`:
+
+.. code-block:: c
+
+ error = GSM_TerminateConnection(s);
+ check_error(error);
+
+ /* Free up used memory */
+ GSM_FreeStateMachine(s);
+ check_error(error);
+
+There are also other :doc:`examples`.
+
+Compiling the code
+------------------
+
+To compile program using Gammu library, you need to pass include path to the
+compiler and library name and search path to the linker. This can be easiest
+achieved by using :program:`pkg-config`. See following ``Makefile`` for
+example:
+
+.. code-block:: make
+
+ # Sample Makefile which can be used to build examples shipped with Gammu
+
+ CFLAGS=$(shell pkg-config --cflags --libs gammu-smsd) -Wall
+ LDFLAGS=$(shell pkg-config --cflags --libs gammu)
+
+ ALL=phone-info sms-send smsd
+
+ .PHONY: all clean
+
+ all: $(ALL)
+
+ clean:
+ rm -f $(ALL)
+
+ %:%.c
+ $(CC) $< $(CFLAGS) $(LDFLAGS) -o $@
+
+
+Unicode
+-------
+
+Gammu stores all strings internally in UCS-2-BE encoding (terminated by two
+zero bytes). This is used mostly for historical reasons and today the obvious
+choice would be ``wchar_t``. To work with these strings, various functions
+are provided (:c:func:`UnicodeLength`, :c:func:`DecodeUnicode`,
+:c:func:`EncodeUnicode`, :c:func:`CopyUnicodeString`, etc.).
+
+For printing on console you should use:
+
+.. code-block:: c
+
+ printf("%s\n", DecodeUnicodeConsole(unicode_string));
+
+For giving string to some GUI toolkit:
+
+.. code-block:: c
+
+ printf("%s\n", DecodeUnicodeString(unicode_string));
+
+.. note::
+
+ These functions differ only on platforms where console uses historically
+ different character set than GUI, what effectively means only Microsoft
+ Windows.
+
+Debugging
+---------
+
+You can either enabled debug logging globally or per state machine.
+
+To enable global debugging use:
+
+.. code-block:: c
+
+ debug_info = GSM_GetGlobalDebug();
+ GSM_SetDebugFileDescriptor(stderr, FALSE, debug_info);
+ GSM_SetDebugLevel("textall", debug_info);
+
+For per state machine configuration:
+
+.. code-block:: c
+
+ debug_info = GSM_GetDebug(s);
+ GSM_SetDebugGlobal(FALSE, debug_info);
+ GSM_SetDebugFileDescriptor(stderr, FALSE, debug_info);
+ GSM_SetDebugLevel("textall", debug_info);
+
+Waiting for incoming events
+---------------------------
+
+If you expect some incoming events, you need to maintain communication with the
+phone. The best way it can be :c:func:`GSM_ReadDevice`. For example you can use
+following busy loop:
+
+
+.. code-block:: c
+
+ while (!gshutdown) {
+ GSM_ReadDevice(s, TRUE);
+ }
diff --git a/docs/manual/c/index.rst b/docs/manual/c/index.rst
new file mode 100644
index 0000000..3910c4d
--- /dev/null
+++ b/docs/manual/c/index.rst
@@ -0,0 +1,21 @@
+.. _libgammu:
+
+libGammu
+========
+
+The libGammu library exposes all Gammu functionality for various phones in
+standard API. It can be used to do anything with your phone, however for
+easier tasks you might prefer to use Python and :doc:`../python/index`.
+
+If you intend to use libGammu in your application, all you should need
+is to ``#include <gammu.h>`` and then use Gammu functions. You can check
+docs/examples/ for some small example applications. You don't need real phone
+for testing, use :ref:`dummy-driver` instead.
+
+.. toctree::
+ :maxdepth: 3
+
+ hints
+ examples
+ api
+ porting
diff --git a/docs/manual/c/info.rst b/docs/manual/c/info.rst
new file mode 100644
index 0000000..4ebed77
--- /dev/null
+++ b/docs/manual/c/info.rst
@@ -0,0 +1,40 @@
+Info
+====
+
+.. doxygenfunction:: GSM_GetNetworkName
+.. doxygenfunction:: GSM_GetCountryName
+.. doxygenfunction:: GSM_FeatureToString
+.. doxygenfunction:: GSM_FeatureFromString
+.. doxygenfunction:: GSM_IsPhoneFeatureAvailable
+.. doxygenfunction:: GSM_AddPhoneFeature
+.. doxygenfunction:: GSM_GetManufacturer
+.. doxygenfunction:: GSM_GetModel
+.. doxygenfunction:: GSM_GetModelInfo
+.. doxygenfunction:: GSM_GetFirmware
+.. doxygenfunction:: GSM_GetIMEI
+.. doxygenfunction:: GSM_GetOriginalIMEI
+.. doxygenfunction:: GSM_GetManufactureMonth
+.. doxygenfunction:: GSM_GetProductCode
+.. doxygenfunction:: GSM_GetHardware
+.. doxygenfunction:: GSM_GetPPM
+.. doxygenfunction:: GSM_GetSIMIMSI
+.. doxygenfunction:: GSM_GetBatteryCharge
+.. doxygenfunction:: GSM_GetSignalQuality
+.. doxygenfunction:: GSM_GetNetworkInfo
+.. doxygenfunction:: GSM_GetDisplayStatus
+.. doxygenenum:: GSM_NetworkInfo_State
+.. doxygenenum:: GSM_GPRS_State
+.. doxygenstruct:: GSM_NetworkInfo
+ :members:
+.. doxygenstruct:: GSM_SignalQuality
+ :members:
+.. doxygenenum:: GSM_ChargeState
+.. doxygenenum:: GSM_BatteryType
+.. doxygenstruct:: GSM_BatteryCharge
+ :members:
+.. doxygenenum:: GSM_DisplayFeature
+.. doxygenstruct:: GSM_DisplayFeatures
+ :members:
+.. doxygenenum:: GSM_Feature
+.. doxygenstruct:: GSM_PhoneModel
+ :members:
diff --git a/docs/manual/c/inifile.rst b/docs/manual/c/inifile.rst
new file mode 100644
index 0000000..1bea509
--- /dev/null
+++ b/docs/manual/c/inifile.rst
@@ -0,0 +1,17 @@
+INI files
+=========
+
+.. doxygenfunction:: INI_Free
+.. doxygenfunction:: INI_ReadFile
+.. doxygenfunction:: INI_FindLastSectionEntry
+.. doxygenfunction:: INI_GetValue
+.. doxygenfunction:: INI_GetInt
+.. doxygenfunction:: INI_GetBool
+.. doxygenfunction:: GSM_StringToBool
+
+.. doxygentypedef:: INI_Entry
+.. doxygentypedef:: INI_Section
+.. doxygenstruct:: _INI_Entry
+ :members:
+.. doxygenstruct:: _INI_Section
+ :members:
diff --git a/docs/manual/c/keys.rst b/docs/manual/c/keys.rst
new file mode 100644
index 0000000..4f6aabc
--- /dev/null
+++ b/docs/manual/c/keys.rst
@@ -0,0 +1,6 @@
+Keys
+====
+
+.. doxygenfunction:: MakeKeySequence
+.. doxygenfunction:: GSM_PressKey
+.. doxygenenum:: GSM_KeyCode
diff --git a/docs/manual/c/limits.rst b/docs/manual/c/limits.rst
new file mode 100644
index 0000000..b1da03c
--- /dev/null
+++ b/docs/manual/c/limits.rst
@@ -0,0 +1,3 @@
+Limits
+======
+
diff --git a/docs/manual/c/memory.rst b/docs/manual/c/memory.rst
new file mode 100644
index 0000000..1db60ec
--- /dev/null
+++ b/docs/manual/c/memory.rst
@@ -0,0 +1,30 @@
+Memory
+======
+
+.. doxygenfunction:: GSM_StringToMemoryType
+.. doxygenfunction:: GSM_GetMemoryStatus
+.. doxygenfunction:: GSM_GetMemory
+.. doxygenfunction:: GSM_GetNextMemory
+.. doxygenfunction:: GSM_SetMemory
+.. doxygenfunction:: GSM_AddMemory
+.. doxygenfunction:: GSM_DeleteMemory
+.. doxygenfunction:: GSM_DeleteAllMemory
+.. doxygenfunction:: GSM_GetSpeedDial
+.. doxygenfunction:: GSM_SetSpeedDial
+.. doxygenfunction:: GSM_PhonebookGetEntryName
+.. doxygenfunction:: GSM_PhonebookFindDefaultNameNumberGroup
+.. doxygenfunction:: GSM_EncodeVCARD
+.. doxygenfunction:: GSM_DecodeVCARD
+.. doxygenfunction:: GSM_FreeMemoryEntry
+.. doxygenenum:: GSM_MemoryType
+.. doxygenstruct:: GSM_MemoryStatus
+ :members:
+.. doxygenenum:: GSM_EntryType
+.. doxygenenum:: GSM_EntryLocation
+.. doxygenstruct:: GSM_SubMemoryEntry
+ :members:
+.. doxygenstruct:: GSM_MemoryEntry
+ :members:
+.. doxygenstruct:: GSM_SpeedDial
+ :members:
+.. doxygenenum:: GSM_VCardVersion
diff --git a/docs/manual/c/message.rst b/docs/manual/c/message.rst
new file mode 100644
index 0000000..431bc4a
--- /dev/null
+++ b/docs/manual/c/message.rst
@@ -0,0 +1,91 @@
+Messages
+========
+
+.. doxygenfunction:: GSM_DecodePDUFrame
+.. doxygenfunction:: GSM_DecodeSMSFrame
+.. doxygenfunction:: GSM_GetMessageCoding
+.. doxygenfunction:: GSM_EncodeSMSFrame
+.. doxygenfunction:: GSM_DecodeSMSFrameStatusReportData
+.. doxygenfunction:: GSM_DecodeSMSFrameText
+.. doxygenfunction:: GSM_DecodeUDHHeader
+.. doxygenfunction:: GSM_EncodeUDHHeader
+.. doxygenfunction:: GSM_SetDefaultReceivedSMSData
+.. doxygenfunction:: GSM_SetDefaultSMSData
+.. doxygenfunction:: GSM_DecodeSiemensOTASMS
+.. doxygenfunction:: PHONE_EncodeSMSFrame
+.. doxygenfunction:: GSM_EncodeMultiPartSMS
+.. doxygenfunction:: GSM_DecodeMultiPartSMS
+.. doxygenfunction:: GSM_ClearMultiPartSMSInfo
+.. doxygenfunction:: GSM_FreeMultiPartSMSInfo
+.. doxygenfunction:: GSM_LinkSMS
+.. doxygenfunction:: GSM_DecodeMMSFileToMultiPart
+.. doxygenfunction:: GSM_ClearMMSMultiPart
+.. doxygenfunction:: GSM_GetSMSC
+.. doxygenfunction:: GSM_SetSMSC
+.. doxygenfunction:: GSM_GetSMSStatus
+.. doxygenfunction:: GSM_GetSMS
+.. doxygenfunction:: GSM_GetNextSMS
+.. doxygenfunction:: GSM_SetSMS
+.. doxygenfunction:: GSM_AddSMS
+.. doxygenfunction:: GSM_DeleteSMS
+.. doxygenfunction:: GSM_SendSMS
+.. doxygenfunction:: GSM_SendSavedSMS
+.. doxygenfunction:: GSM_SetFastSMSSending
+.. doxygenfunction:: GSM_SetIncomingSMS
+.. doxygenfunction:: GSM_SetIncomingCB
+.. doxygenfunction:: GSM_GetSMSFolders
+.. doxygenfunction:: GSM_AddSMSFolder
+.. doxygenfunction:: GSM_DeleteSMSFolder
+.. doxygenfunction:: GSM_GetMMSFolders
+.. doxygenfunction:: GSM_GetNextMMSFileInfo
+.. doxygenfunction:: GSM_SetIncomingUSSD
+.. doxygenfunction:: GSM_SMSCounter
+.. doxygenenum:: GSM_MMS_Class
+.. doxygenstruct:: GSM_MMSIndicator
+ :members:
+.. doxygenstruct:: GSM_CBMessage
+ :members:
+.. doxygenenum:: GSM_USSDStatus
+.. doxygenstruct:: GSM_USSDMessage
+ :members:
+.. doxygenstruct:: GSM_SMSMemoryStatus
+ :members:
+.. doxygenenum:: GSM_SMSFormat
+.. doxygenenum:: GSM_ValidityPeriod
+.. doxygenenum:: GSM_ValidityPeriodFormat
+.. doxygenstruct:: GSM_SMSValidity
+ :members:
+.. doxygenstruct:: GSM_SMSC
+ :members:
+.. doxygenenum:: GSM_SMS_State
+.. doxygenenum:: GSM_Coding_Type
+.. doxygenenum:: GSM_UDH
+.. doxygenstruct:: GSM_UDHHeader
+ :members:
+.. doxygenenum:: GSM_SMSMessageType
+.. doxygenstruct:: GSM_SMSMessage
+ :members:
+.. doxygenstruct:: GSM_SMSMessageLayout
+ :members:
+.. doxygenstruct:: GSM_OneSMSFolder
+ :members:
+.. doxygenstruct:: GSM_SMSFolders
+ :members:
+.. doxygenstruct:: GSM_SiemensOTASMSInfo
+ :members:
+.. doxygenstruct:: GSM_MultiSMSMessage
+ :members:
+.. doxygenstruct:: GSM_OneMMSFolder
+ :members:
+.. doxygenstruct:: GSM_MMSFolders
+ :members:
+.. doxygenenum:: EncodeMultiPartSMSID
+.. doxygenstruct:: GSM_MultiPartSMSEntry
+ :members:
+.. doxygenstruct:: GSM_MultiPartSMSInfo
+ :members:
+.. doxygenenum:: MMSAddressType
+.. doxygenstruct:: GSM_EncodedMultiPartMMSEntry
+ :members:
+.. doxygenstruct:: GSM_EncodedMultiPartMMSInfo
+ :members:
diff --git a/docs/manual/c/misc.rst b/docs/manual/c/misc.rst
new file mode 100644
index 0000000..ff9e343
--- /dev/null
+++ b/docs/manual/c/misc.rst
@@ -0,0 +1,11 @@
+Miscellaneous
+=============
+
+.. doxygenfunction:: GetLine
+.. doxygenfunction:: GetGammuVersion
+.. doxygenfunction:: GetCompiler
+.. doxygenfunction:: GetOS
+.. doxygenfunction:: GetGammuLocalePath
+.. doxygenfunction:: GSM_InitLocales
+.. doxygenfunction:: EncodeHexBin
+.. doxygenfunction:: GSM_IsNewerVersion
diff --git a/docs/manual/c/nokia.rst b/docs/manual/c/nokia.rst
new file mode 100644
index 0000000..b761669
--- /dev/null
+++ b/docs/manual/c/nokia.rst
@@ -0,0 +1,5 @@
+Nokia
+=====
+
+.. doxygenfunction:: NOKIA_GetDefaultCallerGroupName
+.. doxygenfunction:: NOKIA_GetDefaultProfileName
diff --git a/docs/manual/c/porting.rst b/docs/manual/c/porting.rst
new file mode 100644
index 0000000..0faff6d
--- /dev/null
+++ b/docs/manual/c/porting.rst
@@ -0,0 +1,51 @@
+Porting from libGammu older than 1.12.0
+========================================
+
+Rationale for API change
+------------------------
+
+This document describes what you have to change in your code, if you
+used Gammu older than 1.12.0. This release came with huge changes to
+API, which has to be done for various reasons:
+
+- ABI stability. - Till now almost every change in internals of any
+ driver lead to ABI change. If we would correctly increase soname on
+ each ABI change, we would be somewhere near 200, what is not something
+ we could be proud of.
+
+- Centralisation of variables cleanup. - Currently all phone drivers
+ have to do some common things in each function. New API allows one to
+ centralize those operations in one place.
+
+- Exposing of internals. - Old API exposed too much of Gammu internals,
+ what could be misused by programmers and could lead to unexpected
+ behaviour when some internals are changed.
+
+Changes you have to do in your code
+-----------------------------------
+
+Below examples expect ``sm`` to be state machine structure in your current
+code, change it to appropriate variable name if it differs.
+
+1. Use pointer to :c:type:`GSM_StateMachine` instead of it. API now do not expose
+ this structure, so you will get compiler error. You should allocate
+ this pointer by :c:func:`GSM_AllocStateMachine` and free by
+ :c:func:`GSM_FreeStateMachine`.
+
+2. Change all phone functions from ``sm.Phone.Functions->SomeFunction`` to
+ ``GSM_SomeFunction``. Only functions which results were stored inside
+ state machine structure have changed signature to include results of
+ the operation.
+
+3. All callbacks are set by function ``GSM_Set*Callback`` instead of
+ directly accessing structure.
+
+4. Some function have been renamed to follow ``GSM_*`` naming conventions.
+
+As there might be some functions still missing from new API, don't
+hesitate to contact author or ask on mailing list if you miss something.
+
+API documentation can be generated using Doxygen (make apidoc in build
+tree) or Sphinx and is part of this manual.
+
+.. seealso:: :ref:`libgammu`
diff --git a/docs/manual/c/ringtone.rst b/docs/manual/c/ringtone.rst
new file mode 100644
index 0000000..ac3dded
--- /dev/null
+++ b/docs/manual/c/ringtone.rst
@@ -0,0 +1,43 @@
+Ringtone
+========
+
+.. doxygenfunction:: PHONE_RTTLPlayOneNote
+.. doxygenfunction:: PHONE_Beep
+.. doxygenfunction:: GSM_GetRingtone
+.. doxygenfunction:: GSM_SetRingtone
+.. doxygenfunction:: GSM_GetRingtonesInfo
+.. doxygenfunction:: GSM_DeleteUserRingtones
+.. doxygenfunction:: GSM_PlayTone
+.. doxygenfunction:: GSM_RingtoneConvert
+.. doxygenfunction:: GSM_ReadRingtoneFile
+.. doxygenfunction:: GSM_SaveRingtoneFile
+.. doxygenfunction:: GSM_SaveRingtoneOtt
+.. doxygenfunction:: GSM_SaveRingtoneMidi
+.. doxygenfunction:: GSM_SaveRingtoneIMelody
+.. doxygenfunction:: GSM_SaveRingtoneWav
+.. doxygenfunction:: GSM_SaveRingtoneRttl
+.. doxygenfunction:: GSM_GetRingtoneName
+.. doxygenfunction:: GSM_RTTLGetTempo
+.. doxygenenum:: GSM_RingNoteStyle
+.. doxygenenum:: GSM_RingNoteNote
+.. doxygenenum:: GSM_RingNoteDuration
+.. doxygenenum:: GSM_RingNoteDurationSpec
+.. doxygenenum:: GSM_RingNoteScale
+.. doxygenstruct:: GSM_RingNote
+ :members:
+.. doxygenenum:: GSM_RingCommandType
+.. doxygenstruct:: GSM_RingCommand
+ :members:
+.. doxygenstruct:: GSM_NoteRingtone
+ :members:
+.. doxygenstruct:: GSM_NokiaBinaryRingtone
+ :members:
+.. doxygenstruct:: GSM_BinaryTone
+ :members:
+.. doxygenenum:: GSM_RingtoneFormat
+.. doxygenstruct:: GSM_Ringtone
+ :members:
+.. doxygenstruct:: GSM_RingtoneInfo
+ :members:
+.. doxygenstruct:: GSM_AllRingtonesInfo
+ :members:
diff --git a/docs/manual/c/security.rst b/docs/manual/c/security.rst
new file mode 100644
index 0000000..6d466a6
--- /dev/null
+++ b/docs/manual/c/security.rst
@@ -0,0 +1,8 @@
+Security
+========
+
+.. doxygenfunction:: GSM_EnterSecurityCode
+.. doxygenfunction:: GSM_GetSecurityStatus
+.. doxygenenum:: GSM_SecurityCodeType
+.. doxygenstruct:: GSM_SecurityCode
+ :members:
diff --git a/docs/manual/c/settings.rst b/docs/manual/c/settings.rst
new file mode 100644
index 0000000..1344227
--- /dev/null
+++ b/docs/manual/c/settings.rst
@@ -0,0 +1,39 @@
+Settings
+========
+
+.. doxygenfunction:: GSM_GetLocale
+.. doxygenfunction:: GSM_SetLocale
+.. doxygenfunction:: GSM_GetSyncMLSettings
+.. doxygenfunction:: GSM_SetSyncMLSettings
+.. doxygenfunction:: GSM_GetChatSettings
+.. doxygenfunction:: GSM_SetChatSettings
+.. doxygenfunction:: GSM_GetMMSSettings
+.. doxygenfunction:: GSM_SetMMSSettings
+.. doxygenfunction:: GSM_SetAutoNetworkLogin
+.. doxygenfunction:: GSM_Reset
+.. doxygenfunction:: GSM_ResetPhoneSettings
+.. doxygenfunction:: GSM_GetProfile
+.. doxygenfunction:: GSM_SetProfile
+.. doxygenfunction:: GSM_GetFMStation
+.. doxygenfunction:: GSM_SetFMStation
+.. doxygenfunction:: GSM_ClearFMStations
+.. doxygenfunction:: GSM_GetGPRSAccessPoint
+.. doxygenfunction:: GSM_SetGPRSAccessPoint
+.. doxygenstruct:: GSM_SyncMLSettings
+ :members:
+.. doxygenenum:: GSM_ResetSettingsType
+.. doxygenstruct:: GSM_ChatSettings
+ :members:
+.. doxygenenum:: GSM_Profile_Feat_Value
+.. doxygenenum:: GSM_Profile_Feat_ID
+.. doxygenstruct:: GSM_Profile
+ :members:
+.. doxygenstruct:: GSM_FMStation
+ :members:
+.. doxygenstruct:: GSM_GPRSAccessPoint
+ :members:
+.. doxygenenum:: GSM_DateFormat
+.. doxygenstruct:: GSM_Locale
+ :members:
+.. doxygenstruct:: GSM_Profile_PhoneTableValue
+ :members:
diff --git a/docs/manual/c/smsd.rst b/docs/manual/c/smsd.rst
new file mode 100644
index 0000000..5c06d9a
--- /dev/null
+++ b/docs/manual/c/smsd.rst
@@ -0,0 +1,13 @@
+SMSD
+====
+
+.. doxygenfunction:: SMSD_InjectSMS
+.. doxygenfunction:: SMSD_GetStatus
+.. doxygenfunction:: SMSD_Shutdown
+.. doxygenfunction:: SMSD_ReadConfig
+.. doxygenfunction:: SMSD_MainLoop
+.. doxygenfunction:: SMSD_NewConfig
+.. doxygenfunction:: SMSD_FreeConfig
+.. doxygenstruct:: GSM_SMSDStatus
+ :members:
+.. doxygentypedef:: GSM_SMSDConfig
diff --git a/docs/manual/c/statemachine.rst b/docs/manual/c/statemachine.rst
new file mode 100644
index 0000000..62078d8
--- /dev/null
+++ b/docs/manual/c/statemachine.rst
@@ -0,0 +1,32 @@
+State machine
+=============
+
+.. doxygenfunction:: GSM_InitConnection_Log
+
+.. doxygenfunction:: GSM_InitConnection
+
+.. doxygenfunction:: GSM_TerminateConnection
+
+.. doxygenfunction:: GSM_AbortOperation
+
+.. doxygenfunction:: GSM_Install
+
+.. doxygentypedef:: GSM_StateMachine
+
+.. doxygenenum:: GSM_ConnectionType
+
+.. doxygenstruct:: GSM_Config
+ :members:
+
+.. doxygentypedef:: GSM_Log_Function
+
+.. doxygenfunction:: GSM_ReadDevice
+.. doxygenfunction:: GSM_IsConnected
+.. doxygenfunction:: GSM_FindGammuRC
+.. doxygenfunction:: GSM_ReadConfig
+.. doxygenfunction:: GSM_GetConfig
+.. doxygenfunction:: GSM_GetConfigNum
+.. doxygenfunction:: GSM_SetConfigNum
+.. doxygenfunction:: GSM_AllocStateMachine
+.. doxygenfunction:: GSM_FreeStateMachine
+.. doxygenfunction:: GSM_GetUsedConnection
diff --git a/docs/manual/c/types.rst b/docs/manual/c/types.rst
new file mode 100644
index 0000000..ddae807
--- /dev/null
+++ b/docs/manual/c/types.rst
@@ -0,0 +1,5 @@
+Types
+=====
+
+.. doxygentypedef:: gboolean
+
diff --git a/docs/manual/c/unicode.rst b/docs/manual/c/unicode.rst
new file mode 100644
index 0000000..7000826
--- /dev/null
+++ b/docs/manual/c/unicode.rst
@@ -0,0 +1,24 @@
+Unicode
+=======
+
+.. doxygenfunction:: UnicodeLength
+.. doxygenfunction:: DecodeUnicodeString
+.. doxygenfunction:: DecodeUnicodeConsole
+.. doxygenfunction:: DecodeUnicode
+.. doxygenfunction:: EncodeUnicode
+.. doxygenfunction:: ReadUnicodeFile
+.. doxygenfunction:: CopyUnicodeString
+.. doxygenfunction:: EncodeUTF8QuotedPrintable
+.. doxygenfunction:: DecodeUTF8QuotedPrintable
+.. doxygenfunction:: EncodeWithUTF8Alphabet
+.. doxygenfunction:: DecodeWithUTF8Alphabet
+.. doxygenfunction:: DecodeHexUnicode
+.. doxygenfunction:: EncodeHexUnicode
+.. doxygenfunction:: mywstrncmp
+.. doxygenfunction:: mywstrstr
+.. doxygenfunction:: mywstrncasecmp
+.. doxygenfunction:: EncodeUTF8
+.. doxygenfunction:: DecodeUTF8
+.. doxygenfunction:: DecodeHexBin
+.. doxygenfunction:: EncodeWithUnicodeAlphabet
+.. doxygenfunction:: DecodeWithUnicodeAlphabet
diff --git a/docs/manual/c/wap.rst b/docs/manual/c/wap.rst
new file mode 100644
index 0000000..7cfcfe2
--- /dev/null
+++ b/docs/manual/c/wap.rst
@@ -0,0 +1,17 @@
+WAP
+===
+
+.. doxygenfunction:: GSM_EncodeURLFile
+.. doxygenfunction:: GSM_GetWAPBookmark
+.. doxygenfunction:: GSM_SetWAPBookmark
+.. doxygenfunction:: GSM_DeleteWAPBookmark
+.. doxygenfunction:: GSM_GetWAPSettings
+.. doxygenfunction:: GSM_SetWAPSettings
+.. doxygenstruct:: GSM_WAPBookmark
+ :members:
+.. doxygenenum:: WAPSettings_Speed
+.. doxygenenum:: WAPSettings_Bearer
+.. doxygenstruct:: GSM_WAPSettings
+ :members:
+.. doxygenstruct:: GSM_MultiWAPSettings
+ :members:
diff --git a/docs/manual/conf.py b/docs/manual/conf.py
new file mode 100644
index 0000000..a687607
--- /dev/null
+++ b/docs/manual/conf.py
@@ -0,0 +1,424 @@
+# -*- coding: utf-8 -*-
+#
+# python-gammu documentation build configuration file, created by
+# sphinx-quickstart on Tue Mar 10 18:14:17 2009.
+#
+# This file is execfile()d with the current directory set to its
+# containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys
+import os
+import shlex
+
+# Change what .. option:: parses
+import sphinx.domains.std
+import re
+
+try:
+ import alabaster
+ has_alabaster = True
+except ImportError:
+ has_alabaster = False
+
+on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
+
+def gammu_process_link(self, env, refnode, has_explicit_title, title, target):
+ program = env.temp_data.get('std:program')
+ if not has_explicit_title:
+ if ' ' in title and not (title.startswith('/') or
+ title.startswith('-')):
+ program, target = re.split(' (?=-|--|/)?', title, 1)
+ program = sphinx.domains.std.ws_re.sub('-', program)
+ target = target.strip()
+ elif ' ' in target:
+ program, target = re.split(' (?=-|--|/)?', target, 1)
+ program = sphinx.domains.std.ws_re.sub('-', program)
+ refnode['refprogram'] = program
+ return title, target
+
+sphinx.domains.std.option_desc_re = re.compile(
+ r'((?:/|-|--|^)[-_a-zA-Z0-9]+)(\s*.*?)(?=,\s+(?:/|-|--)|$)')
+sphinx.domains.std.OptionXRefRole.process_link = gammu_process_link
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+sys.path.append('@CMAKE_CURRENT_SOURCE_DIR@')
+sys.path.append(os.path.abspath(os.path.dirname(__file__)))
+
+# -- General configuration ------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
+# ones.
+extensions = ['breathe', 'configext', 'sphinx.ext.graphviz', 'sphinx.ext.intersphinx']
+
+intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None)}
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['@CMAKE_CURRENT_SOURCE_DIR@/.templates']
+
+# The suffix(es) of source filenames.
+# You can specify multiple suffix as a list of string:
+# source_suffix = ['.rst', '.md']
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'Gammu'
+copyright = u'2009-2015, Michal ÄŒihaÅ™ <michal@cihar.com>'
+author = u'Michal ÄŒihaÅ™ <michal@cihar.com>'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '@GAMMU_VERSION@'
+# The full version, including alpha/beta/rc tags.
+release = version
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#
+# This is also used if you do content translation via gettext catalogs.
+# Usually you set "language" from the command line for these cases.
+language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['.build']
+
+# The reST default role (used for this markup: `text`) to use for all
+# documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+# If true, keep warnings as "system message" paragraphs in the built documents.
+#keep_warnings = False
+
+# If true, `todo` and `todoList` produce output, else they produce nothing.
+todo_include_todos = False
+
+
+# -- Options for HTML output ----------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+if on_rtd or not has_alabaster:
+ html_theme = 'default'
+else:
+ html_theme = 'alabaster'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+html_theme_path = ['.']
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = []
+
+# Add any extra paths that contain custom files (such as robots.txt or
+# .htaccess) here, relative to this directory. These files are copied
+# directly to the root of the documentation.
+#html_extra_path = []
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Language to be used for generating the HTML full-text search index.
+# Sphinx supports the following languages:
+# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
+# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr'
+#html_search_language = 'en'
+
+# A dictionary with options for the search language support, empty by default.
+# Now only 'ja' uses this config value
+#html_search_options = {'type': 'default'}
+
+# The name of a javascript file (relative to the configuration directory) that
+# implements a search results scorer. If empty, the default will be used.
+#html_search_scorer = 'scorer.js'
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'gammudoc'
+
+# -- Options for LaTeX output ---------------------------------------------
+
+latex_elements = {
+# The paper size ('letterpaper' or 'a4paper').
+ 'papersize': 'a4',
+
+# The font size ('10pt', '11pt' or '12pt').
+#'pointsize': '10pt',
+
+# Additional stuff for the LaTeX preamble.
+#'preamble': '',
+
+# Latex figure (float) alignment
+#'figure_align': 'htbp',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title,
+# author, documentclass [howto, manual, or own class]).
+latex_documents = [
+ ('contents', 'gammu.tex', ur'Gammu Manual',
+ ur'Michal ÄŒihaÅ™ <michal@cihar.com>', 'manual', True),
+ ('smsd/index', 'smsd.tex', ur'Gammu SMSD Daemon Manual',
+ ur'Michal ÄŒihaÅ™ <michal@cihar.com>', 'manual', True),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+latex_domain_indices = True
+
+# -- Options for breathe extension ----------------------------------------
+
+breathe_projects = {
+ 'api':'@DOXYGEN_OUTPUT@/xml',
+}
+
+breathe_default_project = 'api'
+
+
+breathe_domain_by_extension = {
+ "h" : "c",
+}
+
+# -- Options for manual page output ---------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ ('smsd/files', 'gammu-smsd-files', 'gammu-smsd(1) backend using filesystem as a message storage', u'Michal ÄŒihaÅ™ <michal@cihar.com>', 7),
+ ('smsd/tables', 'gammu-smsd-tables', 'description of tables for database backends of gammu-smsd(1)', u'Michal ÄŒihaÅ™ <michal@cihar.com>', 7),
+ ('smsd/mysql', 'gammu-smsd-mysql', 'gammu-smsd(1) backend using MySQL database server as a message storage', u'Michal ÄŒihaÅ™ <michal@cihar.com>', 7),
+ ('smsd/pgsql', 'gammu-smsd-pgsql', 'gammu-smsd(1) backend using PostgreSQL database server as a message storage', u'Michal ÄŒihaÅ™ <michal@cihar.com>', 7),
+ ('smsd/dbi', 'gammu-smsd-dbi', 'gammu-smsd(1) backend using DBI abstraction layer to use any supported database as a message storage', u'Michal ÄŒihaÅ™ <michal@cihar.com>', 7),
+ ('smsd/odbc', 'gammu-smsd-odbc', 'gammu-smsd(1) backend using ODBC abstraction layer to use any supported database as a message storage', u'Michal ÄŒihaÅ™ <michal@cihar.com>', 7),
+ ('smsd/sql', 'gammu-smsd-sql', 'gammu-smsd(1) backend using SQL abstraction layer to use any supported database as a message storage', u'Michal ÄŒihaÅ™ <michal@cihar.com>', 7),
+ ('smsd/run', 'gammu-smsd-run', 'documentation for RunOnReceive directive', u'Michal ÄŒihaÅ™ <michal@cihar.com>', 7),
+ ('smsd/null', 'gammu-smsd-null', 'gammu-smsd(1) backend not storing messages', u'Michal ÄŒihaÅ™ <michal@cihar.com>', 7),
+ ('smsd/config', 'gammu-smsdrc', 'gammu-smsd(1) configuration file', u'Michal ÄŒihaÅ™ <michal@cihar.com>', 5),
+ ('smsd/inject', 'gammu-smsd-inject', 'Inject messages into queue of SMS daemon for Gammu', u'Michal ÄŒihaÅ™ <michal@cihar.com>', 1),
+ ('smsd/monitor', 'gammu-smsd-monitor', 'Monitor state of SMS daemon for Gammu', u'Michal ÄŒihaÅ™ <michal@cihar.com>', 1),
+ ('smsd/smsd', 'gammu-smsd', 'SMS daemon for Gammu', u'Michal ÄŒihaÅ™ <michal@cihar.com>', 1),
+ ('config/index', 'gammurc', 'gammu(1) configuration file', u'Michal ÄŒihaÅ™ <michal@cihar.com>', 5),
+ ('gammu/index', 'gammu', 'Does some neat things with your cellular phone or modem.', u'Michal ÄŒihaÅ™ <michal@cihar.com>', 1),
+ ('formats/backup', 'gammu-backup', 'gammu(1) backup file format.', u'Michal ÄŒihaÅ™ <michal@cihar.com>', 5),
+ ('formats/smsbackup', 'gammu-smsbackup', 'gammu(1) SMS backup file format.', u'Michal ÄŒihaÅ™ <michal@cihar.com>', 5),
+ ('utils/jadmaker', 'jadmaker', 'JAD File Generator', u'Michal ÄŒihaÅ™ <michal@cihar.com>', 1),
+ ('utils/gammu-config', 'gammu-config', 'Gammu configurator', u'Michal ÄŒihaÅ™ <michal@cihar.com>', 1),
+ ('utils/gammu-detect', 'gammu-detect', 'Gammu device detection', u'Michal ÄŒihaÅ™ <michal@cihar.com>', 1),
+]
+
+# If true, show URL addresses after external links.
+#man_show_urls = False
+
+
+# -- Options for Texinfo output -------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+# dir menu entry, description, category)
+texinfo_documents = [
+ (master_doc, 'testproject', u'testproject Documentation',
+ author, 'testproject', 'One line description of project.',
+ 'Miscellaneous'),
+]
+
+# Documents to append as an appendix to all manuals.
+#texinfo_appendices = []
+
+# If false, no module index is generated.
+#texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#texinfo_show_urls = 'footnote'
+
+# If true, do not generate a @detailmenu in the "Top" node's menu.
+#texinfo_no_detailmenu = False
+
+
+# -- Options for Epub output ----------------------------------------------
+
+# Bibliographic Dublin Core info.
+epub_title = project
+epub_author = author
+epub_publisher = author
+epub_copyright = copyright
+
+# The basename for the epub file. It defaults to the project name.
+#epub_basename = project
+
+# The HTML theme for the epub output. Since the default themes are not optimized
+# for small screen space, using the same theme for HTML and epub output is
+# usually not wise. This defaults to 'epub', a theme designed to save visual
+# space.
+#epub_theme = 'epub'
+
+# The language of the text. It defaults to the language option
+# or 'en' if the language is not set.
+#epub_language = ''
+
+# The scheme of the identifier. Typical schemes are ISBN or URL.
+#epub_scheme = ''
+
+# The unique identifier of the text. This can be a ISBN number
+# or the project homepage.
+#epub_identifier = ''
+
+# A unique identification for the text.
+#epub_uid = ''
+
+# A tuple containing the cover image and cover page html template filenames.
+#epub_cover = ()
+
+# A sequence of (type, uri, title) tuples for the guide element of content.opf.
+#epub_guide = ()
+
+# HTML files that should be inserted before the pages created by sphinx.
+# The format is a list of tuples containing the path and title.
+#epub_pre_files = []
+
+# HTML files shat should be inserted after the pages created by sphinx.
+# The format is a list of tuples containing the path and title.
+#epub_post_files = []
+
+# A list of files that should not be packed into the epub file.
+epub_exclude_files = ['search.html']
+
+# The depth of the table of contents in toc.ncx.
+#epub_tocdepth = 3
+
+# Allow duplicate toc entries.
+#epub_tocdup = True
+
+# Choose between 'default' and 'includehidden'.
+#epub_tocscope = 'default'
+
+# Fix unsupported image types using the Pillow.
+#epub_fix_images = False
+
+# Scale large images.
+#epub_max_image_width = 0
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#epub_show_urls = 'inline'
+
+# If false, no index is generated.
+#epub_use_index = True
+
+graphviz_output_format = 'svg'
diff --git a/docs/manual/config/index.rst b/docs/manual/config/index.rst
new file mode 100644
index 0000000..48fb31b
--- /dev/null
+++ b/docs/manual/config/index.rst
@@ -0,0 +1,421 @@
+.. _gammurc:
+
+Gammu Configuration File
+========================
+
+Synopsis
+--------
+
+On Linux, MacOS X, BSD and other Unix-like systems, the config file is
+searched in following order:
+
+1. ``$XDG_CONFIG_HOME/gammu/config``
+2. ``~/.config/gammu/config``
+3. ``~/.gammurc``
+4. ``/etc/gammurc``
+
+On Microsoft Windows:
+
+1. ``%PROFILE%\Application Data\gammurc``
+2. ``.\gammurc``
+
+Description
+-----------
+
+Gammu requires configuration to be able to properly talk to your phone.
+:ref:`gammu` reads configuration from a config file. It's location is determined
+on runtime, see above for search paths.
+
+You can use :ref:`gammu-config` or :ref:`gammu-detect` to generate
+configuration file or start from :ref:`Fully documented example`.
+
+For hints about configuring your phone, you can check Gammu Phone
+Database <https://wammu.eu/phones/> to see what user users
+experienced.
+
+This file use ini file syntax, see :ref:`ini`.
+
+Configuration file for gammu can contain several sections - ``[gammu]``, ``[gammu1]``,
+``[gammuN]``, ... Each section configures one connection setup and in default mode
+gammu tries all of them in numerical order. You can also specify which
+configuration section to use by giving it's number (:config:section:`[gammu]` has number 0) as a
+parameter to :ref:`gammu` and it will then use only this section.
+
+.. config:section:: [gammu]
+
+This section is read by default unless you specify other on command line.
+
+Device connection parameters
+++++++++++++++++++++++++++++
+
+.. config:option:: Connection
+
+ Protocol which will be used to talk to your phone.
+
+ For Nokia cables you want to use one of following:
+
+ ``fbus``
+ serial FBUS connection
+ ``dlr3``
+ DLR-3 and compatible cables
+ ``dku2``
+ DKU-2 and compatible cables
+ ``dku5``
+ DKU-5 and compatible cables
+ ``mbus``
+ serial MBUS connection
+
+ If you use some non original cable, you might need to append ``-nodtr`` (eg. for
+ ARK3116 based cables) or ``-nopower``, but Gammu should be able to detect this
+ automatically.
+
+ For non-Nokia phones connected using cable you generally want:
+
+ ``at``
+ generic AT commands based connection
+
+ You can optionally specify speed of the connection, eg. ``at19200``, but it is
+ not needed for modern USB cables.
+
+ For IrDA connections use one of following:
+
+ ``irdaphonet``
+ Phonet connection for Nokia phones.
+ ``irdaat``
+ AT commands connection for most of phones (this is not supported on Linux).
+ ``irdaobex``
+ OBEX (IrMC or file transfer) connection for most of phones.
+ ``irdagnapbus``
+ GNapplet based connection for Symbian phones, see :ref:`gnapplet`.
+
+ For Bluetooth connection use one of following:
+
+ ``bluephonet``
+ Phonet connection for Nokia phones.
+ ``bluefbus``
+ FBUS connection for Nokia phones.
+ ``blueat``
+ AT commands connection for most of phones.
+ ``blueobex``
+ OBEX (IrMC or file transfer) connection for most of phones.
+ ``bluerfgnapbus``
+ GNapplet based connection for Symbian phones, see :ref:`gnapplet`.
+ ``blues60``
+ Connection to Series60 applet in S60 phones, see :ref:`s60`.
+
+ .. versionadded:: 1.29.90
+
+
+ .. versionadded:: 1.36.7
+
+ Gammu now supports connecting using proxy command.
+
+ You can also proxy the connection using shell command, for example to
+ different host. This can be done using proxy connections:
+
+ ``proxyphonet``
+ Phonet connection for Nokia phones.
+ ``proxyfbus``
+ FBUS connection for Nokia phones.
+ ``proxyat``
+ AT commands connection for most of phones.
+ ``proxyobex``
+ OBEX (IrMC or file transfer) connection for most of phones.
+ ``proxygnapbus``
+ GNapplet based connection for Symbian phones, see :ref:`gnapplet`.
+ ``proxys60``
+ Connection to Series60 applet in S60 phones, see :ref:`s60`.
+
+ .. seealso:: :ref:`faq-config`
+
+.. config:option:: Device
+
+ .. versionadded:: 1.27.95
+
+ Device node or address of phone. It depends on used connection.
+
+ For **cables** or emulated serial ports, you enter device name (for example
+ ``/dev/ttyS0``, ``/dev/ttyACM0``, ``/dev/ircomm0``, ``/dev/rfcomm0`` on Linux,
+ ``/dev/cuad0`` on 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.
+
+ .. note::
+
+ Some USB modems expose several interfaces, in such cases Gammu works best
+ with "User" one, you can find more information on
+ <http://www.dd-wrt.com/wiki/index.php/Mobile_Broadband>.
+
+ 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
+ Device = serial:123456 # Match device by serial string
+
+ .. note::
+
+ On Linux systems, you might lack permissions for some device nodes.
+ You might need to be member of some group (eg. :samp:`plugdev` or
+ :samp:`dialout`) or or add special udev rules to enable you access
+ these devices as non-root.
+
+ For Nokia phones you can put following file (also available in sources
+ as :file:`contrib/udev/69-gammu-acl.rules`) as
+ :file:`/etc/udev/rules.d/69-gammu-acl.rules`:
+
+ .. literalinclude:: ../../../contrib/udev/69-gammu-acl.rules
+ :language: sh
+
+ In case your USB device appears as the serial port in the system (eg.
+ ``/dev/ttyACM0`` on Linux or ``COM5:`` on Windows), just use same setup as
+ with serial port.
+
+ For **Bluetooth** connection you have to enter Bluetooth address of your phone
+ (you can list Bluetooth devices in range on Linux using :command:`hcitool scan`
+ command). Optionally you can also force Gammu to use specified channel by
+ including channel number after slash.
+
+ Before using Gammu, your device should be paired with computer or you should
+ have set up automatic pairing.
+
+ For **Proxy** connections, you need to specify command which should be
+ executed. It is supposed to pass bidirectional communication from Gammu to
+ the device. This can happen for example over network.
+
+ For **IrDA** connections, this parameters is not used at all.
+
+ If IrDA does not work on Linux, you might need to bring up the interface and
+ enable discovery (you need to run these commands as root):
+
+ .. code-block:: sh
+
+ ip l s dev irda0 up # Enables irda0 device
+ sysctl net.irda.discovery=1 # Enables device discovery on IrDA
+
+ .. note::
+
+ Native IrDA is not supported on Linux, you need to setup virtual
+ serial port for it (eg. ``/dev/ircomm0``) and use it same way as cable.
+ This can be usually achieved by loading modules ``ircomm-tty`` and ``irtty-sir``:
+
+ .. code-block:: sh
+
+ modprobe ircomm-tty
+ modprobe irtty-sir
+
+ .. seealso:: :ref:`faq-config`
+
+.. config:option:: Port
+
+ .. deprecated:: 1.27.95
+
+ Please use :config:option:`Device` instead.
+
+ Alias for :config:option:`Device`, kept for backward compatibility.
+
+.. config:option:: Model
+
+ Do not use this parameter unless really needed! The only use case for this is
+ when Gammu does not know your phone and misdetects it's features.
+
+ The only special case for using model is to force special type of OBEX
+ connection instead of letting Gammu try the best suited for selected
+ operation:
+
+ ``obexfs``
+ force using of file browsing service (file system support)
+ ``obexirmc``
+ force using of IrMC service (contacts, calendar and notes support)
+ ``obexnone``
+ none service chosen, this has only limited use for sending file (:option:`gammu sendfile` command)
+ ``mobex``
+ m-obex service for Samsung phones
+
+.. config:option:: Use_Locking
+
+ On Posix systems, you might want to lock serial device when it is being used
+ using UUCP-style lock files. Enabling this option (setting to yes) will make
+ Gammu honor these locks and create it on startup. On most distributions you
+ need additional privileges to use locking (eg. you need to be member of uucp
+ group).
+
+ This option has no meaning on Windows.
+
+Connection options
+++++++++++++++++++
+
+.. config:option:: SynchronizeTime
+
+ If you want to set time from computer to phone during starting connection.
+
+.. config:option:: StartInfo
+
+ This option allows one to set, that you want (setting ``yes``) to see
+ message on the phone screen or phone should enable light for a moment
+ during starting connection. Phone will not beep during starting connection
+ with this option. This works only with some Nokia phones.
+
+
+Debugging options
++++++++++++++++++
+
+.. config:option:: LogFile
+
+ Path to file where information about communication will be stored.
+
+ .. note::
+
+ For most debug levels (excluding ``errors``) the log file is overwritten on
+ each execution.
+
+.. config:option:: LogFormat
+
+ Determines what all will be logged to :config:option:`LogFile`. Possible values are:
+
+ ``nothing``
+ no debug level
+ ``text``
+ transmission dump in text format
+ ``textall``
+ all possible info in text format
+ ``textalldate``
+ all possible info in text format, with time stamp
+ ``errors``
+ errors in text format
+ ``errorsdate``
+ errors in text format, with time stamp
+ ``binary``
+ transmission dump in binary format
+
+ For debugging use either ``textalldate`` or ``textall``, it contains all
+ needed information to diagnose problems.
+
+.. config:option:: Features
+
+ Custom features for phone. This can be used as override when values coded
+ in ``common/gsmphones.c`` are bad or missing. Consult
+ ``include/gammu-info.h`` for possible values (all :c:type:`GSM_Feature` values
+ without leading ``F_`` prefix). Please report correct values to Gammu
+ authors.
+
+Locales and character set options
++++++++++++++++++++++++++++++++++
+
+.. config:option:: GammuCoding
+
+ Forces using specified codepage (for example ``1250`` will force CP-1250 or
+ ``utf8`` for UTF-8). This should not be needed, Gammu detects it according
+ to your locales.
+
+.. config:option:: GammuLoc
+
+ Path to directory with localisation files (the directory should contain
+ ``LANG/LC_MESSAGES/gammu.mo``). If gammu is properly installed it should find
+ these files automatically.
+
+Other options
++++++++++++++
+
+.. config:option:: DataPath
+
+ Additional path where to search for data files. The default path is
+ configured on build time (and defaults to ``/usr/share/data/gammu`` on Unix
+ systems). Currently it is used only for searching files to upload to phone
+ using :option:`gammu install`.
+
+Examples
+--------
+
+There is more complete example available in Gammu documentation, see :ref:`gammu`.
+
+Connection examples
++++++++++++++++++++
+
+Gammu configuration for Nokia phone using DLR-3 cable:
+
+.. code-block:: ini
+
+ [gammu]
+ device = /dev/ttyACM0
+ connection = dlr3
+
+Gammu configuration for Sony-Ericsson phone (or any other AT compatible
+phone) connected using USB cable:
+
+.. code-block:: ini
+
+ [gammu]
+ device = /dev/ttyACM0
+ connection = at
+
+Gammu configuration for Sony-Ericsson (or any other AT compatible
+phone) connected using bluetooth:
+
+.. code-block:: ini
+
+ [gammu]
+ device = B0:0B:00:00:FA:CE
+ connection = blueat
+
+Gammu configuration for phone which needs to manually adjust Bluetooth channel to use channel 42:
+
+.. code-block:: ini
+
+ [gammu]
+ device = B0:0B:00:00:FA:CE/42
+ connection = blueat
+
+Working with multiple phones
+++++++++++++++++++++++++++++
+
+Gammu can be configured for multiple phones (however only one connection
+is used at one time, you can choose which one to use with :option:`gammu -s`
+parameter). Configuration for phones on three serial ports would look
+like following:
+
+.. code-block:: ini
+
+ [gammu]
+ device = /dev/ttyS0
+ connection = at
+
+ [gammmu1]
+ device = /dev/ttyS1
+ connection = at
+
+ [gammmu2]
+ device = /dev/ttyS2
+ connection = at
+
+Connecting to remote phone
+++++++++++++++++++++++++++
+
+.. versionadded:: 1.36.7
+
+You can connect using Gammu to phone running on different host. This can be
+achieved using proxy connection, which executes command to forward
+bi-directional communication with the phone.
+
+.. code-block:: ini
+
+ [gammu]
+ device = ssh root@my.router /usr/local/bin/myscript /dev/ttyUSB0
+ connection = proxyat
+
+You can find sample script which can be used on the remote side in
+:file:`contrib/proxy/gammu-backend`.
+
+.. _Fully documented example:
+
+Fully documented example
+++++++++++++++++++++++++
+
+You can find this sample file as :file:`docs/config/gammurc` in Gammu sources.
+
+.. literalinclude:: ../../../docs/config/gammurc
+ :language: ini
+
diff --git a/docs/manual/configext.py b/docs/manual/configext.py
new file mode 100644
index 0000000..50b1cb7
--- /dev/null
+++ b/docs/manual/configext.py
@@ -0,0 +1,156 @@
+from sphinx.locale import l_, _
+from sphinx.domains import Domain, ObjType
+from sphinx.roles import XRefRole
+from sphinx.domains.std import GenericObject, StandardDomain
+from sphinx.directives import ObjectDescription
+from sphinx.util.nodes import clean_astext, make_refnode
+from sphinx.util import ws_re
+from sphinx import addnodes
+from docutils import nodes
+
+class ConfigOption(ObjectDescription):
+ indextemplate = l_('configuration option; %s')
+ parse_node = None
+
+ def handle_signature(self, sig, signode):
+ if self.parse_node:
+ name = self.parse_node(self.env, sig, signode)
+ else:
+ signode.clear()
+ signode += addnodes.desc_name(sig, sig)
+ # normalize whitespace like XRefRole does
+ name = ws_re.sub('', sig)
+ return name
+
+ def add_target_and_index(self, name, sig, signode):
+ targetname = '%s-%s' % (self.objtype, name)
+ signode['ids'].append(targetname)
+ self.state.document.note_explicit_target(signode)
+ if self.indextemplate:
+ colon = self.indextemplate.find(':')
+ if colon != -1:
+ indextype = self.indextemplate[:colon].strip()
+ indexentry = self.indextemplate[colon+1:].strip() % (name,)
+ else:
+ indextype = 'single'
+ indexentry = self.indextemplate % (name,)
+ self.indexnode['entries'].append((indextype, indexentry,
+ targetname, targetname))
+ self.env.domaindata['config']['objects'][self.objtype, name] = \
+ self.env.docname, targetname
+
+
+class ConfigSectionXRefRole(XRefRole):
+ """
+ Cross-referencing role for configuration sections (adds an index entry).
+ """
+
+ def result_nodes(self, document, env, node, is_ref):
+ if not is_ref:
+ return [node], []
+ varname = node['reftarget']
+ tgtid = 'index-%s' % env.new_serialno('index')
+ indexnode = addnodes.index()
+ indexnode['entries'] = [
+ ('single', varname, tgtid, varname),
+ ('single', _('configuration section; %s') % varname, tgtid, varname)
+ ]
+ targetnode = nodes.target('', '', ids=[tgtid])
+ document.note_explicit_target(targetnode)
+ return [indexnode, targetnode, node], []
+
+class ConfigSection(ObjectDescription):
+ indextemplate = l_('configuration section; %s')
+ parse_node = None
+
+ def handle_signature(self, sig, signode):
+ if self.parse_node:
+ name = self.parse_node(self.env, sig, signode)
+ else:
+ signode.clear()
+ signode += addnodes.desc_name(sig, sig)
+ # normalize whitespace like XRefRole does
+ name = ws_re.sub('', sig)
+ return name
+
+ def add_target_and_index(self, name, sig, signode):
+ targetname = '%s-%s' % (self.objtype, name)
+ signode['ids'].append(targetname)
+ self.state.document.note_explicit_target(signode)
+ if self.indextemplate:
+ colon = self.indextemplate.find(':')
+ if colon != -1:
+ indextype = self.indextemplate[:colon].strip()
+ indexentry = self.indextemplate[colon+1:].strip() % (name,)
+ else:
+ indextype = 'single'
+ indexentry = self.indextemplate % (name,)
+ self.indexnode['entries'].append((indextype, indexentry,
+ targetname, targetname))
+ self.env.domaindata['config']['objects'][self.objtype, name] = \
+ self.env.docname, targetname
+
+
+class ConfigOptionXRefRole(XRefRole):
+ """
+ Cross-referencing role for configuration options (adds an index entry).
+ """
+
+ def result_nodes(self, document, env, node, is_ref):
+ if not is_ref:
+ return [node], []
+ varname = node['reftarget']
+ tgtid = 'index-%s' % env.new_serialno('index')
+ indexnode = addnodes.index()
+ indexnode['entries'] = [
+ ('single', varname, tgtid, varname),
+ ('single', _('configuration option; %s') % varname, tgtid, varname)
+ ]
+ targetnode = nodes.target('', '', ids=[tgtid])
+ document.note_explicit_target(targetnode)
+ return [indexnode, targetnode, node], []
+
+
+class ConfigFileDomain(Domain):
+ name = 'config'
+ label = 'Config'
+
+ object_types = {
+ 'option': ObjType(l_('config option'), 'option'),
+ 'section': ObjType(l_('config section'), 'section'),
+ }
+ directives = {
+ 'option': ConfigOption,
+ 'section': ConfigSection,
+ }
+ roles = {
+ 'option': ConfigOptionXRefRole(),
+ 'section': ConfigSectionXRefRole(),
+ }
+
+ initial_data = {
+ 'objects': {}, # (type, name) -> docname, labelid
+ }
+
+ def clear_doc(self, docname):
+ for key, (fn, _) in self.data['objects'].items():
+ if fn == docname:
+ del self.data['objects'][key]
+
+ def resolve_xref(self, env, fromdocname, builder,
+ typ, target, node, contnode):
+ docname, labelid = self.data['objects'].get((typ, target), ('', ''))
+ if not docname:
+ return None
+ else:
+ return make_refnode(builder, fromdocname, docname,
+ labelid, contnode)
+
+ def get_objects(self):
+ for (type, name), info in self.data['objects'].iteritems():
+ yield (name, name, type, info[0], info[1],
+ self.object_types[type].attrs['searchprio'])
+
+def setup(app):
+ app.add_domain(ConfigFileDomain)
+
diff --git a/docs/manual/contents.rst b/docs/manual/contents.rst
new file mode 100644
index 0000000..41bd579
--- /dev/null
+++ b/docs/manual/contents.rst
@@ -0,0 +1,29 @@
+.. _contents:
+
+Gammu Documentation Contents
+----------------------------
+
+.. toctree::
+ :maxdepth: 2
+
+ project/index
+ quick/index
+ faq/index
+ python/index
+ c/index
+ internal/index
+ formats/index
+ config/index
+ gammu/index
+ smsd/index
+ utils/index
+ testing/index
+ protocol/index
+ glossary
+
+Indices and tables
+------------------
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
diff --git a/docs/manual/faq/config.rst b/docs/manual/faq/config.rst
new file mode 100644
index 0000000..37c3b48
--- /dev/null
+++ b/docs/manual/faq/config.rst
@@ -0,0 +1,130 @@
+.. _faq-config:
+
+Configuring Gammu FAQ
+=====================
+
+.. _faq-config-at:
+
+How to configure 3G/UMTS/... modem or AT capable phone?
+-------------------------------------------------------
+
+As most modems support AT commands, this is pretty easy and you should use
+``at`` :config:option:`Connection`. For :config:option:`Device` you should use
+device name as modem appears in your system, for example ``/dev/ttyACM0`` or
+``COM7:``.
+
+Some modems expose more serial ports and you need to carefully choose the right
+one - for example only one of them can receive USSD notifications.
+
+.. note::
+
+ On Linux, you might have to install `usb-modeswitch`_ to make your modem
+ actually behave like a modem and not like a disk containing drivers for
+ Windows.
+
+.. seealso:: :ref:`faq-devname`, :ref:`gammurc`
+
+.. _usb-modeswitch: http://www.draisberghof.de/usb_modeswitch/
+
+Example configuration on Linux:
+
+.. code-block:: ini
+
+ [gammu]
+ device = /dev/ttyACM3
+ connection = at
+
+Example configuration on Windows:
+
+.. code-block:: ini
+
+ [gammu]
+ device = COM12:
+ connection = at
+
+.. _faq-config-symbian:
+
+How to configure Symbian based phone?
+-------------------------------------
+
+The only support for Symbian phones is using applet installed to phone and
+Bluetooth connection. You should use ``blues60`` :config:option:`Connection`
+and Bluetooth address of phone as :config:option:`Device`. On older Symbian
+phones you will have to use gnapplet and ``bluerfgnapbus`` connection.
+
+.. seealso:: :ref:`s60`, :ref:`gammurc`
+
+.. note::
+
+ Do not forget to start the applet before trying to connect to the phone.
+
+Example configuration:
+
+.. code-block:: ini
+
+ [gammu]
+ device = 11:22:33:44:55:66 # Bluetooth address of your phone
+ connection = blues60
+
+.. _faq-config-nokia:
+
+How to configure Nokia phone?
+-----------------------------
+
+If you have Series 40 (S40) phone, it should work using either Bluetooth or USB
+cable.
+
+For Bluetooth connection, ``bluephonet`` :config:option:`Connection` is always
+the right choice with Bluetooth address of phone as :config:option:`Device`.
+
+For USB cable choosing the right connection type is more tricky and depends on
+generation of your phone. Newest phones usually work with ``dku2`` and the
+older ones with ``dlr3`` as :config:option:`Connection`.
+
+Should you have old phone with serial cable (and USB to serial converter),
+``fbus`` :config:option:`Connection` is the right one.
+
+.. seealso:: :ref:`gammurc`
+
+Example configuration for Bluetooth:
+
+.. code-block:: ini
+
+ [gammu]
+ device = 11:22:33:44:55:66 # Bluetooth address of your phone
+ connection = bluephonet
+
+Example configuration for newer phones:
+
+.. code-block:: ini
+
+ [gammu]
+ connection = dku2
+
+Example configuration for older phones on Linux:
+
+.. code-block:: ini
+
+ [gammu]
+ device = /dev/ttyACM3
+ connection = dlr3
+
+Example configuration for older phones on Windows:
+
+.. code-block:: ini
+
+ [gammu]
+ device = COM12:
+ connection = dlr3
+
+How to configure phone not listed above?
+----------------------------------------
+
+First check whether your phone is supported. In case it is, it most likely
+falls into one of above categories.
+
+You can also find additional user experiences in `Gammu Phones Database`_.
+
+.. seealso:: :ref:`faq-phones`, :ref:`gammurc`
+
+.. _Gammu Phones Database: https://wammu.eu/phones/
diff --git a/docs/manual/faq/general.rst b/docs/manual/faq/general.rst
new file mode 100644
index 0000000..de8e74f
--- /dev/null
+++ b/docs/manual/faq/general.rst
@@ -0,0 +1,115 @@
+General Gammu FAQ
+=================
+
+Will Gammu work on my system?
+-----------------------------
+
+Gammu is known to run on wide range of systems. It can be compiled natively on
+Linux, Mac OS X, FreeBSD, OpenBSD and Microsoft Windows. It can be probably
+compiled also elsewhere, but nobody has yet tried. On some platforms however
+you might lack support for some specific kind of devices (eg. Bluetooth or
+USB).
+
+.. seealso:: :ref:`installing`
+
+How to set sender number in message?
+------------------------------------
+
+You can quite often see messages sent from textual address or with some other
+nice looking sender number. However this needs to be done in the GSM network
+and it is not possible to influence this from the terminal device (phone).
+Usually it is set by SMSC and some network providers allow you to set this
+based on some contract. Alternatively you can use their SMS gateways, which
+also allow this functionality.
+
+.. seealso:: :ref:`gammu-sms`
+
+Can I use Gammu to send MMS?
+----------------------------
+
+MMS contains of two parts - the actual MMS data in SMIL format and the SMS
+containing notification about the data. Gammu can create the notification SMS,
+where you just need to put URL of the data (use :option:`gammu sendsms`
+MMSINDICATOR for that). However you need to encode MMS data yourself or use
+other program to do that.
+
+.. _faq-devname:
+
+Device name always changes on Linux, how to solve that?
+-------------------------------------------------------
+
+You can use udev to assign persistent device name (used as
+:config:option:`Device`). You can either use standard persistent names based on
+serial number (located in :file:`/dev/serial/by-id/`) or define own rules::
+
+ ACTION=="add", SUBSYSTEMS=="usb", ATTRS{manufacturer}=="Nokia", KERNEL=="ttyUSB*", SYMLINK+="phone"
+
+Better is to use vendor and product IDs (you can get them for example using :command:`lsusb`)::
+
+ ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="xxxx", ATTRS{idProduct}=="yyyy", SYMLINK+="phone"
+
+If you're using 3G modem, it's quite likely that it exposes multiple interfaces
+and only one of them is good for Gammu usage. In this case you should match
+against interface number as well::
+
+ ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="xxxx", ATTRS{idProduct}=="yyyy", ATTRS{bInterfaceNumber}=="00", SYMLINK+="phone"
+
+You can match by various attributes, you can figure them using udevadm command:
+
+.. code-block:: sh
+
+ udevadm info --name=/dev/ttyUSB1 --attribute-walk
+
+.. seealso::
+
+ Various documentation on creating persistent device names using udev is
+ available online, for example on the `Debian wiki`_ or in
+ `Writing udev rules`_ document.
+
+.. _echo:
+
+Mutliple programs using same device cause various errors, how to fix that?
+--------------------------------------------------------------------------
+
+Gammu needs to be the only program using the device, otherwise you will get
+strange errors from both programs as they will read answer to command sent by
+something else.
+
+In gammu, it can happen quite early with error message "Phone does not support
+enabled echo, it can not work with Gammu!", but it can be spotted later as
+well, depending on various conditions.
+
+In case you see such behavior, check what other programs are using given device.
+This can be done using :program:`fuser` tool:
+
+.. code-block:: sh
+
+ fuser -va /dev/ttyACM0
+
+The usual programs involve:
+
+* NetworkManager with ModemManager, you need to disable mobile networking to
+ stop it using the device, disabling the modem connection does not seem to be
+ enough.
+* Other Gammu instance, in case you want to interact with modem while SMSD is
+ running see :ref:`gammu-smsd-suspend`.
+
+
+What are free alternatives to Gammu?
+------------------------------------
+
+It depends on your phone. For Nokia or AT based phones, you can try `Gnokii`_,
+but Gammu should be superior in most cases. For Symbian phone you can try using
+`Series60-Remote`_, which works pretty well with S60 phones, though Gammu
+brings various fixes to their applet.
+
+If you are looking for synchronisation, try using something what supports
+SyncML to retrieve contacts or calendar from your phone, for example
+`OpenSync`_ or `syncEvolution`_.
+
+.. _Debian wiki: http://wiki.debian.org/udev#persistent-name
+.. _Writing udev rules: http://reactivated.net/writing_udev_rules.html
+.. _Series60-Remote: http://series60-remote.sourceforge.net/
+.. _OpenSync: http://www.opensync.org/
+.. _syncEvolution: http://syncevolution.org/
+.. _Gnokii: http://gnokii.org/
diff --git a/docs/manual/faq/index.rst b/docs/manual/faq/index.rst
new file mode 100644
index 0000000..5ef1755
--- /dev/null
+++ b/docs/manual/faq/index.rst
@@ -0,0 +1,13 @@
+.. _faq:
+
+Frequently Asked Questions
+==========================
+
+.. toctree::
+ :maxdepth: 2
+
+ general
+ config
+ phone
+ smsd
+ python
diff --git a/docs/manual/faq/phone.rst b/docs/manual/faq/phone.rst
new file mode 100644
index 0000000..d6e1f0b
--- /dev/null
+++ b/docs/manual/faq/phone.rst
@@ -0,0 +1,72 @@
+Phone Support FAQ
+=================
+
+.. _faq-phones:
+
+Is my phone supported?
+----------------------
+
+Generally any phone capable of AT commands or IrMC should be supported. Also
+any Nokia phone using Nokia OS should work. For Symbian please check separate
+topic. You can check other user experiences in `Gammu Phones Database`_.
+
+For information how to configure your phone, see :ref:`faq-config`.
+
+.. seealso:: :ref:`faq-nokia`, :ref:`faq-symbian`, :ref:`faq-android`, :ref:`faq-blackberry`, :ref:`faq-iphone`, :ref:`faq-config`, :ref:`gammurc`
+
+Which phone is best supported?
+------------------------------
+
+It really depends on what you expect. If you want to use SMSD, this topic is covered
+in separate FAQ (see :ref:`faq-smsd-phone`). For backing up your contacts or calendar,
+most of Nokia (S40 or S60) phones should work as well as any other capable of AT
+commands. Gammu also supports wide range of extensions for Samsung, Motorola, Siemens
+or Sony-Ericsson phones.
+
+.. seealso:: :ref:`faq-smsd-phone`
+
+.. _faq-nokia:
+
+Are Nokia phones supported?
+---------------------------
+
+It depends on used operating systems Series40 and older phones should work
+(see :ref:`faq-config-nokia` for information how to configure them), Symbian
+based phones are covered in separate topic, check :ref:`faq-symbian`.
+
+.. _faq-symbian:
+
+Are Symbian phones supported?
+-----------------------------
+
+You need to install applet to the phone to allow Gammu talk to it. For older
+phones (Symbian 9.0 and older), install gnapplet (see :ref:`gnapplet`). Newer
+phones can use Python based applet called Series60-remote (see :ref:`s60`).
+This option is supported since Gammu 1.29.90.
+
+.. seealso:: :ref:`faq-config-symbian`
+
+.. _faq-android:
+
+Are Android phones supported?
+-----------------------------
+
+Unfortunately no at the moment. Any help in this area is welcome.
+
+.. seealso:: See our `issue tracker <https://github.com/gammu/gammu/issues/81>`_ for more details.
+
+.. _faq-blackberry:
+
+Are Blackberry phones supported?
+--------------------------------
+
+Unfortunately no at the moment. Any help in this area is welcome.
+
+.. _faq-iphone:
+
+Are iPhone phones supported?
+----------------------------
+
+Unfortunately no at the moment. Any help in this area is welcome.
+
+.. _Gammu Phones Database: https://wammu.eu/phones/
diff --git a/docs/manual/faq/python.rst b/docs/manual/faq/python.rst
new file mode 100644
index 0000000..033dd25
--- /dev/null
+++ b/docs/manual/faq/python.rst
@@ -0,0 +1,19 @@
+Python-gammu FAQ
+================
+
+Where can I download python-gammu?
+----------------------------------
+
+The python-gammu project has been merged into `Gammu`_, so you just need
+to grab `Gammu`_ and it includes python-gammu. Binaries for Windows are
+distributed separately.
+
+How can I use python-gammu?
+---------------------------
+
+There are lot of examples shipped with Gammu, you can find them in
+the :file:`examples` subdirectory.
+
+.. seealso:: :ref:`python`, :ref:`python-gammu-examples`
+
+.. _Gammu: https://wammu.eu/gammu/
diff --git a/docs/manual/faq/smsd.rst b/docs/manual/faq/smsd.rst
new file mode 100644
index 0000000..a35f441
--- /dev/null
+++ b/docs/manual/faq/smsd.rst
@@ -0,0 +1,89 @@
+SMSD FAQ
+========
+
+Which databases does SMSD support?
+----------------------------------
+
+SMSD natively supports `MySQL`_ and `PostgreSQL`_. However it has also support for
+`libdbi`_, which provides access to wide range of database engines (eg. SQLite, MS
+SQL Server, Sybase, Firebird,...). Unfortunately `libdbi`_ currently does not work
+natively on Microsoft Windows, so you can use it only on Unix platforms.
+
+Since version 1.29.92, SMSD can also connect to any ODBC data source, so you
+should be able to connect to virtually any database engine using this
+standard.
+
+.. seealso:: :ref:`gammu-smsd-sql`
+
+Is there some user interface for SMSD?
+--------------------------------------
+
+Yes. You can use some of example interfaces distributed with gammu in ``contrib``
+directory. Or there is full featured separate interface written in PHP called
+`Kalkun`_.
+
+.. _faq-smsd-phone:
+
+Which phone is best for SMSD gateway?
+-------------------------------------
+
+Standard phones usually do not perform good when used long term as a modem. So
+it's always better to choose some GSM (GPRS, EDGE, UMTS) terminals/modems, which
+are designed to be used long for term in connection with computer.
+
+The best option seem to be Siemens modems (eg. ES75/MC35i/MC55i). Slightly
+cheaper, while still good are modems made by Huawei (eg. E160/E220/E1750/...).
+We have heard also positive experiences with cheap modems from various Chinese
+resellers like DealExtreme or Alibaba.
+
+.. seealso:: You can check other user experiences in `Gammu Phones Database`_.
+
+The RunOnReceive script fails, how to fix that?
+-----------------------------------------------
+
+There can be various reasons why the script you've supplied as
+:config:option:`RunOnReceive` has failed. You can usually find more information
+in the debug log (see :ref:`reporting-bugs-smsd`). For example it can look like
+following:
+
+.. code-block:: log
+
+ gammu-smsd[9886]: Starting run on receive: ../received.sh
+ gammu-smsd[9875]: Process failed with exit status 2
+ gammu-smsd[9875]: Subprocess output: ../received.sh: 7: ../received.sh: Syntax error: end of file unexpected (expecting "then")
+
+From here it's quite easy to diagnose it's a syntax error in the script causing
+troubles.
+
+.. note::
+
+ If process output is missing from your debug log, you're using older
+ version, which didn't support this. Please upgrade to version newer than
+ 1.36.4.
+
+.. seealso:: :ref:`gammu-smsd-run`, :config:option:`RunOnReceive`
+
+Why received delivery reports are not matched to sent messages?
+---------------------------------------------------------------
+
+This can occasionally happen and can have several reasons.
+
+* If reports are arriving late, you can adjust
+ :config:option:`DeliveryReportDelay`.
+* If reports are coming from different SMSC than you're using for sending, set
+ :config:option:`SkipSMSCNumber`.
+* If SMSD is unable to match sent message with delivery report, it might be due
+ to missing international prefix in one of the numbers. Generally the best
+ approach is to always send messages to international number (eg. use
+ ``+32485xxxxxx`` instead of ``0485xxxxxx``).
+
+.. note::
+
+ If using Gammu 1.36.3 or newer, whenever first two cases happen, you will
+ see hint to adjust the configuration in the log.
+
+.. _Kalkun: http://kalkun.sourceforge.net/
+.. _MySQL: https://www.mysql.com/
+.. _PostgreSQL: https://www.postgresql.org/
+.. _libdbi: http://libdbi.sourceforge.net/
+.. _Gammu Phones Database: https://wammu.eu/phones/
diff --git a/docs/manual/formats/backup.rst b/docs/manual/formats/backup.rst
new file mode 100644
index 0000000..d48ff59
--- /dev/null
+++ b/docs/manual/formats/backup.rst
@@ -0,0 +1,56 @@
+.. _gammu-backup:
+
+Backup Format
+=============
+
+The backup format is text file encoded in either ASCII or UCS-2-BE encodings.
+
+This file use ini file syntax, see :ref:`ini`.
+
+Examples
+--------
+
+If you will backup settings to Gammu text file, it will be possible to edit
+it. It's easy: many things in this file will be written double - once in Unicode,
+once in ASCII. When you will remove Unicode version Gammu will use ASCII
+on \fBrestore\fR (and you can easy edit ASCII text) and will convert it
+according to your OS locale. When will be available Unicode version of text,
+it will be used instead of ASCII (useful with Unicode phones - it isn't important,
+what locale is set in computer and no conversion Unicode -> ASCII and ASCII ->
+Unicode is done).
+
+You can use any editor with regular expressions function to edit backup text
+file. Examples of such editors can be `vim <http://www.vim.org/>`_ or
+`TextPad <http://www.textpad.com/>`_ which both do support regular expressions.
+
+Remove info about voice tags
+
+Find::
+
+ ^Entry\([0-9][0-9]\)VoiceTag = \(.*\)\n
+
+Replace::
+
+ <blank>
+
+Change all numbers starting from +3620, +3630, +3660, +3670 to +3620
+
+Find::
+
+ Type = NumberGeneral\nEntry\([0-9][0-9]\)Text = "\+36\(20\|30\|60\|70\)\n
+
+Replace::
+
+ Type = NumberMobile\nEntry\1Text = "\+3620
+
+Change phone numbers type to mobile for numbers starting from +3620, +3630,... and removing the corresponding TextUnicode line
+
+Find::
+
+ Type = NumberGeneral\nEntry\([0-9][0-9]\)Text = "\+36\([2367]0\)\([^\"]*\)"\nEntry\([0-9][0-9]\)TextUnicode = \([^\n]*\)\n
+
+Replace::
+
+ Type = NumberMobile\nEntry\1Text = "\+36\2\3"\n
+
+.. seealso:: :ref:`converting-formats`
diff --git a/docs/manual/formats/index.rst b/docs/manual/formats/index.rst
new file mode 100644
index 0000000..e03a4f2
--- /dev/null
+++ b/docs/manual/formats/index.rst
@@ -0,0 +1,14 @@
+.. _formats:
+
+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
+
+ ini
+ smsbackup
+ backup
diff --git a/docs/manual/formats/ini.rst b/docs/manual/formats/ini.rst
new file mode 100644
index 0000000..4e7ef65
--- /dev/null
+++ b/docs/manual/formats/ini.rst
@@ -0,0 +1,31 @@
+.. _ini:
+
+INI file format
+===============
+
+The INI file format is widely used in Gammu, for both configuration (see
+:ref:`gammurc`) and storing data (see :ref:`gammu-backup` and :ref:`gammu-smsbackup`).
+
+This file use ini file syntax, with comment parts being marked with both ``;``
+and ``#``. Sections of config file are identified in square brackets line
+``[this]``. All key values are case insensitive.
+
+Examples
+--------
+
+You most likely know INI files from other programs, however to illustrate,
+here is some example:
+
+.. code-block:: ini
+
+ ; comment
+
+ [section]
+ key = value
+
+ [another section]
+
+ key = longer value
+
+
+ # another comment
diff --git a/docs/manual/formats/smsbackup.rst b/docs/manual/formats/smsbackup.rst
new file mode 100644
index 0000000..d50b219
--- /dev/null
+++ b/docs/manual/formats/smsbackup.rst
@@ -0,0 +1,129 @@
+.. _gammu-smsbackup:
+
+SMS Backup Format
+=================
+
+The SMS backup format is text file encoded in current encoding of platform
+where Gammu is running.
+
+This file use ini file syntax, see :ref:`ini`.
+
+Sections
+--------
+
+The file consists of sections, whose name starts with ``SMSBackup``. When
+creating the backup file, three digits are appended to this text defining
+order. While reading the backup, any part after ``SMSBackup`` text is ignored
+and everything which begins with this is processed. So you can as well give
+the section name ``SMSBackupFoo`` and it will be processed.
+
+The number of messages in backup file is currently limited by
+:c:data:`GSM_BACKUP_MAX_SMS` (100000 at time of writing this document).
+
+``SMSBackup`` section
++++++++++++++++++++++
+
+Each section interprets one physical SMS message (eg. one message part in case
+of multipart messages).
+
+Decoded text
+~~~~~~~~~~~~
+
+For SMS backups created by Gammu, there is a decoded text as a comment just
+after the section name:
+
+.. code-block:: ini
+
+ [SMSBackup001]
+ ; This is message text
+
+The text can be split to more lines if it is too long or of original message
+included new lines.
+
+.. note::
+
+ This is easiest way to get message text, however also the least reliable
+ one, because it is stored in the comments in the file.
+
+Variables
+~~~~~~~~~
+
+The following variables can be defined for each SMS:
+
+``SMSC``
+ Text representation of SMSC number, not used by Gammu if ``SMSCUnicode``
+ exists.
+``SMSCUnicode``
+ Hex encoded UCS-2 string with SMSC number.
+``Class``
+ Message class.
+``Sent``
+ Timestamp, when message has been sent.
+``PDU``
+ Message type, one of:
+
+ * ``Deliver`` - received message
+ * ``Submit`` - message to send
+ * ``Status_Report`` - message to send with delivery report
+``DateTime``
+ Timestamp of message (sent or received).
+``RejectDuplicates``
+ Whether receiver should reject duplicates.
+``ReplaceMessage``
+ ID of message to replace.
+``MessageReference``
+ Message reference number as generated by network.
+``State``
+ State of the message:
+
+ * ``Read``
+ * ``UnRead``
+ * ``Sent``
+ * ``UnSent``
+``Number``
+ Recipient number.
+``Name``
+ Name of the message.
+``Length``
+ Length of message text.
+``Coding``
+ Coding of the message:
+
+ * ``8bit`` - binary message
+ * ``Default`` - GSM encoding, up to 160 chars in message
+ * ``Unicode`` - Unicode encoding, up to 70 chars in message
+``Text00`` ... ``TextNN``
+ Numbered parts of the message payload.
+``Folder``
+ ID of folder where the message was saved.
+``UDH``
+ User defined header of the message.
+
+
+Example
+-------
+
+The backup of message can look like following:
+
+.. code-block:: ini
+
+ [SMSBackup000]
+ #ABCDEFGHIJKLMNOPQRSTUVWXYZ
+ #
+ SMSC = "+4540590000"
+ SMSCUnicode = 002B0034003500340030003500390030003000300030
+ Sent = 20021201T025023
+ State = UnRead
+ Number = "+4522706947"
+ NumberUnicode = 002B0034003500320032003700300036003900340037
+ Name = ""
+ NameUnicode =
+ Text00 = 004100420043004400450046004700480049004A004B004C004D004E004F0050005100520053005400550056005700580059005A000A
+ Coding = Default
+ Folder = 1
+ Length = 27
+ Class = -1
+ ReplySMSC = False
+ RejectDuplicates = True
+ ReplaceMessage = 0
+ MessageReference = 0
diff --git a/docs/manual/gammu/index.rst b/docs/manual/gammu/index.rst
new file mode 100644
index 0000000..d404c8f
--- /dev/null
+++ b/docs/manual/gammu/index.rst
@@ -0,0 +1,1988 @@
+.. _gammu:
+
+Gammu Utility
+=============
+
+.. program:: gammu
+
+Synopsis
+++++++++
+
+
+.. code-block:: text
+
+ gammu [parameters] <command> [options]
+
+Commands actually indicate which operation should Gammu perform. They can be
+specified with or without a leading ``--``.
+
+Description
++++++++++++
+
+This program is a tool for mobile phones. Many vendors and phones
+are supported, for actual listing see `Gammu Phones Database <https://wammu.eu/phones/>`_.
+
+
+Options
+-------
+
+Parameters before command configure gammu behaviour:
+
+.. option:: -c, --config <filename>
+
+ name of configuration file (see :ref:`gammurc`)
+
+.. option:: -s, --section <confign>
+
+ section of config file to use, eg. 42
+
+.. option:: -d, --debug <level>
+
+ debug level (see :config:option:`LogFormat` in :ref:`gammurc` for possible values)
+
+.. option:: -f, --debug-file <filename>
+
+ file for logging debug messages
+
+
+Call commands
+-------------
+
+.. option:: answercall [id]
+
+ Answer incoming call.
+
+.. option:: cancelcall [id]
+
+ Cancel incoming call
+
+.. option:: canceldiverts
+
+ Cancel all existing call diverts.
+
+.. option:: conferencecall id
+
+ Initiates a conference call.
+
+.. option:: dialvoice number [show|hide]
+
+ Make voice call from SIM card line set in phone.
+
+ ``show|hide`` - optional parameter whether to disable call number indication.
+
+.. option:: divert get|set all|busy|noans|outofreach all|voice|fax|data [number timeout]
+
+ Manage or display call diverts.
+
+ ``get`` or ``set``
+ whether to get divert information or to set it.
+ ``all`` or ``busy`` or ``noans`` or ``outofreach``
+ condition when apply divert
+ ``all`` or ``voice`` or ``fax`` or ``data``
+ call type when apply divert
+ number
+ number where to divert
+ timeout
+ timeout when the diversion will happen
+
+.. option:: getussd code
+
+ Retrieves USSD information - dials a service number and reads response.
+
+.. option:: holdcall id
+
+ Holds call.
+
+.. option:: maketerminatedcall number length [show|hide]
+
+ Make voice call from SIM card line set in phone which will
+ be terminated after ``length`` seconds.
+
+.. option:: senddtmf sequence
+
+ Plays DTMF sequence. In some phones available only during calls
+
+.. option:: splitcall id
+
+ Splits call.
+
+.. option:: switchcall [id]
+
+ Switches call.
+
+.. option:: transfercall [id]
+
+ Transfers call.
+
+.. option:: unholdcall id
+
+ Unholds call.
+
+.. _gammu-sms:
+
+SMS and EMS commands
+--------------------
+
+Sending messages might look a bit complicated on first attempt to use.
+But be patient, the command line has been written in order to allow
+almost every usage. See EXAMPLE section for some hints on usage.
+
+There is also an option to use :ref:`gammu-smsd` when you want to send or
+receive more messages and process them automatically.
+
+Introduction to SMS formats
+___________________________
+
+Gammu has support for many SMS formats like:
+
+Nokia Smart Messaging
+ used for monochromatic picture images, downloadable profiles, monochromatic operator logos, monochromatic caller logos and monophonic ringtones
+Linked SMS
+ both with 8 and 16-bit identification numbers in headers
+EMS
+ this is SMS format used for saving monochromatic images, monophonic ringtones, animations, text formatting and others
+MMS notifications
+ contains links where phone should download MMS
+Alcatel logo messages
+ proprietary format for logos
+
+
+You need to ensure that the target phone supports message type you want to
+send. Otherwise the phone will not be able to display it or will even crash,
+because firmware of phone did not expect this possibility.
+
+Encoding chars in SMS text
+__________________________
+
+Text in SMS can be coded using two ways:
+
+GSM Default Alphabet
+~~~~~~~~~~~~~~~~~~~~
+
+With `GSM Default Alphabet` you can fit at most 160 chars into single SMS
+(Gammu doesn't support compressing such texts according to GSM standards, but
+it isn't big limit, because there are no phones supporting them), but they're
+from limited set:
+
+* all Latin small and large
+* all digits
+* some Greek
+* some other national
+* some symbols like @ ! " # & / ( ) % * + = - , . : ; < > ?
+* few others
+
+Unicode
+~~~~~~~
+
+With `Unicode` single SMS can contain at most 70 chars, but these can be
+any chars including all national and special ones.
+
+.. warning::
+
+ Please note, that some older phones might have problems displaying such
+ message.
+
+Conversion
+~~~~~~~~~~
+
+Gammu tries to do the best to handle non ASCII characters in your message.
+Everything is internally handled in Unicode (the input is converted depending
+on your locales configuration) and in case message uses Unicode the text will
+be given as such to the message.
+
+Should the message be sent in GSM Default Alphabet, Gammu will try to convert
+all characters to keep message readable. Gammu does support multi byte
+encoding for some characters in GSM Default Alphabet (it is needed for ``^`` ``{`` ``}``
+``\`` ``[`` ``]`` ``~`` ``|``). The characters which are not present in GSM Default Alphabet
+are transliterated to closest ASCII equivalent (accents are removed).
+Remaining not known characters are replaced by question mark.
+
+SMS commands
+____________
+
+.. option:: addsmsfolder name
+
+.. option:: deleteallsms folder
+
+ Delete all SMS from specified SMS folder.
+
+.. option:: deletesms folder start [stop]
+
+ Delete SMS from phone. See description for :option:`gammu getsms` for info about
+ sms folders naming convention.
+
+ Locations are numerated from 1.
+
+.. option:: displaysms ... (options like in sendsms)
+
+ Displays PDU data of encoded SMS messages. It accepts same parameters and
+ behaves same like sendsms.
+
+.. option:: getallsms -pbk
+
+ Get all SMS from phone. In some phones you will have also SMS templates
+ and info about locations used to save Picture Images. With each sms you
+ will see location. If you want to get such sms from phone alone, use
+ :option:`gammu getsms`.
+
+.. option:: geteachsms -pbk
+
+ Similiary to :option:`gammu getallsms`. Difference is, that
+ links all concatenated sms
+
+.. option:: getsms folder start [stop]
+
+ Get SMS.
+
+ Locations are numerated from 1.
+
+ Folder 0 means that sms is being read from "flat" memory (all sms from all
+ folders have unique numbers). It's sometimes emulated by Gammu. You
+ can use it with all phones.
+
+ Other folders like 1, 2, etc. match folders in phone such as Inbox, Outbox, etc.
+ and each sms has unique number in his folder. Name of folders can
+ depend on your phone (the most often 1="Inbox", 2="Outbox", etc.).
+ This method is not supported by all phones (for example, not supported
+ by Nokia 3310, 5110, 6110). If work with your phone, use
+ :option:`gammu getsmsfolders` to get folders list.
+
+.. option:: getsmsc [start [stop]]
+
+ Get SMSC settings from SIM card.
+
+ Locations are numerated from 1.
+
+.. option:: getsmsfolders
+
+ Get names for SMS folders in phone
+
+.. option:: savesms TYPE [type parameters] [type options] [-folder id] [-unread] [-read] [-unsent] [-sent] [-sender number] [-smsname name] [-smscset number] [-smscnumber number] [-reply] [-maxsms num]
+
+ Saves SMS to phone, see below for ``TYPE`` options.
+
+ .. option:: -smscset number
+
+ SMSC number will be taken from phone stored SMSC configuration ``number``.
+
+ Default: 1
+
+ .. option:: -smscnumber number
+
+ SMSC number
+
+ .. option:: -reply
+
+ reply SMSC is set
+
+ .. option:: -folder number
+
+ save to specified folder.
+
+ Folders are numerated from 1.
+
+ The most often folder 1 = "Inbox", 2 = "Outbox",etc. Use :option:`gammu getsmsfolders` to get folder list.
+
+ .. option:: -unread
+
+ makes message unread. In some phones (like 6210) you won't see
+ unread sms envelope after saving such sms. In some phones with internal
+ SMS memory (like 6210) after using it with folder 1 SIM SMS memory will be used
+
+ .. option:: -read
+
+ makes message read. In some phones with internal
+ SMS memory (like 6210) after using it with folder 1 SIM SMS memory will be used
+
+ .. option:: -unsent
+
+ makes message unsent
+
+ .. option:: -sent
+
+ makes message sent
+
+ .. option:: -smsname name
+
+ set message name
+
+ .. option:: -sender number
+
+ set sender number (default: ``Gammu``)
+
+ .. option:: -maxsms num
+
+ Limit maximum number of messages which will be
+ created. If there are more messages, Gammu will terminate with failure.
+
+ Types of messages:
+
+ .. option:: ANIMATION frames file1 file2...
+
+ Save an animation as a SMS. You need to give
+ number of frames and picture for each frame. Each picture can be in any
+ picture format which Gammu supports (B/W bmp, gif, wbmp, nol, nlm...).
+
+ .. option:: BOOKMARK file location
+
+ Read WAP bookmark from file created by :option:`gammu backup` command and saves in
+ Nokia format as SMS
+
+
+ .. option:: CALENDAR file location
+
+ Read calendar note from file created by :option:`gammu backup` command and saves in
+ VCALENDAR 1.0 format as SMS. The location identifies position of calendar item
+ to be read in backup file (usually 1, but can be useful in case the backup contains
+ more items).
+
+
+ .. option:: CALLER file
+
+ Save caller logo as sms in Nokia (Smart Messaging)
+ format - size 72x14, two colors.
+
+ .. warning::
+
+ Please note, that it isn't designed for colour logos available for
+ example in DCT4/TIKU - you need to put bitmap file there inside
+ phone using filesystem commands.
+
+
+ .. option:: USSD
+
+ Send USSD query instead of SMS.
+
+
+ .. option:: EMS [-unicode] [-16bit] [-format lcrasbiut] [-text text] [-unicodefiletext file] [-defsound ID] [-defanimation ID] [-tone10 file] [-tone10long file] [-tone12 file] [-tone12long file] [-toneSE file] [-toneSElong file] [-fixedbitmap file] [-variablebitmap file] [-variablebitmaplong file] [-animation frames file1 ...] [-protected number]
+
+ Saves EMS sequence. All format specific parameters (like :option:`-defsound`) can be used few times.
+
+ .. option:: -text
+
+ adds text
+
+ .. option:: -unicodefiletext
+
+ adds text from Unicode file
+
+ .. option:: -defanimation
+
+ adds default animation with ID specified by user. ID for different phones are different.
+
+ .. option:: -animation
+
+ adds "frames" frames read from file1, file2, etc.
+
+ .. option:: -defsound
+
+ adds default sound with ID specified by user. ID for different phones are different.
+
+ .. option:: -tone10
+
+ adds IMelody version 1.0 read from RTTL or other compatible file
+
+ .. option:: -tone10long
+
+ IMelody version 1.0 saved in one of few SMS with UPI. Phones
+ compatible with UPI (like Sony-Ericsson phones) will read such
+ ringtone as one
+
+ .. option:: -tone12
+
+ adds IMelody version 1.2 read from RTTL or other compatible file
+
+ .. option:: -tone12long
+
+ IMelody version 1.2 saved in one of few SMS with UPI. Phones
+ compatible with UPI (like Sony-Ericsson phones) will read such
+ ringtone as one
+
+ .. option:: -toneSE
+
+ adds IMelody in "short" form supported by Sony-Ericsson phones
+
+ .. option:: -toneSElong
+
+ add Sony-Ericsson IMelody saved in one or few SMS with UPI
+
+ .. option:: -variablebitmap
+
+ bitmap in any size saved in one SMS
+
+ .. option:: -variablebitmaplong
+
+ bitmap with maximum size 96x128 saved in one or few sms
+
+ .. option:: -fixedbitmap
+
+ bitmap 16x16 or 32x32
+
+ .. option:: -protected
+
+ all ringtones and bitmaps after this parameter (excluding default
+ ringtones and logos) will be "protected" (in phones compatible with
+ ODI like SonyEricsson products it won't be possible to forward them
+ from phone menu)
+
+ .. option:: -16bit
+
+ Gammu uses SMS headers with 16-bit numbers for saving linking info
+ in SMS (it means less chars available for user in each SMS)
+
+ .. option:: -format lcrasbiut
+
+ last text will be formatted. You can use combinations of chars:
+
+ ========= ==================
+ Character Formating
+ ========= ==================
+ ``l`` left aligned
+ ``c`` centered
+ ``r`` right aligned
+ ``a`` large font
+ ``s`` small font
+ ``b`` bold font
+ ``i`` italic font
+ ``u`` underlined font
+ ``t`` strikethrough font
+ ========= ==================
+
+
+ .. option:: MMSINDICATOR URL Title Sender
+
+ Creates a MMS indication SMS. It contains URL where the actual MMS
+ payload is stored which needs to be SMIL encoded. The phone usually
+ downloads the MMS data using special APN, which does not count to
+ transmitted data, however there might be limitations which URLs can
+ be accessed.
+
+ .. option:: MMSSETTINGS file location
+
+ Saves a message with MMS configuration. The
+ configuration will be read from Gammu backup file from given location.
+
+ .. option:: OPERATOR file [-netcode netcode] [-biglogo]
+
+ Save operator logo as sms in Nokia (Smart Messaging) format - size
+ 72x14 in two colors.
+
+ .. option:: -biglogo
+
+ Use 78x21 formatted logo instead of standard 72x14.
+
+ .. note::
+
+ This isn't designed for colour logos available for example in newer
+ phones - you need to put bitmap file there inside phone using
+ filesystem commands.
+
+
+ .. option:: PICTURE file [-text text] [-unicode] [-alcatelbmmi]
+
+ Read bitmap from 2 colors file (bmp, nlm, nsl, ngg, nol, wbmp, etc.), format
+ into bitmap in Smart Messaging (72x28, 2 colors, called often Picture Image
+ and saved with text) or Alcatel format and send/save over SMS.
+
+
+ .. option:: PROFILE [-name name] [-bitmap bitmap] [-ringtone ringtone]
+
+ Read ringtone (RTTL) format, bitmap (Picture Image size) and name, format into
+ Smart Messaging profile and send/save as SMS.
+
+ .. warning::
+
+ Please note, that this format is abandoned by Nokia and supported
+ by some (older) devices only like Nokia 3310.
+
+
+ .. option:: RINGTONE file [-long] [-scale]
+
+ Read RTTL ringtone from file and save as SMS
+ into SIM/phone memory. Ringtone is saved in Nokia (Smart Messaging) format.
+
+ .. option:: -long
+
+ ringtone is saved using Profile style. It can be longer (and saved
+ in 2 SMS), but decoded only by newer phones (like 33xx)
+
+ .. option:: -scale
+
+ ringtone will have Scale info for each note. It will allow one to edit
+ it correctly later in phone composer (for example, in 33xx)
+
+
+ .. option:: SMSTEMPLATE [-unicode] [-text text] [-unicodefiletext file] [-defsound ID] [-defanimation ID] [-tone10 file] [-tone10long file] [-tone12 file] [-tone12long file] [-toneSE file] [-toneSElong file] [-variablebitmap file] [-variablebitmaplong file] [-animation frames file1 ...]
+
+ Saves a SMS template (for Alcatel phones).
+
+
+ .. option:: TEXT [-inputunicode] [-16bit] [-flash] [-len len] [-autolen len] [-unicode] [-enablevoice] [-disablevoice] [-enablefax] [-disablefax] [-enableemail] [-disableemail] [-voidsms] [-replacemessages ID] [-replacefile file] [-text msgtext] [-textutf8 msgtext]
+
+ Take text from stdin (or commandline if -text
+ specified) and save as text SMS into SIM/phone memory.
+
+ .. option:: -flash
+
+ Class 0 SMS (should be displayed after receiving on recipients' phone display after receiving without entering Inbox)
+
+ .. option:: -len len
+
+ specify, how many chars will be read. When use this option and text
+ will be longer than 1 SMS, will be split into more linked SMS
+
+ .. option:: -autolen len
+
+ specify, how many chars will be read. When use this option and text
+ will be longer than 1 SMS, will be split into more linked
+ SMS.Coding type (SMS default alphabet/Unicode) is set according to
+ input text
+
+ .. option:: -enablevoice
+
+ sms will set voice mail indicator. Text will be cut to 1 sms.
+
+ .. option:: -disablevoice
+
+ sms will not set voice mail indicator. Text will be cut to 1 sms.
+
+ .. option:: -enablefax
+
+ sms will set fax indicator. Text will be cut to 1 sms.
+
+ .. option:: -disablefax
+
+ sms will not set fax indicator. Text will be cut to 1 sms.
+
+ .. option:: -enableemail
+
+ sms will set email indicator. Text will be cut to 1 sms.
+
+ .. option:: -disableemail
+
+ sms will not set email indicator. Text will be cut to 1 sms.
+
+ .. option:: -voidsms
+
+ many phones after receiving it won't display anything, only beep,
+ vibrate or turn on light. Text will be cut to 1 sms.
+
+ .. option:: -unicode
+
+ SMS will be saved in Unicode format
+
+ .. note::
+
+ The ``~`` char in SMS text and :option:`-unicode` option
+ (Unicode coding required) can cause text of SMS after ``~``
+ char blink in some phones (like Nokia 33xx).
+
+ .. option:: -inputunicode
+
+ input text is in Unicode.
+
+ .. note::
+
+ You can create Unicode file using WordPad in Windows (during
+ saving select "Unicode Text Document" format). In Unix can use
+ for example YUdit or vim.
+
+ .. option:: -text
+
+ get text from command line instead of stdin.
+
+ .. option:: -textutf8
+
+ get text in UTF-8 from command line instead of stdin.
+
+ .. note::
+
+ Gammu detects your locales and uses by default encoding based
+ on this. Use this option only when you know the input will be
+ in UTF-8 in all cases.
+
+ .. option:: -16bit
+
+ Gammu uses SMS headers with 16-bit numbers for saving linking info
+ in SMS (it means less chars available for user in each SMS)
+
+ .. option:: -replacemessages ID
+
+ ``ID`` can be 1..7. When you will use option and send more single
+ SMS to one recipient with the same ID, each another SMS will
+ replace each previous with the same ID
+
+ .. option:: -replacefile file
+
+ File with replacement table in unicode (UCS-2), preferably with
+ byte order mark (BOM). It contains pairs of chars, first one is to
+ replace, second is replacement one. The replacement is done after
+ reading text for the message.
+
+ For example replacement ``1`` (0x0061) with ``a`` (0x0031) would
+ be done by file with following content (hex dump, first two bytes
+ is BOM)::
+
+ ff fe 61 00 31 00
+
+ .. option:: TODO file location
+
+ Saves a message with a todo entry. The content will
+ be read from any backup format which Gammu supports and from given location.
+
+ .. option:: VCARD10|VCARD21 file SM|ME location [-nokia]
+
+ Read phonebook entry from file created by :option:`gammu backup`
+ command and saves in VCARD 1.0 (only name and default number) or VCARD
+ 2.1 (all entry details with all numbers, text and name) format as SMS.
+ The location identifies position of contact item to be read in backup
+ file (usually 1, but can be useful in case the backup contains more
+ items).
+
+
+ .. option:: WAPINDICATOR URL Title
+
+ Saves a SMS with a WAP indication for given
+ URL and title.
+
+
+ .. option:: WAPSETTINGS file location DATA|GPRS
+
+ Read WAP settings from file created by :option:`gammu backup` command
+ and saves in Nokia format as SMS
+
+
+.. option:: sendsms TYPE destination [type parameters] [type options] [-smscset number] [-smscnumber number] [-reply] [-report] [-validity HOUR|6HOURS|DAY|3DAYS|WEEK|MAX] [-save [-folder number]]
+
+ Sends a message to a ``destination`` number, most parameters are same as for :option:`gammu savesms`.
+
+ .. option:: -save
+
+ will also save message which is being sent
+
+ .. option:: -report
+
+ request delivery report for message
+
+ .. option:: -validity HOUR|6HOURS|DAY|3DAYS|WEEK|MAX
+
+ sets how long will be the
+ message valid (SMSC will the discard the message after this time if it could
+ not deliver it).
+
+.. option:: setsmsc location number
+
+ Set SMSC settings on SIM card. This keeps all SMSC configuration
+ intact, it just changes the SMSC number.
+
+ Locations are numerated from 1.
+
+
+Memory (phonebooks and calls) commands
+--------------------------------------
+
+.. _memory types:
+
+Memory types
+____________
+
+Gammu recognizes following memory types:
+
+``DC``
+ Dialled calls
+``MC``
+ Missed calls
+``RC``
+ Received calls
+``ON``
+ Own numbers
+``VM``
+ voice mailbox
+``SM``
+ SIM phonebook
+``ME``
+ phone internal phonebook
+``FD``
+ fixed dialling
+``SL``
+ sent SMS log
+
+
+Memory commands
+_______________
+
+.. option:: deleteallmemory DC|MC|RC|ON|VM|SM|ME|MT|FD|SL
+
+ Deletes all entries from specified memory type.
+
+ For memory types description see :ref:`memory types`.
+
+.. option:: deletememory DC|MC|RC|ON|VM|SM|ME|MT|FD|SL start [stop]
+
+ Deletes entries in specified range from specified memory type.
+
+ For memory types description see :ref:`memory types`.
+
+.. option:: getallmemory DC|MC|RC|ON|VM|SM|ME|MT|FD|SL
+
+ Get all memory locations from phone.
+
+ For memory types description see :ref:`memory types`.
+
+.. option:: getmemory DC|MC|RC|ON|VM|SM|ME|MT|FD|SL start [stop [-nonempty]]
+
+ Get memory location from phone.
+
+ For memory types description see :ref:`memory types`.
+
+ Locations are numerated from 1.
+
+.. option:: getspeeddial start [stop]
+
+ Gets speed dial choices.
+
+.. option:: searchmemory text
+
+ Scans all memory entries for given text. It performs
+ case insensitive substring lookup. You can interrupt searching by pressing
+ :kbd:`Ctrl+C`.
+
+Filesystem commands
+-------------------
+
+Gammu allows one to access phones using native protocol (Nokias) or OBEX. Your
+phone can also support usb storage, which is handled on the operating system
+level and Gammu does not use that.
+
+.. option:: addfile folderID name [-type JAR|BMP|PNG|GIF|JPG|MIDI|WBMP|AMR|3GP|NRT] [-readonly] [-protected] [-system] [-hidden] [-newtime]
+
+ Add file with specified name to folder with specified folder ID.
+
+ .. option:: -type
+
+ File type was required for filesystem 1 in Nokia phones (current filesystem 2 doesn't need this).
+
+ .. option:: -readonly
+
+ Sets the read only attribute.
+
+ .. option:: -protected
+
+ Sets the protected attribute (file can't be for example forwarded
+ from phone menu).
+
+ .. option:: -system
+
+ Sets the system attribute.
+
+ .. option:: -hidden
+
+ Sets the hidden attribute (file is hidden from phone menu).
+
+ .. option:: -newtime
+
+ After using it date/time of file modification will be set to moment of uploading.
+
+.. option:: addfolder parentfolderID name
+
+ Create a folder in phone with specified name in a
+ folder with specified folder ID.
+
+.. option:: deletefiles fileID
+
+ Delete files with given IDs.
+
+.. option:: deletefolder name
+
+ Delete folder with given ID.
+
+.. option:: getfilefolder fileID, fileID, ...
+
+ Retrieve files or all files from folder with given IDs from a phone filesytem.
+
+.. option:: getfiles fileID, fileID, ...
+
+ Retrieve files with given IDs from a phone filesytem.
+
+.. option:: getfilesystem [-flatall|-flat]
+
+ Display info about all folders and files in phone memory/memory card. By default there is tree displayed, you can change it:
+
+ .. option:: -flatall
+
+ there are displayed full file/folder details like ID (first parameter in line)
+
+ .. option:: -flat
+
+ .. note:: In some phones (like N6230) content of some folders (with more files) can be cut (only part of files will be displayed) for example on infrared connection. This is not Gammu issue, but phone firmware problem.
+
+.. option:: getfilesystemstatus
+
+ Display info filesystem status - number of
+ bytes available, used or used by some specific content.
+
+.. option:: getfolderlisting folderID
+
+ Display files and folders available in folder with given folder ID. You can get ID's using getfilesystem -flatall.
+
+ .. warning::
+
+ Please note, that in some phones (like N6230) content of some folders
+ (with more files) can be cut (only part of files will be displayed) for
+ example on infrared connection. This is not Gammu issue, but phone
+ firmware problem.
+
+.. option:: getrootfolders
+
+ Display info about drives available in phone/memory card.
+
+.. option:: sendfile name
+
+ Sends file to a phone. It's up to phone to decide where
+ to store this file and how to handle it (for example when you send vCard or
+ vCalendar, most of phones will offer you to import it.
+
+.. option:: setfileattrib folderID [-system] [-readonly] [-hidden] [-protected]
+
+
+Logo and pictures commands
+--------------------------
+
+These options are mainly (there are few exceptions) for monochromatic logos and
+images available in older phones. Recognized file formats: xpm (only saving),
+2-colors bmp, nlm, nsl, ngg, nol, wbmp, gif (for Samsung).
+
+In new models all bitmaps are saved in filesystem and should go into filesystem section
+
+.. option:: copybitmap inputfile [outputfile [OPERATOR|PICTURE|STARTUP|CALLER]]
+
+ Allow one to convert logos files to another. When give ONLY inputfile, output will
+ be written to stdout using ASCII art. When give output file and format, in
+ some file formats (like NLM) will be set indicator informing about logo type
+ to given.
+
+.. option:: getbitmap TYPE [type options]
+
+ Reads bitmap from phone, following types are supported:
+
+ .. option:: CALLER location [file]
+
+ Get caller group logo from phone. Locations 1-5.
+
+ .. option:: DEALER
+
+ In some models it's possible to save dealer welcome note - text displayed
+ during enabling phone, which can't be edited from phone menu. Here you can
+ get it.
+
+ .. option:: OPERATOR [file]
+
+ Get operator logo (picture displayed instead of operator name) from phone.
+
+ .. option:: PICTURE location [file]
+
+ Get Picture Image from phone.
+
+ .. option:: STARTUP [file]
+
+ Get static startup logo from phone. Allow one to save it in file.
+
+ .. option:: TEXT
+
+ Get startup text from phone.
+
+.. option:: setbitmap TYPE [type options]
+
+ Sets bitmap in phone, following types are supported:
+
+ .. option:: CALLER location [file]
+
+ Set caller logo.
+
+ .. option:: COLOUROPERATOR [fileID [netcode]]
+
+ Sets color operator logo in phone.
+
+ .. option:: COLOURSTARTUP [fileID]
+
+ .. option:: DEALER text
+
+ Sets welcome message configured by dealer, which usually can not be changed in phone menus.
+
+ .. option:: OPERATOR [file [netcode]]
+
+ Set operator logo in phone. When won't give file and netcode, operator logo
+ will be removed from phone. When will give only filename, operator logo will
+ be displayed for your current GSM operator. When you give additionally network
+ code, it will be displayed for this operator.
+
+ .. option:: PICTURE file location [text]
+
+ Sets picture image in phone.
+
+ .. option:: STARTUP file|1|2|3
+
+ Set startup logo in phone. It can be static (then you will have to give file
+ name) or one of predefined animated (only some phones like Nokia 3310 or 3330
+ supports it, use location 1, 2 or 3 for these).
+
+ .. option:: TEXT text
+
+ Sets startup text in phone.
+
+ .. option:: WALLPAPER fileID
+
+ Sets wallpaper in phone.
+
+Ringtones commands
+------------------
+
+Ringtones are mostly supported only for older phones. For recent phones you
+usually just upload them to some folder in phone filesystem.
+
+There are recognized various file formats by options described below: rttl,
+binary format created for Gammu, mid (saving), re (reading), ott, communicator,
+ringtones format found in fkn.pl, wav (saving), ime/imy (saving), rng, mmf (for
+Samsung).
+
+
+.. option:: copyringtone source destination [RTTL|BINARY]
+
+ Copy source ringtone to destination.
+
+.. option:: getphoneringtone location [file]
+
+ Get one of "default" ringtones and saves into file
+
+.. option:: getringtone location [file]
+
+ Get ringtone from phone in RTTL or BINARY format.
+
+ Locations are numerated from 1.
+
+.. option:: getringtoneslist
+
+.. option:: playringtone file
+
+ Play approximation of ringtone over phone buzzer. File can be in RTTL or BINARY (Nokia DCT3) format.
+
+.. option:: playsavedringtone number
+
+ Play one of built-in ringtones. This option is available for DCT4 phones.
+ For getting ringtones list use :option:`gammu getringtoneslist`.
+
+.. option:: setringtone file [-location location] [-scale] [-name name]
+
+ Set ringtone in phone. When don't give location, it will be written
+ "with preview" (in phones supporting this feature like 61xx or 6210).
+
+ .. option:: -scale
+
+ Scale information will be added to each note of RTTL ringtone. It will
+ avoid scale problems available during editing ringtone in composer
+ from phone menu (for example, in Nokia 33xx).
+
+ .. note::
+
+ When use ``~`` char in ringtone name, in some phones (like 33xx) name
+ will blink later in phone menus.
+
+
+Calendar notes commands
+-----------------------
+
+In Nokia 3310, 3315 and 3330 these are named "Reminders" and have some limitations (depending on phone firmware version).
+
+.. option:: deletecalendar start [stop]
+
+ Deletes selected calendar entries in phone.
+
+.. option:: getallcalendar
+
+ Retrieves all calendar entries from phone.
+
+.. option:: getcalendar start [stop]
+
+ Retrieves selected calendar entries from phone.
+
+
+To do list commands
+-------------------
+
+.. option:: deletetodo start [stop]
+
+ Deletes selected todo entries in phone.
+
+.. option:: getalltodo
+
+ Retrieves all todo entries from phone.
+
+.. option:: gettodo start [stop]
+
+ Retrieves selected todo entries from phone.
+
+Notes commands
+--------------
+
+.. option:: getallnotes
+
+ Reads all notes from the phone.
+
+ .. note::
+
+ Not all phones supports this function, especially most Sony Ericsson
+ phones even if they have notes inside phone.
+
+
+Date, time and alarm commands
+-----------------------------
+
+.. option:: getalarm [start]
+
+ Get alarm from phone, if no location is specified,
+ 1 is used.
+
+.. option:: getdatetime
+
+ Get date and time from phone
+
+.. option:: setalarm hour minute
+
+ Sets repeating alarm in phone on selected time.
+
+.. option:: setdatetime [HH:MM[:SS]] [YYYY/MM/DD]
+
+ Set date and time in phone to date and time set in computer. Please
+ note, that this option doesn't show clock on phone screen. It only set
+ date and time.
+
+ .. note::
+
+ You can make such synchronization each time, when will connect your
+ phone and use Gammu. See :config:option:`SynchronizeTime` in :ref:`gammurc` for details.
+
+
+Categories commands
+-------------------
+
+.. note::
+
+ Categories are supported only on few phones (Alcatel).
+
+.. option:: addcategory TODO|PHONEBOOK text
+
+.. option:: getallcategory TODO|PHONEBOOK
+
+.. option:: getcategory TODO|PHONEBOOK start [stop]
+
+.. option:: listmemorycategory text|number
+
+.. option:: listtodocategory text|number
+
+
+Backing up and restoring commands
+---------------------------------
+
+.. option:: addnew file [-yes] [-memory ME|SM|..]
+
+ Adds data written in file created using :option:`gammu backup` command. All things
+ backed up :option:`gammu backup` can be restored (when made backup to Gammu text
+ file).
+
+ Please note that this adds all content of backup file to phone and
+ does not care about current data in the phone (no duplicates are
+ detected).
+
+ Use -yes parameter to answer yes to all questions (you want to automatically
+ restore all data).
+
+ Use -memory parameter to force usage of defined memory type for storing entries
+ regardless what backup format says.
+
+.. option:: addsms folder file [-yes]
+
+ Adds SMSes from file (format like :option:`gammu backupsms` uses) to
+ selected folder in phone.
+
+.. option:: backup file [-yes]
+
+ Backup your phone to file. It's possible to backup (depends on phone and backup format):
+
+ * phonebook from SIM and phone memory
+ * calendar notes
+ * SMSC settings
+ * operator logo
+ * startup (static) logo or startup text
+ * WAP bookmarks
+ * WAP settings
+ * caller logos and groups
+ * user ringtones
+
+ There are various backup formats supported and the backup format is guessed
+ based on file extension:
+
+ * ``.lmb`` - Nokia backup, supports contacts, caller logos and startup logo.
+ * ``.vcs`` - vCalendar, supports calendar and todo.
+ * ``.vcf`` - vCard, supports contacts.
+ * ``.ldif`` - LDAP import, supports contacts.
+ * ``.ics`` - iCalendar, supports calendar and todo.
+ * Any other extension is Gammu backup file and it supports all data mentioned above, see :ref:`gammu-backup` for more details.
+
+ By default this command is interactive and asks which items tou want to backup.
+
+ Use -yes for answering yes to all questions.
+
+.. option:: backupsms file [-yes|-all]
+
+ Stores all SMSes from phone to file into :ref:`gammu-smsbackup`.
+
+ By default this command is interactive and asks which folders you want
+ to backup and whether you want to remove messages from phone afterwards.
+
+ Use -yes for answering yes to all questions (backup all messages and
+ delete them from phone), or -all to just backup all folders while keeping
+ messages in phone.
+
+.. option:: restore file [-yes]
+
+ .. warning::
+
+ Please note that restoring deletes all current content in phone. If you
+ want only to add entries to phone, use :option:`gammu addnew`.
+
+ Restore settings written in file created using :option:`gammu backup` command.
+
+
+ In some phones restoring calendar notes will not show error, but won't
+ be done, when phone doesn't have set clock inside.
+
+.. option:: restoresms file [-yes]
+
+ .. warning::
+
+ Please note that this overwrites existing messages in phone (if it supports it).
+
+ Restores SMSes from file (format like :option:`gammu backupsms` uses) to
+ selected folder in phone.
+
+.. option:: savefile TYPE [type options]
+
+ Converts between various file formats supported by Gammu, following types
+ are supported:
+
+ .. option:: BOOKMARK target.url file location
+
+ Converts backup format supported by
+ Gammu to vBookmark file.
+
+ .. option:: CALENDAR target.vcs file location
+
+ Allows one to convert between various backup formats which gammu
+ supports for calendar events. The file type is guessed (for input file
+ guess is based on extension and file content, for output solely on
+ extension).
+
+ .. option:: TODO target.vcs file location
+
+ Allows one to convert between various backup formats which gammu
+ supports for todo events. The file type is guessed (for input file
+ guess is based on extension and file content, for output solely on
+ extension).
+
+ .. option:: VCARD10|VCARD21 target.vcf file SM|ME location
+
+ Allows one to convert between various backup formats which gammu
+ supports for phonebook events. The file type is guessed (for input file
+ guess is based on extension and file content, for output solely on
+ extension).
+
+ .. seealso:: :option:`gammu convertbackup`
+
+.. option:: convertbackup source.file output.file
+
+ .. versionadded:: 1.28.94
+
+ Converts backup between formats supported by Gammu. Unlike
+ :option:`gammu savefile`, this does not give you any options what to
+ convert, it simply takes converts all what can be saved into output file.
+
+ .. seealso:: :option:`gammu savefile`
+
+
+Nokia specific commands
+-----------------------
+
+.. option:: nokiaaddfile TYPE [type options]
+
+ Uploads file to phone to specific location for the type:
+
+ .. option:: APPLICATION|GAME file [-readonly] [-overwrite] [-overwriteall]
+
+ Install the ``*.jar/*.jad`` file pair of a midlet in the application or
+ game menu of the phone. You need to specify filename without the jar/jad
+ suffix, both will be added automatically.
+
+ .. option:: -overwrite
+
+ Delete the application's .jad and .jar files before installing, but
+ doesn't delete the application data.
+
+ .. option:: -overwriteall
+
+ Delete the application (same as :option:`-overwrite`) and all it's
+ data.
+
+ You can use :ref:`jadmaker` to generate a .jad file from a .jar file.
+
+ .. option:: GALLERY|GALLERY2|CAMERA|TONES|TONES2|RECORDS|VIDEO|PLAYLIST|MEMORYCARD file [-name name] [-protected] [-readonly] [-system] [-hidden] [-newtime]
+
+.. option:: nokiaaddplaylists
+
+ Goes through phone memory and generated playlist for all music files found.
+
+ To manually manage playlists:
+
+ .. code-block:: sh
+
+ gammu addfile a:\\predefplaylist filename.m3u
+
+ Will add playlist filename.m3u
+
+ .. code-block:: sh
+
+ gammu getfilesystem
+
+ Will get list of all files (including names of files with playlists)
+
+ .. code-block:: sh
+
+ gammu deletefiles a:\\predefplaylist\\filename.m3u
+
+ Will delete playlist filename.m3u
+
+ Format of m3u playlist is easy (standard mp3 playlist):
+
+ First line is ``#EXTM3U``, next lines contain names of files (``b:\file1.mp3``,
+ ``b:\folder1\file2.mp3``, etc.). File needs t have ``\r\n`` terminated lines. So
+ just run :program:`unix2dos` on the resulting file before uploading it your your phone.
+
+
+.. option:: nokiacomposer file
+
+ Show, how to enter RTTL ringtone in composer existing in many Nokia phones
+ (and how should it look like).
+
+.. option:: nokiadebug filename [[v11-22] [,v33-44]...]
+
+.. option:: nokiadisplayoutput
+
+.. option:: nokiadisplaytest number
+
+.. option:: nokiagetadc
+
+.. option:: nokiagetoperatorname
+
+ 6110.c phones have place for name for one GSM network (of course, with flashing it's
+ possible to change all names, but Gammu is not flasher ;-)). You can get this
+ name using this option.
+
+.. option:: nokiagetpbkfeatures memorytype
+
+.. option:: nokiagett9
+
+ This option should display T9 dictionary content from
+ DCT4 phones.
+
+.. option:: nokiagetvoicerecord location
+
+ Get voice record from location and save to WAV file. File is
+ coded using GSM 6.10 codec (available for example in win32). Name
+ of file is like name of voice record in phone.
+
+ Created WAV files require GSM 6.10 codec to be played. In Win XP it's included
+ by Microsoft. If you deleted it by accident in this operating system, make such
+ steps:
+
+ 1. Control Panel
+ 2. Add hardware
+ 3. click Next
+ 4. select "Yes. I have already connected the hardware
+ 5. select "Add a new hardware device
+ 6. select "Install the hardware that I manually select from a list
+ 7. select "Sound, video and game controllers
+ 8. select "Audio codecs
+ 9. select "windows\\system32" directory and file "mmdriver.inf
+ 10. if You will be asked for file msgsm32.acm, it should unpacked from Windows CD
+ 11. now You can be asked if want to install unsigned driver (YES), about select codec configuration (select what you want) and rebotting PC (make it)
+
+.. option:: nokiamakecamerashoot
+
+.. option:: nokianetmonitor test
+
+ Takes output or set netmonitor for Nokia DCT3 phones.
+
+ .. seealso::
+
+ For more info about this option, please visit
+ `Marcin's page <http://www.mwiacek.com/>`_ and read netmonitor manual
+ there.
+
+ .. note::
+
+ test ``243`` enables all tests (after using command
+ :command:`gammu nokianetmonitor 243` in some phones like 6210 or 9210 have to reboot
+ them to see netmonitor menu)
+
+.. option:: nokianetmonitor36
+
+ Reset counters from netmonitor test 36 in Nokia DCT3 phones.
+
+ .. seealso::
+
+ For more info about this option, please visit
+ `Marcin's page <http://www.mwiacek.com/>`_ and read netmonitor manual
+ there.
+
+.. option:: nokiasecuritycode
+
+ Get/reset to "12345" security code
+
+.. option:: nokiaselftests
+
+ Perform tests for Nokia DCT3 phones.
+
+ .. note::
+
+ EEPROM test can show an error when your phone has an EEPROM in flash
+ (like 82xx/7110/62xx/33xx). The clock test will show an error when the
+ phone doesn't have an internal battery for the clock (like 3xxx).
+
+.. option:: nokiasetlights keypad|display|torch on|off
+
+.. option:: nokiasetoperatorname [networkcode name]
+
+.. option:: nokiasetphonemenus
+
+ Enable all (?) possible menus for DCT3 Nokia phones:
+
+ 1. ALS (Alternative Line Service) option menu
+ 2. vibra menu for 3210
+ 3. 3315 features in 3310 5.45 and higher
+ 4. two additional games (React and Logic) for 3210 5.31 and higher
+ 5. WellMate menu for 6150
+ 6. NetMonitor
+
+ and for DCT4:
+
+ 1. ALS (Alternative Line Service) option menu
+ 2. Bluetooth, WAP bookmarks and settings menu, ... (6310i)
+ 3. GPRS Always Online
+ 4. and others...
+
+.. option:: nokiasetvibralevel level
+
+ Set vibra power to "level" (given in percent)
+
+.. option:: nokiatuneradio
+
+.. option:: nokiavibratest
+
+
+Siemens specific commands
+-------------------------
+
+.. option:: siemensnetmonact netmon_type
+
+ Enables network monitor in Siemens phone. Currently known values for type
+ are 1 for full and 2 for simple mode.
+
+.. option:: siemensnetmonitor test
+
+.. option:: siemenssatnetmon
+
+Network commands
+----------------
+
+.. option:: getgprspoint start [stop]
+
+.. option:: listnetworks [country]
+
+ Show names/codes of GSM networks known for Gammu
+
+.. option:: networkinfo
+
+ Show information about network status from the phone.
+
+.. option:: setautonetworklogin
+
+WAP settings and bookmarks commands
+-----------------------------------
+
+.. option:: deletewapbookmark start [stop]
+
+ Delete WAP bookmarks from phone.
+
+ Locations are numerated from 1.
+
+.. option:: getchatsettings start [stop]
+
+.. option:: getsyncmlsettings start [stop]
+
+.. option:: getwapbookmark start [stop]
+
+ Get WAP bookmarks from phone.
+
+ Locations are numerated from 1.
+
+.. option:: getwapsettings start [stop]
+
+ Get WAP settings from phone.
+
+ Locations are numerated from 1.
+
+MMS and MMS settings commands
+-----------------------------
+
+.. option:: getallmms [-save]
+
+.. option:: geteachmms [-save]
+
+.. option:: getmmsfolders
+
+.. option:: getmmssettings start [stop]
+
+.. option:: readmmsfile file [-save]
+
+
+FM radio commands
+-----------------
+
+.. option:: getfmstation start [stop]
+
+ Show info about FM stations in phone
+
+Phone information commands
+--------------------------
+
+.. option:: battery
+
+ Displays information about battery and power source.
+
+.. option:: getdisplaystatus
+
+.. option:: getsecuritystatus
+
+ Show, if phone wait for security code (like PIN, PUK, etc.) or not
+
+.. option:: identify
+
+ Show the most important phone data.
+
+.. option:: monitor [times]
+
+ Retrieves phone status and writes it continuously to standard output. Press
+ :kbd:`Ctrl+C` to interrupt this command.
+
+ If no parameter is given, the program runs until interrupted, otherwise
+ only given number of iterations is performed.
+
+ This command outputs almost all information Gammu supports:
+
+ * Number of contacts, calendar and todo entries, messages, calls, etc.
+ * Signal strength.
+ * Battery state.
+ * Currently used network.
+ * Notifications of incoming messages and calls.
+
+
+Phone settings commands
+-----------------------
+
+.. option:: getcalendarsettings
+
+ Displays calendar settings like first day of
+ week or automatic deleting of old entries.
+
+.. option:: getprofile start [stop]
+
+.. option:: resetphonesettings PHONE|DEV|UIF|ALL|FACTORY
+
+ .. warning:: This will delete user data, be careful.
+
+ Reset phone settings.
+
+ ``PHONE``
+ Clear phone settings.
+
+ ``DEV``
+ Clear device settings.
+
+ ``ALL``
+ Clear user settings.
+
+ * removes or set logos to default
+ * set default phonebook and other menu settings
+ * clear T9 words,
+ * clear call register info
+ * set default profiles settings
+ * clear user ringtones
+
+ ``UIF``
+ Clear user settings and disables hidden menus.
+
+ * changes like after ``ALL``
+ * disables netmon and PPS (all "hidden" menus)
+
+ ``FACTORY``
+ Reset to factory defaults.
+
+ * changes like after ``UIF``
+ * clear date/time
+
+
+Dumps decoding commands
+-----------------------
+
+.. note:: These commands are available only if Gammu was compiled with debugging options.
+
+.. option:: decodebinarydump file [phonemodel]
+
+ Decodes a dump made by Gammu with
+ :config:option:`LogFormat` set to ``binary``.
+
+.. option:: decodesniff MBUS2|IRDA file [phonemodel]
+
+ Allows one to decode sniffs. See :ref:`Discovering protocol` for more details.
+
+Other commands
+--------------
+
+.. option:: entersecuritycode PIN|PUK|PIN2|PUK2|PHONE|NETWORK code|- [newpin|-]
+
+ Allow one to enter security code from PC. When code is ``-``, it is read from stdin.
+
+ In case entering PUK, some phones require you to set new PIN as well.
+
+.. option:: presskeysequence mMnNpPuUdD+-123456789*0#gGrR<>[]hHcCjJfFoOmMdD@
+
+ Press specified key sequence on phone keyboard
+
+ ``mM``
+ Menu
+ ``nN``
+ Names key
+ ``pP``
+ Power
+ ``uU``
+ Up
+ ``dD``
+ Down
+ ``+-``
+ +-
+ ``gG``
+ Green
+ ``rR``
+ Red
+ ``123456789*0#``
+ numeric keyboard
+
+.. option:: reset SOFT|HARD
+
+ Make phone reset:
+
+ ``SOFT``
+ without asking for PIN
+ ``HARD``
+ with asking for PIN
+
+ .. note:: Some phones will ask for PIN even with ``SOFT`` option.
+ .. warning:: Some phones will reset user data on ``HARD`` reset.
+
+.. option:: setpower ON|OFF
+
+ .. versionadded:: 1.33.90
+
+ Turns off or on the phone.
+
+ .. note:: This is usually required for built in modules in notebooks.
+
+.. option:: screenshot filename
+
+ Captures phone screenshot and saves it as filename. The extension is
+ automatically appended to filename based on what data phone provides.
+
+Batch mode commands
+-------------------
+
+.. option:: batch [file]
+
+ Starts Gammu in a batch mode. In this mode you can issue
+ several commands each on one line. Lines starting with # are treated as a
+ comments.
+
+ By default, commands are read from standard input, but you can optionally
+ specify a file from where they would be read (special case ``-`` means standard
+ input).
+
+Configuration commands
+----------------------
+
+.. option:: searchphone [-debug]
+
+ Attempts to search for a connected phone.
+
+ .. warning::
+
+ Please note that this can take a very long time, but in case you have
+ no clue how to configure phone connection, this is a convenient way to
+ find working setup for Gammu.
+
+.. option:: install [-minimal]
+
+ Installs applet for currently configured connection to the phone.
+
+ You can configure search path for installation files by
+ :config:option:`DataPath`.
+
+ The -minimal parameter forces installation of applet only without possible
+ support libraries, this can be useful for updates.
+
+Gammu information commands
+--------------------------
+
+.. option:: checkversion [STABLE]
+
+ Checks whether there is newer Gammu version
+ available online (if Gammu has been compiled with CURL). If you pass
+ additional parameter ``STABLE``, only stable versions will be checked.
+
+.. option:: features
+
+ Print information about compiled in features.
+
+.. option:: help [topic]
+
+ Print help. By default general help is printed, but you can
+ also specify a help category to get more detailed help on some topic.
+
+.. option:: version
+
+ Print version information and license.
+
+
+Return values
++++++++++++++
+
+gammu returns 0 on success. In case of failure non zero code is
+returned.
+
+1
+ Out of memory or other critical error.
+2
+ Invalid command line parameters.
+3
+ Failed to open file specified on command line.
+4
+ Program was interrupted.
+98
+ Gammu library version mismatch.
+99
+ Functionality has been moved. For example to :ref:`gammu-smsd`.
+
+Errors codes greater than 100 map to the GSM_Error
+values increased by 100:
+
+101
+ No error.
+102
+ Error opening device. Unknown, busy or no permissions.
+103
+ Error opening device, it is locked.
+104
+ Error opening device, it doesn't exist.
+105
+ Error opening device, it is already opened by other application.
+106
+ Error opening device, you don't have permissions.
+107
+ Error opening device. No required driver in operating system.
+108
+ Error opening device. Some hardware not connected/wrongly configured.
+109
+ Error setting device DTR or RTS.
+110
+ Error setting device speed. Maybe speed not supported.
+111
+ Error writing to the device.
+112
+ Error during reading from the device.
+113
+ Can't set parity on the device.
+114
+ No response in specified timeout. Probably phone not connected.
+115
+ Frame not requested right now. See <https://wammu.eu/support/bugs/> for information how to report it.
+116
+ Unknown response from phone. See <https://wammu.eu/support/bugs/> for information how to report it.
+117
+ Unknown frame. See <https://wammu.eu/support/bugs/> for information how to report it.
+118
+ Unknown connection type string. Check config file.
+119
+ Unknown model type string. Check config file.
+120
+ Some functions not available for your system (disabled in config or not implemented).
+121
+ Function not supported by phone.
+122
+ Entry is empty.
+123
+ Security error. Maybe no PIN?
+124
+ Invalid location. Maybe too high?
+125
+ Functionality not implemented. You are welcome to help authors with it.
+126
+ Memory full.
+127
+ Unknown error.
+128
+ Can not open specified file.
+129
+ More memory required...
+130
+ Operation not allowed by phone.
+131
+ No SMSC number given. Provide it manually or use the one configured in phone.
+132
+ You're inside phone menu (maybe editing?). Leave it and try again.
+133
+ Phone is not connected.
+134
+ Function is currently being implemented. If you want to help, please contact authors.
+135
+ Phone is disabled and connected to charger.
+136
+ File format not supported by Gammu.
+137
+ Nobody is perfect, some bug appeared in protocol implementation. Please contact authors.
+138
+ Transfer was canceled by phone, maybe you pressed cancel on phone.
+139
+ Phone module need to send another answer frame.
+140
+ Current connection type doesn't support called function.
+141
+ CRC error.
+142
+ Invalid date or time specified.
+143
+ Phone memory error, maybe it is read only.
+144
+ Invalid data given to phone.
+145
+ File with specified name already exists.
+146
+ File with specified name doesn't exist.
+147
+ You have to give folder name and not file name.
+148
+ You have to give file name and not folder name.
+149
+ Can not access SIM card.
+150
+ Wrong GNAPPLET version in phone. Use version from currently used Gammu.
+151
+ Only part of folder has been listed.
+152
+ Folder must be empty.
+153
+ Data were converted.
+154
+ Gammu is not configured.
+155
+ Wrong folder used.
+156
+ Internal phone error.
+157
+ Error writing file to disk.
+158
+ No such section exists.
+159
+ Using default values.
+160
+ Corrupted data returned by phone.
+161
+ Bad feature string in configuration.
+162
+ Desired functionality has been disabled on compile time.
+163
+ Bluetooth configuration requires channel option.
+164
+ Service is not running.
+165
+ Service configuration is missing.
+166
+ Command rejected because device was busy. Wait and restart.
+167
+ Could not connect to the server.
+168
+ Could not resolve the host name.
+169
+ Failed to get SMSC number from phone.
+170
+ Operation aborted.
+171
+ Installation data not found, please consult debug log and/or documentation for more details.
+172
+ Entry is read only.
+
+
+Examples
+++++++++
+
+Configuration
+-------------
+
+To check it out, you need to have configuration file for gammu, see
+:ref:`gammurc` for more details about it.
+
+Sending messages
+----------------
+
+.. note::
+
+ All messages below are sent to number 123456, replace it with proper destination.
+
+Send text message up to standard 160 chars:
+
+.. code-block:: sh
+
+ echo "All your base are belong to us" | gammu sendsms TEXT 123456
+
+or
+
+.. code-block:: sh
+
+ gammu sendsms TEXT 123456 -text "All your base are belong to us"
+
+Send long text message:
+
+.. code-block:: sh
+
+ echo "All your base are belong to us" | gammu sendsms TEXT 123456 -len 400
+
+or
+
+.. code-block:: sh
+
+ gammu sendsms TEXT 123456 -len 400 -text "All your base are belong to us"
+
+or
+
+.. code-block:: sh
+
+ gammu sendsms EMS 123456 -text "All your base are belong to us"
+
+Send some funky message with predefined sound and animation from 2 bitmaps:
+
+.. code-block:: sh
+
+ gammu sendsms EMS 123456 -text "Greetings" -defsound 1 -text "from Gammu -tone10 axelf.txt -animation 2 file1.bmp file2.bmp
+
+Send protected message with ringtone:
+
+.. code-block:: sh
+
+ gammu sendsms EMS 123456 -protected 2 -variablebitmaplong ala.bmp -toneSElong axelf.txt -toneSE ring.txt
+
+
+Retrieving USSD replies
+-----------------------
+
+For example for retrieving prepaid card status or retrieving various network info:
+
+.. code-block:: sh
+
+ gammu getussd '#555#'
+
+Uploading files to Nokia
+------------------------
+
+Add Alien to applications in your phone (you need to have files Alien.JAD and Alien.JAR in current directory):
+
+.. code-block:: sh
+
+ gammu nokiaaddfile APPLICATION Alien
+
+Add file.mid to ringtones folder:
+
+.. code-block:: sh
+
+ gammu nokiaaddfile TONES file.mid
+
+Setting operator logo
+---------------------
+
+Set logo for network ``230 03`` (Vodafone CZ):
+
+.. code-block:: sh
+
+ gammu setbitmap OPERATOR ala.bmp "230 03"
+
+.. _converting-formats:
+
+Converting file formats
+-----------------------
+
+The formats conversion can done using :option:`gammu savefile` or
+:option:`gammu convertbackup` commands.
+
+Convert single entry (at position 260) from :ref:`gammu-backup` to vCalendar:
+
+.. code-block:: sh
+
+ gammu savefile CALENDAR output.vcs myCalendar.backup 260
+
+Convert first phonebook entry from :ref:`gammu-backup` to vCard:
+
+.. code-block:: sh
+
+ gammu savefile VCARD21 output.vcf phone.backup ME 1
+
+Convert all contacts from backup to vCard:
+
+.. code-block:: sh
+
+ gammu convertbackup phone.backup output.vcf
+
+
+Reporting bugs
+--------------
+
+There are definitely many bugs, reporting to author is welcome. Please include
+some useful information when sending bug reports (especially debug logs,
+operating system, it's version and phone information are needed).
+
+To generate debug log, enable it in :ref:`gammurc`:
+
+.. code-block:: ini
+
+ [gammu]
+ YOUR CONNECTION SETTINGS
+ logfile = /tmp/gammu.log
+ logformat = textall
+
+Alternatively you can specify logging on command line:
+
+.. code-block:: sh
+
+ gammu -d textall -f /tmp/gammu.log ...
+
+With this settings, Gammu generates /tmp/gammu.log on each connection to
+phone and stores dump of communication there. You can also find some
+hints for improving support for your phone in this log.
+
+See <https://wammu.eu/support/bugs/> for more information on reporting bugs.
+
+Please report bugs to `Gammu bug tracker <https://github.com/gammu/gammu/issues>`_.
diff --git a/docs/manual/glossary.rst b/docs/manual/glossary.rst
new file mode 100644
index 0000000..c2645ed
--- /dev/null
+++ b/docs/manual/glossary.rst
@@ -0,0 +1,8 @@
+Glossary
+========
+
+.. glossary::
+ :sorted:
+
+ TPMR
+ Message reference as generated by GSM network.
diff --git a/docs/manual/index.rst b/docs/manual/index.rst
new file mode 100644
index 0000000..aad45c7
--- /dev/null
+++ b/docs/manual/index.rst
@@ -0,0 +1,37 @@
+The Gammu Manual
+================
+
+Gammu is a project providing abstraction layer for cell phones access. It
+covers wide range of phones, mostly focusing on AT compatible phones and Nokia
+phones.
+
+This manual describes all parts of Gammu, starting with information about
+:ref:`project`, going through API documentation for both :ref:`python` and
+:ref:`libgammu` and covering :ref:`smsd` as well.
+
+
+Continue reading
+----------------
+
+.. hlist::
+ :columns: 2
+
+ * :ref:`quick` -- quick starter guide
+ * :ref:`project` -- learn about Gammu project
+ * :ref:`smsd` -- comprehensive SMSD documentation
+ * :ref:`gammu` -- the Gammu utility
+ * :ref:`gammurc` -- the Gammu configuration file
+ * :ref:`python` -- use Gammu functionality from Python
+ * :ref:`libgammu` -- use Gammu functionality from C
+ * :ref:`internal` -- learn about Gammu internals
+ * :ref:`faq` -- frequently asked questions
+ * :ref:`protocols` -- learn about phone protocols
+ * :ref:`formats` -- file formats supported by Gammu
+
+Full contents
+-------------
+
+.. toctree::
+ :maxdepth: 2
+
+ contents
diff --git a/docs/manual/internal/index.rst b/docs/manual/internal/index.rst
new file mode 100644
index 0000000..9c4acac
--- /dev/null
+++ b/docs/manual/internal/index.rst
@@ -0,0 +1,15 @@
+.. _internal:
+
+Gammu internals
+===============
+
+Gammu project internals are a bit more complicated than required, mostly for
+historical reasons. Before digging into source code, you should look at
+:doc:`../project/directories` and :doc:`../project/coding-style`.
+
+.. toctree::
+ :maxdepth: 2
+
+ reply
+ state-machine
+ new-phone
diff --git a/docs/manual/internal/new-phone.rst b/docs/manual/internal/new-phone.rst
new file mode 100644
index 0000000..f7530c4
--- /dev/null
+++ b/docs/manual/internal/new-phone.rst
@@ -0,0 +1,173 @@
+Adding support for new phone
+============================
+
+This document covers basic information on adding support for new phone into
+Gammu. It will never cover all details, but will give you basic instructions.
+
+Adding support for new AT commands
+----------------------------------
+
+The easiest situation is when all you need to support new device is to add
+support for new AT commands. All the protocol infrastructure is there, you
+only need to hook new code into right places.
+
+The main code for AT driver is in :file:`libgammu/phone/at/atgen.c`. At the
+bottom of the file, you can find two arrays, one defining driver interface
+(:c:type:`GSM_Phone_Functions`) and second one defining callbacks (see
+:ref:`reply-functions` for more detailed description. You will definitely need
+to define callbacks for newly introduced commands, but the interface for
+desired functionality might already exist.
+
+Detecting whether command is supported
+++++++++++++++++++++++++++++++++++++++
+
+As Gammu is trying to support as much phones as possible, you should try to
+make it automatically detect whether connected phone supports the command.
+This can be done on first invocation of affected operation or on connecting to
+phone. As we want to avoid lengthy connecting to phone, in most cases you
+should probe for support on first attempt to use given functionality. The code
+might look like following:
+
+.. code-block:: c
+
+ GSM_Error ATGEN_GetFoo(GSM_StateMachine *s) {
+ GSM_Phone_ATGENData *Priv = &s->Phone.Data.Priv.ATGEN;
+
+ if (Priv->Foo_XXXX == 0) {
+ ATGEN_CheckXXXX(s);
+ }
+
+ if (Priv->Foo_XXXX == AT_AVAILABLE) {
+ /* Perform reading */
+ }
+
+ /* Fail with error or fallback to other methods */
+ return ERR_NOTSUPPORTED;
+ }
+
+ GSM_Error ATGEN_CheckXXXX(GSM_StateMachine *s) {
+ GSM_Error error;
+ GSM_Phone_ATGENData *Priv = &s->Phone.Data.Priv.ATGEN;
+
+ smprintf(s, "Checking availability of XXXX\n");
+ ATGEN_WaitForAutoLen(s, "AT+XXXX=?\r", 0x00, 4, ID_GetProtocol);
+ if (error == ERR_NONE) {
+ Priv->Foo_XXXX = AT_AVAILABLE;
+ } else {
+ Priv->Foo_XXXX = AT_NOTAVAILABLE;
+ }
+ return error;
+ }
+
+
+ GSM_Reply_Function ATGENReplyFunctions[] = {
+ ...
+ {ATGEN_GenericReply, "AT+XXXX=?" ,0x00,0x00,ID_GetProtocol },
+ ...
+
+Alternatively (if detection is not possible), you can use features and phones
+database (see :file:`libgammu/gsmphones.c`) or vendor based decision to use
+some commands.
+
+Invoking AT command
++++++++++++++++++++
+
+The AT commands are invoked using :c:func:`GSM_WaitFor`, or a wrapper
+:c:func:`ATGEN_WaitForAutoLen`, where you don't have to specify length for
+text commands and automatically sets error variable.
+
+Generally you need to construct buffer and then invoke it. For some simple
+functions it is pretty straight forward:
+
+.. code-block:: c
+
+ GSM_Error ATGEN_GetBatteryCharge(GSM_StateMachine *s, GSM_BatteryCharge *bat)
+ {
+ GSM_Error error;
+
+ GSM_ClearBatteryCharge(bat);
+ s->Phone.Data.BatteryCharge = bat;
+ smprintf(s, "Getting battery charge\n");
+ ATGEN_WaitForAutoLen(s, "AT+CBC\r", 0x00, 4, ID_GetBatteryCharge);
+ return error;
+ }
+
+As you can see, it is often required to store pointer to data store somewhere,
+for most data types ``s->Phone.Data`` does contain the pointer to do that.
+
+Parsing reply
++++++++++++++
+
+For parsing reply, you should use :c:func:`ATGEN_ParseReply`, which should
+be able to handle all encoding and parsing magic. You can grab lines from the
+reply using :c:func:`GetLineString`.
+
+The reply function needs to be hooked to the reply functions array, so that it
+is invoked when reply is received from the phone.
+
+Continuing in above example for getting battery status, the (simplified)
+function would look like:
+
+.. code-block:: c
+
+ GSM_Error ATGEN_ReplyGetBatteryCharge(GSM_Protocol_Message *msg, GSM_StateMachine *s)
+ {
+ GSM_Error error;
+ GSM_Phone_ATGENData *Priv = &s->Phone.Data.Priv.ATGEN;
+ GSM_BatteryCharge *BatteryCharge = s->Phone.Data.BatteryCharge;
+ int bcs = 0, bcl = 0;
+
+ switch (s->Phone.Data.Priv.ATGEN.ReplyState) {
+ case AT_Reply_OK:
+ smprintf(s, "Battery level received\n");
+ error = ATGEN_ParseReply(s,
+ GetLineString(msg->Buffer, &Priv->Lines, 2),
+ "+CBC: @i, @i",
+ &bcs,
+ &bcl);
+
+ BatteryCharge->BatteryPercent = bcl;
+
+ switch (bcs) {
+ case 0:
+ BatteryCharge->ChargeState = GSM_BatteryPowered;
+ break;
+ case 1:
+ BatteryCharge->ChargeState = GSM_BatteryConnected;
+ break;
+ case 2:
+ BatteryCharge->ChargeState = GSM_BatteryCharging;
+ break;
+ default:
+ BatteryCharge->ChargeState = 0;
+ smprintf(s, "WARNING: Unknown battery state: %d\n", bcs);
+ break;
+ }
+ return ERR_NONE;
+ case AT_Reply_Error:
+ smprintf(s, "Can't get battery level\n");
+ return ERR_NOTSUPPORTED;
+ case AT_Reply_CMSError:
+ smprintf(s, "Can't get battery level\n");
+ return ATGEN_HandleCMSError(s);
+ case AT_Reply_CMEError:
+ return ATGEN_HandleCMEError(s);
+ default:
+ return ERR_UNKNOWNRESPONSE;
+ }
+ }
+
+
+ GSM_Reply_Function ATGENReplyFunctions[] = {
+ ...
+ {ATGEN_ReplyGetBatteryCharge, "AT+CBC" ,0x00,0x00,ID_GetBatteryCharge },
+ ...
+
+As you can see, all reply function first need to handle which error code did
+they receive and return appropriate error if needed. Functions
+:c:func:`ATGEN_HandleCMSError` and :c:func:`ATGEN_HandleCMEError` simplify
+this, but you might need to customize it by handling some error codes manually
+(eg. when phone returns error on empty location).
+
+The rest of the function is just call to :c:func:`ATGEN_ParseReply` and
+processing parsed data.
diff --git a/docs/manual/internal/reply.rst b/docs/manual/internal/reply.rst
new file mode 100644
index 0000000..70af6c3
--- /dev/null
+++ b/docs/manual/internal/reply.rst
@@ -0,0 +1,117 @@
+.. _reply-functions:
+
+Reply functions
+===============
+
+When phone gives answers, we check if we requested received info and we
+redirect it to concrete reply function, which will decode it. Different
+phone answers can go to one reply function let's say responsible for
+getting sms status.
+
+.. c:type:: GSM_Reply_Function
+
+ Defines reply function for phone driver.
+
+ .. c:member:: GSM_Error (*Function) (GSM_Protocol_Message *msg, GSM_StateMachine *s);
+
+ Callback on reply match.
+
+ .. c:member:: const unsigned char *msgtype;
+
+ String match on the message.
+
+ .. c:member:: const size_t subtypechar;
+
+ Position for char match inside reply. If 0, message type is checked.
+
+ .. c:member:: const int subtype;
+
+ Match for char/message type check (see above).
+
+ .. c:member:: const GSM_Phone_RequestID requestID;
+
+ Match for request ID. this is filled in when calling :c:func:`GSM_WaitFor`.
+
+There are three types of answer matching:
+
+Binary
+------
+
+Example:
+
+.. code-block:: c
+
+ {N6110_ReplySaveSMSMessage,"\x14",0x03,0x05,ID_SaveSMSMessage},
+
+ID_SaveSMSMessage request function reply. Frame is type "\x14",
+0x03 char of frame must be 0x05. If yes, we go to N6110_ReplySaveSMSMessage.
+Of course, things like frame type are found in protocol (here FBUS, MBUS,
+etc.) functions. If don't need anything more than frame type, 0x03,0x05
+should be 0x00, 0x00 - it means then, that we check only frame type.
+
+Text
+----
+
+Example:
+
+.. code-block:: c
+
+ {ATGEN_ReplyIncomingCallInfo,"+CLIP",0x00,0x00,ID_IncomingFrame},
+
+All incoming (not requested in the moment, sent by phone, who
+likes us - ID_IncomingFrame) responses starting from "+CLIP" will go
+to the ATGEN_ReplyIncomingCallInfo.
+
+Numeric
+-------
+
+Example:
+
+.. code-block:: c
+
+ {S60_Reply_Generic, "", 0x00, NUM_QUIT, ID_Terminate },
+
+When match string is empty and match char position is zero, matching on message
+type is performed.
+
+Requests
+--------
+
+This is how GSM_Reply_Function is filled. Now how to make phone requests ?
+
+Example:
+
+.. code-block:: c
+
+ static GSM_Error N6110_GetMemory (GSM_StateMachine *s,
+ GSM_PhonebookEntry *entry)
+ {
+ unsigned char req[] = {
+ N6110_FRAME_HEADER, 0x01,
+ 0x00, /* memory type */
+ 0x00, /* location */
+ 0x00};
+
+ req[4] = NOKIA_GetMemoryType(entry->MemoryType,N6110_MEMORY_TYPES);
+ if (req[4]==0xff) return GE_NOTSUPPORTED;
+
+ req[5] = entry->Location;
+
+ s->Phone.Data.Memory=entry;
+ dprintf("Getting phonebook entry\n");
+ return GSM_WaitFor (s, req, 7, 0x03, 4, ID_GetMemory);
+ }
+
+First we fill req according to values in \*entry. Later set pointer
+in s->Phone.Data (it's available for reply functions and they set
+responses exactly to it) and use GSM_WaitFor. It uses s statemachine,
+sends req frame with length 7, msg type is 0x03, we wait for answer
+during 4 seconds, request id is ID_GetMemory. GSM_WaitFor internally
+checks incoming bytes from phone and redirect them to protocol functions.
+If they found full frame, there is checked GSM_Reply_Function, where is
+called ReplyFunction or showed debug info, that frame is unknown. If
+there is ReplyFunction, it has access to s->Phone.Data and decodes answer.
+Returns error or not (and this is value for GSM_WaitFor). If there is
+no requested answer during time, GSM_WaitFor returns GE_TIMEOUT.
+
+
diff --git a/docs/manual/internal/state-machine.rst b/docs/manual/internal/state-machine.rst
new file mode 100644
index 0000000..67ec6a0
--- /dev/null
+++ b/docs/manual/internal/state-machine.rst
@@ -0,0 +1,29 @@
+State Machine
+=============
+
+The state machine is core of libGammu operations. It gets the data from the
+phone and dispatches them through protocol layer to phone drivers.
+
+To see how it operates, following figure shows example of what happens when
+:c:func:`GSM_GetModel` is called from the program:
+
+.. graphviz::
+
+ digraph statemachine {
+ "GSM_GetModel" -> "Phone.Functions.GetModel";
+ "Phone.Functions.GetModel" -> "GSM_WaitFor";
+ "GSM_WaitFor" -> "Protocol.Functions.WriteMessage";
+ "Protocol.Functions.WriteMessage" -> "GSM_WaitForOnce";
+ "GSM_WaitForOnce" -> "GSM_WaitFor" [label="Retries"];
+ "GSM_WaitForOnce" -> "GSM_ReadDevice";
+ "GSM_ReadDevice" -> "GSM_WaitForOnce" [label="Wair for complete request"];
+ "GSM_ReadDevice" -> "Device.Functions.ReadDevice";
+ "Device.Functions.ReadDevice" -> "GSM_ReadDevice" [label="Wait for data"];
+ "Device.Functions.ReadDevice" -> "Protocol.Functions.StateMachine";
+ "Protocol.Functions.StateMachine" -> "Phone.Functions.DispatchMessage"
+ "Phone.Functions.DispatchMessage" -> "GSM_DispatchMessage";
+ "GSM_DispatchMessage" -> "Phone.Functions.ReplyFunctions[]()";
+ "Phone.Functions.ReplyFunctions[]()" -> "Phone.Functions.GetModel";
+ "Phone.Functions.GetModel" -> "GSM_GetModel";
+ }
+
diff --git a/docs/manual/project/about.rst b/docs/manual/project/about.rst
new file mode 100644
index 0000000..18ae3ab
--- /dev/null
+++ b/docs/manual/project/about.rst
@@ -0,0 +1,16 @@
+About Gammu
+===========
+
+Gammu is library and command line utility for mobile phones. It is
+released under GNU GPL version 2.
+
+It has been initiated by Marcin Wiacek and other people. Originally the
+code was based on `Gnokii`_ and later `MyGnokii`_ projects. Gammu was former (up to version
+0.58) called MyGnokii2.
+
+Currently the project is lead by `Michal ÄŒihaÅ™`_ with
+help of many contributors.
+
+.. _Gnokii: http://www.gnokii.org
+.. _MyGnokii: http://www.mwiacek.com
+.. _Michal ÄŒihaÅ™: mailto:michal@cihar.com
diff --git a/docs/manual/project/coding-style.rst b/docs/manual/project/coding-style.rst
new file mode 100644
index 0000000..3043a6d
--- /dev/null
+++ b/docs/manual/project/coding-style.rst
@@ -0,0 +1,54 @@
+Coding Style
+============
+
+Please follow coding style when touching Gammu code. We know that there are
+still some parts which really do not follow it and fixes to that are also
+welcome.
+
+The coding style is quite similar to what Linux kernel uses, the only major
+differences are requested block braces and switch indentation.
+
+1. Use indentation, tab is tab and is 8 chars wide.
+2. Try to avoid long lines (though there is currently no hard limit on line
+ length).
+3. Braces are placed according to K&R:
+ .. code-block:: c
+
+ int function(int x)
+ {
+ body of function
+ }
+
+ do {
+ body of do-loop
+ } while (condition);
+
+ if (x == y) {
+ ..
+ } else if (x > y) {
+ ...
+ } else {
+ ...
+ }
+4. All blocks should have braces, even if the statements are one liners:
+ .. code-block:: c
+
+ if (a == 2) {
+ foo();
+ }
+5. There should be no spaces after function names, but there should be space after do/while/if/... statements:
+ .. code-block:: c
+
+ while (TRUE) {
+ do_something(work, FALSE);
+ }
+6. Each operand should have spaces around, no spaces after opening parenthesis or before closing parenthesis:
+ .. code-block:: c
+
+ if ((i + 1) == ((j + 2) / 5)) {
+ return *bar;
+ }
+7. Generally all enums start from 1, not from 0. 0 is used for not set value.
+
+You can use :program:`admin/Gindent` to adjust coding style of your file to
+match our coding style.
diff --git a/docs/manual/project/contributing.rst b/docs/manual/project/contributing.rst
new file mode 100644
index 0000000..036d04a
--- /dev/null
+++ b/docs/manual/project/contributing.rst
@@ -0,0 +1,52 @@
+Contributing
+============
+
+We welcome contribution in any area, if you don't have developer skills, you
+can always contribute to :doc:`localization` or just `donate us money`_. In case you are
+interested in fixing some code, please read :doc:`../internal/index` to
+understand structure of Gammu code. We also maintain list of
+`wanted skills <https://wammu.eu/contribute/wanted/>`_ where you can find in
+which areas we currently mostly lack manpower.
+
+Sending patches
+---------------
+
+As we use `Git <http://git-scm.com/>`_ for development, the preferred way to
+get patches is in form which can be directly applied to Git. So start with
+cloning our Git repository::
+
+ git clone https://github.com/gammu/gammu.git gammu
+
+Once you have done that, do some fixes and commit them (see
+`Git tutorial <http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html>`_
+for information how to work with Git). Once you're satisfied with your
+results, you can send the patches (all changes you've made so far) to us::
+
+ git send-email --to=gammu-users@lists.sourceforge.net origin
+
+Please note that `mailing list <https://lists.sourceforge.net/lists/listinfo/gammu-users>`_
+requires you to subscribe before posting. This is anyway good idea in case you
+want to contribute. However if you don't want to do that, just send the mails
+directly to one of authors::
+
+ git send-email --to=michal@cihar.com origin
+
+
+Creating patches
+----------------
+
+If for whatever reason you don't want to use Git, you can also manually create
+patches using :program:`diff`. Also we can handle if you send us just the file
+you have changed with reference where did you take it.
+
+To manually create patch you can use following steps:
+
+1. Copy source with Gammu, you start from, into ``gammu`` directory.
+2. Copy source with Gammu, you want to modify, into ``work`` directory.
+3. Make your changes in ``work`` directory.
+4. Go into parent directory, where ``gammu`` and ``work`` directories are
+ placed.
+5. Call ``diff -rup -X .git gammu work > patchfile``.
+6. Send ``patchfile`` to us (you can use bug tracker or mailing list).
+
+.. _donate us money: https://wammu.eu/donate/
diff --git a/docs/manual/project/directories.rst b/docs/manual/project/directories.rst
new file mode 100644
index 0000000..50d6688
--- /dev/null
+++ b/docs/manual/project/directories.rst
@@ -0,0 +1,204 @@
+Directory structure
+===================
+
+libgammu directory
+------------------
+
+This directory contains sources of Gammu library. You can find all phone
+communication and data encoding functionality here.
+
+There are following subdirectories:
+
+``device``
+ drivers for devices such serial ports or irda
+``device/serial``
+ drivers for serial ports
+``device/irda``
+ drivers for infrared over sockets
+``protocol``
+ protocol drivers
+``protocol/nokia``
+ Nokia specific protocols
+``phone``
+ phone modules
+``phone/nokia``
+ modules for different Nokia phones
+``misc``
+ different services. They can be used for any project
+``service``
+ different gsm services for logos, ringtones, etc.
+
+gammu directory
+---------------
+
+Sources of Gammu command line utility. It contains interface to libGammu
+and some additional functionality as well.
+
+smsd directory
+--------------
+
+Sources of SMS Daemon as well as all it's service backends.
+
+The ``services`` subdirectory contains source code for :ref:`smsd_services`.
+
+python directory
+----------------
+
+Sources of python-gammu module and some examples.
+
+helper directory
+----------------
+
+These are some helper functions used either as replacement for
+functionality missing on some platforms (eg. strptime) or used in more
+places (message command line processing which is shared between SMSD and
+Gammu utility).
+
+docs directory
+--------------
+
+Documentation for both end users and developers as well as SQL scripts
+for creating SMSD database.
+
+``config``
+ configuration file samples
+``examples``
+ examples using libGammu
+``manual``
+ sources of The Gammu Manual which you are reading
+``sql``
+ SQL scripts to create table structures for :ref:`smsd`
+``user``
+ user documentation like man pages
+
+admin directory
+---------------
+
+Administrative scripts for updating locales, making release etc.
+
+cmake directory
+---------------
+
+CMake include files and templates for generated files.
+
+include directory
+-----------------
+
+Public headers for libGammu.
+
+locale directory
+----------------
+
+Gettext po files for translating Gammu, libGammu and user documentation.
+See :doc:`localization` for more information.
+
+tests directory
+---------------
+
+CTest based test suite for libGammu.
+See :doc:`testing` for more information.
+
+utils directory
+---------------
+
+Various utilities usable with Gammu.
+
+contrib directory
+-----------------
+
+This directory contains various things which might be useful with Gammu.
+Most of them were contributed by Gammu users.
+
+.. note::
+
+ Please note that that code here might have different license terms than
+ Gammu itself.
+
+.. warning::
+
+ Most of scripts provided here are not actively maintained and might
+ be broken.
+
+bash-completion
+***************
+
+Completion script for bash.
+
+conversion
+**********
+
+Various scripts for converting data.
+
+init
+****
+
+Init scripts for Gammu SMSD.
+
+media
+*****
+
+Sample media files which can be used with Gammu.
+
+perl
+****
+
+Various perl scripts which interface to Gammu or SMSD.
+
+php
+***
+
+Various PHP frontends to SMSD or Gammu directly.
+
+sms
+***
+
+This directory contains SMS default alphabet saved in Unicode text file
+(:file:`charset.txt`) and table used for converting chars during saving
+SMS with default alphabet (:file:`convert.txt`).
+
+sms-gammu2android
+*****************
+
+Perl script to convert :ref:`gammu-smsbackup` into XML suitable for
+Android SMS Backup & Restore application.
+
+.. seealso:: http://blog.ginkel.com/2009/12/transferring-sms-from-nokia-to-android/
+
+smscgi
+******
+
+Simple cgi application gor handling SMS messages (a bit lighter version
+of SMSD).
+
+sql
+***
+
+Various SQL snippets and triggers useful with SMSD.
+
+testing
+*******
+
+Helper scripts for automatic testing or git bisect.
+
+sqlreply
+********
+
+System for automatic replying to SMS messages.
+
+symbian
+*******
+
+GNapplet sources and binaries. This comes from Gnokii project, but Gammu
+includes slightly modified version.
+
+s60
+***
+
+Series60 applet to use with recent Symbian phones.
+
+.. seealso:: :ref:`s60`
+
+win32
+*****
+
+Unsupported applications built on top of libGammu.dll on Windows.
diff --git a/docs/manual/project/documentation.rst b/docs/manual/project/documentation.rst
new file mode 100644
index 0000000..01aceb4
--- /dev/null
+++ b/docs/manual/project/documentation.rst
@@ -0,0 +1,57 @@
+Project Documentation
+=====================
+
+The documentation for Gammu consists of two major parts - The Gammu Manual,
+which you are currently reading and comments in the sources, which are partly
+included in this manual as well.
+
+The Gammu Manual
+----------------
+
+This manual is in written in rst format and built using
+`Sphinx <http://sphinx.pocoo.org/>`_ with
+`breathe <https://github.com/michaeljones/breathe>`_ extension.
+
+To generate the documentation there are various ``manual-*`` targets for make.
+You can build HTML, PDF, PS, HTMLHELP and Latex versions of it:
+
+.. code-block:: sh
+
+ # Generates HTML version of manual in docs/manual/html
+ make manual-html
+
+ # Generates PS version of manual in docs/manual/latex/gammu.ps
+ make manual-ps
+
+ # Generates PDF version of manual in docs/manual/latex/gammu.pdf
+ make manual-pdf
+
+ # Generates HTML version of manual in docs/manual/htmlhelp
+ make manual-htmlhelp
+
+ # Generates HTML version of manual in docs/manual/latex
+ make manual-latex
+
+Man pages
+---------
+
+The man pages for all commands are generated using Sphinx as well:
+
+.. code-block:: sh
+
+ # Generates HTML version of manual in docs/manual/man
+ make manual-man
+
+However man pages are stored in Git as well, so you should update generated
+copy on each change:
+
+.. code-block:: sh
+
+ # Updates generated man pages in Git
+ make update-man
+
+Code comments
+-------------
+
+The code comments in C code should be parseable by Doxygen, what is more or
+less standard way to document C code.
diff --git a/docs/manual/project/index.rst b/docs/manual/project/index.rst
new file mode 100644
index 0000000..2414978
--- /dev/null
+++ b/docs/manual/project/index.rst
@@ -0,0 +1,19 @@
+.. _project:
+
+Gammu project
+=============
+
+.. toctree::
+ :maxdepth: 2
+
+ about
+ motivation
+ install
+ contributing
+ localization
+ testing
+ coding-style
+ versioning
+ documentation
+ directories
+ roadmap
diff --git a/docs/manual/project/install.rst b/docs/manual/project/install.rst
new file mode 100644
index 0000000..c4a00ae
--- /dev/null
+++ b/docs/manual/project/install.rst
@@ -0,0 +1,587 @@
+.. _installing:
+
+Installing Gammu
+================
+
+Prebuilt Binaries for Linux
+---------------------------
+
+Many distributions come with prebuilt Gammu binaries, if you can use
+them, it is definitely the easiest thing. There are also binary packages
+of latest release built for many distributions available on Gammu home
+page <https://wammu.eu/gammu/>.
+
+You can usually also find Gammu in your distribution, so unless you need a
+newer version, just install package from your distribution.
+
+Debian
+++++++
+
+Gammu packages are included in Debian (testing versions go to
+experimental and stable to unstable). If you want to build Debian
+package on your own, you can find packaging in Git repository at
+``https://anonscm.debian.org/git/collab-maint/gammu.git`` (you can browse it on
+<https://anonscm.debian.org/git/collab-maint/gammu.git>).
+
+RPM
++++
+
+Gammu packages are included in openSUSE and Fedora. Additionally source tarball
+contains :file:`gammu.spec` which you can use for building RPM package.
+
+Slackware
++++++++++
+
+Gammu packages are included in Gentoo. Additionally source tarball contains
+:file:`description-pak` which you can use for building Slackware package.
+
+Prebuilt Binaries for Windows
+-----------------------------
+
+You can download Windows binaries from <https://wammu.eu/gammu/>. For
+Windows 95, 98 and NT 4.0 you will also need ShFolder DLL, which can be
+downloaded from Microsoft:
+
+http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=6AE02498-07E9-48F1-A5D6-DBFA18D37E0F
+
+
+.. _deps:
+
+Dependencies
+------------
+
+You need CMake from <https://cmake.org/> for compiling Gammu.
+
+Additionally pkg-config <https://www.freedesktop.org/wiki/Software/pkg-config/> is used for
+detecting available libraries.
+
+.. _opt-deps:
+
+Optional Dependencies
+---------------------
+
+Gammu does not require any special libraries at all to build, but you might
+miss some features. Optional libraries include:
+
+Bluez-libs
+++++++++++
+
+Required for Bluetooth support on Linux.
+
+.. seealso:: http://www.bluez.org/
+
+libusb-1.0
+++++++++++
+
+Required for fbususb/dku2 connection support on Linux.
+
+.. seealso:: http://libusb.sourceforge.net/
+
+libCURL
++++++++
+
+Required for new versions notification (see :option:`gammu checkversion`).
+
+.. seealso:: https://curl.haxx.se/libcurl/
+
+libiconv
+++++++++
+
+Used to support more character sets in AT engine.
+
+.. seealso:: https://www.gnu.org/software/libiconv/
+
+Gettext
++++++++
+
+Localization of strings.
+
+.. seealso:: https://www.gnu.org/software/gettext/
+
+MySQL
++++++
+
+Required for :ref:`gammu-smsd-mysql` in :ref:`smsd`.
+
+.. seealso:: https://www.mysql.com/
+
+PostgreSQL
+++++++++++
+
+Required for :ref:`gammu-smsd-pgsql` in :ref:`smsd`.
+
+.. seealso:: https://www.postgresql.org/
+
+unixODBC
+++++++++
+
+Required for :ref:`gammu-smsd-odbc` in :ref:`smsd`.
+
+.. note:: Not needed on platforms having native ODBC support such as Microsoft Windows.
+
+.. seealso:: http://www.unixodbc.org/
+
+libdbi
+++++++
+
+Required for :ref:`gammu-smsd-dbi` in :ref:`smsd`.
+
+.. note:: Required at least version 0.8.2.
+
+.. seealso:: http://libdbi.sourceforge.net/
+
+Python
+++++++
+
+Gammu has a Python bindings, see :ref:`python`.
+
+.. seealso:: https://www.python.org/
+
+SQLite + libdbi-drivers with SQLite
++++++++++++++++++++++++++++++++++++
+
+Needed for testing of SMSD using libdbi driver (libdbd-sqlite3), see :ref:`testing`.
+
+.. seealso:: https://www.sqlite.org/
+
+glib
+++++
+
+Currently needed only for :ref:`gammu-detect`.
+
+.. seealso:: https://www.gtk.org/
+
+gudev
++++++
+
+Currently needed only for :ref:`gammu-detect`.
+
+.. seealso:: http://gudev.sourceforge.net/
+
+
+Compiling on Linux/Unix Systems
+-------------------------------
+
+First install all :ref:`deps` and :ref:`opt-deps`. Do not forget to install
+corresponding devel packages as well, they are usually named with ``-dev`` or
+``-devel`` suffix, depending on your distribution.
+
+For example on Debian or Ubuntu, you can install all optional packages by
+following command:
+
+.. code-block:: sh
+
+ apt-get install cmake python-dev pkg-config libmysqlclient-dev libpq-dev \
+ libcurl4-gnutls-dev libusb-1.0-0-dev libdbi0-dev libbluetooth-dev \
+ libgudev-1.0-dev libglib2.0-dev unixodbc-dev
+
+For openSUSE, the installation all optional packages could look like:
+
+.. code-block:: sh
+
+ zypper install libusb-1_0-devel libdbi-devel bluez-devel postgresql-devel \
+ mysql-devel python-devel libcurl-devel cmake pkgconfig unixODBC-devel \
+ glib2-devel libgudev-1_0-devel
+
+Configure like wrapper
+++++++++++++++++++++++
+
+For compatibility reasons, configure like wrapper is provided, if you
+don't need much specific tuning, you can use usual set of commands:
+
+.. code-block:: sh
+
+ ./configure
+ make
+ sudo make install
+
+The configure wrapper will create directory build-configure and build all
+binaries there (nothing is changed in source tree), for example gammu binary is
+in build-configure/gammu directory.
+
+Using CMake
++++++++++++
+
+If you need/want to tweak build a bit more than configure wrapper
+provides, you have to use `CMake`_ directly. For now, only out of source
+build is supported, so you have to create separate directory for build:
+
+.. code-block:: sh
+
+ mkdir build
+ cd build
+
+Then just configure project:
+
+.. code-block:: sh
+
+ cmake ..
+
+Build it:
+
+.. code-block:: sh
+
+ make
+
+Test that everything is okay:
+
+.. code-block:: sh
+
+ make test
+
+And finally install it:
+
+.. code-block:: sh
+
+ sudo make install
+
+You can configure build parameters either by command line (see
+parameters below), or using TUI - ccmake.
+
+Useful cmake parameters:
+
+* ``-DBUILD_SHARED_LIBS=ON`` enables shared library
+* ``-DCMAKE_BUILD_TYPE="Debug"`` enables debug build
+* ``-DCMAKE_INSTALL_PREFIX="/usr"`` change installation prefix
+* ``-DENABLE_PROTECTION=OFF`` disables various compile time protections
+ against buffer overflows and similar attacks
+
+You can also disable support for whole set of phones, e.g.:
+
+* ``-DWITH_NOKIA_SUPPORT=OFF`` disables Nokia phones support
+* ``-DWITH_BLUETOOTH=OFF`` disables Bluetooth support
+* ``-DWITH_IRDA=OFF`` disables IrDA support
+
+Library search paths
+++++++++++++++++++++
+
+By installing Gammu to non default system paths, you might need to add path
+where libGammu and other Gammu liraries are installed to :program:`ldconfig`
+search path.
+
+You can do this by editing :file:`/etc/ld.so.conf` or adding new file to
+:file:`/etc/ld.so.conf.d/` directory containing path, wherge Gammu library has
+been installed. Some examples:
+
+.. code-block:: sh
+
+ # Gammu on 64-bit Fedora installed to /opt/gammu
+ echo /opt/gammu/lib64 > /etc/ld.so.conf.d/gammu.conf
+
+ # Gammu installed to /usr/local
+ echo /usr/local/lib > /etc/ld.so.conf.d/gammu.conf
+
+The similar situation exists with Python modules, if you install in path when
+your Python interpreter does not search it won't load newly installed Gammu
+bindings.
+
+You can also avoid changing ldconfig configuration by installing Gammu to paths
+where it already searches, for examble by:
+
+.. code-block:: sh
+
+ cmake .. -DCMAKE_INSTALL_PREFIX="/usr"
+
+
+Compiling on Microsoft Windows
+------------------------------
+
+First install all :ref:`deps` and :ref:`opt-deps`.
+
+`CMake`_ is able to generate projects for various tools including Microsoft
+Visual Studio, Borland toolchains, Cygwin or Mingw32. Just click on
+CMakeLists.txt in project sources and configure CMake to be able to find
+optional libraries (see cross compilation section for more information about
+getting those). The result should be project for your compiler where you
+should be able to work with it as with any other project.
+
+Compiling using MS Visual C++
++++++++++++++++++++++++++++++
+
+You will probably need additional SDKs:
+
+* Microsoft Windows Platform SDK (required especially for Bluetooth).
+ It's given for free. Below are links to different releases (if you
+ have problems with latest one, use older). They work for various
+ Windows versions, even though Microsoft named them Windows Server 2003
+ Platform SDK.
+* For free Visual C++ Express 2005 you need to set compiler to work with
+ Platform SDK (see description).
+* MySQL include/library files from MySQL install package (for MySQL
+ support in SMSD).
+* PostgreSQL include/library files from PostgreSQL install package (for
+ PostgreSQL support in SMSD).
+* For gettext (internationalization) support, you will need gettext
+ packages from GnuWin32 project.
+* As build is now based on CMake, you will need to get it from
+ https://cmake.org/.
+
+After downloading and installing them into your system:
+
+* Now you should be able to execute cmake by clicking on CMakeLists.txt
+ file in Gammu sources, this should pop up dialog with configuration
+ options.
+
+ * You can also start CMakeSetup from start menu and select source
+ directory (just point to it to Gammu sources).
+ * Select directory where binaries will be stored, I suggest this is
+ different than source one, eg. append subdirectory build.
+ * Select compiler you want to use in Build for select.
+
+* In list below, you can tweak paths to some optional libraries and
+ project configuration.
+* Then just press Configure button, which will do the hard job. After
+ this, just click OK button to generate Visual Studio project.
+* Project files for Visual Studio should be now generated in directory
+ you selected, just open it in Visual Studio and compile :-).
+
+ * Project file should be named Gammu.dsw or Gammu.sln depending on
+ what MSVC version you choose.
+ * You should see ALL_BUILD target, which builds everything needed,
+ similar to make all on Linux.
+
+* For running testsuite, you need working sh and sed. The easiest way to
+ install them is from MinGW project <http://mingw.org/>.
+
+* I know this guide is incomplete, I don't have environment to test,
+ you're welcome to improve it!. Some more information can be found in
+ howtos for other projects using CMake, eg. Blender, SIM, KDE, VTK,
+ ISGTK. ITK, [wxWidgets http://www.wxwidgets.org/wiki/index.php/CMake].
+
+Compiling using Borland C++
++++++++++++++++++++++++++++
+
+Borland toolchain - you can download compiler at
+<http://www.codegear.com/downloads/free/cppbuilder>. You need to add
+c:/Borland/BCC55/Bin to system path (or manually set it when running
+CMake) and add -Lc:/Borland/BCC55/Lib -Ic:/Borland/BCC55/Include
+-Lc:/Borland/BCC55/Lib/PSDK to CMAKE_C_FLAGS in CMake (otherwise
+compilation fails).
+
+Compiling using Cygwin
+++++++++++++++++++++++
+
+This should work pretty much same as on Linux.
+
+Compiling on Mac OS X
+---------------------
+
+First install all :ref:`deps` and :ref:`opt-deps`.
+
+Gammu should be compilable on Mac OS X, you need to have installed
+Developer Tols (version 2.4.1 was tested) and `CMake`_ (there is a Mac OS X
+"Darwin" DMG download). For database support in SMSD, install wanted
+database, eg. MySQL.
+
+The rest of the compilation should be pretty same as on Linux, see Linux
+section for more details about compile time options.
+
+If you get some errors while linking with iconv, it is caused by two
+incompatible iconv libraries available on the system. You can override the
+library name:
+
+.. code-block:: sh
+
+ cmake -D ICONV_LIBRARIES="/opt/local/lib/libiconv.dylib" ..
+
+Or completely disable iconv support:
+
+.. code-block:: sh
+
+ cmake -DWITH_Iconv=OFF ..
+
+To build backward compatible binaries, you need CMake 2.8 or newer. The
+command line then would look like:
+
+.. code-block:: sh
+
+ cmake -DCMAKE_OSX_ARCHITECTURES="ppc;i386;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.4
+
+
+Cross compilation for Windows on Linux
+--------------------------------------
+
+First install all :ref:`deps` and :ref:`opt-deps` into your mingw build
+environment.
+
+Only cross compilation using `CMake`_ has been tested. You need to install
+MinGW cross tool chain and run time. On Debian you can do it by apt-get
+install mingw32. Build is then quite simple:
+
+.. code-block:: sh
+
+ mkdir build-win32
+ cd build-win32
+ cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw32.cmake
+ make
+
+There is also toolchain configuration for Win64 available:
+
+.. code-block:: sh
+
+ mkdir build-win64
+ cd build-win64
+ cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw64.cmake
+ make
+
+If your MinGW cross compiler binaries are not found automatically, you
+can specify their different names in cmake/Toolchain-mingw32.cmake.
+
+To build just bare static library without any dependencies, use:
+
+.. code-block:: sh
+
+ cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw32.cmake \
+ -DBUILD_SHARED_LIBS=OFF \
+ -DWITH_MySQL=OFF \
+ -DWITH_Postgres=OFF \
+ -DWITH_GettextLibs=OFF \
+ -DWITH_Iconv=OFF \
+ -DWITH_CURL=OFF
+
+To be compatible with current Python on Windows, we need to build
+against matching Microsoft C Runtime library. For Python 2.4 and 2.5
+MSVCR71 was used, for Python 2.6 the right one is MSVCR90. To achieve
+building against different MSVCRT, you need to adjust compiler
+specifications, example is shown in cmake/mingw.spec, which is used by
+CMakeLists.txt. You might need to tune it for your environment.
+
+Third party libraries
++++++++++++++++++++++
+
+The easiest way to link with third party libraries is to add path to
+their installation to cmake/Toolchain-mingw32.cmake or to list these
+paths in CMAKE_FIND_ROOT_PATH when invoking cmake.
+
+
+MySQL
+~~~~~
+
+You can download MySQL binaries from <http://dev.mysql.com/>, but then
+need some tweaks:
+
+.. code-block:: sh
+
+ cd mysql/lib/opt
+ reimp.exe -d libmysql.lib
+ i586-mingw32msvc-dlltool --kill-at --input-def libmysql.def \
+ --dllname libmysql.dll --output-lib libmysql.a
+
+reimp.exe is part of mingw-utils and can be run through wine, I didn't
+try to compile native binary from it.
+
+
+PostgreSQL
+~~~~~~~~~~
+
+You can download PostgreSQL binaries from <http://www.postgresql.org/>,
+but then you need to add wldap32.dll library to bin.
+
+
+Gettext
+~~~~~~~
+
+For Gettext (internationalization support), you need
+gettext-0.14.4-bin.zip, gettext-0.14.4-dep.zip, gettext-0.14.4-lib.zip
+from <http://gnuwin32.sourceforge.net/>. Unpack these to same directory.
+
+
+CURL
+~~~~
+
+For CURL support, you need curl-7.19.0-devel-mingw32.zip from
+<http://curl.haxx.se/>.
+
+Crosscompiling to different platform
+------------------------------------
+
+To cross compile Gammu to different architecture (or platform) you need to
+provide CMake toolchain file for that and invoke `CMake`_ with it:
+
+.. code-block:: sh
+
+ cmake -DCMAKE_TOOLCHAIN_FILE=~/Toolchain-eldk-ppc74xx.cmake ..
+
+More information on creating that is described in `CMake Cross Compiling`_ wiki
+page. Also distributions like `OpenEmbedded`_ usually already come with
+prepared recipes for `CMake`_.
+
+.. _CMake Cross Compiling: http://www.vtk.org/Wiki/CMake_Cross_Compiling
+.. _OpenEmbedded: http://www.openembedded.org/
+
+Advanced Build Options
+----------------------
+
+The build system accepts wide range of options. You can see them all by
+running GUI version of `CMake`_ or by inspecting :file:`CMakeCache.txt` in
+build directory.
+
+Limiting set of installed data
+++++++++++++++++++++++++++++++
+
+By setting following flags you can control which additional parts will
+be installed:
+
+* INSTALL_GNAPPLET - Install Gnapplet binaries
+* INSTALL_MEDIA - Install sample media files
+* INSTALL_PHP_EXAMPLES - Install PHP example scripts
+* INSTALL_BASH_COMPLETION - Install bash completion script for Gammu
+* INSTALL_LSB_INIT - Install LSB compatible init script for Gammu
+* INSTALL_DOC - Install documentation
+* INSTALL_LOC - Install locales data
+
+For example:
+
+.. code-block:: sh
+
+ cmake -DINSTALL_DOC=OFF
+
+
+Debugging build failures
+++++++++++++++++++++++++
+
+If there is some build failure (eg. some dependencies are not correctly
+detected), please attach :file:`CMakeCache.txt`,
+:file:`CMakeFiles/CMakeError.log` and :file:`CMakeFiles/CMakeOutput.log` files
+to the report. It will help diagnose what was detected on the system and
+possibly fix these errors.
+
+To find out what is going on during compilation, add
+``-DCMAKE_VERBOSE_MAKEFILE=ON`` to :program:`cmake` command line or run
+:program:`make` with ``VERBOSE=1``:
+
+.. code-block:: sh
+
+ make VERBOSE=1
+
+Debugging crashes
++++++++++++++++++
+
+To debug program crashes, you might want to build Gammu with
+``-DENABLE_PROTECTION=OFF``, otherwise debugging tools are somehow confused
+with protections GCC makes and produce bogus back traces.
+
+
+Compiling python-gammu
+----------------------
+
+Currently python-gammu is distributed as a separate package, which follows
+Python usual method for building modules - distutils, so use :file:`setup.py`
+is placed in the top level directory:
+
+.. code-block:: sh
+
+ ./setup.py build
+ sudo ./setup.py install
+
+You can install it using pip installer:
+
+.. code-block:: sh
+
+ pip install python-gammu
+
+You need to have Gammu installed for compiling python-gammu. It's location is
+discovered using pkg-config or by GAMMU_PATH environment variable. The latter
+is recommended when building on Windows.
+
+.. _CMake: http://www.cmake.org/
diff --git a/docs/manual/project/localization.rst b/docs/manual/project/localization.rst
new file mode 100644
index 0000000..c831d74
--- /dev/null
+++ b/docs/manual/project/localization.rst
@@ -0,0 +1,42 @@
+Localization
+============
+
+Localization uses `Gettext`_ po files for both program translations and the
+documentation. The documentation translation is managed using `po4a`_.
+
+Using Translation
+-----------------
+
+You can set locales you want to use by specifying LANG or LC_* environment
+variables (on Linux you usually don't care about this, on Windows just export
+e.g. ``LANG=cs_CZ``).
+
+Improving Translation
+---------------------
+
+If you want to improve existing translation, please visit
+`translation server`_. For adding new one, you need to
+contact `Michal ÄŒihaÅ™`_ and then you will be able to edit it on
+former mentioned URL.
+
+You can also go ahead with traditional way of creating/updating po files
+in locale/ folder and then sending updated ones to bug tracker.
+
+Translation Areas
+-----------------
+
+There are several po files to translate:
+
+``libgammu.po``
+ Messages used in the Gammu library (see :ref:`libgammu`).
+``gammu.po``
+ Messages used by command line utilities (mostly :ref:`gammu`).
+``docs.po``
+ Basic documentation shipped within package (eg. :file:`README.rst` and
+ :file:`INSTALL` files).
+
+
+.. _translation server: http://hosted.weblate.org/projects/gammu/
+.. _Michal ÄŒihaÅ™: mailto:michal@cihar.com
+.. _Gettext: http://en.wikipedia.org/wiki/GNU_gettext\
+.. _po4a: http://po4a.alioth.debian.org/
diff --git a/docs/manual/project/motivation.rst b/docs/manual/project/motivation.rst
new file mode 100644
index 0000000..b63ce8e
--- /dev/null
+++ b/docs/manual/project/motivation.rst
@@ -0,0 +1,52 @@
+Motivation to fork Gnokii
+=========================
+
+.. note::
+
+ Please note that this is original list of differences written by
+ Marcin when forking Gnokii, so it represents state of the code in
+ that time.
+
+1. Unicode used almost everywhere. In MyGnokii and Gnokii with modern
+ phones (they return everything in Unicode) things are converted from
+ Unicode and again to Unicode in other places. No more unnecessary
+ conversions.
+2. Almost everything is structural. In Gnokii some things are declared
+ in files, not in "main" phone structure. It can make some problems, when
+ will try to support two phones on two serial ports in one application.
+3. in Gammu you can make support for some things without adding source
+ to "main" phone modules. Very good idea for things, which are available
+ only for few models and for all other will be UNIMPLEMENTED. It includes
+ also some obsolete functions - why should we compile RLP source, when
+ all new better phones have modems built in ?
+4. Gnokii/MyGnokii has to have some compatibility with previously written source. In Gammu some solutions are reimplemented and done easier.
+5. no more reimplementing C libraries in source - see snprintf in gnokii.
+6. more OS supported.
+7. better sharing source. Less source = smaller application easier to debug.
+8. better user friendly interface
+9. no more 2 years rewriting source...
+10. it's easier to see, what frames are implemented, what not (in phone modules they're put line after line).
+11. better compatibility with ANSI C = no warnings in MS VC 6
+12. all locations for user start from 0 (in Gnokii some from 0, some from 1)
+13. some things like SMS can be accessed few ways
+14. when possible, there are used "constant" locations. I will explain
+ on the example:
+
+ 1. save two calendar notes in any Nokia 61xx phone. Call them "reminder" and "call" notes. Reminder will be returned by phone of 1'st location, Call on 2'nd.
+ 2. Now Reminder will be deleted (for example, from phone keypad). Call will be moved from 2'nd to 1'st.
+ 3. When will read calendar notes again, have to read all notes again
+ because of changed locations (let's say, we won't read Call note
+ again. It will have location 2 in PC. Now you will write new note
+ into phone (for keypad) and it will save in under location 2. When
+ will try to save Call not with location 2, it will overwrite new
+ saved note !).
+
+ This is not good. When for example delete one entry from phonebook,
+ other locations "stays" on their places. These are "constant" locations.
+
+ With "constant" locations, when delete one location from PC, don't have
+ to read full memory from phone.
+
+etc. etc.
+
+Of course, some of these things can be in the future in gnokii too...
diff --git a/docs/manual/project/roadmap.rst b/docs/manual/project/roadmap.rst
new file mode 100644
index 0000000..f8a5682
--- /dev/null
+++ b/docs/manual/project/roadmap.rst
@@ -0,0 +1,61 @@
+Roadmap for Gammu
+=================
+
+There are some major issues which should be addressed in Gammu soon. This list
+is not sorted at all, but includes bad design decisions made in Gammu past
+which we would like to fix.
+
+Locations handling
+------------------
+
+One problem is locations handling, because current scheme (using numbers)
+really does not match majority of current phones and it should be converted to
+using path based locations for messages, phonebook, calendar, etc.
+
+Unicode strings
+---------------
+
+The another major obstacle which is all around Gammu code is own
+implementation of unicode (UCS-2-BE) strings. This code should be dropped and
+use some standard library for that. Note that wchar_t is probably not a good
+choice here as it's 16-bit on Windows and thus can not store emojis and other
+supplemental plan unicode chars.
+
+Hardcoded length for strings
+----------------------------
+
+Most of the strings have hardcoded length limits. This limitation should be
+removed and strings allocated on the fly.
+
+Unsigned char mess
+------------------
+
+In many cases ``unsigned char`` is used without any reason.
+
+Extensibility of libGammu
+-------------------------
+
+Current way of adding protocol specific functionality from applications using
+libGammu is broken. Actually only application using this is Gammu utility.
+This option should be either completely removed or rewritten from scratch not
+to be dependent on libGammu internals.
+
+Built time configuration
+------------------------
+
+Avoid heavy usage of gsmstate.h header and move the
+``#ifdef...#define...#endif`` blocks to ``gammu-config.h``. Or rather cleanup
+them and have only single define for single compile time option.
+
+Config file handling
+--------------------
+
+Drop multiple configurations handling in libGammu, it should provide just API
+to read some section from Gammurc and possible fall-back logic should be in
+application.
+
+AT module
+---------
+
+There should be simpler way to generate AT command with proper escaping and
+charset conversion of fields. Something like reverse ATGEN_ParseReply.
diff --git a/docs/manual/project/testing.rst b/docs/manual/project/testing.rst
new file mode 100644
index 0000000..8d32c12
--- /dev/null
+++ b/docs/manual/project/testing.rst
@@ -0,0 +1,8 @@
+Testing
+=======
+
+Gammu comes with quite big test suite. It covers some basic low level
+functions, handling replies from the phone and also does testing of command
+line utilities and SMSD.
+
+.. seealso:: See :ref:`testing` for more details.
diff --git a/docs/manual/project/versioning.rst b/docs/manual/project/versioning.rst
new file mode 100644
index 0000000..544d4c5
--- /dev/null
+++ b/docs/manual/project/versioning.rst
@@ -0,0 +1,9 @@
+.. _versioning:
+
+Versioning
+==========
+
+There are two types of releases - testing and stable, both having
+version x.y.z. Stable releases have usually z = 0 or some small number,
+while testing ones have z >= 90. Testing releases usually provide latest
+features, but everything does not have to be stabilized yet.
diff --git a/docs/manual/protocol/carkit.rst b/docs/manual/protocol/carkit.rst
new file mode 100644
index 0000000..ea74cf5
--- /dev/null
+++ b/docs/manual/protocol/carkit.rst
@@ -0,0 +1,698 @@
+Nokia 6210/6310, CARC91, PC Experiment
+======================================
+
+Author:
+ Jens Bennfors
+
+Company
+ AB Indevia
+
+Date:
+ 2002-04-09
+
+Introduction
+-------------
+
+The purpose of this experiment is to gain understanding about how Nokias commands for handsfree works in a way that can be of use in the construction of Com.n.sense. The means available is a Nokia 6210, a Nokia 6310, a HFU-2 CARC91 and a PC with a LabVIEW program installed.
+
+Setup
+-----
+
+I have connected the phone to a Nokia original handsfree (CARC91). I then use the PC for listening to the data communication between the phone and CARC91. I also send the frames directly from the PC to the phone.
+
+Nokia 6210
+----------
+
+Phone connected to PC
++++++++++++++++++++++
+
+Initiation
+~~~~~~~~~~
+1F0004 D0 0001 04 00CE
+ Power up from PC
+1F0004 D0 0001 04 01CF
+ Power up from PC
+1F0400 D0 0001 05 10DF
+ Power up from phone
+1F0004 79 0005 0201 0164 00 0203
+ Enable carkit mode from PC
+1F0004 79 0005 0201 0164 00 0302
+ Enable carkit mode from PC
+1F0400 7F 0367
+ Ack from phone
+1F0004 79 0012 0201 0206 0056 2030 372E 3030 0A48 4655 3200 044F
+ HFU-2 Version
+1F0400 7F 0460
+ Ack from phone
+1F0400 78 0004 0102 0801 117C
+ Status 0x08, 0x01 from phone
+1F0400 DA 0002 0002 12D3
+ Type => 0xDA, data => 0x00, 0x02
+1F0004 79 0005 0201 0164 00 0504
+ Enable carkit mode from PC
+1F0004 79 0005 0201 0164 00 0607
+ Enable carkit mode from PC
+1F0400 7F 0662
+ Ack from phone
+1F0004 78 0003 0201 0307 67
+ Status confirm from PC
+1F0004 78 0003 0201 0308 68
+ Status confirm from PC
+1F0400 7F 086C
+ Ack from phone
+
+The phone enters the profile â€handsfree†when the frame carkit enable is sent. It sends out an unknown status frame 0x08, 0x01.
+
+Incoming call
+~~~~~~~~~~~~~
+
+1F0400 78 0004 0102 0701 197B
+ Status 0x07, 0x01 from phone
+1F0400 78 0004 0102 0E03 1A73
+ Status 0x0E, 0x03 from phone
+
+Status type 0x07 with status 0x01 means mute external audio equipment. Status type 0x0E with status 0x03 means audio amplifier on.
+
+Connected
+~~~~~~~~~
+
+The phone doesn’t send out anything when a call has been set up.
+
+Initiation with connected phone
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+1F0004 D0 0001 04 00CE
+ Power up from PC
+1F0400 D0 0001 05 1BD4
+ Power up from phone
+1F0004 79 0005 0201 0164 0001 00
+ Enable carkit mode from PC
+1F0400 7F 0165
+ Ack from phone
+1F0400 78 0004 0102 0E03 1C75
+ Status 0x0E, 0x03 from phone
+1F0400 78 0004 0102 0701 1D7F
+ Status 0x07, 0x01 from phone
+1F0004 79 0012 0201 0206 00 5620 3037 2E30 300A 4846 5532 00 0249
+ HFU-2 Version from PC
+1F0400 7F 0266
+ Ack from phone
+1F0400 78 0004 0102 0801 1E73
+ Status 0x08, 0x01 from phone
+1F0004 79 0005 0201 0164 0003 02
+ Enable carkit mode from PC
+1F0400 7F 0367
+ Ack from phone
+1F0400 78 0004 0102 0E03 1F76
+ Status 0x0E, 0x03 from phone
+1F0400 78 0004 0102 0701 2042
+ Status 0x07, 0x01 from phone
+1F0004 78 0003 0201 03 0464
+ Status confirm from PC
+1F0400 7F 0460
+ Ack from phone
+
+Disconnected
+~~~~~~~~~~~~
+
+1F04 0078 0004 0102 0700 2142
+ Status 0x07, 0x00
+
+Incoming SMS
+~~~~~~~~~~~~
+
+FCF0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0F0 F0
+ Initiation of bit length from phone
+1F0400 78 0004 0102 0E03 254C
+ Status 0x0E, 0x03 from phone
+F0F0F0F0
+ Initiation of bit length from phone
+
+Phone connected to CARC91
++++++++++++++++++++++++++
+
+Initiation
+~~~~~~~~~~
+
+1F0004 D0 0001 04 00CE
+ Power up from HFU-2
+1F0400 D0 0001 05 02CD
+ Power up from phone
+1F0004 79 0005 0201 0164 00 0100
+ Enable carkit mode from HFU-2
+1F0400 7F 0165
+ Ack from phone
+1F0004 79 0012 0201 0206 0056 2030 372E 3030 0A48 4655 3200 0249
+ HFU-2 Version
+1F0400 7F 0266
+ Ack from phone
+1F0400 78 0004 0102 0801 036E
+ Status 0x08, 0x01
+1F0004 79 0005 0201 0164 00 0302
+ Enable carkit mode from HFU-2
+1F0400 7F 0367
+ Ack from phone
+1F0400 78 0004 0102 0801 036E
+ Status 0x08, 0x01
+1F0004 7F 0367
+ Ack from HFU-2
+1F0400 DA 0002 0002 04C5
+ Status type => 0xDA, data => 0x00, 0x02
+1F0004 7F 0460
+ Ack from HFU-2
+1F0400 78 0004 0102 0E03 056C
+ Status 0x0E, 0x03
+1F0004 7F 0561
+ Ack from HFU-2
+1F0004 78 0003 0201 03 0464
+ Status confirm from HFU-2
+1F0400 7F 0460
+ Ack from phone
+1F0400 78 0004 0102 0E00 066C
+ Status 0x0E, 0x00
+1F0004 7F 0662
+ Ack from HFU-2
+1F0004 78 0003 0201 03 0565
+ Status confirm from HFU-2
+1F0400 7F 0561
+ Ack from phone
+
+Incoming call
+~~~~~~~~~~~~~
+
+1F0400 78 0004 0102 0701 1173
+ Status 0x07, 0x01
+1F0004 7F 1175
+ Ack from HFU-2
+1F0400 78 0004 0102 0E03 127B
+ Status 0x0E, 0x03
+1F0004 7F 1276
+ Ack from HFU-2
+1F0004 78 0003 0201 03 0868
+ Status confirm from HFU-2
+1F0400 7F 086C
+ Ack from phone
+
+Connected
+~~~~~~~~~
+
+The phone doesn’t send out anything when a call has been set up.
+
+Initiation with connected phone
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+1F0004 D0 0001 04 00CE
+ Power up from HFU-2
+1F0400 D0 0001 05 1AD5
+ Power up from phone
+1F0004 79 0005 0201 0164 00 0100
+ Enable carkit mode from HFU-2
+1F0400 7F 0165
+ Ack from phone
+1F0400 78 0004 0102 0E03 1B72
+ Status 0x0E, 0x03
+1F0004 79 0012 0201 0206 0056 2030 372E 3030 0A48 4655 3200 0249
+ HFU-2 Version
+1F0400 7F 0266
+ Ack from phone
+1F0004 79 0005 0201 0164 00 0302
+ Enable carkit mode from HFU-2
+1F0400 7F 0367
+ Ack from phone
+1F0400 78 0004 0102 0E03 1B72
+ Status 0x0E, 0x03
+1F0004 7F 1B7F
+ Ack from HFU-2
+1F0400 78 0004 0102 0801 1C71
+ Status 0x08, 0x01
+1F0004 78 0003 0201 03 0464
+ Status confirm from HFU-2
+1F0400 7F 0460
+ Ack from phone
+1F0400 78 0004 0102 0801 1C71
+ Status 0x08, 0x01
+1F0004 7F 1C78
+ Ack from HFU-2
+1F0400 78 0004 0102 0E03 1D74
+ Status 0x0E, 0x03
+1F0004 7F 1D79
+ Ack from HFU-2
+1F0400 78 0004 0102 0701 1E7C
+ Status 0x07, 0x01
+1F0004 78 0003 0201 03 0565
+ Status confirm from HFU-2
+1F0400 7F 0561
+ Ack from phone
+1F0400 78 0004 0102 0701 1E7C
+ Status 0x07, 0x01
+1F0004 7F 1E7A
+ Ack from HFU-2
+1F0400 78 0004 0102 0701 1F7D
+ Status 0x07, 0x01
+1F0004 7F 1F7B
+ Ack from phone
+1F0400 DA 0002 0002 20E1
+ Typ => 0xDA, data => 0x00. 0x02
+1F0004 7F 2044
+ Ack from HFU-2
+
+Disconnected
+~~~~~~~~~~~~
+
+1F0400 78 0004 0102 0700 1774
+ Status 0x07, 0x00
+1F0004 7F 1773
+ Ack from HFU-2
+1F0400 78 0004 0102 0E00 1872
+ Status 0x0E, 0x00
+1F0004 7F 187C
+ Ack from HFU-2
+1F0004 78 0003 0201 03 0B6B
+ Status confirm from HFU-2
+1F0400 7F 0B6F
+ Ack from phone
+
+Incoming SMS
+~~~~~~~~~~~~
+
+1F0400 78 0004 0102 0E03 076E
+ Status 0x0E, 0x03
+1F0004 7F 0763
+ Ack from HFU-2
+1F0004 78 0003 0201 03 0666
+ Status confirm from HFU-2
+1F0400 7F 0662
+ Ack from phone
+1F0400 78 0004 0102 0E00 0862
+ Status 0x0E, 0x00
+1F0004 7F 086C
+ Ack from HFU-2
+1F0004 78 0003 0201 03 0767
+ Status confirm from HFU-2
+1F0400 7F 0763
+ Ack from phone
+
+Button pushed
+~~~~~~~~~~~~~
+
+1F0400 78 0004 0102 0E03 0960
+ Status 0x0E, 0x03
+1F0004 7F 096D
+ Ack from HFU-2
+1F0004 78 0003 0201 03 0868
+ Status confirm from HFU-2
+1F0400 7F 086C
+ Ack from phone
+1F0400 78 0004 0102 0E00 0A60
+ Status 0x0E, 0x00
+1F0004 7F 0A6E
+ Ack from HFU-2
+1F0004 78 0003 0201 03 0969
+ Status confirm from HFU-2
+1F0400 7F 096D
+ Ack from phone
+
+Nokia 6310
+----------
+
+Phone connected to PC
++++++++++++++++++++++
+
+Initiation
+~~~~~~~~~~
+
+1F0004 D0 0001 04 02CC
+ Power up from PC
+1F0400 D0 0001 05 0DC2
+ Power up from phone
+1F0004 79 0005 0201 0164 00 0C0D
+ Enable carkit mode from PC
+1F0400 7F 0C68
+ Ack from phone
+1F0400 78 0004 0128 0B00 0E4B
+ Status 0x0B, 0x00 from phone
+1F0004 79 0012 0201 0206 0056 2030 372E 3030 0A48 4655 3200 0D46
+ HFU-2 version from PC
+1F0400 7F 0E6A
+ Ack from phone
+1F0400 DA 0004 0028 0000 0FE2
+ ?
+1F0004 79 0005 0201 0164 00 1716
+ Enable carkit mode from PC
+1F0400 7F 1773
+ Ack from phone
+1F0400 78 0004 0128 0B00 1055
+ Status 0x0B, 0x00 from phone
+1F0004 78 0003 0201 03 1878
+ Status confirm from PC
+1F0400 7F 1A7E
+ Ack from phone
+
+An unknown status frame (0x0B) is sent by the phone.
+
+Incoming call
+~~~~~~~~~~~~~
+
+1F0400 78 0004 0128 0701 0D45
+ Status 0x07, 0x01 from phone
+1F0400 78 0004 0128 0E01 0F4E
+ Status 0x0E, 0x01 from phone
+1F0400 78 0004 0128 0A00 1054
+ Status 0x0A, 0x00 from phone
+1F0400 78 0004 0128 0901 1157
+ Status 0x09, 0x01 from phone
+
+Byte 8 in the status frames is some kind of ID number. 0x28 is the ID for 6310. Status 0x0A, 0x09 is unknown.
+
+Connected
+~~~~~~~~~
+
+The phone doesn’t send out anything when a call has been set up. This might be because the profile “handsfree†is lost when ack isn’t sent.
+
+Initiation with connected phone
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+1F0004 79 0012 0201 0206 0056 2030 372E 3030 0A48 4655 3200 1C57
+ HFU-2 version from PC
+1F0400 7F 1C78
+ Ack from phone
+1F0400 78 0004 0128 0E02 1A58
+ Status 0x0E, 0x02
+1F0400 78 0004 0128 0A00 1B5F
+ Status 0x0A, 0x00
+1F0400 78 0004 0128 0900 1C5B
+ Status 0x09, 0x00
+1F0400 78 0004 0128 0701 1D55
+ Status 0x07, 0x01
+1F0004 D0 0001 04 00CE
+ Power up from HFU-2
+1F0400 D0 0001 05 74BB
+ Power up from phone
+1F0004 79 0005 0201 0164 00 0100
+ Enable carkit mode from HFU-2
+1F0400 7F 0165
+ Ack from phone
+1F0004 79 0012 0201 0206 0056 2030 372E 3030 0A48 4655 3200 0249
+ HFU-2 Version
+1F0400 7F 0266
+ Ack from phone
+1F0400 78 0004 0128 0E01 7534
+ Status 0x0E, 0x01
+1F0004 79 0005 0201 0164 00 0302
+ Enable carkit mode from HFU-2
+1F0400 7F 0367
+ Ack from phone
+1F0400 78 0004 0128 0E01 7534
+ Status 0x0E, 0x01
+1F0004 7F 7511
+ Ack from HFU-2
+1F0400 78 0004 0128 0A01 7633
+ Status 0x0A, 0x01
+1F0004 7F 7612
+ Ack from HFU-2
+1F0400 78 0004 0128 0901 7731
+ Status 0x09, 0x01
+1F0004 7F 7713
+ Ack from HFU-2
+1F0400 78 0004 0128 0701 7830
+ Status 0x07, 0x01
+1F0004 7F 781C
+ Ack from HFU-2
+1F0400 78 0004 0128 0E01 7938
+ Status 0x0E, 0x01
+1F0004 7F 791D
+ Ack from HFU-2
+1F0004 78 0003 2801 03 044E
+ Status confirm from HFU-2
+1F0400 7F 0460
+ Ack from phone
+1F0400 DA 0004 0028 0000 7A97
+ Type => 0xDA, data => 0x0028, 0x0000
+1F0004 7F 7A1E
+ Ack from HFU-2
+1F0400 78 0004 0128 0E01 7B3A
+ Status 0x0E, 0x01
+1F0004 7F 7B1F
+ Ack from HFU-2
+1F0400 78 0004 0128 0A00 7C38
+ Status 0x0A, 0x00
+1F0004 78 0003 2801 03 054F
+ Status confirm from HFU-2
+1F0400 7F 0561
+ Ack from phone
+1F0400 78 0004 0128 0A00 7C38
+ Status 0x0A, 0x00
+1F0004 7F 7C18
+ Ack from HFU-2
+1F0400 78 0004 0128 0700 7D34
+ Status 0x07, 0x00
+1F0004 7F 7D19
+ Ack from HFU-2
+1F0400 78 0004 0128 0E00 7E3E
+ Status 0x0E, 0x00
+1F0004 7F 7E1A
+ Ack from HFU-2
+1F0004 78 0003 2801 03 064C
+ Status confirm from HFU-2
+1F0400 7F 0662
+ Ack from phone
+
+Disconnected
+~~~~~~~~~~~~
+
+No response. Probably because phone has lost the profile “handsfreeâ€.
+
+Incoming SMS
+~~~~~~~~~~~~
+
+1F0400 78 0004 0128 0E01 0849
+ Status 0x0E, 0x01
+1F0400 78 0004 0128 0A00 094D
+ Status 0x0A, 0x00
+1F0400 78 0004 0128 0901 0A4C
+ Status 0x09, 0x01
+
+Phone connected to CARC91
++++++++++++++++++++++++++
+
+Initiation
+~~~~~~~~~~
+
+1F0004 D0 0001 04 00CE
+ Power up from HFU-2
+1F0400 D0 0001 05 2DE2
+ Power up from phone
+1F0004 79 0005 0201 0164 00 0100
+ Enable carkit mode from HFU-2
+1F0400 7F 0165
+ Ack from phone
+1F0004 79 0012 0201 0206 0056 2030 372E 3030 0A48 4655 3200 0249
+ HFU version from HFU-2
+1F0400 7F 0266
+ Ack from phone
+1F0004 79 0005 0201 0164 00 0302
+ Enable carkit mode from HFU-2
+1F0400 7F 0367
+ Ack from phone
+1F0400 78 0004 0128 0E00 2E6E
+ Status 0x0E, 0x00
+1F0004 7F 2E4A
+ Ack from HFU-2
+1F0004 78 0003 2801 03 044E
+ Status confirm from HFU-2
+1F0400 7F 0460
+ Ack from phone
+1F0400 DA 0004 0028 0000 2FC2
+ ?
+1F0004 7F 2F4B
+ Ack from HFU-2
+
+Incoming call
+~~~~~~~~~~~~~
+
+1F0400 78 0004 0128 0701 3078
+ Status 0x07, 0x01
+1F0004 7F 3054
+ Ack from HFU-2
+1F0400 78 0004 0128 0701 3179
+ Status 0x07, 0x01
+1F0004 7F 3155
+ Ack from HFU-2
+1F0400 78 0004 0128 0E01 3273
+ Status 0x0E, 0x01
+1F0004 7F 3256
+ Ack from HFU-2
+1F0400 78 0004 0128 0A00 3377
+ Status 0x0A, 0x00
+1F0004 78 0003 2801 03 054F
+ Status confirm from HFU-2
+1F0400 7F 0561
+ Ack from phone
+1F0400 78 0004 0128 0A00 3377
+ Status 0x0A, 0x00
+1F0004 7F 33 57
+ Ack from HFU-2
+1F0400 78 0004 0128 0901 3472
+ Status 0x09, 0x01
+1F0004 7F 3450
+ Ack from HFU-2
+
+Connected
+~~~~~~~~~
+
+1F0400 78 0004 0128 0E01 3574
+ Status 0x0E, 0x01
+1F0004 7F 3551
+ Ack from HFU-2
+1F0400 78 0004 0128 0A01 3673
+ Status 0x0A, 0x01
+1F0004 78 0003 2801 03 064C
+ Status confirm from HFU-2
+1F0400 7F 0662
+ Ack from phone
+1F0400 78 0004 0128 0A01 3673
+ Status 0x0A, 0x01
+1F0004 7F 3652
+ Ack from HFU-2
+1F0400 78 0004 0128 0A00 3773
+ Status 0x0A, 0x00
+1F0004 7F 3753
+ Ack from HFU-2
+1F0400 78 0004 0128 0900 387F
+ Status 0x09, 0x00
+1F0004 7F 385C
+ Ack from HFU-2
+1F0400 78 0004 0128 0A01 397C
+ Status 0x0A, 0x01
+1F0004 7F 395D
+ Ack from HFU-2
+1F0400 78 0004 0128 0901 3A7C
+ Status 0x09, 0x01
+1F0004 7F 3A5E
+ Ack from HFU-2
+
+Initiation with connected phone
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+1F0004 D0 0001 04 00CE
+ Power up from HFU-2
+1F0400 D0 0001 05 5996
+ Power up from phone
+1F0004 79 0005 0201 0164 00 0100
+ Enable carkit mode from HFU-2
+1F0400 7F 0165
+ Ack from phone
+1F0004 79 0012 0201 0206 0056 2030 372E 3030 0A48 4655 3200 0249
+ HFU-2 Version
+1F0400 7F 0266
+ Ack from phone
+1F0400 78 0004 0128 0E01 5A1B
+ Status 0x0E, 0x01
+1F0004 79 0005 0201 0164 00 0302
+ Enable carkit mode from HFU-2
+1F0400 7F 0367
+ Ack from phone
+1F0400 78 0004 0128 0E01 5A1B
+ Status 0x0E, 0x01
+1F0004 7F 5A3E
+ Ack from HFU-2
+1F0400 78 0004 0128 0A01 5B1E
+ Status 0x0A, 0x01
+1F0004 7F 5B3F
+ Ack from HFU-2
+1F0400 78 0004 0128 0901 5C1A
+ Status 0x09, 0x01
+1F0004 7F 5C38
+ Ack from HFU-2
+1F0400 78 0004 0128 0701 5D15
+ Status 0x07, 0x01
+1F0004 7F 5D39
+ Ack from HFU-2
+1F0004 78 0003 2801 0305 4F
+ Status confirm from HFU-2
+1F0400 7F 0561
+ Ack from phone
+1F0400 DA 0004 0028 0000 5EB3
+ ?
+1F0004 7F 5E3A
+ Ack from HFU-2
+
+Disconnected
+~~~~~~~~~~~~
+
+1F0400 78 0004 0128 0E01 3B7A
+ Status 0x0E, 0x01
+1F0004 7F 3B5F
+ Ack from HFU-2
+1F0400 78 0004 0128 0A00 3C78
+ Status 0x0A, 0x00
+1F0004 78 0003 2801 03 074D
+ Status confirm from HFU-2
+1F0400 7F 0763
+ Ack from phone
+1F0400 78 0004 0128 0A00 3C78
+ Status 0x0A, 0x00
+1F0004 7F 3C58
+ Ack from HFU-2
+1F0400 78 0004 0128 0700 3D74
+ Status 0x07, 0x00
+1F0004 7F 3D59
+ Ack from HFU-2
+1F0400 78 0004 0128 0E00 3E7E
+ Status 0x0E, 0x00
+1F0004 7F 3E5A
+ Ack from HFU-2
+1F0004 78 0003 2801 0308 42
+ Status confirm from HFU-2
+1F0400 7F 086C
+ Ack from phone
+
+Incoming SMS
+~~~~~~~~~~~~
+
+1F0400 78 0004 0128 0E01 6627
+ Status 0x0E, 0x01
+1F0004 7F 6602
+ Ack from HFU-2
+1F0004 78 0003 2801 03 064C
+ Status confirm from HFU-2
+1F0400 7F 0662
+ Ack from phone
+1F0400 78 0004 0128 0E00 6727
+ Status 0x0E, 0x00
+1F0004 7F 6703
+ Ack from HFU-2
+1F0004 78 0003 2801 03 074D
+ Status confirm from HFU-2
+1F0400 7F 0763
+ Ack from phone
+
+Button pushed
+~~~~~~~~~~~~~
+
+1F0400 78 0004 0128 0E01 0948
+ Status 0x0E, 0x01
+1F0004 7F 096D
+ Ack from HFU-2
+1F0004 78 0003 2801 03 064C
+ Status confirm from HFU-2
+1F0400 7F 0662
+ Ack from phone
+1F0400 78 0004 0128 0E00 0A4A
+ Status 0x0E, 0x00
+1F0004 7F 0A6E
+ Ack from HFU-2
+1F0004 78 0003 2801 03 074D
+ Status confirm from HFU-2
+1F0400 7F 0763
+ Ack from phone
+
+Result
+------
+
+Important things to consider when designing a program for Com.n.sense that is to work with 6310.
+
+* 6310 sends out status 0x0E, 0x01 when speaker should be enabled
+* HFU-2 version has to be sent in order for 6310 to switch to profile â€Handsfreeâ€.
+* Status 0x0A might say weather the phone is ringing or connected. Only 6310 send this status.
+* Status confirm should be sent when status 0x0E is received.
diff --git a/docs/manual/protocol/discovering.rst b/docs/manual/protocol/discovering.rst
new file mode 100644
index 0000000..b058708
--- /dev/null
+++ b/docs/manual/protocol/discovering.rst
@@ -0,0 +1,82 @@
+.. _Discovering protocol:
+
+Discovering protocol
+====================
+
+You need to get a communication dump to be able to understand protocol
+or discover new commands. As most vendors provide some software for
+Windows, all following sections assume you do the sniffing on Windows.
+
+USB
+---
+
+For USB there exist various tools to dump USB communication. The dumps
+can be later analyzed and used to discover protocol details or unknown
+commands. One of the best free tools available currently is `UsbSnoop`_.
+
+In directory ``contrib/usbsnoop`` in Gammu sources you can find some tools to
+decode the output.
+
+.. _UsbSnoop: http://www.pcausa.com/Utilities/UsbSnoop/
+
+Serial port
+-----------
+
+
+Download `Portmon`_, which allows one to capture bytes sent and received by
+ready binary software.
+
+.. _Portmon: http://technet.microsoft.com/en-us/sysinternals/bb896644.aspx
+
+If you have log saved by PortMon and protocol is the same to "old" Nokia
+protocols, can use Gammu to decode it. It's simple::
+
+ gammu --decodesniff MBUS2 file 6210 > log
+
+saves in log decoded MBUS2 dump session. There is used phone module for
+6210 and have you have debug info about 6210 specific frames (you don't have
+to add model). Dump file for --decodesniff and MBUS should be specific:
+
+1. without bytes sent to phone (in Portmon you set it here:
+ "Edit", "Filter/Highlight")
+
+2. in Hex format ("Options", "Show Hex")
+
+3. without Date & Time ("Options", "Show Time" & "Clock Time")
+
+
+Infrared
+--------
+
+First of all you need two computers with IrDA. One running linux, that will
+sniff and one running windows, which will communicate with the phone and
+whatever software you want (Nokia, Logomanager, Oxygen Phone Manager).
+Then you have to get the software from
+http://www.dev-thomynet.de/nokworld/noktrace/
+
+You have to disable IrDA services on the linux machine and eventually you
+have to change the default port the 'irda_intercept' program is sniffing
+from (default ttyS1). On the windows machine you should decrease the
+maximum transmission speed to 9600bps if possible, because the intercept
+program doesn't seem to handle speed changes. (9600 is for searching
+devices in range and then the highest possible speed is chosen) If it isn't
+possible you have to change the default bitrate in intercept source code,
+too. Then you won't see anything until the windows machine and the phone
+start transmitting data, which isn't too bad. At least here in my setup I
+could sniff the data coming from phone and sent to it in one go, like that::
+
+ win ------------------> Nokia
+ machine <----------------- phone
+ ^^
+ ||
+ sniffing
+ device
+
+You get a raw data file (.trc) from the intercept program, which you can
+then decode to hex with the second program from the above mentioned page.
+You should possibly be able to use Marcin's magnokii for decoding the trc
+files, too, but it didn't work for me so I just figured things out from the
+hex files. In the hex files you should look for primary frames with
+00 01 00 in it, because this is the FBUS header which is in every valuable
+frame sent to phone. It's not really joy to do that, but if it brings
+support for a new phone it's worth it :-)
diff --git a/docs/manual/protocol/gnapplet.rst b/docs/manual/protocol/gnapplet.rst
new file mode 100644
index 0000000..9d452f9
--- /dev/null
+++ b/docs/manual/protocol/gnapplet.rst
@@ -0,0 +1,62 @@
+.. _gnapplet:
+
+Gnapplet Protocol
+=================
+
+.. note::
+
+ The original applet has been created for
+ <http://www.gnokii.org/>. Gammu currently uses slightly
+ extended version which will be hopefully merged back.
+
+Installation
+------------
+
+To communicate with the phone, you need to install the applet. There are few
+options how to do it:
+
+Installation using Gammu
+++++++++++++++++++++++++
+
+Gammu can transmit the applet to your phone automatically. Just configure it
+for use of gnapplet connection and invoke :option:`gammu install`:
+
+.. code-block:: sh
+
+ gammu install
+
+It will automatically transmit the applet to the phone. On some phones the
+installation will start automatically, on some you need to find received files
+in the inbox and install them manually from there.
+
+Downloading from phone
+++++++++++++++++++++++
+
+Downloading files from the phone and installing them directly. You can
+download all required files from http://dl.cihar.com/gammu/gnapplet/.
+
+Manual Installation using Gammu
++++++++++++++++++++++++++++++++
+
+If the above mentioned :option:`gammu install` does not work for you, for
+example when you need to use different applet, you can still use Gammu to send
+files to the phone using :option:`gammu sendfile`.
+
+First you need to create ``~/.gammurc`` with following content:
+
+.. code-block:: ini
+
+ [gammu]
+ connection = blueobex
+ model = obexnone
+ device = 5C:57:C8:XX:XX:XX # Address of the phone
+
+And now you can send files to your phone:
+
+.. code-block:: sh
+
+ gammu sendfile gnapplet.sis
+ gammu sendfile gnapplet.ini
+
+Files should appear in inbox in your phone and you can install them from
+there.
diff --git a/docs/manual/protocol/index.rst b/docs/manual/protocol/index.rst
new file mode 100644
index 0000000..89a91b2
--- /dev/null
+++ b/docs/manual/protocol/index.rst
@@ -0,0 +1,28 @@
+.. _protocols:
+
+Phone Protocols
+===============
+
+.. toctree::
+ :maxdepth: 2
+
+ discovering
+ nokia
+ nokia-s40-sms
+ n6110
+ n6510
+ n7110
+ carkit
+ tdma_5120
+ samsung
+ samsung-gt
+ sonim
+ mtk
+ m-obex
+ s60
+ gnapplet
+
+.. seealso::
+
+ You can also find documentation for some protocols and vendor extensions
+ in separate git repository at http://github.com/gammu/gsm-docs
diff --git a/docs/manual/protocol/m-obex.rst b/docs/manual/protocol/m-obex.rst
new file mode 100644
index 0000000..eb7803f
--- /dev/null
+++ b/docs/manual/protocol/m-obex.rst
@@ -0,0 +1,440 @@
+m-obex protocol used by some Samsung mobiles
+============================================
+
+This document is copied from <http://code.google.com/p/samsyncro/wiki/mobex> and extended.
+
+Introduction
+------------
+
+This is an attempt to document the m-obex protocol. It is a obex-variation by Samsung used to exchange PIM data and files over bluetooth.
+
+This documentation is by no means complete but is only a reference for the samsyncro implementation. As I don't know the obex protocol I can't say in which parts it differs from the standard-obex. The only thing I found strange is the fact, that you will always get 0xA0 as a response. Which means Ok, success in obex. If there was an error you will find it's error code in the 0x42 header. If this is a normal behavior: Why are there so many response codes defined?
+
+The information about the protocol was gained by listening to the transferred data from Samsungs New PC Studio to a SGH-F480i and B2100 mobile.
+
+Requirements
+------------
+
+* Established bluetooth connection to the serial channel of the mobile
+* Some way to access this serial port. For example minicom.
+
+Starting the obex server
+------------------------
+
+To start the obex server you have to send this AT command first::
+
+ AT+SYNCML=MOBEXSTART
+
+Some phones seem to start with following command::
+
+ AT$TSSPCSW=1
+
+Obex commands
+-------------
+
+In the following chapters I will describe the obex packages to read and edit data on the mobile. I think most of them are in standard-obex format and are following this structure:
+
++-------------------------------------------+-----------------------------------+-------------------------------------------+
+|Package Header |Session Id |Obex Header(s) |
++===========================================+===================================+===========================================+
+|* First byte: Type of request. |* 0xCB and four bytes of session id|* First byte: Type of header. |
+|* Second and third bytes: length of package| |* Second and third bytes: length of header.|
+| | |* Next bytes: data. |
+| | |* Last byte: 0x00 |
++-------------------------------------------+-----------------------------------+-------------------------------------------+
+
+For detailed information about obex, for example what types of packages and headers exists, get the official Obex documentation from Infared Data Association. But I don't know if this is available for free.
+
+Here is a list of the most used types for the Samsung mobiles:
+
+There exists mainly two types of operations: Put (package header 0x02 and 0x82) to write data to the mobile and Get (package header 0x03 and 0x83) to retrieve data from the mobile. A put or get operation can be divided into several packages. The high-bit indicates if this is the last package of an operation. For example if you want to transfer a file to the mobile you send n-time 0x02 packages and only the last one is 0x82.
+
+Headers consists normally out of three blocks: First byte: Header type, second and third byte: length of the header (if the headers length is variable), following bytes: data. The most used header types are
+
++-----------------------+------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
+| Obex description | Byte | following two bytes | following bytes |
++=======================+======+========================+===================================================================================================================================================+
+| Name | 0x01 | length of header | Used for filesystem operation to name a path or file |
++-----------------------+------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
+| Type | 0x42 | length of header | Obex command for example "m-obex/contacts/list" |
++-----------------------+------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
+| Length | 0xC3 | | Used in put operations and specifies the length of the transferred data (without header bytes). The length is represented in 4 bytes. |
++-----------------------+------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
+| Body | 0x48 | length of header | Data in a multi-package put operation |
++-----------------------+------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
+| End of Bady | 0x49 | length of header | Last data package in a put operation |
++-----------------------+------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
+| Session id | 0xCB | | Four bytes representing the session id. Needed for multiplexing |
++-----------------------+------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
+| Application Parameter | 0X4C | length of header | In a request: Parameters for example a contact's id. <p>In an answer: The error/return code. If it is 0x00 0x00 than the operation was successful |
++-----------------------+------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
+
+Contacts
+--------
+
+Get contacts count
+++++++++++++++++++
+
+Request
+~~~~~~~
+
+*83* 00 25
+ Obex Get
+CB 00 00 00 00
+ Session Id
+*42* 00 19 6D 2D 6F 62 65 78 2F 63 6F 6E 74 61 63 74 73 2F 63 6F 75 6E 74 00
+ m-obex command: m-obex/contacts/count
+4C 00 04 01
+ Unknown! Didn' see PC Studio sending something other than 0x01 as parameter
+
+Answer
+~~~~~~
+*A0* 00 14
+ Obex ok
+*C3* 00 00 00 04
+ Maybe the number of requests you have to send to get all contacts. See next chapter for more information
+*4C* 00 05 00 00
+ Error code
+*49* 00 07 07 D0 00 18
+ First two data bytes: maximum number of contacts (0x07D0 = 2000). Last two data bytes: Current number of contacts
+
+
+List all
+++++++++
+
+Request
+~~~~~~~
+*83* 00 26
+ Obex Get package
+*CB* 00 00 00 00
+ Session Id
+*42* 00 18 6D 2D 6F 62 65 78 2F 63 6F 6E 74 61 63 74 73 2F 6C 6F 61 64 00
+ m-obex Command: m-obex/contacts/load
+*4C* 00 06 01 00 00
+ First Byte unknown. Last two bytes: increment until all contacts received
+
+Answer
+~~~~~~
+*A0* 08 C1
+ Obex Ok
+*C3* 00 00 08 B1
+ Length of sent data
+*4C* 00 05 00 02
+ Indicates if these are the last contacts
+*49* 07 41 01 10 01 8D ...."
+ The first byte is unknown but all answers have this byte, then byte 2 and 3 contains the length of the answer, bytes 4 and 5 are the ID of the first entry bytes 6 and 7 are the length of this entry.
+
+ In one response more than 1 vcard can be returned in this case, entries are separated by 4 bytes with the following meaning: bytes 1 and 2 ID of the entry, bytes 3 and 4: length of the entry.
+
+To get all contacts the request have to be sent several times. The last two bytes must be incremented by every call.
+
+The end of the contacts list is reached if the header 0x4C is 0. The header will be 4C 00 05 00 00.
+
+
+Create a contact
+++++++++++++++++
+
+Beware: This is a put operation and is performed in some obex implementations in several packages (for example 0x02, 0x02, 0x82). But I didn't get the mobile to accept this. I had to create/update PIM data in exactly one package.
+
+Request
+~~~~~~~
+*82* 00 88
+ Obex put
+*CB* 00 00 00 00
+ Session id
+*42* 00 1A 6D 2D 6F 62 65 78 2F 63 6F 6E 74 61 63 74 73 2F 63 72 65 61 74 65 00
+ m-obex/contacts/create
+*4C* 00 04 01
+ ? maybe flag for internal/external memory
+C3 00 00 00 5A
+ Length of the vcard string
+49 00 5D 42 45....
+ Contact as vcard
+
+Answer
+~~~~~~
+*A0* 00 12
+ Obex ok
+*C3* 00 00 00 02
+ ?
+*4C* 00 05 00 00
+ Error code
+*49* 00 05 00 21
+ last two bytes: the id of the newly created contact
+
+
+Update a contact
+++++++++++++++++
+
+Beware: This is a put operation and is performed in some obex implementations in several packages (for example 0x02, 0x02, 0x82). But I didn't get the mobile to accept this. I had to create/update PIM data in exactly one package.
+
+Request
+~~~~~~~
+*82* 00 8D
+ Obex put
+*CB* 00 00 00 00
+ Session id
+*42* 00 19 6D 2D 6F 62 65 78 2F 63 6F 6E 74 61 63 74 73 2F 77 72 69 74 65 00
+ m-obex/contacts/write
+*4C* 00 06 01 00 20
+ Id of the contact which should be updated
+C3 00 00 00 5E
+ Length of the vcard string
+49 00 61 42...
+ Contact as vcard
+
+Answer
+~~~~~~
+*A0* 00 08
+ Obex ok
+*4C* 00 05 00 00
+ Error code: 0x00 0x00 means successful
+
+
+Read one contact
+++++++++++++++++
+
+There is also the possibility to read exactly one contact.
+
+Request
+~~~~~~~
+*83* 00 26
+ Obex get
+*CB* 00 00 00 00
+ Session id
+*42* 00 18 6D 2D 6F 62 65 78 2F 63 6F 6E 74 61 63 74 73 2F 72 65 61 64 00
+ m-obex/contacts/read
+*4C* 00 06 01 00 20
+ First byte:? Last two bytes: Id of contact
+
+Answer
+~~~~~~
+*A0* 00 C4
+ Obex ok
+*C3* 00 00 00 B4
+ Length of vcard (without headers, just data)
+*4C* 00 05 00 00
+ Error code
+49 00 B7 42 45 47 49 4E ...
+ contact as vcard. TODO: where is id? First two bytes?
+
+Delete contact
+++++++++++++++
+
+To delete a contact you only have to know it's id.
+
+Request
+~~~~~~~
+*82* 00 28
+ Obex put
+*CB* 00 00 00 00
+ Session id
+*42* 00 1A 6D 2D 6F 62 65 78 2F 63 6F 6E 74 61 63 74 73 2F 64 65 6C 65 74 65 00
+ m-obex/contacts/delete
+*4C* 00 06 01 00 19
+ First byte: ? Last two bytes: Id of contact
+
+Answer
+~~~~~~
+
+*A0* 00 08
+ Obex ok
+*4C* 00 05 00 00
+ Error code
+
+
+Calendar
+--------
+
+Get count
++++++++++
+
+Request
+~~~~~~~
+*83* 00 25
+ Obex get
+*CB* 00 00 00 00
+ Session id
+*42* 00 19 6D 2D 6F 62 65 78 2F 63 61 6C 65 6E 64 61 72 2F 63 6F 75 6E 74 00
+ m-obex/calendar/count
+*4C* 00 04 FF
+ ?
+
+Answer
+~~~~~~
+A0 00 1C
+ Obex ok
+*C3* 00 00 00 0C
+ length of data
+*4C* 00 05 00 00
+ Error code
+*49* 00 0F 01 2C 00 06 00 64 00 00 00 64 00 00
+ ?TODO?
+
+List all
+++++++++
+
+Request
+~~~~~~~
+*83* 00 20
+ Obex get
+*CB* 00 00 00 00
+ Session id
+*42* 00 18 6D 2D 6F 62 65 78 2F 63 61 6C 65 6E 64 61 72 2F 69 6E 66 6F 00
+ m-obex/calendar/load
+
+
+Answer
+~~~~~~
+*A0* 00 C0
+ Obex ok
+*C3* 00 00 00 B0
+ Session
+*4C* 00 05 00 00
+ Error code
+*49* 00 B3 01 07 08 00 00 00 00 00 00 00 00 ...
+ Calendar items in vcalendar format. TODO: where are the ids?
+
+Create
+++++++
+
+Request
+~~~~~~~
+*82* 00 CC
+ Obex put
+*CB* 00 00 00 00
+ Session
+*42* 00 1A 6D 2D 6F 62 65 78 2F 63 61 6C 65 6E 64 61 72 2F 63 72 65 61 74 65 00
+ m-obex/calendar/create
+4C 00 04 01
+ ?
+*C3* 00 00 00 9E
+ Length of vcalendar
+*49* 00 A1 42 45 47 49 4E 3A 56 43 41 4C 45 ...
+ vcalendar
+
+Answer
+~~~~~~
+*A0* 00 12
+ Obex ok
+*C3* 00 00 00 02
+ Length
+*4C* 00 05 00 00
+ Error code
+*49* 00 05 00 06
+ Id of the created item
+
+Update
+++++++
+
+Request
+~~~~~~~
+*82* 00 F7
+ Obex put
+*CB* 00 00 00 00
+ Session
+*42* 00 19 6D 2D 6F 62 65 78 2F 63 61 6C 65 6E 64 61 72 2F 77 72 69 74 65 00
+ m-obex/calendar/write
+*4C* 00 06 01 00 05
+ First byte: ? Second and third byte: Id of the item
+*C3* 00 00 00 C8
+ Length of vcalendar
+*49* 00 CB 42 45 47 49 4E 3A 56
+ vcalendar item
+
+Answer
+~~~~~~
+*A0* 00 08
+ Obex ok
+*4C* 00 05 00 00
+ Error code
+
+
+Read
+++++
+
+Request
+~~~~~~~
+*83* 00 26
+ Obex get
+*CB* 00 00 00 00
+ Session
+*42* 00 18 6D 2D 6F 62 65 78 2F 63 61 6C 65 6E 64 61 72 2F 72 65 61 64 00
+ m-obex/calendar/read
+4C 00 06 01 00 06
+ Id of calendar item
+
+Answer
+~~~~~~
+*A0* 00 C0
+ Obex ok
+*C3* 00 00 00 B0
+ Length
+*4C* 00 05 00 00
+ Error code
+*49* 00 B3 42 45 47 49 4E 3A 56 43 41 4C 45 4E 44 41 52 0D 0A 56 45 52 53 49 4F 4E 3A 31 2E 3....
+ vcalendar item. TODO: Where is the id?
+
+Delete
+++++++
+
+Request
+~~~~~~~
+*82* 00 28
+ Obex put
+*CB* 00 00 00 00
+ Session
+*42* 00 1A 6D 2D 6F 62 65 78 2F 63 61 6C 65 6E 64 61 72 2F 64 65 6C 65 74 65 00
+ m-obex/calendar/delete
+*4C* 00 06 01 00 06
+ id of calendar item
+
+
+Notes
+-----
+
+
+Tasks
+-----
+
+
+Files
+-----
+
+To get the file structure on the mobile, there are two commands. One that lists all subdirectories and one that lists all files.
+
+List directories
+++++++++++++++++
+
+List files
+++++++++++
+
+Get file
+++++++++
+
+Create file
++++++++++++
+
+Delete file
++++++++++++
+
+
+SMS
+---
+
+0x01: Inbox
+0x08: Outbox
+
+Get sms count
++++++++++++++
+
+List all sms
+++++++++++++
+
+Send sms
+++++++++
+
+Create sms
+++++++++++
+
+I don't think this is possible. At least I didn't find the function in New PC Studio. So sadly there will be no backup of sms messages.
diff --git a/docs/manual/protocol/mtk.rst b/docs/manual/protocol/mtk.rst
new file mode 100644
index 0000000..01e1e98
--- /dev/null
+++ b/docs/manual/protocol/mtk.rst
@@ -0,0 +1,41 @@
+MTK AT Commands
+===============
+
+VCard access
+------------
+
+Read vcard, first 1 is READ command, second 1 is memory position::
+
+ AT+EVCARD=1,1
+ +EVCARD: "0043003a005c00520065006300650069007600650064005c007e00760063006100720064005f0072002e007600630066"
+ OK
+
+HEX UCS2 temporary file name which we must read for VCARD
+
+Filesystem access
+-----------------
+
+Change operation mode to obtain access to filesystem operations::
+
+ AT+ESUO=3
+ OK
+
+Change directory to root folder::
+
+ AT+EFSF=3
+ OK
+
+Read file with name from +EVCARD reply::
+
+ AT+EFSR="0043003a005c00520065006300650069007600650064005c007e00760063006100720064005f0072002e007600630066"
+ +EFSR: 1, 1, 168,
+ "424547494E3A56434152440D0A56455253494F4E3A322E310D0A4E3B434841525345543D5554462D383B454E434F44494E473D51554F5445442D5052494E5441424C453A3D44303D39383D44313D38303D44303D42383D44303D42443D44303D42300D0A54454C3B43454C4C3A2B37787878787878787878780D0A54454C3B484F4D453A2B37787878787878787878780D0A54454C3B574F524B3A2B37787878787878787878780D0A454E443A56434152440D0A"
+ OK
+
+(1, 1, 168) = (<MEM POSITION>, <EOF FLAG>, <HEXLIFIED VCARD LEN>)
+
+Change operation mode to compatible::
+
+ AT+ESUO=4
+ OK
+
diff --git a/docs/manual/protocol/n6110.rst b/docs/manual/protocol/n6110.rst
new file mode 100644
index 0000000..70b4943
--- /dev/null
+++ b/docs/manual/protocol/n6110.rst
@@ -0,0 +1,798 @@
+Nokia 6110
+==========
+
+
+Assembled by
+Balazs Nagy <js@iksz.hu>
+Harri Yli-Torkko <hyt@surfeu.fi>
+Alfred R. Nurnberger <arnu@flosys.com>
+Hugh Blemings <Hugh.Blemings@vsb.com.au>
+Mike Bradley <mike@trumpington.st>
+Odinokov Serge <serge@takas.lt>
+Pavel Janik <Pavel@Janik.cz>
+BORBELY Zoltan <bozo@andrews.hu>
+Pawel Kot <pkot@linuxnews.pl>
+Marcin Wiacek <Marcin@MWiacek.com>
+Walek <walek@pa98.opole.sdi.tpnet.pl>
+... and other members of gnokii mailing list
+and authors of some WWW pages.
+
+The data provided is for information purposes only.
+Some of the frames might be hazardous to your phone. Be careful!!!
+We do not take any responsibility or liability for damages, etc.
+
+
+.. note::
+
+ this information isn't (and can't be) complete. If you know anything
+ about features not listed here or you noticed a bug in this list, please
+ notify us via e-mail. Thank you.
+
+Document describing frames used in
+GSM/PCN Nokia 6110 and derivatives (Nokia 6130, 6150, 6190, 5110, 5130, 5150,
+5190, 3210, 3310)
+
+Correct format is FBUS version 2/Direct IRDA/MBUS version 2
+(see nokia.txt for protocol details):
+
+List::
+
+ 0x00: Monitoring values
+ r monitoring value {+0x01, 0x01, block... }
+ where block: 0x5e, 0x05, 0x7a(?), 0xd0(?), 0x85(?), 0x02, percentHI, percentLO
+ Battery percent level
+ 0x5e, 0x0c, 0x52(?), 0x4b(?), 0x6f(?), 0x02, voltageHI, voltageLO
+ Battery standby voltage
+ ...
+ 0x01: Call Information
+ s Make call { 0x0001, "number", type, block }
+ where type:
+ 0x01 - data call
+ 0x05 - voice call
+ block:
+ data call (non digital lines):
+ 0x02,0x01,0x05,0x81,0x01,0x00,0x00,0x01,0x02,0x0a,
+ 0x07,0xa2,0x88,0x81,0x21,0x15,0x63,0xa8,0x00,0x00
+ data call (digital lines):
+ 0x02,0x01,0x05,0x81,0x01,0x00,0x00,0x01,0x02,0x0a,
+ 0x07,0xa1,0x88,0x89,0x21,0x15,0x63,0xa0,0x00,0x06,
+ 0x88,0x90,0x21,0x48,0x40,0xbb
+ voice call:
+ 0x01, 0x01, 0x05, 0x81/0x00, sendnum, 0x00, 0x00, 0x01
+ where:
+ sendnum (own number sending):
+ 0x01: preset (depends on network)
+ 0x03: on
+ 0x02: off
+ r Call going msg { 0x0002 }
+ r Call in progress { 0x0003, seqnr }
+ r Remote end hang up { 0x0004, seqnr, ?, error (like in netmon in 39) }
+ r incoming call alert { 0x0005, seqnr, numlen, "number", namelen, "name" }
+ s Answer call part 2 { 0x0006, seqnr, 0x00 }
+ r answered call { 0x0007, seqnr }
+ s Hang up { 0x0008, seqnr, 0x85 }
+ r terminated call { 0x0009, seqnr }
+ r call msg { 0x000a, seqnr }
+ r call held { 0x0023, seqnr, 0x01 }
+ r call resumed { 0x0025, seqnr, 0x01 }
+ r Send DTMF/voice call { 0x0040}
+ s Answer call part 1 { 0x0042,0x05,0x01,0x07,0xa2,0x88,0x81,0x21,0x15,0x63,0xa8,0x00,0x00,
+ 0x07,0xa3,0xb8,0x81,0x20,0x15,0x63,0x80 }
+ s Sent after issuing { 0x0042,0x05,0x81,0x07,0xa1,0x88,0x89,0x21,0x15,0x63,0xa0,0x00,0x06,
+ data call 0x88,0x90,0x21,0x48,0x40,0xbb,0x07,0xa3,
+ (digital lines) 0xb8,0x81,0x20,0x15,0x63,0x80 }
+ s Sent after issuing { 0x0042,0x05,0x01,0x07,0xa2,0xc8,0x81,0x21,0x15,0x63,0xa8,0x00,0x00,
+ data call 0x07,0xa3,0xb8,0x81,0x20,0x15,0x63,0x80,
+ (non digital lines) 0x01,0x60 }
+ s Send DTMF { 0x0050, length, {ascii codes for DTMF}, 0x01 }
+
+ Note:
+ to make data call (non digital lines):
+ 1.send "Make call" for non digital lines
+ 2.send "Sent after issuing data call (non digital lines)"
+ to make data call (digital lines):
+ 1.send "Answer call part 1"
+ 2.send "Sent after issuing data call (digital lines)"
+ 3.send "Make call" for digital lines
+ to answer call:
+ 1.send "Answer call part 1"
+ 2.send "Answer call part 2"
+
+ 0x02: SMS handling
+ s Send SMS message { 0x0001, 0x02, 0x00 (SEND REQUEST), ... }
+ r Message sent { 0x0002 }
+ r Send failed { 0x0003, ?, ?, error (like in netmon in 65)}
+ s Get SMS message { 0x0007, 0x02, location, 0x01, 0x64 }
+ s Initiate connection { 0x000d, 0x00, 0x00, 0x02 }
+ r Initiate ACK { 0x000e, 0x01 }
+ r SMS message received { 0x0010, ...... } (whole message)
+ s Set CellBroadcast { 0x0020, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01 }
+ for enable cell broadcast ?
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
+ for disable cell broadcast ?
+ r Set CellBroadcast OK { 0x0021, 0x01 }
+ r Read CellBroadcast { 0x0023, ?, ?, ?, channel, ?, message... } ?
+ s Set SMS center { 0x0030, 0x64, priority, checksum? ,0?, format,
+ validity, {DefaultRecipient no.}[12],
+ {SMScenter no.}[12], {SMSC name}, 0x00}
+ where tel.no.[12]: {len, type, {number(BCD)}}
+ type: 0x81: normal
+ 0x91: + (international)
+ 0xd0: alphanumeric
+ format: 0x00: text
+ 0x22: fax
+ 0x24: voice
+ 0x25: ERMES
+ 0x26: paging
+ 0x31: X.400
+ 0x32: email
+ validity: 0x0b: 1 hour
+ 0x47: 6 hours
+ 0xa7: 24 hours
+ 0xa9: 72 hours
+ 0xad: 1 week
+ 0xff: max.time
+ r Set SMS center OK { 0x0031 }
+ r Set SMS center error { 0x0032, reason }
+ s Get SMS center { 0x0033, 0x64, priority }
+ r SMS center received { 0x0034, priority, checksum?, format, 0x00?,
+ validity, {DefaultRecipient no.}[12],
+ {SMScenter no.}[12], {SMSC name}, 0x00}
+ tel.no[12]: {len, type, {number(BCD)}}
+ where priority, checksum, type, validity,
+ tel.no.[12]: see 0x02/0x0030
+ r SMS center error recv { 0x0035, reason }
+ 0x03: Phonebook functions
+ s Get mem location { 0x0001, memtype, location, 0 }
+ where memory:
+ 0x01: telephone and SIM phonebook (in one)
+ 0x02: telephone phonebook
+ 0x03: SIM phonebook
+ 0x04: SIM fixdialling-phonebook (?)
+ 0x05: Own numbers
+ 0x07: Dialled numbers
+ 0x08: Missed calls
+ 0x09: Received calls
+ 0x0b: voice mailbox (location not important)
+ r mem location recvd { 0x0002, 0x00,namelen,"name",numlen,"number",groupID, 0x01?, yearLO, yearHI, month, day, hour, minute, sec. }
+ Note: in 3310 all entries have null name ("feature" of bug ?)
+ r mem loc error recvd { 0x0003, errtype }
+ where errtype:
+ 0x7d: invalid memory type
+ 0x74: empty location ?
+ 0x8d: no PIN
+ s Set mem location { 0x0004, memtype,location,namelen,"Name",numlen,"number",groupID }
+ r mem set OK { 0x0005 }
+ r mem set error { 0x0006, errtype }
+ where errtype: 0x7d: name is too long
+ s Mem status request { 0x0007, memtype }
+ r Mem status recvd { 0x0008, memtype, free, used }
+ r Mem status error recv { 0x0009, errtype }
+ where errtype: 0x6f: mem status error
+ 0x7d: invalid memory type
+ 0x8d: waiting for pin
+ s Get caller group data { 0x0010, groupID }
+ r Get caller group data { 0x0011, groupID, size, "Name", ringtoneID, graphic_on?1:0, lenHI, lenLO, OTABitmap (72x14 logo) }
+ r Get call.group error { 0x0012, reason }
+ where reason: 0x7d: invalid location
+ s Set caller group data { 0x0013, groupID, size, "Name", ringtoneID, graphic_on?1:0, lenHI, lenLO, OTABitmap (72x14 logo) }
+ r Set caller group OK { 0x0014 }
+ r Set call.group error { 0x0015, reason }
+ where reason: 0x7d: invalid location
+ s Get speed dial { 0x0016, index(1-9) }
+ r Get speed dial OK { 0x0017, mem.type, location }
+ where mem.type: 0x02: ME (== 0 if not stored)
+ 0x03: SIM
+ location: memory location (== 0 if not stored)
+ r Get speed dial error { 0x0018 }
+ s Set speed dial { 0x0019, index(1-9), mem.type, location }
+ r Set speed dial OK { 0x001a }
+ r Set speed dial error { 0x001b }
+ 0x04: Phone Status
+ s Phone status { 0x0001 }
+ r Phone status { 0x0002, mode, signal str, ???, pwr, batt.level }
+ where mode: 1: registered within the network
+ 2: call in progress
+ 3: waiting for pin
+ 4: powered off
+ pwr: 1: AC/DC
+ 2: battery
+ s Request Phone ID { 0x0003 }
+ r RequestPhone ID { 0x0004, 0x01,"NOKIA""imei", 0, "model", 0, "prod.code", 0, "HW", 0, "firmware", 0x00, 0x01 }
+ 0x05: Profile settings
+ s Set profile feature { 0x0010, 1, nr, feature, a, 1 }
+ where nr: see 0x05/0x0013
+ feature: see 0x05/0x0014
+ a: see 0x05/0x0014
+ r Set profile feat. OK { 0x0011, 1 }
+ s Get profile feature { 0x0013, 1, nr, feature, 1 }
+ where nr is profile number (general=0, silent, meeting, outdoor, pager, car, headset=6)
+ feature: see 0x05/0x0014
+ r Get profile feature { 0x0014, 1, nr, feature, 4, a, b, c, d, 1 }
+
+ Note: Settings num 0x00 .. 0x09 can be assigned
+ separately to each profile (0x00 .. 0x05), but rest are common
+ to all profiles.
+
+ 6110
+
+ Feature Description Value
+ ------- ------------------- -----------------
+ 0x00 keypad notes 0xff=off, 0x00=level 1, 0x01=level 2, 0x02=level 3
+ 0x01 lights (? only in car profile) 0x00=off, 0x??=on (maybe 0x01)
+ 0x02 incoming call alert 1=ringing, 2=beep once, 3=unknown, 4=off, 5=ring once,
+ 6=ascending, 7=caller groups (see feature #0x08)
+ 0x03 ringing tone ID for original 6110: 0x12=ring ring, 0x13=low, etc.
+ 0x04 ringing volume level 1 (0x06) - level 5 (0x0a)
+ 0x05 message alert tone 0=no tone, 1=standard, 2=special, 3=beep once, 4=ascending
+ 0x06 vibration 0=off, 1=on
+ 0x07 warning and game tones 0xff=off, 0x04=on
+ 0x08 incoming caller groups 1=family, 2=VIP, 4=friends, 8=colleagues, 16=other
+ 0x09 automatic answer 0x00=off, 0x01=on
+ -------------------------
+ 0x16 Anykey answer 0x00=Off, 0x01=On
+ 0x17 ??? 0x00 | 0x01
+ 0x18 Memory in use 0x00=Phone, 0x01=SIM card
+ 0x19 Network selection 0x00=Automatic, 0x01=Manual
+ 0x1a Automatic redial 0x00=Off, 0x01=On
+ 0x1b ??? 0x00 | 0x01
+ 0x1c ??? 0x00...0x18
+ 0x1d Speed dialling 0x00=Off, 0x01=On
+ 0x1e Own number sending 0x00=Preset, 0x01=On, 0x02=Off
+ 0x1f Cell info display 0x00=Off, 0x01=On
+ 0x21 Language 0x00=English
+ 0x01=Deutsch
+ 0x02=Francais
+ 0x03=Italiano
+ 0x06=Nederlands
+ 0x07=Dansk
+ 0x08=Svenska
+ 0x09=Suomi
+ 0x0e=Norsk
+ 0x10=Automatic
+ 0x26 Reply via same centre 0x00=No, 0x01=Yes
+ 0x27 Delivery reports 0x00=No, 0x01=Yes
+ 0x28 Hide clock 0x00=Show clock, 0x01=Hide clock
+ 0x29 Time format 0x00=24-hour, 0x01=12-hour
+ 0x2a Selected profile 0x00=General, 0x01.. the rest
+
+ 33x0
+
+ Feature Description Value
+ ------- ------------------- -----------------
+ 0x00 keypad notes 0xff=off, 0x00=level 1, 0x01=level 2, 0x02=level 3
+ 0x01 incoming call alert 1=ringing, 2=beep once, 3=unknown, 4=off, 5=ring once,
+ 6=ascending
+ 0x02 ringing tone ID
+ 0x03 ringing volume level 1 (0x06) - level 5 (0x0a)
+ 0x04 message alert tone 0=no tone, 1=standard, 2=special, 3=beep once, 4=ascending
+ 0x05 vibration 0=off, 1=on, 2=vibrate first
+ 0x06 warning tones 0xff=off, 0x04=on
+ 0x07 screen saver 1=on, 0=off
+ 0x08 Screen saver -> Timeout 0x00=5 sec, 0x01=20 sec,....
+ 0x09 Screen saver -> Screen saver 0x00 ... 0x0d = Number of picture image
+ -------------------------
+ 0x0a: ???:
+ ...: ???:
+ 0x15: ???: Read only?
+ -------------------------
+ 0x16: ???: 0x00=??? 0x01=???
+ 0x17: Memory in use (Nokia 3330): 0x00=Phone, 0x01=SIM card
+ 0x18: Network selection: 0x00=Automatic, 0x01=Manual
+ 0x19: Automatic redial: 0x00=Off, 0x01=On
+ 0x1a: Speed dialling: 0x00=Off, 0x01=On
+ 0x1b: Own number sending: 0x00=Set by network, 0x01=On, 0x02=Off
+ 0x1c: Cell info display: 0x00=Off
+ 0x1d: Type of view: 0x00=Name list,0x01=Name, number,0x02=Large font
+ 0x1e: Language: 0x00=English
+ 0x07=Dansk
+ 0x08=Svenska
+ 0x09=Suomi
+ 0x0c=Turcke
+ 0x0e=Norsk
+ 0x10=Automatic
+ 0x32: Reboots ME (3330)
+ 0x1f: ???: Read only? (3330)
+ 0x20: Reply via same centre: 0x00=No, 0x01=Yes
+ 0x21: Delivery reports: 0x00=No, 0x01=Yes
+ 0x22: Show/Hide clock: 0x00=Show, 0x01=Hide
+ 0x23: Time format: 0x00=24-hour, 0x01=12-hour
+ 0x24: Select profile: 0x00=General, 0x01 ... 0x05=rest of them
+ 0x25: ???: Read only? (N3330)
+ 0x26: Confirm SIM service actions: 0x00=Not asked, 0x01=Asked
+ 0x27: T9 Dictionary: 0x00=Off, 0x01=English, 0x0a=Suomi
+ 0x28: Messages -> Character support: 0x00=Automatic, 0x01=GSM alphabet, 0x02=Unicode
+ 0x29: Startup logo settings: 0x00=Your own uploaded logo,0x01=Nokia
+ 0x02=Draft HUMAN technology(tm),0x03=Itineris
+ 0x2a: ???: 0x00=??? 0x01=???
+ 0x2b: ???: 0x00=??? 0x01=???
+ 0x2c: ???: Read only? (N3330)
+ 0x2d: Auto update of date and time: 0x00=Off,0x01=Confirm first,0x02=On
+
+ s Get welcome message { 0x0016 }
+ r Get welcome message { 0x0017, no.of blocks, { block } * }
+ where block: { id, {blockspecific} }
+ id: 1: startup logo { y, x, picture (coding?) }
+ 2: welcome note { len, "message" }
+ 3: operator msg { len, "message" }
+ s Set welcome message { 0x0018, no.of blocks, { block } * }
+ where block: see 0x05/0x0017
+ r Set welcome OK { 0x0019, 0x01 }
+ s Get profile name { 0x001a, nr }
+ where nr: see 0x05/0x0013
+ r Profile name { 0x001b, 1, 1, 3, flen, nr, len, {text} }
+ where nr: see 0x05/0x0013
+ len: text length
+ flen len + len(nr, len) = len + 2
+ Note: in Nokia 3310 name is in Unicode
+ s ??? { 0x001c }
+ r ??? { 0x001d, 0x93 }
+ s Set oplogo { 0x0030, location, MCC1, MCC2, MNC, lenhi=0x00, lenlo=0x82, OTABitmap }
+ r Set oplogo OK { 0x0031 }
+ r Set oplogo error { 0x0032, reason }
+ where reason: 0x7d invalid location
+ s Get oplogo { 0x0033, location }
+ where location: 1 (doesn't seem to matter)
+ r Get oplogo { 0x0034, location, MCC1, MCC2, MNC, lenhi=0x00, lenlo=0x82, OTABitmap }
+ r Get oplogo error { 0x0035, reason }
+ where reason: 0x7d invalid location
+ s Set ringtone { 0x0036, location,0x00,0x78, ringtone packed according to SM2.0}
+ r Set ringtone OK { 0x0037 }
+ r Set ringtone error { 0x0038, reason }
+ where reason=0x7d, when not supported location
+ s Get services settings { 0x0080, setting (2 bytes) }
+ where: setting: 0x02,0x00=Nokia access number 1
+ 0x02,0x01=Operator access number 1
+ 0x01,0x00=Personal bookmark 1 settings (name only ?)
+ 0x01,0x01=?
+ 0x02,0x02=?
+ r Get services sett.OK { 0x0081, .... }
+ r Get services sett.err { 0x0082, 0x7b }
+ 0x06: Calling line restriction/Call forwarding etc
+ r Get call divert { 0x0001, 0x02, x, 0x00, divtype, 0x02, calltype, y, z, 0x0b, number, 0x00...0x00, timeout (byte 45) }
+ s Set call divert { 0x0001, 0x03, 0x00, divtype, calltype, 0x01, number(packed like in SMS), 0x00 ... 0x00,
+ length of number (byte 29), 0x00 ... 0x00, timeout (byte 52), 0x00, 0x00, 0x00}
+ NOTE: msglen=0x37
+ where timeout:
+ 0x00: not set ?
+ 0x05: 5 second
+ 0x0a: 10 second
+ 0x0f: 15 second
+ 0x14: 20 second
+ 0x19: 25 second
+ 0x1e: 30 second
+ where divtype:
+ 0x02: all diverts for all call types ?
+ Found only, when deactivate all diverts for all call types (with call type 0x00)
+ 0x15: all calls
+ 0x43: when busy
+ 0x3d: when not answered
+ 0x3e: if not reached
+ calltype:
+ 0x00: all calls (data, voice, fax)
+ 0x0b: voice calls
+ 0x0d: fax calla
+ 0x19: data calls
+ s Deactivate calldiverts{ 0x0001, 0x04, 0x00, divtype, calltype, 0x00 }
+ where divtype, calltype: see above
+ r Deactivate calldiverts{ 0x0002, 0x04, 0x00, divtype, 0x02, calltype, data }
+ s Get call diverts { 0x0001, 0x05, 0x00, divtype, calltype, 0x00 }
+ where divtype, calltype: see above
+ r Get call diverts ok { 0x0002, 0x05, 0x00, divtype, 0x02, calltype, data }
+ where divtype, calltype: see above
+ data: { 0x01, 0x00 } - isn't active
+ { 0x02, 0x01, number(packed like in SMS), 0x00, 0x00..., timeout }
+ r Get prepaid(?) info { 0x0005, ?,?,?,length,message(packed like in 7bit SMS)}
+ r Call diverts active { 0x0006, ??? }
+ 0x07:
+ s ??? { 0x0022, ? (1&2 sounds OK) }
+ r ??? OK { 0x0023, ?,?,? }
+ r ??? error { 0x0024, reason }
+ s ??? { 0x0025, ??? }
+ r ??? OK { 0x0026, ??? }
+ r ??? error { 0x0027, reason }
+ 0x08: Security codes
+ s Change code { 0x0004, code, "current", 0x00, "new", 0x00 }
+ where code: 1: security code (5 chars)
+ 2: PIN (4 chars)
+ 3: PIN2 (4 chars)
+ 4: PUK (8 chars)
+ 5: PUK2 (8 chars)
+ s Status request { 0x0007, 0x01 }
+ r pin recvd { 0x0008, accepted }
+ where accepted: 0x0c (or 0x06): OK
+ code: waiting for (0x08/0x0004) code
+ s entering code { 0x000a, code, "code", 0x00 }
+ where code: see 0x08/0x0004
+ 0x09: SIM login
+ r login { 0x0080 }
+ r logout { 0x0081 }
+ 0x0a: Network status
+ s Key duplication on/off{ 0x0044, on? 0x01: 0x02 }
+ s get used network { 0x0070 }
+ r network registration { 0x0071, ?,?,?,length,netstatus,netsel,cellIDH,cellIDL,lacH,lacL,netcode,netcode,netcode }
+ 0x0c: Keys
+ s Get key assignments { 0x0040, 0x01 }
+ r Get key assignments { 0x0041, {key '1'}, 0x00, {key '2'} ... {key '0'}, 0,0,0, {symbols}, 0 }
+ where {key '0'} => ' ', '0'
+ s Press key { 0x0042, press: 0x01; release: 0x02, button, 0x01 }
+ where button: 0x01 - 0x09: 1-9
+ 0x0a: 0
+ 0x0b: #
+ 0x0c: *
+ 0x0d: Power
+ 0x0e: Pick up phone
+ 0x0f: Hang
+ 0x10: Volume +
+ 0x11: Volume -
+ 0x17: Up
+ 0x18: Down
+ 0x19: Menu
+ 0x1a: Names
+ 0x1B onwards: don't know but they do produce
+ a beep and light up the keypad as if
+ a key had been pressed.
+ r Press key ack { 0x0043, press/release/error(0x05) }
+ s ??? { 0x0044 }
+ r ??? ack { 0x0045, 0x01 }
+ 0x0d: Status
+ r Display { 0x0050, 0x01, y, x, len, "string"(unicode) }
+ s Status request { 0x0051 }
+ r Status { 0x0052, no. of byte pairs, {byte pair} }
+ where {byte pair}: {cmd, 1:off 2:on}
+ cmd: 1: call in progress
+ 2: ???
+ 3: have unread sms
+ 4: voice call active
+ 5: fax call active
+ 6: data call active
+ 7: key lock active
+ 8: is SMS storage full
+ s Display status { 0x0053, 1:on 2:off }
+ (will send displayed messages with x,y coordinates)
+ r Display status ack { 0x0054, 1 }
+ 0x11: Phone clock & alarm
+ s set date and time { 0x0060, 1,1,7,yearh,yearl,month,mday,hour,min,0x00 }
+ r date and time set { 0x0061 }
+ s get date and time { 0x0062 }
+ r date and time recvd { 0x0063,date_set?,time_set?,?,?,yearh,yearl,month,mday,hour,min,second }
+ where: date_set & time_set==0x01 - set
+ 0x00 - not set, ?,?,yearh,yearl,month,mday,hour,min,second
+ not available in frame
+ s set alarm { 0x006b, 1,32,3,0x02(on-off),hour,min,0x00 }
+ r alarm set { 0x006c }
+ s get alarm { 0x006d }
+ r alarm received { 0x006e,?,?,?,?,alrm(==2:on),hour,min }
+ 0x12: Connect to NBS port (61xx only ?)
+ s Send {+0x0c, 0x01, UDH header, data}
+ (without 0,1 header -- for oplogo, cli, ringtone etc upload)
+ where: UDH header = 0x06, 0x05, 0x04,destporth,destportl,srcporth,srcportl
+ 0x13: Calendar notes
+ s Write calendar note { 0x0064, 0x01, 0x10, length, type, yearH, yearL, month, day, hour, timezone,
+ alarm?(alarm yearH, yearL, month, day, hour, timezone): (0,0,0,0,0,0),
+ textlen, "text" }
+ r Write cal.note report { 0x0065, return }
+ where return: 0x01: ok
+ 0x73: failure
+ 0x81: calendar functions busy. Exit Calendar menu and try again
+ s Calendar notes set { 0x0066... }
+ r Calendar note recvd { 0x0067, 0x01, ?, length, type, yrH,yrL,mon,day,hr,tz,alrm yrH,yrL,mon,day,hr,tz,textlen, "text" }
+ r Cal.note recvd error { 0x0067, err }
+ where err: 0x93: not available
+ (0x01: OK)
+ other: error
+ s Delete cal.note { 0x0068, location }
+ r Del. cal.note report { 0x0069, err }
+ where err: 0x01: OK
+ 0x93: cannot delete
+ 0x14: SMS funcs
+ s Write SMS to SIM { 0x0004, .... }
+ s Mark SMS as read { 0x0007, 0x02, location, 0x00, 0x64 }
+ r SMS message frame rcv { 0x0008,subtype,?,num,?,BCD(smscenter)...} 20->type, 22->status
+ where type: 0x06: delivery report
+ status: 0x00: delivered
+ 0x30: pending
+ 0x46: failed
+ 0x09: reading failed
+ subtype: 0x02: invalid mem type
+ 0x07: empty SMS location
+ 0x0c: no access to memory (no PIN in card, etc.)
+ s Delete SMS message { 0x000a, 0x02, location }
+ r Delete OK { 0x000b }
+ s SMS status request { 0x0036, 0x64 }
+ r SMS status { 0x0037,?,?,?,?,?,?,msgnumber,unread }
+ r SMS status error { 0x0038 }
+ 0x3f: WAP
+ s Enable WAP frames { 0x0000}
+ r Enable WAP frames { 0x0002, 0x01}
+
+ s ?? { 0x0003}
+ r ?? { 0x0004}
+
+ s Get WAP bookmark { 0x0006, 0x00, location}
+ where location: 0 - 14
+ r Get WAP bookmark { 0x0007, 0x00, name_len, name(unicode),
+ url_len, url(unicode), 0x01,0x80,0x00[7]}
+ r Get WAP bookmark err { 0x0008, error }
+ where error:
+ 0x00(?)invalid position
+ 0x01 user inside "Bookmarks" menu. Must leave it
+ 0x02 invalid/too high/empty location
+
+ s Set WAP bookmark { 0x0009, 0xff, 0xff, name_len, name(unicode),
+ url_len, url(unicode), 0x01,0x80,0x00[7] }
+ Note: bookmark is added to the first free location.
+ r Set WAP bookmark OK {+0x01, 0x36, 0x0a, block }
+ where block:
+ 0x0a, location_of_just_written_bookmark(?),
+ 0x00, next_free_location(?)
+ r Set WAP bookmark err {+0x01, 0x36, 0x0b, error }
+ where error:
+ 0x04 - memory is full
+ 0x01 - we are in the bookmark menu
+ 0x00 - unknown reason for now ;(
+
+ ? s Delete WAP bookmark { 0x000c, 0x00, location }
+ where: location = 0-14
+ ? r Delete WAR bookmark OK{ 0x000d }
+ ? r Delete WAPbookmark err{ 0x000e, 0x02 }
+
+ s ?? { 0x000F}
+ r ?? { 0x0010, 0x00}
+
+ s Get WAP settings 1 { 0x0015, location}
+ where location: 0x00 - 0x05
+ r Get WAP settings 1 OK { 0x0016, title length, title (Unicode), URL length, URL(Unicode),con_type, ???[6 bytes],location, ???[5 bytes],security,...}
+ where:
+ con_type: 0x00 - temporary
+ 0x01 - continuous
+ location: when use "Get WAP settings 2 frame", must give it
+ security: 0x00 = no, 0x01 = yes
+ r Get WAP settings 1 err{ 0x0017, error }
+ where error:
+ 0x01 user inside "Settings" menu. Must leave it
+ 0x02 invalid/too high/empty location
+
+ s Get WAP settings 2 { 0x001b, location}
+ where location: 0x00 - 0x1d (you get it in "Get WAP settings 1" frame)
+ r Get WAP settings 2 OK { 0x001c, 0x01, type, frame...}
+ where type : 0x00 - SMS bearer
+ frame:
+ service_num_len, service_num (Unicode), server_num_len, server_num(Unicode)
+ 0x01 - data bearer
+ frame:
+ auth, call_type, call_speed, ?, IP len, IP (Unicode), dialup len, dialup (Unicode),
+ user len, user (Unicode), password len, password (Unicode)
+ where auth: 0x00 - normal, 0x01 - secure
+ call_type: 0x00 - analogue, 0x01 - ISDN
+ call_speed: 0x00 - 9600, 0x01 - 14400
+ 0x02 - USSD bearer
+ frame: type, service number len/IP len,service num (Unicode)/IP (Unicode),service code len,
+ service code (Unicode)
+ where type: 0x01 - service number, 0x00 - IP
+ r Get WAP settings 2 err{ 0x001d,error}
+ where: error=0x05
+ 0x40: Security commands
+ s ??? {+0x00, 0x00, 0x07, 0x11, 0x00, 0x10, 0x00, 0x00}
+ This frame hangs phone (N3310 4.02). Meaning unknown !
+ s Open simlock 1 { 0x02, 0x03, 0x1f, 0x11, 0x01, 0x01, 0x10, 0x00}
+ r Open simlock 1 { 0x02 }
+ s ???(N6150) { 0x08, 0x00 }
+ r ???(N6150) { 0x08 }
+ s Enable extended cmds { 0x64, cmd }
+ where cmd: 0x00: off
+ 0x01: on
+ 0x02: enter service mode ?
+ 0x03: reset (doesn't ask for PIN again)
+ 0x04: reset (PIN is requested)
+ In 5110 makes reset without PIN
+ 0x06: CONTACT SERVICE!!! Don't try it!
+ s Reset phone settings { 0x65, value, 0x00 }
+ where value: 0x08 - reset UI (User Interface) settings
+ 0x38 - reset UI, SCM and call counters
+ 0x40 - reset test 36 in netmonitor
+ r Reset phone settings { 0x65, 0x00 }
+ s Get IMEI { 0x66 }
+ r Get IMEI { 0x66, 0x01, IMEI, 0x00}
+ s (ACD Readings)?(N6150 { 0x68 }
+ r (ACD Readings)?(N6150 { 0x68, ... }
+ s Get Product Profile
+ Settings { 0x6a}
+ r Get Product Profile
+ Settings { 0x6a, 4bytes with Product Profile Settings }
+ s Set Product Profile
+ Settings { 0x6b, 4bytes with Product Profile Settings }
+ r Set Product Profile
+ Settings OK ? { 0x6b }
+ s Get code { 0x6e, code }
+ where code: see 0x08/0x0004 (only sec.code is allowed)
+ r Get code { 0x6e, code, allowed, allowed? (sec code (text)) }
+ where code: see 0x08/0x0004
+ allowed: 0: no
+ 1: yes
+ s Set code { 0x6f, code, sec code(text), 0x00 }
+ where code: see 0x08/0x0004
+ s Start monitoring { 0x70, block }
+ where block(N6150):
+ 0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xf9,0x76,0x65,0x20,0x00,
+ 0x00,0x00,0x00,0x00,0x18,0x26,0x15,0x7d,0x0a,0x00,
+ 0xf5,0x82,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x77,0x80,
+ 0x77,0x80,0xf2,0x82,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x20
+ This block enables probably all possible monitored parameters.
+ After it phone sends 0x00 message type values
+ s Break monitoring { 0x71 }
+ r Break monitoring { 0x71 }
+ ? s ???? { 0x74, 0x01, 0x01, 0x0e }
+ ? r ???? { 0x74 }
+ s Call commands { 0x7c, block }
+ where where: command, (values)
+ command: 0x01
+ values: number(ASCII), 0x00 - makes voice call
+ command: 0x02 - answer call
+ command: 0x03 - release call
+ r Call commands { 0x7c, command }
+ s Netmonitor { 0x7e, field }
+ where: field: 00: next
+ F0: reset
+ F1: off
+ F2: field test menus
+ F3: developer menus
+ s Open simlock 2 { 0x81, 0x01, locknumber, 0x10, 0x10, 0x10, 0x10, 0x10 }
+ Note: sets simlock type to factory?
+ where locknumber: 1,2,4,8
+ s Open simlock 2 { 0x81, 0x01, locknumber }
+ where locknumber: 1,2,4,8
+ s Close simlock { 0x82, 0x01, locknumber, 0x00, 0x00, locksinfo(lock1,4,2,3), 0x00 }
+ where locknumber: 1,2,4,8
+ r Close simlock { 0x82, the rest like in 0x40/0x8a }
+ s Get simlock info { 0x8a, 0x00}
+ r Get simlock info { 0x8a, 0x00, 0x01, lockstype, locksclosed, 0x00, 0x00, locksinfo(lock1,4,2,3), counter1,counter2,counter4,counter4,0x00 }
+ where: lockstype: bit1,bit2,bit3,bit4 - if set, selected lock is user lock
+ locksclosed: bit1,bit2,bit3,bit4 - if set, selected lock is closed
+ counter1 - counter4: counters for locks
+ s Set downloaded OpName { 0x8b, 0x00, MCC1, MCC2, MNC, Name, 0x00 }
+ r SetdownloadedOpNameOK?{ 0x8b, 0x00, 0x01 }
+ s Get downloaded OpName { 0x8c, 0x00 }
+ r Get downloaded OpName { 0x8c, 0x00, 0x01, MCC1, MCC2, MNC, Name, 0x00,...}
+ s Buzzer pitch { 0x8f, volume, hzLO, hzHI }
+ if volume and hz is 0, it's off
+ r Buzzer pitch { 0x8f}
+ s ACD Readings ? { 0x91, parameter?(0x02,0x03,0x04,0x05,0x07) }
+ r ACD Readings ? { 0x91, parameter?, value? }
+ s Sleep mode test { 0x92, 0x00, 0x00, howlong(2 bytes), enable }
+ where: enable == 0x01 - enable after test
+ 0x00 - don't enable after test
+ howlong (ms) = 0x07, 0xd0 = 2000
+ s ???(N6150) { 0x98, 0x00 }
+ r ???(N6150) { 0x98, 0x00, 0x04 }
+ s Get bin ringtone { 0x9e, location }
+ where: location=0,1,etc.
+ r Get bin ringtone { 0x9e, location, error, contents... }
+ where location=0,1,etc.
+ error=0x0a, ringtone NOT available
+ 0x00, OK
+ s Set bin ringtone { 0xa0, location, 0x00, contenst... }
+ where: location=0,1,etc.
+ r Set bin ringtone { 0xa0, location, error }
+ where location=0,1,etc.
+ error=0x0a, ringtone NOT set
+ 0x00, ringtone set OK
+ r Get MSid { 0xb5, 0x01, 0x2f, msid, 0x25 }
+ s Get info about phone { 0xc8, 0x01 }
+ r Get info about phone { 0xc8, 0x01, 0x00, "V ", "firmware", 0x0a, "firmware date", 0x0a, "model", 0x0a, "(c) NMP.", 0x00 }
+ s Get MCU SW Checksum { 0xc8, 0x02 }
+ r Get MCU SW Checksum { 0xc8, 0x02, 0x00, checksum (4 bytes),0x00 }
+ s DPS External SW { 0xc7, 0x03 }
+ r DSP External SW { 0xc7, 0x03, 0x00, string,0x00 }
+ s Get HW { 0xc8, 0x05 }
+ r Get HW { 0xc8, 0x05, 0x00, HW version (4 bytes), 0x00 }
+ s Get "Made" Date { 0xc8, 0x05 }
+ r Get "Made" Date { 0xc8, 0x05, 0x00, date(4 bytes), 0x00 }
+ s Get DSP Internal SW { 0xc8, 0x09 }
+ r Get DSP Internal SW { 0xc8, 0x09, 0x00, version (1 bytes), 0x00 }
+ s Get PCI version { 0xc8, 0x0b }
+ r Get PCI version { 0xc8, 0x0b, 0x00, version, 0x00 }
+ s Get system ASIC { 0xc8, 0x0c }
+ r Get system ASIC { 0xc8, 0x0c, 0x00, string, 0x00 }
+ s Get COBBA { 0xc8, 0x0d }
+ r Get COBBA { 0xc8, 0x0d, 0x00, string, 0x00 }
+ s Get PLUSSA { 0xc8, 0x0e }
+ r Get PLUSSA { 0xc8, 0x0e, available, 0x00 }
+ where available: 0x01: not available
+ s Get CCONT { 0xc8, 0x0f }
+ r Get CCONT { 0xc8, 0x0f, available, 0x00 }
+ where available: 0x01: not available
+ s Get PPM version { 0xc8, 0x10 }
+ r Get PPM version { 0xc8, 0x10, 0x00, "V ", "firmware", 0x0a, "firmware date", 0x0a, "model", 0x0a, "(c) NMP.", 0x00 }
+ s Get PPM info { 0xc8, 0x12 }
+ r Get PPM info { 0xc8, 0x12, 0x00, PPM version ("B", "C", etc.), 0x00 }
+ s Set HW version { 0xc9, 0x05, version, 0x00 }
+ s Get Product Code { 0xca, 0x01 }
+ r Get Product Code { 0xca, 0x01, 0x00, number, 0x00 }
+ s Get Order Number { 0xca, 0x02 }
+ r Get Order Number { 0xca, 0x02, 0x00, string, 0x00 }
+ s Get Prod.Ser.Number { 0xca, 0x03 }
+ r Get Prod.Ser.Number { 0xca, 0x03, 0x00, number, 0x00 }
+ s Get Basic Prod.Code { 0xca, 0x04 }
+ r Get Basic Prod.Code { 0xca, 0x04, 0x00, number, 0x00 }
+ s Set Product Code { 0xcb, 0x01, product code, 0x00 }
+ s Set Order Number { 0xcb, 0x02, number, 0x00 }
+ s Set Prod.Ser.Number { 0xcb, 0x03, number, 0x00 }
+ s Get (original ?)IMEI { 0xcc, 0x01 }
+ r Get (original ?)IMEI { 0xcc, 0x01, IMEI, 0x00 }
+ s Get Manufacture Month { 0xcc, 0x02 }
+ r Get Manufacture Month { 0xcc, 0x02, 0x00, string, 0x00 }
+ s Get Purchare date { 0xcc, 0x04 }
+ r Get Purchare date { 0xcc, 0x04, 0x00, string, 0x00 }
+ s Set "Made" date { 0xcd, 0x02, string, 0x00 }
+ s Make "all" phone tests{ 0xce,0x1d,0xfe,0x23,0x00,0x00}
+ s Make one phone test { 0xce,0x1d,num1,num2,num3,num4}
+ Where num1-num4: 0x02,0x00,0x00,0x00;
+ 0x04,0x00,0x00,0x00;
+ 0x08,0x00,0x00,0x00;
+ 0x10,0x00,0x00,0x00;
+ 0x20,0x00,0x00,0x00;
+ 0x40,0x00,0x00,0x00;
+ 0x80,0x00,0x00,0x00;
+ 0x00,0x01,0x00,0x00;
+ 0x00,0x02,0x00,0x00;
+ 0x00,0x04,0x00,0x00; - "Power off"
+ No test for "Security data"
+ 0x00,0x10,0x00,0x00;
+ 0x00,0x20,0x00,0x00;
+ 0x00,0x40,0x00,0x00;
+ 0x00,0x80,0x00,0x00;
+ 0x00,0x00,0x01,0x00;
+ ....
+ 0x00,0x00,0x10,0x00;
+ s Result of phone tests { 0xcf }
+ r Result of phone tests { 0xcf, number of tests, results of next tests }
+ s ??? { 0xd1 }
+ r ???(N5110) { 0xd1, 0x00, 0x1d, 0x00, 0x01, 0x08, 0x00 }
+ s LCD Test { 0xd3, value }
+ where value: 0x03, 0x02 - 1'st test
+ 0x03, 0x01 - 2'nd test
+ 0x02, 0x03 - clears screen
+ s ACD Readings(N6150)? { 0xd4, 0x02, 0x00, 0x02, 0x00, 0x0e, 0x01}
+ r ACD Readings(N6150)? { 0xd4, 0x02, 0x00, 0x02, 0x00, 0x0e, 0x01, ?}
+ s Get EEPROM { 0xd4, 0x02, 0x00, 0xa0, locationLo, locationHi, numofbytes }
+ where: numofbytes - how many bytes to read
+ Note: Works ONLY in MBUS
+ r Get EEPROM { 0xd4, 0x02, 0x00, 0xa0, locationLo, locationHi, numofbytes, contest... }
+ where numofbytes - how many bytes available
+ contest - bytes with contests (if numofbytes != 0)
+ 0x41: Snake game ?
+ 0x47:
+ s Get Picture Image { 0x0001, location }
+ r Get Picture Image when contains sender number
+ { 0x0002, location, number(like in SMS), 0x00, len, text, 0x00, width, height, 0x01, bitmap }
+ NOTE:
+ Supports only 0x81 and 0x91 coding (NOT alphanumeric numbers!)
+ in sender without sender number
+ { 0x0002, location, 0x00, 0x00, 0x00, len, text, 0x00, width, height, 0x01, bitmap }
+ s Set Picture Image { 0x0003, frame...}
+ where frame: see 0x47/0x0002
+ r Get/Set PictureImageOK{ 0x0004 }
+ r Set Picture Image err { 0x0005, error? }
+ where error=0x74 - wrong location ?
+ 0x64:
+ s Phone ID request { 0x0010 }
+ r Phone ID recvd { 0x0011, "NOKIA", "imei", 0, "model", 0, "prod.code", 0, "HW", 0, "firmware", magic bytes x 4 ... }
+ s Accessory connection { 0x0012, 16x0x00, 'NOKIA&NOKIA accessory', 3x0x00 } (45 bytes)
+ 0x7f: Acknowledge(FBUS/IRDA){+type, seq }
+ Acknowledge(MBUS)...
+ 0xd0:
+ s Power on message seq1 {+04 }
+ r Power on message seq1 {+05 }
+ 0xd1:
+ s Get HW&SW version { 0x0003, 0x00 }
+ 0xd2:
+ r Get HW&SW version { 0x0003 "V " "firmware\n" "firmware date\n"
+ "model\n" "(c) NMP." }
+ 0xda: ? (during playing 2 player snake)
+ 0xf0:
+ s Send RLP frame {+0x00, 0xd9, ... }
+ 0xf4: Power on message seq 2
diff --git a/docs/manual/protocol/n6510.rst b/docs/manual/protocol/n6510.rst
new file mode 100644
index 0000000..d662047
--- /dev/null
+++ b/docs/manual/protocol/n6510.rst
@@ -0,0 +1,806 @@
+Nokia 6510
+==========
+
+
+Assembled by
+Markus Plail <plail@web.de>
+Marcin Wiacek <Marcin@MWiacek.com>
+<tibor.harsszegi@essnet.se>
+... and other members of gnokii mailing list
+and authors of some WWW pages.
+
+Heavily based on nk7110.txt.
+
+The data provided is for information purposes only.
+Some of the frames might be hazardous to your phone. Be careful!!!
+We do not take any responsibility or liability for damages, etc.
+
+.. note ::
+
+ this information isn't (and can't be) complete. If you know anything
+ about features not listed here or you noticed a bug in this list, please
+ notify us via e-mail. Thank you.
+
+Document describing frames used in
+GSM Nokia 6510 and derivatives (?)
+
+Correct format is FBUS version 2/Infrared/MBUS version 2
+(see nokia.txt for protocol details)::
+
+ 0x00: Connect to NBS port ?
+ r Set ringtone {+....,ringtone packed according to SM2.0}
+
+ 0x01 COMMUNICATION
+ switch (message[3]) {
+ case 0x02:
+ dprintf("Call established, remote phone is ringing.\n");
+ dprintf("Call ID: %i\n", message[4]);
+ break;
+ case 0x03:
+ dprintf("Call complete.\n");
+ dprintf("Call ID: %i\n", message[4]);
+ dprintf("Call Mode: %i\n", message[5]);
+ dummy = malloc(message[6] + 1);
+ DecodeUnicode(dummy, message + 7, message[6]);
+ dprintf("Number: %s\n", dummy);
+ break;
+ case 0x04:
+ dprintf("Hangup!\n");
+ dprintf("Call ID: %i\n", message[4]);
+ dprintf("Cause Type: %i\n", message[5]);
+ dprintf("Cause ID: %i\n", message[6]);
+ break;
+ case 0x05:
+ dprintf("Incoming call:\n");
+ dprintf("Call ID: %i\n", message[4]);
+ dprintf("Call Mode: %i\n", message[5]);
+ dummy = malloc(message[6] + 1);
+ DecodeUnicode(dummy, message + 7, message[6]);
+ dprintf("From: %s\n", dummy);
+ break;
+ case 0x07:
+ dprintf("Call answer initiated.\n");
+ dprintf("Call ID: %i\n", message[4]);
+ break;
+ case 0x09:
+ dprintf("Call released.\n");
+ dprintf("Call ID: %i\n", message[4]);
+ break;
+ case 0x0a:
+ dprintf("Call is being released.\n");
+ dprintf("Call ID: %i\n", message[4]);
+ break;
+ case 0x0b:
+ /* No idea what this is about! */
+ break;
+ case 0x0c:
+ if (message[4] == 0x01)
+ dprintf("Audio enabled\n");
+ else
+ dprintf("Audio disabled\n");
+ break;
+ case 0x53:
+ dprintf("Outgoing call:\n");
+ dprintf("Call ID: %i\n", message[4]);
+ dprintf("Call Mode: %i\n", message[5]);
+ dummy = malloc(message[6] + 1);
+ DecodeUnicode(dummy, message + 7, message[6]);
+ dprintf("To: %s\n", dummy);
+ break;
+
+
+ 0x02: SMS HANDLING
+ s Send SMS { 0x02, 0x00, 0x00, 0x00, 0x55, 0x55,
+ 0x01 (1 big block), 0x02 (submit), length (big block),
+ type, reference, PID, DCS, 0x00, # blocks,
+ blocks... }
+ r Send SMS { 0x03, 0x00, 0x01, 0x0c, 0x08, 0x00, 0x00, 0xdb, 0x55, 0x55, 0x00 }
+
+ s Get SMSC { 0x14, 0x01, 0x00 }
+ r Get SMSC { 0x15, format, 0x01, 0x0b, 0x28, # of SMSC, 0xf8, 0x00, validity, 0x55
+ #blocks,
+ blocks ...}
+
+ 0x03: PHONEBOOK HANDLING
+
+ s Get memory status { 0x03, 0x01, memory type, 0x55, 0x55, 0x55, 0x00}
+ where: memory type - see 0x03/0x07
+ r Get memory status { 0x04, 0x00, location, 0x00[7], 0x01, 0x10, 0x00, 0x00, 0x0c,
+ total_low, total_high, used_low, used_high, 0x01, 0x00, 0x00}
+
+ s Read memory { 0x07, 0x01, 0x01, 0x00, 0x01, 0x02, memory type,
+ 0x00, 0x00, 0x00, 0x00, location_low, location_high, 0x00, 0x00};
+
+ where MT: memory type
+ 0x01: (256) Dialled numbers
+ 0x02: (512) Missed calls
+ 0x03: (768) Received calls
+ 0x05: (500) telephone phonebook
+ 0x06: (160) SIM phonebook
+ 0x07: (10/0)
+ 0x08: (1/0)
+ 0x09: (4) voice mailbox
+ 0x0e: (10) speed dials
+ 0x10: (5) caller groups
+
+ r Read memory { 0x08, 0x00, 0x01,
+ code, 0x00, 0x00, z, xH, xL, yH, yL, 0x00[7], no.of blocks, { block } * }
+
+ where if code==0x0f && xH==0x34 - phonebook location not found
+ y: location
+ z: generic block size
+ block: {id, 0, 0, blocksize, block no.,
+ {contents}, 0x00}
+ id: 0x04 pointer to another memory location { 0xff?, yH, yL, xL,0x00[3] }
+ 0x07 name {len, (unicode)},
+ 0x08 email
+ 0x09 postal
+ 0x0a note {len, (unicode)}
+ 0x0b number {type, 0x00[3], len, (unicode)}
+ 0x0c ringtone {ringtone no., 0, 0}
+ 0x13 date for a called list (DC, RC, etc.)
+ 0x1b caller group graphic {width, height, 0, 0 {bitmap}}
+ 0x1c caller group graphic on? {(1: yes, 0: no), 0, 0}
+ 0x1e caller group number {number, 0, 0}
+ type: 0x0a: General,
+ 0x03: Mobile (office ?),
+ 0x06: Work,
+ 0x04: Fax,
+ 0x02: Home (mobile ?)
+
+ s Set mem location { 0x0b, 0x00, 0x01, 0x01, 0x00, 0x00, z,
+ 0x02, memory type, yH, yL, 0x00[7],
+ no.of blocks, { block }[no.of blocks] }
+ r Set mem location { 0x0c, 0?, 1?, code, 0?, 0?, z?, 0?, 0?,
+ yH, yL, xL }
+ where code:
+ 0x3d - wrong entry type
+
+ 0x08: SECURITY
+
+ s Get status { 0x11, 0x00 }
+ r Get status { 0x12, status, }
+ where status:
+ 0x01: waiting for Security Code
+ 0x07:
+ 0x02: waiting for PIN
+ 0x03: waiting for PUK
+ 0x05: PIN ok, SIM ok
+ 0x06: No input status
+ 0x16: No SIM
+ 0x1A: SIM rejected!
+
+ s Enter PIN { 0x07, 0x02, code, 0x00}
+ r Enter PIN { return code, reason }
+ where:
+ return code: 0x08 = success
+ 0x09 = failure
+ reason: 0x06 = PIN wrong
+
+ 0x0a: NETSTATUS
+
+ s Get Info { 0x00, 0x00 }
+ r Get Info { 0x01, 0x00, # blocks,
+ 0x00, length, 0x00, 0x02, status, length, operator name (unicode),
+ 0x09, length, LAC, LAC, 0x00, 0x00, CellID, CellID, NetworkCode (3 octets), ... }
+
+ s Get RF Level { 0x0b, 0x00, 0x02, 0x00, 0x00, 0x00 }
+ r GET RF Level { 0x0c, 0x00, 0x01, 0x04, 0x04, level, 0x5f }
+
+ s Get operator logo { 0x23, 0x00, 0x00, 0x55, 0x55, 0x55 }
+ r Get operator logo { 0x24, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x02, 0x0c, 0x08, netcode (3 octets), 0x02, 0x00, 0x00,
+ 0x1a, size, width, height, logo size (2 octets), logo size (2 octets), logo }
+
+ 0x10: SUBSCRIBE
+
+ s Subscribe Channel { 0x10, # channels, message types... }
+
+ 0x13 CALENDAR
+
+ s Add meeting note { 0x01, body like in subtype 0x1a...}
+ r Add meeting note { 0x02, location (2 bytes), status (2 bytes)}
+
+ s Add call note { 0x03, body like in subtype 0x1a...}
+ r Add call note { 0x04, location (2 bytes), status (2 bytes)}
+
+ s Add birthday note { 0x05, body like in subtype 0x1a...}
+ r Add birthday note { 0x06, location (2 bytes), status (2 bytes)}
+
+ s Add reminder note { 0x07, body like in subtype 0x1a...}
+ r Add reminder note { 0x08, location (2 bytes), status (2 bytes)}
+
+ s Delete calendar note { 0x0b, location (2 bytes) }
+ r Delete calendar note { 0x0c, location (2 bytes), ?, ?, ?, ? }
+
+ s Get calendar note { 0x19, location (2 bytes) }
+ r Calendar note recvd { 0x1a, location (2 bytes), entry type, 0x00, year (2 bytes), Month, Day, block}
+ where: entry type - 0x01 - Meeting, 0x02 - Call, 0x04 - Birthday, 0x08 - Reminder
+ block: for Meeting:{hour,minute,alarm (two bytes),recurrence (two bytes),len,0x00,string(unicode)}
+ where alarm=Number of minutes before the time of the meeting
+ that the alarm should be triggered:
+ For meetings with "No alarm"=0xFFFF (-1).
+ For "On time"=0x0000
+ half an hour=0x001E, and so on.
+ Recurrence=in hours, between future occurrences of this meeting.
+ If there is no repeat, this value is 0x0000. The special value 0xffff
+ means 1 Year!
+ for Call:{Hour,Minute,Alarm (as above),Recurrence (as above),namelen,numberlen,
+ name(unicode),number(unicode)}
+ for Reminder:{Recurrence (as above),len,0x00,string(unicode)}
+ for Birthday:{byte1,byte2,alarm(4 bytes),yearofbirth,alarmtype,len,string(unicode)}
+ byte1 and byte2 may vary (???). Usually are 0x00 both (but not always)
+ In Birthday, the Year in the common part, usually contains a strange year.
+ So, don't consider it as Year of note, neither year of BirthDay (for Year of
+ Birthday use the value described below).
+ where alarm=32-bit integer that is the number of seconds between the desired
+ alarm time and 11:59:58pm on the birthday.For "No Alarm", the value is
+ 0x0000FFFF (65535).
+ YearOfBirth=used instead of the one in the common part of the entry (see above)
+ but only when reading birthday entries. For storing entries, this field does
+ not exist.
+ AlarmType: 0x00 - Tone, 0x01 - Silent
+
+ ? s??? { 0x0021 }
+ ? r??? { 0x0022, 0x5A, 0x00 }
+ ? s??? { 0x0025 }
+ ? r??? { 0x0026, 0x04, 0x00 }
+ ? s { 0x0029 }
+ ? r { 0x002A, 0x04, 0x00 }
+
+ s Get first free pos { 0x0031 }
+ r Get first free pos { 0x0032, location (2bytes) }
+
+ s Get notes info { 0x003a, 0xFF, 0xFE}
+ r Get notes info { 0x003b, how many notes used (2 bytes), 0x01, 0x07, { two bytes with location for each note} *}
+
+ s Get first free pos { 0x0031 }
+ r Get first free pos { 0x0032, location (2bytes) }
+ s Get notes info { 0x003a, 0xFF, 0xFE}
+ r Get notes info { 0x003b, how many notes used (2 bytes), 0x01, 0x07, { two bytes with location for each note} *}
+
+ ? s Get calendar note?? { 0x003E, location (2 bytes) }
+ ? r Get calendar note?? { 0x003F, location (2bytes), ... }
+
+ 0x14: FOLDER/PICTURE SMS HANDLING
+
+ s Get SMS Status { 0x08, 0x00, 0x01 }
+ r Get SMS Status { 0x09, 0x00, #blocks,
+ type, length, blocknumber,
+ a (2 octets), b (2 octets), c (2 octets), 0x00, 0x55 ,
+ type, length, blocknumber,
+ d (2 octets), e (2 octets), f (2 octets), 0x01, 0x55 }
+
+ where:
+ a - max. number of messages in phone memory
+ b - Number of used messages in phone memory. These
+ are messages manually moved from the other folders.
+ Picture messages are saved here.
+ c - Number of unread messages in phone memory. Probably
+ only smart messages.
+ d - max. number of messages on SIM
+ e - Number of used messages in SIM memory. These are
+ either received messages or saved into Outbox/Inbox.
+ Note that you *can't* save message into this memory
+ using 'Move' option. Picture messages are not here.
+ f - Number of unread messages in SIM memory
+
+
+
+ s Get SMS from folder { 0x02, memory, folderID, location, location, 0x01, 0x00}
+ where:
+ memory - 0x01 for SIM, 0x02 for phone (SIM only for IN/OUTBOX
+ folderID - see 0x14/0x017B
+ r Get SMS from folder { 0x03, 0x00, 0x01, memory, folderID, locationH, locationL, 0x55, 0x55, 0x55,
+ 0x01 (on big block), type, length of big block,
+ [date/time1], [date/time2], # blocks,
+ type, length, data...
+ ... }
+
+ s Delete SMS { 0x04, memory, folderID, location, location, 0x0F, 0x55 }
+ r Delete SMS { 0x05 }
+
+ s Get folder status { 0x0c, memory, folderID, 0x0F, 0x55, 0x55, 0x55, 0x55}
+ where: folderID - see 0x14/0x017B
+ r Get folder status { 0x0d, 0x00, length, number of entries (2 bytes),
+ entry1number (2 bytes), entry2number(2 bytes), ..., 0x55[]}
+
+ s Get message info { 0x0e, memory, folderID, location, location, 0x55, 0x55 }
+ r Get message info { 0x0f, 0x00, 0x01, 0x00, 0x50, memory, type, 0x00, location, FolderID, status
+
+ where: type = 0x00 - MT
+ 0x01 - delivery report
+ 0x02 - MO
+ 0x80 - picture message
+ where: status=0x01 - reveived/read
+ 0x03 - received/unread
+ 0x05 - stored/sent
+ 0x07 - stored/not sent
+
+ s Get folder names { 0x12, 0x00, 0x00}
+ r Get folder names { 0x13, 0x00, number of strings, 0x01, 0x28, folderID, length, 0x00, name1, 0x00,
+ 0x55[40-length(name1)], 01 28, folderID, length, 0x00, name2, 0x00, 0x55[dito] ... }
+ where: folderID = 0x02 - Inbox
+ 0x03 - Outbox
+ 0x04 - Archive
+ 0x05 - Templates
+ 0x06 - first "My folders"
+ 0x07 - second "My folders"
+ 0x08 - third -"-
+ and so on
+
+ 0x15:
+ s ??? {+0x00, 0x06, 0x00, 0x01, 0x01, 0x00 }
+ r ??? {+0x06, ',', 0x00, 'd', 0x00, 0x00 }
+ s ??? {+0x00, 0x06, 0x00, 0x02, 0x00, 0x00 }
+ r ??? {+0x06, '.', 0x00, 'e', ?, ? }
+
+ 0x17: BATTERY
+
+ s Get battery level { 0x0a, 0x02, 0x00 }
+ r Get battery level { 0x0b, 0x01, 0x01, 0x16, level, 0x07, 0x05 }
+ where: level: 1-7 (as in phone display)
+
+ 0x19: CLOCK
+
+ s Get ???? {0x01,...}
+ r Get ???? {0x02,...}
+
+ s Get date { 0x0a, 0x00, 0x00 }
+ r Get date { 0x0b, 0x00, 0x02 (blocks),
+ 0x01 (type), 0x0c (length), 0x01, 0x03, year (2 octets), month, day, hour, minute, second, 0x00,
+ 0x04, 0x04, 0x01, 0x00 }
+
+ s Get ???? {0x0c, 0x00, 0x00}
+ r Get ???? {0x0d..}
+ s Get ???? {0x11,...}
+ r Get ???? {0x12,...}
+
+ 0x1b: IDENTIFY
+
+ s Get IMEI {+0x00, 0x01, 0x01, 0x00, 'A', 0x00, 0x00, 0x00 }
+ r Get IMEI { 0x01, 0x00, 0x01, 'A', 0x14, 0x00, 0x10, {IMEI(ASCII)}, 0x00 }
+ s Get IMEI {+0x00, 0x03, 0x01, 0x00, 'A', 0x00, 0x00, 0x00 }
+ r Get IMEI { 0x01, 0x00, 0x01, 'A', 0x14, 0x00, 0x10, {IMEI(ASCII)}, 0x00 }
+ s Get ??? {+0x00, 0x03, 0x00, 0x00, 'D', 0x00, 0x00, 0x00 }
+ r Get ??? { 0x01, 0x02, 0x00 }
+
+ s Get HW version {+0x00, 0x03, 0x02, 0x07, 0x00, 0x02 }
+ r Get HW version { 0x08, 0x00, 0x01, 'I', 0x0c, 0x00, 0x05, HW(4 bytes), 0x00, 0x00, 0x00, 0x00 }
+
+ s get HW&SW version { 0x07, 0x00, 0x01 }
+ r get HW&SW version { 0x08, 0x00, 0x01, 0x58, 0x29, 0x00, 0x22, "V " "firmware\n" "firmware date\n"
+ "model\n" "(c) NMP.", 0x0a, 0x43, 0x00, 0x00, 0x00 }
+
+ s Get product code {+0x00, 0x03, 0x04, 0x0b, 0x00, 0x02 }
+ r Get product code { 0x0c, 0x00, 0x01, 'N', 0x0c, 0x00, 0x08, code(7 bytes), 0x00 }
+ s ??? {+00 |03 |05 |0b |00 |20}
+ r ??? {+03 |2b+|05 |0c |00 |01 |52R|0c |00 |08 |00 |00 |00 |00 |00 |00 | 00 |00}
+ s Get ??? {+00 |03 |06 |0b |00 |01}
+ r Get ??? {+03 |2b+|06 |0c |00 |01 |4dM|10 |00 |0a |53S|54T|41A|344|355|399|311|355|377|00 |00 |00}
+
+ Sending frame 0x1b / 0x0006
+ 00 |03 |07 |0b |00 |ff  ..... 
+ Received frame 0x1b / 0x0072
+ 03 |2b+|07 |0c |00 |08 |4dM|10 |00 |0a |53S|54T|41A|344|355|39 .+....M...STA459
+ 311|355|377|00 |00 |00 |4eN|0c |00 |08 |300|355|300|377|355|32 157...N...050752
+ 300|00 |50P|0c |00 |08 |00 |00 |00 |00 |00 |00 |00 |00 |4fO|0c 0.P...........O.
+ 00 |08 |300|355|300|333|366|366|366|00 |51Q|0c |00 |06 |00 |00 ..0503666.Q.....
+ 00 |00 |00 |00 |00 |00 |52R|0c |00 |08 |00 |00 |00 |00 |00 |00 ......R.........
+ 00 |00 |53S|0c |00 |5b[|00 |00 |00 |0d |00 |00 |00 |00 |59Y|14 ..S..[........Y.
+ 00 |10 |00 |00 |00 |00 |00 |00 |00 |00 |00 |00 |00 |00 |00 |00 ................
+ 00 |00 ..
+ Sending frame 0x1b / 0x0006
+ 00 |03 |08 |07 |01 |ff  ..... 
+ Received frame 0x1b / 0x00ae
+ 03 |2b+|08 |08 |00 |09 |48H|28(|00 |20 |56V|20 |300|344|2e.|30 .+....H(. V 04.0
+ 344|0a |322|399|2d-|311|300|2d-|300|311|0a |4eN|48H|4dM|2d-|37 4.29-10-01.NHM-7
+ 0a |28(|63c|29)|20 |4eN|4dM|50P|2e.|00 |00 |00 |00 |00 |49I|0c .(c) NMP......I.
+ 00 |05 |300|388|300|322|00 |00 |00 |00 |4aJ|0c |00 |05 |00 |00 ..0802....J.....
+ 00 |00 |00 |00 |00 |00 |4bK|08 |00 |03 |333|366|00 |00 |4cL|0c ......K...36..L.
+ 00 |04 |322|388|388|00 |00 |00 |00 |00 |54T|0c |00 |05 |300|31 ..288.....T...01
+ 300|355|00 |00 |00 |00 |55U|10 |00 |0a |47G|344|2e.|300|2d-|34 05....U...G4.0-4
+ 2e.|311|322|00 |00 |00 |57W|10 |00 |08 |53S|45E|49I|4bK|4fO|20 .12...W...SEIKO
+ 300|00 |00 |00 |00 |00 |58X|29)|00 |22"|56V|20 |300|344|2e.|30 0.....X)."V 04.0
+ 344|0a |322|399|2d-|311|300|2d-|300|311|0a |4eN|48H|4dM|2d-|37 4.29-10-01.NHM-7
+ 0a |28(|63c|29)|20 |4eN|4dM|50P|2e.|0a |44D|00 |00 |00 .(c) NMP..D...
+ Sending frame 0x1b / 0x0008
+ 00 |03 |09 |00 |41A|00 |00 |00 ....A...
+ Received frame 0x1b / 0x001a
+ 03 |2b+|09 |01 |00 |01 |41A|14 |00 |10 |333|355|300|377|300|30 .+....A...350700
+ 311|300|355|388|300|311|333|300|333|00 105801303.
+ Sending frame 0x1b / 0x0008
+ 00 |03 |0a |00 |42B|00 |00 |00 ....B...
+ Received frame 0x1b / 0x0012
+ 03 |2b+|0a |01 |00 |01 |42B|0c |00 |08 |3a:|05 |07 |10 |50P|08 .+....B...:...P.
+ 311|00 1.
+ Sending frame 0x1b / 0x0008
+ 00 |03 |0b |00 |43C|00 |00 |00 ....C...
+ Received frame 0x1b / 0x0016
+ 03 |2b+|0b |01 |00 |01 |43C|10 |00 |09 |333|05 |07 |10 |50P|08 .+....C...3...P.
+ 311|00 |f6÷|00 |00 |00 1.÷...
+ Sending frame 0x1b / 0x0008
+ 00 |03 |0c |00 |44D|00 |00 |00 ....D...
+ Received frame 0x1b / 0x0006
+ 03 |2b+|0c |01 |02 |00 .+....
+ Sending frame 0x1b / 0x0008
+ 00 |03 |0d |00 |45E|00 |00 |00 ....E...
+ Received frame 0x1b / 0x0006
+ 03 |2b+|0d |01 |02 |00 .+....
+ Sending frame 0x1b / 0x0008
+ 00 |03 |0e |00 |46F|00 |00 |00 ....F...
+ Received frame 0x1b / 0x0012
+ 03 |2b+|0e |01 |00 |01 |46F|0c |00 |08 |4eN|54T|54T|4aJ|50P|12 .+....F...NTTJP.
+ 344|56V 4V
+ Sending frame 0x1b / 0x0008
+ 00 |03 |0f |00 |56V|00 |00 |00 ....V...
+ Received frame 0x1b / 0x0006
+ 03 |2b+|0f |01 |02 |00 .+....
+ Sending frame 0x1b / 0x0008
+ 00 |03 |10 |00 |5aZ|00 |00 |00 ....Z...
+ Received frame 0x1b / 0x0006
+ 03 |2b+|10 |01 |02 |00 .+....
+ Sending frame 0x1b / 0x0006
+ 00 |03 |11 |0b |00 |02 ......
+ Received frame 0x1b / 0x0012
+ 03 |2b+|11 |0c |00 |01 |4eN|0c |00 |08 |300|355|300|377|355|32 .+....N...050752
+ 300|00 0.
+ Sending frame 0x1b / 0x0006
+ 00 |03 |12 |0b |00 |20 .....
+ Received frame 0x1b / 0x0012
+ 03 |2b+|12 |0c |00 |01 |52R|0c |00 |08 |00 |00 |00 |00 |00 |00 .+....R.........
+ 00 |00 ..
+ Sending frame 0x1b / 0x0006
+ 00 |03 |13 |0b |00 |01 ......
+ Received frame 0x1b / 0x0016
+ 03 |2b+|13 |0c |00 |01 |4dM|10 |00 |0a |53S|54T|41A|344|355|39 .+....M...STA459
+ 311|355|377|00 |00 |00 157...
+ Sending frame 0x1b / 0x0006
+ 00 |03 |14 |07 |00 |02 ......
+ Received frame 0x1b / 0x0012
+ 03 |2b+|14 |08 |00 |01 |49I|0c |00 |05 |300|388|300|322|00 |00 .+....I...0802..
+ 00 |00 ..
+
+ s Get IMEI { 0x00, 0x41 }
+ r Get IMEI { 0x01, 0x00, 0x01, 0x41, 0x14, 0x00, 0x10, {IMEI(ASCII)}, 0x00 }
+
+ Sending frame 0x1b / 0x0008
+ 00 |03 |16 |00 |44D|00 |00 |00 ....D...
+ Received frame 0x1b / 0x0006
+ 03 |2b+|16 |01 |02 |00 .+....
+ Sending frame 0x1b / 0x0006
+ 00 |03 |17 |07 |00 |01 ......
+ Received frame 0x1b / 0x002e
+ 03 |2b+|17 |08 |00 |01 |48H|28(|00 |20 |56V|20 |300|344|2e.|30 .+....H(. V 04.0
+ 344|0a |322|399|2d-|311|300|2d-|300|311|0a |4eN|48H|4dM|2d-|37 4.29-10-01.NHM-7
+ 0a |28(|63c|29)|20 |4eN|4dM|50P|2e.|00 |00 |00 |00 |00 .(c) NMP......
+ Sending frame 0x1b / 0x0006
+ 00 |03 |18 |07 |00 |01 ......
+ Received frame 0x1b / 0x002e
+ 03 |2b+|18 |08 |00 |01 |48H|28(|00 |20 |56V|20 |300|344|2e.|30 .+....H(. V 04.0
+ 344|0a |322|399|2d-|311|300|2d-|300|311|0a |4eN|48H|4dM|2d-|37 4.29-10-01.NHM-7
+ 0a |28(|63c|29)|20 |4eN|4dM|50P|2e.|00 |00 |00 |00 |00 .(c) NMP......
+ Sending frame 0x1b / 0x0006
+ 00 |03 |19 |07 |00 |01 ......
+ Received frame 0x1b / 0x002e
+ 03 |2b+|19 |08 |00 |01 |48H|28(|00 |20 |56V|20 |300|344|2e.|30 .+....H(. V 04.0
+ 344|0a |322|399|2d-|311|300|2d-|300|311|0a |4eN|48H|4dM|2d-|37 4.29-10-01.NHM-7
+ 0a |28(|63c|29)|20 |4eN|4dM|50P|2e.|00 |00 |00 |00 |00 .(c) NMP......
+ Sending frame 0x1b / 0x0006
+ 00 |03 |1a |07 |00 |01 ......
+ Received frame 0x1b / 0x002e
+ 03 |2b+|1a |08 |00 |01 |48H|28(|00 |20 |56V|20 |300|344|2e.|30 .+....H(. V 04.0
+ 344|0a |322|399|2d-|311|300|2d-|300|311|0a |4eN|48H|4dM|2d-|37 4.29-10-01.NHM-7
+ 0a |28(|63c|29)|20 |4eN|4dM|50P|2e.|00 |00 |00 |00 |00 .(c) NMP......
+ Sending frame 0x1b / 0x0006
+ 00 |03 |1b |07 |00 |01 ......
+ Received frame 0x1b / 0x002e
+ 03 |2b+|1b |08 |00 |01 |48H|28(|00 |20 |56V|20 |300|344|2e.|30 .+....H(. V 04.0
+ 344|0a |322|399|2d-|311|300|2d-|300|311|0a |4eN|48H|4dM|2d-|37 4.29-10-01.NHM-7
+ 0a |28(|63c|29)|20 |4eN|4dM|50P|2e.|00 |00 |00 |00 |00 .(c) NMP......
+ Sending frame 0x1b / 0x0006
+ 00 |03 |1c |07 |00 |01 ......
+ Received frame 0x1b / 0x002e
+ 03 |2b+|1c |08 |00 |01 |48H|28(|00 |20 |56V|20 |300|344|2e.|30 .+....H(. V 04.0
+ 344|0a |322|399|2d-|311|300|2d-|300|311|0a |4eN|48H|4dM|2d-|37 4.29-10-01.NHM-7
+ 0a |28(|63c|29)|20 |4eN|4dM|50P|2e.|00 |00 |00 |00 |00 .(c) NMP......
+ Sending frame 0x1b / 0x0006
+ 00 |03 |1d |07 |00 |01 ......
+ Received frame 0x1b / 0x002e
+ 03 |2b+|1d |08 |00 |01 |48H|28(|00 |20 |56V|20 |300|344|2e.|30 .+....H(. V 04.0
+ 344|0a |322|399|2d-|311|300|2d-|300|311|0a |4eN|48H|4dM|2d-|37 4.29-10-01.NHM-7
+ 0a |28(|63c|29)|20 |4eN|4dM|50P|2e.|00 |00 |00 |00 |00 .(c) NMP......
+ Sending frame 0x1b / 0x0006
+ 00 |03 |1e |07 |00 |01 ......
+ Received frame 0x1b / 0x002e
+ 03 |2b+|1e |08 |00 |01 |48H|28(|00 |20 |56V|20 |300|344|2e.|30 .+....H(. V 04.0
+ 344|0a |322|399|2d-|311|300|2d-|300|311|0a |4eN|48H|4dM|2d-|37 4.29-10-01.NHM-7
+ 0a |28(|63c|29)|20 |4eN|4dM|50P|2e.|00 |00 |00 |00 |00 .(c) NMP......
+
+ 0x1f: RINGTONE
+
+ s Get Ringtones { 0x07, 0x00, 0x00, 0xFE, 0x00, 0x7D }
+ r Get Ringtones { 0x08, 0x00, 0x23, 0x00, # ringtones, 0x00,
+ ringtone number, 0x01, 0x01, 0x00, name length (chars), name (unicode)... }
+
+
+ 0x2b:
+ s Get IMEI { 0x00, 0x41 }
+ r Get IMEI { 0x01, 0x00, 0x01, 0x41, 0x14, 0x00, 0x10, {IMEI(ASCII)}, 0x00 }
+ s get HW&SW version { 0x07, 0x00, 0x01 }
+ r get HW&SW version { 0x08, 0x00, 0x01, 0x58, 0x29, 0x00, 0x22, "V " "firmware\n" "firmware date\n"
+ "model\n" "(c) NMP.", 0x0a, 0x43, 0x00, 0x00, 0x00 }
+
+ 0x38:
+ s ??? {+00 |02 |00 |0a |00 |01 |00, location, 00}
+ where location: 0, 1, 2, 3
+ r ??? {+02 |1d |00 |0b |00 |01 |00, location, 08 |00 |00 |00 |00 |00}
+ s ???
+ 00 |02 |00 |0a |00 |60`|00 |10 |00 |11 |00 |12 |00 |13 |00 |14 .....`..........
+ 00 |15 |00 |16 |00 |17 |00 |18 |00 |19 |00 |1a |00 |1b |00 |1c ................
+ 00 |1d |00 |1e |00 |1f |00 |20 |00 |21!|00 |22"|00 |23#|00 |24 ....... .!.".#.$
+ 00 |25%|00 |26&|00 |27'|00 |28(|00 |29)|00 |2a*|00 |2b+|00 |2c .%.&.'.(.).*.+.,
+ 00 |2d-|00 |2e.|00 |2f/|00 |300|00 |311|00 |322|00 |333|00 |34 .-.../.0.1.2.3.4
+ 00 |355|00 |366|00 |377|00 |388|00 |399|00 |3a:|00 |3b;|00 |3c .5.6.7.8.9.:.;.<
+ 00 |3d=|00 |3e>|00 |3f?|00 |40@|00 |41A|00 |42B|00 |43C|00 |44 .=.>.?.@.A.B.C.D
+ 00 |45E|00 |46F|00 |47G|00 |48H|00 |49I|00 |4aJ|00 |4bK|00 |4c .E.F.G.H.I.J.K.L
+ 00 |4dM|00 |4eN|00 |4fO|00 |50P|00 |51Q|00 |52R|00 |53S|00 |54 .M.N.O.P.Q.R.S.T
+ 00 |55U|00 |56V|00 |57W|00 |58X|00 |59Y|00 |5aZ|00 |5b[|00 |5c .U.V.W.X.Y.Z.[.\
+ 00 |5d]|00 |5e^|00 |5f_|00 |60`|00 |61a|00 |62b|00 |63c|00 |64 .].^._.`.a.b.c.d
+ 00 |65e|00 |66f|00 |67g|00 |68h|00 |69i|00 |6aj|00 |6bk|00 |6c .e.f.g.h.i.j.k.l
+ 00 |6dm|00 |6en|00 |6fo|00 .m.n.o.
+ r ???
+ 02 |1d |00 |0b |00 |60`|00 |10 |04 |00 |00 |11 |0c |06 |00 |00 .....`..........
+ 00 |00 |00 |00 |00 |00 |00 |12 |04 |00 |00 |13 |04 |00 |00 |14 ................
+ 08 |00 |00 |00 |00 |00 |00 |15 |08 |00 |00 |00 |00 |00 |00 |16 ................
+ 08 |00 |00 |00 |00 |00 |00 |17 |08 |00 |00 |00 |00 |00 |00 |18 ................
+ 08 |00 |00 |00 |00 |00 |00 |19 |08 |00 |00 |00 |00 |00 |00 |1a ................
+ 08 |00 |00 |00 |00 |00 |00 |1b |08 |00 |00 |00 |00 |00 |00 |1c ................
+ 04 |00 |00 |1d |08 |04 |00 |00 |00 |00 |00 |1e |3c<|355|ff |ff ............<5  
+ ff |ff |ff |ff |ff |ff |ff |ff |ff |ff |ff |ff |ff |ff |ff |ff                 
+ ff |ff |ff |ff |ff |ff |ff |ff |ff |ff |ff |ff |ff |ff |ff |ff                 
+ ff |ff |ff |ff |ff |ff |ff |ff |ff |ff |ff |ff |ff |ff |ff |ff                 
+ ff |ff |ff |00 |00 |00 |00 |1f |08 |00 |00 |00 |00 |00 |00 |20    ............
+ 04 |00 |00 |21!|04 |00 |00 |22"|04 |00 |00 |23#|04 |00 |00 |24 ...!..."...#...$
+ 04 |00 |00 |25%|04 |00 |00 |26&|04 |00 |00 |27'|08 |00 |00 |00 ...%...&...'....
+ 00 |00 |00 |28(|08 |00 |00 |00 |00 |00 |00 |29)|08 |00 |00 |00 ...(.......)....
+ 00 |00 |00 |2a*|04 |00 |00 |2b+|0c |08 |00 |00 |00 |00 |00 |00 ...*...+........
+ 00 |00 |00 |2c,|04 |00 |00 |2d-|08 |00 |00 |00 |00 |00 |00 |2e ...,...-........
+ 08 |00 |00 |00 |00 |00 |00 |2f/|08 |00 |00 |00 |00 |00 |00 |30 ......./.......0
+ 08 |00 |00 |00 |00 |00 |00 |311|08 |00 |00 |00 |00 |00 |00 |32 .......1.......2
+ 08 |00 |00 |00 |00 |00 |00 |333|08 |00 |00 |00 |00 |00 |00 |34 .......3.......4
+ 08 |00 |00 |00 |00 |00 |00 |355|08 |00 |00 |00 |00 |00 |00 |36 .......5.......6
+ 08 |00 |00 |00 |00 |00 |00 |377|08 |00 |00 |00 |00 |00 |00 |38 .......7.......8
+ 08 |04 |00 |00 |00 |00 |00 |399|08 |04 |00 |00 |00 |00 |00 |3a .......9.......:
+ 08 |04 |00 |00 |00 |00 |00 |3b;|14 |10 |00 |00 |00 |00 |00 |00 .......;........
+ 00 |00 |00 |00 |00 |00 |00 |00 |00 |00 |00 |3c<|08 |00 |00 |00 ...........<....
+ 00 |00 |00 |3d=|08 |00 |00 |00 |00 |00 |00 |3e>|08 |00 |00 |00 ...=.......>....
+ 00 |00 |00 |3f?|08 |00 |00 |00 |00 |00 |00 |40@|08 |00 |00 |8e ...?.......@...Ä
+ 00 |00 |00 |41A|04 |00 |00 |42B|04 |00 |00 |43C|08 |00 |00 |00 ...A...B...C....
+ 00 |00 |00 |44D|08 |00 |00 |00 |00 |00 |00 |45E|08 |00 |00 |00 ...D.......E....
+ 00 |00 |00 |46F|08 |00 |00 |00 |00 |00 |00 |47G|08 |00 |00 |00 ...F.......G....
+ 00 |00 |00 |48H|08 |00 |00 |00 |00 |00 |00 |49I|08 |00 |00 |00 ...H.......I....
+ 00 |00 |00 |4aJ|08 |00 |00 |00 |00 |00 |00 |4bK|08 |00 |00 |00 ...J.......K....
+ 00 |00 |00 |4cL|08 |00 |00 |00 |00 |00 |00 |4dM|08 |00 |00 |00 ...L.......M....
+ 00 |00 |00 |4eN|08 |00 |00 |00 |00 |00 |00 |4fO|08 |00 |00 |00 ...N.......O....
+ 00 |00 |00 |50P|08 |00 |00 |00 |00 |00 |00 |51Q|08 |00 |00 |00 ...P.......Q....
+ 00 |00 |00 |52R|08 |00 |00 |00 |00 |00 |00 |53S|08 |00 |00 |00 ...R.......S....
+ 00 |00 |00 |54T|08 |00 |00 |00 |00 |00 |00 |55U|08 |00 |00 |00 ...T.......U....
+ 00 |00 |00 |56V|08 |00 |00 |00 |00 |00 |00 |57W|08 |00 |00 |00 ...V.......W....
+ 00 |00 |00 |58X|08 |00 |00 |00 |00 |00 |00 |59Y|08 |00 |00 |00 ...X.......Y....
+ 00 |00 |00 |5aZ|08 |00 |00 |00 |00 |00 |00 |5b[|08 |00 |00 |00 ...Z.......[....
+ 00 |00 |00 |5c\|08 |00 |00 |00 |00 |00 |00 |5d]|08 |00 |00 |00 ...\.......]....
+ 00 |00 |00 |5e^|08 |00 |00 |00 |00 |00 |00 |5f_|08 |00 |00 |00 ...^......._....
+ 00 |00 |00 |60`|08 |00 |00 |00 |00 |00 |00 |61a|08 |00 |00 |00 ...`.......a....
+ 00 |00 |00 |62b|08 |00 |00 |00 |00 |00 |00 |63c|08 |00 |00 |00 ...b.......c....
+ 00 |00 |00 |64d|08 |00 |00 |00 |00 |00 |00 |65e|08 |00 |00 |00 ...d.......e....
+ 00 |00 |00 |66f|08 |00 |00 |00 |00 |00 |00 |67g|08 |00 |00 |00 ...f.......g....
+ 00 |00 |00 |68h|08 |00 |00 |00 |00 |00 |00 |69i|08 |00 |00 |00 ...h.......i....
+ 00 |00 |00 |6aj|08 |00 |00 |00 |00 |00 |00 |6bk|08 |04 |00 |00 ...j.......k....
+ 00 |00 |00 |6cl|08 |04 |00 |00 |00 |00 |00 |6dm|08 |00 |00 |00 ...l.......m....
+ 00 |00 |00 |6en|08 |00 |00 |00 |00 |00 |00 |6fo|08 |00 |00 |00 ...n.......o....
+ 00 |00 ..
+ Sending frame 0x38 / 0x00c7
+ 00 |02 |00 |0a |00 |60`|00 |70p|00 |71q|00 |72r|00 |73s|00 |74 .....`.p.q.r.s.t
+ 00 |75u|00 |76v|00 |77w|00 |78x|00 |79y|00 |7az|00 |7b{|00 |7c .u.v.w.x.y.z.{.|
+ 00 |7d}|00 |7e~|00 |7f |00 |80Ç|00 |81ü|00 |82é|00 |83â|00 |84 .}.~...Ç.ü.é.â.ä
+ 00 |85ů|00 |86ć|00 |87ç|00 |88Å‚|00 |89ë|00 |8aÅ|00 |8bÅ‘|00 |8c .ů.ć.ç.Å‚.ë.Å.Å‘.î
+ 00 |8dŹ|00 |8eÄ|00 |8fĆ|00 |90É|00 |91Ĺ|00 |92ĺ|00 |93ô|00 |94 .Ź.Ä.Ć.É.Ĺ.ĺ.ô.ö
+ 00 |95Ľ|00 |96ľ|00 |97Ś|00 |98ś|00 |99Ö|00 |9aÜ|00 |9bŤ|00 |9c .Ľ.ľ.Ś.ś.Ö.Ü.Ť.ť
+ 00 |9dÅ|00 |9e×|00 |9fÄ|00 |a0á|00 |a1í|00 |a2ó|00 |a3ú|00 |a4 .Å.×.Ä.á.í.ó.ú.Ä„
+ 00 |a5ą|00 |a6Ž|00 |a7ž|00 |a8Ę|00 |a9ę|00 |aa¬|00 |abź|00 |ac .ą.Ž.ž.Ę.ę.¬.ź.Č
+ 00 |adş|00 |ae«|00 |af»|00 |b0 |00 |b1 |00 |b2 |00 |b3 |00 |b4 .ş.«.»..........
+ 00 |b5Ã|00 |b6Â|00 |b7Äš|00 |b8Åž|00 |b9 |00 |ba |00 |bb |00 |bc .Ã.Â.Äš.Åž........
+ 00 |bdŻ|00 |beż|00 |bf |00 |c0 |00 |c1 |00 |c2 |00 |c3 |00 |c4 .Ż.ż............
+ 00 |c5 |00 |c6Ă|00 |c7ă|00 |c8 |00 |c9 |00 |ca |00 |cb |00 |cc ...Ă.ă..........
+ 00 |cd |00 |ce |00 |cf¤|00 .....¤.
+ Received frame 0x38 / 0x0306
+ 02 |1d |00 |0b |00 |60`|00 |70p|08 |00 |00 |00 |00 |00 |00 |71 .....`.p.......q
+ 08 |00 |00 |00 |00 |00 |00 |72r|08 |00 |00 |00 |00 |00 |00 |73 .......r.......s
+ 08 |00 |00 |00 |00 |00 |00 |74t|08 |00 |00 |00 |00 |00 |00 |75 .......t.......u
+ 08 |00 |00 |00 |00 |00 |00 |76v|08 |00 |00 |00 |00 |00 |00 |77 .......v.......w
+ 08 |00 |00 |00 |00 |00 |00 |78x|08 |00 |00 |00 |00 |00 |00 |79 .......x.......y
+ 08 |00 |00 |00 |00 |00 |00 |7az|08 |00 |00 |00 |00 |00 |00 |04 .......z........
+ 08 |04 |00 |7b{|00 |00 |00 |04 |08 |04 |00 |7c||00 |00 |00 |04 ...{.......|....
+ 08 |04 |00 |7d}|00 |00 |00 |04 |08 |04 |00 |7e~|00 |00 |00 |04 ...}.......~....
+ 08 |04 |00 |7f |00 |00 |00 |04 |08 |04 |00 |80Ç|00 |00 |00 |04 ...........Ç....
+ 08 |04 |00 |81ü|00 |00 |00 |04 |08 |04 |00 |82é|00 |00 |00 |04 ...ü.......é....
+ 08 |04 |00 |83â|00 |00 |00 |04 |08 |04 |00 |84ä|00 |00 |00 |04 ...â.......ä....
+ 08 |04 |00 |85ů|00 |00 |00 |04 |08 |04 |00 |86ć|00 |00 |00 |04 ...ů.......ć....
+ 08 |04 |00 |87ç|00 |00 |00 |04 |08 |04 |00 |88ł|00 |00 |00 |04 ...ç.......ł....
+ 08 |04 |00 |89ë|00 |00 |00 |04 |08 |04 |00 |8aÅ|00 |00 |00 |04 ...ë.......Å....
+ 08 |04 |00 |8bő|00 |00 |00 |04 |08 |04 |00 |8cî|00 |00 |00 |04 ...ő.......î....
+ 08 |04 |00 |8dŹ|00 |00 |00 |04 |08 |04 |00 |8eÄ|00 |00 |00 |04 ...Ź.......Ä....
+ 08 |04 |00 |8fĆ|00 |00 |00 |04 |08 |04 |00 |90É|00 |00 |00 |04 ...Ć.......É....
+ 08 |04 |00 |91Ĺ|00 |00 |00 |04 |08 |04 |00 |92ĺ|00 |00 |00 |04 ...Ĺ.......ĺ....
+ 08 |04 |00 |93ô|00 |00 |00 |04 |08 |04 |00 |94ö|00 |00 |00 |04 ...ô.......ö....
+ 08 |04 |00 |95Ľ|00 |00 |00 |04 |08 |04 |00 |96ľ|00 |00 |00 |04 ...Ľ.......ľ....
+ 08 |04 |00 |97Åš|00 |00 |00 |04 |08 |04 |00 |98Å›|00 |00 |00 |04 ...Åš.......Å›....
+ 08 |04 |00 |99Ö|00 |00 |00 |04 |08 |04 |00 |9aÜ|00 |00 |00 |04 ...Ö.......Ü....
+ 08 |04 |00 |9bŤ|00 |00 |00 |04 |08 |04 |00 |9cť|00 |00 |00 |04 ...Ť.......ť....
+ 08 |04 |00 |9dÅ|00 |00 |00 |04 |08 |04 |00 |9e×|00 |00 |00 |04 ...Å.......×....
+ 08 |04 |00 |9fÄ|00 |00 |00 |04 |08 |04 |00 |a0á|00 |00 |00 |04 ...Ä.......á....
+ 08 |04 |00 |a1í|00 |00 |00 |04 |08 |04 |00 |a2ó|00 |00 |00 |04 ...í.......ó....
+ 08 |04 |00 |a3ú|00 |00 |00 |04 |08 |04 |00 |a4Ą|00 |00 |00 |04 ...ú.......Ą....
+ 08 |04 |00 |a5ą|00 |00 |00 |04 |08 |04 |00 |a6Ž|00 |00 |00 |04 ...ą.......Ž....
+ 08 |04 |00 |a7ž|00 |00 |00 |04 |08 |04 |00 |a8Ę|00 |00 |00 |04 ...ž.......Ę....
+ 08 |04 |00 |a9ę|00 |00 |00 |04 |08 |04 |00 |aa¬|00 |00 |00 |04 ...ę.......¬....
+ 08 |04 |00 |abź|00 |00 |00 |04 |08 |04 |00 |acČ|00 |00 |00 |04 ...ź.......Č....
+ 08 |04 |00 |adş|00 |00 |00 |04 |08 |04 |00 |ae«|00 |00 |00 |04 ...ş.......«....
+ 08 |04 |00 |af»|00 |00 |00 |04 |08 |04 |00 |b0 |00 |00 |00 |04 ...»............
+ 08 |04 |00 |b1 |00 |00 |00 |04 |08 |04 |00 |b2 |00 |00 |00 |04 ................
+ 08 |04 |00 |b3 |00 |00 |00 |04 |08 |04 |00 |b4 |00 |00 |00 |04 ................
+ 08 |04 |00 |b5Ã|00 |00 |00 |04 |08 |04 |00 |b6Â|00 |00 |00 |04 ...Ã.......Â....
+ 08 |04 |00 |b7Äš|00 |00 |00 |04 |08 |04 |00 |b8Åž|00 |00 |00 |04 ...Äš.......Åž....
+ 08 |04 |00 |b9 |00 |00 |00 |04 |08 |04 |00 |ba |00 |00 |00 |04 ................
+ 08 |04 |00 |bb |00 |00 |00 |04 |08 |04 |00 |bc |00 |00 |00 |04 ................
+ 08 |04 |00 |bdŻ|00 |00 |00 |04 |08 |04 |00 |beż|00 |00 |00 |04 ...Ż.......ż....
+ 08 |04 |00 |bf |00 |00 |00 |04 |08 |04 |00 |c0 |00 |00 |00 |04 ................
+ 08 |04 |00 |c1 |00 |00 |00 |04 |08 |04 |00 |c2 |00 |00 |00 |04 ................
+ 08 |04 |00 |c3 |00 |00 |00 |04 |08 |04 |00 |c4 |00 |00 |00 |04 ................
+ 08 |04 |00 |c5 |00 |00 |00 |04 |08 |04 |00 |c6Ä‚|00 |00 |00 |04 ...........Ä‚....
+ 08 |04 |00 |c7ă|00 |00 |00 |04 |08 |04 |00 |c8 |00 |00 |00 |04 ...ă............
+ 08 |04 |00 |c9 |00 |00 |00 |04 |08 |04 |00 |ca |00 |00 |00 |04 ................
+ 08 |04 |00 |cb |00 |00 |00 |04 |08 |04 |00 |cc |00 |00 |00 |04 ................
+ 08 |04 |00 |cd |00 |00 |00 |04 |08 |04 |00 |ce |00 |00 |00 |04 ................
+ 08 |04 |00 |cf¤|00 |00 ...¤..
+ Received frame 0x38 / 0x0306
+ 02 |1d |00 |0b |00 |60`|00 |04 |08 |04 |00 |d0Ä‘|00 |00 |00 |04 .....`.....Ä‘....
+ 08 |04 |00 |d1Ä|00 |00 |00 |04 |08 |04 |00 |d2ÄŽ|00 |00 |00 |04 ...Ä.......ÄŽ....
+ 08 |04 |00 |d3Ë|00 |00 |00 |04 |08 |04 |00 |d4Ä|00 |00 |00 |04 ...Ë.......Ä....
+ 08 |04 |00 |d5Ň|00 |00 |00 |04 |08 |04 |00 |d6Ã|00 |00 |00 |04 ...Ň.......Ã....
+ 08 |04 |00 |d7ÃŽ|00 |00 |00 |04 |08 |04 |00 |d8Ä›|00 |00 |00 |04 ...ÃŽ.......Ä›....
+ 08 |04 |00 |d9 |00 |00 |00 |04 |08 |04 |00 |da |00 |00 |00 |db ................
+ 08 |00 |00 |00 |00 |00 |00 |dc |08 |00 |00 |00 |00 |00 |00 |dd ...............Å¢
+ 08 |00 |00 |00 |00 |00 |00 |deÅ®|08 |00 |00 |00 |00 |00 |00 |df .......Å®........
+ 08 |00 |00 |00 |00 |00 |00 |e0Ó|08 |00 |00 |00 |00 |00 |00 |e1 .......Ó.......ß
+ 08 |00 |00 |00 |00 |00 |00 |e2Ô|08 |00 |00 |00 |00 |00 |00 |e3 .......Ô.......Ń
+ 08 |00 |00 |00 |00 |00 |00 |e4ń|08 |00 |00 |00 |00 |00 |00 |e5 .......ń.......ň
+ 08 |00 |00 |00 |00 |00 |00 |04 |08 |04 |00 |e6Å |00 |00 |00 |e7 ...........Å ...Å¡
+ 08 |00 |00 |00 |00 |00 |00 |e8Å”|08 |00 |00 |00 |00 |00 |00 |04 .......Å”........
+ 08 |04 |00 |e9Ú|00 |00 |00 |04 |08 |04 |00 |eaŕ|00 |00 |00 |04 ...Ú.......ŕ....
+ 08 |04 |00 |ebŰ|00 |00 |00 |04 |08 |04 |00 |ecý|00 |00 |00 |04 ...Ű.......ý....
+ 08 |04 |00 |edÃ|00 |00 |00 |04 |08 |04 |00 |eeÅ£|00 |00 |00 |04 ...Ã.......Å£....
+ 08 |04 |00 |ef´|00 |00 |00 |04 |08 |04 |00 |f0­|00 |00 |00 |04 ...´.......­....
+ 08 |04 |00 |f1 |00 |00 |00 |04 |08 |04 |00 |f2 |00 |00 |00 |04 ................
+ 08 |04 |00 |f3 |00 |00 |00 |04 |08 |04 |00 |f4 |00 |00 |00 |f5 ...............§
+ 08 |00 |00 |00 |00 |00 |00 |f6÷|08 |00 |00 |00 |00 |00 |00 |f7 .......÷.......¸
+ 08 |00 |00 |00 |00 |00 |00 |f8°|08 |00 |00 |00 |00 |00 |00 |04 .......°........
+ 08 |04 |00 |f9¨|00 |00 |00 |04 |08 |04 |00 |fa |00 |00 |00 |04 ...¨............
+ 08 |04 |00 |fbű|00 |00 |00 |04 |08 |04 |00 |fcŘ|00 |00 |00 |04 ...ű.......Ř....
+ 08 |04 |00 |fdÅ™|00 |00 |00 |04 |08 |04 |00 |fe |00 |00 |00 |04 ...Å™............
+ 08 |04 |00 |ff |00 |00 |00 |04 |08 |04 |01 |00 |00 |00 |00 |04 ... ............
+ 08 |04 |01 |01 |00 |00 |00 |04 |08 |04 |01 |02 |00 |00 |00 |04 ................
+ 08 |04 |01 |03 |00 |00 |00 |04 |08 |04 |01 |04 |00 |00 |00 |04 ................
+ 08 |04 |01 |05 |00 |00 |00 |04 |08 |04 |01 |06 |00 |00 |00 |04 ................
+ 08 |04 |01 |07 |00 |00 |00 |04 |08 |04 |01 |08 |00 |00 |00 |04 ................
+ 08 |04 |01 |09 |00 |00 |00 |04 |08 |04 |01 |0a |00 |00 |00 |04 ................
+ 08 |04 |01 |0b |00 |00 |00 |04 |08 |04 |01 |0c |00 |00 |00 |04 ................
+ 08 |04 |01 |0d |00 |00 |00 |04 |08 |04 |01 |0e |00 |00 |00 |04 ................
+ 08 |04 |01 |0f |00 |00 |00 |04 |08 |04 |01 |10 |00 |00 |00 |04 ................
+ 08 |04 |01 |11 |00 |00 |00 |04 |08 |04 |01 |12 |00 |00 |00 |04 ................
+ 08 |04 |01 |13 |00 |00 |00 |04 |08 |04 |01 |14 |00 |00 |00 |04 ................
+ 08 |04 |01 |15 |00 |00 |00 |04 |08 |04 |01 |16 |00 |00 |00 |04 ................
+ 08 |04 |01 |17 |00 |00 |00 |04 |08 |04 |01 |18 |00 |00 |00 |04 ................
+ 08 |04 |01 |19 |00 |00 |00 |04 |08 |04 |01 |1a |00 |00 |00 |04 ................
+ 08 |04 |01 |1b |00 |00 |00 |04 |08 |04 |01 |1c |00 |00 |00 |04 ................
+ 08 |04 |01 |1d |00 |00 |00 |04 |08 |04 |01 |1e |00 |00 |00 |04 ................
+ 08 |04 |01 |1f |00 |00 |00 |04 |08 |04 |01 |20 |00 |00 |00 |04 ........... ....
+ 08 |04 |01 |21!|00 |00 |00 |04 |08 |04 |01 |22"|00 |00 |00 |04 ...!......."....
+ 08 |04 |01 |23#|00 |00 |00 |04 |08 |04 |01 |24$|00 |00 |00 |04 ...#.......$....
+ 08 |04 |01 |25%|00 |00 |00 |04 |08 |04 |01 |26&|00 |00 |00 |04 ...%.......&....
+ 08 |04 |01 |27'|00 |00 |00 |04 |08 |04 |01 |28(|00 |00 |00 |04 ...'.......(....
+ 08 |04 |01 |29)|00 |00 |00 |04 |08 |04 |01 |2a*|00 |00 |00 |04 ...).......*....
+ 08 |04 |01 |2b+|00 |00 |00 |04 |08 |04 |01 |2c,|00 |00 |00 |04 ...+.......,....
+ 08 |04 |01 |2d-|00 |00 |00 |04 |08 |04 |01 |2e.|00 |00 |00 |04 ...-............
+ 08 |04 |01 |2f/|00 |00 .../..
+ Sending frame 0x38 / 0x000e
+ 00 |02 |00 |0c |00 |01 |00 |01 |08 |02 |05 |08 |00 |00 ..............
+ Received frame 0x38 / 0x0006
+ 02 |1d |00 |0d |00 |00 ......
+
+ 0x39: PROFILES
+
+ s Get Profile { 0x01, 0x01, 0x0c, 0x01,
+ 0x04 (length), profile #, 'feature', 0x01 }
+ r Get Profile { 0x02, 0x00, 0x0c, 0x02,
+ 0x09 (length), type, 0x01, 0x02, 0x00, 0x00, 0x01, value, 0x02 ... }
+
+ s Set Profile { 0x03, 0x01, # blocks, 0x03,
+ length, type, profile #, value, 0x00, 0x00, 0x01, value, 0x03 ... }
+ r Set Profile { 0x04, 0x01, # blocks,
+ length, 0xXX, type, 0xXX, value
+ where value: 0x00 = success
+
+ 0x3E: FM Radio
+ s Get FM Station { 0x00, 0x01, 0x00, 0x05, location, 0x00, 0x01}
+ r Get FM Station { 0x06, 0x00, 0x01, 0x00, 0x1c,
+ name_length, 0x14, 0x09, 0x00, location, 0x00, 0x00, 0x01,
+ FreqHI , FreqLO,
+ name_in_unicode,[0x55,0x55] - if name_length is odd}
+ where frequency = (0xffff + FreqHi * 0x100 + FreqLo) kHz
+
+ r Get FM Station { 0x16, 0x05, 0x06 } - if entry is empty
+
+ 0x42:
+ s ???? {+00 |07 |00 |01 |00 |02}
+ r ???? {+07 |2d-|00 |02 |06 |02 |00 |02 |00 |01 |02 |08 |00 |0c |07 |d1 |00 |00}
+
+ 0x42:
+ s Get ??? {+0x00, 0x07, 0x02, 0x01, 0x00, 0x01 }
+ r Get ??? { 02 |06 |02 |00 |02 |00 |01 |02 |08 |00 |0c |07 |d1 |00 |00}
+ s Get original IMEI ? {+0x00, 0x07, 0x02, 0x01, 0x00, 0x01 }
+ r Get original IMEI ? { 0x02, 0x06, 0x01, 0x01, 0x00, 0x01, 0x01, 0x18, 0x01, 0x00, IMEI, 0x00, 'U' }
+ s Get ??? {+0x00, 0x07, 0x03, 0x01, 0x00, 0x02 }
+ r Get ??? { 02 |06 |02 |00 |02 |00 |01 |02 |08 |00 |0c |07 |d1 |00 |00}
+ s Get ??? {+0x00, 0x07, 0x04, 0x01, 0x00, 0x10 }
+ r Get ??? { 02 |06 |10 |00 |10 |00 |01 |05 |08 |00 |00 |00 |00 | 00 |00}
+ s Get ??? {+0x00, 0x07, 0x05, 0x01, 0x00, 0x08 }
+ r Get ??? { 02 |06 |08 |00 |08 |00 |01 |04 |08 |00 |00 |00 |00 | 00 |00}
+ s Get ??? {+0x00, 0x07, 0x06, 0x01, 0x00, 0x20 }
+ r Get ??? { 02 |06 |20 |00 |20 |00 |01 |06 |04 |03 |00}
+
+ 0x43:
+ s ???? {+00 |08 |00 |01 |00 |00 |00 |00 |00, x}
+ where x = 0x01, 0x02, 0x04, 0x08, 0x10
+ r ???? {+08 |1f |y |02 |00 |00 |00 |00 }
+ where y = 0 - 0x04
+ s ??? {+00 |08 |05 |01 |00 |00 |00 |00 |00 |20}
+ r ??? {+08 |1f |05 |02 |00 |00 |00 |00}
+
+ 0x45: PHONEBOOK HANDLING ????
+ the same to msg 0x03 ????
+
+ 0x53:
+ s Get simlock info {0x0C}
+
+ 0x55: TODO
+ s Get TODO {0x03, 0x00, 0x00, 0x80, location low, location hi}
+ r Get TODO {0x04, .... }
+ s Get number of TODO {0x07}
+ r Get number of TODO {0x08, number lo, number hi}
+ s Delete all TODO {0x11}
+ r Delete all TODO {0x12}
+ s Get TODO locations {0x15, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00}
+ r Get TODO locations {0x16, ...}
+
+ 0x7a: STARTUP
+
+ s Get startup logo { 0x02, 0x0f }
+ r Get startup logo { 0x03, 0x0f, 0x00[4], # blocks,
+ 0xc0, 0x02, height (2 octets),
+ 0xc0, 0x03, width (2 octets),
+ 0xc0, 0x04, size (2 octets),
+ picture }
+
+ s Get startup greeting { 0x02, 0x01, 0x00 }
+ r Get startup greeting { 0x03, 0x01, 0x00, greeting (unicode), 0x00 }
+
+ s Get anykey answer { 0x02, 0x05, 0x00 }
+ r Get anykey answer { 0x03, 0x05, 0x00, 0x00/0x01 }
+
+ 0xd1:
+ s Get HW&SW version { 0x0003, 0x00 }
+ 0xd2:
+ r Get HW&SW version { 0x0003 "V " "firmware\n" "firmware date\n"
+ "model\n" "(c) NMP." }
diff --git a/docs/manual/protocol/n7110.rst b/docs/manual/protocol/n7110.rst
new file mode 100644
index 0000000..409de6e
--- /dev/null
+++ b/docs/manual/protocol/n7110.rst
@@ -0,0 +1,717 @@
+Nokia 7110
+==========
+
+
+Assembled by
+Balazs Nagy <js@iksz.hu>
+Marcin Wiacek <Marcin@MWiacek.com>
+Jens Bennfors <jens.bennfors@ing.hj.se>
+Michael Hund <michael@drhund.de>
+Jay Bertrand <jay.bertrand@libertysurf.fr>
+Gabriele Zappi <gzappi@inwind.it>
+Markus Plail <plail@web.de>
+Ralf Thelen <ralf@mythelen.de>
+Walek <walek@pa98.opole.sdi.tpnet.pl>
+... and other members of gnokii mailing list
+and authors of some WWW pages.
+
+The data provided is for information purposes only.
+Some of the frames might be hazardous to your phone. Be careful!!!
+We do not take any responsibility or liability for damages, etc.
+
+.. note::
+
+ this information isn't (and can't be) complete. If you know anything
+ about features not listed here or you noticed a bug in this list, please
+ notify us via e-mail. Thank you.
+
+Document describing frames used in
+GSM Nokia 6210 and derivatives (7110)
+
+Correct format is FBUS version 2/Infrared/MBUS version 2
+(see nokia.txt for protocol details):
+
+List::
+
+ 0x00: Connect to NBS port ?
+ r Set ringtone {+0x7c,0x01,0x00,0x0d,0x06[6],0x78,ringtone packed according to SM2.0}
+ Seems not to work in MBUS!
+ 0x01: Communication Status
+ ? r Call msg { 0x0002 }
+ ? r Call in progress { 0x0003, seqnr }
+ ? r Remote end hang up { 0x0004, seqnr, ?, error (like in netmon in 39) }
+ ? r incoming call alert { 0x0005, seqnr, numlen, "number", namelen, "name" }
+ ? r answered call { 0x0007, seqnr }
+ ? r terminated call { 0x0009, seqnr }
+ ? r call msg { 0x000a, seqnr }
+ Note: in 6210 4.27 all msg from 0x01 seems to be unavailable
+ 0x02: SMS handling
+ s Send SMS message { 0x0001, 0x02, 0x00 (SEND REQUEST), ... }
+ r Message sent { 0x0002 }
+ r Send failed { 0x0003, ?, ?, error (like in netmon in 65)}
+ s Incoming SMS info on { 0x000d, 0x00, 0x00, 0x02}
+ note: no info about Delivery Reports
+ r Incoming SMS info onOK{ 0x000e }
+ note: no info about Delivery Reports
+ r Incoming SMS infoonerr{ 0x000f, error }
+ where error: 0x0c - no PIN
+ r SMS message received { 0x0011, ...... } (whole message)
+ s Set CellBroadcast { 0x0020, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01 }
+ for enable cell broadcast ?
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
+ for disable cell broadcast ?
+ r Set CellBroadcast OK { 0x0021, 0x01 }
+ r Read CellBroadcast { 0x0023, ?, ?, ?, channel, ?, message... } ?
+ s Set SMS center { 0x0030, 0x64, priority, checksum?, format,
+ validity[2], {DefaultRecipient no.}[12],
+ {SMScenter no.}[12], {SMSC name}, 0x00}
+ where tel.no.[12]: {len, type, {number(BCD)}}
+ type: 0x81: normal
+ 0x91: + (international)
+ 0xd0: alphanumeric
+ format: 0x00: text
+ 0x22: fax
+ 0x24: voice
+ 0x25: ERMES
+ 0x26: paging
+ 0x31: X.400
+ 0x32: email
+ validity: 0x000b: 1 hour
+ 0x0047: 6 hours
+ 0x00a7: 24 hours
+ 0x00a9: 72 hours
+ 0x00ad: 1 week
+ 0x00ff: max.time
+ r Set SMS center OK { 0x0031 }
+ r Set SMS center error { 0x0032, reason }
+ s Get SMS center { 0x0033, 0x64, priority }
+ r SMS center received { 0x0034, priority, checksum?, type,
+ validity[2], {DefaultRecipient no.}[12],
+ {SMScenter no.}[12], {SMSC name}, 0x00 }
+ where priority, checksum, type, validity,
+ tel.no.[12]: see 0x02/0x0030
+ r SMS center error recv { 0x0035, reason }
+ s?? { 0x0074}
+ r?? { 0x0075, 0xFF, 0x11, 0x98}
+ s?? { 0x008C}
+ r?? { 0x008D, 0x00}
+ 0x03: Phonebook functions
+ s Get memory status { 0x0103, 0x02, memory type }
+ where: memory type - see 0x03/0x0107
+ r Get memory status { 0x0104, 0x00, xL, 0x00[2], y1H, y1L, 0x10,
+ 0x00[2], z?, ymaxH, ymaxL, y2H, y2L,
+ 0x0d?, xH?, 0x00[2]? }
+ where y1: location (lowermost)
+ y2: no. of locations
+ ymax: maximum location no.
+ s Read memory { 0x0107, 0x01, 0x01, 0x00, 0x01, xH, xL,
+ yH, yL, 0x00, 0x00}
+ where x: memory type
+ 0x01: (256) Dialled numbers
+ 0x02: (512) Missed calls
+ 0x03: (768) Received calls
+ 0x05: (500) telephone phonebook
+ 0x06: (160) SIM phonebook
+ 0x07: (10/0)
+ 0x08: (1/0)
+ 0x09: (4) voice mailbox
+ 0x0e: (10) speed dials
+ 0x10: (5) caller groups
+ y: location
+ r Read memory error { 0x0108, 0x00, 0x01,
+ code,0x00, 0x00, z, error}
+ where code==0x0f
+ error: 0x34 - phonebook location not found
+ 0x3b - speed dial not assigned
+ r Read memory OK { 0x0108, 0x00, 0x01,
+ code,0x00, 0x00, z, xH, xL, yH, yL, 0x00, 0x00, 0x00, no.of blocks, { block } * }
+ where code: != 0x0f
+ y: location
+ z: generic block size
+ block: {id, 0, 0, blocksize, block no.,
+ {contents}, 0x00}
+ id: 0x04 pointer to another memory location { 0xff?, yH, yL, xL,0x00[3] }
+ 0x07 name {len, (unicode)},
+ 0x08 email
+ 0x09 postal
+ 0x0a note {len, (unicode)}
+ 0x0b number {type, 0x00[3], len, (unicode)}
+ 0x0c ringtone {ringtone no., 0, 0}
+ 0x13 date for a called list (DC, RC, etc.)
+ 0x1b caller group graphic {width, height, 0, 0 {bitmap}}
+ 0x1c caller group graphic on? {(1: yes, 0: no), 0, 0}
+ 0x1e caller group number {number, 0, 0}
+ type: 0x0a: General,
+ 0x03: Mobile (office ?),
+ 0x06: Work,
+ 0x04: Fax,
+ 0x02: Home (mobile ?)
+ s Set mem location { 0x010b, 0x00, 0x01, 0x01, 0x00, 0x00, z,
+ xH, xL, yH, yL, 0x00, 0x00, 0x00,
+ no.of blocks, { block }[no.of blocks] }
+ r Set mem location { 0x010c, 0?, 1?, code, 0?, 0?, z?, 0?, 0?,
+ yH, yL, xL }
+ where code:
+ 0x3d - wrong entry type
+ 0x3e - too many entries
+ s Delete mem location { 0x010f, 0x00, 0x01, 0x04, 0x00, 0x00, 0x0c, 0x01, 0xff, xH, xL,
+ yH, yL, 0x00, 0x00}
+ where x: location
+ y: memory type
+ r Delete mem location { 0x0110, 0x00, 0x00 }
+ 0x06: Calling line restriction/Call forwarding etc
+ r Get call divert { 0x0001, 0x02, x, 0x00, divtype, 0x02, calltype, y, z, 0x0b, number, 0x00...0x00, timeout (byte 45) }
+ s Set call divert { 0x0001, 0x03, 0x00, divtype, calltype, 0x01, number(packed like in SMS), 0x00 ... 0x00,
+ length of number (byte 29), 0x00 ... 0x00, timeout (byte 52), 0x00, 0x00, 0x00}
+ NOTE: msglen=0x37
+ where timeout:
+ 0x00: not set ?
+ 0x05: 5 second
+ 0x0a: 10 second
+ 0x0f: 15 second
+ 0x14: 20 second
+ 0x19: 25 second
+ 0x1e: 30 second
+ where divtype:
+ 0x02: all diverts for all call types ?
+ Found only, when deactivate all diverts for all call types (with call type 0x00)
+ 0x15: all calls
+ 0x43: when busy
+ 0x3d: when not answered
+ 0x3e: if not reached
+ calltype:
+ 0x00: all calls (data, voice, fax)
+ 0x0b: voice calls
+ 0x0d: fax calla
+ 0x19: data calls
+ s Deactivate calldiverts{ 0x0001, 0x04, 0x00, divtype, calltype, 0x00 }
+ where divtype, calltype: see above
+ r Deactivate calldiverts{ 0x0002, 0x04, 0x00, divtype, 0x02, calltype, data }
+ s Get call diverts { 0x0001, 0x05, 0x00, divtype, calltype, 0x00 }
+ where divtype, calltype: see above
+ r Get call diverts ok { 0x0002, 0x05, 0x00, divtype, 0x02, calltype, data }
+ where divtype, calltype: see above
+ data: { 0x01, 0x00 } - isn't active
+ { 0x02, 0x01, number(packed like in SMS), 0x00, 0x00..., timeout }
+ r Get prepaid(?) info { 0x0005, ?,?,?,length,message(packed like in 7bit SMS)}
+ r Call diverts active { 0x0006, ??? }
+ 0x0a: Network status
+ s get used network { 0x0070 }
+ r get used network { 0x0071, available,?,?,length,netstatus,netsel,cellIDH,
+ cellIDL,lacH,lacL,MCC+MNC[3],{Opstr}, 4?,
+ len, xlen(78), ylen(21), 0, {bitmap} }
+ where {Opstr}: namelen, {operator name(unicode)}
+ len: {xlen, ylen, 0, {bitmap} + 2
+ {bitmap}: bitmaplen, 0, 0, {OTA bitmap}
+ available: 0x02 if the logo following is valid,
+ 0x01 for no operator logo following
+ s get network status { 0x0081 }
+ r get network status { 0x0082, network%, 0x14? }
+ s set operator logo { 0x01a3 0x01, oplogo?, MCC+MNC[3], 0?,4?,len,
+ xlen(78),ylen(21), 0 (frames?),
+ {bitmap}*?, 0x00(padding) }
+ where len, {bitmap}: see 0x0a/0x0071
+ r set operator logo OK { 0x01a4 }
+ s clear operator logo { 0x00af, x}
+ where x==0 to 4
+ r clear operator logo { 0x00bf}
+ 0x13: Calendar notes
+ s Add meeting note { 0x0001, body like in subtype 0x001a...}
+ r Add meeting note { 0x0002, location (2 bytes), status (2 bytes)}
+ s Add call note { 0x0003, body like in subtype 0x001a...}
+ r Add call note { 0x0004, location (2 bytes), status (2 bytes)}
+ s Add birthday note { 0x0005, location (2 bytes), entry type, 0x00, year of birth(2 bytes),
+ Month, Day, 0x00, 0x00, alarm (4 bytes), alarm type, length, text (Unicode)}
+ r Add birthday note { 0x0006, location (2 bytes), status (2 bytes)}
+ s Add reminder note { 0x0007, body like in subtype 0x001a...}
+ r Add reminder note { 0x0008, location (2 bytes), status (2 bytes)}
+ s Delete calendar note { 0x000b, location (2 bytes) }
+ r Delete calendar note { 0x000c, location (2 bytes), ?, ?, ?, ? }
+ s Get calendar note { 0x0019, location (2 bytes) }
+ r Calendar note recvd { 0x001a, location (2 bytes), entry type, 0x00, year (2 bytes), Month, Day, block}
+ where: entry type - 0x01 - Meeting, 0x02 - Call, 0x04 - Birthday, 0x08 - Reminder
+ block: for Meeting:{hour,minute,alarm (two bytes),recurrence (two bytes),len,0x00,string(unicode)}
+ where alarm=Number of minutes before the time of the meeting
+ that the alarm should be triggered:
+ For meetings with "No alarm"=0xFFFF (-1).
+ For "On time"=0x0000
+ half an hour=0x001E, and so on.
+ Recurrence=in hours, between future occurrences of this meeting.
+ If there is no repeat, this value is 0x0000. The special value 0xffff
+ means 1 Year!
+ for Call:{Hour,Minute,Alarm (as above),Recurrence (as above),namelen,numberlen,
+ name(unicode),number(unicode)}
+ for Reminder:{Recurrence (as above),len,0x00,string(unicode)}
+ for Birthday:{byte1,byte2,alarm(4 bytes),yearofbirth,alarmtype,len,string(unicode)}
+ byte1 and byte2 may vary (???). Usually are 0x00 both (but not always)
+ In Birthday, the Year in the common part, usually contains a strange year.
+ So, don't consider it as Year of note, neither year of BirthDay (for Year of
+ Birthday use the value described below).
+ where alarm=32-bit integer that is the number of seconds between the desired
+ alarm time and 11:59:58pm on the birthday.For "No Alarm", the value is
+ 0x0000FFFF (65535).
+ YearOfBirth=used instead of the one in the common part of the entry (see above)
+ but only when reading birthday entries. For storing entries, this field does
+ not exist.
+ AlarmType: 0x00 - Tone, 0x01 - Silent
+ ? s??? { 0x0021 }
+ ? r??? { 0x0022, 0x5A, 0x00 }
+ ? s??? { 0x0025 }
+ ? r??? { 0x0026, 0x04, 0x00 }
+ ? s { 0x0029 }
+ ? r { 0x002A, 0x04, 0x00 }
+ s Get first free pos { 0x0031 }
+ r Get first free pos { 0x0032, location (2bytes) }
+ s Get notes info { 0x003a, 0xFF, 0xFE}
+ r Get notes info { 0x003b, how many notes used (2 bytes), 0x01, 0x07, { two bytes with location for each note} *}
+ ? s Get calendar note?? { 0x003E, location (2 bytes) }
+ ? r Get calendar note?? { 0x003F, location (2bytes), ... }
+ 0x14:
+ s Get Picture Image { 0x0007, location, number[2 bytes], 0x00, 0x64 }
+ r Get Picture Image { 0x0008, 0x07, location, number[2 bytes], 0x07, ??[38],
+ width, height, lenH, lenL, {bitmap}, 0x00, 0x00, text len, text(coded like in SMS)...}
+ r Get SMS failed { 0x0009, 0x02 },
+ s Get SMS status { 0x0036, 0x64 }
+ r Get SMS Status { 0x0037, 0x05/0x03, 0x01, 0x00, 0x00,
+ a (2 octets), b (2 octets), c (2 octets),
+ d (2 octets), e (2 octets), 0x00
+ where:
+ a - according to P.Kot:
+ Number of locations in "fixed" memory. These are all
+ Templates entries in my Nokias 6210 (NPE-3 (c) NMP V05.36
+ 14-11-01, NPE-3 (c) NMP V05.27 01-08-01).
+ I can't remove any of Templates entries in my phone.
+ Marcin WiÄ…cek: Rather not ! I don't agree.
+ I have 0x00, 0x0f and 10 templates and 3 SMS
+ and 10 Picture Images.
+ b - Number of used messages in phone memory. These
+ are messages manually moved from the other folders.
+ Picture messages are saved here.
+ c - Number of unread messages in phone memory. Probably
+ only smart msssages.
+ d - Number of used messages in SIM memory. These are
+ either received messages or saved into Outbox/Inbox.
+ Note that you *can't* save message into this memory
+ using 'Move' option. Picture messages are not here.
+ e - Number of unread messages in SIM memory
+
+ s Set Picture Image { 0x0050, 0x07, location, number[2 bytes], 0x07, ??[38],
+ width, height, lenH, lenL, {bitmap}, 0x00, 0x00, text len, text(coded like in SMS)...}
+ std. size: 72x28
+ r Set Picture Image { 0x0051, location, number[2 bytes], 0x07 }
+ s Set SMS name { 0x0083,folder,location(2bytes),name(Unicode),0x00 , 0x00}
+ r Set SMS name { 0x0084,folder,0x00, 0x00, name (Unicode),0x00,0x00}
+ s List Picture Images { 0x0096, location, 0x0f, 0x07 }
+ where location:
+ LM tries with 0x09, 0x11, 0x19, 0x21, 0x29, 0x31, 0x39, 0x41, 0x49
+ Returned value with 0x21
+ r List Picture Images { 0x0097, number of pictures[2 bytes], number1[2 bytes], number2[2 bytes], ..., }
+ s Write SMS to folder { 0x0104, status, folder ID, location(2 bytes), 0x02, 0x01, SMS stuff ... }
+ r Write SMS to folder { 0x0105, folder ID, location(2 bytes), 0x00 }
+ r Write SMS to folder { 0x0106, 0x02 (write failed errorcode ?) }
+ s Get SMS from folder { 0x0107, folderID, location(2 bytes), 0x01, 0x65, 0x01}
+ where: folderID - see 0x14/0x017B
+ r Get SMS from folder { 0x0108, status, folderID, 0x00, location, type, sender number,...}
+
+ where: status=0x01 - reveived/read
+ 0x03 - received/unread
+ 0x05 - stored/sent
+ 0x07 - stored/not sent
+
+ where: folderID - see 0x14/0x017B
+
+ where: type=0x00 - received SMS
+ 0x01 - delivery report
+ 0x02 - stored SMS
+ 0x07 - picture message
+ s Delete SMS message { 0x010a, folderID, location(2 bytes), 0x01 }
+ r Delete SMS { 0x010b }
+ s Get folder status { 0x016b, folderID, 0x0F, 0x01}
+ where: folderID - see 0x14/0x017B
+ r Get folder status { 0x016c, number of entries (2 bytes), entry1number (2 bytes), entry2number(2 bytes), ....}
+ s Get folder names { 0x017A, 0x00, 0x00}
+ r Get folder names { 0x017B, number of strings, folderID, name1, 0x00, folderID, name2, 0x00, name3, 0x00,...}
+ where: folderID=0x08 - Inbox
+ 0x10 - Outbox
+ 0x18 - Archive
+ 0x20 - Templates
+ 0x29 - first "My folders"
+ 0x31 - second "My folders"
+ 0x39 - third -"-
+ and so on
+ 0x17:
+ s Get Battery info { 0x0002 }
+ r Get Battery info { 0x0003, 0x0b, batt%, 0x14?, 0x01? }
+ 0x19: Phone clock & alarm
+
+ These frames are like the same frames subtypes in 0x11 in 6110
+
+ s set date and time { 0x0060, 1,1,7,yearh,yearl,month,mday,hour,min,0x00 }
+ r date and time set { 0x0061 }
+ s get date and time { 0x0062 }
+ r date and time recvd { 0x0063,date_set?,time_set?,?,?,yearh,yearl,month,mday,hour,min,second }
+ where: date_set & time_set==0x01 - set
+ 0x00 - not set, ?,?,yearh,yearl,month,mday,hour,min,second
+ not available in frame
+ s set alarm { 0x006b, 1,32,3,0x02(on-off),hour,min,0x00 }
+ r alarm set { 0x006c }
+ s get alarm { 0x006d }
+ r alarm received { 0x006e,?,?,?,?,alrm(==2:on),hour,min }
+
+ These are new (?)
+
+ ? s ?? { 0x0083, id }
+ ? r ?? { 0x0084, 0x01, 0x40, 0x03, id, 0x00, 0x00 }
+ ? r ?? { 0x0084, 0x01, 0x40, 0x03, id, 0x00, 0x01 }
+ ? r ?? { 0x0084, 0x01, 0x40, 0x03, id, 0x01, 0x00 }
+ where: id=0x27,0x2a,0x32,0x28,0x40
+ 0x1b:
+ s Get IMEI { 0x0001 }
+ r Get IMEI { 0x0002, {IMEI(ASCII)}, 0x00 }
+ s get HW&SW version { 0x0003, 0x01, 0x32 }
+ r get HW&SW version { 0x0004, "V " "firmware\n" "firmware date\n"
+ "model\n" "(c) NMP." 0x00 0xff[14] }
+ 0x1f:
+ s ??? { 0x0010, 0x02, 0x00, 0xff, 0xff }
+ r ??? { 0x0011, length, 0x00, {block}[length] }
+ where block: { unicode letter[2], 0x0000,
+ 0x00, 0x55, ??, ?? }
+ s Set ringtone { 0x011f, 0x00, location, 0x00, name(Unicode),
+ ringtone(format the same to 0x40/0x019e and 0x40/0x01a0) }
+ where: location: 0x87 to 0x8b on N6210
+ 0x74 to ... on N7110
+ s Get ringtone { 0x0122, 0x00, location}
+ r Get ringtone { 0x0123, 0x00, location, name(Unicode), 0x00,...,0x00, 0x02,0xFC,0x09(ringtone contenst)}
+ r Get ringtone error { 0x0124, ...}
+ 0x39:
+ s get profile feature { 0x0101, 0x01, 0x01, 0x01, number1, number2}
+ where number1: from 0x00 to 0x07 (for each profile ?)
+ number2: 0x00 - 0x09, 0x0A, 0x16 - 0x19, 0x1a - 0x1f, 0x20 - 0x29, 0x2a - 0x2c, 0xff
+ where 0x09: keypad tones 0x02: incoming call alert 0x03: ringtone number
+ 0x04: ringing volume
+ 0x05: message alert tone 0x06: vibra 0x07: warning tones 0x08: caller groups alert for 0x09: automatic answer
+ 0xff: name
+ r get profile feature { 0x0102, 0x01, 0x02, number2, block...}
+ for number2==0xff: (Profile Name)
+ block: 0x01, length, name(Unicode), 0x00, 0x00
+ for number2==0x00: (Keypad Tones)
+ block: 0x01, 0x01, 0x01, Type, 0x01
+ where: Type : 0x00 = Off
+ 0x01 to 0x03 = Level1 .. Level3
+ for number2==0x02: (Incoming Call Alert)
+ block: 0x01, 0x01, 0x01, Type, 0x01
+ where: Type : 0x00 = Ringing
+ 0x01 = Ascending
+ 0x02 = Ring Once
+ 0x03 = Beep Once
+ 0x05 = Off
+ for number2==0x03: (Ringtone Number)
+ block: 0x01, 0x01, 0x01, Number, 0x01
+ where: Number : 0x40 to 0x62 - gives number of factory ringtone. The number of menu is
+ obtained by doing (Number - 0x3f);
+ where: Number : 0x89 to 0x8d - gives number of uploaded ringtone. The number of menu is
+ obtained by doing (Number - 0x65),while the uploaded ringtone number is
+ obtained by doing (Number - 0x88).
+ for number2==0x04: (Ringing volume)
+ block: 0x01, 0x??, 0x??, Volume, 0x01
+ where: Volume : 0 = Level1 .. to 4 = Level5
+ for number2==0x05: (Message Alert Tone)
+ block: 0x01, 0x01, 0x??, Type, 0x01
+ where: Type : 0x00 = Off
+ 0x01 = Standard
+ 0x02 = Special
+ 0x03 = Beep Once
+ 0x04 = Ascending
+ for number2==0x06: (Vibration)
+ block: 0x01, 0x??, 0x??, Switch, 0x01
+ where: Switch : 0 = Off, 1 = On
+ for number2==0x07: (Warning Tones)
+ block: 0x01, 0x??, 0x??, Switch, 0x01
+ where: Switch : 0 = Off, 1 = On
+ for number2==0x08: (Caller groups Alert for)
+ block: 0x01, 0x??, 0x??, Callers, 0x01
+ where: Callers : 0xff = All calls alert (Read below *)
+ 0x01 = Family
+ 0x02 = VIP
+ 0x04 = Friends
+ 0x08 = Colleagues
+ 0x10 = Others
+ All logical OR among groups are valid, so if you select from one phone's profile
+ alert for Friends and Colleagues, a 0x0c will return (because 0x04 OR 0x08 = 0x0c).
+ (*) If Callers==0xff, means "Alert for All calls". Then, in this case, you don't
+ need to read other groups selection.
+ for number2==0x09: (Automatic answer)
+ block: 0x01, 0x??, 0x??, Switch, 0x01
+ where: Switch : 0 = Off, 1 = On
+ N.B. This feature is valid for Handsfree and Headset profiles only!
+ s ??? { 0x0101, 0x04, 0x01, 0x01, 0xff, 0x03 }
+ r ??? { 0x0102, 0x01, 0x02, 0x03, 0x01, 0x01, 0x01, 0x85/0x087 }
+
+ s ? { 0x0105}
+ r ? { 0x0106, 0x01, 0x04}
+ 0x3f: WAP
+ s Enable WAP frames { 0x0000}
+ r Enable WAP frames { 0x0002, 0x01}
+
+ s ?? { 0x0003}
+ r ?? { 0x0004}
+
+ s Get WAP bookmark { 0x0006, 0x00, location}
+ where location: 0 - 14
+ r Get WAP bookmark { 0x0007, 0x00, name_len, name(unicode),
+ url_len, url(unicode), 0x01,0x80,0x00[7]}
+ r Get WAP bookmark err { 0x0008, error }
+ where error:
+ 0x00(?)invalid position
+ 0x01 user inside "Bookmarks" menu. Must leave it
+ 0x02 invalid/too high/empty location
+
+ s Set WAP bookmark { 0x0009, 0xff, 0xff, name_len, name(unicode),
+ url_len, url(unicode), 0x01,0x80,0x00[7] }
+ Note: bookmark is added to the first free location.
+ r Set WAP bookmark OK {+0x01, 0x36, 0x0a, block }
+ where block:
+ 0x0a, location_of_just_written_bookmark(?),
+ 0x00, next_free_location(?)
+ r Set WAP bookmark err {+0x01, 0x36, 0x0b, error }
+ where error:
+ 0x04 - memory is full
+ 0x01 - we are in the bookmark menu
+ 0x00 - unknown reason for now ;(
+
+ ? s Delete WAP bookmark { 0x000c, 0x00, location }
+ where: location = 0-14
+ ? r Delete WAR bookmark OK{ 0x000d }
+ ? r Delete WAPbookmark err{ 0x000e, 0x02 }
+
+ s ?? { 0x000F}
+ r ?? { 0x0010, 0x00}
+
+ s Get WAP settings 1 { 0x0015, location}
+ where location: 0x00 - 0x05
+ r Get WAP settings 1 OK { 0x0016, title length, title (Unicode), URL length, URL(Unicode),con_type, ???[6 bytes],location, ???[5 bytes],security,...}
+ where:
+ con_type: 0x00 - temporary
+ 0x01 - continuous
+ location: when use "Get WAP settings 2 frame", must give it
+ security: 0x00 = no, 0x01 = yes
+ r Get WAP settings 1 err{ 0x0017, error }
+ where error:
+ 0x01 user inside "Settings" menu. Must leave it
+ 0x02 invalid/too high/empty location
+ s Get WAP settings 2 { 0x001b, location}
+ where location: 0x00 - 0x1d (you get it in "Get WAP settings 1" frame)
+ r Get WAP settings 2 OK { 0x001c, 0x01, type, frame...}
+ where type : 0x00 - SMS bearer
+ frame:
+ service_num_len, service_num (Unicode), server_num_len, server_num(Unicode)
+ 0x01 - data bearer
+ frame:
+ auth, call_type, call_speed, ?, IP len, IP (Unicode), dialup len, dialup (Unicode),
+ user len, user (Unicode), password len, password (Unicode)
+ where auth: 0x00 - normal, 0x01 - secure
+ call_type: 0x00 - analogue, 0x01 - ISDN
+ call_speed: 0x00 - 9600, 0x01 - 14400
+ 0x02 - USSD bearer
+ frame: type, service number len/IP len,service num (Unicode)/IP (Unicode),service code len,
+ service code (Unicode)
+ where type: 0x01 - service number, 0x00 - IP
+ r Get WAP settings 2 err{ 0x001d,error}
+ where: error=0x05
+ 0x40: Security commands
+ ? s ???(N6150) { 0x08, 0x00 }
+ ? r ???(N6150) { 0x08 }
+ s Enable extended cmds { 0x64, cmd }
+ where cmd: 0x00: off
+ 0x01: on
+ 0x03: reset (doesn't ask for PIN again)
+ 0x04: reset (PIN is requested)
+ In 5110 makes reset without PIN
+ 0x06: CONTACT SERVICE!!! Don't try it!
+ s Reset phone settings { 0x65, value, 0x00 }
+ where value: 0x08 - reset UI (User Interface) settings
+ 0x38 - reset UI, SCM and call counters
+ 0x40 - reset test 36 in netmonitor
+ r Reset phone settings { 0x65, 0x00 }
+ s Get IMEI { 0x66 }
+ r Get IMEI { 0x66, 0x01, IMEI, 0x00}
+ s (ACD Readings)?(N6150 { 0x68 }
+ r (ACD Readings)?(N6150 { 0x68, ... }
+ s Get Product Profile
+ Settings { 0x6a}
+ r Get Product Profile
+ Settings { 0x6a, 4bytes with Product Profile Settings }
+ s Set Product Profile
+ Settings { 0x6b, 4bytes with Product Profile Settings }
+ r Set Product Profile
+ Settings OK ? { 0x6b }
+ s Get code { 0x6e, code }
+ where code: see 0x08/0x0004 (no allowed code !)
+ r Get code { 0x6e, code, allowed, allowed? (sec code (text)) }
+ where code: see 0x08/0x0004
+ allowed: 0: no
+ 1: yes
+ ? s ???? { 0x74, 0x01, 0x01, 0x0e }
+ ? r ???? { 0x74 }
+ s Call commands { 0x7c, block }
+ where where: command, (values)
+ command: 0x01
+ values: number(ASCII), 0x00 - makes voice call
+ command: 0x02 - answer call
+ command: 0x03 - release call
+ r Call commands { 0x7c, command }
+ s Netmonitor { 0x7e, field }
+ where: field: 00: next
+ F0: reset
+ F1: off
+ F2: field test menus
+ F3: developer menus
+ s Get simlock info { 0x8a, 0x00}
+ r Get simlock info { 0x8a, 0x00, 0x01, lockstype, locksclosed, 0x00, 0x00, locksinfo(lock1,4,2,3), counter1,counter2,counter4,counter4,0x00 }
+ where: lockstype: bit1,bit2,bit3,bit4 - if set, selected lock is user lock
+ locksclosed: bit1,bit2,bit3,bit4 - if set, selected lock is closed
+ counter1 - counter4: counters for locks
+ s Buzzer pitch { 0x8f, volume, hzLO, hzHI }
+ if volume and hz is 0, it's off
+ r Buzzer pitch { 0x8f}
+ s ACD Readings ? { 0x91, parameter?(0x02,0x03,0x04,0x05,0x07) }
+ r ACD Readings ? { 0x91, parameter?, value? }
+ ? s ???(N6150) { 0x98, 0x00 }
+ ? r ???(N6150) { 0x98, 0x00, 0x04 }
+ s Get bin ringtone { 0x9e, location }
+ where: location=0,1,etc.
+ r Get bin ringtone { 0x9e, location, error, contents... }
+ where location=0,1,etc.
+ error=0x0a, ringtone NOT available
+ 0x00, OK
+ s Set bin ringtone { 0xa0, location, 0x00, contenst... }
+ where: location=0,1,etc.
+ r Set bin ringtone { 0xa0, location, error }
+ where location=0,1,etc.
+ error=0x0a, ringtone NOT set
+ 0x00, ringtone set OK
+ ? r Get MSid { 0xb5, 0x01, 0x2f, msid, 0x25 }
+ s Get info about phone { 0xc8, 0x01 }
+ r Get info about phone { 0xc8, 0x01, 0x00, "V ", "firmware", 0x0a, "firmware date", 0x0a, "model", 0x0a, "(c) NMP.", 0x00 }
+ s Get MCU SW Checksum { 0xc8, 0x02 }
+ r Get MCU SW Checksum { 0xc8, 0x02, 0x00, checksum (4 bytes),0x00 }
+ s DPS External SW { 0xc7, 0x03 }
+ r DSP External SW { 0xc7, 0x03, 0x00, string,0x00 }
+ s Get HW { 0xc8, 0x05 }
+ r Get HW { 0xc8, 0x05, 0x00, HW version (4 bytes), 0x00 }
+ s Get "Made" Date { 0xc8, 0x05 }
+ r Get "Made" Date { 0xc8, 0x05, 0x00, date(4 bytes), 0x00 }
+ s Get DSP Internal SW { 0xc8, 0x09 }
+ r Get DSP Internal SW { 0xc8, 0x09, 0x00, version (1 bytes), 0x00 }
+ s Get PCI version { 0xc8, 0x0b }
+ r Get PCI version { 0xc8, 0x0b, 0x00, version, 0x00 }
+ s Get system ASIC { 0xc8, 0x0c }
+ r Get system ASIC { 0xc8, 0x0c, 0x00, string, 0x00 }
+ s Get COBBA { 0xc8, 0x0d }
+ r Get COBBA { 0xc8, 0x0d, 0x00, string, 0x00 }
+ s Get PLUSSA { 0xc8, 0x0e }
+ r Get PLUSSA { 0xc8, 0x0e, available, 0x00 }
+ where available: 0x01: not available
+ s Get CCONT { 0xc8, 0x0f }
+ r Get CCONT { 0xc8, 0x0f, available, 0x00 }
+ where available: 0x01: not available
+ s Get PPM version { 0xc8, 0x10 }
+ r Get PPM version { 0xc8, 0x10, 0x00, "V ", "firmware", 0x0a, "firmware date", 0x0a, "model", 0x0a, "(c) NMP.", 0x00 }
+ s Get PPM info { 0xc8, 0x12 }
+ r Get PPM info { 0xc8, 0x12, 0x00, PPM version ("B", "C", etc.), 0x00 }
+ s Set HW version { 0xc9, 0x05, version, 0x00 }
+ s Get Product Code { 0xca, 0x01 }
+ r Get Product Code { 0xca, 0x01, 0x00, number, 0x00 }
+ s Get Order Number { 0xca, 0x02 }
+ r Get Order Number { 0xca, 0x02, 0x00, string, 0x00 }
+ s Get Prod.Ser.Number { 0xca, 0x03 }
+ r Get Prod.Ser.Number { 0xca, 0x03, 0x00, number, 0x00 }
+ s Get Basic Prod.Code { 0xca, 0x04 }
+ r Get Basic Prod.Code { 0xca, 0x04, 0x00, number, 0x00 }
+ s Set Product Code { 0xcb, 0x01, product code, 0x00 }
+ s Set Order Number { 0xcb, 0x02, number, 0x00 }
+ s Set Prod.Ser.Number { 0xcb, 0x03, number, 0x00 }
+ s Get (original ?)IMEI { 0xcc, 0x01 }
+ r Get (original ?)IMEI { 0xcc, 0x01, IMEI, 0x00 }
+ s Get Manufacture Month { 0xcc, 0x02 }
+ r Get Manufacture Month { 0xcc, 0x02, 0x00, string, 0x00 }
+ s Get Purchare date { 0xcc, 0x04 }
+ r Get Purchare date { 0xcc, 0x04, 0x00, string, 0x00 }
+ s Set "Made" date { 0xcd, 0x02, string, 0x00 }
+ s Make "all" phone tests{ 0xce,0x1d,0xfe,0x23,0x00,0x00}
+ s Make one phone test { 0xce,0x1d,num1,num2,num3,num4}
+ Where num1-num4: 0x02,0x00,0x00,0x00;
+ 0x04,0x00,0x00,0x00;
+ 0x08,0x00,0x00,0x00;
+ 0x10,0x00,0x00,0x00;
+ 0x20,0x00,0x00,0x00;
+ 0x40,0x00,0x00,0x00;
+ 0x80,0x00,0x00,0x00;
+ 0x00,0x01,0x00,0x00;
+ 0x00,0x02,0x00,0x00;
+ 0x00,0x04,0x00,0x00; - "Power off"
+ No test for "Security data"
+ 0x00,0x10,0x00,0x00;
+ 0x00,0x20,0x00,0x00;
+ 0x00,0x40,0x00,0x00;
+ 0x00,0x80,0x00,0x00;
+ 0x00,0x00,0x01,0x00;
+ ....
+ 0x00,0x00,0x10,0x00;
+ s Result of phone tests { 0xcf }
+ r Result of phone tests { 0xcf, number of tests, results of next tests }
+ ? s ??? { 0xd1 }
+ ? r ???(N5110) { 0xd1, 0x00, 0x1d, 0x00, 0x01, 0x08, 0x00 }
+ s LCD Test { 0xd3, value }
+ where value: 0x03, 0x02 - 1'st test
+ 0x03, 0x01 - 2'nd test
+ 0x02, 0x03 - clears screen
+ s ACD Readings(N6150)? { 0xd4, 0x02, 0x00, 0x02, 0x00, 0x0e, 0x01}
+ r ACD Readings(N6150)? { 0xd4, 0x02, 0x00, 0x02, 0x00, 0x0e, 0x01, ?}
+ r Function of { 0xff, 0x8c }
+ 0x40 msgtype not
+ supported ?
+ 0x78:
+ s Status confirm { 0x0201, 0x03 }
+ r Incoming call seq1 { 0x0102 0x0e 0x03 }
+ r Incoming call seq2 { 0x0102 0x7e 0x01 }
+ 0x79:
+ s CarKit enable { 0x0201 0x01 0x62 0x00 }
+ r CarKit enabled { 0x0201 0x02 0x06 0x00 "V " {version} "\nHFU"
+ 0x00 }
+ 0x7a: settings
+ r Set setting { 0x01eb, number, 0x00 }
+ s Set setting { 0x01ec, number, contents }
+ where for number:
+ 0x02 (startup text) : 0x00, text (Unicode)
+ 0x15 (startup logo) : 0x00, 0x00, 0x00, 0x04,
+ 0xc0, 0x02, 0x00, height, 0xc0, 0x03, 0x00, width,
+ 0xc0, 0x04, 0x03, 0x00, {bitmap} }
+ where width, height, {bitmap}: see 0x7a/0x01ed 0x15
+ s Get setting { 0x01ee, number}
+ where number: 0x01 - 0x1e
+ 0x02: startup text
+ 0x15: startup logo
+ 0x1c: security code
+ r Get setting { 0x01ed,number, 0x00, contents}
+ where for number:
+ 0x02 (startup text) : 0x00, text (Unicode)
+ 0x15 (startup logo) : 0x00, 0x00, 0x00, 0x04,
+ 0xc0, 0x02, 0x00, height, 0xc0, 0x03, 0x00, width,
+ 0xc0, 0x04, 0x03, 0x00, {bitmap} }
+ where height: 60 (0x3c) or 65
+ width: 96 (0x60)
+ {bitmap}: like other bitmaps but pixels
+ placed vertically.
+ 0x1c (security code): {code(ascii)}, 0x00
+ 0x7f: Acknowledge(FBUS/IRDA){+type, seq }
+ Acknowledge(MBUS)...
+ 0xd0:
+ s Power on message seq1 {+04 }
+ r Power on message seq1 {+05 }
+ 0xd1:
+ s Get HW&SW version { 0x0003, 0x00 }
+ 0xd2:
+ r Get HW&SW version { 0x0003 "V " "firmware\n" "firmware date\n"
+ "model\n" "(c) NMP." }
+ 0xf4: Power on message seq 2
diff --git a/docs/manual/protocol/nokia-s40-sms-scratch.txt b/docs/manual/protocol/nokia-s40-sms-scratch.txt
new file mode 100644
index 0000000..485d3e8
--- /dev/null
+++ b/docs/manual/protocol/nokia-s40-sms-scratch.txt
@@ -0,0 +1,151 @@
+10:
+
+\x00\x02\x00\x01\x00\x00\x00\x00\x00\x00\x01\x91
+\x00[\x00B\x00u\x00g\x00 \x002\x001\x003\x006\x003\x009\x00]\x00 \x00R\x00e\x00:\x00 \x00P\x00r\x00o\x00b\x00l\x00e\x00m\x00 \x00w\x00i\x00t\x00h\x00 \x00I\x00D\x00E\x00 \x00D\x00V\x00D\x00-\x00R\x00W\x00\x00
+\x00b\x00i\x00g\x00l\x00@\x00a\x00f\x00f\x00.\x00c\x00o\x00m\x00.\x00p\x00l\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01
+
+\x00\xde
+
+\x01\x00\x01\x00
+\x08\x00\x01\x00
+\x0e\x00\x01\x00
+\x0b\x00\x01\x00
+\x06\x00\x04\x00\x00\x00\x00
+\x09\x00\x04\x00\x00\x00\x00
+\x27\x00\x01\x00
+\x23\x00\x04\x00\x00\t\xa6
+\x26\x00\x01\x00
+\x04\x00 \x00b\x00i\x00g\x00l\x00@\x00a\x00f\x00f\x00.\x00c\x00o\x00m\x00.\x00p\x00l\x00\x00
+\x07\x00\x01\x00
+\x05\x00\x01\x00
+\x12\x00\x045\xean\xd2
+\x24\x00\x01\x00
+\x04\x006\x00r\x00u\x00s\x00l\x00a\x00n\x00.\x00l\x00e\x00v\x00i\x00t\x00s\x00k\x00i\x00y\x00@\x00g\x00m\x00a\x00i\x00l\x00.\x00c\x00o\x00m\x00\x00
+\x07\x00\x01\x00
+\x05\x00\x01\x00
+\x12\x00\x045\xean\xd2
+\x24\x00\x01\x01
+\x22\x00\x01\x84
+\x25\x00\x0e\x00L\x00e\x00s\x00z\x00e\x00k\x00\x00
+\x00\x17GmailId11c13012913d0af7
+
+06:
+
+\x00\x02\x00\x01\x00\x00\x00\x16\x00\x00\x01\x20
+\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
+
+\x004\x002\x000\x002\x002\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x84\x05\x81$ \xf2\x00\x00\x80!\x02\x02\x002@\x06\xb4Z\xadVS\x00
+
+\x01\x00W
+
+\x01\x00\x01\x00
+\x02\x00\x0e+393492000200\x00
+\x03\x00\x0e\x004\x005\x005\x005\x005\x00\n\x00\x00
+\x04\x00\x0c\x004\x002\x000\x002\x002\x00\x00
+\x0c\x00\x01\x00
+\x07\x00\x01\x00
+\x05\x00\x01\x00
+\x06\x00\x04\x00\x00\x00\x00
+\x08\x00\x01\x02
+\x0b\x00\x01\x00
+\x09\x00\x04\x00\x00\x00\x00
+
+08:
+
+\x00\x02\x00\x01\x00\x00\x00B\x00\x00\x01\xd7
+\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00T\x00c\x00h\x00i\x00b\x00o\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
+
+\x04\x0b\xd0\xd41:-~\x03\x00\x00\x90P\x81"\x10#\x805\xc8\xb2\\\xcfN\x8f\xd1\xa0k\x9a\xcd^\xbf\xdb\xed\xb2\x1b$.\xa7AI\xb4\xbc\xdc\x06Q\xc7\xe8\xb4\xf8\rj\xbe\xc5i\xb6\xb9\xee^\xb7\xa8ay\xda\xec\x02
+
+\x01\x00\xe2
+
+\x01\x00\x01\x00
+\x08\x00\x01\x00
+\x0e\x00\x01\x00
+\x0b\x00\x01\x00
+\x0f\x00\x02\x00\x00
+\x06\x00\x04\x00\x00\x00\x00
+\x09\x00\x04\x00\x00\x00\x00
+\x27\x00\x01\x00
+\x2A\x00\x01\x00
+\x23\x00\x04\x00\x00\x00\x00
+\x26\x00\x01\x00
+\x03\x00l\x00H\x00e\x00r\x00z\x00l\x00i\x00c\x00h\x00 \x00W\x00i\x00l\x00l\x00k\x00o\x00m\x00m\x00e\x00n\x00 \x00b\x00e\x00i\x00 \x00I\x00h\x00r\x00e\x00m\x00 \x00T\x00c\x00h\x00i\x00b\x00o\x00 \x00M\x00o\x00b\x00i\x00l\x00f\x00u\x00n\x00k\x00-\x00T\x00a\x00r\x00i\x00f\x00.\x00\x00
+
+\x02\x00\x0e+491760000443\x00
+\x04\x00\x01\x00
+\x2b\x00\x0e\x00T\x00c\x00h\x00i\x00b\x00o\x00\x00
+\x07\x00\x01\x00
+\x05\x00\x01\x00
+\x12\x00\x04\x00\x00\x00\x00
+\x24\x00\x01\x00
+\x22\x00\x01\x00
+
+07:
+
+\x00\x02\x00\x01\x00\x00\x00>\x00\x00\x01\x4c
+\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
+
+\x8c\x84\x8d\x92\x8bmejhkyee1lz9e6hc16\x00\x85\x04I\x89i)\x84\x83Failed to retrieve the message
+
+\x01\x00[
+
+\x01\x00\x01\x00
+\x0b\x00\x01\x00
+\x09\x00\x04\x00\x00\x00\x00
+\x03\x00>\x00F\x00a\x00i\x00l\x00e\x00d\x00 \x00t\x00o\x00 \x00r\x00e\x00t\x00r\x00i\x00e\x00v\x00e\x00 \x00t\x00h\x00e\x00 \x00m\x00e\x00s\x00s\x00a\x00g\x00e\x00\x00
+\x06\x00\x04\x00\x00\x00\x00
+\x08\x00\x01\x00
+
+05:
+
+\x00\x02\x00\x01\x00\x00\x00\x9f\x00\x00\x02\x51
+\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00+\x003\x009\x003\x003\x003\x003\x003\x003\x001\x000\x005\x008\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
+
+D\x0c\x91\x93#h(\x01\x85\x00\x08\x80\x90\x032!\x10\x80\x8c\x05\x00\x03\xe3\x02\x01\x00P\x00e\x00z\x00z\x00o\x00 \x00d\x00i\x00 \x00z\x00u\x00l\x00\xfa\x00 \x00m\x00a\x00 \x00k\x00e\x00.\x00.\x00n\x00n\x00 \x00s\x00i\x00 \x00r\x00i\x00s\x00p\x00o\x00n\x00d\x00e\x00 \x00p\x00i\x00\xf9\x00 \x00a\x00i\x00 \x00m\x00e\x00s\x00s\x00a\x00g\x00i\x00?\x00!\x00 \x00C\x00a\x00g\x00a\x00t\x00i\x00.\x00 \x00B\x00u\x00o\x00n\x00a\x00
+
+\x01\x00\xff
+
+\x01\x00\x01\x00
+\x02\x00\x0e+393205956111\x00
+\x03\x00\xa6\x00P\x00e\x00z\x00z\x00o\x00 \x00d\x00i\x00 \x00z\x00u\x00l\x00\xfa\x00 \x00m\x00a\x00 \x00k\x00e\x00.\x00.\x00n\x00n\x00 \x00s\x00i\x00 \x00r\x00i\x00s\x00p\x00o\x00n\x00d\x00e\x00 \x00p\x00i\x00\xf9\x00 \x00a\x00i\x00 \x00m\x00e\x00s\x00s\x00a\x00g\x00i\x00?\x00!\x00 \x00C\x00a\x00g\x00a\x00t\x00i\x00.\x00 \x00B\x00u\x00o\x00n\x00a\x00 \x00n\x00o\x00t\x00t\x00e\x00!\x00:\x00-\x00P\x00 \x00e\x00h\x00 \x00e\x00h\x00\x00
+\x04\x00\x1c\x00+\x003\x009\x003\x002\x008\x006\x008\x002\x001\x000\x005\x008\x00\x00
+\x0c\x00\x01\x00
+\x07\x00\x01\x00
+\x05\x00\x01\x00
+\x06\x00\x04\x00\x00\x00\x00
+\x08\x00\x01\x00
+\x0b\x00\x01\x00
+\x09\x00\x04\x00\x00\x00\x00
+\x00
+\x0b\x00\x01\x00
+\x09\x00\x04\x00\x00\x00\x00
+
+03:
+
+\x00\x02\x00\x01\x00\x00\x00\x71\x00\x00\x02\x48
+\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x35\x00\x39\x00\x35\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x03\x81\x95\xF5\x00\x00\x70\x40\x41\x70\x24\x43\x80\x6F\xD6\x37\x39\x6C\x7E\xBB\xCB\xA0\x66\x79\x3E\x2F\xBB\xCF\x65\xB9\x0B\x04\x0D\xCB\xC3\xA0\xF1\xDB\x5D\x1E\xD3\xC3\x72\x7A\x19\x44\x2E\xCF\xC9\x65\x50\x99\x0D\x1A\xB2\xD3\x65\x37\xBD\x0C\x82\x0E\x41\xF4\x3A\x28\x49\x04\x91\xCB\xA0\x66\x79\x3E\x2F\xBB\xCF\x65\x39\xA8\x3C\xD7\x81\xCA\x73\x98\x0C\x16\x93\xC1\x6A\x33\x50\x1E\x44\xAF\x83\xC6\xEC\xB0\xBD\x0C\x2A\xCF\x75\xA0\x99\x0D\x76\xCB\xB9\x00\x01\x01\x24
+\x01\x00\x01\x00
+\x02\x00\x0D\x2B\x33\x34\x36\x30\x37\x30\x30\x33\x31\x31\x30\x00
+\x03\x00\xE0\x00\x56\x00\x6F\x00\x64\x00\x61\x00\x66\x00\x6F\x00\x6E\x00\x65\x00\x20\x00\x4D\x00\x65\x00\x73\x00\x73\x00\x65\x00\x6E\x00\x67\x00\x65\x00\x72\x00\x2E\x00\x20\x00\x50\x00\x61\x00\x72\x00\x61\x00\x20\x00\x63\x00\x6F\x00\x6E\x00\x65\x00\x63\x00\x74\x00\x61\x00\x72\x00\x74\x00\x65\x00\x20\x00\x64\x00\x65\x00\x73\x00\x64\x00\x65\x00\x20\x00\x65\x00\x6C\x00\x20\x00\x43\x00\x6C\x00\x69\x00\x65\x00\x6E\x00\x74\x00\x65\x00\x20\x00\x50\x00\x43\x00\x20\x00\x74\x00\x75\x00\x20\x00\x49\x00\x44\x00\x20\x00\x64\x00\x65\x00\x20\x00\x4D\x00\x65\x00\x73\x00\x73\x00\x65\x00\x6E\x00\x67\x00\x65\x00\x72\x00\x20\x00\x65\x00\x73\x00\x3A\x00\x20\x00\x65\x00\x73\x00\x30\x00\x32\x00\x30\x00\x31\x00\x32\x00\x30\x00\x35\x00\x33\x00\x20\x00\x79\x00\x20\x00\x74\x00\x75\x00\x20\x00\x63\x00\x6C\x00\x61\x00\x76\x00\x65\x00\x20\x00\x65\x00\x73\x00\x3A\x00\x20\x00\x33\x00\x36\x00\x30\x00\x37\x00\x39\x00\x2E\x00\x00
+\x04\x00\x08\x00\x35\x00\x39\x00\x35\x00\x00\x0C\x00
+\x01\x00\x07\x00\x01\x00\x05\x00\x01\x00
+\x06\x00\x04\x00\x00\x00\x00
+\x08\x00\x01\x00
+\x0B\x00\x01\x00
+\x09\x00\x04\x00\x00\x00\x00
+
+
+\x00\x02\x00\x01\x00\x00\x00q\x00\x00\x02\x48
+\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x005\x009\x005\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x03\x81\x95\xf5\x00\x00p@Ap$C\x80o\xd679l~\xbb\xcb\xa0fy>/\xbb\xcfe\xb9\x0b\x04\r\xcb\xc3\xa0\xf1\xdb]\x1e\xd3\xc3rz\x19D.\xcf\xc9eP\x99\r\x1a\xb2\xd3e7\xbd\x0c\x82\x0eA\xf4:(I\x04\x91\xcb\xa0fy>/\xbb\xcfe9\xa8<\xd7\x81\xcas\x98\x0c\x16\x93\xc1j3P\x1eD\xaf\x83\xc6\xec\xb0\xbd\x0c*\xcfu\xa0\x99\rv\xcb\xb9\x00\x01\x01$
+\x01\x00\x01\x00
+\x02\x00\0x0d+34607003110\x00
+\x03\x00\xe0\x00V\x00o\x00d\x00a\x00f\x00o\x00n\x00e\x00 \x00M\x00e\x00s\x00s\x00e\x00n\x00g\x00e\x00r\x00.\x00 \x00P\x00a\x00r\x00a\x00 \x00c\x00o\x00n\x00e\x00c\x00t\x00a\x00r\x00t\x00e\x00 \x00d\x00e\x00s\x00d\x00e\x00 \x00e\x00l\x00 \x00C\x00l\x00i\x00e\x00n\x00t\x00e\x00 \x00P\x00C\x00 \x00t\x00u\x00 \x00I\x00D\x00 \x00d\x00e\x00 \x00M\x00e\x00s\x00s\x00e\x00n\x00g\x00e\x00r\x00 \x00e\x00s\x00:\x00 \x00e\x00s\x000\x002\x000\x001\x002\x000\x005\x003\x00 \x00y\x00 \x00t\x00u\x00 \x00c\x00l\x00a\x00v\x00e\x00 \x00e\x00s\x00:\x00 \x003\x006\x000\x007\x009\x00.\x00\x00
+\x04\x00\x08\x005\x009\x005\x00\x00
+\x0c\x00\x01\x00
+\x07\x00\x01\x00
+\x05\x00\x01\x00
+\x06\x00\x04\x00\x00\x00\x00
+\x08\x00\x01\x00
+\x0b\x00\x01\x00
+\x09\x00\x04\x00\x00\x00\x00
diff --git a/docs/manual/protocol/nokia-s40-sms.rst b/docs/manual/protocol/nokia-s40-sms.rst
new file mode 100644
index 0000000..4ee56ae
--- /dev/null
+++ b/docs/manual/protocol/nokia-s40-sms.rst
@@ -0,0 +1,74 @@
+Nokia S40 filesystem SMS format
+===============================
+
+This text is work in progress and does not claim to be correct or accurate. It
+is solely based on Gammu dumps received from users. Analysed by Michal Cihar
+<michal@cihar.com>.
+
+File structure
+--------------
+
+- 176 bytes header
+ - at offset 7 is length of PDU data
+ - at offset 94 is stored remote number in unicode
+ - rest is not known
+- PDU data (without SMSC)
+ - here can be sometimes also some failure block, which is not known yet
+- structured data header: 0x01 0x00 <LEN>, where <LEN> is length of rest
+- structured blocks:
+
+Block: <TYPE = byte> <LENGTH = word> <DATA ...>
+
+Blocks
+------
+
+0x01
+ Unknown \x00 / \x01 (maybe received / sent)
+0x02
+ SMSC number, ASCII
+0x03
+ Text, unicode
+0x04
+ Sender, unicode
+0x05
+ Recipient, unicode
+0x06
+ Unknown \x00\x00\x00\x00
+0x07
+ Unknown \x00
+0x08
+ Unknown \x02 / \x00
+0x09
+ Unknown \x00\x00\x00\x00
+0x0a
+ Unknown \x00
+0x0b
+ Unknown \x00
+0x0c
+ Unknown, several values (maybe message reference per number)
+0x0d
+ Unknown \x00\x00
+0x0e
+ Unknown \x00\x00
+0x0f
+ Unknown \x00\x00
+
+
+0x22
+ Unknown \x00
+0x23
+ Unknown \x00\x00\x00\x00
+0x24
+ Unknown \x00
+0x26
+ Unknown \x00
+0x27
+ Unknown \x00
+0x2a
+ Unknown \x00
+0x2b
+ some text (Sender?), unicode
+
+
+To test:
+ - multiple recipients sms
diff --git a/docs/manual/protocol/nokia.rst b/docs/manual/protocol/nokia.rst
new file mode 100644
index 0000000..30efad2
--- /dev/null
+++ b/docs/manual/protocol/nokia.rst
@@ -0,0 +1,317 @@
+Nokia protocols
+===============
+
+Document describing protocol used in Nokia phones.
+
+The data provided is for information purposes only.
+Some of the frames might be hazardous to your phone. Be careful!!!
+We do not take any responsibility or liability for damages, etc.
+
+Last update 23.06.2003
+
+Assembled by
+Balazs Nagy <js@iksz.hu>
+Alfred R. Nurnberger <arnu@flosys.com>
+Hugh Blemings <Hugh.Blemings@vsb.com.au>
+Mike Bradley <mike@trumpington.st>
+Odinokov Serge <serge@takas.lt>
+Pavel Janik <Pavel@Janik.cz>
+Pawel Kot <pkot@linuxnews.pl>
+Marcin Wiacek <Marcin@MWiacek.com>
+Jens Bennfors <jens.bennfors@ing.hj.se>
+Michael Hund <michael@drhund.de>
+Jay Bertrand <jay.bertrand@libertysurf.fr>
+<arnu@venia.net>
+Andrew Kozin
+Pavel Machek <pavel@ucw.cz>
+Diego Betancor <dbetancor@duocom.net>
+... and other members of gnokii mailing list
+and authors of some WWW pages.
+
+.. note::
+
+ this information isn't (and can't be) complete. If you know anything
+ about features not listed here or you noticed a bug in this list, please
+ notify us via e-mail. Thank you.
+
+Frame format for MBUS version 1
+-------------------------------
+
+Request from Computer/Answer from Phone::
+
+ { DestDEV, SrcDEV, FrameLength, MsgType, {block}, id, ChkSum }
+
+ where DestDEV, SrcDEV: 0x00: phone
+ 0xf8: PC (wakeup msg)
+ 0xe4: PC (normal msg)
+ FrameLength: length of data frame. Maximal 0x78. Longer
+ frames are divided into smaller.
+ MsgType: see List
+ {block}: main frame
+ id: request identity number 1..n, incremented after
+ the request is accepted
+ ChkSum: XOR on frame's all numbers
+
+Ack from Phone::
+
+ { DestDEV, 0x00, FrameLength, MsgType, {block} , id, ChkSum }
+
+ where DestDEV: taken from original request packet
+ FrameLength: 0x7f, when DestDEV = 0xe4
+ 0x7e, when DestDEV = 0xf8
+ MsgType: see List. Present only, when DestDEV = 0xf8
+ {block}: main frame. Present only, when DestDEV = 0xf8
+ id: request identity number 1..?, corresponding
+ to the original request packet id
+ the request is accepted
+ ChkSum: XOR on frame's all numbers
+
+Update: description above according to the
+http://www.gadgets.demon.co.uk/nokia21xx/protocol.html.
+
+Pavel Machek <pavel@ucw.cz> wrote:
+ 0x7e is actually registration acknowledge. Both have nothing to do
+ with DestDEV, except that special device needs to be used for
+ registration.
+
+Ack from Computer::
+
+ { 0x00, SrcDEV, 0x7f, id, ChkSum }
+
+ where SrcDEV: taken from response packet
+ id: request identity number 1..?, corresponding
+ to the response packet id
+ the request is accepted
+ ChkSum: XOR on frame's all numbers
+
+Port settings:
+ Speed 9600 bps, Bits 8, ParityOdd, Stop Bits 1, DTR and RTS logic 0
+
+In the MBUS bus, the phone has only one connector for transmission and
+reception.
+
+Because of this characteristics of the phone connector, every time that the
+PC writes into the phone it is writing as well into its own Rx. So every
+time the PC sends info into the phone it finds that same information in its
+own Rx buffers, like a mirror copy. This should be discarded.
+
+The communications is made like an old cb radio, only one
+talking at a time. Many transmission are made this way:
+
+* <computer sends request>
+* <phone sends ack>
+* <phone sends response>
+* <computer sends ack>
+
+Some frames are sent from phone without asking for them
+
+You have to implement collision protocol. IE. you should listen for
+what you are transmitting, and if it does not come back, you have
+collision.
+
+You should wait for bus to be free for 3 miliseconds before normal
+message, and for 2.5 miliseconds before acknowledge. You should wait
+for acknowledge for 200 miliseconds, then retransmit.
+
+Frame format for FBUS version 1
+-------------------------------
+
+All frames::
+
+ { FrameID, FrameLength, MsgType, {block}, SeqNo, ChkSum }
+
+ where FrameID: 0x01 Command frame from computer to Nokia
+ 0x02 ??? - Data call frame from computer to Nokia - ???
+ 0x03 Data call frame from Nokia to computer
+ 0x04 Command frame from Nokia to computer
+ FrameLength: {block} + 2
+ MsgType: see List
+ SeqNum: Sequence number of command in case where direction is
+ from ME to computer, the sequence number is
+ counting from 0x30 to 0x37 and resetting back to 0x30.
+ When direction is from computer to ME,
+ sequence number counts from 0x08 to 0x0f and resets back to 0x08.
+ It may not be required to be this way.
+ Sequence numbers are used in acknowledging commands.
+ ChkSum1: CRC = 0;
+ for (i = 0; i < (2 + CMD_LEN); i++)
+ CRC ^= frame[i];
+
+Frame format for FBUS version 2/Direct IRDA
+-------------------------------------------
+
+All frames::
+
+ { FrameID, DestDEV, SrcDEV, MsgType, 0x00, FrameLength, {block}, FramesToGo,
+ SeqNo, PaddingByte?, ChkSum1, ChkSum2 }
+
+ where FrameID: 0x1c: IR / FBUS
+ 0x1e: Serial / FBUS
+ DestDev, SrcDev: 0x00: mobile phone
+ 0x0c: TE (FBUS) [eg. PC]
+ MsgType: see List
+ FrameLength: {block} + 2 (+ 1 if PaddingByte exists)
+ FramesToGo: 0x01 means the last frame
+ SeqNo: [0xXY]
+ X: 4: first block
+ 0: continuing block
+ Y: sequence number
+ PaddingByte: 0x00 if FrameLength would be an odd number
+ anyways it doesn't exists
+ ChkSum1: XOR on frame's odd numbers
+ ChkSum2?: XOR on frame's even numbers
+
+Frame format for MBUS version 2
+-------------------------------
+
+Cable::
+
+ { FrameID, DestDEV, SrcDEV, MsgType, FrameLengthLO, FrameLengthHI, {block},
+ SeqNo, ChkSum }
+
+ where FrameID: 0x1f: Serial / M2BUS
+ DestDev, SrcDev: 0x00: mobile phone
+ 0x1d: TE (M2BUS)
+ 0x10: TE (M2BUS) (Service Software ?)
+ 0x04: Carkit?
+ 0x48: DLR3 cable?
+ 0xF8: unknown target?
+ 0xFF: global target?
+ MsgType: see List
+ FrameLength: {block}
+ SeqNo: sequence number
+ ChkSum: XOR on frame's all numbers
+
+Please note that M2BUS has only one checksum: XOR on frame[FrameID..SeqNo]
+
+Ack::
+
+ { FrameID, DestDEV, SrcDEV, 0x7f, Id_SeqNo, ChkSum }
+
+ where Id_SeqNo: Is the sequence number that you are
+ acknowleging (from the other part).
+
+Frame format for Infrared::
+
+ { FrameID, DestDEV, SrcDEV, MsgType, FrameLengthLo, FrameLengthHi, {block}}
+
+ where FrameID: 0x14
+ DestDev, SrcDev: 0x00: mobile phone
+ 0x0c: TE [eg. PC]
+ MsgType: see List
+ FrameLength: {block}
+
+Frame format for Bluetooth::
+
+ { FrameID, DestDEV, SrcDEV, MsgType, FrameLengthLo, FrameLengthHi, {block} }
+
+ where FrameID: 0x19
+ DestDev, SrcDev: 0x00: mobile phone
+ 0x10: TE [eg. PC]
+ MsgType: see List
+ FrameLength: {block}
+
+Frames list format::
+
+ hex: Short description
+ x msg desc { ... }
+ 0xXX -> one byte
+ 0xXXYY -> two bytes (== 0xXX, 0xYY)
+
+ where hex: message type
+ x: s=send (eg. to mobile), r=receive
+ { ... }: data after 0x00, 0x01 header
+ {+... }: raw data (without header)
+
+Misc (about MBUS version 2)
+---------------------------
+
+0x4E commands
++++++++++++++
+
+(sent from a 5160i TDMA / 6160i TDMA / 6185 CDMA or 7110 GSM
+phone to the uC in the DLR-3 cable)
+
+DLR-3 req:
+
+1F 48 00 4E 00 02 01 XX SQ CS
+
+ frame sent from the phone to the DLR-3 cable
+ (after 15kOhm resistor detected betw. XMIC (3) and DGND (9).)
+ DSR,DCD,CTS flow control data is coded into the 2nd databyte
+
+ XX:
+
+ * bit.0=/CTS
+ * bit.1=/DCD
+ * bit.2=CMD/DATA
+ * bit.3=DSR
+ * bit.4-7=0
+
+0x78 / 0x79 commands
+++++++++++++++++++++
+
+(used by handsfree carkit) Works also on GSM phones (5110 / 6110 / etc)
+
+These commands are used by the Nokia Carkits to switch the phone audio path to
+XMiC and XEAR , turn the phone on/off according to the car ignition, and
+control the PA loudspeaker amplifier in the carkit and the car radio mute
+output which silences the car radio during a call
+
+mute status tone:
+ 1F 04 00 78 00 04 01 02 0E 00 SQ CS
+ status indication = disable carkit audio amplifier (no audio / no tone)
+mute status tone:
+ 1F 04 00 78 00 04 01 02 0E 03 SQ CS
+ status indication = enable carkit audio amplifier (audio / tone present)
+mute status call:
+ 1F 04 00 78 00 04 01 02 07 00 SQ CS
+ status indication = disable radio mute output (no call)
+mute status call:
+ 1F 04 00 78 00 04 01 02 07 01 SQ CS
+ status indication = enable radio mute output (call active)
+enable ???:
+ 1F 04 00 78 00 04 01 02 08 01 SQ CS
+ status indication = enable ??? sent to HFU-2 on power on
+ byte 9 (07,08,0E) seems to be a pointer to a memory location,
+ byte 10 is the data at this memeory location.
+response from HFU:
+ 1F 00 04 78 00 03 02 01 03 SQ CS
+ response message from HFU-2 (use unknown)
+go HF and IGN on:
+ 1F 00 04 79 00 05 02 01 01 63 00 SQ CS
+ enables carkit mode + turns phone on + req. mute status
+go HF and IGN off:
+ 1F 00 04 79 00 05 02 01 01 61 00 SQ CS
+ enables carkit mode + powers phone off (1 min delay) + req. mute status
+ext. HS Offhk:
+ 1F 00 04 79 00 05 02 01 01 23 00 SQ CS
+ enables carkit mode + external handset lifted (OFF-Hook)
+ext. HS Onhk:
+ 1F 00 04 79 00 05 02 01 01 63 00 SQ CS
+ enables carkit mode + external handset put back (ON-Hook)
+ Ignition and Hook are coded into one byte
+
+ * bit.0 = 0:on power on 1:when in operation
+ * bit.1 = IGNITION STATUS
+ * bit.2 = x can be 1 or 0
+ * bit.3 = 0
+ * bit.4 = 0
+ * bit.5 = 1
+ * bit.6 = Hook (inverted)
+ * bit.7 = 0
+HFU-2 version:
+ 1F 00 04 79 00 12 02 01 02 06 00 56 20 30 36 2E 30 30 0A 48 46 55 32 00 SQ CS
+for HFU-2:
+ 1F 04 00 DA 00 02 00 02 SQ CS
+ function unknown - sent from Nokia phone to HFU-2mute output (call active )
+
+0xD0 commands
++++++++++++++
+
+init:
+ 1F 00 1D D0 00 01 04 SQ CS
+ sent by the Service Software or HFU-2 on startup
+init resp:
+ 1F 1D 00 D0 00 01 05 SQ CS
+ response from phone to above frame
diff --git a/docs/manual/protocol/s60-download-qr.png b/docs/manual/protocol/s60-download-qr.png
new file mode 100644
index 0000000..5661e57
--- /dev/null
+++ b/docs/manual/protocol/s60-download-qr.png
Binary files differ
diff --git a/docs/manual/protocol/s60.rst b/docs/manual/protocol/s60.rst
new file mode 100644
index 0000000..9eeecf9
--- /dev/null
+++ b/docs/manual/protocol/s60.rst
@@ -0,0 +1,167 @@
+.. _s60:
+
+Series60 Remote Protocol
+========================
+
+.. versionchanged:: 1.31.90
+ There were some changes in the protocol and applet has been renamed.
+
+.. note::
+
+ The original applet has been created for
+ <http://series60-remote.sourceforge.net/>. Gammu uses
+ extended version which is probably not fully compatible with original.
+
+.. warning::
+
+ Connection to S60 phones currently works only using Bluetooth.
+
+Choosing right version
+----------------------
+
+Before using this connection type, you need to install the applet to the
+phone. The applet can be found in ``contrib/s60`` directory and there are two
+variants of the applets:
+
+``gammu-s60-remote.sis``
+ Not signed applet, which can be installed to the phone if it has enabled
+ installation of unsigned applications (see :ref:`s60-unsigned`).
+
+ .. note::
+
+ This applet also lacks some capabilities, so for example you will not
+ be able to get network information.
+
+``gammu-s60-remote-sign.sis``
+ Applet ready for signing using `Open Signed Online`_. This will allow you
+ to install applet to your phone only (it is bound to IMEI), but you don't
+ need to allow installation of unsigned applications.
+
+.. note::
+
+ The best way of course would be to have properly signed applet. However
+ access to signing tools costs 200 USD per year, what is something we can
+ not afford right now.
+
+.. _s60-unsigned:
+
+Allowing installation of unsigned applications
+++++++++++++++++++++++++++++++++++++++++++++++
+
+For security reasons, Symbian defaults to install signed applications only. As
+getting properly signed applet is expensive for non commercial product like
+Gammu, you need to either sign applet yourself (the signature is valid for
+single phone) or allow installation of unsigned applications:
+
+1. Open :guilabel:`Application Manager`, it is usually located in :guilabel:`Control Center`.
+2. Press left soft key for :guilabel:`Options` menu.
+3. From the menu choose :guilabel:`Settings`.
+4. Change the :guilabel:`Software Installation` to :guilabel:`All`.
+5. Change the :guilabel:`Online certif. check` to :guilabel:`Off`.
+
+.. warning::
+
+ This allows installation of any not signed code to your phone. You should
+ consider reverting this change, once you have installed applet required
+ for Gammu.
+
+Installation
+------------
+
+To run the applet you need to install `Python for S60`_ 2.0 to the phone. You
+can either download it from their website, or just get mirrored installation
+package from <http://dl.cihar.com/gammu/s60/Python_2.0.0.sis>. This file is
+not distributed with Gammu due to licensing reasons.
+
+.. note::
+
+ On some phones, the Python for S60 2.0 will not start, in this case you
+ need to install some additional support libraries coming with Python for S60 2.0 -
+ :file:`pips.sis`, :file:`ssl.sis` and :file:`stdioserver.sis`. You can get
+ all of them at https://wammu.eu/s60/ as well.
+
+Installing Python for S60 and Series60 remote applet can be done in several
+ways:
+
+Installation using Gammu
+++++++++++++++++++++++++
+
+Gammu can transmit the applet to your phone automatically. Just configure it
+for use of BlueS60 connection (see :ref:`connecting-s60` chapter below) and
+invoke :option:`gammu install`:
+
+.. code-block:: sh
+
+ gammu install
+
+It will automatically transmit the applet to the phone. On some phones the
+installation will start automatically, on some you need to find received files
+in the inbox and install them manually from there.
+
+If you want to install Python for S60 as well you need to download it and
+place in folder where Gammu searches for installation images (you can
+configure it by setting :config:option:`DataPath`). For example:
+
+.. code-block:: sh
+
+ cd /usr/share/data/gammu
+ wget http://dl.cihar.com/gammu/s60/Python_2.0.0.sis
+ wget http://dl.cihar.com/gammu/s60/pips.sis
+
+Downloading from phone
+++++++++++++++++++++++
+
+Downloading files from the phone and installing them directly. You can
+download all required files from https://wammu.eu/s60/.
+
+.. figure:: s60-download-qr.png
+ :target: https://wammu.eu/s60/
+ :alt: QR code for download of applet.
+
+ QR code for download of applet.
+
+Manual Installation using Gammu
++++++++++++++++++++++++++++++++
+
+If the above mentioned :option:`gammu install` does not work for you, for
+example when you need to use different applet, you can still use Gammu to send
+files to the phone using :option:`gammu sendfile`.
+
+First you need to create ``~/.gammurc`` with following content:
+
+.. code-block:: ini
+
+ [gammu]
+ connection = blueobex
+ model = obexnone
+ device = 5C:57:C8:XX:XX:XX # Address of the phone
+
+And now you can send files to your phone:
+
+.. code-block:: sh
+
+ gammu sendfile Python_2.0.0.sis
+ gammu sendfile contrib/s60/gammu-s60-remote.sis
+
+Files should appear in inbox in your phone and you can install them from
+there.
+
+.. _connecting-s60:
+
+Connecting to Series60 phone
+----------------------------
+
+The Gammu configuration is simple, all you need to specify is correct
+:config:option:`Connection`:
+
+.. code-block:: ini
+
+ [gammu]
+ connection = blues60
+ device = 5C:57:C8:XX:XX:XX # Address of the phone
+
+Now you need to start the Series60 applet in the phone and Gammu should be
+able to talk to it.
+
+.. _Open Signed Online: https://www.symbiansigned.com/app/page/public/openSignedOnline.do
+.. _Python for S60: https://garage.maemo.org/projects/pys60/
diff --git a/docs/manual/protocol/samsung-gt.rst b/docs/manual/protocol/samsung-gt.rst
new file mode 100644
index 0000000..10aea3e
--- /dev/null
+++ b/docs/manual/protocol/samsung-gt.rst
@@ -0,0 +1,168 @@
+SAMSUNG GT calendar AT commands
+===============================
+
+Calendar Entries
+----------------
+
+``AT+SSHT=1`` - selects the Organizer->Calendar->Appointment entries
+(Spotkania in Polish version)
+
+``AT+SSHT=2`` - selects the Organizer->Calendar->Anniversary entries
+(Rocznice in Polish version)
+
+``AT+SSHT=5`` - selects the Organizer->Calendar->Holiday entries (Święta
+in Polish version)
+
+``AT+SSHT=6`` - selects the Organizer->Calendar->Important entries (Ważne
+in Polish version)
+
+``AT+SSHT=7`` - selects the Organizer->Calendar->Private entries (Prywatne
+in Polish version)
+
+After selection of type, we can read all items::
+
+ AT+SSHR=0
+ +SSHR:5,"5,test1","0,","0,",2010,5,12,2010,5,12,21,49,22,49,0,0,0,0,2010,5,30,,
+ +SSHR:3,"1,x","0,","0,",2010,6,2,2010,6,3,0,0,0,0,0,0,0,0,2010,5,30,,
+ +SSHR:1,"9,event1234","0,","0,",2010,6,7,2010,6,7,7,0,8,59,0,0,0,0,2010,5,30,,
+ +SSHR:4,"7,test123","0,","0,",2010,6,14,2010,6,14,21,37,22,37,0,0,0,0,2010,5,30,,
+ +SSHR:2,"7,Meeting","0,","0,",2010,6,15,2010,6,15,8,0,8,59,0,0,0,0,2010,5,30,,
+ OK
+
+Or just read a single item::
+
+ AT+SSHR=1
+ +SSHR:1,"9,Event 123","0,","0,",2010,6,7,2010,6,7,7,0,8,59,0,0,0,0,2010,5,30,,
+ OK
+
+Getting status (the last number appears to be number of notes)::
+
+ AT+SSHR=?
+ +SSHR:100,15,100,15,"1000000",2008,2024,5
+ OK
+
+You can also add or modify an item::
+
+ AT+SSHW="7,event01","16,details of event","5,where",2010,06,03,2010,06,04,12,31,13,42,0,0,0,0,2010,05,31,,,0
+
+It seems, that the last number in the above record specifies whether
+it is addition of a new record (0), or modification of the old record
+(then the number is the position of the item, as the first number
+listed after ``AT+SSHR=0``). e.g.::
+
+ AT+SSHW="13,event1234 new","0,","0,",2010,06,07,2010,06,07,07,00,08,59,0,0,0,0,2010,05,30,,,1
+
+
+Please note, that the format for writing is somehow different, than
+for reading - hour and minuts must be in two-digit form!
+The text fields (as shown above) are formatted in the following way:
+"number_of_characters_in_string,string"
+In all items above the first string is the name of event, the second
+string - details of event, the third one - place of event.
+The numeric fields encode start date (year,month,day), end date (year,
+month, day), start time (hour,minutes),
+end time (hour, minutes), four unknown to me (yet?) values, date of
+creation? (year month day) - the meaning of this date is not sure for
+me yet.
+
+To delete entries::
+
+ AT+SSHD=1
+ OK
+
+Task Entries
+------------
+
+There is yet another type, that can be selected by ``AT+SSHT=3``
+This is Organizer->Task::
+
+ AT+SSHT=3
+ OK
+ AT+SSHR=0
+ +SSHR:1,"10,Test event","10,2010-06-05",60823,11,25,60823,11,26,0,0,0,0,0,0,0,0,0
+ OK
+
+Please note, that the format of output is different, when you read the
+specific task::
+
+ AT+SSHR=1
+ +SSHR:1,"10,Test event","12,Some details",2010,6,3,2010,6,5,1,2010,6,4,10,11,0,2,0
+
+You can similarly add a new task::
+
+ AT+SSHW="9,New task1","10,0123456789",2010,06,21,2010,06,30,1,2010,06,27,08,07,0,2,0,0
+ +SSHW:2
+ OK
+
+Read it back::
+
+ AT+SSHR=2
+ +SSHR:2,"9,New task1","10,0123456789",2010,6,21,2010,6,30,1,2010,6,27,8,7,0,2,0
+ OK
+
+And modify::
+
+ AT+SSHW="9,New task1","11,New details",2010,06,21,2010,06,30,1,2010,06,27,08,07,0,2,0,2
+ +SSHW:2
+ OK
+ AT+SSHR=2
+ +SSHR:2,"9,New task1","11,New details",2010,6,21,2010,6,30,1,2010,6,27,8,7,0,2,0
+ OK
+
+To delete entries::
+
+ AT+SSHT=3
+ OK
+ AT+SSHR=0
+ +SSHR:1,"10,Test
+ event","10,2010-06-05",60823,11,25,60823,11,26,0,60823,11,26,0,0,0,0,0
+ +SSHR:2,"9,New task1","10,2010-06-30",60823,11,25,60823,11,26,0,60823,11,26,0,0,0,0,0
+ OK
+ AT+SSHD=1
+ OK
+ AT+SSHR=0
+ +SSHR:2,"9,New task1","10,2010-06-30",60823,11,25,60823,11,26,0,0,0,0,0,0,0,0,0
+ OK
+
+Memo Notes
+----------
+
+The memo notes are accessible via ``AT+OMM???`` commands::
+
+ AT+OMMI?
+ +OMMI:4,100,100
+
+We found, that we have 4 memos
+
+You can add a note::
+
+ AT+OMMW=0,"This is a note"
+ +OMMW:6
+ OK
+
+You can read it::
+
+ AT+OMMR=6
+ +OMMR:"This is a note"
+ OK
+
+You can modify it::
+
+ AT+OMMW=6,"This is a new modified note"
+ +OMMW:6
+ OK
+ AT+OMMR=6
+ +OMMR:"This is a new modified note"
+ OK
+
+To delete entries::
+
+ AT+OMMR=3
+ +OMMR:"Note number 3"
+ OK
+ AT+OMMD=3
+ OK
+ AT+OMMW=3,"New note number 3"
+ +CME ERROR:29
+
+ ERROR
diff --git a/docs/manual/protocol/samsung.rst b/docs/manual/protocol/samsung.rst
new file mode 100644
index 0000000..41e8344
--- /dev/null
+++ b/docs/manual/protocol/samsung.rst
@@ -0,0 +1,304 @@
+SAMSUNG Organizer AT commands
+=============================
+
+Get organizer information
++++++++++++++++++++++++++
+
+Invocation::
+
+ AT+ORGI?
+
+Example::
+
+ AT+ORGI?
+ +ORGI: 84,400,30,100,30
+ OK
+
+Return 5 values:
+
+par1
+ ( 84) Busy entries (1 to par1 of par2 possibles entries)
+par2
+ (400) Max possible entries
+par3
+ ( 30) Unknown
+par4
+ (100) Unknown
+par5
+ ( 30) Unknown
+
+
+Get organizer details
++++++++++++++++++++++
+
+Invocation::
+
+ AT+ORGR=number
+
+Get organizer details for index entry "number"
+Returns 24 values:
+
+Example 1::
+
+ AT+ORGR=10
+ +ORGR: 161,1,"Comprar lagrimas artificiales","Farmacia",2,4,2009,9,0,2,4,2009,9,10,"Farmacia",1,1,0,3,,,29,1,2010
+ OK
+
+Example 2::
+
+ AT+ORGR=15
+ +ORGR: 67,2,,"Laura Santiesteban Cabrera",3,11,2009,9,0,,,,,,,1,3,0,4,,,,,
+ OK
+
+Example 3::
+
+ AT+ORGR=19
+ +ORGR: 205,3,,"Cemento",13,3,2009,10,35,13,3,2009,,,,1,3,0,0,1,0,,,
+ OK
+
+Example 4::
+
+ AT+ORGR=23
+ +ORGR: 235,4,"Curso","Averiguar",13,3,2009,9,50,13,3,2009,9,59,,1,1,0,,,,,,
+ OK
+
++ORGR: AT+ORGR answer header
+
+par01
+ Pointer to real memory position
+par02
+ Organizer entry type (1=appointments, 2=aniversaries, 3=tasks, 4=miscellany )
+
+If par02 =1, appointment entry type
+
+par03
+ Organizer entry short name
+par04
+ Organizer entry detailed description
+par05
+ Start day
+par06
+ Start month
+par07
+ Start year
+par08
+ Start hour
+par09
+ Start minute
+par10
+ End day
+par11
+ End month
+par12
+ End year
+par13
+ End hour
+par14
+ End minute
+par15
+ Location
+par16
+ Alarm flag (0=no, 1=yes)
+par17
+ Alarm time unit (1=minutes, 2=hours, days, 4=weeks)
+par18
+ Alarm items quantity
+par19
+ Alarm repeat flag (0 or empty=no, 2=yes)
+par20
+ Empty
+par21
+ Empty
+par22
+ Repeat until day
+par23
+ Repeat until month
+par24
+ Repeat until year
+
+If par02 = 2, anniversary entry type
+
+par03
+ Empty
+par04
+ Occasion name
+par05
+ Alarm day
+par06
+ Alarm month
+par07
+ Alarm year
+par08
+ Alarm hour
+par09
+ Alarm minutes
+par10
+ Empty
+par11
+ Empty
+par12
+ Empty
+par13
+ Empty
+par14
+ Empty
+par15
+ Empty
+par16
+ Alarm flag (0=no, 1=yes)
+par17
+ Alarm time unit (1=minutes, 2=hours, days, 4=weeks)
+par18
+ Alarm items quantity
+par19
+ Repeat each year (0=no, 4=yes)
+par20
+ Empty
+par21
+ Empty
+par22
+ Empty
+par23
+ Empty
+par24
+ Empty
+
+If par02 = 3, task entry type
+
+par03
+ Empty
+par04
+ Task name
+par05
+ Start day
+par06
+ Start month
+par07
+ Start year
+par08
+ Alarm hour
+par09
+ Alarm minute
+par10
+ Due day
+par11
+ Due month
+par12
+ Due year
+par13
+ Empty
+par14
+ Empty
+par15
+ Empty
+par16
+ Alarm flag (0=no, 1=yes)
+par17
+ Alarm time unit (1=minutes, 2=hours, days, 4=weeks)
+par18
+ Alarm items quantity
+par19
+ Empty
+par20
+ Task priority (1=high, 2=normal, 3=low)
+par21
+ Task status (0=undone, 1=done)
+par22
+ Empty
+par23
+ Empty
+par24
+ Empty
+
+If par02 = 4, miscellany entry type
+
+par03
+ Entry name
+par04
+ Details
+par05
+ Start day
+par06
+ Start month
+par07
+ Start year
+par08
+ Start hour
+par09
+ Start minutes
+par10
+ End day
+par11
+ End month
+par12
+ End year
+par13
+ End hour
+par14
+ End minutes
+par15
+ Empty
+par16
+ Alarm flag (0=no, 1=yes)
+par17
+ Alarm time unit (1=minutes, 2=hours, days, 4=weeks)
+par18
+ Alarm items quantity
+par19
+ Empty
+par20
+ Empty
+par21
+ Empty
+par22
+ Empty
+par23
+ Empty
+par24
+ Empty
+
+Write organizer entry
++++++++++++++++++++++
+
+Invocation::
+
+ AT+ORGW=par0,par1,par2...par24
+
+Write organizer entry in memory location par0
+
+If par0=65535 then locate next empty entry on memory
+
+Example::
+
+ AT+ORGW=65535,0,4,"p2","p2",14,3,2009,2,23,14,3,2009,3,23,,0,0,0,,,,,,
+ +ORGW: 253,253
+ OK
+
+par1 to par24 has the same significance than in the AT+ORGR command
+
+Delete organizer entry
+++++++++++++++++++++++
+
+Invocation::
+
+ AT+ORGD=number
+
+Delete organizer entry of index "number"
+
+Example::
+
+ AT+ORGD=21
+
+ OK
+
+Notes
++++++
+
+Read command use index reference.
+
+Write command uses index and direct memory reference with special 65535 value to locate empty memory position.
+
+Delete command use direct memory reference, index are automatically reorganized.
+
+Hint: After create or delete an organizer entry, reread full information to update index table.
+
diff --git a/docs/manual/protocol/sonim.rst b/docs/manual/protocol/sonim.rst
new file mode 100644
index 0000000..60c2214
--- /dev/null
+++ b/docs/manual/protocol/sonim.rst
@@ -0,0 +1,37 @@
+Sonim AT Commands
+=================
+
+Filesystem access::
+
+ at*list=<path> - list directory content
+ (0=file, 1=subdirectory)
+ at*mkdir=<path> - make directory
+ at*rmdir=<path> - remove directory
+ at*remove=<path> - remove file
+ at*move=<srcpath>,<dstpath> - ? copy (move?) files
+ at*startul=<srcpath> - prepare file to upload (from phone)
+ returned data:
+ *STARTUL: <filesize_in_bytes>
+ at*startdl=<dstpath>,<filesize> - prepare file to download (to phone)
+ at*get - get base64 coded data chunk
+ returned data:
+ *GET: <chunklen>,<data>
+ at*get - get base64 coded data chunk
+ returned data:
+ *GET: <chunklen>,<data>
+ at*put=<no>,<len>,<data>,<chck> - put base64 coded data chunk
+ (no is chunk number, starting from 0)
+ (len is chunk length)
+ (last 4 characters is checksum ?)
+ at*end - end/finish file transfer operation
+ -------------------
+ at*syph=?,?.?,<path> - ? (add downloaded record to phonebook?)
+ at*syph=0,1,%d,%s
+ EXAMPLE:
+ AT*SYPH=0,1,74,/app/dir/tmp.dat
+ at*sysm=0,1,%d - ? SMS handling
+
+ ---
+ Phone has at least two directories from root, /app and /app3 .
+ at*list=/ gives error.
+
diff --git a/docs/manual/protocol/tdma_5120.rst b/docs/manual/protocol/tdma_5120.rst
new file mode 100644
index 0000000..a006e16
--- /dev/null
+++ b/docs/manual/protocol/tdma_5120.rst
@@ -0,0 +1,121 @@
+TDMA 5120
+=========
+
+Eduardo Spremolla at gnokii-users@mail.freesoftware.fsf.org
+
+After playing a while with my 5120i y find some use full frames:
+
+got from sneefing in Logomanger the get startup logo
+----------------------------------------------------
+
+request::
+
+ 40 {0x07, 0x07, 0x08, section} section goes from 1 to 6
+
+answer::
+
+ dd {+0x01, 0x00, 0x07, 0x08, (84 bytes => 84 cols x 8 bits bit0 first row )
+
+Can't figure out how to modify 6110 code to get & put the logo, not in a
+hi value to me now.
+
+got key press working
+---------------------
+
+As stated in http://www.flosys.com/tdma/n5160.html
+
+with frame: key-press::
+
+ D1 {+00 01 50 00 01 KY}
+
+this seems to press the key for a while. No release needed
+
+key-release:
+
+ D1 {+00 01 50 00 00 KY}
+
+keep the key press => got speedee dial::
+
+ D1 {+00 01 50 00 02 00 KY}
+
+get memory
+----------
+
+the getmemory::
+ 40 {+00 00 07 11 00 10 00 mem}
+
+get phonebook with the phone in bcd, but it seems to be a way to read
+chunks of memory with different numbers in the 6 place. in particular:
+
+get configuration pins::
+
+ 40 {+0x00, 0x00, 0x07, 0x11, 0x00, 0x0f, 0x00, 0x00 }
+
+get security code::
+
+ 40 {+0x00, 0x00, 0x07, 0x11, 0x00, 0x09, 0x00, 0x00 }
+
+get NAM data ::
+
+ 40 {+0x00, 0x00, 0x07, 0x11, 0x00, 0x08, 0x00, nam# }
+
+that last answers with::
+
+ dd {+01 00 11 00 08 00 00,
+
+03 04
+ home sys id
+01 4d
+ primary paggin channel
+02 c4
+ seconda paggin channel
+88 88 88 88 88
+ own #
+09 63 c2 09 03 00 0b
+ unknow
+0a
+ group id
+01
+ Access method
+01
+ local option
+0f
+ overload class
+20 41 43 41 45 00 00 00 00 00 00 00 00 00 00 00
+ alpha tag
+b3 4d
+ unknow
+01
+ NAM status
+11 11 11 11 11 00 00 00 00 00 00 00 00
+ unknow
+00 00 00 00 00 00 01 00 00 00 01 36
+ unknow
+01 4d
+ dedicate ch
+01 4e
+ dedicate B ch
+14
+ dedicate ch #
+14
+ dedicate B ch #
+00
+ msg center # len
+00
+ msg center in flag
+00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ msg center #
+08 01 80 70 8f dd 00 ef 00 00 00 00 00 00 00 00
+ unknow
+00 00 00 00 00
+ gate way #
+00 00 00
+ unknow
+
+More interesting ( and dangerous ) is than the 07 10 sequence in place
+of 07 11 in the request change the command from read to write.be care
+full!!! I almost ruin my 5125 with a 40 {+0x00, 0x00, 0x07, 0x10, 0x00,
+0x08, 0x00, 0x01 } frame , since the frame is ok, but the phone the
+write info from an area of the buffer that I did not send!!!!
+
+OK so far. Still looking for how to handle SMS......
diff --git a/docs/manual/python/data.rst b/docs/manual/python/data.rst
new file mode 100644
index 0000000..ff0170b
--- /dev/null
+++ b/docs/manual/python/data.rst
@@ -0,0 +1,42 @@
+:mod:`gammu.data` -- Generic data usable with Gammu
+===================================================
+
+.. module:: gammu.data
+ :synopsis: Provides various data, which can be useful with Gammu.
+
+.. data:: Connections
+
+ Provides list of connection strings known to Gammu. They can be used for
+ example when giving user a choice of connection string.
+
+.. data:: MemoryValueTypes
+
+ Provides list of types of memory entry values.
+
+.. data:: CalendarTypes
+
+ Provides list of calendar event types.
+
+.. data:: CalendarValueTypes
+
+ Provides list of types of calendar entry values.
+
+.. data:: TodoPriorities
+
+ Provides list of todo priorities.
+
+.. data:: TodoValueTypes
+
+ Provides list of types of todo entry values.
+
+.. data:: InternationalPrefixes
+
+ List of known international prefixes.
+
+.. data:: Errors
+
+ Mapping of text representation of errors to gammu error codes. Reverse to :data:`ErrorNumbers`.
+
+.. data:: ErrorNumbers
+
+ Mapping of gammu error codes to text representation. Reverse to :data:`Errors`.
diff --git a/docs/manual/python/examples.rst b/docs/manual/python/examples.rst
new file mode 100644
index 0000000..5f9a9d8
--- /dev/null
+++ b/docs/manual/python/examples.rst
@@ -0,0 +1,190 @@
+.. _python-gammu-examples:
+
+More python-gammu Examples
+==========================
+
+Many examples are available in ``examples/`` directory in the python-gammu
+sources.
+
+Sending a message
+-----------------
+
+.. code-block:: python
+
+ #!/usr/bin/env python
+ # Sample script to show how to send SMS
+
+ from __future__ import print_function
+ import gammu
+ import sys
+
+ # Create object for talking with phone
+ state_machine = gammu.StateMachine()
+
+ # Optionally load config file as defined by first parameter
+ if len(sys.argv) >= 2:
+ # Read the configuration from given file
+ state_machine.ReadConfig(Filename=sys.argv[1])
+ # Remove file name from args list
+ del sys.argv[1]
+ else:
+ # Read the configuration (~/.gammurc)
+ state_machine.ReadConfig()
+
+ # Check parameters
+ if len(sys.argv) != 2:
+ print('Usage: sendsms.py [configfile] RECIPIENT_NUMBER')
+ sys.exit(1)
+
+ # Connect to the phone
+ state_machine.Init()
+
+ # Prepare message data
+ # We tell that we want to use first SMSC number stored in phone
+ message = {
+ 'Text': 'python-gammu testing message',
+ 'SMSC': {'Location': 1},
+ 'Number': sys.argv[1],
+ }
+
+ # Actually send the message
+ state_machine.SendSMS(message)
+
+Sending a long message
+----------------------
+
+.. code-block:: python
+
+
+ #!/usr/bin/env python
+ # Sample script to show how to send long (multipart) SMS
+
+ from __future__ import print_function
+ import gammu
+ import sys
+
+ # Create object for talking with phone
+ state_machine = gammu.StateMachine()
+
+ # Optionally load config file as defined by first parameter
+ if len(sys.argv) >= 2:
+ # Read the configuration from given file
+ state_machine.ReadConfig(Filename=sys.argv[1])
+ # Remove file name from args list
+ del sys.argv[1]
+ else:
+ # Read the configuration (~/.gammurc)
+ state_machine.ReadConfig()
+
+ # Check parameters
+ if len(sys.argv) != 2:
+ print('Usage: sendlongsms.py [configfile] RECIPIENT_NUMBER')
+ sys.exit(1)
+
+ # Connect to the phone
+ state_machine.Init()
+
+
+ # Create SMS info structure
+ smsinfo = {
+ 'Class': -1,
+ 'Unicode': False,
+ 'Entries': [
+ {
+ 'ID': 'ConcatenatedTextLong',
+ 'Buffer':
+ 'Very long python-gammu testing message '
+ 'sent from example python script. '
+ 'Very long python-gammu testing message '
+ 'sent from example python script. '
+ 'Very long python-gammu testing message '
+ 'sent from example python script. '
+ }
+ ]}
+
+ # Encode messages
+ encoded = gammu.EncodeSMS(smsinfo)
+
+ # Send messages
+ for message in encoded:
+ # Fill in numbers
+ message['SMSC'] = {'Location': 1}
+ message['Number'] = sys.argv[1]
+
+ # Actually send the message
+ state_machine.SendSMS(message)
+
+Initiating a voice call
+-----------------------
+
+.. code-block:: python
+
+ #!/usr/bin/env python
+
+ from __future__ import print_function
+ import gammu
+ import sys
+
+ # Create object for talking with phone
+ state_machine = gammu.StateMachine()
+
+ # Read the configuration (~/.gammurc or from command line)
+ if len(sys.argv) >= 2:
+ state_machine.ReadConfig(Filename=sys.argv[1])
+ del sys.argv[1]
+ else:
+ state_machine.ReadConfig()
+
+ # Connect to the phone
+ state_machine.Init()
+
+ # Check whether we have a number to dial
+ if len(sys.argv) != 2:
+ print('Usage: dialvoice.py NUMBER')
+ sys.exit(1)
+
+ # Dial a number
+ state_machine.DialVoice(sys.argv[1])
+
+Reading calendar from phone
+---------------------------
+
+.. code-block:: python
+
+ #!/usr/bin/env python
+ # Example for reading calendar from phone
+
+ from __future__ import print_function
+ import gammu
+
+ # Create object for talking with phone
+ state_machine = gammu.StateMachine()
+
+ # Read the configuration (~/.gammurc)
+ state_machine.ReadConfig()
+
+ # Connect to the phone
+ state_machine.Init()
+
+ # Get number of calendar entries
+ status = state_machine.GetCalendarStatus()
+
+ remain = status['Used']
+
+ start = True
+
+ while remain > 0:
+ # Read the entry
+ if start:
+ entry = state_machine.GetNextCalendar(Start=True)
+ start = False
+ else:
+ entry = state_machine.GetNextCalendar(Location=entry['Location'])
+ remain = remain - 1
+
+ # Display it
+ print()
+ print('%-20s: %d' % ('Location', entry['Location']))
+ print('%-20s: %s' % ('Type', entry['Type']))
+ for v in entry['Entries']:
+ print('%-20s: %s' % (v['Type'], str(v['Value'])))
diff --git a/docs/manual/python/exceptions.rst b/docs/manual/python/exceptions.rst
new file mode 100644
index 0000000..771aaf0
--- /dev/null
+++ b/docs/manual/python/exceptions.rst
@@ -0,0 +1,375 @@
+:mod:`gammu.exception` -- Gammu exception handling
+==================================================
+
+.. module:: gammu.exception
+ :synopsis: Defines all exceptions used in Gammu.
+
+.. exception:: gammu.GSMError
+
+ Generic class as parent for all Gammu exceptions. This is never raised
+ directly, but should be used to catch any Gammu related exception.
+
+.. exception:: gammu.ERR_ABORTED
+
+ Exception corresponding to gammu error ERR_ABORTED.
+ Verbose error description: Operation aborted.
+
+.. exception:: gammu.ERR_BADFEATURE
+
+ Exception corresponding to gammu error ERR_BADFEATURE.
+ Verbose error description: Bad feature string in configuration.
+
+.. exception:: gammu.ERR_BUG
+
+ Exception corresponding to gammu error ERR_BUG.
+ Verbose error description: Nobody is perfect, some bug appeared in protocol implementation. Please contact authors.
+
+.. exception:: gammu.ERR_BUSY
+
+ Exception corresponding to gammu error ERR_BUSY.
+ Verbose error description: Command rejected because device was busy. Wait and restart.
+
+.. exception:: gammu.ERR_CANCELED
+
+ Exception corresponding to gammu error ERR_CANCELED.
+ Verbose error description: Transfer was canceled by phone, maybe you pressed cancel on phone.
+
+.. exception:: gammu.ERR_CANTOPENFILE
+
+ Exception corresponding to gammu error ERR_CANTOPENFILE.
+ Verbose error description: Can not open specified file.
+
+.. exception:: gammu.ERR_CORRUPTED
+
+ Exception corresponding to gammu error ERR_CORRUPTED.
+ Verbose error description: Corrupted data returned by phone.
+
+.. exception:: gammu.ERR_COULDNT_CONNECT
+
+ Exception corresponding to gammu error ERR_COULDNT_CONNECT.
+ Verbose error description: Could not connect to the server.
+
+.. exception:: gammu.ERR_COULDNT_RESOLVE
+
+ Exception corresponding to gammu error ERR_COULDNT_RESOLVE.
+ Verbose error description: Could not resolve the host name.
+
+.. exception:: gammu.ERR_DATACONVERTED
+
+ Exception corresponding to gammu error ERR_DATACONVERTED.
+ Verbose error description: Data were converted.
+
+.. exception:: gammu.ERR_DEVICEBUSY
+
+ Exception corresponding to gammu error ERR_DEVICEBUSY.
+ Verbose error description: Error opening device, it is already opened by other application.
+
+.. exception:: gammu.ERR_DEVICECHANGESPEEDERROR
+
+ Exception corresponding to gammu error ERR_DEVICECHANGESPEEDERROR.
+ Verbose error description: Error setting device speed. Maybe speed not supported.
+
+.. exception:: gammu.ERR_DEVICEDTRRTSERROR
+
+ Exception corresponding to gammu error ERR_DEVICEDTRRTSERROR.
+ Verbose error description: Error setting device DTR or RTS.
+
+.. exception:: gammu.ERR_DEVICELOCKED
+
+ Exception corresponding to gammu error ERR_DEVICELOCKED.
+ Verbose error description: Error opening device, it is locked.
+
+.. exception:: gammu.ERR_DEVICENODRIVER
+
+ Exception corresponding to gammu error ERR_DEVICENODRIVER.
+ Verbose error description: Error opening device. No required driver in operating system.
+
+.. exception:: gammu.ERR_DEVICENOPERMISSION
+
+ Exception corresponding to gammu error ERR_DEVICENOPERMISSION.
+ Verbose error description: Error opening device, you don't have permissions.
+
+.. exception:: gammu.ERR_DEVICENOTEXIST
+
+ Exception corresponding to gammu error ERR_DEVICENOTEXIST.
+ Verbose error description: Error opening device, it doesn't exist.
+
+.. exception:: gammu.ERR_DEVICENOTWORK
+
+ Exception corresponding to gammu error ERR_DEVICENOTWORK.
+ Verbose error description: Error opening device. Some hardware not connected/wrongly configured.
+
+.. exception:: gammu.ERR_DEVICEOPENERROR
+
+ Exception corresponding to gammu error ERR_DEVICEOPENERROR.
+ Verbose error description: Error opening device. Unknown, busy or no permissions.
+
+.. exception:: gammu.ERR_DEVICEPARITYERROR
+
+ Exception corresponding to gammu error ERR_DEVICEPARITYERROR.
+ Verbose error description: Can't set parity on the device.
+
+.. exception:: gammu.ERR_DEVICEREADERROR
+
+ Exception corresponding to gammu error ERR_DEVICEREADERROR.
+ Verbose error description: Error during reading from the device.
+
+.. exception:: gammu.ERR_DEVICEWRITEERROR
+
+ Exception corresponding to gammu error ERR_DEVICEWRITEERROR.
+ Verbose error description: Error writing to the device.
+
+.. exception:: gammu.ERR_DISABLED
+
+ Exception corresponding to gammu error ERR_DISABLED.
+ Verbose error description: Desired functionality has been disabled on compile time.
+
+.. exception:: gammu.ERR_EMPTY
+
+ Exception corresponding to gammu error ERR_EMPTY.
+ Verbose error description: Entry is empty.
+
+.. exception:: gammu.ERR_EMPTYSMSC
+
+ Exception corresponding to gammu error ERR_EMPTYSMSC.
+ Verbose error description: No SMSC number given. Provide it manually or use the one configured in phone.
+
+.. exception:: gammu.ERR_FILEALREADYEXIST
+
+ Exception corresponding to gammu error ERR_FILEALREADYEXIST.
+ Verbose error description: File with specified name already exists.
+
+.. exception:: gammu.ERR_FILENOTEXIST
+
+ Exception corresponding to gammu error ERR_FILENOTEXIST.
+ Verbose error description: File with specified name doesn't exist.
+
+.. exception:: gammu.ERR_FILENOTSUPPORTED
+
+ Exception corresponding to gammu error ERR_FILENOTSUPPORTED.
+ Verbose error description: File format not supported by Gammu.
+
+.. exception:: gammu.ERR_FOLDERNOTEMPTY
+
+ Exception corresponding to gammu error ERR_FOLDERNOTEMPTY.
+ Verbose error description: Folder must be empty.
+
+.. exception:: gammu.ERR_FOLDERPART
+
+ Exception corresponding to gammu error ERR_FOLDERPART.
+ Verbose error description: Only part of folder has been listed.
+
+.. exception:: gammu.ERR_FRAMENOTREQUESTED
+
+ Exception corresponding to gammu error ERR_FRAMENOTREQUESTED.
+ Verbose error description: Frame not requested right now. See <https://wammu.eu/support/bugs/> for information how to report it.
+
+.. exception:: gammu.ERR_FULL
+
+ Exception corresponding to gammu error ERR_FULL.
+ Verbose error description: Memory full.
+
+.. exception:: gammu.ERR_GETTING_SMSC
+
+ Exception corresponding to gammu error ERR_GETTING_SMSC.
+ Verbose error description: Failed to get SMSC number from phone.
+
+.. exception:: gammu.ERR_GNAPPLETWRONG
+
+ Exception corresponding to gammu error ERR_GNAPPLETWRONG.
+ Verbose error description: Wrong GNAPPLET version in phone. Use version from currently used Gammu.
+
+.. exception:: gammu.ERR_INSIDEPHONEMENU
+
+ Exception corresponding to gammu error ERR_INSIDEPHONEMENU.
+ Verbose error description: You're inside phone menu (maybe editing?). Leave it and try again.
+
+.. exception:: gammu.ERR_INSTALL_NOT_FOUND
+
+ Exception corresponding to gammu error ERR_INSTALL_NOT_FOUND.
+ Verbose error description: Installation data not found, please consult debug log and/or documentation for more details.
+
+.. exception:: gammu.ERR_INVALIDDATA
+
+ Exception corresponding to gammu error ERR_INVALIDDATA.
+ Verbose error description: Invalid data given to phone.
+
+.. exception:: gammu.ERR_INVALIDDATETIME
+
+ Exception corresponding to gammu error ERR_INVALIDDATETIME.
+ Verbose error description: Invalid date or time specified.
+
+.. exception:: gammu.ERR_INVALIDLOCATION
+
+ Exception corresponding to gammu error ERR_INVALIDLOCATION.
+ Verbose error description: Invalid location. Maybe too high?
+
+.. exception:: gammu.ERR_MEMORY
+
+ Exception corresponding to gammu error ERR_MEMORY.
+ Verbose error description: Phone memory error, maybe it is read only.
+
+.. exception:: gammu.ERR_MOREMEMORY
+
+ Exception corresponding to gammu error ERR_MOREMEMORY.
+ Verbose error description: More memory required...
+
+.. exception:: gammu.ERR_NEEDANOTHERANSWER
+
+ Exception corresponding to gammu error ERR_NEEDANOTHERANSWER.
+ Verbose error description: Phone module need to send another answer frame.
+
+.. exception:: gammu.ERR_NETWORK_ERROR
+
+ Exception corresponding to gammu error ERR_NETWORK_ERROR.
+ Verbose error description: Network error.
+
+.. exception:: gammu.ERR_NONE
+
+ Exception corresponding to gammu error ERR_NONE.
+ Verbose error description: No error.
+
+.. exception:: gammu.ERR_NONE_SECTION
+
+ Exception corresponding to gammu error ERR_NONE_SECTION.
+ Verbose error description: No such section exists.
+
+.. exception:: gammu.ERR_NOSERVICE
+
+ Exception corresponding to gammu error ERR_NOSERVICE.
+ Verbose error description: Service configuration is missing.
+
+.. exception:: gammu.ERR_NOSIM
+
+ Exception corresponding to gammu error ERR_NOSIM.
+ Verbose error description: Can not access SIM card.
+
+.. exception:: gammu.ERR_NOTCONNECTED
+
+ Exception corresponding to gammu error ERR_NOTCONNECTED.
+ Verbose error description: Phone is not connected.
+
+.. exception:: gammu.ERR_NOTIMPLEMENTED
+
+ Exception corresponding to gammu error ERR_NOTIMPLEMENTED.
+ Verbose error description: Functionality not implemented. You are welcome to help authors with it.
+
+.. exception:: gammu.ERR_NOTRUNNING
+
+ Exception corresponding to gammu error ERR_NOTRUNNING.
+ Verbose error description: Service is not running.
+
+.. exception:: gammu.ERR_NOTSUPPORTED
+
+ Exception corresponding to gammu error ERR_NOTSUPPORTED.
+ Verbose error description: Function not supported by phone.
+
+.. exception:: gammu.ERR_OTHERCONNECTIONREQUIRED
+
+ Exception corresponding to gammu error ERR_OTHERCONNECTIONREQUIRED.
+ Verbose error description: Current connection type doesn't support called function.
+
+.. exception:: gammu.ERR_PERMISSION
+
+ Exception corresponding to gammu error ERR_PERMISSION.
+ Verbose error description: Operation not allowed by phone.
+
+.. exception:: gammu.ERR_PHONEOFF
+
+ Exception corresponding to gammu error ERR_PHONEOFF.
+ Verbose error description: Phone is disabled and connected to charger.
+
+.. exception:: gammu.ERR_PHONE_INTERNAL
+
+ Exception corresponding to gammu error ERR_PHONE_INTERNAL.
+ Verbose error description: Internal phone error.
+
+.. exception:: gammu.ERR_READ_ONLY
+
+ Exception corresponding to gammu error ERR_READ_ONLY.
+ Verbose error description: Entry is read only.
+
+.. exception:: gammu.ERR_SECURITYERROR
+
+ Exception corresponding to gammu error ERR_SECURITYERROR.
+ Verbose error description: Security error. Maybe no PIN?
+
+.. exception:: gammu.ERR_SHOULDBEFILE
+
+ Exception corresponding to gammu error ERR_SHOULDBEFILE.
+ Verbose error description: You have to give file name and not folder name.
+
+.. exception:: gammu.ERR_SHOULDBEFOLDER
+
+ Exception corresponding to gammu error ERR_SHOULDBEFOLDER.
+ Verbose error description: You have to give folder name and not file name.
+
+.. exception:: gammu.ERR_SOURCENOTAVAILABLE
+
+ Exception corresponding to gammu error ERR_SOURCENOTAVAILABLE.
+ Verbose error description: Some functions not available for your system (disabled in config or not implemented).
+
+.. exception:: gammu.ERR_SPECIFYCHANNEL
+
+ Exception corresponding to gammu error ERR_SPECIFYCHANNEL.
+ Verbose error description: Bluetooth configuration requires channel option.
+
+.. exception:: gammu.ERR_TIMEOUT
+
+ Exception corresponding to gammu error ERR_TIMEOUT.
+ Verbose error description: No response in specified timeout. Probably phone not connected.
+
+.. exception:: gammu.ERR_UNCONFIGURED
+
+ Exception corresponding to gammu error ERR_UNCONFIGURED.
+ Verbose error description: Gammu is not configured.
+
+.. exception:: gammu.ERR_UNKNOWN
+
+ Exception corresponding to gammu error ERR_UNKNOWN.
+ Verbose error description: Unknown error.
+
+.. exception:: gammu.ERR_UNKNOWNCONNECTIONTYPESTRING
+
+ Exception corresponding to gammu error ERR_UNKNOWNCONNECTIONTYPESTRING.
+ Verbose error description: Unknown connection type string. Check config file.
+
+.. exception:: gammu.ERR_UNKNOWNFRAME
+
+ Exception corresponding to gammu error ERR_UNKNOWNFRAME.
+ Verbose error description: Unknown frame. See <https://wammu.eu/support/bugs/> for information how to report it.
+
+.. exception:: gammu.ERR_UNKNOWNMODELSTRING
+
+ Exception corresponding to gammu error ERR_UNKNOWNMODELSTRING.
+ Verbose error description: Unknown model type string. Check config file.
+
+.. exception:: gammu.ERR_UNKNOWNRESPONSE
+
+ Exception corresponding to gammu error ERR_UNKNOWNRESPONSE.
+ Verbose error description: Unknown response from phone. See <https://wammu.eu/support/bugs/> for information how to report it.
+
+.. exception:: gammu.ERR_USING_DEFAULTS
+
+ Exception corresponding to gammu error ERR_USING_DEFAULTS.
+ Verbose error description: Using default values.
+
+.. exception:: gammu.ERR_WORKINPROGRESS
+
+ Exception corresponding to gammu error ERR_WORKINPROGRESS.
+ Verbose error description: Function is currently being implemented. If you want to help, please contact authors.
+
+.. exception:: gammu.ERR_WRITING_FILE
+
+ Exception corresponding to gammu error ERR_WRITING_FILE.
+ Verbose error description: Error writing file to disk.
+
+.. exception:: gammu.ERR_WRONGCRC
+
+ Exception corresponding to gammu error ERR_WRONGCRC.
+ Verbose error description: CRC error.
+
+.. exception:: gammu.ERR_WRONGFOLDER
+
+ Exception corresponding to gammu error ERR_WRONGFOLDER.
+ Verbose error description: Wrong folder used.
diff --git a/docs/manual/python/gammu.rst b/docs/manual/python/gammu.rst
new file mode 100644
index 0000000..ef1009d
--- /dev/null
+++ b/docs/manual/python/gammu.rst
@@ -0,0 +1,1375 @@
+:mod:`gammu` -- Mobile phone access
+===================================
+
+.. module:: gammu
+ :synopsis: Provides access to mobile phones.
+
+This module wraps all python-gammu functionality.
+
+:class:`gammu.StateMachine`
+---------------------------
+
+.. class:: StateMachine(Locale)
+
+ StateMachine object, that is used for communication with phone.
+
+ :param Locale: What locales to use for gammu error messages, default is ``auto`` which does autodetection according to user locales
+ :type Locale: string
+
+
+ .. method:: AddCalendar(Value)
+
+ Adds calendar entry.
+
+ :param Value: Calendar entry data, see :ref:`cal_obj`
+ :type Value: dict
+ :return: Location of newly created entry
+ :rtype: int
+
+
+ .. method:: AddCategory(Type, Name)
+
+ Adds category to phone.
+
+ :param Type: Type of category to read, one of ``ToDo``, ``Phonebook``
+ :type Type: string
+ :param Name: Category name
+ :type Name: string
+ :return: Location of created category
+ :rtype: int
+
+
+ .. method:: AddFilePart(File)
+
+ Adds file part to filesystem.
+
+ :param File: File data, see :ref:`file_obj`
+ :type File: dict
+ :return: File data for subsequent calls (Finished indicates transfer has been completed)
+ :rtype: dict
+
+
+ .. method:: AddFolder(ParentFolderID, Name)
+
+ Adds folder to filesystem.
+
+ :param ParentFolderID: Folder where to create subfolder
+ :type ParentFolderID: string
+ :param Name: New folder name
+ :type Name: string
+ :return: New folder ID.
+ :rtype: string
+
+
+ .. method:: AddMemory(Value)
+
+ Adds memory (phonebooks or calls) entry.
+
+ :param Value: Memory entry, see :ref:`pbk_obj`
+ :type Value: dict
+ :return: Location of created entry
+ :rtype: int
+
+
+ .. method:: AddSMS(Value)
+
+ Adds SMS to specified folder.
+
+ :param Value: SMS data, see :ref:`sms_obj`
+ :type Value: dict
+ :return: Tuple for location and folder.
+ :rtype: tuple
+
+
+ .. method:: AddSMSFolder(Name)
+
+ Creates SMS folder.
+
+ :param Name: Name of new folder
+ :type Name: string
+ :return: None
+ :rtype: None
+
+
+ .. method:: AddToDo(Value)
+
+ Adds ToDo in phone.
+
+ :param Value: ToDo data, see :ref:`todo_obj`
+ :type Value: dict
+ :return: Location of created entry
+ :rtype: int
+
+
+ .. method:: AnswerCall(ID, All)
+
+ Accept current incoming call.
+
+ :param ID: ID of call
+ :type ID: int
+ :param All: Answer all calls? Defaults to True
+ :type All: bool
+ :return: None
+ :rtype: None
+
+ .. method:: CancelAllDiverts()
+
+ .. versionadded:: 1.31.90
+
+ Cancels all call diverts.
+
+ :return: None
+ :rtype: None
+
+
+ .. method:: CancelCall(ID, All)
+
+ Deny current incoming call.
+
+ :param ID: ID of call
+ :type ID: int
+ :param All: Cancel all calls? Defaults to True
+ :type All: bool
+ :return: None
+ :rtype: None
+
+
+ .. method:: ConferenceCall(ID)
+
+ Initiates conference call.
+
+ :param ID: ID of call
+ :type ID: int
+ :return: None
+ :rtype: None
+
+
+ .. method:: DeleteAllCalendar()
+
+ Deletes all calendar entries.
+
+ :return: None
+ :rtype: None
+
+
+ .. method:: DeleteAllMemory(Type)
+
+ Deletes all memory (phonebooks or calls) entries of specified type.
+
+ :param Type: Memory type, one of ``ME``, ``SM``, ``ON``, ``DC``, ``RC``, ``MC``, ``MT``, ``FD``, ``VM``
+ :type Type: string
+ :return: None
+ :rtype: None
+
+
+ .. method:: DeleteAllToDo()
+
+ Deletes all todo entries in phone.
+
+ :return: None
+ :rtype: None
+
+
+ .. method:: DeleteCalendar(Location)
+
+ Deletes calendar entry.
+
+ :param Location: Calendar entry to delete
+ :type Location: int
+ :return: None
+ :rtype: None
+
+
+ .. method:: DeleteFile(FileID)
+
+ Deletes file from filesystem.
+
+ :param FileID: File to delete
+ :type FileID: string
+ :return: None
+ :rtype: None
+
+
+ .. method:: DeleteFolder(FolderID)
+
+ Deletes folder on filesystem.
+
+ :param FolderID: Folder to delete
+ :type FolderID: string
+ :return: None
+ :rtype: None
+
+
+ .. method:: DeleteMemory(Type, Location)
+
+ Deletes memory (phonebooks or calls) entry.
+
+ :param Type: Memory type, one of ``ME``, ``SM``, ``ON``, ``DC``, ``RC``, ``MC``, ``MT``, ``FD``, ``VM``
+ :type Type: string
+ :param Location: Location of entry to delete
+ :type Location: int
+ :return: None
+ :rtype: None
+
+
+ .. method:: DeleteSMS(Folder, Location)
+
+ Deletes SMS.
+
+ :param Folder: Folder where to read entry (0 is emulated flat memory)
+ :type Folder: int
+ :param Location: Location of entry to delete
+ :type Location: int
+ :return: None
+ :rtype: None
+
+ .. note::
+
+ In most cases you want to use Folder=0 as in this mode it will accept locations
+ as GetNextSMS returns them.
+
+
+ .. method:: DeleteSMSFolder(ID)
+
+ Deletes SMS folder.
+
+ :param ID: Index of folder to delete
+ :type ID: int
+ :return: None
+ :rtype: None
+
+
+ .. method:: DeleteToDo(Location)
+
+ Deletes ToDo entry in phone.
+
+ :param Location: Location of entry to delete
+ :type Location: int
+ :return: None
+ :rtype: None
+
+
+ .. method:: DialService(Number)
+
+ Dials number and starts voice call.
+
+ :param Number: Number to dial
+ :type Number: string
+ :return: None
+ :rtype: None
+
+
+ .. method:: DialVoice(Number, ShowNumber)
+
+ Dials number and starts voice call.
+
+ :param Number: Number to dial
+ :type Number: string
+ :param ShowNumber: Identifies whether to enable CLIR (None = keep default phone settings). Default is None
+ :type ShowNumber: bool or None
+ :return: None
+ :rtype: None
+
+
+ .. method:: EnterSecurityCode(Type, Code, NewPIN)
+
+ Enters security code.
+
+ :param Type: What code to enter, one of ``PIN``, ``PUK``, ``PIN2``, ``PUK2``, ``Phone``.
+ :type Type: string
+ :param Code: Code value
+ :type Code: string
+ :param NewPIN: New PIN value in case entering PUK
+ :type NewPIN: string
+ :return: None
+ :rtype: None
+
+
+ .. method:: GetAlarm(Location)
+
+ Reads alarm set in phone.
+
+ :param Location: Which alarm to read. Many phone support only one alarm. Default is 1.
+ :type Location: int
+ :return: Alarm dict
+ :rtype: dict
+
+
+ .. method:: GetBatteryCharge()
+
+ Gets information about battery charge and phone charging state.
+
+ :return: Dictionary containing information about battery state (BatteryPercent and ChargeState)
+ :rtype: dict
+
+
+ .. method:: GetCalendar(Location)
+
+ Retrieves calendar entry.
+
+ :param Location: Calendar entry to read
+ :type Location: int
+ :return: Dictionary with calendar values, see :ref:`cal_obj`
+ :rtype: dict
+
+
+ .. method:: GetCalendarStatus()
+
+ Retrieves calendar status (number of used entries).
+
+ :return: Dictionary with calendar status (Used)
+ :rtype: dict
+
+
+ .. method:: GetCallDivert(Divert = 'AllTypes', Type = 'All')
+
+ .. versionadded:: 1.31.90
+
+ Gets call diverts.
+
+ :param Divert: When to do the divert.
+ :type Divert: :ref:`divert-type`
+ :param Type: What call types to divert.
+ :type Type: :ref:`divert-call`
+ :return: List of call diverts.
+ :rtype: :ref:`divert-entry`
+
+ .. method:: GetCategory(Type, Location)
+
+ Reads category from phone.
+
+ :param Type: Type of category to read, one of ``ToDo``, ``Phonebook``
+ :type Type: string
+ :param Location: Location of category to read
+ :type Location: int
+ :return: Category name as string
+ :rtype: string
+
+
+ .. method:: GetCategoryStatus(Type)
+
+ Reads category status (number of used entries) from phone.
+
+ :param Type: Type of category to read, one of ``ToDo``, ``Phonebook``
+ :type Type: string
+ :return: Dictionary containing information about category status (Used)
+ :rtype: dict
+
+
+ .. method:: GetConfig(Section)
+
+ Gets specified config section. Configuration consists of all params which can be defined in gammurc config file:
+ - Model
+ - DebugLevel
+ - Device
+ - Connection
+ - SyncTime
+ - LockDevice
+ - DebugFile
+ - StartInfo
+ - UseGlobalDebugFile
+
+ :param Section: Index of config section to read. Defaults to 0.
+ :type Section: int
+ :return: Dictionary containing configuration
+ :rtype: dict
+
+
+ .. method:: GetDateTime()
+
+ Reads date and time from phone.
+
+ :return: Date and time from phone as datetime.datetime object.
+ :rtype: datetime.datetime
+
+
+ .. method:: GetDisplayStatus()
+
+ Acquired display status.
+ :return: List of indicators displayed on display
+ :rtype: list
+
+
+ .. method:: GetFilePart(File)
+
+ Gets file part from filesystem.
+
+ :param File: File data, see :ref:`file_obj`
+ :type File: dict
+ :return: File data for subsequent calls (Finished indicates transfer has been completed), see :ref:`file_obj`
+ :rtype: dict
+
+
+ .. method:: GetFileSystemStatus()
+
+ Acquires filesystem status.
+
+ :return: Dictionary containing filesystem status (Used and Free)
+ :rtype: dict
+
+
+ .. method:: GetFirmware()
+
+ Reads firmware information from phone.
+
+ :return: Tuple from version, date and numeric version.
+ :rtype: tuple
+
+
+ .. method:: GetFolderListing(Folder, Start)
+
+ Gets next filename from filesystem folder.
+
+ :param Folder: Folder to list
+ :type Folder: string
+ :param Start: Whether we're starting listing. Defaults to False.
+ :type Start: bool
+ :return: File data as dict, see :ref:`file_obj`
+ :rtype: dict
+
+
+ .. method:: GetHardware()
+
+ Gets hardware information about device.
+
+ :return: Hardware information as string.
+ :rtype: string
+
+
+ .. method:: GetIMEI()
+
+ Reads IMEI/serial number from phone.
+
+ :return: IMEI of phone as string.
+ :rtype: string
+
+
+ .. method:: GetLocale()
+
+ Gets locale information from phone.
+
+ :return: Dictionary of locale settings. :meth:`SetLocale` lists them all.
+ :rtype: dict
+
+
+ .. method:: GetManufactureMonth()
+
+ Gets month when device was manufactured.
+
+ :return: Month of manufacture as string.
+ :rtype: string
+
+
+ .. method:: GetManufacturer()
+
+ Reads manufacturer from phone.
+
+ :return: String with manufacturer name
+ :rtype: string
+
+
+ .. method:: GetMemory(Type, Location)
+
+ Reads entry from memory (phonebooks or calls). Which entry should be read is defined in entry.
+
+ :param Type: Memory type, one of ``ME``, ``SM``, ``ON``, ``DC``, ``RC``, ``MC``, ``MT``, ``FD``, ``VM``
+ :type Type: string
+ :return: Memory entry as dict, see :ref:`pbk_obj`
+ :rtype: dict
+
+
+ .. method:: GetMemoryStatus(Type)
+
+ Gets memory (phonebooks or calls) status (eg. number of used and free entries).
+
+ :param Type: Memory type, one of ``ME``, ``SM``, ``ON``, ``DC``, ``RC``, ``MC``, ``MT``, ``FD``, ``VM``
+ :type Type: string
+ :return: Dictionary with information about memory (Used and Free)
+ :rtype: dict
+
+
+ .. method:: GetModel()
+
+ Reads model from phone.
+
+ :return: Tuple containing gammu identification and real model returned by phone.
+ :rtype: tuple
+
+
+ .. method:: GetNetworkInfo()
+
+ Gets network information.
+
+ :return: Dictionary with information about network (NetworkName, State, NetworkCode, CID and LAC)
+ :rtype: dict
+
+
+ .. method:: GetNextCalendar(Start, Location)
+
+ Retrieves calendar entry. This is useful for continuous reading of all calendar entries.
+
+ :param Start: Whether to start. This can not be used together with Location
+ :type Start: bool
+ :param Location: Last read location. This can not be used together with Start
+ :type Location: int
+ :return: Dictionary with calendar values, see :ref:`cal_obj`
+ :rtype: dict
+
+
+ .. method:: GetNextFileFolder(Start)
+
+ Gets next filename from filesystem.
+
+ :param Start: Whether we're starting listing. Defaults to False.
+ :type Start: bool
+ :return: File data as dict, see :ref:`file_obj`
+ :rtype: dict
+
+
+ .. method:: GetNextMemory(Type, Start, Location)
+
+ Reads entry from memory (phonebooks or calls). Which entry should be read is defined in entry. This can be easily used for reading all entries.
+
+ :param Type: Memory type, one of ``ME``, ``SM``, ``ON``, ``DC``, ``RC``, ``MC``, ``MT``, ``FD``, ``VM``
+ :type Type: string
+ :param Start: Whether to start. This can not be used together with Location
+ :type Start: bool
+ :param Location: Last read location. This can not be used together with Start
+ :type Location: int
+ :return: Memory entry as dict, see :ref:`pbk_obj`
+ :rtype: dict
+
+
+ .. method:: GetNextRootFolder(Folder)
+
+ Gets next root folder from filesystem. Start with empty folder name.
+
+ :param Folder: Previous read folder. Start with empty folder name.
+ :type Folder: string
+ :return: Structure with folder information
+
+
+ .. method:: GetNextSMS(Folder, Start, Location)
+
+ Reads next (or first if start set) SMS message. This might be faster for some phones than using :meth:`GetSMS` for each message.
+
+ :param Folder: Folder where to read entry (0 is emulated flat memory)
+ :type Folder: int
+ :param Start: Whether to start. This can not be used together with Location
+ :type Start: bool
+ :param Location: Location last read entry. This can not be used together with Start
+ :type Location: int
+ :return: Dictionary with SMS data, see :ref:`sms_obj`
+ :rtype: dict
+
+
+ .. method:: GetNextToDo(Start, Location)
+
+ Reads ToDo from phone.
+
+ :param Start: Whether to start. This can not be used together with Location
+ :type Start: bool
+ :param Location: Last read location. This can not be used together with Start
+ :type Location: int
+ :return: Dictionary with ToDo values, see :ref:`todo_obj`
+ :rtype: dict
+
+
+ .. method:: GetOriginalIMEI()
+
+ Gets original IMEI from phone.
+
+ :return: Original IMEI of phone as string.
+ :rtype: string
+
+
+ .. method:: GetPPM()
+
+ Gets PPM (Post Programmable Memory) from phone.
+
+ :return: PPM as string
+ :rtype: string
+
+
+ .. method:: GetProductCode()
+
+ Gets product code of device.
+ :return: Product code as string.
+ :rtype: string
+
+
+ .. method:: GetSIMIMSI()
+
+ Gets SIM IMSI from phone.
+
+ :return: SIM IMSI as string
+ :rtype: string
+
+
+ .. method:: GetSMS(Folder, Location)
+
+ Reads SMS message.
+
+ :param Folder: Folder where to read entry (0 is emulated flat memory)
+ :type Folder: int
+ :param Location: Location of entry to read
+ :type Location: int
+ :return: Dictionary with SMS data, see :ref:`sms_obj`
+ :rtype: dict
+
+
+ .. method:: GetSMSC(Location)
+
+ Gets SMS Service Center number and SMS settings.
+
+ :param Location: Location of entry to read. Defaults to 1
+ :type Location: int
+ :return: Dictionary with SMSC information, see :ref:`smsc_obj`
+ :rtype: dict
+
+
+ .. method:: GetSMSFolders()
+
+ Returns SMS folders information.
+
+ :return: List of SMS folders.
+ :rtype: list
+
+
+ .. method:: GetSMSStatus()
+
+ Gets information about SMS memory (read/unread/size of memory for both SIM and phone).
+
+ :return: Dictionary with information about phone memory (SIMUnRead, SIMUsed, SIMSize, PhoneUnRead, PhoneUsed, PhoneSize and TemplatesUsed)
+ :rtype: dict
+
+
+ .. method:: GetSecurityStatus()
+
+ Queries whether some security code needs to be entered.
+
+ :return: String indicating which code needs to be entered or None if none is needed
+ :rtype: string
+
+
+ .. method:: GetSignalQuality()
+
+ Reads signal quality (strength and error rate).
+
+ :return: Dictionary containing information about signal state (SignalStrength, SignalPercent and BitErrorRate)
+ :rtype: dict
+
+
+ .. method:: GetSpeedDial(Location)
+
+ Gets speed dial.
+
+ :param Location: Location of entry to read
+ :type Location: int
+ :return: Dictionary with speed dial (Location, MemoryLocation, MemoryNumberID, MemoryType)
+ :rtype: dict
+
+
+ .. method:: GetToDo(Location)
+
+ Reads ToDo from phone.
+
+ :param Location: Location of entry to read
+ :type Location: int
+ :return: Dictionary with ToDo values, see :ref:`todo_obj`
+ :rtype: dict
+
+
+ .. method:: GetToDoStatus()
+
+ Gets status of ToDos (count of used entries).
+
+ :return: Dictionary of status (Used)
+ :rtype: dict
+
+
+ .. method:: HoldCall(ID)
+
+ Holds call.
+
+ :param ID: ID of call
+ :type ID: int
+ :return: None
+ :rtype: None
+
+
+ .. method:: Init(Replies)
+
+ Initialises the connection with phone.
+
+ :param Replies: Number of replies to wait for on each request. Defaults to 1. Higher value makes sense only on unreliable links.
+ :type Replies: int
+ :return: None
+ :rtype: None
+
+
+ .. method:: PressKey(Key, Press)
+
+ Emulates key press.
+
+ :param Key: What key to press
+ :type Key: string
+ :param Press: Whether to emulate press or release.
+ :type Press: bool
+ :return: None
+ :rtype: None
+
+
+ .. method:: ReadConfig(Section, Configuration, Filename)
+
+ Reads specified section of gammurc
+
+ :param Section: Index of config section to read. Defaults to 0.
+ :type Section: int
+ :param Configuration: Index where config section will be stored. Defaults to Section.
+ :type Configuration: int
+ :param Filename: Path to configuration file (otherwise it is autodetected).
+ :type Filename: string
+ :return: None
+ :rtype: None
+
+
+ .. method:: ReadDevice(Wait)
+
+ Reads data from device. This should be used in busy wait loop in case you
+ are waiting for incoming events on the device.
+
+ :param Wait: Whether to wait, default is not to wait.
+ :type Wait: bool
+ :return: Number of bytes read
+ :rtype: int
+
+
+ .. method:: Reset(Hard)
+
+ Performs phone reset.
+
+ :param Hard: Whether to make hard reset
+ :type Hard: bool
+ :return: None
+ :rtype: None
+
+
+ .. method:: ResetPhoneSettings(Type)
+
+ Resets phone settings.
+
+ :param Type: What to reset, one of ``PHONE``, ``UIF``, ``ALL``, ``DEV``, ``FACTORY``
+ :type Type: string
+ :return: None
+ :rtype: None
+
+
+ .. method:: SendDTMF(Number)
+
+ Sends DTMF (Dual Tone Multi Frequency) tone.
+
+ :param Number: Number to dial
+ :type Number: string
+ :return: None
+ :rtype: None
+
+
+ .. method:: SendFilePart(File)
+
+ Sends file part to phone.
+
+ :param File: File data, see :ref:`file_obj`
+ :type File: dict
+ :return: File data for subsequent calls (Finished indicates transfer has been completed), see :ref:`file_obj`
+ :rtype: dict
+
+
+ .. method:: SendSMS(Value)
+
+ Sends SMS.
+
+ :param Value: SMS data, see :ref:`sms_obj`
+ :type Value: dict
+ :return: Message reference as int
+ :rtype: int
+
+
+ .. method:: SendSavedSMS(Folder, Location)
+
+ Sends SMS saved in phone.
+
+ :param Folder: Folder where to read entry (0 is emulated flat memory)
+ :type Folder: int
+ :param Location: Location of entry to send
+ :type Location: int
+ :return: Message reference as int
+ :rtype: int
+
+
+ .. method:: SetAlarm(DateTime, Location, Repeating, Text)
+
+ Sets alarm in phone.
+
+ :param DateTime: When should alarm happen.
+ :type DateTime: datetime.datetime
+ :param Location: Location of alarm to set. Defaults to 1.
+ :type Location: int
+ :param Repeating: Whether alarm should be repeating. Defaults to True.
+ :type Repeating: bool
+ :param Text: Text to be displayed on alarm. Defaults to empty.
+ :type Text: string
+ :return: None
+ :rtype: None
+
+
+ .. method:: SetAutoNetworkLogin()
+
+ Enables network auto login.
+
+ :return: None
+ :rtype: None
+
+
+ .. method:: SetCalendar(Value)
+
+ Sets calendar entry
+
+ :param Value: Calendar entry data, see :ref:`cal_obj`
+ :type Value: dict
+ :return: Location of set entry
+ :rtype: int
+
+
+ .. method:: SetConfig(Section, Values)
+
+ Sets specified config section.
+
+ :param Section: Index of config section to modify
+ :type Section: int
+ :param Values: Config values, see :meth:`GetConfig` for description of accepted
+ :type Values: dict
+ :return: None
+ :rtype: None
+
+ .. method:: SetCallDivert(Divert, Type, Number, Timeout=0)
+
+ .. versionadded:: 1.31.90
+
+ Sets call divert.
+
+ :param Divert: When to do the divert.
+ :type Divert: :ref:`divert-type`
+ :param Type: What call types to divert.
+ :type Type: :ref:`divert-call`
+ :param Number: Phone number where to divert.
+ :type Number: string
+ :param Timeout: Optional timeout when divert happens.
+ :type Timeout: int
+ :return: None
+ :rtype: None
+
+ .. method:: SetDateTime(Date)
+
+ Sets date and time in phone.
+
+ :param Date: Date to set
+ :type Date: datetime.datetime
+ :return: None
+ :rtype: None
+
+
+ .. method:: SetDebugFile(File, Global)
+
+ Sets state machine debug file.
+
+ :param File: File where to write debug stuff (as configured by :meth:`SetDebugLevel`). Can be either None for no file, Python file object or filename.
+ :type File: mixed
+ :param Global: Whether to use global debug structure (overrides File)
+ :type Global: bool
+ :return: None
+ :rtype: None
+
+
+ .. method:: SetDebugLevel(Level)
+
+ Sets state machine debug level accorting to passed string. You need to configure output file using :meth:`SetDebugFile` to activate it.
+
+ :type Level: string
+ :param Level: name of debug level to use, currently one of:
+ - nothing
+ - text
+ - textall
+ - binary
+ - errors
+ - textdate
+ - textalldate
+ - errorsdate
+ :return: None
+ :rtype: None
+
+
+ .. method:: SetFileAttributes(Filename, ReadOnly, Protected, System, Hidden)
+
+ Sets file attributes.
+
+ :param Filename: File to modify
+ :type Filename: string
+ :param ReadOnly: Whether file is read only. Default to False.
+ :type ReadOnly: bool
+ :param Protected: Whether file is protected. Default to False.
+ :type Protected: bool
+ :param System: Whether file is system. Default to False.
+ :type System: bool
+ :param Hidden: Whether file is hidden. Default to False.
+ :type Hidden: bool
+ :return: None
+ :rtype: None
+
+
+ .. method:: SetIncomingCB(Enable)
+
+ Gets network information from phone.
+
+ :type Enable: bool
+ :param Enable: Whether to enable notifications, default is True
+ :return: None
+ :rtype: None
+
+
+ .. method:: SetIncomingCall(Enable)
+
+ Activates/deactivates noticing about incoming calls.
+
+ :type Enable: bool
+ :param Enable: Whether to enable notifications, default is True
+ :return: None
+ :rtype: None
+
+
+ .. method:: SetIncomingCallback(Callback)
+
+ Sets callback function which is called whenever any (enabled) incoming event appears. Please note that you have to enable each event type by calling SetIncoming* functions.
+
+ The callback function needs to accept three parameters: StateMachine object, event type and it's data in dictionary.
+
+ :param Callback: callback function or None for disabling
+ :type Callback: function
+ :return: None
+ :rtype: None
+
+
+ .. method:: SetIncomingSMS(Enable)
+
+ Enable/disable notification on incoming SMS.
+
+ :type Enable: bool
+ :param Enable: Whether to enable notifications, default is True
+ :return: None
+ :rtype: None
+
+
+ .. method:: SetIncomingUSSD(Enable)
+
+ Activates/deactivates noticing about incoming USSDs (UnStructured Supplementary Services).
+
+ :type Enable: bool
+ :param Enable: Whether to enable notifications, default is True
+ :return: None
+ :rtype: None
+
+
+ .. method:: SetLocale(DateSeparator, DateFormat, AMPMTime)
+
+ Sets locale of phone.
+
+ :param DateSeparator: Date separator.
+ :type DateSeparator: string
+ :param DateFormat: Date format, one of ``DDMMYYYY``, ``MMDDYYYY``, ``YYYYMMDD``
+ :type DateFormat: string
+ :param AMPMTime: Whether to use AM/PM time.
+ :type AMPMTime: bool
+ :return: None
+ :rtype: None
+
+
+ .. method:: SetMemory(Value)
+
+ Sets memory (phonebooks or calls) entry.
+
+ :param Value: Memory entry, see :ref:`pbk_obj`
+ :type Value: dict
+ :return: Location of created entry
+ :rtype: int
+
+
+ .. method:: SetSMS(Value)
+
+ Sets SMS.
+
+ :param Value: SMS data, see :ref:`sms_obj`
+ :type Value: dict
+ :return: Tuple for location and folder.
+ :rtype: tuple
+
+
+ .. method:: SetSMSC(Value)
+
+ Sets SMS Service Center number and SMS settings.
+
+ :param Value: SMSC information, see :ref:`smsc_obj`
+ :type Value: dict
+ :return: None
+ :rtype: None
+
+
+ .. method:: SetSpeedDial(Value)
+
+ Sets speed dial.
+
+ :param Value: Speed dial data, see :meth:`GetSpeedDial` for listing.
+ :type Value: dict
+ :return: None
+ :rtype: None
+
+
+ .. method:: SetToDo(Value)
+
+ Sets ToDo in phone.
+
+ :param Value: ToDo data, see :ref:`todo_obj`
+ :type Value: dict
+ :return: Location of created entry
+ :rtype: int
+
+
+ .. method:: SplitCall(ID)
+
+ Splits call.
+
+ :param ID: ID of call
+ :type ID: int
+ :return: None
+ :rtype: None
+
+
+ .. method:: SwitchCall(ID, Next)
+
+ Switches call.
+
+ :param ID: ID of call
+ :type ID: int
+ :return: None
+ :rtype: None
+
+
+ .. method:: Terminate()
+
+ Terminates the connection with phone.
+
+ :return: None
+ :rtype: None
+
+ .. method:: Abort()
+
+ Aborts current operation.
+
+ :return: None
+ :rtype: None
+
+ .. method:: TransferCall(ID, Next)
+
+ Transfers call.
+
+ :param ID: ID of call
+ :type ID: int
+ :return: None
+ :rtype: None
+
+
+ .. method:: UnholdCall(ID)
+
+ Unholds call.
+
+ :param ID: ID of call
+ :type ID: int
+ :return: None
+ :rtype: None
+
+
+
+Generic functions
+-----------------
+
+.. function:: Version()
+
+ Get version information.
+
+ :return: Tuple of version information - Gammu runtime version, python-gammu version, build time Gammu version.
+ :rtype: tuple
+
+Debugging configuration
+-----------------------
+
+.. function:: SetDebugFile(File)
+
+ Sets global debug file.
+
+ :param File: File where to write debug stuff (as configured by :meth:`SetDebugLevel`). Can be either None for no file, Python file object or filename.
+ :type File: mixed
+ :return: None
+ :rtype: None
+
+.. function:: SetDebugLevel(Level)
+
+ Sets global debug level accorting to passed string. You need to configure output file using :meth:`SetDebugFile` to activate it.
+
+ :type Level: string
+ :param Level: name of debug level to use, currently one of:
+
+ * nothing
+ * text
+ * textall
+ * binary
+ * errors
+ * textdate
+ * textalldate
+ * errorsdate
+ :return: None
+ :rtype: None
+
+Message processing
+------------------
+
+.. function:: LinkSMS(Messages, EMS)
+
+ Links multi part SMS messages.
+
+ :type Messages: list
+ :type EMS: bool
+ :param Messages: List of messages to link, see :ref:`sms_obj`
+ :param EMS: Whether to detect ems, defauls to True
+ :return: List of linked messages, see :ref:`sms_obj`
+ :rtype: list
+
+.. function:: SMSCounter(Text, UDH = "NoUDH", Coding = "Default")
+
+ Calculates number of SMS and free chars in SMS.
+
+ :type Text: string
+ :param Text: Message text
+ :type UDH: string
+ :param UDH: Message UDH
+ :type Coding: string
+ :param Coding: Message coding (eg. Unicode or Default)
+ :return: Number of messages and number of free chars
+ :rtype: tuple
+
+ .. versionadded:: 1.29.90
+
+.. function:: DecodeSMS(Messages, EMS)
+
+ Decodes multi part SMS message.
+
+ :param Messages: Nessages to decode, see :ref:`sms_obj`
+ :type Messages: list
+ :param EMS: Whether to use EMS, defalt to True
+ :type EMS: bool
+ :return: Multi part message information, see :ref:`sms_info_obj`
+ :rtype: dict
+
+.. function:: EncodeSMS(MessageInfo)
+
+ Encodes multi part SMS message.
+
+ :param MessageInfo: Description of message, see :ref:`sms_info_obj`
+ :type MessageInfo: dict
+ :return: List of dictionaries with raw message, see :ref:`sms_obj`
+ :rtype: dict
+
+.. function:: DecodePDU(Data, SMSC = False)
+
+ Parses PDU packet.
+
+ :param Data: PDU data, need to be binary not hex encoded
+ :type Data: string
+ :param SMSC: Whether PDU includes SMSC.
+ :type SMSC: bool
+ :return: Message data, see :ref:`sms_obj`
+ :rtype: dict
+
+ **Example:**
+
+ .. code-block:: python
+
+ gammu.DecodePDU(
+ '0681678968986811000a8152564557550010ff0d3bf67aed5ebbddeb1d7bed06'.decode('hex')
+ )
+
+.. function:: EncodePDU(SMS, Layout = Submit)
+
+ Creates PDU packet.
+
+ :param SMS: SMS dictionary, see :ref:`sms_obj`
+ :type SMS: dict
+ :param Layout: Layout (one of Submit, Deliver, StatusReport), Submit is default
+ :type Layout: string
+ :return: Message data
+ :rtype: string
+
+ .. versionadded:: 1.27.93
+
+Encoding and decoding entries
+-----------------------------
+
+.. function:: DecodeVCARD(Text)
+
+ Decodes memory entry v from a string.
+
+ :param Text: String to decode
+ :type Text: string
+ :return: Memory entry, see :ref:`pbk_obj`
+ :rtype: dict
+
+.. function:: EncodeVCARD(Entry)
+
+ Encodes memory entry to a vCard.
+
+ :param Entry: Memory entry, see :ref:`pbk_obj`
+ :type Entry: dict
+ :return: String with vCard
+ :rtype: string
+
+.. function:: DecodeVCS(Text)
+
+ Decodes todo/calendar entry v from a string.
+
+ :param Text: String to decode
+ :type Text: string
+ :return: Calendar or todo entry (whatever one was included in string), see :ref:`cal_obj`, :ref:`todo_obj`
+ :rtype: dict
+
+.. function:: DecodeICS(Text)
+
+ Decodes todo/calendar entry v from a string.
+
+ :param Text: String to decode
+ :type Text: string
+ :return: Calendar or todo entry (whatever one was included in string), see :ref:`cal_obj`, :ref:`todo_obj`
+ :rtype: dict
+
+.. function:: EncodeVCALENDAR(Entry)
+
+ Encodes calendar entry to a vCalendar.
+
+ :param Entry: Calendar entry, see :ref:`cal_obj`
+ :type Entry: dict
+ :return: String with vCalendar
+ :rtype: string
+
+.. function:: EncodeICALENDAR(Entry)
+
+ Encodes calendar entry to a iCalendar.
+
+ :param Entry: Calendar entry, see :ref:`cal_obj`
+ :type Entry: dict
+ :return: String with iCalendar
+ :rtype: string
+
+.. function:: EncodeVTODO(Entry)
+
+ Encodes todo entry to a vTodo.
+
+ :param Entry: Todo entry, see :ref:`todo_obj`
+ :type Entry: dict
+ :return: String with vTodo
+ :rtype: string
+
+.. function:: EncodeITODO(Entry)
+
+ Encodes todo entry to a iTodo.
+
+ :param Entry: Todo entry, see :ref:`todo_obj`
+ :type Entry: dict
+ :return: String with vCard
+ :rtype: string
+
+Backup reading and writing
+--------------------------
+
+.. function:: SaveRingtone(Filename, Ringtone, Format)
+
+ Saves ringtone into file.
+
+ :param Filename: Name of file where ringote will be saved
+ :type Filename: string
+ :param Ringtone: Ringtone to save
+ :type Ringtone: dict
+ :param Format: One of ``ott``, ``mid``, ``rng``, ``imy``, ``wav``, ``rttl``
+ :type Format: string
+ :return: None
+ :rtype: None
+
+.. function:: SaveBackup(Filename, Backup, Format)
+
+ Saves backup into file.
+
+ :param Filename: Name of file to read backup from
+ :type Filename: string
+ :param Backup: Backup data, see :func:`ReadBackup` for description
+ :type Backup: dict
+ :param Format: File format to use (``Auto``, ``AutoUnicode``, ``LMB``, ``VCalendar``, ``VCard``, ``LDIF``, ``ICS``, ``Gammu``, ``GammuUnicode``, the default is ``AutoUnicode``)
+ :type Format: string
+ :return: None
+ :rtype: None
+
+.. function:: ReadBackup(Filename, Format)
+
+ Reads backup into file.
+
+ :param Filename: Name of file where backup is stored
+ :type Filename: string
+ :param Format: File format to use (``Auto``, ``AutoUnicode``, ``LMB``, ``VCalendar``, ``VCard``, ``LDIF``, ``ICS``, ``Gammu``, ``GammuUnicode``, the default is ``AutoUnicode``)
+ :type Format: string
+ :return: Dictionary of read entries, it contains following keys, each might be empty:
+
+ * IMEI
+ * Model
+ * Creator
+ * PhonePhonebook
+ * SIMPhonebook
+ * Calendar
+ * ToDo
+ * DateTime
+ :rtype: dict
+
+.. function:: SaveSMSBackup(Filename, Backup)
+
+ Saves SMS backup into file.
+
+ :param Filename: Name of file where to save SMS backup
+ :type Filename: string
+ :param Backup: List of messages to store
+ :type Backup: list
+ :return: None
+ :rtype: None
+
+.. function:: ReadSMSBackup(Filename)
+
+ Reads SMS backup into file.
+
+ :param Filename: Name of file where SMS backup is stored
+ :type Filename: string
+ :return: List of messages read from file
+ :rtype: list
+
+Various data
+------------
+
+.. data:: GSMNetworks
+
+ Dictionary with GSM network codes.
+
+.. data:: GSMCountries
+
+ Dictionary with GSM country codes.
diff --git a/docs/manual/python/index.rst b/docs/manual/python/index.rst
new file mode 100644
index 0000000..2ec00eb
--- /dev/null
+++ b/docs/manual/python/index.rst
@@ -0,0 +1,51 @@
+.. _python:
+
+python-gammu
+============
+
+A taste of python-gammu
+-----------------------
+
+Python-gammu allows you to easily access the phone. Following code will connect
+to phone based on your Gammu configuration (usually stored in
+:file:`~/.gammurc`) and gets network information from it::
+
+ import gammu
+ import sys
+
+ # Create state machine object
+ sm = gammu.StateMachine()
+
+ # Read ~/.gammurc
+ sm.ReadConfig()
+
+ # Connect to phone
+ sm.Init()
+
+ # Reads network information from phone
+ netinfo = sm.GetNetworkInfo()
+
+ # Print information
+ print 'Network name: %s' % netinfo['NetworkName']
+ print 'Network code: %s' % netinfo['NetworkCode']
+ print 'LAC: %s' % netinfo['LAC']
+ print 'CID: %s' % netinfo['CID']
+
+.. toctree::
+ :maxdepth: 3
+
+ examples
+
+API documentation
+-----------------
+
+.. toctree::
+ :maxdepth: 3
+
+ gammu
+ smsd
+ data
+ worker
+ exceptions
+ objects
+
diff --git a/docs/manual/python/objects.rst b/docs/manual/python/objects.rst
new file mode 100644
index 0000000..9394e97
--- /dev/null
+++ b/docs/manual/python/objects.rst
@@ -0,0 +1,879 @@
+Objects
+=======
+
+For various (mostly historical) reasons, all objects you get from Gammu are
+not real objects but rather a dictionaries. This has quite a big impact of
+usability and will most likely change in the future.
+
+All the objects basically map to C structures, so you might also refer to
+:ref:`libgammu` chapter.
+
+.. _sms_obj:
+
+SMS Object
+----------
+
+Object describing single SMS message in a way GSM network handles is (140
+bytes of data). You can construct it from :ref:`sms_info_obj` using
+:meth:`gammu.EncodeSMS`.
+
+Message dictionary can consist of following fields:
+
+.. attribute:: SMSC
+
+ SMSC information, see :ref:`smsc_obj`.
+
+.. attribute:: Number
+
+ Recipient number, needs to be set for sending.
+
+.. attribute:: Name
+
+ Name of the message, does not make any effect on sending, some phones might
+ store it.
+
+.. attribute:: UDH
+
+ User defined headers for SMS, see :ref:`udh_obj`.
+
+.. attribute:: Text
+
+ Message text
+
+.. attribute:: Folder
+
+ Folder where the message is stored
+
+.. attribute:: Location
+
+ Location where the message is stored
+
+.. attribute:: InboxFolder
+
+ Indication whether folder is an inbox
+
+.. attribute:: DeliveryStatus
+
+ Message delivery status, used only for received messages
+
+.. attribute:: ReplyViaSameSMSC
+
+ Flag indicating whether reply using same SMSC is requested
+
+.. attribute:: Class
+
+ Message class
+
+.. attribute:: MessageReference
+
+ Message reference number, used mostly to identify delivery reports
+
+.. attribute:: ReplaceMessage
+
+ Id of message which this message is supposed to replace
+
+.. attribute:: RejectDuplicates
+
+ Whether to reject duplicates
+
+.. attribute:: Memory
+
+ Memory where the message is stored
+
+.. attribute:: Type
+
+ Message type, one of:
+
+* ``Submit`` - message to be send
+* ``Deliver`` - delivered message
+* ``Status_Report`` - when creating new message this will create submit message
+ with request for delivery report
+
+.. attribute:: Coding
+
+ Message encoding, one of:
+
+* ``Unicode_No_Compression`` - unicode message which can contain any chars,
+ but can be only 70 chars long
+* ``Unicode_Compression`` - not supported by Gammu and most phones
+* ``Default_No_Compression`` - message with GSM alphabet only, up to 160 chars
+ long
+* ``Default_Compression`` - not supported by Gammu and most phones
+* ``8bit`` - for binary messages
+
+.. attribute:: DateTime
+
+ Timestamp when the message was received or sent.
+
+ Please note that most phones do no record timestamp of sent messages.
+
+.. attribute:: SMSCDateTime
+
+ Timestamp when the message was at SMSC.
+
+.. attribute:: State
+
+ Message state, one of:
+
+* ``Sent``
+* ``UnSent``
+* ``Read``
+* ``UnRead``
+
+Examples::
+
+ # Simple message to send, using SMSC from phone
+ SMS_1 = {
+ 'Number': '123465',
+ 'SMSC': {'Location': 1},
+ 'Text': 'Hello world!',
+ }
+
+ # Class 0 (on display) message using custom SMSC number
+ SMS_2 = {
+ 'Number': '123465',
+ 'SMSC': {'Number': '+420987654321'},
+ 'Text': 'Hello world!',
+ 'Class': 0,
+ }
+
+
+.. _udh_obj:
+
+UDH Object
+----------
+
+UDH dictionary can consist of following fields:
+
+.. attribute:: ID8bit
+
+ 8-bit ID of the message, not required
+
+.. attribute:: ID16bit
+
+ 16-bit ID of the message, not required
+
+.. attribute:: PartNumber
+
+ Number of current part
+
+.. attribute:: AllParts
+
+ Count of all message parts
+
+.. attribute:: Type
+
+ UDH type, one of predefined strings:
+
+* ``NoUDH``
+* ``ConcatenatedMessages``
+* ``ConcatenatedMessages16bit``
+* ``DisableVoice``
+* ``DisableFax``
+* ``DisableEmail``
+* ``EnableVoice``
+* ``EnableFax``
+* ``EnableEmail``
+* ``VoidSMS``
+* ``NokiaRingtone``
+* ``NokiaRingtoneLong``
+* ``NokiaOperatorLogoLong``
+* ``NokiaCallerLogo``
+* ``NokiaWAP``
+* ``NokiaWAPLong``
+* ``NokiaCalendarLong``
+* ``NokiaProfileLong``
+* ``NokiaPhonebookLong``
+* ``UserUDH``
+
+.. attribute:: Text
+
+ UDH content
+
+Example:
+
+.. code-block:: python
+
+ UDH = {
+ 'ID8bit': 0xcd,
+ 'PartNumber': 1,
+ 'AllParts': 2,
+ 'Type': 'ConcatenatedMessages',
+ }
+
+.. _smsc_obj:
+
+SMSC Object
+-----------
+
+SMSC dictionary can consist of following fields:
+
+.. attribute:: Location
+
+ Location where the SMSC is stored
+
+.. attribute:: Number
+
+ SMSC number
+
+.. attribute:: Name
+
+ Name of the SMSC configuration
+
+.. attribute:: DefaultNumber
+
+ Default recipient number, ignored on most phones
+
+.. attribute:: Format
+
+ Default message format, one of:
+
+* ``Text``
+* ``Pager``
+* ``Fax``
+* ``Email``
+
+.. attribute:: Validity
+
+ Default message validity as a string
+
+* ``NA`` - validity not available
+* ``Max`` - maximum validity allowed by network
+* ``nM``, ``nH``, ``nD``, ``nW`` - period defined in minutes, hours, days or
+ weeks, eg. ``3W``
+
+Example:
+
+.. code-block:: python
+
+ SMSC = {
+ 'Location': 1,
+ 'Number': '+420987654321',
+ 'Format': 'Text',
+ 'Validity': 'Max',
+ }
+
+.. _sms_info_obj:
+
+SMS Info Object
+---------------
+
+Message info dictionary can consist of following fields:
+
+.. attribute:: Unicode
+
+ Whether to use Unicode for the message.
+
+.. attribute:: ReplaceMessage
+
+ Id of message which this message is supposed to replace
+
+.. attribute:: Unknown
+
+ Boolean flag indicating there was some part which Gammu could not decode.
+
+.. attribute:: Class
+
+ Message class
+
+.. attribute:: Entries
+
+ Actual message data, see :ref:`sms_info_part_obj`.
+
+Example:
+
+.. code-block:: python
+
+ SMSINFO = {
+ 'Class': 1,
+ 'Entries': [
+ {'ID': 'Text', 'Buffer': 'This is a '},
+ {'ID': 'Text', 'Buffer': 'message', 'Italic': True},
+ {'ID': 'Text', 'Buffer': ' from '},
+ {'ID': 'Text', 'Buffer': 'Gammu', 'Bold': True},
+ ],
+ }
+
+.. _sms_info_part_obj:
+
+SMS Info Part Object
+--------------------
+
+Message component can consist of following fields:
+
+.. attribute:: ID
+
+ Identification of the part type:
+
+* ``Text``
+* ``ConcatenatedTextLong`` - Contacenated SMS, when longer than 1 SMS.
+* ``ConcatenatedAutoTextLong`` - Contacenated SMS, auto Default/Unicode coding.
+* ``ConcatenatedTextLong16bit``
+* ``ConcatenatedAutoTextLong16bit``
+* ``NokiaProfileLong`` - Nokia profile = Name`` Ringtone`` ScreenSaver
+* ``NokiaPictureImageLong`` - Nokia Picture Image + (text)
+* ``NokiaScreenSaverLong`` - Nokia screen saver + (text)
+* ``NokiaRingtone`` - Nokia ringtone - old SM2.0 format`` 1 SMS
+* ``NokiaRingtoneLong`` - Nokia ringtone concatenated`` when very long
+* ``NokiaOperatorLogo`` - Nokia 72x14 operator logo`` 1 SMS
+* ``NokiaOperatorLogoLong`` - Nokia 72x14 op logo or 78x21 in 2 SMS
+* ``NokiaCallerLogo`` - Nokia 72x14 caller logo`` 1 SMS
+* ``NokiaWAPBookmarkLong`` - Nokia WAP bookmark in 1 or 2 SMS
+* ``NokiaWAPSettingsLong`` - Nokia WAP settings in 2 SMS
+* ``NokiaMMSSettingsLong`` - Nokia MMS settings in 2 SMS
+* ``NokiaVCARD10Long`` - Nokia VCARD 1.0 - only name and default number
+* ``NokiaVCARD21Long`` - Nokia VCARD 2.1 - all numbers + text
+* ``NokiaVCALENDAR10Long`` - Nokia VCALENDAR 1.0 - can be in few sms
+* ``NokiaVTODOLong``
+* ``VCARD10Long``
+* ``VCARD21Long``
+* ``DisableVoice``
+* ``DisableFax``
+* ``DisableEmail``
+* ``EnableVoice``
+* ``EnableFax``
+* ``EnableEmail``
+* ``VoidSMS``
+* ``EMSSound10`` - IMelody 1.0
+* ``EMSSound12`` - IMelody 1.2
+* ``EMSSonyEricssonSound`` - IMelody without header - SonyEricsson extension
+* ``EMSSound10Long`` - IMelody 1.0 with UPI.
+* ``EMSSound12Long`` - IMelody 1.2 with UPI.
+* ``EMSSonyEricssonSoundLong`` - IMelody without header with UPI.
+* ``EMSPredefinedSound``
+* ``EMSPredefinedAnimation``
+* ``EMSAnimation``
+* ``EMSFixedBitmap`` - Fixed bitmap of size 16x16 or 32x32.
+* ``EMSVariableBitmap``
+* ``EMSVariableBitmapLong``
+* ``MMSIndicatorLong`` - MMS message indicator.
+* ``WAPIndicatorLong``
+* ``AlcatelMonoBitmapLong`` - Variable bitmap with black and white colors
+* ``AlcatelMonoAnimationLong`` - Variable animation with black and white colors
+* ``AlcatelSMSTemplateName``
+* ``SiemensFile`` - Siemens OTA
+
+.. attribute:: Left
+
+ Text formatting
+
+.. attribute:: Right
+
+ Text formatting
+
+.. attribute:: Center
+
+ Text formatting
+
+.. attribute:: Large
+
+ Text formatting
+
+.. attribute:: Small
+
+ Text formatting
+
+.. attribute:: Bold
+
+ Text formatting
+
+.. attribute:: Italic
+
+ Text formatting
+
+.. attribute:: Underlined
+
+ Text formatting
+
+.. attribute:: Strikethrough
+
+ Text formatting
+
+.. attribute:: Protected
+
+ Whether message part should be protected (DRM)
+
+.. attribute:: Number
+
+ Number to encode in message.
+
+.. attribute:: Ringtone
+
+ Ringtone to encode in message.
+
+.. attribute:: Bitmap
+
+ Bitmap to encode in message.
+
+.. attribute:: Bookmark
+
+ Bookmark to encode in message.
+
+.. attribute:: Settings
+
+ Settings to encode in message.
+
+.. attribute:: MMSIndicator
+
+ MMS indication to encode in message.
+
+.. attribute:: Phonebook
+
+ Phonebook entry to encode in message, see :ref:`pbk_obj`.
+
+.. attribute:: Calendar
+
+ Calendar entry to encode in message, see :ref:`cal_obj`.
+
+.. attribute:: ToDo
+
+ Todo entry to encode in message, see :ref:`todo_obj`.
+
+.. attribute:: File
+
+ File to encode in message, see :ref:`file_obj`.
+
+.. attribute:: Buffer
+
+ String to encode in message.
+
+.. _todo_obj:
+
+Todo Object
+-----------
+
+Todo entry is a dictionary consisting of following fields:
+
+.. attribute:: Location
+
+ Location where the entry is stored
+
+.. attribute:: Type
+
+ Type of entry, one of:
+
+* ``REMINDER`` - Reminder or Date
+* ``CALL`` - Call
+* ``MEETING`` - Meeting
+* ``BIRTHDAY`` - Birthday or Anniversary or Special Occasion
+* ``MEMO`` - Memo or Miscellaneous
+* ``TRAVEL`` - Travel
+* ``VACATION`` - Vacation
+* ``T_ATHL`` - Training - Athletism
+* ``T_BALL`` - Training - Ball Games
+* ``T_CYCL`` - Training - Cycling
+* ``T_BUDO`` - Training - Budo
+* ``T_DANC`` - Training - Dance
+* ``T_EXTR`` - Training - Extreme Sports
+* ``T_FOOT`` - Training - Football
+* ``T_GOLF`` - Training - Golf
+* ``T_GYM`` - Training - Gym
+* ``T_HORS`` - Training - Horse Race
+* ``T_HOCK`` - Training - Hockey
+* ``T_RACE`` - Training - Races
+* ``T_RUGB`` - Training - Rugby
+* ``T_SAIL`` - Training - Sailing
+* ``T_STRE`` - Training - Street Games
+* ``T_SWIM`` - Training - Swimming
+* ``T_TENN`` - Training - Tennis
+* ``T_TRAV`` - Training - Travels
+* ``T_WINT`` - Training - Winter Games
+* ``ALARM`` - Alarm
+* ``DAILY_ALARM`` - Alarm repeating each day.
+
+.. attribute:: Priority
+
+ Entry priority, one of:
+
+* ``High``
+* ``Medium``
+* ``Low``
+* ``None``
+
+.. attribute:: Entries
+
+ Actual entries, see :ref:`todo_entry_obj`
+
+Example:
+
+.. code-block:: python
+
+ TODO = {
+ 'Type': 'MEMO',
+ 'Entries': [
+ {'Type': 'END_DATETIME', 'Value': datetime.datetime.now() + datetime.timedelta(days = 1)},
+ {'Type': 'TEXT', 'Value': 'Buy some milk'},
+ ],
+ }
+
+.. _todo_entry_obj:
+
+Todo Entries Object
+-------------------
+
+.. attribute:: Type
+
+ Type of entry, one of:
+
+* ``END_DATETIME`` - Due date (Date).
+* ``COMPLETED`` - Whether is completed (Number).
+* ``ALARM_DATETIME`` - When should alarm be fired (Date).
+* ``SILENT_ALARM_DATETIME`` - When should silent alarm be fired (Date).
+* ``TEXT`` - Text of to do (Text).
+* ``DESCRIPTION`` - Description of to do (Text).
+* ``LOCATION`` - Location of to do (Text).
+* ``PRIVATE`` - Whether entry is private (Number).
+* ``CATEGORY`` - Category of entry (Number).
+* ``CONTACTID`` - Related contact ID (Number).
+* ``PHONE`` - Number to call (Text).
+* ``LUID`` - IrMC LUID which can be used for synchronisation (Text).
+* ``LAST_MODIFIED`` - Date and time of last modification (Date).
+* ``START_DATETIME`` - Start date (Date).
+
+.. attribute:: Value
+
+ Actual value, corresponding type to Type field.
+
+.. _cal_obj:
+
+Calendar Object
+---------------
+
+Calendar entry is a dictionary consisting of following fields:
+
+.. attribute:: Location
+
+ Location where the entry is stored
+
+.. attribute:: Type
+
+ Type of entry, one of:
+
+* ``REMINDER`` - Reminder or Date
+* ``CALL`` - Call
+* ``MEETING`` - Meeting
+* ``BIRTHDAY`` - Birthday or Anniversary or Special Occasion
+* ``MEMO`` - Memo or Miscellaneous
+* ``TRAVEL`` - Travel
+* ``VACATION`` - Vacation
+* ``T_ATHL`` - Training - Athletism
+* ``T_BALL`` - Training - Ball Games
+* ``T_CYCL`` - Training - Cycling
+* ``T_BUDO`` - Training - Budo
+* ``T_DANC`` - Training - Dance
+* ``T_EXTR`` - Training - Extreme Sports
+* ``T_FOOT`` - Training - Football
+* ``T_GOLF`` - Training - Golf
+* ``T_GYM`` - Training - Gym
+* ``T_HORS`` - Training - Horse Race
+* ``T_HOCK`` - Training - Hockey
+* ``T_RACE`` - Training - Races
+* ``T_RUGB`` - Training - Rugby
+* ``T_SAIL`` - Training - Sailing
+* ``T_STRE`` - Training - Street Games
+* ``T_SWIM`` - Training - Swimming
+* ``T_TENN`` - Training - Tennis
+* ``T_TRAV`` - Training - Travels
+* ``T_WINT`` - Training - Winter Games
+* ``ALARM`` - Alarm
+* ``DAILY_ALARM`` - Alarm repeating each day.
+
+.. attribute:: Entries
+
+ Actual entries, see :ref:`cal_entry_obj`
+
+Example:
+
+.. code-block:: python
+
+ CAL = {
+ 'Type': 'MEMO',
+ 'Entries': [
+ {'Type': 'START_DATETIME', 'Value': datetime.datetime.now()},
+ {'Type': 'END_DATETIME', 'Value': datetime.datetime.now() + datetime.timedelta(days = 1)},
+ {'Type': 'LOCATION', 'Value': 'Home'},
+ {'Type': 'TEXT', 'Value': 'Relax for one day'},
+ ],
+ }
+
+.. _cal_entry_obj:
+
+Calendar Entries Object
+-----------------------
+
+.. attribute:: Type
+
+ Type of entry, one of:
+
+* ``START_DATETIME`` - Date and time of event start.
+* ``END_DATETIME`` - Date and time of event end.
+* ``TONE_ALARM_DATETIME`` - Alarm date and time.
+* ``SILENT_ALARM_DATETIME`` - Date and time of silent alarm.
+* ``TEXT`` - Text.
+* ``DESCRIPTION`` - Detailed description.
+* ``LOCATION`` - Location.
+* ``PHONE`` - Phone number.
+* ``PRIVATE`` - Whether this entry is private.
+* ``CONTACTID`` - Related contact id.
+* ``REPEAT_DAYOFWEEK`` - Repeat each x'th day of week.
+* ``REPEAT_DAY`` - Repeat each x'th day of month.
+* ``REPEAT_DAYOFYEAR`` - Repeat each x'th day of year.
+* ``REPEAT_WEEKOFMONTH`` - Repeat x'th week of month.
+* ``REPEAT_MONTH`` - Repeat x'th month.
+* ``REPEAT_FREQUENCY`` - Repeating frequency.
+* ``REPEAT_STARTDATE`` - Repeating start.
+* ``REPEAT_STOPDATE`` - Repeating end.
+* ``REPEAT_COUNT`` - Number of repetitions.
+* ``LUID`` - IrMC LUID which can be used for synchronisation.
+* ``LAST_MODIFIED`` - Date and time of last modification.
+
+.. attribute:: Value
+
+ Actual value, corresponding type to Type field.
+
+.. _pbk_obj:
+
+Phonebook Object
+----------------
+
+Phonebook entry is a dictionary consisting of following fields:
+
+.. attribute:: Location
+
+ Location where the entry is stored
+
+.. attribute:: MemoryType
+
+ Memory where the message is stored
+
+.. attribute:: Entries
+
+ Actual entries, see :ref:`pbk_entry_obj`
+
+Example:
+
+.. code-block:: python
+
+ PBK = {
+ 'Location': 1000,
+ 'MemoryType': 'ME',
+ 'Entries': [
+ {'Type': 'Number_General', 'Value': '+420123456789'},
+ {'Type': 'Text_Name', 'Value': 'Stojan Jakotyc'},
+ ],
+ }
+
+.. _pbk_entry_obj:
+
+Phonebook Entries Object
+------------------------
+
+.. attribute:: Type
+
+ Type of entry, one of:
+
+ * ``Number_General`` - General number. (Text)
+ * ``Number_Mobile`` - Mobile number. (Text)
+ * ``Number_Fax`` - Fax number. (Text)
+ * ``Number_Pager`` - Pager number. (Text)
+ * ``Number_Other`` - Other number. (Text)
+ * ``Text_Note`` - Note. (Text)
+ * ``Text_Postal`` - Complete postal address. (Text)
+ * ``Text_Email`` - Email. (Text)
+ * ``Text_Email2`` - Second email. (Text)
+ * ``Text_URL`` - URL (Text)
+ * ``Date`` - Date and time of last call. (Date)
+ * ``Caller_Group`` - Caller group. (Number)
+ * ``Text_Name`` - Name (Text)
+ * ``Text_LastName`` - Last name. (Text)
+ * ``Text_FirstName`` - First name. (Text)
+ * ``Text_Company`` - Company. (Text)
+ * ``Text_JobTitle`` - Job title. (Text)
+ * ``Category`` - Category. (Number, if -1 then text)
+ * ``Private`` - Whether entry is private. (Number)
+ * ``Text_StreetAddress`` - Street address. (Text)
+ * ``Text_City`` - City. (Text)
+ * ``Text_State`` - State. (Text)
+ * ``Text_Zip`` - Zip code. (Text)
+ * ``Text_Country`` - Country. (Text)
+ * ``Text_Custom1`` - Custom information 1. (Text)
+ * ``Text_Custom2`` - Custom information 2. (Text)
+ * ``Text_Custom3`` - Custom information 3. (Text)
+ * ``Text_Custom4`` - Custom information 4. (Text)
+ * ``RingtoneID`` - Ringtone ID. (Number)
+ * ``PictureID`` - Picture ID. (Number)
+ * ``Text_UserID`` - User ID. (Text)
+ * ``CallLength`` - Length of call (Number)
+ * ``Text_LUID`` - LUID - Unique Identifier used for synchronisation (Text)
+ * ``LastModified`` - Date of last modification (Date)
+ * ``Text_NickName`` - Nick name (Text)
+ * ``Text_FormalName`` - Formal name (Text)
+ * ``Text_PictureName`` - Picture name (on phone filesystem). (Text)
+ * ``PushToTalkID`` - Push-to-talk ID (Text)
+ * ``Number_Messaging`` - Favorite messaging number. (Text)
+ * ``Photo`` - Photo (Picture).
+ * ``SecondName`` - Second name. (Text)
+ * ``VOIP`` - VOIP address (Text).
+ * ``SIP`` - SIP address (Text).
+ * ``DTMF`` - DTMF (Text).
+ * ``Video`` - Video number. (Text)
+ * ``SWIS`` - See What I See address. (Text)
+ * ``WVID`` - Wireless Village user ID. (Text)
+ * ``NamePrefix`` - Name prefix (Text)
+ * ``NameSuffix`` - Name suffix (Text)
+
+.. attribute:: Location
+
+ Location for the field:
+
+ * ``Unknown`` - not define
+ * ``Home`` - home
+ * ``Work`` - work
+
+.. attribute:: Value
+
+ Actual value, corresponding type to Type field.
+
+.. attribute:: PictureType
+
+ Type of picture which is stored in Value field (only for Picture fields).
+
+.. _file_obj:
+
+File Object
+-----------
+
+File is a dictionary consisting of following fields:
+
+.. attribute:: Used
+
+ Number of bytes used by this file.
+
+.. attribute:: Name
+
+ File name.
+
+.. attribute:: Folder
+
+ Boolean value indicating whether this is a folder.
+
+.. attribute:: Level
+
+ Depth of file on the filesystem.
+
+.. attribute:: Type
+
+ File type, one of:
+
+* ``Other``
+* ``Java_JAR``
+* ``Image_JPG``
+* ``Image_BMP``
+* ``Image_GIF``
+* ``Image_PNG``
+* ``Image_WBMP``
+* ``Video_3GP``
+* ``Sound_AMR``
+* ``Sound_NRT`` - DCT4 binary format
+* ``Sound_MIDI``
+* ``MMS``
+
+.. attribute:: ID_FullName
+
+ Full file name including path.
+
+.. attribute:: Buffer
+
+ Content of the file.
+
+.. attribute:: Modified
+
+ Timestamp of last change
+
+.. attribute:: Protected
+
+ Boolean value indicating whether file is protected (DRM).
+
+.. attribute:: ReadOnly
+
+ Boolean value indicating whether file is read only.
+
+.. attribute:: Hidden
+
+ Boolean value indicating whether file is hidden.
+
+.. attribute:: System
+
+ Boolean value indicating whether file is system.
+
+.. attribute:: Pos
+
+ Current position of file upload
+
+.. attribute:: Finished
+
+ Boolean value indicating completed file transfer.
+
+Example:
+
+.. code-block:: python
+
+ FILE = {
+ 'ID_FullName': PATH,
+ 'Name': os.path.basename(PATH),
+ 'Buffer': data,
+ 'Protected': 0,
+ 'ReadOnly': 0,
+ 'Hidden': 0,
+ 'System': 0,
+ 'Folder': 0,
+ 'Level': 0,
+ 'Type': 'Other',
+ 'Finished': 0,
+ 'Pos': 0,
+ }
+
+.. _divert-type:
+
+Divert Type
+-----------
+
+The divert type can have one of following values:
+
+* ``Busy`` - Divert when busy.
+* ``NoAnswer`` - Divert when not answered.
+* ``OutOfReach`` - Divert when phone off or no coverage.
+* ``AllTypes`` - Divert all calls without ringing.
+
+.. _divert-call:
+
+Call Type
+---------
+
+The call type for diverts can have one of following values:
+
+* ``Voice`` - Voice calls.
+* ``Fax`` - Fax calls.
+* ``Data`` - Data calls.
+* ``All`` - All calls.
+
+.. _divert-entry:
+
+Call Divert Objects
+-------------------
+
+.. attribute:: DivertType
+
+ When to do the divert, see :ref:`divert-type`.
+
+.. attribute:: CallType
+
+ What call types to divert, see :ref:`divert-call`.
+
+.. attribute:: Number
+
+ Phone number where to divert.
+
+.. attribute:: Timeout
+
+ Timeout after which the divert will happen.
diff --git a/docs/manual/python/smsd.rst b/docs/manual/python/smsd.rst
new file mode 100644
index 0000000..e0acdf5
--- /dev/null
+++ b/docs/manual/python/smsd.rst
@@ -0,0 +1,90 @@
+:mod:`gammu.smsd` -- SMSD access
+===================================
+
+.. module:: gammu.smsd
+ :synopsis: Provides access to Gammu SMSD functions.
+
+:class:`SMSD`
+-------------
+
+.. class:: SMSD(Config)
+
+ SMSD main class, that is used for communication with phone.
+
+ You don't need to run the SMS daemon itself to control or ask it for
+ status, this can be also done on separately running instances. All you
+ need to do for this is to give same configuration file as that instance is
+ using.
+
+ :param Config: Path to SMSD configuration file.
+ :type Config: string
+
+ .. method:: MainLoop(MaxFailures)
+
+ Runs SMS daemon main loop.
+
+ Please note that this will run until some serious error occurs or until
+ terminated by :meth:`Shutdown`.
+
+ :param MaxFailures: After how many init failures SMSD ends. Defaults to 0, what means never.
+ :type MaxFailures: int
+ :return: None
+ :rtype: None
+
+
+ .. method:: Shutdown()
+
+ Signals SMS daemon to stop.
+
+ :return: None
+ :rtype: None
+
+ .. method:: GetStatus()
+
+ Returns SMSD status.
+
+ The following values are set in resulting dictionary:
+
+ Client
+
+ Client software name.
+
+ PhoneID
+
+ PhoneID which can be used for multiple SMSD setup.
+
+ IMEI
+
+ IMEI of currently connected phone.
+
+ Sent
+
+ Number of sent messages.
+
+ Received
+
+ Number of received messages.
+
+ Failed
+
+ Number of failed messages.
+
+ BatterPercent
+
+ Last battery state as reported by connected phone.
+
+ NetworkSignal
+
+ Last signal level as reported by connected phone.
+
+ :return: Dict with status values
+ :rtype: dict
+
+ .. method:: InjectSMS(Message)
+
+ Injects SMS message into outgoing messages queue in SMSD.
+
+ :param Message: Message to inject (can be multipart)
+ :type Message: list of :ref:`sms_obj`
+ :return: ID of inserted message
+ :rtype: string
diff --git a/docs/manual/python/worker.rst b/docs/manual/python/worker.rst
new file mode 100644
index 0000000..333074d
--- /dev/null
+++ b/docs/manual/python/worker.rst
@@ -0,0 +1,162 @@
+:mod:`gammu.worker` - Asynchronous communication to phone.
+==========================================================
+
+.. module:: gammu.worker
+ :synopsis: Asynchronous communication to phone.
+
+Mostly you should use only :class:`GammuWorker` class, others are only helpers
+which are used by this class.
+
+
+.. class:: GammuCommand(command, params=None, percentage=100)
+ :module: gammu.worker
+
+ Storage of single command for gammu.
+
+
+ .. method:: GammuCommand.get_command()
+ :module: gammu.worker
+
+ Returns command name.
+
+
+ .. method:: GammuCommand.get_params()
+ :module: gammu.worker
+
+ Returns command params.
+
+
+ .. method:: GammuCommand.get_percentage()
+ :module: gammu.worker
+
+ Returns percentage of current task.
+
+
+.. class:: GammuTask(name, commands)
+ :module: gammu.worker
+
+ Storage of task for gammu.
+
+
+ .. method:: GammuTask.get_name()
+ :module: gammu.worker
+
+ Returns task name.
+
+
+ .. method:: GammuTask.get_next()
+ :module: gammu.worker
+
+ Returns next command to be executed as :class:`GammuCommand`.
+
+
+.. class:: GammuThread(queue, config, callback)
+ :module: gammu.worker
+
+ Thread for phone communication.
+
+
+ .. method:: GammuThread.join(timeout=None)
+ :module: gammu.worker
+
+ Terminates thread and waits for it.
+
+
+ .. method:: GammuThread.kill()
+ :module: gammu.worker
+
+ Forces thread end without emptying queue.
+
+
+ .. method:: GammuThread.run()
+ :module: gammu.worker
+
+ Thread body, which handles phone communication. This should not
+ be used from outside.
+
+
+.. class:: GammuWorker(callback)
+ :module: gammu.worker
+
+ Wrapper class for asynchronous communication with Gammu. It spawns
+ own thread and then passes all commands to this thread. When task is
+ done, caller is notified via callback.
+
+
+ .. method:: GammuWorker.abort()
+ :module: gammu.worker
+
+ Aborts any remaining operations.
+
+
+ .. method:: GammuWorker.configure(config)
+ :module: gammu.worker
+
+ Configures gammu instance according to config.
+
+ :param config: Gammu configuration, same as :meth:`gammu.StateMachine.SetConfig` accepts.
+ :type config: hash
+
+
+ .. method:: GammuWorker.enqueue(command, params=None, commands=None)
+ :module: gammu.worker
+
+ Enqueues command or task.
+
+ :param command: Command(s) to execute. Each command is tuple containing function name and it's parameters.
+ :type command: tuple of list of tuples
+ :param params: Parameters to command.
+ :type params: tuple or string
+ :param commands: List of commands to execute. When this is not none, params are ignored and command is taken as task name.
+ :type commands: list of tuples or strings
+
+
+ .. method:: GammuWorker.enqueue_command(command, params)
+ :module: gammu.worker
+
+ Enqueues command.
+
+ :param command: Command(s) to execute. Each command is tuple containing function name and it's parameters.
+ :type command: tuple of list of tuples
+ :param params: Parameters to command.
+ :type params: tuple or string
+
+
+ .. method:: GammuWorker.enqueue_task(command, commands)
+ :module: gammu.worker
+
+ Enqueues task.
+
+ :param command: Command(s) to execute. Each command is tuple containing function name and it's parameters.
+ :type command: tuple of list of tuples
+ :param commands: List of commands to execute.
+ :type commands: list of tuples or strings
+
+
+ .. method:: GammuWorker.initiate()
+ :module: gammu.worker
+
+ Connects to phone.
+
+
+ .. method:: GammuWorker.terminate(timeout=None)
+ :module: gammu.worker
+
+ Terminates phone connection.
+
+
+.. exception:: InvalidCommand(value)
+ :module: gammu.worker
+
+ Exception indicating invalid command.
+
+
+.. function:: check_worker_command(command)
+ :module: gammu.worker
+
+ Checks whether command is valid.
+
+ :param command: Name of command.
+ :type command: string
+
+
diff --git a/docs/manual/quick/index.rst b/docs/manual/quick/index.rst
new file mode 100644
index 0000000..b83c13e
--- /dev/null
+++ b/docs/manual/quick/index.rst
@@ -0,0 +1,200 @@
+.. _quick:
+
+Quick starter guide
+===================
+
+Gammu family
+------------
+
+Gammu family consists of several programs and libraries:
+
+:ref:`gammu`
+ Command line utility to talk to the phone. It performs one time operations
+ only.
+`Wammu <https://wammu.eu/wammu>`_
+ Graphical interface for Gammu, providing basic functions.
+:ref:`gammu-smsd`
+ Daemon to receive and send messages using your phone.
+:ref:`gammu-smsd-inject`
+ Injects outgoing messages into :ref:`gammu-smsd` queue.
+:ref:`gammu-detect`
+ Simple utility to detect phones or modems connected to computer.
+:ref:`python`
+ Python bindings for Gammu, use it from Python scripts.
+:ref:`libgammu`
+ Core library, used by all other parts and you can use it directly in your C
+ programs.
+
+Installing Gammu
+----------------
+
+On most platforms you can install Gammu from binaries - most Linux
+distributions ship Gammu and for Windows you can download binaries from
+`Gammu website <https://wammu.eu/download/>`_. You can find more detailed
+instructions (including instructions for compiling from source) in
+:ref:`installing`.
+
+Starting with Gammu on Linux
+----------------------------
+
+First you need to find out device name where your phone/modem is connected. In
+most cases you can rely on :ref:`gammu-detect` to find it (it will also list
+all serial ports in your systems, where probably nothing is connected).
+
+Generally for most current modems you will end up with ``/dev/ttyUSB0``.
+
+The next step is to create configuration file in :file:`~/.gammurc` (see
+:ref:`gammurc`):
+
+.. code-block:: ini
+
+ [gammu]
+ device = /dev/ttyUSB0
+ connection = at
+
+And you can connect to the phone:
+
+.. code-block:: console
+
+ $ gammu identify
+ Device : /dev/ttyUSB0
+ Manufacturer : Wavecom
+ Model : MULTIBAND 900E 1800 (MULTIBAND 900E 1800)
+ Firmware : 641b09gg.Q2403A 1320676 061804 14:38
+ IMEI : 123456789012345
+ SIM IMSI : 987654321098765
+
+Starting with Gammu on Windows
+------------------------------
+
+First you need to find out device name where your phone/modem is connected. The
+easiest way is to look into :guilabel:`Device manager` under
+:guilabel:`Ports (COM & LPT)` and lookup correct COM port there.
+
+Generally for most current modems you will end up with something like
+``COM12``.
+
+The next step is to create configuration file in
+:file:`$PROFILE\\Application Data\\gammurc` (see :ref:`gammurc`):
+
+.. code-block:: ini
+
+ [gammu]
+ device = COM12:
+ connection = at
+
+And you can connect to the phone:
+
+.. code-block:: console
+
+ C:\Program Files\Gammu 1.33.0\bin> gammu identify
+ Device : COM12:
+ Manufacturer : Wavecom
+ Model : MULTIBAND 900E 1800 (MULTIBAND 900E 1800)
+ Firmware : 641b09gg.Q2403A 1320676 061804 14:38
+ IMEI : 123456789012345
+ SIM IMSI : 987654321098765
+
+Starting with SMSD
+------------------
+
+.. note::
+
+ Before starting with SMSD, make sure you can connect to your phone using
+ Gammu (see chapters above for guide how to do that).
+
+Once you have configured Gammu, running :ref:`gammu-smsd` is pretty easy. You
+need to decide where you want to store messages (see :config:option:`Service`).
+For this example we will stick with MySQL database, but the instructions are
+quite similar for any storage service.
+
+Configuring the storage
++++++++++++++++++++++++
+
+First we have to setup the actual storage. With MySQL, we need access to the
+MySQL server. Now connect as administrative user to the server (usually
+``root``), grant privileges to the ``smsd`` user and create ``smsd`` database:
+
+.. code-block:: mysql
+
+ GRANT USAGE ON *.* TO 'smsd'@'localhost' IDENTIFIED BY 'password';
+
+ GRANT SELECT, INSERT, UPDATE, DELETE ON `smsd`.* TO 'smsd'@'localhost';
+
+ CREATE DATABASE smsd;
+
+Once this is ready, you should import the tables structure. It is shipped as
+:file:`docs/sql/mysql.sql` with Gammu, so all you have to do is to import this
+file (see :ref:`mysql-create` for more details):
+
+.. code-block:: console
+
+ $ mysql -u root -p password smsd < docs/sql/mysql.sql
+
+Configuring SMSD
+++++++++++++++++
+
+Now we just have to tell SMSD what service it is supposed to use. This is done
+in the SMSD configuration file. You can place it anywhere and tell SMSD on
+startup where it can find it, but on Linux the recommended location for system
+wide service is :file:`/etc/gammu-smsdrc` (see :ref:`gammu-smsdrc` for more
+information).
+
+You have to put both modem and storage service configuration into this file:
+
+.. code-block:: ini
+
+ [gammu]
+ device = /dev/ttyUSB0
+ connection = at
+
+ [smsd]
+ service = SQL
+ driver = native_mysql
+ host = localhost
+ database = smsd
+ user = smsd
+ password = password
+
+There are many ways to customize SMSD, but the defaults should work fine in
+most environments. You can find more information on customizing SMSD in
+:ref:`gammu-smsdrc`.
+
+Running SMSD
+++++++++++++
+
+With configuration file ready, you can actually start SMSD. You can do this
+manually or as a system wide service.
+
+For manual startup, just execute it:
+
+.. code-block:: console
+
+ $ gammu-smsd
+
+Alternatively you can specify path to the configuration file:
+
+.. code-block:: console
+
+ $ gammu-smsd -c /path/to/gammu-smsdrc
+
+The binary packages on Linux usually come with support for starting SMSD as a
+system wide daemon.
+
+With systemd, you can start it by:
+
+.. code-block:: console
+
+ $ systemctl start gammu-smsd.service
+
+Sending message through SMSD
+++++++++++++++++++++++++++++
+
+Once SMSD is up and running, you can send some messages using it:
+
+.. code-block:: console
+
+ $ gammu-smsd-inject TEXT 123456 -text "All your base are belong to us"
+
+You can find more examples in the :ref:`gammu-smsd-inject` documentation:
+:ref:`smsd-inject-examples`.
diff --git a/docs/manual/requirements.txt b/docs/manual/requirements.txt
new file mode 100644
index 0000000..cd6467e
--- /dev/null
+++ b/docs/manual/requirements.txt
@@ -0,0 +1 @@
+breathe
diff --git a/docs/manual/smsd/backends.rst b/docs/manual/smsd/backends.rst
new file mode 100644
index 0000000..80cd67b
--- /dev/null
+++ b/docs/manual/smsd/backends.rst
@@ -0,0 +1,20 @@
+.. _smsd_services:
+
+Backend services
+----------------
+
+The backend service is used to store messages (both incoming and queue of
+outgoing ones).
+
+.. toctree::
+ :maxdepth: 2
+
+ files
+ sql
+ mysql
+ pgsql
+ dbi
+ odbc
+ null
+ tables
+
diff --git a/docs/manual/smsd/code.rst b/docs/manual/smsd/code.rst
new file mode 100644
index 0000000..93128bc
--- /dev/null
+++ b/docs/manual/smsd/code.rst
@@ -0,0 +1,201 @@
+Developer documentation
+=======================
+
+Backend services
+----------------
+
+The backend service is responsible for storing received messages and giving
+the SMSD core messages to send. It is solely up to them how the message will
+be stored, for example currently Gammu includes backends to store messages on
+filesystem (:ref:`gammu-smsd-files`), various databases (:ref:`gammu-smsd-mysql`,
+:ref:`gammu-smsd-pgsql`, :ref:`gammu-smsd-dbi`) or backend which does not store anything
+at all (:ref:`gammu-smsd-null`).
+
+
+Backend interface
++++++++++++++++++
+
+Each backend service needs to support several operations, which are exported
+in ``GSM_SMSDService`` structure:
+
+.. c:function:: GSM_Error GSM_SMSDService::Init (GSM_SMSDConfig *Config)
+
+ Initializes internal state, connect to backend storage.
+
+ :param Config: Pointer to SMSD configuration data
+ :return: Error code.
+
+.. c:function:: GSM_Error GSM_SMSDService::Free (GSM_SMSDConfig *Config)
+
+ Freeing internal data, disconnect from backend storage.
+
+ :param Config: Pointer to SMSD configuration data
+ :return: Error code.
+
+.. c:function:: GSM_Error GSM_SMSDService::InitAfterConnect (GSM_SMSDConfig *Config)
+
+ Optional hook called after SMSD is connected to phone, can be used for storing information about phone in backend.
+
+ :param Config: Pointer to SMSD configuration data
+ :return: Error code.
+
+.. c:function:: GSM_Error GSM_SMSDService::SaveInboxSMS (GSM_MultiSMSMessage *sms, GSM_SMSDConfig *Config, char **Locations)
+
+ Saves message into inbox.
+
+ :param sms: Message data to save
+ :param Config: Pointer to SMSD configuration data
+ :param Locations: Newly allocation pointer to string with IDs identifying saved messages.
+ :return: Error code.
+
+.. c:function:: GSM_Error GSM_SMSDService::FindOutboxSMS (GSM_MultiSMSMessage *sms, GSM_SMSDConfig *Config, char *ID)
+
+ Finds message in outbox suitable for sending.
+
+ :param sms: Found outbox message will be stored here
+ :param Config: Pointer to SMSD configuration data
+ :param ID: Identification of found message will be stored here, this
+ should be unique for different message, so that repeated attempts to
+ send same message can be detected by SMSD core. Empty string avoids
+ this check.
+ :return: Error code.
+
+.. c:function:: GSM_Error GSM_SMSDService::MoveSMS (GSM_MultiSMSMessage *sms, GSM_SMSDConfig *Config, char *ID, gboolean alwaysDelete, gboolean sent)
+
+ Moves sent message from outbox to sent items.
+
+ :param sms: Message which should be moved, backend usually can get it by ID as well.
+ :param Config: Pointer to SMSD configuration data.
+ :param ID: Identification of message to be moved.
+ :param alwaysDelete: Whether to delete message from outbox even if moving fails.
+ :param sent: Whether message was sent (``TRUE``) or there was a failure (``FALSE``).
+ :return: Error code.
+
+.. c:function:: GSM_Error GSM_SMSDService::CreateOutboxSMS (GSM_MultiSMSMessage *sms, GSM_SMSDConfig *Config, char *NewID)
+
+ Saves message into outbox queue.
+
+ :param sms: Message data to save
+ :param Config: Pointer to SMSD configuration data
+ :param NewID: ID of created message will be stored here.
+ :return: Error code.
+
+.. c:function:: GSM_Error GSM_SMSDService::AddSentSMSInfo (GSM_MultiSMSMessage *sms, GSM_SMSDConfig *Config, char *ID, int Part, GSM_SMSDSendingError err, int TPMR)
+
+ Logs information about sent message (eg. delivery report).
+
+ :param sms: Message which should be moved, backend usually can get it by ID as well.
+ :param Config: Pointer to SMSD configuration data
+ :param ID: Identification of message to be marked.
+ :param Part: Part of the message which is being processed.
+ :param err: Status of sending message.
+ :param TPMR: Message reference if available (:term:`TPMR`).
+ :return: Error code.
+
+.. c:function:: GSM_Error GSM_SMSDService::RefreshSendStatus (GSM_SMSDConfig *Config, char *ID)
+
+ Updates sending status in service backend.
+
+ :param Config: Pointer to SMSD configuration data
+ :param ID: Identification of message to be marked.
+ :return: Error code.
+
+.. c:function:: GSM_Error GSM_SMSDService::RefreshPhoneStatus (GSM_SMSDConfig *Config)
+
+ Updates information about phone in database (network status, battery, etc.).
+
+ :param Config: Pointer to SMSD configuration data
+ :return: Error code.
+
+.. c:function:: GSM_Error GSM_SMSDService::ReadConfiguration (GSM_SMSDConfig *Config)
+
+ Reads configuration specific for this backend.
+
+ :param Config: Pointer to SMSD configuration data
+ :return: Error code.
+
+Message ID
+++++++++++
+
+You might have noticed that message ID is often used in the API. The primary
+reason for this is that it is usually easier for backend to handle message
+just by it's internal identification instead of handling message data from
+:c:type:`GSM_MultiSMSMessage`.
+
+If the backend does not use any IDs internally, it really does not have to
+provide them, with only exception of :c:func:`GSM_SMSDService::FindOutboxSMS`,
+where ID is used for detection of repeated sending of same message.
+
+The lifetime of ID for sent message:
+
+ * :c:func:`GSM_SMSDService::CreateOutboxSMS` or direct manipulation
+ with backend storage creates new ID
+ * :c:func:`GSM_SMSDService::FindOutboxSMS` returns ID of message to
+ process
+ * :c:func:`GSM_SMSDService::AddSentSMSInfo` and
+ :c:func:`GSM_SMSDService::RefreshSendStatus` are then notified using
+ this ID about sending of the message
+ * :c:func:`GSM_SMSDService::MoveSMS` then moves the message based on
+ ID to sent items
+
+The lifetime of ID for incoming messages:
+
+ * :c:func:`GSM_SMSDService::SaveInboxSMS` generates the message
+ * :ref:`gammu-smsd-run` uses this ID
+
+Message Sending Workflow
+------------------------
+
+.. graphviz::
+
+ digraph smsdsending {
+ "new message" [shape=box];
+ "message in storage" [shape=box];
+ "message sent" [shape=box];
+ "error sending message" [shape=box];
+ "new message" -> "manually created SMS";
+ "new message" -> "CreateOutboxSMS";
+ "manually created SMS" -> "message in storage";
+ "CreateOutboxSMS" -> "message in storage"
+ "message in storage" -> "FindOutboxSMS";
+ "FindOutboxSMS" -> "AddSentSMSInfo(ERROR)" [label="Error", style=dotted];
+ "FindOutboxSMS" -> "check duplicates";
+ "check duplicates" -> "AddSentSMSInfo(ERROR)" [label="Too many retries", style=dotted];
+ "check duplicates" -> "GSM_SendSMS";
+ "GSM_SendSMS" -> "RefreshSendStatus";
+ "GSM_SendSMS" -> "AddSentSMSInfo(ERROR)" [label="Error", style=dotted];
+ "RefreshSendStatus" -> "RefreshSendStatus" [label="Sending"];
+ "RefreshSendStatus" -> "AddSentSMSInfo(ERROR)" [label="Timeout", style=dotted];
+ "RefreshSendStatus" -> "AddSentSMSInfo(OK)";
+ "AddSentSMSInfo(OK)" -> "MoveSMS(noforce, OK)";
+ "MoveSMS(noforce, OK)" -> "MoveSMS(force, ERR)" [label="Error", style=dotted];
+ "AddSentSMSInfo(OK)" -> "MoveSMS(force, ERR)" [label="Error", style=dotted];
+ "AddSentSMSInfo(ERROR)" -> "MoveSMS(force, ERR)";
+ "MoveSMS(noforce, OK)" -> "message sent";
+ "MoveSMS(force, ERR)" -> "error sending message";
+ }
+
+Message Receiving Workflow
+--------------------------
+
+.. graphviz::
+
+ digraph smsdreceiving {
+ "received message" [shape=box];
+ "ignored message" [shape=box];
+ "failed message" [shape=box];
+ "waiting message" [shape=box];
+ "processed message" [shape=box];
+ "received message" -> "GSM_GetNextSMS";
+ "GSM_GetNextSMS" -> "SMSD_ValidMessage";
+ "SMSD_ValidMessage" -> "GSM_LinkSMS";
+ "SMSD_ValidMessage" -> "ignored message" [label="Not valid", style=dotted];
+ "GSM_LinkSMS" -> "SMSD_CheckMultipart";
+ "SMSD_CheckMultipart" -> "SaveInboxSMS";
+ "SMSD_CheckMultipart" -> "waiting message" [label="Not all parts", style=dotted];
+ "SaveInboxSMS" -> "SMSD_RunOnReceive" [label="Locations are passed here"];
+ "SaveInboxSMS" -> "failed message" [label="Error", style=dotted];
+ "SMSD_RunOnReceive" -> "GSM_DeleteSMS";
+ "GSM_DeleteSMS" -> "processed message"
+ "GSM_DeleteSMS" -> "failed message" [label="Error", style=dotted];
+ }
diff --git a/docs/manual/smsd/config.rst b/docs/manual/smsd/config.rst
new file mode 100644
index 0000000..7ab7f5f
--- /dev/null
+++ b/docs/manual/smsd/config.rst
@@ -0,0 +1,828 @@
+.. _gammu-smsdrc:
+
+SMSD Configuration File
+=======================
+
+Description
+-----------
+
+gammu-smsd reads configuration from a config file. It's location can be
+specified on command line, otherwise default path ``/etc/gammu-smsdrc``
+is used.
+
+This file use ini file syntax, see :ref:`ini`.
+
+Configuration file of gammu-smsd consists of at least two sections -
+:config:section:`[gammu]` and :config:section:`[smsd]`. For :ref:`gammu-smsd-sql`
+you can also use :config:section:`[sql]` and :config:section:`[tables]`.
+
+The :config:section:`[gammu]` section is configuration of a phone connection
+and is same as described in :ref:`gammurc` with the only exception that
+:config:option:`LogFile` is ignored and common logging for gammu library and
+SMS daemon is used. However the :config:option:`LogFormat` directive still
+configures how much messages gammu emits.
+
+.. config:section:: [smsd]
+
+ The :config:section:`[smsd]` section configures SMS daemon itself, which are described in
+ following subsections. First general parameters of SMS daemon are listed and
+ then specific parameters for storage backends.
+
+.. config:section:: [include_numbers]
+
+ List of numbers from which accept messages, see :ref:`message_filtering`.
+
+.. config:section:: [exclude_numbers]
+
+ List of numbers from which reject messages, see :ref:`message_filtering`.
+
+.. config:section:: [include_smsc]
+
+ List of SMSC numbers from which accept messages, see :ref:`message_filtering`.
+
+.. config:section:: [exclude_smsc]
+
+ List of SMSC numbers from which reject messages, see :ref:`message_filtering`.
+
+.. config:section:: [sql]
+
+ Configure SQL queries used by :ref:`gammu-smsd-sql`, you usually don't have to modify them.
+
+ .. seealso:: :ref:`Configurable queries`
+
+.. config:section:: [tables]
+
+ Configure SQL table names used by :ref:`gammu-smsd-sql`, you usually don't have to modify them.
+
+ .. seealso:: :ref:`Configurable tables`
+
+General parameters of SMS daemon
+--------------------------------
+
+.. config:option:: Service
+
+ SMSD service to use, one of following choices:
+
+ ``FILES``
+ Stores messages in files, see :ref:`gammu-smsd-files` for details.
+ ``NULL``
+ Does not store messages at all, see :ref:`gammu-smsd-null` for details.
+ ``SQL``
+ Stores messages in SQL database, see :ref:`gammu-smsd-sql` for details,
+ choose database type to use by :config:option:`Driver`.
+
+ .. versionadded:: 1.28.93
+ ``MYSQL``
+ .. deprecated:: 1.28.93
+
+ Use :config:option:`Service` = ``SQL`` and :config:option:`Driver` = ``native_mysql`` instead.
+
+ Compatibility option for older configuration files, stores messages in
+ MySQL database, see :ref:`gammu-smsd-mysql` for details.
+
+ ``PGSQL``
+ .. deprecated:: 1.28.93
+
+ Use :config:option:`Service` = ``SQL`` and :config:option:`Driver` = ``native_pgsql`` instead.
+
+ Compatibility option for older configuration files, stores messages in
+ PostgreSQL database, see :ref:`gammu-smsd-pgsql` for details.
+
+ ``DBI``
+ .. deprecated:: 1.28.93
+
+ Use :config:option:`Service` = ``SQL`` and :config:option:`Driver` = DBI driver instead.
+
+ Compatibility option for older configuration files, stores messages in
+ any database supported by libdbi, see :ref:`gammu-smsd-dbi` for details.
+
+ .. note::
+
+ Availability of backends depends on platform and compile time configuration.
+
+.. config:option:: PIN
+
+ PIN for SIM card. This is optional, but you should set it if your phone after
+ power on requires PIN.
+
+.. config:option:: NetworkCode
+
+ Network personalisation password. This is optional, but some phones require it
+ after power on.
+
+.. config:option:: PhoneCode
+
+ Phone lock password. This is optional, but some phones require it after power
+ on.
+
+.. config:option:: LogFile
+
+ File where SMSD actions are being logged. You can also use special value
+ ``syslog`` which will send all messages to syslog daemon. On Windows another
+ special value ``eventlog`` exists, which will send logs to Windows Event Log.
+
+ If you run SMSD as a system daemon (or service), it is recommended to use
+ absolute path to log file as startup directory might be different than you
+ expect.
+
+ Default is to provide no logging.
+
+ .. note::
+
+ For logging to Windows Event Log, it is recommended to install Event Log
+ source by invoking :option:`gammu-smsd -e` (this is automatically done during
+ installation of Gammu).
+
+.. config:option:: LogFacility
+
+ Facility to use on logging backends which support it (currently only
+ syslog). One of following chouces:
+
+ * ``DAEMON`` (default)
+ * ``USER``
+ * ``LOCAL0``
+ * ``LOCAL1``
+ * ``LOCAL2``
+ * ``LOCAL3``
+ * ``LOCAL4``
+ * ``LOCAL5``
+ * ``LOCAL6``
+ * ``LOCAL7``
+
+ .. versionadded:: 1.30.91
+
+.. config:option:: DebugLevel
+
+ Debug level for SMSD. The integer value should be sum of all flags you
+ want to enable.
+
+ 1
+ enables basic debugging information
+ 2
+ enables logging of SQL queries of service backends
+ 4
+ enables logging of gammu debug information
+
+ Generally to get as much debug information as possible, use 255.
+
+ Default is 0, what should mean no extra information.
+
+.. config:option:: CommTimeout
+
+ How many seconds should SMSD wait after there is no message in outbox
+ before scanning it again.
+
+ Default is 30.
+
+.. config:option:: SendTimeout
+
+ Shows how many seconds SMSD should wait for network answer during sending
+ sms. If nothing happen during this time, sms will be resent.
+
+ Default is 30.
+
+.. config:option:: MaxRetries
+
+ How many times will SMSD try to resend message if sending fails. This
+ is tracked per message and currently supported only with SQL backends.
+
+ Default is 1.
+
+.. config:option:: ReceiveFrequency
+
+ The number of seconds between testing for received SMSes, when the phone is
+ busy sending SMSes. Normally a test for received SMSes is done every
+ :config:option:`CommTimeout` seconds and after each sent SMS.
+
+ Default is 15.
+
+.. config:option:: StatusFrequency
+
+ The number of seconds between refreshing phone status (battery, signal) stored
+ in shared memory and possibly in service backends. Use 0 to disable.
+
+ You might want to increase this for higher throughput.
+
+ Default is 60.
+
+.. config:option:: LoopSleep
+
+ The number of seconds how long will SMSD sleep before checking for some
+ activity. Please note that setting this to higher value than 1 will have
+ effects to other time based configurations, because they will be effectively
+ rounded to multiply of this value.
+
+ Setting this to 0 disables sleeping. Please note this might cause Gammu to
+ consume quite a lot of CPU power as it will effectively do busy loop.
+
+ This sleep is utilized only if the main loop (sending and receiving
+ messages) takes less than defined time. For example if you set LoopSleep to
+ 5 seconds and sending messages take 10 seconds, no sleep will be done in
+ the iteration which is sending messages. Also the sleep time is lowered by
+ the already processed time.
+
+ Default is 1.
+
+.. config:option:: MultipartTimeout
+
+ The number of seconds how long will SMSD wait for all parts of multipart
+ message. If all parts won't arrive in time, parts will be processed as separate
+ messages.
+
+ Default is 600 (10 minutes).
+
+.. config:option:: CheckSecurity
+
+ Whether to check if phone wants to enter PIN.
+
+ Default is 1 (enabled).
+
+.. config:option:: HangupCalls
+
+ .. versionadded:: 1.34.0
+
+ Whether to automatically hangup any incoming calls.
+
+ Default is 0 (disabled).
+
+.. config:option:: CheckBattery
+
+ Whether to check phone battery state periodically.
+
+ Default is 1 (enabled).
+
+.. config:option:: CheckSignal
+
+ Whether to check signal level periodically.
+
+ Default is 1 (enabled).
+
+.. config:option:: CheckNetwork
+
+ .. versionadded:: 1.37.90
+
+ Whether to check network status periodically.
+
+ If phone is reported to be not on the network, SMSD
+ tries to power it on.
+
+ Default is 1 (enabled).
+
+.. config:option:: ResetFrequency
+
+ The number of seconds between performing a preventive soft reset in order to
+ minimize the cases of hanging phones e.g. Nokia 5110 will sometimes freeze to
+ a state when only after unmounting the battery the phone will be functional
+ again.
+
+ Default is 0 (not used).
+
+.. config:option:: HardResetFrequency
+
+ .. versionadded:: 1.28.92
+
+ .. warning::
+
+ For some phones hard reset means deleting all data in it. Use
+ :config:option:`ResetFrequency` instead, unless you know what you are
+ doing.
+
+ The number of seconds between performing a preventive hard reset in order to
+ minimize the cases of hanging phones.
+
+ Default is 0 (not used).
+
+.. config:option:: DeliveryReport
+
+ Whether delivery reports should be used, one of ``no``, ``log``, ``sms``.
+
+ ``log``
+ one line log entry,
+ ``sms``
+ store in inbox as a received SMS
+ ``no``
+ no delivery reports
+
+ Default is ``no``.
+
+.. config:option:: DeliveryReportDelay
+
+ Delay in seconds how long is still delivery report considered valid. This
+ depends on brokenness of your network (delivery report should have same
+ timestamp as sent message). Increase this if delivery reports are not paired
+ with sent messages.
+
+ Default is 600 (10 minutes).
+
+.. config:option:: PhoneID
+
+ String with info about phone used for sending/receiving. This can be useful if
+ you want to run several SMS daemons (see :ref:`smsd-multi`).
+
+ When you set PhoneID, all messages (including injected ones) will be marked
+ by this string (stored as SenderID in the database) and it allows more SMS
+ daemons to share a single database.
+
+ SMSD daemon will in such case send :ref:`outbox` messages only with
+ matching or empty SenderID.
+
+ This option has actually no effect with :ref:`gammu-smsd-files`.
+
+.. config:option:: SMSC
+
+ .. versionadded:: 1.36.2
+
+ SMSC number to use for sending messages if not specified in the message
+ (see options of :ref:`gammu-smsd-inject`).
+
+ In most cases you don't need this settings as Gammu tries to read correct
+ SMSC from phone, but sometimes this fails (try :option:`gammu getsmsc`).
+
+.. config:option:: RunOnReceive
+
+ Executes a program after receiving message.
+
+ This parameter is executed through shell, so you might need to escape some
+ special characters and you can include any number of parameters. Additionally
+ parameters with identifiers of received messages are appended to the command
+ line. The identifiers depend on used service backend, typically it is ID of
+ inserted row for database backends or file name for file based backends.
+
+ Gammu SMSD waits for the script to terminate. If you make some time consuming
+ there, it will make SMSD not receive new messages. However to limit breakage
+ from this situation, the waiting time is limited to two minutes. After this
+ time SMSD will continue in normal operation and might execute your script
+ again.
+
+ The process has available lot of information about received message in
+ environment, check :ref:`gammu-smsd-run` for more details.
+
+.. config:option:: RunOnFailure
+
+ .. versionadded:: 1.28.93
+
+ Executes a program on failure.
+
+ This can be used to proactively react on some failures or to interactively
+ detect failure of sending message.
+
+ The program will receive optional parameter, which can currently be either
+ ``INIT`` (meaning failure during phone initialization) or message ID,
+ which would indicate error while sending the message.
+
+ .. note:: The environment with message (as is in :config:option:`RunOnReceive`) is not passed to the command.
+
+.. config:option:: RunOnSent
+
+ .. versionadded:: 1.36.4
+
+ Executes a program after sending message.
+
+ The program will receive optional parameter a message ID and environment
+ with message details as described in :ref:`gammu-smsd-run`.
+
+.. config:option:: RunOnIncomingCall
+
+ .. versionadded:: 1.38.5
+
+ Executes a program after cancelling incoming call.
+
+ The program will receive a parameter with a phone number of the call.
+ This requires :config:option:`HangupCalls` to be enabled.
+
+.. config:option:: IncludeNumbersFile
+
+ File with list of numbers which are accepted by SMSD. The file contains one
+ number per line, blank lines are ignored. The file is read at startup and is
+ reread only when configuration is being reread. See Message filtering for
+ details.
+
+.. config:option:: ExcludeNumbersFile
+
+ File with list of numbers which are not accepted by SMSD. The file contains
+ one number per line, blank lines are ignored. The file is read at startup and
+ is reread only when configuration is being reread. See Message filtering for
+ details.
+
+.. config:option:: IncludeSMSCFile
+
+ File with list of SMSC numbers which are accepted by SMSD. The file contains
+ one number per line, blank lines are ignored. The file is read at startup and
+ is reread only when configuration is being reread. See Message filtering for
+ details.
+
+.. config:option:: ExcludeSMSCFile
+
+ File with list of SMSC numbers which are not accepted by SMSD. The file
+ contains one number per line, blank lines are ignored. The file is read at
+ startup and is reread only when configuration is being reread. See Message
+ filtering for details.
+
+.. config:option:: BackendRetries
+
+ 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.
+
+.. config:option:: Send
+
+ .. versionadded:: 1.28.91
+
+ Whether to enable sending of messages.
+
+ Default is True.
+
+.. config:option:: Receive
+
+ .. versionadded:: 1.28.91
+
+ Whether to enable receiving of messages.
+
+ Default is True.
+
+
+Database backends options
+-------------------------
+
+All DBI, ODBC, MYSQL and PGSQL backends (see :ref:`gammu-smsd-mysql`,
+:ref:`gammu-smsd-odbc`, :ref:`gammu-smsd-pgsql`, :ref:`gammu-smsd-dbi` for
+their documentation) supports same options for configuring connection to a
+database:
+
+.. config:option:: User
+
+ User name used for connection to a database.
+
+.. config:option:: Password
+
+ Password used for connection to a database.
+
+.. config:option:: Host
+
+ Database server address. It can also contain port or socket path after
+ semicolon, for example ``localhost:/path/to/socket`` or
+ ``192.168.1.1:8000``.
+
+ For ODBC this is used as Data source name.
+
+ .. note::
+
+ Some database servers differentiate usage of ``localhost`` (to use
+ local socket) and ``127.0.0.1`` (to use locat TCP/IP connection).
+ Please make sure your SMSD settings match the database server ones.
+
+ .. versionadded:: 1.28.92
+
+.. config:option:: PC
+
+ .. deprecated:: 1.28.92
+
+ Please use :config:option:`Host` instead.
+
+ Synonym for :config:option:`Host`, kept for backwards compatibility.
+
+.. config:option:: Database
+
+ Name of database (or schema) to use and where SMSD can find it's tables.
+
+ Please note that you should create tables in this database before using
+ gammu-smsd. SQL files for creating needed tables are included in
+ documentation for individual database backends: :ref:`gammu-smsd-mysql`,
+ :ref:`gammu-smsd-odbc`, :ref:`gammu-smsd-pgsql`, :ref:`gammu-smsd-dbi`
+
+.. config:option:: SkipSMSCNumber
+
+ When you send sms from some SMS centers you can have delivery reports from
+ other SMSC number. You can set here number of this SMSC used by you and Gammu
+ will not check it's number during assigning reports to sent SMS.
+
+.. config:option:: Driver
+
+ SQL driver to use, Gammu supports several native drivers and generic
+ interface using ODBC and DBI. Availability of the backends depends on
+ compile time options.
+
+ Available drivers:
+
+ ``odbc``
+
+ Connects to the database using ODBC, see :ref:`gammu-smsd-odbc`.
+
+ ``native_mysql``
+
+ Stores messages in MySQL database, see :ref:`gammu-smsd-mysql` for
+ details.
+
+ ``native_pgsql``
+
+ Stores messages in PostgreSQL database, see :ref:`gammu-smsd-pgsql` for
+ details.
+
+ ``db2``, ``firebird``, ``freetds``, ``ingres``, ``msql``, ``mysql``, ``oracle``, ``pgsql``, ``sqlite``, ``sqlite3``
+
+ Stores messages using DBI library in given backend. You need to have
+ installed appropriate DBI driver to make it work. See
+ :ref:`gammu-smsd-dbi` for details.
+
+.. config:option:: SQL
+
+ SQL dialect to use. This is specially useful with :ref:`gammu-smsd-odbc` where SMSD
+ does not know which server it is actually talking to.
+
+ Possible values:
+
+ * ``mysql`` - MySQL
+ * ``pgsql`` - PostgreSQL
+ * ``sqlite`` - SQLite
+ * ``mssql`` - Microsoft SQL Server
+ * ``sybase`` - Sybase
+ * ``access`` - Microsoft Access
+ * ``oracle`` - Oracle
+ * ``odbc`` - Generic ODBC
+
+ .. versionadded:: 1.28.93
+
+ .. seealso:: You can also completely customize SQL queries used as described in :ref:`SQL Queries`.
+
+.. config:option:: DriversPath
+
+ Path, where DBI drivers are stored, this usually does not have to be set if
+ you have properly installed drivers.
+
+.. config:option:: DBDir
+
+ Database directory for some (currently only sqlite) DBI drivers. Set here path
+ where sqlite database files are stored.
+
+Files backend options
++++++++++++++++++++++
+
+The FILES backend accepts following configuration options. See
+:ref:`gammu-smsd-files` for more detailed service backend description. Please note
+that all path should contain trailing path separator (/ on Unix systems):
+
+.. config:option:: InboxPath
+
+ Where the received SMSes are stored.
+
+ Default is current directory.
+
+.. config:option:: OutboxPath
+
+ Where SMSes to be sent should be placed.
+
+ Default is current directory.
+
+.. config:option:: SentSMSPath
+
+ Where the transmitted SMSes are placed, if same as :config:option:`OutboxPath` transmitted
+ messages are deleted.
+
+ Default is to delete transmitted messages.
+
+.. config:option:: ErrorSMSPath
+
+ Where SMSes with error in transmission is placed.
+
+ Default is same as :config:option:`SentSMSPath`.
+
+.. config:option:: InboxFormat
+
+ The format in which the SMS will be stored: ``detail``, ``unicode``, ``standard``.
+
+ ``detail``
+ format used for message backup by :ref:`gammu`, see :ref:`gammu-smsbackup`.
+ ``unicode``
+ message text stored in unicode (UTF-16)
+ ``standard``
+ message text stored in system charset
+
+ The ``standard`` and ``unicode`` settings do not apply for 8-bit messages, which
+ are always written raw as they are received with extension .bin.
+
+ Default is ``unicode``.
+
+ .. note::
+
+ In ``detail`` format, all message parts are stored into signle file,
+ for all others each message part is saved separately.
+
+.. config:option:: OutboxFormat
+
+ The format in which messages created by :ref:`gammu-smsd-inject` will be stored,
+ it accepts same values as InboxFormat.
+
+ Default is ``detail`` if Gammu is compiled in with backup functions, ``unicode``
+ otherwise.
+
+.. config:option:: TransmitFormat
+
+ The format for transmitting the SMS: ``auto``, ``unicode``, ``7bit``.
+
+ This option is used only if :config:option:`OutboxFormat` is not set to
+ ``detail``. In such case encoding specified in the message is used (you can
+ specify it to :ref:`gammu-smsd-inject`).
+
+ Default is ``auto``.
+
+.. _message_filtering:
+
+Message filtering
+-----------------
+
+SMSD allows one to process only limited subset of incoming messages. You can define
+filters for sender number in :config:section:`[include_numbers]` and
+:config:section:`[exclude_numbers]` sections or using
+:config:option:`IncludeNumbersFile` and :config:option:`ExcludeNumbersFile`
+directives.
+
+If :config:section:`[include_numbers]` section exists, all values (keys are
+ignored) from it are used as allowed phone numbers and no other message is
+processed. On the other side, in :config:section:`[exclude_numbers]` you can
+specify numbers which you want to skip.
+
+Lists from both sources are merged together. If there is any number in include
+list, only include list is used and only messages in this list are being
+accepted. If include list is empty, exclude list can be used to ignore
+messages from some numbers. If both lists are empty, all messages are
+accepted.
+
+Similar filtering rules can be used for SMSC number filtering, they just use
+different set of configuration options - :config:section:`[include_smsc]` and
+:config:section:`[exclude_smsc]` sections or :config:option:`IncludeSMSCFile`
+and :config:option:`ExcludeSMSCFile` directives.
+
+Examples
+--------
+
+There is more complete example available in Gammu documentation. Please note
+that for simplicity following examples do not include :config:section:`[gammu]`
+section, you can look into :ref:`gammurc` for some examples how it can look like.
+
+Files service
++++++++++++++
+
+SMSD configuration file for FILES backend could look like:
+
+.. code-block:: ini
+
+ [smsd]
+ Service = files
+ PIN = 1234
+ LogFile = syslog
+ InboxPath = /var/spool/sms/inbox/
+ OutboxPath = /var/spool/sms/outbox/
+ SentSMSPath = /var/spool/sms/sent/
+ ErrorSMSPath = /var/spool/sms/error/
+
+MySQL service
++++++++++++++
+
+If you want to use MYSQL backend, you will need something like this:
+
+.. code-block:: ini
+
+ [smsd]
+ Service = sql
+ Driver = native_mysql
+ PIN = 1234
+ LogFile = syslog
+ User = smsd
+ Password = smsd
+ PC = localhost
+ Database = smsd
+
+DBI service using SQLite
+++++++++++++++++++++++++
+
+For :ref:`gammu-smsd-dbi` backend, in this particular case SQLite:
+
+.. code-block:: ini
+
+ [smsd]
+ Service = sql
+ Driver = sqlite3
+ DBDir = /var/lib/sqlite3
+ Database = smsd.db
+
+ODBC service using MySQL
+++++++++++++++++++++++++
+
+For :ref:`gammu-smsd-odbc` backend, in this particular case using DSN ``smsd`` server:
+
+.. code-block:: ini
+
+ [smsd]
+ Service = sql
+ Driver = odbc
+ Host = smsd
+
+The DSN definition (in :file:`~/.odbc.ini` on UNIX) for using MySQL server would look like:
+
+.. code-block:: ini
+
+ [smsd]
+ Description = MySQL
+ Driver = MySQL
+ Server = 127.0.0.1
+ Database = smsd
+ Port =
+ Socket =
+ Option =
+ Stmt =
+
+ [smsdsuse]
+ Driver = MySQL ODBC 3.51.27r695 Driver
+ DATABASE = smsd
+ SERVER = 127.0.0.1
+
+
+Numbers filtering
++++++++++++++++++
+
+Process only messages from 123456 number:
+
+.. code-block:: ini
+
+ [include_numbers]
+ number1 = 123456
+
+Do not process messages from evil number 666:
+
+.. code-block:: ini
+
+ [exclude_numbers]
+ number1 = 666
+
+Debugging
++++++++++
+
+Enabling debugging:
+
+.. code-block:: ini
+
+ [smsd]
+ debuglevel = 255
+ logfile = smsd.log
+
+.. _smsd-multi:
+
+Multiple modems
++++++++++++++++
+
+You can run any number of SMSD instances and they can even share same backend
+database. For routing the messages, you need to set different
+:config:option:`PhoneID` for each instance and set ``SenderID`` column in
+:ref:`outbox` table.
+
+Following example shows configuration for two modems, but you can have any
+number of SMSD instances. The only limitation is performance of your hardware,
+especially if all modems are connected using USB.
+
+Configuration for first SMSD:
+
+.. code-block:: ini
+
+ [gammu]
+ device = /dev/ttyACM0
+ connection = at
+
+ [smsd]
+ Service = sql
+ Driver = native_mysql
+ PIN = 1234
+ LogFile = syslog
+ User = smsd
+ Password = smsd
+ PC = localhost
+ Database = smsd
+ PhoneID = first
+
+Configuration for second SMSD:
+
+.. code-block:: ini
+
+ [gammu]
+ device = /dev/ttyACM1
+ connection = at
+
+ [smsd]
+ Service = sql
+ Driver = native_mysql
+ PIN = 1234
+ LogFile = syslog
+ User = smsd
+ Password = smsd
+ PC = localhost
+ Database = smsd
+ PhoneID = second
+
+You can then start two separate instances of SMSD:
+
+.. code-block:: sh
+
+ gammu-smsd -c /path/to/first-smsdrc
+ gammu-smsd -c /path/to/second-smsdrc
diff --git a/docs/manual/smsd/dbi.rst b/docs/manual/smsd/dbi.rst
new file mode 100644
index 0000000..d9f30ad
--- /dev/null
+++ b/docs/manual/smsd/dbi.rst
@@ -0,0 +1,78 @@
+.. _gammu-smsd-dbi:
+
+DBI Backend
+===========
+
+Description
+-----------
+
+DBI backend stores all data in any database supported by `libdbi`_, which
+parameters are defined by configuration (see :ref:`gammu-smsdrc` for description of
+configuration options).
+
+For tables description see :ref:`gammu-smsd-tables`.
+
+This backend is based on :ref:`gammu-smsd-sql`.
+
+.. note::
+
+ The DBI driver is currently not supported on Windows because libdbi
+ library does not support this platform.
+
+
+Configuration
+-------------
+
+Before running :ref:`gammu-smsd` you need to create necessary tables in the
+database. You can use examples given in database specific backends parts of
+this manual to do that.
+
+The configuration file then can look like:
+
+.. code-block:: ini
+
+ [smsd]
+ service = sql
+ driver = DBI_DRIVER
+ host = localhost
+
+.. seealso:: :ref:`gammu-smsdrc`
+
+Supported drivers
+-----------------
+
+For complete list of drivers for `libdbi`_ see `libdbi-drivers`_ project. The
+drivers for example include:
+
+* ``sqlite3`` - for SQLite 3
+* ``mysql`` - for MySQL
+* ``pgsql`` - for PostgeSQL
+* ``freetds`` - for MS SQL Server or Sybase
+
+.. _libdbi: http://libdbi.sourceforge.net/
+.. _libdbi-drivers: http://libdbi-drivers.sourceforge.net/
+
+.. _sqlite-create:
+
+Creating tables for SQLite
+--------------------------
+
+SQL script for creating tables in SQLite database:
+
+.. literalinclude:: ../../sql/sqlite.sql
+ :language: sql
+
+.. note::
+
+ You can find the script in :file:`docs/sql/sqlite.sql` as well. There are
+ also scripts for other databases in same folder.
+
+Upgrading tables
+----------------
+
+The easiest way to upgrade database structure is to backup old one and start
+with creating new one based on example above.
+
+For upgrading existing database, you can use changes described in
+:ref:`smsd-tables-history` and then manually update ``Version`` field in
+``gammu`` table.
diff --git a/docs/manual/smsd/files.rst b/docs/manual/smsd/files.rst
new file mode 100644
index 0000000..6e204f5
--- /dev/null
+++ b/docs/manual/smsd/files.rst
@@ -0,0 +1,81 @@
+.. _gammu-smsd-files:
+
+Files backend
+=============
+
+Description
+-----------
+
+FILES backend stores all data on a filesystem in folders defined by
+configuration (see :ref:`gammu-smsdrc` for description of configuration options).
+
+Receiving of messages
+---------------------
+
+Received messages are stored in a folder defined by configuration. The
+filename will be ``IN<date>_<time>_<serial>_<sender>_<sequence>.<ext>``,
+for example ``IN20021130_021531_00_+45409000931640979_00.txt``.
+
+Explanation of fields:
+
+``<date>``
+ date in format ``YYYYMMDD``
+``<time>``
+ time in format ``HHMMSS``
+``<sender>``
+ sender number
+``<serial>``
+ order of a message (in case more messages were received at same time), in format ``NN``
+``<sequence>``
+ part of the message for multipart messages, in format ``NN``
+``<ext>``
+ ``txt`` for text message, 8-bit messages are stored with ``bin`` extension, ``smsbackup`` for :ref:`gammu-smsbackup`
+
+The content of the file is content of the message and the format is defined by
+configuration directive :config:option:`InboxFormat` (see :ref:`gammu-smsdrc`).
+
+Transmitting of messages
+------------------------
+
+Transmitted messages are read from a folder defined by configuration. The
+filename should be one of the following formats:
+
+- ``OUT<recipient>.<ext>``
+- ``OUT<priority>_<recipient>_<serial>.<ext>``
+- ``OUT<priority><date>_<time>_<serial>_<recipient>_<note>.<ext>``
+
+Explanation of fields:
+
+``<recipient>``
+ recipient number where to send message
+``<priority>``
+ an alphabetic character (A-Z) A = highest priority
+``<ext>``
+ ``txt`` for normal text SMS, ``smsbackup`` for :ref:`gammu-smsbackup`
+``<note>``
+ any arbitrary text which is ignored
+
+For text messages, you can additionally append flags to extension:
+
+ ``d``
+ delivery report requested
+ ``f``
+ flash SMS
+ ``b``
+ WAP bookmark as name,URL
+
+Other fields are same as for received messages.
+
+For example OUTG20040620_193810_123_+4512345678_xpq.txtdf is a flash text SMS
+requesting delivery reports.
+
+SMSes will be transmitted sequentially based on the file name. The contents of
+the file is the SMS to be transmitted (in Unicode or standard character set).
+
+The contents of the file is the SMS to be transmitted (in Unicode or standard
+character set), for WAP bookmarks it is split on as Name,URL, for text
+messages whole file content is used.
+
+Please note that if file is not in Unicode, encoding is detected based on
+locales, which do not have to be configured if SMSD is running from init
+script. If this is your case, please add locales definition to init script.
diff --git a/docs/manual/smsd/index.rst b/docs/manual/smsd/index.rst
new file mode 100644
index 0000000..36c9b2c
--- /dev/null
+++ b/docs/manual/smsd/index.rst
@@ -0,0 +1,15 @@
+.. _smsd:
+
+SMS Daemon
+==========
+
+.. toctree::
+ :maxdepth: 2
+
+ overview
+ usage
+ manual
+ config
+ run
+ backends
+ code
diff --git a/docs/manual/smsd/inject.rst b/docs/manual/smsd/inject.rst
new file mode 100644
index 0000000..0c35191
--- /dev/null
+++ b/docs/manual/smsd/inject.rst
@@ -0,0 +1,113 @@
+.. _gammu-smsd-inject:
+
+gammu-smsd-inject
+=================
+
+.. program:: gammu-smsd-inject
+
+Synopsis
+--------
+
+.. code-block:: text
+
+ gammu-smsd-inject [OPTION]... MESSAGETYPE RECIPIENT [MESSAGE_PARAMETER]...
+
+Description
+-----------
+
+This manual page documents briefly the :program:`gammu-smsd-inject` command.
+
+:program:`gammu-smsd-inject` is a program that enqueues message in Gammu SMS
+Daemon, which will be later sent by the daemon using connected GSM modem.
+
+Support for this program depends on features available in currently used SMSD
+service backend, however currently it is supported by all of them.
+
+Program accepts following options (please note that long options might be not
+accepted on some platforms):
+
+.. option:: -h, --help
+
+ Shows help.
+
+.. option:: -v, --version
+
+ Shows version information and compiled in features.
+
+.. option:: -c, --config=file
+
+ Configuration file to use, default is /etc/gammu-smsdrc, on Windows there
+ is no default and configuration file path has to be always specified.
+
+.. option:: -l, --use-log
+
+ Use logging as configured in config file.
+
+.. option:: -L, --no-use-log
+
+ Do not use logging as configured in config file (default).
+
+For description of message types and their parameters, please check documentation
+for :option:`gammu savesms`.
+
+.. _smsd-inject-examples:
+
+Examples
+--------
+
+To check it out, you need to have configuration file for SMSD, see
+:ref:`gammu-smsdrc` for more details about it.
+
+Inject text message up to standard 160 chars:
+
+.. code-block:: sh
+
+ echo "All your base are belong to us" | gammu-smsd-inject TEXT 123456
+
+or
+
+.. code-block:: sh
+
+ gammu-smsd-inject TEXT 123456 -text "All your base are belong to us"
+
+Inject unicode text message:
+
+.. code-block:: sh
+
+ gammu-smsd-inject TEXT 123456 -unicode -text "Zkouška sirén"
+
+Inject long text message:
+
+.. code-block:: sh
+
+ echo "All your base are belong to us" | gammu-smsd-inject TEXT 123456 -len 400
+
+or
+
+.. code-block:: sh
+
+ gammu-smsd-inject TEXT 123456 -len 400 -text "All your base are belong to us"
+
+or
+
+.. code-block:: sh
+
+ gammu-smsd-inject EMS 123456 -text "All your base are belong to us"
+
+Inject some funky message with predefined sound and animation from 2 bitmaps:
+
+.. code-block:: sh
+
+ gammu-smsd-inject EMS 123456 -text "Greetings" -defsound 1 -text "from Gammu" -tone10 axelf.txt -animation 2 file1.bmp file2.bmp
+
+Inject protected message with ringtone:
+
+.. code-block:: sh
+
+ gammu-smsd-inject EMS 123456 -protected 2 -variablebitmaplong ala.bmp -toneSElong axelf.txt -toneSE ring.txt
+
+Inject USSD query:
+
+.. code-block:: sh
+
+ gammu-smsd-inject USSD '*101#'
diff --git a/docs/manual/smsd/manual.rst b/docs/manual/smsd/manual.rst
new file mode 100644
index 0000000..a413fff
--- /dev/null
+++ b/docs/manual/smsd/manual.rst
@@ -0,0 +1,9 @@
+Program Manuals
+===============
+
+.. toctree::
+ :maxdepth: 2
+
+ smsd
+ inject
+ monitor
diff --git a/docs/manual/smsd/monitor.rst b/docs/manual/smsd/monitor.rst
new file mode 100644
index 0000000..906692f
--- /dev/null
+++ b/docs/manual/smsd/monitor.rst
@@ -0,0 +1,63 @@
+.. _gammu-smsd-monitor:
+
+gammu-smsd-monitor
+==================
+
+.. program:: gammu-smsd-monitor
+
+Synopsis
+--------
+
+.. code-block:: text
+
+ gammu-smsd-monitor [OPTION]...
+
+Description
+-----------
+
+This manual page documents briefly the :program:`gammu-smsd-monitor` command.
+
+:program:`gammu-smsd-monitor` is a program that monitors state of Gammu SMS
+Daemon. It periodically displays information about phone and number of
+processed messages.
+
+Program accepts following options (please note that long options might be not
+accepted on some platforms):
+
+.. option:: -h, --help
+
+ Shows help.
+
+.. option:: -v, --version
+
+ Shows version information and compiled in features.
+
+.. option:: -c, --config=file
+
+ Configuration file to use, default is /etc/gammu-smsdrc, on Windows there
+ is no default and configuration file path has to be always specified.
+
+.. option:: -n, --loops=count
+
+ Number of loops, by default monitor loops infinitely.
+
+.. option:: -d, --delay=seconds
+
+ Delay between polling SMSD state, default is 20 seconds.
+
+.. option:: -C, --csv
+
+ Print output in comma separated values format:
+
+ .. code-block:: text
+
+ client;phone ID;IMEI;sent;received;failed;battery;signal
+
+.. option:: -l, --use-log
+
+ Use logging as configured in config file.
+
+.. option:: -L, --no-use-log
+
+ Do not use logging as configured in config file (default).
+
diff --git a/docs/manual/smsd/mysql.rst b/docs/manual/smsd/mysql.rst
new file mode 100644
index 0000000..19b59bf
--- /dev/null
+++ b/docs/manual/smsd/mysql.rst
@@ -0,0 +1,94 @@
+.. _gammu-smsd-mysql:
+
+MySQL Backend
+=============
+
+Description
+-----------
+
+MYSQL backend stores all data in a `MySQL`_ database server, which parameters are
+defined by configuration (see :ref:`gammu-smsdrc` for description of configuration
+options).
+
+For tables description see :ref:`gammu-smsd-tables`.
+
+This backend is based on :ref:`gammu-smsd-sql`.
+
+Configuration
+-------------
+
+Before running :ref:`gammu-smsd` you need to create necessary tables in the
+database, which is described below.
+
+The configuration file then can look like:
+
+.. code-block:: ini
+
+ [smsd]
+ service = sql
+ driver = native_mysql
+ host = localhost
+
+.. seealso:: :ref:`gammu-smsdrc`
+
+Privileges
+----------
+
+The user accessing the database does not need much privileges, the following
+privileges should be enough:
+
+.. code-block:: sql
+
+ GRANT USAGE ON *.* TO 'smsd'@'localhost' IDENTIFIED BY 'password';
+
+ GRANT SELECT, INSERT, UPDATE, DELETE ON `smsd`.* TO 'smsd'@'localhost';
+
+ CREATE DATABASE smsd;
+
+.. note::
+
+ For creating the SQL tables you need more privileges, especially for
+ creating triggers, which are used for some functionality.
+
+.. _MySQL: https://www.mysql.com/
+
+.. _mysql-create:
+
+Creating tables for MySQL
+-------------------------
+
+Depending on MySQL version and settings please choose best fitting
+script to create tables:
+
+* :file:`mysql-strict.sql` can be used in strict mode, but requires MySQL 5.6.5
+ or newer
+* :file:`mysql.sql` supports all MySQL versions, but requires neither of
+ `NO_ZERO_DATE`, `ANSI` or `STRICT` modes to be set in the server
+
+SQL script :file:`mysql.sql` for creating tables in MySQL database:
+
+.. literalinclude:: ../../sql/mysql.sql
+ :language: mysql
+
+.. note::
+
+ You can find the script in :file:`docs/sql/mysql.sql` as well.
+
+SQL script :file:`mysql-strict.sql` for creating tables in MySQL database:
+
+.. literalinclude:: ../../sql/mysql-strict.sql
+ :language: mysql
+
+.. note::
+
+ You can find the script in :file:`docs/sql/mysql-strict.sql` as well.
+
+Upgrading tables
+----------------
+
+The easiest way to upgrade database structure is to backup old one and start
+with creating new one based on example above.
+
+For upgrading existing database, you can use changes described in
+:ref:`smsd-tables-history` and then manually update ``Version`` field in
+``gammu`` table.
diff --git a/docs/manual/smsd/null.rst b/docs/manual/smsd/null.rst
new file mode 100644
index 0000000..585d650
--- /dev/null
+++ b/docs/manual/smsd/null.rst
@@ -0,0 +1,25 @@
+.. _gammu-smsd-null:
+
+Null Backend
+============
+
+Description
+-----------
+
+NULL backend does not store data at all. It could be useful in case you
+don't want to store messages at all and you want to process then in
+:config:option:`RunOnReceive` handler.
+
+Configuration
+-------------
+
+The configuration file then can look like:
+
+.. code-block:: ini
+
+ [smsd]
+ Service = null
+ RunOnReceive = /usr/local/bin/process-sms
+
+.. seealso:: :ref:`gammu-smsdrc`
+
diff --git a/docs/manual/smsd/odbc.rst b/docs/manual/smsd/odbc.rst
new file mode 100644
index 0000000..d32e41f
--- /dev/null
+++ b/docs/manual/smsd/odbc.rst
@@ -0,0 +1,90 @@
+.. _gammu-smsd-odbc:
+
+ODBC Backend
+============
+
+Description
+-----------
+
+.. versionadded:: 1.29.92
+
+ODBC backend stores all data in any database supported by `ODBC`_, which
+parameters are defined by configuration (see :ref:`gammu-smsdrc` for description of
+configuration options).
+
+For tables description see :ref:`gammu-smsd-tables`.
+
+This backend is based on :ref:`gammu-smsd-sql`.
+
+Supported drivers
+-----------------
+
+On Microsoft Windows, Gammu uses native ODBC, on other platforms, `unixODBC`_
+can be used.
+
+.. _ODBC: https://en.wikipedia.org/wiki/Open_Database_Connectivity
+.. _unixODBC: http://www.unixodbc.org/
+
+Limitations
+-----------
+
+Due to limits of the ODBC interface, Gammu can not reliably detect which SQL
+engine it is connected to.
+
+In most cases this can be solved by setting :config:option:`SQL` setting to
+correct dialect.
+
+If that fails, you can also tweak the SQL queries to work in used SQL server,
+see :ref:`SQL Queries` for more details. Still you should set
+:config:option:`SQL` to closest matching SQL dialect.
+
+Configuration
+-------------
+
+Before running :ref:`gammu-smsd` you need to create necessary tables in the
+database. You can use examples given in database specific backends parts of
+this manual to do that.
+
+You specify data source name (DSN) as :config:option:`Host` in
+:ref:`gammu-smsdrc`. The data source is configured depending on your platform.
+
+.. note::
+
+ Please remember that SMSD might be running in different context than your
+ user (separate account on Linux or as as service on Windows), so the ODBC
+ DSN needs to be configured as system wide in this case (system DSN on
+ Windows or in global configuration on Linux).
+
+On Microsoft Windows, you can find instructions on Microsoft website:
+https://support.microsoft.com/kb/305599
+
+For unixODBC this is documented in the user manual:
+http://www.unixodbc.org/doc/UserManual/
+
+Creating tables
+---------------
+
+Prior to starting SMSD you have to create tables it will use. Gammu ships SQL
+scripts for several databases to do that:
+
+* :ref:`mysql-create`
+* :ref:`pgsql-create`
+* :ref:`sqlite-create`
+
+
+Example
+-------
+
+Example configuration:
+
+.. code-block:: ini
+
+ [smsd]
+ service = sql
+ driver = odbc
+ host = dsn_of_your_database
+ sql = sql_variant_to_use
+ user = username
+ password = password
+
+.. seealso:: :ref:`gammu-smsdrc`
diff --git a/docs/manual/smsd/overview.rst b/docs/manual/smsd/overview.rst
new file mode 100644
index 0000000..bfc167f
--- /dev/null
+++ b/docs/manual/smsd/overview.rst
@@ -0,0 +1,81 @@
+Overview
+========
+
+Gammu SMS Daemon is a program that periodically scans GSM modem for received
+messages, stores them in defined storage and also sends messages enqueued in
+this storage.
+
+Overall schema
+--------------
+
+The interactions of SMS Daemon and related components can be seen on following
+picture.
+
+.. graphviz::
+
+ digraph smsdinteractions {
+ "gammu-smsd-inject" [shape=box];
+ "gammu-smsd" [shape=box];
+ "Run on receive" [shape=box, style=dotted];
+ "GSM modem" [shape=box, style=dashed];
+ "gammu-smsd-monitor" [shape=box];
+ "Service\nstorage" [shape=doublecircle];
+ "Kalkun" [shape=box, style=dotted];
+ "gammu-smsd" -> "GSM modem" [label="Outgoing"];
+ "GSM modem" -> "gammu-smsd" [label="Incoming"];
+ "gammu-smsd" -> "Service\nstorage" [label="Save"];
+ "Service\nstorage" -> "gammu-smsd" [label="Read"];
+ "gammu-smsd" -> "Run on receive" [label="Execute"];
+ "Service\nstorage" -> "Run on receive" [label="Read"];
+ "Kalkun" -> "Service\nstorage" [label="Inject"];
+ "Service\nstorage" -> "Kalkun" [label="Read"];
+ "gammu-smsd-inject" -> "Service\nstorage" [label="Inject"];
+ "gammu-smsd" -> "gammu-smsd-monitor" [label="Monitor"];
+ }
+
+SMSD operation
+--------------
+
+The SMSD operation consist of several steps.
+
+.. graphviz::
+
+ digraph smsloop {
+ start[shape="box", style=rounded, label="Startup"];
+ end[shape="box", style=rounded, label="Termination"];
+ connected[shape="diamond", style="", label="Phone connected?"];
+ connect[label="Connect to phone"];
+ security[label="Check for security code"];
+ receive[label="Receive messages"];
+ reset[label="Reset phone if needed"];
+ send[label="Send messages"];
+ status[label="Check phone status"];
+ sleep[label="Sleep"];
+ shutdown[shape="diamond", style="", label="Shutdown requested?"];
+
+ start -> connected;
+ connected -> connect [label="No"];
+ connected -> security [label="Yes"];
+ connect -> security;
+ security -> receive;
+ receive -> reset;
+ reset -> send;
+ send -> status;
+ status -> sleep;
+ sleep -> shutdown;
+
+ shutdown -> connected [label="No"];
+ shutdown -> end [label="Yes"];
+ }
+
+1. Process command line options.
+2. Configure backend service.
+3. Main loop is executed until it is signalled to be terminated.
+ 1. Try to connect to phone if not connected.
+ 2. Check for security code if configured (configured by :config:option:`CheckSecurity`).
+ 3. Check for received messages (frequency configured by :config:option:`ReceiveFrequency`).
+ 4. Check for reset of the phone if configured (frequency configured by :config:option:`ResetFrequency`).
+ 5. Check for messages to send (frequency configured by :config:option:`CommTimeout`).
+ 6. Check phone status (frequency configured by :config:option:`StatusFrequency`).
+ 7. Sleep for defined time (:config:option:`LoopSleep`).
+4. Backend service is freed.
diff --git a/docs/manual/smsd/pgsql.rst b/docs/manual/smsd/pgsql.rst
new file mode 100644
index 0000000..eb55b62
--- /dev/null
+++ b/docs/manual/smsd/pgsql.rst
@@ -0,0 +1,58 @@
+.. _gammu-smsd-pgsql:
+
+PostgreSQL Backend
+==================
+
+Description
+-----------
+
+PGSQL backend stores all data in a `PostgreSQL`_ database server, which
+parameters are defined by configuration (see :ref:`gammu-smsdrc` for description of
+configuration options).
+
+For tables description see :ref:`gammu-smsd-tables`.
+
+This backend is based on :ref:`gammu-smsd-sql`.
+
+.. _PostgreSQL: https://www.postgresql.org/
+
+Configuration
+-------------
+
+Before running :ref:`gammu-smsd` you need to create necessary tables in the
+database, which is described below.
+
+The configuration file then can look like:
+
+.. code-block:: ini
+
+ [smsd]
+ service = sql
+ driver = native_pgsql
+ host = localhost
+
+.. seealso:: :ref:`gammu-smsdrc`
+
+.. _pgsql-create:
+
+Creating tables for PostgreSQL
+------------------------------
+
+SQL script for creating tables in PostgreSQL database:
+
+.. literalinclude:: ../../sql/pgsql.sql
+ :language: sql
+
+.. note::
+
+ You can find the script in :file:`docs/sql/pgsql.sql` as well.
+
+Upgrading tables
+----------------
+
+The easiest way to upgrade database structure is to backup old one and start
+with creating new one based on example above.
+
+For upgrading existing database, you can use changes described in
+:ref:`smsd-tables-history` and then manually update ``Version`` field in
+``gammu`` table.
diff --git a/docs/manual/smsd/run.rst b/docs/manual/smsd/run.rst
new file mode 100644
index 0000000..7fcd913
--- /dev/null
+++ b/docs/manual/smsd/run.rst
@@ -0,0 +1,168 @@
+.. _gammu-smsd-run:
+
+RunOnReceive Directive
+======================
+
+Description
+-----------
+
+Gammu SMSD can be configured by :config:option:`RunOnReceive` directive (see
+:ref:`gammu-smsdrc` for details) to run defined program after receiving
+every message. It can receive single message or more messages, which are parts
+of one multipart message.
+
+This parameter is executed through shell, so you might need to escape some
+special characters and you can include any number of parameters. Additionally
+parameters with identifiers of received messages are appended to the command
+line. The identifiers depend on used service backend, typically it is ID of
+inserted row for database backends or file name for file based backends.
+
+Gammu SMSD waits for the script to terminate. If you make some time consuming
+there, it will make SMSD not receive new messages. However to limit breakage
+from this situation, the waiting time is limited to two minutes. After this
+time SMSD will continue in normal operation and might execute your script
+again.
+
+.. note::
+
+ All input and output file descriptors are closed when this program is
+ invoked, so you have to ensure to open files on your own.
+
+Environment
+-----------
+
+.. versionadded:: 1.28.0
+
+Program is executed with environment which contains lot of information about
+the message. You can use it together with NULL service (see
+:ref:`gammu-smsd-null`) to implement completely own processing of messages.
+
+Global variables
+++++++++++++++++
+
+.. envvar:: SMS_MESSAGES
+
+ Number of physical messages received.
+
+.. envvar:: DECODED_PARTS
+
+ Number of decoded message parts.
+
+.. envvar:: PHONE_ID
+
+ .. versionadded:: 1.38.2
+
+ Value of :config:option:`PhoneID`. Useful when running multiple instances
+ (see :ref:`smsd-multi`).
+
+Per message variables
++++++++++++++++++++++
+
+The variables further described as ``SMS_1_...`` are generated for each physical
+message, where 1 is replaced by current number of message.
+
+.. envvar:: SMS_1_CLASS
+
+ Class of message.
+
+.. envvar:: SMS_1_NUMBER
+
+ Sender number.
+
+.. envvar:: SMS_1_TEXT
+
+ Message text. Text is not available for 8-bit binary messages.
+
+.. envvar:: SMS_1_REFERENCE
+
+ .. versionadded:: 1.38.5
+
+ Message Reference. If delivery status received, this variable contains TPMR of original message
+
+Per part variables
+++++++++++++++++++
+
+The variables further described as ``DECODED_1_...`` are generated for each message
+part, where 1 is replaced by current number of part. Set are only those
+variables whose content is present in the message.
+
+.. envvar:: DECODED_1_TEXT
+
+ Decoded long message text.
+
+.. envvar:: DECODED_1_MMS_SENDER
+
+ Sender of MMS indication message.
+
+.. envvar:: DECODED_1_MMS_TITLE
+
+ title of MMS indication message.
+
+.. envvar:: DECODED_1_MMS_ADDRESS
+
+ Address (URL) of MMS from MMS indication message.
+
+.. envvar:: DECODED_1_MMS_SIZE
+
+ Size of MMS as specified in MMS indication message.
+
+
+Examples
+--------
+
+Activating RunOnReceive
++++++++++++++++++++++++
+
+To activate this feature you need to set :config:option:`RunOnReceive` in
+the :ref:`gammu-smsdrc`.
+
+.. code-block:: ini
+
+ [smsd]
+ RunOnReceive = /path/to/script.sh
+
+Processing messages from the files backend
+++++++++++++++++++++++++++++++++++++++++++
+
+Following script (if used as :config:option:`RunOnReceive` handler) passes
+message data to other program. This works only with the :ref:`gammu-smsd-files`.
+
+.. literalinclude:: ../../../contrib/smsd-scripts/receive-files
+ :language: sh
+
+Invoking commands based on message text
++++++++++++++++++++++++++++++++++++++++
+
+Following script (if used as :config:option:`RunOnReceive` handler) executes
+given programs based on message text.
+
+.. literalinclude:: ../../../contrib/smsd-scripts/sms-commands
+ :language: sh
+
+Passing message text to program
++++++++++++++++++++++++++++++++
+
+Following script (if used as :config:option:`RunOnReceive` handler) passes
+message text and sender to external program.
+
+.. literalinclude:: ../../../contrib/smsd-scripts/receive-exec
+ :language: sh
+
+Passing MMS indication parameters to external program
++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+Following script (if used as :config:option:`RunOnReceive` handler) will write
+information about each received MMS indication to the log file. Just replace
+echo command with your own program to do custom processing.
+
+.. literalinclude:: ../../../contrib/smsd-scripts/receive-mms
+ :language: sh
+
+Processing message text in Python
++++++++++++++++++++++++++++++++++
+
+Following script (if used as :config:option:`RunOnReceive` handler) written
+in Python will concatenate all text from received message:
+
+.. literalinclude:: ../../../contrib/smsd-scripts/receive-python
+ :language: python
diff --git a/docs/manual/smsd/smsd-interactions.dia b/docs/manual/smsd/smsd-interactions.dia
new file mode 100644
index 0000000..87f2ef8
--- /dev/null
+++ b/docs/manual/smsd/smsd-interactions.dia
@@ -0,0 +1,949 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dia:diagram xmlns:dia="http://www.lysator.liu.se/~alla/dia/">
+ <dia:diagramdata>
+ <dia:attribute name="background">
+ <dia:color val="#ffffff"/>
+ </dia:attribute>
+ <dia:attribute name="pagebreak">
+ <dia:color val="#000099"/>
+ </dia:attribute>
+ <dia:attribute name="paper">
+ <dia:composite type="paper">
+ <dia:attribute name="name">
+ <dia:string>#A4#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="tmargin">
+ <dia:real val="2.8222000598907471"/>
+ </dia:attribute>
+ <dia:attribute name="bmargin">
+ <dia:real val="2.8222000598907471"/>
+ </dia:attribute>
+ <dia:attribute name="lmargin">
+ <dia:real val="2.8222000598907471"/>
+ </dia:attribute>
+ <dia:attribute name="rmargin">
+ <dia:real val="2.8222000598907471"/>
+ </dia:attribute>
+ <dia:attribute name="is_portrait">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="scaling">
+ <dia:real val="1"/>
+ </dia:attribute>
+ <dia:attribute name="fitto">
+ <dia:boolean val="false"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="grid">
+ <dia:composite type="grid">
+ <dia:attribute name="width_x">
+ <dia:real val="1"/>
+ </dia:attribute>
+ <dia:attribute name="width_y">
+ <dia:real val="1"/>
+ </dia:attribute>
+ <dia:attribute name="visible_x">
+ <dia:int val="1"/>
+ </dia:attribute>
+ <dia:attribute name="visible_y">
+ <dia:int val="1"/>
+ </dia:attribute>
+ <dia:composite type="color"/>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#d8e5e5"/>
+ </dia:attribute>
+ <dia:attribute name="guides">
+ <dia:composite type="guides">
+ <dia:attribute name="hguides"/>
+ <dia:attribute name="vguides"/>
+ </dia:composite>
+ </dia:attribute>
+ </dia:diagramdata>
+ <dia:layer name="Pozadí" visible="true" active="true">
+ <dia:object type="Sybase - Stable Queue" version="1" id="O0">
+ <dia:attribute name="obj_pos">
+ <dia:point val="20,15"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="19.95,14.95;25.0955,20.8179"/>
+ </dia:attribute>
+ <dia:attribute name="meta">
+ <dia:composite type="dict"/>
+ </dia:attribute>
+ <dia:attribute name="elem_corner">
+ <dia:point val="20,15"/>
+ </dia:attribute>
+ <dia:attribute name="elem_width">
+ <dia:real val="5.045454545454545"/>
+ </dia:attribute>
+ <dia:attribute name="elem_height">
+ <dia:real val="3.9642857142857149"/>
+ </dia:attribute>
+ <dia:attribute name="line_width">
+ <dia:real val="0.10000000000000001"/>
+ </dia:attribute>
+ <dia:attribute name="line_colour">
+ <dia:color val="#000000"/>
+ </dia:attribute>
+ <dia:attribute name="fill_colour">
+ <dia:color val="#ffffff"/>
+ </dia:attribute>
+ <dia:attribute name="show_background">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="line_style">
+ <dia:enum val="0"/>
+ <dia:real val="1"/>
+ </dia:attribute>
+ <dia:attribute name="padding">
+ <dia:real val="0.10000000000000001"/>
+ </dia:attribute>
+ <dia:attribute name="text">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>#Service storage
+(eg. database)#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="0.80000000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="22.5227,19.7445"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="1"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="flip_horizontal">
+ <dia:boolean val="false"/>
+ </dia:attribute>
+ <dia:attribute name="flip_vertical">
+ <dia:boolean val="false"/>
+ </dia:attribute>
+ <dia:attribute name="subscale">
+ <dia:real val="1"/>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Flowchart - Box" version="0" id="O1">
+ <dia:attribute name="obj_pos">
+ <dia:point val="33,7"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="32.95,6.95;41.05,11.05"/>
+ </dia:attribute>
+ <dia:attribute name="elem_corner">
+ <dia:point val="33,7"/>
+ </dia:attribute>
+ <dia:attribute name="elem_width">
+ <dia:real val="8"/>
+ </dia:attribute>
+ <dia:attribute name="elem_height">
+ <dia:real val="4"/>
+ </dia:attribute>
+ <dia:attribute name="show_background">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="padding">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:attribute name="text">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>#gammu-smsd-inject#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="0.80000000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="37,9.18"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="1"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Flowchart - Box" version="0" id="O2">
+ <dia:attribute name="obj_pos">
+ <dia:point val="4,15"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="3.95,14.95;12.05,19.05"/>
+ </dia:attribute>
+ <dia:attribute name="elem_corner">
+ <dia:point val="4,15"/>
+ </dia:attribute>
+ <dia:attribute name="elem_width">
+ <dia:real val="8"/>
+ </dia:attribute>
+ <dia:attribute name="elem_height">
+ <dia:real val="4"/>
+ </dia:attribute>
+ <dia:attribute name="show_background">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="padding">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:attribute name="text">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>#gammu-smsd#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="0.80000000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="8,17.18"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="1"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Flowchart - Box" version="0" id="O3">
+ <dia:attribute name="obj_pos">
+ <dia:point val="4,7"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="3.95,6.95;12.05,11.05"/>
+ </dia:attribute>
+ <dia:attribute name="elem_corner">
+ <dia:point val="4,7"/>
+ </dia:attribute>
+ <dia:attribute name="elem_width">
+ <dia:real val="8"/>
+ </dia:attribute>
+ <dia:attribute name="elem_height">
+ <dia:real val="4"/>
+ </dia:attribute>
+ <dia:attribute name="show_background">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="padding">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:attribute name="text">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>#gammu-smsd-monitor#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="0.80000000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="8,9.18"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="1"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Flowchart - Box" version="0" id="O4">
+ <dia:attribute name="obj_pos">
+ <dia:point val="33,15"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="32.95,14.95;41.05,19.05"/>
+ </dia:attribute>
+ <dia:attribute name="elem_corner">
+ <dia:point val="33,15"/>
+ </dia:attribute>
+ <dia:attribute name="elem_width">
+ <dia:real val="8"/>
+ </dia:attribute>
+ <dia:attribute name="elem_height">
+ <dia:real val="4"/>
+ </dia:attribute>
+ <dia:attribute name="border_width">
+ <dia:real val="0.10000000149011612"/>
+ </dia:attribute>
+ <dia:attribute name="show_background">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="line_style">
+ <dia:enum val="4"/>
+ </dia:attribute>
+ <dia:attribute name="padding">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:attribute name="text">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>#Kalkun
+web frontend#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="0.80000000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="37,16.78"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="1"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Standard - Line" version="0" id="O5">
+ <dia:attribute name="obj_pos">
+ <dia:point val="8,11"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="7.6382,10.95;8.3618,15.05"/>
+ </dia:attribute>
+ <dia:attribute name="conn_endpoints">
+ <dia:point val="8,11"/>
+ <dia:point val="8,15"/>
+ </dia:attribute>
+ <dia:attribute name="numcp">
+ <dia:int val="1"/>
+ </dia:attribute>
+ <dia:attribute name="start_arrow">
+ <dia:enum val="22"/>
+ </dia:attribute>
+ <dia:attribute name="start_arrow_length">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:attribute name="start_arrow_width">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:connections>
+ <dia:connection handle="0" to="O3" connection="13"/>
+ <dia:connection handle="1" to="O2" connection="2"/>
+ </dia:connections>
+ </dia:object>
+ <dia:object type="Standard - Line" version="0" id="O6">
+ <dia:attribute name="obj_pos">
+ <dia:point val="33,18"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="24.95,17.6382;33.05,18.3618"/>
+ </dia:attribute>
+ <dia:attribute name="conn_endpoints">
+ <dia:point val="33,18"/>
+ <dia:point val="25,18"/>
+ </dia:attribute>
+ <dia:attribute name="numcp">
+ <dia:int val="1"/>
+ </dia:attribute>
+ <dia:attribute name="start_arrow">
+ <dia:enum val="22"/>
+ </dia:attribute>
+ <dia:attribute name="start_arrow_length">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:attribute name="start_arrow_width">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:connections>
+ <dia:connection handle="0" to="O4" connection="9"/>
+ </dia:connections>
+ </dia:object>
+ <dia:object type="Standard - Line" version="0" id="O7">
+ <dia:attribute name="obj_pos">
+ <dia:point val="12,16"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="11.95,15.6382;20.0637,16.3618"/>
+ </dia:attribute>
+ <dia:attribute name="conn_endpoints">
+ <dia:point val="12,16"/>
+ <dia:point val="19.9519,16"/>
+ </dia:attribute>
+ <dia:attribute name="numcp">
+ <dia:int val="1"/>
+ </dia:attribute>
+ <dia:attribute name="end_arrow">
+ <dia:enum val="22"/>
+ </dia:attribute>
+ <dia:attribute name="end_arrow_length">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:attribute name="end_arrow_width">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Standard - Line" version="0" id="O8">
+ <dia:attribute name="obj_pos">
+ <dia:point val="33,9"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="23.907,8.93066;33.0693,15.0693"/>
+ </dia:attribute>
+ <dia:attribute name="conn_endpoints">
+ <dia:point val="33,9"/>
+ <dia:point val="24,15"/>
+ </dia:attribute>
+ <dia:attribute name="numcp">
+ <dia:int val="1"/>
+ </dia:attribute>
+ <dia:attribute name="end_arrow">
+ <dia:enum val="22"/>
+ </dia:attribute>
+ <dia:attribute name="end_arrow_length">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:attribute name="end_arrow_width">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:connections>
+ <dia:connection handle="0" to="O1" connection="7"/>
+ </dia:connections>
+ </dia:object>
+ <dia:object type="Standard - Text" version="1" id="O9">
+ <dia:attribute name="obj_pos">
+ <dia:point val="25,15"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="25,14.42;25,15.1375"/>
+ </dia:attribute>
+ <dia:attribute name="text">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>##</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="0.80000000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="25,15"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="0"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="valign">
+ <dia:enum val="3"/>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Standard - Text" version="1" id="O10">
+ <dia:attribute name="obj_pos">
+ <dia:point val="27,11"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="24.6887,10.2412;29.3113,11.7587"/>
+ </dia:attribute>
+ <dia:attribute name="text">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>#Inject messages
+to send#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="0.80000000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="27,10.8212"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="1"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="valign">
+ <dia:enum val="2"/>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Standard - Text" version="1" id="O11">
+ <dia:attribute name="obj_pos">
+ <dia:point val="15.976,16"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="13.9485,15.2412;18.0035,16.7587"/>
+ </dia:attribute>
+ <dia:attribute name="text">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>#Save received
+messages#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="0.80000000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="15.976,15.8212"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="1"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="valign">
+ <dia:enum val="2"/>
+ </dia:attribute>
+ <dia:connections>
+ <dia:connection handle="0" to="O7" connection="0"/>
+ </dia:connections>
+ </dia:object>
+ <dia:object type="Standard - Text" version="1" id="O12">
+ <dia:attribute name="obj_pos">
+ <dia:point val="15.976,18"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="13.6648,17.2413;18.2873,18.7587"/>
+ </dia:attribute>
+ <dia:attribute name="text">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>#Read messages
+to send#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="0.80000000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="15.976,17.8212"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="1"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="valign">
+ <dia:enum val="2"/>
+ </dia:attribute>
+ <dia:connections>
+ <dia:connection handle="0" to="O16" connection="0"/>
+ </dia:connections>
+ </dia:object>
+ <dia:object type="Standard - Text" version="1" id="O13">
+ <dia:attribute name="obj_pos">
+ <dia:point val="9,13"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="8.1475,12.2412;9.8525,13.7587"/>
+ </dia:attribute>
+ <dia:attribute name="text">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>#Read
+status#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="0.80000000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="9,12.8212"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="1"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="valign">
+ <dia:enum val="2"/>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Standard - Text" version="1" id="O14">
+ <dia:attribute name="obj_pos">
+ <dia:point val="29,16"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="26.6887,15.2412;31.3113,16.7587"/>
+ </dia:attribute>
+ <dia:attribute name="text">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>#Inject messages
+to send#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="0.80000000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="29,15.8212"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="1"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="valign">
+ <dia:enum val="2"/>
+ </dia:attribute>
+ <dia:connections>
+ <dia:connection handle="0" to="O17" connection="0"/>
+ </dia:connections>
+ </dia:object>
+ <dia:object type="Standard - Text" version="1" id="O15">
+ <dia:attribute name="obj_pos">
+ <dia:point val="29,18"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="26.9387,17.2413;31.0613,18.7587"/>
+ </dia:attribute>
+ <dia:attribute name="text">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>#Read received
+messages#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="0.80000000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="29,17.8212"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="1"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="valign">
+ <dia:enum val="2"/>
+ </dia:attribute>
+ <dia:connections>
+ <dia:connection handle="0" to="O6" connection="0"/>
+ </dia:connections>
+ </dia:object>
+ <dia:object type="Standard - Line" version="0" id="O16">
+ <dia:attribute name="obj_pos">
+ <dia:point val="12,18"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="11.95,17.6382;20.0019,18.3618"/>
+ </dia:attribute>
+ <dia:attribute name="conn_endpoints">
+ <dia:point val="12,18"/>
+ <dia:point val="19.9519,18"/>
+ </dia:attribute>
+ <dia:attribute name="numcp">
+ <dia:int val="1"/>
+ </dia:attribute>
+ <dia:attribute name="start_arrow">
+ <dia:enum val="22"/>
+ </dia:attribute>
+ <dia:attribute name="start_arrow_length">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:attribute name="start_arrow_width">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:connections>
+ <dia:connection handle="0" to="O2" connection="10"/>
+ </dia:connections>
+ </dia:object>
+ <dia:object type="Standard - Line" version="0" id="O17">
+ <dia:attribute name="obj_pos">
+ <dia:point val="33,16"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="24.8882,15.6382;33.05,16.3618"/>
+ </dia:attribute>
+ <dia:attribute name="conn_endpoints">
+ <dia:point val="33,16"/>
+ <dia:point val="25,16"/>
+ </dia:attribute>
+ <dia:attribute name="numcp">
+ <dia:int val="1"/>
+ </dia:attribute>
+ <dia:attribute name="end_arrow">
+ <dia:enum val="22"/>
+ </dia:attribute>
+ <dia:attribute name="end_arrow_length">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:attribute name="end_arrow_width">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:connections>
+ <dia:connection handle="0" to="O4" connection="5"/>
+ </dia:connections>
+ </dia:object>
+ <dia:object type="Flowchart - Box" version="0" id="O18">
+ <dia:attribute name="obj_pos">
+ <dia:point val="4,23"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="3.95,22.95;12.05,27.05"/>
+ </dia:attribute>
+ <dia:attribute name="elem_corner">
+ <dia:point val="4,23"/>
+ </dia:attribute>
+ <dia:attribute name="elem_width">
+ <dia:real val="8"/>
+ </dia:attribute>
+ <dia:attribute name="elem_height">
+ <dia:real val="4"/>
+ </dia:attribute>
+ <dia:attribute name="border_width">
+ <dia:real val="0.10000000149011612"/>
+ </dia:attribute>
+ <dia:attribute name="show_background">
+ <dia:boolean val="true"/>
+ </dia:attribute>
+ <dia:attribute name="line_style">
+ <dia:enum val="1"/>
+ </dia:attribute>
+ <dia:attribute name="dashlength">
+ <dia:real val="0.29999999999999999"/>
+ </dia:attribute>
+ <dia:attribute name="padding">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:attribute name="text">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>#GSM
+modem#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="0.80000000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="8,24.78"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="1"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Standard - Line" version="0" id="O19">
+ <dia:attribute name="obj_pos">
+ <dia:point val="6,19"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="5.6382,18.95;6.3618,23.1118"/>
+ </dia:attribute>
+ <dia:attribute name="conn_endpoints">
+ <dia:point val="6,19"/>
+ <dia:point val="6,23"/>
+ </dia:attribute>
+ <dia:attribute name="numcp">
+ <dia:int val="1"/>
+ </dia:attribute>
+ <dia:attribute name="end_arrow">
+ <dia:enum val="22"/>
+ </dia:attribute>
+ <dia:attribute name="end_arrow_length">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:attribute name="end_arrow_width">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:connections>
+ <dia:connection handle="0" to="O2" connection="12"/>
+ <dia:connection handle="1" to="O18" connection="1"/>
+ </dia:connections>
+ </dia:object>
+ <dia:object type="Standard - Line" version="0" id="O20">
+ <dia:attribute name="obj_pos">
+ <dia:point val="10,23"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="9.6382,18.8882;10.3618,23.05"/>
+ </dia:attribute>
+ <dia:attribute name="conn_endpoints">
+ <dia:point val="10,23"/>
+ <dia:point val="10,19"/>
+ </dia:attribute>
+ <dia:attribute name="numcp">
+ <dia:int val="1"/>
+ </dia:attribute>
+ <dia:attribute name="end_arrow">
+ <dia:enum val="22"/>
+ </dia:attribute>
+ <dia:attribute name="end_arrow_length">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:attribute name="end_arrow_width">
+ <dia:real val="0.5"/>
+ </dia:attribute>
+ <dia:connections>
+ <dia:connection handle="0" to="O18" connection="3"/>
+ <dia:connection handle="1" to="O2" connection="14"/>
+ </dia:connections>
+ </dia:object>
+ <dia:object type="Standard - Text" version="1" id="O21">
+ <dia:attribute name="obj_pos">
+ <dia:point val="12,21"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="10.5412,20.2143;13.4767,21.7857"/>
+ </dia:attribute>
+ <dia:attribute name="text">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>#Incoming
+messages#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="0.80000000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="12,20.8123"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="1"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="valign">
+ <dia:enum val="2"/>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Standard - Text" version="1" id="O22">
+ <dia:attribute name="obj_pos">
+ <dia:point val="4,21"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="2.54125,20.2143;5.47669,21.7857"/>
+ </dia:attribute>
+ <dia:attribute name="text">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>#Outgoing
+messages#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="0.80000000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="4,20.8123"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="1"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="valign">
+ <dia:enum val="2"/>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Standard - Text" version="1" id="O23">
+ <dia:attribute name="obj_pos">
+ <dia:point val="37,17"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="37,16.42;37,17.1375"/>
+ </dia:attribute>
+ <dia:attribute name="text">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>##</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="0.80000000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="37,17"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="0"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="valign">
+ <dia:enum val="3"/>
+ </dia:attribute>
+ <dia:connections>
+ <dia:connection handle="0" to="O4" connection="16"/>
+ </dia:connections>
+ </dia:object>
+ </dia:layer>
+</dia:diagram>
diff --git a/docs/manual/smsd/smsd-interactions.png b/docs/manual/smsd/smsd-interactions.png
new file mode 100644
index 0000000..250af4a
--- /dev/null
+++ b/docs/manual/smsd/smsd-interactions.png
Binary files differ
diff --git a/docs/manual/smsd/smsd.rst b/docs/manual/smsd/smsd.rst
new file mode 100644
index 0000000..6314add
--- /dev/null
+++ b/docs/manual/smsd/smsd.rst
@@ -0,0 +1,271 @@
+.. _gammu-smsd:
+
+gammu-smsd
+==========
+
+.. program:: gammu-smsd
+
+Synopsis
+--------
+
+.. code-block:: text
+
+ gammu-smsd [OPTION]...
+
+
+Description
+-----------
+
+This manual page documents briefly the :program:`gammu-smsd` command.
+
+:program:`gammu-smsd` is a program that periodically scans GSM modem for
+received messages, stores them in defined storage and also sends messages
+enqueued in this storage.
+
+The daemon can reload configuration file after sending hangup signal (SIGHUP)
+and properly terminates itself on SIGINT and SIGTERM.
+
+Program accepts following options (please note that long options might be not
+accepted on some platforms):
+
+.. option:: -h, --help
+
+ Shows help.
+
+.. option:: -v, --version
+
+ Shows version information and compiled in features.
+
+.. option:: -c, --config=file
+
+ Configuration file to use, default is /etc/gammu-smsdrc, on Windows there
+ is no default and configuration file path has to be always specified.
+
+ If you run SMSD as a system daemon (or service), it is recommended to use
+ absolute path to configuration file as startup directory might be
+ different than you expect.
+
+ See :ref:`gammu-smsdrc` for configuration file documentation.
+
+.. option:: -p, --pid=file
+
+ Lock file for storing pid, empty for no locking. Not supported on Windows.
+
+.. option:: -U, --user=user
+
+ Drop daemon privileges to chosen user after starting.
+
+.. option:: -G, --group=group
+
+ Drop daemon privileges to chosen group after starting.
+
+.. option:: -d, --daemon
+
+ Daemonize program on startup. Not supported on Windows.
+
+.. option:: -i, --install-service
+
+ Installs SMSD as a Windows service.
+
+.. option:: -u, --uninstall-service
+
+ Uninstalls SMSD as a Windows service.
+
+.. option:: -s, --start-service
+
+ Starts SMSD Windows service.
+
+.. option:: -k, --stop-service
+
+ Stops SMSD Windows service.
+
+.. option:: -f, --max-failures=count
+
+ Terminate after defined number of failures. Use 0 to not terminate (this is default).
+
+.. option:: -X, --suicide=seconds
+
+ Kills itself after number of seconds.
+
+.. option:: -S, --run-service
+
+ Runs pogram as SMSD Windows service. This should not be used manually, but
+ only Windows Service manager should use this command.
+
+.. option:: -n, --service-name=name
+
+ Defines name of a Windows service. Each service requires an unique name,
+ so if you want to run several SMSD instances, you have to name each
+ service differently. Default is "GammuSMSD".
+
+.. option:: -l, --use-log
+
+ Use logging as configured in config file (default).
+
+.. option:: -L, --no-use-log
+
+ Do not use logging as configured in config file.
+
+.. option:: -e, --install-event-log
+
+ Installs Windows EventLog description to registry.
+
+ .. versionadded:: 1.31.90
+
+.. option:: -E, --uninstall-event-log
+
+ Uninstalls Windows EventLog description to registry.
+
+ .. versionadded:: 1.31.90
+
+.. _gammu-smsd-signals:
+
+Signals
+-------
+
+SMSD can be controlled using following POSIX signals (if your platform supports this):
+
+SIGHUP
+ Reload configuration and reconnect to phone.
+SIGINT, SIGTERM
+ Gracefully shutdown the daemon.
+SIGALRM
+ Used internally for :option:`gammu-smsd -X`
+SIGUSR1
+ Suspends SMSD operation, closing connection to phone and database.
+SIGUSR2
+ Resumes SMSD operation (after previous suspend).
+
+.. versionchanged:: 1.22.91
+ Added support for SIGHUP.
+.. versionchanged:: 1.22.95
+ Added support for SIGALRM.
+.. versionchanged:: 1.31.90
+ Added support for SIGUSR1 and SIGUSR2.
+
+Examples
+--------
+
+Linux/Unix Examples
++++++++++++++++++++
+
+Start SMSD as a daemon on Linux:
+
+.. code-block:: sh
+
+ gammu-smsd --config /etc/gammu-smsdrc --pid /var/run/gammu-smsd.pid --daemon
+
+Start SMSD as a daemon on Linux with reduced privileges:
+
+.. code-block:: sh
+
+ gammu-smsd --config /etc/gammu-smsdrc --pid /var/run/gammu-smsd.pid --daemon --user gammu --group gammu
+
+SMSD as a system wide daemon
+++++++++++++++++++++++++++++
+
+To use SMSD as a daemon, you might want to use init script which is shipped
+with Gammu in contrib/init directory. It is not installed by default, either
+install it manually or check INSTALL file for instructions.
+
+Under Windows 7 you might need to disable UAC (user account control) before
+you will be able to install SMSD service.
+
+Windows Service Examples
+++++++++++++++++++++++++
+
+Install Gammu SMSD Windows service:
+
+.. code-block:: sh
+
+ gammu-smsd.exe -c c:\Gammu\smsdrc -i
+
+Install two instances of SMSD Windows service:
+
+.. code-block:: sh
+
+ gammu-smsd.exe -c c:\Gammu\smsdrc-1 -n Gammu-first-phone -i
+
+ gammu-smsd.exe -c c:\Gammu\smsdrc-2 -n Gammu-second-phone -i
+
+To uninstall a Windows service:
+
+.. code-block:: sh
+
+ gammu-smsd.exe -u
+
+Troubleshooting Windows Service
++++++++++++++++++++++++++++++++
+
+If Gammu fails to start as a Windows service (you will usually get "Error
+1053: The service did not respond to the start or control request in a timely
+fashion"), first check your SMSD logs. If they do not contain any useful hint,
+try starting SMSD manually with exactly same parameters as you installed the
+service (without -i).
+
+For example the command line can look like:
+
+.. code-block:: sh
+
+ gammu-smsd.exe -c smsdrc
+
+You now should be able to get errors from SMSD even if it fails to start as a
+service.
+
+.. _gammu-smsd-suspend:
+
+Invoking Gammu and suspending SMSD
+++++++++++++++++++++++++++++++++++
+
+As you can not run Gammu and Gammu SMSD at same time on signle device, you can
+workaround this limitation by suspending SMSD temporarily using `SIGUSR1` and
+`SIGUSR2` signals (see also :ref:`gammu-smsd-signals`):
+
+.. code-block:: sh
+
+ SMSD_PID=`pidof gammu-smsd`
+ if [ -z "$SMSD_PID" ] ; then
+ echo "Failed to figure out SMSD PID!"
+ else
+ kill -SIGUSR1 $SMSD_PID
+ gammu identify
+ kill -SIGUSR2 $SMSD_PID
+ fi
+
+Or even create a `gammu-safe` script:
+
+.. code-block:: sh
+ #!/bin/bash
+ SMSD_PID=`pidof gammu-smsd`
+ if [ -z "$SMSD_PID" ] ; then
+ gammu $@
+ else
+ tty=$(lsof |grep -E "gammu-sms\s+$SMSD_PID\s+.*/dev/tty*"|awk {'print $NF'})
+ kill -SIGUSR1 $SMSD_PID
+ while test "$(fuser $ttyfuser $tty 2> /dev/null|xargs)" = $SMSD_PID
+ do
+ sleep 1
+ done
+ sleep 1
+ gammu $@
+ kill -SIGUSR2 $SMSD_PID
+ while test "$(fuser $ttyfuser $tty 2> /dev/null|xargs)" != $SMSD_PID
+ do
+ sleep 1
+ done
+ sleep 1
+ fi
+
+
+Known Limitations
+-----------------
+
+You can not use same phone by more programs in same time. However in case you
+did not enable locking in :config:section:`[gammu]` section, it might be able
+to start the communication with phone from more programs. In this case neither
+of the programs will probably work, see :ref:`gammu-smsd-suspend` for
+workaround.
+
+There is no way to detect that SMS message is reply to another by looking at
+message headers. The only way to achieve this is to add some token to the
+message and let the user include it in the message on reply.
diff --git a/docs/manual/smsd/sql.rst b/docs/manual/smsd/sql.rst
new file mode 100644
index 0000000..fd894e0
--- /dev/null
+++ b/docs/manual/smsd/sql.rst
@@ -0,0 +1,469 @@
+.. _gammu-smsd-sql:
+
+SQL Service
+===========
+
+Description
+-----------
+
+SQL service stores all its data in database. It can use one of these SQL backends
+(configuration option :config:option:`Driver` in smsd section):
+
+* ``native_mysql`` for :ref:`gammu-smsd-mysql`
+* ``native_pgsql`` for :ref:`gammu-smsd-pgsql`
+* ``odbc`` for :ref:`gammu-smsd-odbc`
+* drivers supported by DBI for :ref:`gammu-smsd-dbi`, which include:
+ * ``sqlite3`` - for SQLite 3
+ * ``mysql`` - for MySQL
+ * ``pgsql`` - for PostgeSQL
+ * ``freetds`` - for MS SQL Server or Sybase
+
+SQL connection parameters
+-------------------------
+
+Common for all backends:
+
+* :config:option:`User` - user connecting to database
+* :config:option:`Password` - password for connecting to database
+* :config:option:`Host` - database host or data source name
+* :config:option:`Database` - database name
+* :config:option:`Driver` - ``native_mysql``, ``native_pgsql``, ``odbc`` or DBI one
+* :config:option:`SQL` - SQL dialect to use
+
+Specific for DBI:
+
+* :config:option:`DriversPath` - path to DBI drivers
+* :config:option:`DBDir` - sqlite/sqlite3 directory with database
+
+.. seealso:: The variables are fully described in :ref:`gammurc` documentation.
+
+.. _Configurable tables:
+
+Tables
+------
+
+.. versionadded:: 1.37.1
+
+You can customize name of all tables in the :config:section:`[tables]`. The SQL
+queries will reflect this, so it's enough to change table name in this section.
+
+.. config:option:: gammu
+
+ Name of the :ref:`gammu-table` table.
+
+.. config:option:: inbox
+
+ Name of the :ref:`inbox` table.
+
+.. config:option:: sentitems
+
+ Name of the :ref:`sentitems` table.
+
+.. config:option:: outbox
+
+ Name of the :ref:`outbox` table.
+
+.. config:option:: outbox_multipart
+
+ Name of the :ref:`outbox_multipart` table.
+
+.. config:option:: phones
+
+ Name of the :ref:`phones` table.
+
+You can change any table name using these:
+
+.. code-block:: ini
+
+ [tables]
+ inbox = special_inbox
+
+.. _SQL Queries:
+
+SQL Queries
+-----------
+
+Almost all queries are configurable. You can edit them in
+:config:section:`[sql]` section. There are several variables used in SQL
+queries. We can separate them into three groups:
+
+* phone specific, which can be used in every query, see :ref:`Phone Specific Parameters`
+* SMS specific, which can be used in queries which works with SMS messages, see :ref:`SMS Specific Parameters`
+* query specific, which are numeric and are specific only for given query (or set of queries), see :ref:`Configurable queries`
+
+.. _Phone Specific Parameters:
+
+Phone Specific Parameters
++++++++++++++++++++++++++
+
+``%I``
+ IMEI of phone
+``%S``
+ SIM IMSI
+``%P``
+ PHONE ID (hostname)
+``%N``
+ client name (eg. Gammu 1.12.3)
+``%O``
+ network code
+``%M``
+ network name
+
+
+.. _SMS Specific Parameters:
+
+SMS Specific Parameters
++++++++++++++++++++++++
+
+``%R``
+ remote number [#f1]_
+``%C``
+ delivery datetime
+``%e``
+ delivery status on receiving or status error on sending
+``%t``
+ message reference
+``%d``
+ receiving datetime for received sms
+``%E``
+ encoded text of SMS
+``%c``
+ SMS coding (ie 8bit or UnicodeNoCompression)
+``%F``
+ sms centre number
+``%u``
+ UDH header
+``%x``
+ class
+``%T``
+ decoded SMS text
+``%A``
+ CreatorID of SMS (sending sms)
+``%V``
+ relative validity
+
+.. [#f1] Sender number for received messages (insert to inbox or delivery notifications), destination otherwise.
+
+.. _Configurable queries:
+
+Configurable queries
+--------------------
+
+All configurable queries can be set in :config:section:`[sql]` section. Sequence of rows in selects are mandatory.
+
+All default queries noted here are noted for MySQL. Actual time and time addition
+are selected for default queries during initialization.
+
+.. config:option:: delete_phone
+
+ Deletes phone from database.
+
+ Default value:
+
+ .. code-block:: sql
+
+ DELETE FROM phones WHERE IMEI = %I
+
+.. config:option:: insert_phone
+
+ Inserts phone to database.
+
+ Default value:
+
+ .. code-block:: sql
+
+ INSERT INTO phones (IMEI, ID, Send, Receive, InsertIntoDB, TimeOut, Client, Battery, Signal)
+ VALUES (%I, %P, %1, %2, NOW(), (NOW() + INTERVAL 10 SECOND) + 0, %N, -1, -1)
+
+ Query specific parameters:
+
+ ``%1``
+ enable send (yes or no) - configuration option Send
+ ``%2``
+ enable receive (yes or no) - configuration option Receive
+
+.. config:option:: save_inbox_sms_select
+
+ Select message for update delivery status.
+
+ Default value:
+
+ .. code-block:: sql
+
+ SELECT ID, Status, SendingDateTime, DeliveryDateTime, SMSCNumber FROM sentitems
+ WHERE DeliveryDateTime IS NULL AND SenderID = %P AND TPMR = %t AND DestinationNumber = %R
+
+.. config:option:: save_inbox_sms_update_delivered
+
+ Update message delivery status if message was delivered.
+
+ Default value:
+
+ .. code-block:: sql
+
+ UPDATE sentitems SET DeliveryDateTime = %C, Status = %1, StatusError = %e WHERE ID = %2 AND TPMR = %t
+
+ Query specific parameters:
+
+ ``%1``
+ delivery status returned by GSM network
+ ``%2``
+ ID of message
+
+.. config:option:: save_inbox_sms_update
+
+ Update message if there is an delivery error.
+
+ Default value:
+
+ .. code-block:: sql
+
+ UPDATE sentitems SET Status = %1, StatusError = %e WHERE ID = %2 AND TPMR = %t
+
+ Query specific parameters:
+
+ ``%1``
+ delivery status returned by GSM network
+ ``%2``
+ ID of message
+
+.. config:option:: save_inbox_sms_insert
+
+ Insert received message.
+
+ Default value:
+
+ .. code-block:: sql
+
+ INSERT INTO inbox (ReceivingDateTime, Text, SenderNumber, Coding, SMSCNumber, UDH,
+ Class, TextDecoded, RecipientID) VALUES (%d, %E, %R, %c, %F, %u, %x, %T, %P)
+
+.. config:option:: update_received
+
+ Update statistics after receiving message.
+
+ Default value:
+
+ .. code-block:: sql
+
+ UPDATE phones SET Received = Received + 1 WHERE IMEI = %I
+
+.. config:option:: refresh_send_status
+
+ Update messages in outbox.
+
+ Default value:
+
+ .. code-block:: sql
+
+ UPDATE outbox SET SendingTimeOut = (NOW() + INTERVAL 60 SECOND) + 0
+ WHERE ID = %1 AND (SendingTimeOut < NOW() OR SendingTimeOut IS NULL)
+
+ The default query calculates sending timeout based on :config:option:`LoopSleep`
+ value.
+
+ Query specific parameters:
+
+ ``%1``
+ ID of message
+
+.. config:option:: find_outbox_sms_id
+
+ Find sms messages for sending.
+
+ Default value:
+
+ .. code-block:: sql
+
+ SELECT ID, InsertIntoDB, SendingDateTime, SenderID FROM outbox
+ WHERE SendingDateTime < NOW() AND SendingTimeOut < NOW() AND
+ SendBefore >= CURTIME() AND SendAfter <= CURTIME() AND
+ ( SenderID is NULL OR SenderID = '' OR SenderID = %P ) ORDER BY InsertIntoDB ASC LIMIT %1
+
+ Query specific parameters:
+
+ ``%1``
+ limit of sms messages sended in one walk in loop
+
+.. config:option:: find_outbox_body
+
+ Select body of message.
+
+ Default value:
+
+ .. code-block:: sql
+
+ SELECT Text, Coding, UDH, Class, TextDecoded, ID, DestinationNumber, MultiPart,
+ RelativeValidity, DeliveryReport, CreatorID FROM outbox WHERE ID=%1
+
+ Query specific parameters:
+
+ ``%1``
+ ID of message
+
+.. config:option:: find_outbox_multipart
+
+ Select remaining parts of sms message.
+
+ Default value:
+
+ .. code-block:: sql
+
+ SELECT Text, Coding, UDH, Class, TextDecoded, ID, SequencePosition
+ FROM outbox_multipart WHERE ID=%1 AND SequencePosition=%2
+
+ Query specific parameters:
+
+ ``%1``
+ ID of message
+ ``%2``
+ Number of multipart message
+
+.. config:option:: delete_outbox
+
+ Remove messages from outbox after threir successful send.
+
+ Default value:
+
+ .. code-block:: sql
+
+ DELETE FROM outbox WHERE ID=%1
+
+ Query specific parameters:
+
+ ``%1``
+ ID of message
+
+.. config:option:: delete_outbox_multipart
+
+ Remove messages from outbox_multipart after threir successful send.
+
+ Default value:
+
+ .. code-block:: sql
+
+ DELETE FROM outbox_multipart WHERE ID=%1
+
+ Query specific parameters:
+
+ ``%1``
+ ID of message
+
+.. config:option:: create_outbox
+
+ Create message (insert to outbox).
+
+ Default value:
+
+ .. code-block:: sql
+
+ INSERT INTO outbox (CreatorID, SenderID, DeliveryReport, MultiPart,
+ InsertIntoDB, Text, DestinationNumber, RelativeValidity, Coding, UDH, Class,
+ TextDecoded) VALUES (%1, %P, %2, %3, NOW(), %E, %R, %V, %c, %u, %x, %T)
+
+ Query specific parameters:
+
+ ``%1``
+ creator of message
+ ``%2``
+ delivery status report - yes/default
+ ``%3``
+ multipart - FALSE/TRUE
+ ``%4``
+ Part (part number)
+ ``%5``
+ ID of message
+
+.. config:option:: create_outbox_multipart
+
+ Create message remaining parts.
+
+ Default value:
+
+ .. code-block:: sql
+
+ INSERT INTO outbox_multipart (SequencePosition, Text, Coding, UDH, Class,
+ TextDecoded, ID) VALUES (%4, %E, %c, %u, %x, %T, %5)
+
+ Query specific parameters:
+
+ ``%1``
+ creator of message
+ ``%2``
+ delivery status report - yes/default
+ ``%3``
+ multipart - FALSE/TRUE
+ ``%4``
+ Part (part number)
+ ``%5``
+ ID of message
+
+.. config:option:: add_sent_info
+
+ Insert to sentitems.
+
+ Default value:
+
+ .. code-block:: sql
+
+ INSERT INTO sentitems (CreatorID,ID,SequencePosition,Status,SendingDateTime,
+ SMSCNumber, TPMR, SenderID,Text,DestinationNumber,Coding,UDH,Class,TextDecoded,
+ InsertIntoDB,RelativeValidity)
+ VALUES (%A, %1, %2, %3, NOW(), %F, %4, %P, %E, %R, %c, %u, %x, %T, %5, %V)
+
+ Query specific parameters:
+
+ ``%1``
+ ID of sms message
+ ``%2``
+ part number (for multipart sms)
+ ``%3``
+ message state (SendingError, Error, SendingOK, SendingOKNoReport)
+ ``%4``
+ message reference (TPMR)
+ ``%5``
+ time when inserted in db
+
+.. config:option:: update_sent
+
+ Update sent statistics after sending message.
+
+ Default value:
+
+ .. code-block:: sql
+
+ UPDATE phones SET Sent= Sent + 1 WHERE IMEI = %I
+
+.. config:option:: refresh_phone_status
+
+ Update phone status (battery, signal).
+
+ Default value:
+
+ .. code-block:: sql
+
+ UPDATE phones SET TimeOut= (NOW() + INTERVAL 10 SECOND) + 0,
+ Battery = %1, Signal = %2 WHERE IMEI = %I
+
+ Query specific parameters:
+
+ ``%1``
+ battery percent
+ ``%2``
+ signal percent
+
+.. config:option:: update_retries
+
+ Update number of retries for outbox message.
+
+ .. code-block:: sql
+
+ UPDATE outbox SET SendngTimeOut = (NOW() + INTERVAL 600 SECOND) + 0,
+ Retries = %2 WHERE ID = %1
+
+ Query specific parameters:
+
+ ``%1``
+ message ID
+ ``%2``
+ number of retries
diff --git a/docs/manual/smsd/tables.rst b/docs/manual/smsd/tables.rst
new file mode 100644
index 0000000..8b06e79
--- /dev/null
+++ b/docs/manual/smsd/tables.rst
@@ -0,0 +1,625 @@
+.. _gammu-smsd-tables:
+
+SMSD Database Structure
+=======================
+
+The backends themselves are described in their sections, this document
+describes general database structure and required tables.
+
+More SMS daemons can share single database. If you do not specify PhoneID in
+their configuration, all are treated equally and you have no guarantee which
+one sends outgoing message. If you configure PhoneID and use it when inserting
+message to the ``outbox`` table (:ref:`gammu-smsd-inject` does this), each SMS
+daemon will have separate outbox queue. See also :ref:`smsd-multi`.
+
+Receiving of messages
+---------------------
+
+Received messages are stored in :ref:`inbox` table.
+
+Transmitting of messages
+------------------------
+
+Transmitted messages are read from table :ref:`outbox` and possible subsequent parts
+of the same message from :ref:`outbox_multipart`.
+
+Description of tables
+---------------------
+
+.. _gammu-table:
+
+gammu
++++++
+
+Table holding single field ``Version`` - version of a database schema. See
+:ref:`smsd-tables-history` for details what has changed.
+
+.. _inbox:
+
+inbox
++++++
+
+Table where received messages will be stored.
+
+Fields description:
+
+``UpdatedInDB`` (timestamp)
+ when somebody (daemon, user, etc.) updated it
+
+``ReceivingDateTime`` (timestamp)
+ when SMS was received
+
+``Text`` (text)
+ encoded SMS text (for all SMS)
+
+``SenderNumber`` (varchar(20))
+ decoded SMS sender number
+
+``Coding`` (enum('Default_No_Compression', 'Unicode_No_Compression', '8bit', 'Default_Compression', 'Unicode_Compression'))
+ SMS text coding
+
+``UDH`` (text)
+ encoded User Data Header text
+
+``SMSCNumber`` (varchar(20))
+ decoded SMSC number
+
+``Class`` (integer)
+ SMS class or \-1 (0 is flash SMS, 1 is normal one, 127 is USSD)
+
+``TextDecoded`` (varchar(160))
+ decoded SMS text (for Default Alphabet/Unicode SMS)
+
+``ID`` (integer unsigned)
+ SMS identificator (for using with external applications)
+
+``RecipientID`` (text)
+ which Gammu daemon has added it
+
+``Processed`` (enum('false', 'true'))
+ you can use for marking, whether SMS was processed or not
+
+``Status`` (integer)
+ Status of incoming message. Currently only used for
+ ``Class`` 127 (USSD) messages with following meaning:
+
+ ``1``
+ Unknown status.
+ ``2``
+ No action is needed, maybe network initiated USSD.
+ ``3``
+ Reply is expected.
+ ``4``
+ USSD dialog terminated.
+ ``5``
+ Another client replied.
+ ``6``
+ Operation not supported.
+ ``7``
+ Network timeout.
+
+ .. versionadded:: 1.38.5
+
+.. _outbox:
+
+outbox
+++++++
+
+Messages enqueued for sending should be placed in this table. If message
+is multipart, subsequent parts are stored in table :ref:`outbox_multipart`.
+
+Fields description:
+
+``UpdatedInDB`` (timestamp)
+ when somebody (daemon, user, etc.) updated it
+
+``InsertIntoDB`` (timestamp)
+ when message was inserted into database
+
+``SendingDateTime`` (timestamp)
+ set it to some value, when want to force sending after some planned time
+
+``SendBefore`` (time)
+ Send message before specified time, can be used to limit messages from
+ being sent in night. Default value is 23:59:59
+
+ .. versionadded:: 1.29.90
+
+``SendAfter`` (time)
+ Send message after specified time, can be used to limit messages from
+ being sent in night. Default value is 00:00:00
+
+ .. versionadded:: 1.29.90
+
+``Text`` (text)
+ SMS text encoded using hex values in proper coding. If you want to use
+ TextDecoded field, keep this NULL (or empty).
+
+``DestinationNumber`` (varchar(20))
+ recipient number
+
+``Coding`` (enum('Default_No_Compression', 'Unicode_No_Compression', '8bit', 'Default_Compression', 'Unicode_Compression'))
+ SMS text coding
+
+``UDH`` (text)
+ User Data Header encoded using hex values which will be used for constructing
+ the message. Without this, message will be sent as plain text.
+
+``Class`` (integer)
+ SMS class or \-1 (0 is normal SMS, 1 is flash one, 127 is USSD)
+
+``TextDecoded`` (varchar(160))
+ SMS text in "human readable" form
+
+``ID`` (integer unsigned)
+ SMS/SMS sequence ID
+
+ Please note that this number has to be unique also for sentitems table, so
+ reusing message IDs might not be a good idea.
+
+``MultiPart`` (enum('false','true'))
+ info, whether there are more SMS from this sequence in outbox_multipart
+
+``RelativeValidity`` (integer)
+ SMS relative validity like encoded using GSM specs
+
+``SenderID`` (text)
+ which SMSD instance should send this one sequence, see
+ :config:option:`PhoneID` and :ref:`smsd-multi`. If blank, first SMSD who
+ sees this message first will process it.
+
+``SendingTimeOut`` (timestamp)
+ used by SMSD instance for own targets
+
+``DeliveryReport`` (enum('default','yes','no'))
+ when default is used, Delivery Report is used or not according to SMSD instance settings; yes forces Delivery Report.
+
+``CreatorID`` (text)
+ identification of program created the message
+
+``Retries`` (integer)
+ number of attempted retries when sending this message
+
+``Priority`` (integer)
+ priority of message, messages with higher priority are processed first
+
+``Status`` (enum('SendingOK', 'SendingOKNoReport', 'SendingError', 'DeliveryOK', 'DeliveryFailed', 'DeliveryPending', 'DeliveryUnknown', 'Error', 'Reserved'))
+ Status of message sending. SendingError means that phone failed to send the
+ message, Error indicates some other error while processing message.
+
+ ``SendingOK``
+ Message has been sent, waiting for delivery report.
+ ``SendingOKNoReport``
+ Message has been sent without asking for delivery report.
+ ``SendingError``
+ Sending has failed.
+ ``DeliveryOK``
+ Delivery report arrived and reported success.
+ ``DeliveryFailed``
+ Delivery report arrived and reports failure.
+ ``DeliveryPending``
+ Delivery report announced pending deliver.
+ ``DeliveryUnknown``
+ Delivery report reported unknown status.
+ ``Error``
+ Some other error happened during sending (usually bug in SMSD).
+ ``Reserved``
+ Initial value, meaning the status has not been set.
+
+ .. versionadded:: 1.38.5
+
+``StatusCode`` (integer)
+ GSM status code
+
+ .. versionadded:: 1.38.5
+
+.. _outbox_multipart:
+
+outbox_multipart
+++++++++++++++++
+
+Data for outgoing multipart messages.
+
+Fields description:
+
+``ID`` (integer unsigned)
+ the same meaning as values in outbox table
+``Text`` (text)
+ the same meaning as values in outbox table
+``Coding`` (enum('Default_No_Compression', 'Unicode_No_Compression', '8bit', 'Default_Compression', 'Unicode_Compression'))
+ the same meaning as values in outbox table
+``UDH`` (text)
+ the same meaning as values in outbox table
+``Class`` (integer)
+ the same meaning as values in outbox table
+``TextDecoded`` (varchar(160))
+ the same meaning as values in outbox table
+``ID`` (integer unsigned)
+ the same meaning as values in outbox table
+
+``SequencePosition`` (integer)
+ info, what is SMS number in SMS sequence (start at 2, first part is in :ref:`outbox`
+ table).
+
+``Status`` (enum('SendingOK', 'SendingOKNoReport', 'SendingError', 'DeliveryOK', 'DeliveryFailed', 'DeliveryPending', 'DeliveryUnknown', 'Error', 'Reserved'))
+ Status of message sending. SendingError means that phone failed to send the
+ message, Error indicates some other error while processing message.
+
+ ``SendingOK``
+ Message has been sent, waiting for delivery report.
+ ``SendingOKNoReport``
+ Message has been sent without asking for delivery report.
+ ``SendingError``
+ Sending has failed.
+ ``DeliveryOK``
+ Delivery report arrived and reported success.
+ ``DeliveryFailed``
+ Delivery report arrived and reports failure.
+ ``DeliveryPending``
+ Delivery report announced pending deliver.
+ ``DeliveryUnknown``
+ Delivery report reported unknown status.
+ ``Error``
+ Some other error happened during sending (usually bug in SMSD).
+ ``Reserved``
+ Initial value, meaning the status has not been set.
+
+ .. versionadded:: 1.38.5
+
+``StatusCode`` (integer)
+ GSM status code
+
+ .. versionadded:: 1.38.5
+
+.. _phones:
+
+phones
+++++++
+
+Information about connected phones. This table is periodically refreshed and
+you can get information such as battery or signal level from here.
+
+Fields description:
+
+``ID`` (text)
+ PhoneID value
+
+``UpdatedInDB`` (timestamp)
+ when this record has been updated
+
+``InsertIntoDB`` (timestamp)
+ when this record has been created (when phone has been connected)
+
+``TimeOut`` (timestamp)
+ when this record expires
+
+``Send`` (boolean)
+ indicates whether SMSD is sending messages, depends on configuration directive :config:option:`Send`
+
+``Receive`` (boolean)
+ indicates whether SMSD is receiving messages, depends on configuration directive :config:option:`Receive`
+
+``IMEI`` (text)
+ IMEI of phone
+
+``IMSI`` (text)
+ SIM IMSI
+
+``Client`` (text)
+ client name, usually string Gammu with version
+
+``Battery`` (integer)
+ battery level in percent (or \-1 if unknown)
+
+``Signal`` (integer)
+ signal level in percent (or \-1 if unknown)
+
+``Sent`` (integer)
+ Number of sent SMS messages (SMSD does not reset this counter, so it might
+ overflow).
+
+``Received`` (integer)
+ Number of received SMS messages (SMSD does not reset this counter, so it might
+ overflow).
+
+.. _sentitems:
+
+sentitems
++++++++++
+
+Log of sent messages (and unsent ones with error code). Also if delivery
+reports are enabled, message state is updated after receiving delivery report.
+
+Fields description:
+
+``UpdatedInDB`` (timestamp)
+ when somebody (daemon, user, etc.) updated it
+
+``InsertIntoDB`` (timestamp)
+ when message was inserted into database
+
+``SendingDateTime`` (timestamp)
+ when message has been sent
+
+``DeliveryDateTime`` (timestamp)
+ Time of receiving delivery report (if it has been enabled).
+
+``Status`` (enum('SendingOK', 'SendingOKNoReport', 'SendingError', 'DeliveryOK', 'DeliveryFailed', 'DeliveryPending', 'DeliveryUnknown', 'Error'))
+ Status of message sending. SendingError means that phone failed to send the
+ message, Error indicates some other error while processing message.
+
+ ``SendingOK``
+ Message has been sent, waiting for delivery report.
+ ``SendingOKNoReport``
+ Message has been sent without asking for delivery report.
+ ``SendingError``
+ Sending has failed.
+ ``DeliveryOK``
+ Delivery report arrived and reported success.
+ ``DeliveryFailed``
+ Delivery report arrived and reports failure.
+ ``DeliveryPending``
+ Delivery report announced pending deliver.
+ ``DeliveryUnknown``
+ Delivery report reported unknown status.
+ ``Error``
+ Some other error happened during sending (usually bug in SMSD).
+
+``StatusError`` (integer)
+ Status of delivery from delivery report message, codes are defined in GSM
+ specification 03.40 section 9.2.3.15 (TP-Status).
+
+``Text`` (text)
+ SMS text encoded using hex values
+
+``DestinationNumber`` (varchar(20))
+ decoded destination number for SMS
+
+``Coding`` (enum('Default_No_Compression', 'Unicode_No_Compression', '8bit', 'Default_Compression', 'Unicode_Compression'))
+ SMS text coding
+
+``UDH`` (text)
+ User Data Header encoded using hex values
+
+``SMSCNumber`` (varchar(20))
+ decoded number of SMSC, which sent SMS
+
+``Class`` (integer)
+ SMS class or \-1 (0 is normal SMS, 1 is flash one, 127 is USSD)
+
+``TextDecoded`` (varchar(160))
+ SMS text in "human readable" form
+
+``ID`` (integer unsigned)
+ SMS ID
+
+``SenderID`` (text)
+ which SMSD instance sent this one sequence, see :config:option:`PhoneID`
+
+``SequencePosition`` (integer)
+ SMS number in SMS sequence
+
+``TPMR`` (integer)
+ Message Reference like in GSM specs
+
+``RelativeValidity`` (integer)
+ SMS relative validity like encoded using GSM specs
+
+``CreatorID`` (text)
+ copied from CreatorID from outbox table
+
+``StatusCode`` (integer)
+ GSM status code
+
+ .. versionadded:: 1.38.5
+
+
+.. _smsd-tables-history:
+
+History of database structure
+-----------------------------
+
+.. note::
+
+ Testing versions (see :ref:`versioning`) do not have to keep same table
+ structure as final releases. Below mentioned versions are for
+ informational purposes only, you should always use stable versions in
+ production environment.
+
+History of schema versions:
+
+17
+
+ * Added ``Status`` field to :ref:`outbox` and :ref:`outbox_multipart`.
+ * Added ``StatusCode`` field to :ref:`sentitems`, :ref:`outbox` and :ref:`outbox_multipart`.
+ * Added ``Status`` field to :ref:`inbox`.
+
+ .. versionchanged:: 1.38.5
+
+16
+
+ * Removed unused ``daemons``, ``pbk`` and ``pbk_groups`` tables.
+ * Added primary key to the ``gammu`` table.
+ * Added ``Priority`` field to the :ref:`outbox`.
+ * Added ``IMSI`` field to the :ref:`phones`.
+
+ .. versionchanged:: 1.37.90
+
+15
+
+ Added ``Retries`` field to the :ref:`outbox`.
+
+ .. versionchanged:: 1.36.7
+
+14
+
+ Added ``NetCode`` and ``NetName`` fields.
+
+ .. versionchanged:: 1.34.0
+
+13
+ Added ``SendBefore`` and ``SendAfter`` fields.
+
+ .. versionchanged:: 1.29.90
+
+ Also PostgreSQL fields are now case sensitive (same as other backends).
+
+ .. versionchanged:: 1.29.93
+12
+ the changes only affect MySQL structure changing default values for
+ timestamps from ``0000-00-00 00:00:00`` to ``CURRENT_TIMESTAMP()`` by
+ using triggers, to update to this version, just execute triggers
+ definition at the end of SQL file.
+
+ .. versionchanged:: 1.28.94
+11
+ all fields for storing message text are no longer limited to 160 chars,
+ but are arbitrary length text fields.
+
+ .. versionchanged:: 1.25.92
+10
+ ``DeliveryDateTime`` is now NULL when message is not delivered, added several
+ indexes
+
+ .. versionchanged:: 1.22.95
+9
+ added sent/received counters to phones table
+
+ .. versionchanged:: 1.22.93
+8
+ Signal and battery state are now stored in database.
+
+ .. versionchanged:: 1.20.94
+7
+ Added ``CreatorID`` to several tables.
+
+ .. versionchanged:: 1.07.00
+6
+ Many fields in outbox can now be NULL.
+
+ .. versionchanged:: 1.06.00
+5
+ Introduced daemons table and various other changes.
+
+ .. versionchanged:: 1.03.00
+3
+ Introduced phones table and various other changes.
+
+ .. versionchanged:: 0.98.0
+
+
+Examples
+--------
+
+Creating tables
++++++++++++++++
+
+SQL scripts to create all needed tables for most databases are included in
+Gammu documentation (docs/sql). As well as some PHP scripts interacting with
+the database.
+
+For example to create SQLite tables, issue following command:
+
+.. code-block:: sh
+
+ sqlite3 smsd.db < docs/sql/sqlite.sql
+
+Injecting a message using SQL
++++++++++++++++++++++++++++++
+
+To send a message, you can either use :ref:`gammu-smsd-inject`, which does all the
+magic for you, or you can insert the message manually. The simplest example is
+short text message:
+
+.. code-block:: sql
+
+ INSERT INTO outbox (
+ DestinationNumber,
+ TextDecoded,
+ CreatorID,
+ Coding
+ ) VALUES (
+ '800123465',
+ 'This is a SQL test message',
+ 'Program',
+ 'Default_No_Compression'
+ );
+
+Please note usage of ``TextDecoded`` field, for ``Text`` field, you would have
+to hex encode the unicode text:
+
+.. code-block:: sql
+
+ INSERT INTO outbox (
+ DestinationNumber,
+ Text,
+ CreatorID,
+ Coding
+ ) VALUES (
+ '800123465',
+ '005400680069007300200069007300200061002000530051004c002000740065007300740020006d006500730073006100670065',
+ 'Program',
+ 'Default_No_Compression'
+ );
+
+Injecting long message using SQL
+++++++++++++++++++++++++++++++++
+
+Inserting multipart messages is a bit more tricky, you need to construct also
+UDH header and store it hexadecimally written into UDH field. Unless you have a
+good reason to do this manually, use :ref:`gammu-smsd-inject`, C library
+(:c:func:`SMSD_InjectSMS`) or Python library
+(:meth:`gammu.smsd.SMSD.InjectSMS`).
+
+For long text message, the UDH starts with ``050003`` followed by byte as a
+message reference (you can put any hex value there, but it should be **different
+for each message**, ``D3`` in following example), byte for number of messages
+(``02`` in example, it should be unique for each message you send to same phone
+number) and byte for number of current message (``01`` for first message,
+``02`` for second, etc.).
+
+I most cases, the mutlipart message has to be class 1.
+
+For example long text message of two parts could look like following:
+
+.. code-block:: sql
+
+ INSERT INTO outbox (
+ CreatorID,
+ MultiPart,
+ DestinationNumber,
+ UDH,
+ TextDecoded,
+ Coding,
+ Class
+ ) VALUES (
+ 'Gammu 1.23.91',
+ 'true',
+ '123465',
+ '050003D30201',
+ 'Mqukqirip ya konej eqniu rejropocejor hugiygydewl tfej nrupxujob xuemymiyliralj. Te tvyjuh qaxumur ibewfoiws zuucoz tdygu gelum L ejqigqesykl kya jdytbez',
+ 'Default_No_Compression',
+ 1
+ )
+
+ INSERT INTO outbox_multipart (
+ SequencePosition,
+ UDH,
+ Class,
+ TextDecoded,
+ ID,
+ Coding,
+ Class
+ ) VALUES (
+ 2,
+ '050003D30202',
+ 'u xewz qisubevumxyzk ufuylehyzc. Nse xobq dfolizygqysj t bvowsyhyhyemim ovutpapeaempye giuuwbib.',
+ <ID_OF_INSERTED_RECORD_IN_OUBOX_TABLE>,
+ 'Default_No_Compression',
+ 1
+ )
+
+.. note::
+
+ Adding UDH means that you have less space for text, in above example you
+ can use only 153 characters in single message.
diff --git a/docs/manual/smsd/usage.rst b/docs/manual/smsd/usage.rst
new file mode 100644
index 0000000..44d28fc
--- /dev/null
+++ b/docs/manual/smsd/usage.rst
@@ -0,0 +1,61 @@
+Usage
+=====
+
+This chapter will describe basic ways of using SMSD. It's use is not limited
+to these, but they can give you overview of SMSD abilities.
+
+Storing Messages in Backend
+---------------------------
+
+The standard mode of operating SMSD. You simply configure backend service, and
+all received messages will end up in it and any message you put into outbox
+storage will be sent.
+
+Creating Messages to Send
+-------------------------
+
+Creating of messages to send heavily depends on service backend you use. Most
+of them support :ref:`gammu-smsd-inject`, which can be used to construct
+the message, or you can just insert message manually to the backend storage.
+
+Alternatively you can use :c:func:`SMSD_InjectSMS` (from C) or using
+:meth:`gammu.smsd.SMSD.InjectSMS` (from Python).
+
+Notification about Received Messages
+------------------------------------
+
+Once SMSD receives message and stores it in backend service, it can invoke
+your own program to do any message processing, see :ref:`gammu-smsd-run`.
+
+Monitoring SMSD Status
+----------------------
+
+You can use :ref:`gammu-smsd-monitor` to monitor status of SMSD. It uses
+shared memory segment to get current status of running SMSD.
+
+Alternatively you can get the same functionality from libGammu using
+:c:func:`SMSD_GetStatus` or python-gammu using
+:meth:`gammu.smsd.SMSD.GetStatus`.
+
+.. _reporting-bugs-smsd:
+
+Reporting Bugs
+--------------
+
+Please report bugs to <https://github.com/gammu/gammu/issues>.
+
+Before reporting a bug, please enable verbose logging in SMSD configuration
+by :config:option:`DebugLevel` and :config:option:`LogFile`:
+
+.. code-block:: ini
+
+ [gammu]
+ connection = your connection setting
+ port = your port name
+ logformat = textalldate
+
+ [smsd]
+ debuglevel = 255
+ logfile = smsd.log
+
+and include this verbose log within bug report.
diff --git a/docs/manual/testing/dummy-driver.rst b/docs/manual/testing/dummy-driver.rst
new file mode 100644
index 0000000..3556244
--- /dev/null
+++ b/docs/manual/testing/dummy-driver.rst
@@ -0,0 +1,88 @@
+.. _dummy-driver:
+
+Dummy Driver
+============
+
+.. versionadded:: 1.22.93
+
+The ``dummy`` driver in Gammu emulates all operations on filesystem. It is
+used by :doc:`testsuite`, but it is also very helpful for application
+developers, because they can test the functionality without using real phone
+and avoiding risk of corrupting data in the phone.
+
+Filesystem structure
+--------------------
+
+The dummy driver emulates all phone functionality on filesystem. The
+:config:option:`Device` configuration directive sets top level directory,
+where all data are stored.
+
+This directory contains file :file:`operations.log`, where are logged
+operations which do not modify any data in the dummy phone (eg. sending
+message).
+
+Messages
+++++++++
+
+Messages are stored in :file:`sms/<FOLDER>` directories (``<FOLDER>`` is in
+range 1-5) in Gammu native smsbackup format.
+
+Phonebook
++++++++++
+
+Phonebook (and calls registers) are stored in :file:`pbk/<MEMORY>` (``<MEMORY>``
+is type of memory like ``ME`` or ``SM``) directories in vCard format.
+
+Notes
++++++
+
+Notes are stored in :file:`note` directory in vNote format.
+
+Calendar
+++++++++
+
+Calendar entries are stored in :file:`calendar` directory in vCalendar format.
+
+Todo
+++++
+
+Todo entries are stored in :file:`todo` directory in vCalendar format.
+
+Filesystem
+++++++++++
+
+Filesystem is stored in :file:`fs` directory. You can create another
+subdirectories there.
+
+Other features
+--------------
+
+By specifying :config:option:`Features` you can configure some specific behavior:
+
+``DISABLE_GETNEXT``
+ Makes the dummy driver fail all GetNext* calls as not supported (with
+ exception of GetNextSMS* and GetNextFile*).
+``DISABLE_GETNEXTSMS``
+ Makes the dummy driver fail all GetNextSMS* calls as not supported.
+
+Examples
+--------
+
+To use dummy driver, you need something like following in :file:`~/.gammurc`:
+
+.. code-block:: ini
+
+ [gammu]
+ model = dummy
+ connection = none
+ device = /path/to/directory/
+
+For disabling GetNext* functions within dummy driver, you need something like following in :file:`~/.gammurc`:
+
+.. code-block:: ini
+
+ [gammu]
+ model = dummy
+ connection = none
+ features = DISABLE_GETNEXT
+ device = /path/to/directory/
diff --git a/docs/manual/testing/index.rst b/docs/manual/testing/index.rst
new file mode 100644
index 0000000..10296c6
--- /dev/null
+++ b/docs/manual/testing/index.rst
@@ -0,0 +1,11 @@
+.. _testing:
+
+Testing Gammu
+=============
+
+.. toctree::
+ :maxdepth: 2
+
+ testsuite
+ dummy-driver
+
diff --git a/docs/manual/testing/testsuite.rst b/docs/manual/testing/testsuite.rst
new file mode 100644
index 0000000..9f8e2e2
--- /dev/null
+++ b/docs/manual/testing/testsuite.rst
@@ -0,0 +1,165 @@
+Gammu Testsuite
+===============
+
+Gammu comes with quite big test suite. It covers some basic low level
+functions, handling replies from the phone and also does testing of command
+line utilities and SMSD.
+
+
+Running the tests
+-----------------
+
+You can run the test suite this using ``make test``. CMake build system uses
+for testing CTest, which also includes option to connect to dashboard and
+submit test results there, so that they can be reviewed and fixed by others. To
+participate in this testing, you need just to run ``make Experimental`` which
+also does submission to the dashboard.
+
+There are some more options for testing:
+
+``make test``
+
+ Runs testsuite with no uploading of results.
+
+``make Experimental``
+
+ Runs testsuite and uploads results to the dashboard.
+
+``make ExperimentalMemCheck``
+
+ This checks memory accesses using valgrind during tests and submits
+ report. You need to do this after ``make Experimental`` and you can
+ submit results using ``make ExperimentalSubmit``.
+
+Coverage reports
+
+ To get test coverage reports, you need to configure project using
+ ``cmake -DCOVERAGE=ON``
+
+Nightly testing
+
+ Currently several machines do compile and test Gammu every night. If
+ you want to tak part of this, just ensure that your machine executes
+ test suite every night (preferably after 3:00 CET). You can select
+ either ``make Nightly`` to do regular testing or
+ ``make NightlyMemoryCheck`` to test with valgrind. Also you can enable
+ coverage tests as described above.
+
+Running single test
+
+ You can run single test by directly calling ctest::
+
+ ctest -R test-name
+
+ Adding ``-V`` runs it in verbose mode with all test output::
+
+ ctest -V -R test-name
+
+Collecting results
+------------------
+
+The tests are ran daily on several platforms and you can find the
+results on `Travis <https://travis-ci.org/gammu/gammu>`_.
+
+The coverage reports are at
+`Coveralls <https://coveralls.io/r/gammu/gammu>`_.
+
+
+Testing of SMSD
+---------------
+
+SMSD tests are performed using :ref:`dummy-driver` and uses file backend and
+sqlite database by default. For this you nee Gammu compiled with libdbi, have
+installed sqlite driver for libdbi and have :program:`sqlite3` binary available
+on the system.
+
+Testing of additional database backends must be enabled separately:
+
+``MYSQL_TESTING``:
+ you need to have setup MySQL server with database where SMSD can play.
+
+``PSQL_TESTING``
+ you need to have setup PostgreSQL server with database where SMSD can play.
+
+Testing of command line utility
+-------------------------------
+
+Gammu command line tests are performed using :ref:`dummy-driver` where
+required. It covers most of command line interface, but some parts need to be
+explicitly enabled:
+
+``ONLINE_TESTING``:
+ enable testing of features which require internet access
+
+Testing of Python interface
+---------------------------
+
+Python module tests are performed using :ref:`dummy-driver` where required. It
+does also cover testing of SMSD interface, which is done using libdbi(sqlite)
+driver.
+
+Testing of reply functions
+--------------------------
+
+The :file:`tests` directory contains various tests which do inject data into
+reply functions and check their response.
+
+Testing of data parsing
+-----------------------
+
+The :file:`tests` directory contains various tests which just try to parse
+various file formats supported by libGammu.
+
+Configuration of the test suite
+-------------------------------
+
+You can pass various parameters to configure the test suite:
+
+Programs used for testing
++++++++++++++++++++++++++
+
+``SH_BIN``
+ Path to the :program:`sh` program
+``BASH_BIN``
+ Path to the :program:`bash` program
+``SQLITE_BIN``
+ Path to the :program:`sqlite3` program
+``SED_BIN``
+ Path to the :program:`sed` program
+``MYSQL_BIN``
+ Path to the :program:`mysql` program
+``PSQL_BIN``
+ Path to the :program:`psql` program
+
+Limiting testsuite
+++++++++++++++++++
+
+``ONLINE_TESTING``
+ Enable testing of parts which use remote servers, requires connection to interned
+``PSQL_TESTING``
+ Enable testing of PostgreSQL SMSD backend, requires configured PostgreSQL database
+``MYSQL_TESTING``
+ Enable testing of MySQL SMSD backend, requires configured MySQL database
+
+Database backends configuration
++++++++++++++++++++++++++++++++
+
+``PSQL_HOST``
+ Host to use for PostgreSQL tests (default: ``127.0.0.1``)
+``PSQL_DATABASE``
+ Database to use for PostgreSQL tests (default: ``smsd``)
+``PSQL_USER``
+ User to use for PostgreSQL tests (default: ``smsd``)
+``PSQL_PASSWORD``
+ Password to use for PostgreSQL tests (default: ``smsd``)
+``MYSQL_HOST``
+ Host to use for MySQL tests (default: ``127.0.0.1``)
+``MYSQL_DATABASE``
+ Database to use for MySQL tests (default: ``smsd``)
+``MYSQL_USER``
+ User to use for MySQL tests (default: ``smsd``)
+``MYSQL_PASSWORD``
+ Password to use for MySQL tests (default: ``smsd``)
+``ODBC_DSN```
+ ODBC DSN to use for ODBC tests (default: ``smsd``).
+ Currently needs to point to MySQL database.
diff --git a/docs/manual/utils/gammu-config.rst b/docs/manual/utils/gammu-config.rst
new file mode 100644
index 0000000..4a53a08
--- /dev/null
+++ b/docs/manual/utils/gammu-config.rst
@@ -0,0 +1,33 @@
+.. _gammu-config:
+
+gammu-config
+============
+
+.. program:: gammu-config
+
+Synopsis
+--------
+
+.. code-block:: text
+
+ gammu-config [-f|--force] [-c|--config CONFIG]
+
+Description
+-----------
+
+Script to help configuring :ref:`gammu`.
+
+This program follows the usual GNU command line syntax, with long options
+starting with two dashes (``-``). A summary of options is included below.
+
+.. option:: -h, --help
+
+ Show summary of options.
+
+.. option:: -f, --force
+
+ Force configuring even if config already exists.
+
+.. option:: -c, --config CONFIG
+
+ Define which configuration file to use.
diff --git a/docs/manual/utils/gammu-detect.rst b/docs/manual/utils/gammu-detect.rst
new file mode 100644
index 0000000..2b56a23
--- /dev/null
+++ b/docs/manual/utils/gammu-detect.rst
@@ -0,0 +1,124 @@
+
+.. _gammu-detect:
+
+gammu-detect
+============
+
+.. versionadded:: 1.28.95
+
+.. program:: gammu-detect
+
+Synopsis
+--------
+
+.. code-block:: text
+
+ gammu-detect [OPTIONS]
+
+Description
+-----------
+
+Script to detect available devices, which might be suitable for :ref:`gammu`.
+
+.. note::
+
+ This program lists all devices, which might be suitable, it does not do
+ any probing on devices them self.
+
+Currently it supports following devices:
+
+* USB devices using udev
+* Serial ports using udev
+* Serial ports on Windows
+* Bluetooth devices using Bluez
+
+.. note::
+
+ Supported devices depend on platform you are using and compiled in
+ features. You can find out what is actually compiled in by running
+ :option:`gammu-detect -v`.
+
+This program follows the usual GNU command line syntax, with long options
+starting with two dashes (``--``). A summary of options is included below.
+
+.. option:: -h, --help
+
+ Show summary of options.
+
+.. option:: -d, --debug
+
+ Show debugging output for detecting devices.
+
+.. option:: -v, --version
+
+ Show version information and compiled in features.
+
+.. option:: -u, --no-udev
+
+ Disables scanning of udev.
+
+.. option:: -b, --no-bluez
+
+ Disables scanning using Bluez.
+
+.. option:: -w, --no-win32-serial
+
+ Disables scanning of Windows serial ports.
+
+Output
+------
+
+The output of :ref:`gammu-detect` is configuration file for Gammu (see
+:ref:`gammurc`) with configuration section for every device which might be
+used with :ref:`gammu`.
+
+.. note::
+
+ You can choose which section to use in :ref:`gammu` by :option:`gammu -s`.
+
+When invoked as :option:`gammu-detect -d`, also all examined devices are
+listed as comments in the output.
+
+Example
+-------
+
+.. code-block:: ini
+
+ ; Configuration file generated by gammu-detect.
+ ; Please check The Gammu Manual for more information.
+
+ [gammu]
+ device = /dev/ttyACM0
+ name = Nokia E52
+ connection = at
+
+ [gammu1]
+ device = /dev/ttyACM1
+ name = Nokia E52
+ connection = at
+
+ [gammu2]
+ device = /dev/ttyS0
+ name = Phone on serial port 0
+ connection = at
+
+ [gammu3]
+ device = /dev/ttyS1
+ name = Phone on serial port 1
+ connection = at
+
+ [gammu4]
+ device = /dev/ttyS2
+ name = Phone on serial port 2
+ connection = at
+
+ [gammu5]
+ device = /dev/ttyS3
+ name = Phone on serial port 3
+ connection = at
+
+ [gammu6]
+ device = 5C:57:C8:BB:BB:BB
+ name = Nokia E52
+ connection = bluephonet
+
diff --git a/docs/manual/utils/index.rst b/docs/manual/utils/index.rst
new file mode 100644
index 0000000..1038af2
--- /dev/null
+++ b/docs/manual/utils/index.rst
@@ -0,0 +1,12 @@
+.. _utils:
+
+Miscellaneous utilities
+=======================
+
+.. toctree::
+ :maxdepth: 2
+
+ gammu-detect
+ gammu-config
+ jadmaker
+
diff --git a/docs/manual/utils/jadmaker.rst b/docs/manual/utils/jadmaker.rst
new file mode 100644
index 0000000..1c6a7a8
--- /dev/null
+++ b/docs/manual/utils/jadmaker.rst
@@ -0,0 +1,34 @@
+.. _jadmaker:
+
+jadmaker
+========
+
+.. program:: jadmaker
+
+Synopsis
+--------
+
+.. code-block:: text
+
+ jadmaker [-f|--force] [-u|--url URL] <filename.jar>...
+
+Description
+-----------
+
+Script to generate JAD file from JAR file.
+
+This program follows the usual GNU command line syntax, with long options
+starting with two dashes (``-``). A summary of options is included below.
+
+
+.. option:: -h, --help
+
+ Show summary of options.
+
+.. option:: -f, --force
+
+ Force rewriting of JAD file even if exists.
+
+.. option:: -u, --url URL
+
+ Define URL to be included in JAD file.
diff --git a/docs/sql/CMakeLists.txt b/docs/sql/CMakeLists.txt
new file mode 100644
index 0000000..1a2deac
--- /dev/null
+++ b/docs/sql/CMakeLists.txt
@@ -0,0 +1,14 @@
+# cmake <http://www.cmake.org> build file for Gammu docs
+# Copyright (c) 2007 - 2017 Michal Cihar
+# vim: expandtab sw=4 ts=4 sts=4:
+
+project (Gammu-doc-sql C)
+
+file(GLOB SQL_FILES "*.sql")
+
+install (
+ FILES ${SQL_FILES}
+ DESTINATION "${INSTALL_DOC_DIR}/examples/sql"
+ COMPONENT "examples"
+ )
+
diff --git a/docs/sql/mysql-strict.sql b/docs/sql/mysql-strict.sql
new file mode 100644
index 0000000..10efe1f
--- /dev/null
+++ b/docs/sql/mysql-strict.sql
@@ -0,0 +1,180 @@
+--
+-- Database for Gammu SMSD
+--
+-- In case you get errors about not supported charset, please
+-- replace utf8mb4 with utf8.
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `gammu`
+--
+
+CREATE TABLE `gammu` (
+ `Version` integer NOT NULL default '0' PRIMARY KEY
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+
+--
+-- Dumping data for table `gammu`
+--
+
+INSERT INTO `gammu` (`Version`) VALUES (17);
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `inbox`
+--
+
+CREATE TABLE `inbox` (
+ `UpdatedInDB` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ `ReceivingDateTime` timestamp NOT NULL default CURRENT_TIMESTAMP,
+ `Text` text NOT NULL,
+ `SenderNumber` varchar(20) NOT NULL default '',
+ `Coding` enum('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression') NOT NULL default 'Default_No_Compression',
+ `UDH` text NOT NULL,
+ `SMSCNumber` varchar(20) NOT NULL default '',
+ `Class` integer NOT NULL default '-1',
+ `TextDecoded` text NOT NULL,
+ `ID` integer unsigned NOT NULL auto_increment,
+ `RecipientID` text NOT NULL,
+ `Processed` enum('false','true') NOT NULL default 'false',
+ `Status` integer NOT NULL default '-1',
+ PRIMARY KEY `ID` (`ID`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
+
+--
+-- Dumping data for table `inbox`
+--
+
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `outbox`
+--
+
+CREATE TABLE `outbox` (
+ `UpdatedInDB` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ `InsertIntoDB` timestamp NOT NULL default CURRENT_TIMESTAMP,
+ `SendingDateTime` timestamp NOT NULL default CURRENT_TIMESTAMP,
+ `SendBefore` time NOT NULL DEFAULT '23:59:59',
+ `SendAfter` time NOT NULL DEFAULT '00:00:00',
+ `Text` text,
+ `DestinationNumber` varchar(20) NOT NULL default '',
+ `Coding` enum('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression') NOT NULL default 'Default_No_Compression',
+ `UDH` text,
+ `Class` integer default '-1',
+ `TextDecoded` text NOT NULL,
+ `ID` integer unsigned NOT NULL auto_increment,
+ `MultiPart` enum('false','true') default 'false',
+ `RelativeValidity` integer default '-1',
+ `SenderID` varchar(255),
+ `SendingTimeOut` timestamp NULL default CURRENT_TIMESTAMP,
+ `DeliveryReport` enum('default','yes','no') default 'default',
+ `CreatorID` text NOT NULL,
+ `Retries` int(3) default 0,
+ `Priority` integer default 0,
+ `Status` enum('SendingOK','SendingOKNoReport','SendingError','DeliveryOK','DeliveryFailed','DeliveryPending','DeliveryUnknown','Error','Reserved') NOT NULL default 'Reserved',
+ `StatusCode` integer NOT NULL default '-1',
+ PRIMARY KEY `ID` (`ID`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+
+CREATE INDEX outbox_date ON outbox(SendingDateTime, SendingTimeOut);
+CREATE INDEX outbox_sender ON outbox(SenderID(250));
+
+--
+-- Dumping data for table `outbox`
+--
+
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `outbox_multipart`
+--
+
+CREATE TABLE `outbox_multipart` (
+ `Text` text,
+ `Coding` enum('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression') NOT NULL default 'Default_No_Compression',
+ `UDH` text,
+ `Class` integer default '-1',
+ `TextDecoded` text,
+ `ID` integer unsigned NOT NULL default '0',
+ `SequencePosition` integer NOT NULL default '1',
+ `Status` enum('SendingOK','SendingOKNoReport','SendingError','DeliveryOK','DeliveryFailed','DeliveryPending','DeliveryUnknown','Error','Reserved') NOT NULL default 'Reserved',
+ `StatusCode` integer NOT NULL default '-1',
+ PRIMARY KEY (`ID`, `SequencePosition`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+
+--
+-- Dumping data for table `outbox_multipart`
+--
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `phones`
+--
+
+CREATE TABLE `phones` (
+ `ID` text NOT NULL,
+ `UpdatedInDB` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ `InsertIntoDB` timestamp NOT NULL default CURRENT_TIMESTAMP,
+ `TimeOut` timestamp NOT NULL default CURRENT_TIMESTAMP,
+ `Send` enum('yes','no') NOT NULL default 'no',
+ `Receive` enum('yes','no') NOT NULL default 'no',
+ `IMEI` varchar(35) NOT NULL,
+ `IMSI` varchar(35) NOT NULL,
+ `NetCode` varchar(10) default 'ERROR',
+ `NetName` varchar(35) default 'ERROR',
+ `Client` text NOT NULL,
+ `Battery` integer NOT NULL DEFAULT -1,
+ `Signal` integer NOT NULL DEFAULT -1,
+ `Sent` int NOT NULL DEFAULT 0,
+ `Received` int NOT NULL DEFAULT 0,
+ PRIMARY KEY (`IMEI`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+
+--
+-- Dumping data for table `phones`
+--
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `sentitems`
+--
+
+CREATE TABLE `sentitems` (
+ `UpdatedInDB` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ `InsertIntoDB` timestamp NOT NULL default CURRENT_TIMESTAMP,
+ `SendingDateTime` timestamp NOT NULL default CURRENT_TIMESTAMP,
+ `DeliveryDateTime` timestamp NULL,
+ `Text` text NOT NULL,
+ `DestinationNumber` varchar(20) NOT NULL default '',
+ `Coding` enum('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression') NOT NULL default 'Default_No_Compression',
+ `UDH` text NOT NULL,
+ `SMSCNumber` varchar(20) NOT NULL default '',
+ `Class` integer NOT NULL default '-1',
+ `TextDecoded` text NOT NULL,
+ `ID` integer unsigned NOT NULL default '0',
+ `SenderID` varchar(255) NOT NULL,
+ `SequencePosition` integer NOT NULL default '1',
+ `Status` enum('SendingOK','SendingOKNoReport','SendingError','DeliveryOK','DeliveryFailed','DeliveryPending','DeliveryUnknown','Error') NOT NULL default 'SendingOK',
+ `StatusError` integer NOT NULL default '-1',
+ `TPMR` integer NOT NULL default '-1',
+ `RelativeValidity` integer NOT NULL default '-1',
+ `CreatorID` text NOT NULL,
+ `StatusCode` integer NOT NULL default '-1',
+ PRIMARY KEY (`ID`, `SequencePosition`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+
+CREATE INDEX sentitems_date ON sentitems(DeliveryDateTime);
+CREATE INDEX sentitems_tpmr ON sentitems(TPMR);
+CREATE INDEX sentitems_dest ON sentitems(DestinationNumber);
+CREATE INDEX sentitems_sender ON sentitems(SenderID(250));
+
+--
+-- Dumping data for table `sentitems`
+--
diff --git a/docs/sql/mysql.sql b/docs/sql/mysql.sql
new file mode 100644
index 0000000..df94747
--- /dev/null
+++ b/docs/sql/mysql.sql
@@ -0,0 +1,234 @@
+--
+-- Database for Gammu SMSD
+--
+-- In case you get errors about not supported charset, please
+-- replace utf8mb4 with utf8.
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `gammu`
+--
+
+CREATE TABLE `gammu` (
+ `Version` integer NOT NULL default '0' PRIMARY KEY
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+
+--
+-- Dumping data for table `gammu`
+--
+
+INSERT INTO `gammu` (`Version`) VALUES (17);
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `inbox`
+--
+
+CREATE TABLE `inbox` (
+ `UpdatedInDB` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ `ReceivingDateTime` timestamp NOT NULL default '0000-00-00 00:00:00',
+ `Text` text NOT NULL,
+ `SenderNumber` varchar(20) NOT NULL default '',
+ `Coding` enum('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression') NOT NULL default 'Default_No_Compression',
+ `UDH` text NOT NULL,
+ `SMSCNumber` varchar(20) NOT NULL default '',
+ `Class` integer NOT NULL default '-1',
+ `TextDecoded` text NOT NULL,
+ `ID` integer unsigned NOT NULL auto_increment,
+ `RecipientID` text NOT NULL,
+ `Processed` enum('false','true') NOT NULL default 'false',
+ `Status` integer NOT NULL default '-1',
+ PRIMARY KEY `ID` (`ID`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
+
+--
+-- Dumping data for table `inbox`
+--
+
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `outbox`
+--
+
+CREATE TABLE `outbox` (
+ `UpdatedInDB` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ `InsertIntoDB` timestamp NOT NULL default '0000-00-00 00:00:00',
+ `SendingDateTime` timestamp NOT NULL default '0000-00-00 00:00:00',
+ `SendBefore` time NOT NULL DEFAULT '23:59:59',
+ `SendAfter` time NOT NULL DEFAULT '00:00:00',
+ `Text` text,
+ `DestinationNumber` varchar(20) NOT NULL default '',
+ `Coding` enum('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression') NOT NULL default 'Default_No_Compression',
+ `UDH` text,
+ `Class` integer default '-1',
+ `TextDecoded` text NOT NULL,
+ `ID` integer unsigned NOT NULL auto_increment,
+ `MultiPart` enum('false','true') default 'false',
+ `RelativeValidity` integer default '-1',
+ `SenderID` varchar(255),
+ `SendingTimeOut` timestamp NULL default '0000-00-00 00:00:00',
+ `DeliveryReport` enum('default','yes','no') default 'default',
+ `CreatorID` text NOT NULL,
+ `Retries` int(3) default 0,
+ `Priority` integer default 0,
+ `Status` enum('SendingOK','SendingOKNoReport','SendingError','DeliveryOK','DeliveryFailed','DeliveryPending','DeliveryUnknown','Error','Reserved') NOT NULL default 'Reserved',
+ `StatusCode` integer NOT NULL default '-1',
+ PRIMARY KEY `ID` (`ID`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+
+CREATE INDEX outbox_date ON outbox(SendingDateTime, SendingTimeOut);
+CREATE INDEX outbox_sender ON outbox(SenderID(250));
+
+--
+-- Dumping data for table `outbox`
+--
+
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `outbox_multipart`
+--
+
+CREATE TABLE `outbox_multipart` (
+ `Text` text,
+ `Coding` enum('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression') NOT NULL default 'Default_No_Compression',
+ `UDH` text,
+ `Class` integer default '-1',
+ `TextDecoded` text,
+ `ID` integer unsigned NOT NULL default '0',
+ `SequencePosition` integer NOT NULL default '1',
+ `Status` enum('SendingOK','SendingOKNoReport','SendingError','DeliveryOK','DeliveryFailed','DeliveryPending','DeliveryUnknown','Error','Reserved') NOT NULL default 'Reserved',
+ `StatusCode` integer NOT NULL default '-1',
+ PRIMARY KEY (`ID`, `SequencePosition`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+
+--
+-- Dumping data for table `outbox_multipart`
+--
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `phones`
+--
+
+CREATE TABLE `phones` (
+ `ID` text NOT NULL,
+ `UpdatedInDB` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ `InsertIntoDB` timestamp NOT NULL default '0000-00-00 00:00:00',
+ `TimeOut` timestamp NOT NULL default '0000-00-00 00:00:00',
+ `Send` enum('yes','no') NOT NULL default 'no',
+ `Receive` enum('yes','no') NOT NULL default 'no',
+ `IMEI` varchar(35) NOT NULL,
+ `IMSI` varchar(35) NOT NULL,
+ `NetCode` varchar(10) default 'ERROR',
+ `NetName` varchar(35) default 'ERROR',
+ `Client` text NOT NULL,
+ `Battery` integer NOT NULL DEFAULT -1,
+ `Signal` integer NOT NULL DEFAULT -1,
+ `Sent` int NOT NULL DEFAULT 0,
+ `Received` int NOT NULL DEFAULT 0,
+ PRIMARY KEY (`IMEI`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+
+--
+-- Dumping data for table `phones`
+--
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `sentitems`
+--
+
+CREATE TABLE `sentitems` (
+ `UpdatedInDB` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ `InsertIntoDB` timestamp NOT NULL default '0000-00-00 00:00:00',
+ `SendingDateTime` timestamp NOT NULL default '0000-00-00 00:00:00',
+ `DeliveryDateTime` timestamp NULL,
+ `Text` text NOT NULL,
+ `DestinationNumber` varchar(20) NOT NULL default '',
+ `Coding` enum('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression') NOT NULL default 'Default_No_Compression',
+ `UDH` text NOT NULL,
+ `SMSCNumber` varchar(20) NOT NULL default '',
+ `Class` integer NOT NULL default '-1',
+ `TextDecoded` text NOT NULL,
+ `ID` integer unsigned NOT NULL default '0',
+ `SenderID` varchar(255) NOT NULL,
+ `SequencePosition` integer NOT NULL default '1',
+ `Status` enum('SendingOK','SendingOKNoReport','SendingError','DeliveryOK','DeliveryFailed','DeliveryPending','DeliveryUnknown','Error') NOT NULL default 'SendingOK',
+ `StatusError` integer NOT NULL default '-1',
+ `TPMR` integer NOT NULL default '-1',
+ `RelativeValidity` integer NOT NULL default '-1',
+ `CreatorID` text NOT NULL,
+ `StatusCode` integer NOT NULL default '-1',
+ PRIMARY KEY (`ID`, `SequencePosition`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+
+CREATE INDEX sentitems_date ON sentitems(DeliveryDateTime);
+CREATE INDEX sentitems_tpmr ON sentitems(TPMR);
+CREATE INDEX sentitems_dest ON sentitems(DestinationNumber);
+CREATE INDEX sentitems_sender ON sentitems(SenderID(250));
+
+--
+-- Dumping data for table `sentitems`
+--
+
+
+--
+-- Triggers for setting default timestamps
+--
+
+DELIMITER //
+
+CREATE TRIGGER inbox_timestamp BEFORE INSERT ON inbox
+FOR EACH ROW
+BEGIN
+ IF NEW.ReceivingDateTime = '0000-00-00 00:00:00' THEN
+ SET NEW.ReceivingDateTime = CURRENT_TIMESTAMP();
+ END IF;
+END;//
+
+CREATE TRIGGER outbox_timestamp BEFORE INSERT ON outbox
+FOR EACH ROW
+BEGIN
+ IF NEW.InsertIntoDB = '0000-00-00 00:00:00' THEN
+ SET NEW.InsertIntoDB = CURRENT_TIMESTAMP();
+ END IF;
+ IF NEW.SendingDateTime = '0000-00-00 00:00:00' THEN
+ SET NEW.SendingDateTime = CURRENT_TIMESTAMP();
+ END IF;
+ IF NEW.SendingTimeOut = '0000-00-00 00:00:00' THEN
+ SET NEW.SendingTimeOut = CURRENT_TIMESTAMP();
+ END IF;
+END;//
+
+CREATE TRIGGER phones_timestamp BEFORE INSERT ON phones
+FOR EACH ROW
+BEGIN
+ IF NEW.InsertIntoDB = '0000-00-00 00:00:00' THEN
+ SET NEW.InsertIntoDB = CURRENT_TIMESTAMP();
+ END IF;
+ IF NEW.TimeOut = '0000-00-00 00:00:00' THEN
+ SET NEW.TimeOut = CURRENT_TIMESTAMP();
+ END IF;
+END;//
+
+CREATE TRIGGER sentitems_timestamp BEFORE INSERT ON sentitems
+FOR EACH ROW
+BEGIN
+ IF NEW.InsertIntoDB = '0000-00-00 00:00:00' THEN
+ SET NEW.InsertIntoDB = CURRENT_TIMESTAMP();
+ END IF;
+ IF NEW.SendingDateTime = '0000-00-00 00:00:00' THEN
+ SET NEW.SendingDateTime = CURRENT_TIMESTAMP();
+ END IF;
+END;//
+
+DELIMITER ;
+
diff --git a/docs/sql/pgsql.sql b/docs/sql/pgsql.sql
new file mode 100644
index 0000000..b549d11
--- /dev/null
+++ b/docs/sql/pgsql.sql
@@ -0,0 +1,270 @@
+--
+-- Database: "smsd"
+--
+-- CREATE USER "smsd" WITH NOCREATEDB NOCREATEUSER;
+-- CREATE DATABASE "smsd" WITH OWNER = "smsd" ENCODING = 'UTF8';
+-- \connect "smsd" "smsd"
+-- COMMENT ON DATABASE "smsd" IS 'Gammu SMSD Database';
+
+-- --------------------------------------------------------
+
+--
+-- Function declaration for updating timestamps
+--
+CREATE LANGUAGE plpgsql;
+CREATE OR REPLACE FUNCTION update_timestamp() RETURNS trigger AS $update_timestamp$
+ BEGIN
+ NEW."UpdatedInDB" := LOCALTIMESTAMP(0);
+ RETURN NEW;
+ END;
+$update_timestamp$ LANGUAGE plpgsql;
+
+-- --------------------------------------------------------
+
+--
+-- Sequence declarations for tables' primary keys
+--
+
+--CREATE SEQUENCE inbox_ID_seq;
+
+--CREATE SEQUENCE outbox_ID_seq;
+
+--CREATE SEQUENCE outbox_multipart_ID_seq;
+
+--CREATE SEQUENCE sentitems_ID_seq;
+
+-- --------------------------------------------------------
+
+--
+-- Index declarations for tables' primary keys
+--
+
+--CREATE UNIQUE INDEX inbox_pkey ON inbox USING btree ("ID");
+
+--CREATE UNIQUE INDEX outbox_pkey ON outbox USING btree ("ID");
+
+--CREATE UNIQUE INDEX outbox_multipart_pkey ON outbox_multipart USING btree ("ID");
+
+--CREATE UNIQUE INDEX sentitems_pkey ON sentitems USING btree ("ID");
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table "gammu"
+--
+
+CREATE TABLE gammu (
+ "Version" smallint NOT NULL DEFAULT '0' PRIMARY KEY
+);
+
+--
+-- Dumping data for table "gammu"
+--
+
+INSERT INTO gammu ("Version") VALUES (17);
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table "inbox"
+--
+
+CREATE TABLE inbox (
+ "UpdatedInDB" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0),
+ "ReceivingDateTime" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0),
+ "Text" text NOT NULL,
+ "SenderNumber" varchar(20) NOT NULL DEFAULT '',
+ "Coding" varchar(255) NOT NULL DEFAULT 'Default_No_Compression',
+ "UDH" text NOT NULL,
+ "SMSCNumber" varchar(20) NOT NULL DEFAULT '',
+ "Class" integer NOT NULL DEFAULT '-1',
+ "TextDecoded" text NOT NULL DEFAULT '',
+ "ID" serial PRIMARY KEY,
+ "RecipientID" text NOT NULL,
+ "Processed" boolean NOT NULL DEFAULT 'false',
+ "Status" integer NOT NULL DEFAULT '-1',
+ CHECK ("Coding" IN
+ ('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression'))
+);
+
+--
+-- Dumping data for table "inbox"
+--
+
+-- --------------------------------------------------------
+
+--
+-- Create trigger for table "inbox"
+--
+
+CREATE TRIGGER update_timestamp BEFORE UPDATE ON inbox FOR EACH ROW EXECUTE PROCEDURE update_timestamp();
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table "outbox"
+--
+
+CREATE TABLE outbox (
+ "UpdatedInDB" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0),
+ "InsertIntoDB" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0),
+ "SendingDateTime" timestamp NOT NULL DEFAULT LOCALTIMESTAMP(0),
+ "SendBefore" time NOT NULL DEFAULT '23:59:59',
+ "SendAfter" time NOT NULL DEFAULT '00:00:00',
+ "Text" text,
+ "DestinationNumber" varchar(20) NOT NULL DEFAULT '',
+ "Coding" varchar(255) NOT NULL DEFAULT 'Default_No_Compression',
+ "UDH" text,
+ "Class" integer DEFAULT '-1',
+ "TextDecoded" text NOT NULL DEFAULT '',
+ "ID" serial PRIMARY KEY,
+ "MultiPart" boolean NOT NULL DEFAULT 'false',
+ "RelativeValidity" integer DEFAULT '-1',
+ "SenderID" varchar(255),
+ "SendingTimeOut" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0),
+ "DeliveryReport" varchar(10) DEFAULT 'default',
+ "CreatorID" text NOT NULL,
+ "Retries" integer DEFAULT '0',
+ "Priority" integer DEFAULT '0',
+ "Status" varchar(255) NOT NULL DEFAULT 'Reserved',
+ "StatusCode" integer NOT NULL DEFAULT '-1',
+ CHECK ("Coding" IN
+ ('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression')),
+ CHECK ("DeliveryReport" IN ('default','yes','no')),
+ CHECK ("Status" IN
+ ('SendingOK','SendingOKNoReport','SendingError','DeliveryOK','DeliveryFailed','DeliveryPending',
+ 'DeliveryUnknown','Error','Reserved'))
+);
+
+CREATE INDEX outbox_date ON outbox("SendingDateTime", "SendingTimeOut");
+CREATE INDEX outbox_sender ON outbox("SenderID");
+
+--
+-- Dumping data for table "outbox"
+--
+
+-- --------------------------------------------------------
+
+--
+-- Create trigger for table "outbox"
+--
+
+CREATE TRIGGER update_timestamp BEFORE UPDATE ON outbox FOR EACH ROW EXECUTE PROCEDURE update_timestamp();
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table "outbox_multipart"
+--
+
+CREATE TABLE outbox_multipart (
+ "Text" text,
+ "Coding" varchar(255) NOT NULL DEFAULT 'Default_No_Compression',
+ "UDH" text,
+ "Class" integer DEFAULT '-1',
+ "TextDecoded" text DEFAULT NULL,
+ "ID" serial,
+ "SequencePosition" integer NOT NULL DEFAULT '1',
+ "Status" varchar(255) NOT NULL DEFAULT 'Reserved',
+ "StatusCode" integer NOT NULL DEFAULT '-1',
+ PRIMARY KEY ("ID", "SequencePosition"),
+ CHECK ("Coding" IN
+ ('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression')),
+ CHECK ("Status" IN
+ ('SendingOK','SendingOKNoReport','SendingError','DeliveryOK','DeliveryFailed','DeliveryPending',
+ 'DeliveryUnknown','Error','Reserved'))
+);
+
+--
+-- Dumping data for table "outbox_multipart"
+--
+
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table "phones"
+--
+
+CREATE TABLE phones (
+ "ID" text NOT NULL,
+ "UpdatedInDB" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0),
+ "InsertIntoDB" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0),
+ "TimeOut" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0),
+ "Send" boolean NOT NULL DEFAULT 'no',
+ "Receive" boolean NOT NULL DEFAULT 'no',
+ "IMEI" varchar(35) PRIMARY KEY NOT NULL,
+ "IMSI" varchar(35) NOT NULL,
+ "NetCode" varchar(10) DEFAULT 'ERROR',
+ "NetName" varchar(35) DEFAULT 'ERROR',
+ "Client" text NOT NULL,
+ "Battery" integer NOT NULL DEFAULT -1,
+ "Signal" integer NOT NULL DEFAULT -1,
+ "Sent" integer NOT NULL DEFAULT 0,
+ "Received" integer NOT NULL DEFAULT 0
+);
+
+--
+-- Dumping data for table "phones"
+--
+
+-- --------------------------------------------------------
+
+--
+-- Create trigger for table "phones"
+--
+
+CREATE TRIGGER update_timestamp BEFORE UPDATE ON phones FOR EACH ROW EXECUTE PROCEDURE update_timestamp();
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table "sentitems"
+--
+
+CREATE TABLE sentitems (
+ "UpdatedInDB" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0),
+ "InsertIntoDB" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0),
+ "SendingDateTime" timestamp(0) WITHOUT time zone NOT NULL DEFAULT LOCALTIMESTAMP(0),
+ "DeliveryDateTime" timestamp(0) WITHOUT time zone NULL,
+ "Text" text NOT NULL,
+ "DestinationNumber" varchar(20) NOT NULL DEFAULT '',
+ "Coding" varchar(255) NOT NULL DEFAULT 'Default_No_Compression',
+ "UDH" text NOT NULL,
+ "SMSCNumber" varchar(20) NOT NULL DEFAULT '',
+ "Class" integer NOT NULL DEFAULT '-1',
+ "TextDecoded" text NOT NULL DEFAULT '',
+ "ID" serial,
+ "SenderID" varchar(255) NOT NULL,
+ "SequencePosition" integer NOT NULL DEFAULT '1',
+ "Status" varchar(255) NOT NULL DEFAULT 'SendingOK',
+ "StatusError" integer NOT NULL DEFAULT '-1',
+ "TPMR" integer NOT NULL DEFAULT '-1',
+ "RelativeValidity" integer NOT NULL DEFAULT '-1',
+ "CreatorID" text NOT NULL,
+ "StatusCode" integer NOT NULL DEFAULT '-1',
+ CHECK ("Status" IN
+ ('SendingOK','SendingOKNoReport','SendingError','DeliveryOK','DeliveryFailed','DeliveryPending',
+ 'DeliveryUnknown','Error')),
+ CHECK ("Coding" IN
+ ('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression')),
+ PRIMARY KEY ("ID", "SequencePosition")
+);
+
+CREATE INDEX sentitems_date ON sentitems("DeliveryDateTime");
+CREATE INDEX sentitems_tpmr ON sentitems("TPMR");
+CREATE INDEX sentitems_dest ON sentitems("DestinationNumber");
+CREATE INDEX sentitems_sender ON sentitems("SenderID");
+
+--
+-- Dumping data for table "sentitems"
+--
+
+-- --------------------------------------------------------
+
+--
+-- Create trigger for table "sentitems"
+--
+
+CREATE TRIGGER update_timestamp BEFORE UPDATE ON sentitems FOR EACH ROW EXECUTE PROCEDURE update_timestamp();
+
diff --git a/docs/sql/sqlite.sql b/docs/sql/sqlite.sql
new file mode 100644
index 0000000..cb05865
--- /dev/null
+++ b/docs/sql/sqlite.sql
@@ -0,0 +1,147 @@
+CREATE TABLE gammu (
+ Version INTEGER NOT NULL DEFAULT '0' PRIMARY KEY
+);
+
+INSERT INTO gammu (Version) VALUES (17);
+
+CREATE TABLE inbox (
+ UpdatedInDB NUMERIC NOT NULL DEFAULT (datetime('now')),
+ ReceivingDateTime NUMERIC NOT NULL DEFAULT (datetime('now')),
+ Text TEXT NOT NULL,
+ SenderNumber TEXT NOT NULL DEFAULT '',
+ Coding TEXT NOT NULL DEFAULT 'Default_No_Compression',
+ UDH TEXT NOT NULL,
+ SMSCNumber TEXT NOT NULL DEFAULT '',
+ Class INTEGER NOT NULL DEFAULT '-1',
+ TextDecoded TEXT NOT NULL DEFAULT '',
+ ID INTEGER PRIMARY KEY AUTOINCREMENT,
+ RecipientID TEXT NOT NULL,
+ Processed TEXT NOT NULL DEFAULT 'false',
+ Status INTEGER NOT NULL DEFAULT '-1',
+ CHECK (Coding IN
+ ('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression'))
+);
+
+CREATE TRIGGER update_inbox_time UPDATE ON inbox
+ BEGIN
+ UPDATE inbox SET UpdatedInDB = datetime('now') WHERE ID = old.ID;
+ END;
+
+CREATE TABLE outbox (
+ UpdatedInDB NUMERIC NOT NULL DEFAULT (datetime('now')),
+ InsertIntoDB NUMERIC NOT NULL DEFAULT (datetime('now')),
+ SendingDateTime NUMERIC NOT NULL DEFAULT (datetime('now')),
+ SendBefore time NOT NULL DEFAULT '23:59:59',
+ SendAfter time NOT NULL DEFAULT '00:00:00',
+ Text TEXT,
+ DestinationNumber TEXT NOT NULL DEFAULT '',
+ Coding TEXT NOT NULL DEFAULT 'Default_No_Compression',
+ UDH TEXT,
+ Class INTEGER DEFAULT '-1',
+ TextDecoded TEXT NOT NULL DEFAULT '',
+ ID INTEGER PRIMARY KEY AUTOINCREMENT,
+ MultiPart TEXT NOT NULL DEFAULT 'false',
+ RelativeValidity INTEGER DEFAULT '-1',
+ SenderID TEXT,
+ SendingTimeOut NUMERIC NOT NULL DEFAULT (datetime('now')),
+ DeliveryReport TEXT DEFAULT 'default',
+ CreatorID TEXT NOT NULL,
+ Retries INTEGER DEFAULT '0',
+ Priority INTEGER DEFAULT '0',
+ Status TEXT NOT NULL DEFAULT 'Reserved',
+ StatusCode INTEGER NOT NULL DEFAULT '-1',
+ CHECK (Coding IN
+ ('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression')),
+ CHECK (DeliveryReport IN ('default','yes','no')),
+ CHECK (Status IN
+ ('SendingOK','SendingOKNoReport','SendingError','DeliveryOK','DeliveryFailed','DeliveryPending',
+ 'DeliveryUnknown','Error','Reserved'))
+);
+
+CREATE INDEX outbox_date ON outbox(SendingDateTime, SendingTimeOut);
+CREATE INDEX outbox_sender ON outbox(SenderID);
+
+CREATE TRIGGER update_outbox_time UPDATE ON outbox
+ BEGIN
+ UPDATE outbox SET UpdatedInDB = datetime('now') WHERE ID = old.ID;
+ END;
+
+CREATE TABLE outbox_multipart (
+ Text TEXT,
+ Coding TEXT NOT NULL DEFAULT 'Default_No_Compression',
+ UDH TEXT,
+ Class INTEGER DEFAULT '-1',
+ TextDecoded TEXT DEFAULT NULL,
+ ID INTEGER,
+ SequencePosition INTEGER NOT NULL DEFAULT '1',
+ Status TEXT NOT NULL DEFAULT 'Reserved',
+ StatusCode INTEGER NOT NULL DEFAULT '-1',
+ CHECK (Coding IN
+ ('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression')),
+ CHECK (Status IN
+ ('SendingOK','SendingOKNoReport','SendingError','DeliveryOK','DeliveryFailed','DeliveryPending',
+ 'DeliveryUnknown','Error','Reserved')),
+ PRIMARY KEY (ID, SequencePosition)
+);
+
+CREATE TABLE phones (
+ ID TEXT NOT NULL,
+ UpdatedInDB NUMERIC NOT NULL DEFAULT (datetime('now')),
+ InsertIntoDB NUMERIC NOT NULL DEFAULT (datetime('now')),
+ TimeOut NUMERIC NOT NULL DEFAULT (datetime('now')),
+ Send TEXT NOT NULL DEFAULT 'no',
+ Receive TEXT NOT NULL DEFAULT 'no',
+ IMEI TEXT PRIMARY KEY NOT NULL,
+ IMSI TEXT NOT NULL,
+ NetCode TEXT DEFAULT 'ERROR',
+ NetName TEXT DEFAULT 'ERROR',
+ Client TEXT NOT NULL,
+ Battery INTEGER NOT NULL DEFAULT -1,
+ Signal INTEGER NOT NULL DEFAULT -1,
+ Sent INTEGER NOT NULL DEFAULT 0,
+ Received INTEGER NOT NULL DEFAULT 0
+);
+
+CREATE TRIGGER update_phones_time UPDATE ON phones
+ BEGIN
+ UPDATE phones SET UpdatedInDB = datetime('now') WHERE IMEI = old.IMEI;
+ END;
+
+CREATE TABLE sentitems (
+ UpdatedInDB NUMERIC NOT NULL DEFAULT (datetime('now')),
+ InsertIntoDB NUMERIC NOT NULL DEFAULT (datetime('now')),
+ SendingDateTime NUMERIC NOT NULL DEFAULT (datetime('now')),
+ DeliveryDateTime NUMERIC NULL,
+ Text TEXT NOT NULL,
+ DestinationNumber TEXT NOT NULL DEFAULT '',
+ Coding TEXT NOT NULL DEFAULT 'Default_No_Compression',
+ UDH TEXT NOT NULL,
+ SMSCNumber TEXT NOT NULL DEFAULT '',
+ Class INTEGER NOT NULL DEFAULT '-1',
+ TextDecoded TEXT NOT NULL DEFAULT '',
+ ID INTEGER,
+ SenderID TEXT NOT NULL,
+ SequencePosition INTEGER NOT NULL DEFAULT '1',
+ Status TEXT NOT NULL DEFAULT 'SendingOK',
+ StatusError INTEGER NOT NULL DEFAULT '-1',
+ TPMR INTEGER NOT NULL DEFAULT '-1',
+ RelativeValidity INTEGER NOT NULL DEFAULT '-1',
+ CreatorID TEXT NOT NULL,
+ StatusCode INTEGER NOT NULL DEFAULT '-1',
+ CHECK (Status IN
+ ('SendingOK','SendingOKNoReport','SendingError','DeliveryOK','DeliveryFailed','DeliveryPending',
+ 'DeliveryUnknown','Error')),
+ CHECK (Coding IN
+ ('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression')) ,
+ PRIMARY KEY (ID, SequencePosition)
+);
+
+CREATE INDEX sentitems_date ON sentitems(DeliveryDateTime);
+CREATE INDEX sentitems_tpmr ON sentitems(TPMR);
+CREATE INDEX sentitems_dest ON sentitems(DestinationNumber);
+CREATE INDEX sentitems_sender ON sentitems(SenderID);
+
+CREATE TRIGGER update_sentitems_time UPDATE ON sentitems
+ BEGIN
+ UPDATE sentitems SET UpdatedInDB = datetime('now') WHERE ID = old.ID;
+ END;