Gammu Manual Release 1.42.0 Michal Čihař
Total Page:16
File Type:pdf, Size:1020Kb
Gammu Manual Release 1.42.0 Michal Čihař <[email protected]> Sep 27, 2021 CONTENTS 1 Gammu project 1 1.1 About Gammu..............................................1 1.2 Motivation to fork Gnokii........................................1 1.3 Installing Gammu............................................2 1.4 Contributing............................................... 11 1.5 Localization............................................... 12 1.6 Testing.................................................. 13 1.7 Releasing Gammu............................................ 13 1.8 Coding Style............................................... 13 1.9 Versioning................................................ 14 1.10 Project Documentation.......................................... 14 1.11 Directory structure............................................ 15 1.12 Roadmap for Gammu........................................... 19 2 Quick starter guide 21 2.1 Gammu family.............................................. 21 2.2 Installing Gammu............................................ 21 2.3 Starting with Gammu on Linux..................................... 21 2.4 Starting with Gammu on Windows................................... 22 2.5 Starting with SMSD........................................... 22 3 Frequently Asked Questions 25 3.1 General Gammu FAQ.......................................... 25 3.2 Configuring Gammu FAQ........................................ 27 3.3 Phone Support FAQ........................................... 29 3.4 SMSD FAQ................................................ 30 3.5 Python-gammu FAQ........................................... 31 4 python-gammu 33 4.1 A taste of python-gammu........................................ 33 4.2 API documentation............................................ 37 5 libGammu 81 5.1 Hints for libGammu Novices....................................... 81 5.2 Examples................................................. 84 5.3 libGammu C API............................................. 99 5.4 Porting from libGammu older than 1.12.0................................ 207 6 Gammu internals 209 6.1 Reply functions.............................................. 209 6.2 State Machine.............................................. 211 i 6.3 Adding support for new phone...................................... 213 7 File formats used by Gammu 217 7.1 INI file format.............................................. 217 7.2 SMS Backup Format........................................... 217 7.3 Backup Format.............................................. 220 8 Gammu Configuration File 221 8.1 Synopsis................................................. 221 8.2 Description................................................ 221 8.3 Examples................................................. 226 9 Gammu Utility 233 9.1 Synopsis................................................. 233 9.2 Description................................................ 233 9.3 Return values............................................... 256 9.4 Examples................................................. 258 10 SMS Daemon 261 10.1 Overview................................................. 261 10.2 Usage................................................... 264 10.3 Program Manuals............................................. 265 10.4 SMSD Configuration File........................................ 271 10.5 RunOnReceive Directive......................................... 283 10.6 Backend services............................................. 286 10.7 Developer documentation........................................ 324 11 Miscellaneous utilities 329 11.1 gammu-detect.............................................. 329 11.2 gammu-config.............................................. 331 11.3 jadmaker................................................. 331 12 Testing Gammu 333 12.1 Gammu Testsuite............................................. 333 12.2 Dummy Driver.............................................. 335 13 Phone Protocols 339 13.1 Discovering protocol........................................... 339 13.2 Nokia protocols.............................................. 340 13.3 Nokia S40 filesystem SMS format.................................... 345 13.4 Nokia 6110................................................ 347 13.5 Nokia 6510................................................ 363 13.6 Nokia 7110................................................ 380 13.7 Nokia 6210/6310, CARC91, PC Experiment.............................. 395 13.8 TDMA 5120............................................... 406 13.9 SAMSUNG Organizer AT commands.................................. 408 13.10 SAMSUNG GT calendar AT commands................................. 412 13.11 Sonim AT Commands.......................................... 415 13.12 MTK AT Commands........................................... 416 13.13 m-obex protocol used by some Samsung mobiles............................ 417 13.14 Series60 Remote Protocol........................................ 424 13.15 Gnapplet Protocol............................................ 427 14 Glossary 429 ii Python Module Index 431 Index 433 iii iv CHAPTER ONE GAMMU PROJECT 1.1 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. 1.2 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 1 Gammu Manual, Release 1.42.0 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... 1.3 Installing Gammu 1.3.1 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 gammu.spec which you can use for building RPM package. 2 Chapter 1. Gammu project Gammu Manual, Release 1.42.0 Slackware Gammu packages are included in Gentoo. Additionally source tarball contains description-pak which you can use for building Slackware package. 1.3.2 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