File: gammu.rst

package info (click to toggle)
gammu 1.28.0-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 21,972 kB
  • ctags: 8,504
  • sloc: ansic: 104,965; pascal: 7,209; cpp: 4,023; python: 3,639; php: 1,622; sh: 1,534; sql: 450; cs: 260; makefile: 192; perl: 107; asm: 31
file content (1287 lines) | stat: -rw-r--r-- 33,369 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
: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: integer
      :param All: Answer all calls?
      :type All: boolean
      :return: None
      :rtype: None
      
   
   .. method:: CancelCall(ID, All)
      
      Deny current incoming call.

      :param ID: ID of call
      :type ID: integer
      :param All: Cancel all calls?
      :type All: boolean
      :return: None
      :rtype: None
      
   
   .. method:: ConferenceCall(ID)
      
      Initiates conference call.

      :param ID: ID of call
      :type ID: integer
      :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
      
   
   .. 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: boolean or None
      :return: None
      :rtype: None
      
   
   .. method:: EnterSecurityCode(Type, Code)
      
      Entres 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
      :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:: 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: boolean
      :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 shouldbe 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 andfree 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: boolean
      :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: boolean
      :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 shouldbe 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: boolean
      :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 fodlder. 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 befaster 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: boolean
      :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: boolean
      :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: integer
      :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 3.
      :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: boolean
      :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.
      
      :param Wait: Whether to wait, default is not to wait.
      :type Wait: boolean
      :return: Number of bytes read
      :rtype: int
      
   
   .. method:: Reset(Hard)
      
      Performs phone reset.
      
      :param Hard: Whether to make hard reset
      :type Hard: boolean
      :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 integer
      :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 integer
      :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: boolean
      :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:: 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: boolean
      :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: boolean
      :param Protected: Whether file is protected. Default to False.
      :type Protected: boolean
      :param System: Whether file is system. Default to False.
      :type System: boolean
      :param Hidden: Whether file is hidden. Default to False.
      :type Hidden: boolean
      :return: None
      :rtype: None
      
   
   .. method:: SetIncomingCB(Enable)
      
      Gets network information from phone.

      :type Enable: boolean
      :param Enable: Whether to enable notifications, default is True
      :return: None
      :rtype: None
      
   
   .. method:: SetIncomingCall(Enable)
      
      Activates/deactivates noticing about incoming calls.

      :type Enable: boolean
      :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.
      
      :param Callback: callback function or None for disabling
      :type Callback: function, it will get three params: StateMachine object, event type and it's data in dictionary
      :return: None
      :rtype: None
      
   
   .. method:: SetIncomingSMS(Enable)
      
      Enable/disable notification on incoming SMS.
      
      :type Enable: boolean
      :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: boolean
      :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: boolean
      :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: integer
      :return: None
      :rtype: None
      
   
   .. method:: SwitchCall(ID, Next)
      
      Switches call.

      :param ID: ID of call
      :type ID: integer
      :return: None
      :rtype: None
      
   
   .. method:: Terminate()
      
      Terminates the connection with phone.
      
      :return: None
      :rtype: None
      
   
   .. method:: TransferCall(ID, Next)
      
      Transfers call.

      :param ID: ID of call
      :type ID: integer
      :return: None
      :rtype: None
      
   
   .. method:: UnholdCall(ID)
      
      Unholds call.

      :param ID: ID of call
      :type ID: integer
      :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: boolean
    :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:: 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: boolean
    :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: Dictionary 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: boolean
    :return: Message data, see :ref:`sms_obj`
    :rtype: dict

.. 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 (default is AutoUnicode)
    :type Format: string (Auto, AutoUnicode, LMB, VCalendar, VCard, LDIF, ICS, Gammu, GammuUnicode)
    :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 (default is AutoUnicode)
    :type Format: string (Auto, AutoUnicode, LMB, VCalendar, VCard, LDIF, ICS, Gammu, GammuUnicode)
    :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