Translated using Weblate.
[gammu.git] / include / gammu-info.h
blob33011a04e58fbda6e9fb28340a840bf9de19098c
1 /**
2 * \file gammu-info.h
3 * \author Michal Čihař
5 * Phone information.
6 */
7 #ifndef __gammu_info_h
8 #define __gammu_info_h
10 /**
11 * \defgroup Info Info
12 * Phone information.
15 #include <gammu-types.h>
16 #include <gammu-error.h>
17 #include <gammu-limits.h>
19 /**
20 * Find network name from given network code.
22 * \ingroup Info
24 const unsigned char *GSM_GetNetworkName(const char *NetworkCode);
26 /**
27 * Find country name from given country code.
29 * \ingroup Info
31 const unsigned char *GSM_GetCountryName(const char *CountryCode);
33 /**
34 * Structure for defining code-name mappings.
36 * \ingroup Info
38 typedef struct {
39 const char Code[8];
40 const char Name[64];
41 } GSM_CodeName;
43 /**
44 * List of network codes, terminated by empty name/code.
46 * \ingroup Info
48 extern const GSM_CodeName GSM_Networks[];
50 /**
51 * List of country codes, terminated by empty name/code.
53 * \ingroup Info
55 extern const GSM_CodeName GSM_Countries[];
57 /**
58 * Status of network logging
60 * \ingroup Info
62 typedef enum {
63 /**
64 * Home network for used SIM card.
66 GSM_HomeNetwork = 1,
67 /**
68 * No network available for used SIM card.
70 GSM_NoNetwork,
71 /**
72 * SIM card uses roaming.
74 GSM_RoamingNetwork,
75 /**
76 * Network registration denied - card blocked or expired or disabled.
78 GSM_RegistrationDenied,
79 /**
80 * Unknown network status.
82 GSM_NetworkStatusUnknown,
83 /**
84 * Network explicitely requested by user.
86 GSM_RequestingNetwork
87 } GSM_NetworkInfo_State;
89 /**
90 * Status of GPRS connection.
92 * \ingroup Info
94 typedef enum {
95 /**
96 * GRPS is detached.
98 GSM_GPRS_Detached = 1,
99 /**
100 * GRPS is attached.
102 GSM_GPRS_Attached
103 } GSM_GPRS_State;
106 * Structure for getting the current network info.
108 * \ingroup Info
110 typedef struct {
112 * Cell ID (CID)
114 char CID[10];
116 * GSM network code.
118 char NetworkCode[10];
120 * Status of network logging. If phone is not logged into any network,
121 * some values are not filled
123 GSM_NetworkInfo_State State;
125 * LAC (Local Area Code).
127 char LAC[10];
129 * Name of current network like returned from phone (or empty).
131 unsigned char NetworkName[15 * 2];
133 * GPRS state.
135 GSM_GPRS_State GPRS;
137 * Cell ID (CID) for packet network
139 char PacketCID[10];
141 * Status of network logging for packet data. If phone is not logged into any network,
142 * some values are not filled
144 GSM_NetworkInfo_State PacketState;
146 * LAC (Local Area Code) for packet data.
148 char PacketLAC[10];
149 } GSM_NetworkInfo;
152 * Information about signal quality, all these should be -1 when unknown.
154 * \ingroup Info
156 typedef struct {
158 * Signal strength in dBm
160 int SignalStrength;
162 * Signal strength in percent.
164 int SignalPercent;
166 * Bit error rate in percent.
168 int BitErrorRate;
169 } GSM_SignalQuality;
172 * Power source
174 * \ingroup Info
176 typedef enum {
178 * Powered from battery
180 GSM_BatteryPowered = 1,
182 * Powered from AC, battery connected
184 GSM_BatteryConnected,
186 * Powered from AC, battery is charging
188 GSM_BatteryCharging,
190 * Powered from AC, no battery
192 GSM_BatteryNotConnected,
194 * Powered from AC, battery is fully charged
196 GSM_BatteryFull,
198 * Power failure
200 GSM_PowerFault
201 } GSM_ChargeState;
204 * Power source
206 * \ingroup Info
208 typedef enum {
210 * Unknown battery
212 GSM_BatteryUnknown = 0,
214 * NiMH battery
216 GSM_BatteryNiMH = 1,
218 * Lithium Ion battery
220 GSM_BatteryLiIon,
222 * Lithium Polymer battery
224 GSM_BatteryLiPol
225 } GSM_BatteryType;
228 * Battery status
230 * \ingroup Info
232 typedef struct {
234 * Signal strength in percent, -1 = unknown
236 int BatteryPercent;
238 * Charge state
240 GSM_ChargeState ChargeState;
242 * Current battery voltage (in mV).
244 int BatteryVoltage;
246 * Voltage from charger (in mV)
248 int ChargeVoltage;
250 * Current from charger (in mA)
252 int ChargeCurrent;
254 * Phone current consumption (in mA)
256 int PhoneCurrent;
258 * Battery temperature (in degrees Celsius)
260 int BatteryTemperature;
262 * Phone temperature (in degrees Celsius)
264 int PhoneTemperature;
266 * Remaining battery capacity (in mAh)
268 int BatteryCapacity;
270 * Battery type
272 GSM_BatteryType BatteryType;
273 } GSM_BatteryCharge;
276 * Display feature
278 * \ingroup Info
280 typedef enum {
281 GSM_CallActive = 1,
283 * blinking envelope
285 GSM_SMSMemoryFull,
286 GSM_FaxCall,
287 GSM_UnreadSMS,
288 GSM_DataCall,
289 GSM_VoiceCall,
290 GSM_KeypadLocked
291 } GSM_DisplayFeature;
294 * Display features
296 * \ingroup Info
298 typedef struct {
299 int Number;
300 GSM_DisplayFeature Feature[7];
301 } GSM_DisplayFeatures;
304 * Phone features definition. This is usually used for things, which can not
305 * be determined on run time.
307 * \ingroup Info
309 typedef enum {
310 /* n6110.c */
312 * Calendar,3310 style - 10 reminders, Unicode, 3 coding types
314 F_CAL33 = 1,
316 * Calendar,5210 style - full Unicode, etc.
318 F_CAL52,
320 * Calendar,8250 style - "normal", but with Unicode
322 F_CAL82,
324 * Ringtones returned in SM format - 33xx
326 F_RING_SM,
328 * No ringtones
330 F_NORING,
332 * No phonebook in Unicode
334 F_NOPBKUNICODE,
336 * No WAP
338 F_NOWAP,
340 * No caller groups
342 F_NOCALLER,
344 * No Picture Images
346 F_NOPICTURE,
348 * No Picture Images text in Unicode
350 F_NOPICTUREUNI,
352 * No startup logo
354 F_NOSTARTUP,
356 * No calendar
358 F_NOCALENDAR,
360 * Startup logo is not animated
362 F_NOSTARTANI,
364 * Network and battery level get from netmonitor
366 F_POWER_BATT,
368 * Phone profiles in 3310 style
370 F_PROFILES33,
372 * Phone profiles in 5110 style
374 F_PROFILES51,
376 * Phone can make authentication with magic bytes
378 F_MAGICBYTES,
380 * Phone can't send DTMF
382 F_NODTMF,
384 * Phone return display status
386 F_DISPSTATUS,
388 * Phone does not return call info
390 F_NOCALLINFO,
392 /* n3320.c */
394 * Day and month reversed in pbk, when compare to GSM models
396 F_DAYMONTH,
398 /* n6510.c */
400 * Phonebook in 3510 style with ringtones ID
402 F_PBK35,
404 * Phonebook in 7250 style with picture ID
406 F_PBKIMG,
408 * Phonebook with selecting ringtones from gallery
410 F_PBKTONEGAL,
412 * Phonebook with SMS list
414 F_PBKSMSLIST,
416 * Phonebook with user ID
418 F_PBKUSER,
420 * Caller groups like in 6230i
422 F_6230iCALLER,
424 * Phone with FM radio
426 F_RADIO,
428 * ToDo in 6310 style - 0x55 msg type
430 F_TODO63,
432 * ToDo in 6610 style - like calendar, with date and other
434 F_TODO66,
436 * No ringtones in MIDI
438 F_NOMIDI,
440 * Bluetooth support
442 F_BLUETOOTH,
444 * No images, ringtones, java saved in special filesystem
446 F_NOFILESYSTEM,
448 * No MMS sets in phone
450 F_NOMMS,
452 * GPRS point are not useable
454 F_NOGPRSPOINT,
456 * Calendar,3510 style - Reminder,Call,Birthday
458 F_CAL35,
460 * Calendar,6510 style - CBMM, method 3
462 F_CAL65,
464 * WAP & MMS settings contains first & second proxy
466 F_WAPMMSPROXY,
468 * Phone with Chat settings
470 F_CHAT,
472 * Phone with SyncML settings
474 F_SYNCML,
476 * Filesystem version 2
478 F_FILES2,
480 * No filesystem version 1
482 F_NOFILE1,
484 * WAP, MMS, etc. settings like in 6230i - unknown now
486 F_6230iWAP,
488 * Profiles support available
490 F_PROFILES,
492 * Series 40 3.0
494 F_SERIES40_30,
496 * SMS are read from filesystem files like in Series 40 3.0
498 F_SMS_FILES,
500 * MMS storage as in 3320
502 F_3220_MMS,
504 /* n6510.c && n7110.c */
506 * Voice tags available
508 F_VOICETAGS,
510 * Calendar,6210 style - Call,Birthday,Memo,Meeting
512 F_CAL62,
514 * Notes supported
516 F_NOTES,
518 /* AT modules */
520 * Phone supports only sent/unsent messages
522 F_SMSONLYSENT,
524 * CPBS on some memories can hang phone
526 F_BROKENCPBS,
528 * Siemens M20 like SMS handling
530 F_M20SMS,
532 * Use slower writing which some phone need
534 F_SLOWWRITE,
536 * SMS in ME start from location 900 - case of Sagem
538 F_SMSME900,
540 * Phone supports Alcatel protocol
542 F_ALCATEL,
544 * Phone can switch to OBEX protocol from AT mode
546 F_OBEX,
548 * Phone supports IrMC level 2 even if it doesn't report it
550 F_IRMC_LEVEL_2,
552 * Switching to OBEX mode is done using AT+MODE=22
554 F_MODE22,
556 * Locations of SMS memories start from 0
558 F_SMS_LOCATION_0,
560 * Phone does not support UCS2 even if it reports it.
562 F_NO_UCS2,
564 * Phone returns strings in utf-8 even if it reports GSM.
566 F_FORCE_UTF8,
568 * Phone supports SM storage for SMS even if it does not report
569 * so.
571 F_SMS_SM,
573 * Phone supports ME storage for SMS even if it does not report
574 * so.
576 F_SMS_ME,
578 * Switching to OBEX mode is done using AT+XLNK.
580 F_XLNK,
582 * Submit messages can be saved on SM memory only.
584 F_SUBMIT_SIM_ONLY,
586 * Prefer Unicode for phone book manipulations.
588 F_PBK_UNICODE,
590 * Switching to OBEX mode using AT^SQWE=3.
592 F_SQWE,
594 * Do not use OBEX/AT switching even if available.
596 F_NO_ATOBEX,
598 * Length of text for contact is in bytes and not chars.
600 F_LENGTH_BYTES,
602 * CMGL does not list real locations for CMGR, these should be
603 * sequential.
605 F_BROKEN_CMGL,
607 * Phonebook has extra numeric field at the end.
609 F_EXTRA_PBK_FIELD,
611 * Key presses can not be in unicode.
613 F_CKPD_NO_UNICODE,
615 * OBEX switching using AT+CPROT even if phone does not report
616 * it properly.
618 F_CPROT,
620 * Phonebook with favorite messaging numbers
622 F_PBKFAVORITEMESSAGE,
624 * No support for postal entry in phonebook.
626 F_PBKNOPOSTAL,
628 * Encode number in HEX charset.
630 F_PBK_ENCODENUMBER,
632 * Do not use CLIP (phone hangs on it).
634 F_NO_CLIP,
636 * USSD propmts and responses are encoded like PDU in SMS
637 * (packed 7-bit GSM encoding).
639 F_ENCODED_USSD,
641 * Phone has better support for SMS text mode (rather than PDU mode)
643 F_USE_SMSTEXTMODE,
645 * Phone does not end CPIN reply with OK/ERROR.
647 F_CPIN_NO_OK,
649 * Phone require four digit year in time.
651 F_FOUR_DIGIT_YEAR,
653 * Phone does not have a phone SMS memory even if it reports so.
655 F_SMS_NO_ME,
657 * Phone does not have a SIM SMS memory even if it reports so.
659 F_SMS_NO_SM,
661 * Phone supports Siemens style phonebook even if it does not
662 * tell so.
664 F_SIEMENS_PBK,
666 * Disable AT+SYNCML probing.
668 F_NO_ATSYNCML,
670 * Phone supports m-obex (usually Samsung phones).
672 F_MOBEX,
674 * Phone supports m-obex (usually Samsung phones) using AT$TSSPCSW=1.
676 F_TSSPCSW,
678 * Disable GetNext* operations on the dummy phone.
680 F_DISABLE_GETNEXT,
682 * Disable GetNextSMS operations on the dummy phone.
684 F_DISABLE_GETNEXTSMS,
686 * CMGL hangs, so should not be used.
688 F_DISABLE_CMGL,
690 * Phone does not support UTF8 even if it reports it.
692 F_NO_UTF8,
694 * Samsung B2100 in UCS-2 mode provides a garbled UTF-8 instead.
696 F_SAMSUNG_UTF8,
698 * SMS text is always UTF-8 encoded.
700 F_SMS_UTF8_ENCODED,
702 * Avoid forcibly stopping CUSD session.
704 F_NO_STOP_CUSD,
706 * Reading og SMSes in text mode.
708 F_READ_SMSTEXTMODE,
711 * Just marker of highest feature code, should not be used.
713 F_LAST_VALUE
714 } GSM_Feature;
717 * Converts feature value to string.
719 * \ingroup Info
721 * \param feature GSM_Feature to convert.
723 * \return Pointer to static string with string for specified feature,
724 * NULL on failure.
726 const char *GSM_FeatureToString(GSM_Feature feature);
729 * Converts feature string to value.
731 * \ingroup Info
733 * \param feature GSM_Feature string to convert.
735 * \return GSM_Feature value, 0 on failure.
737 GSM_Feature GSM_FeatureFromString(const char *feature);
740 * Model identification, used for finding phone features.
742 * \ingroup Info
744 typedef struct {
746 * Model as returned by phone
748 const char *model;
750 * Identification by Gammu
752 const char *number;
754 * Model as used over IrDA
756 const char *irdamodel;
758 * List of supported features
760 GSM_Feature features[GSM_MAX_PHONE_FEATURES + 1];
761 } GSM_PhoneModel;
764 * Checks whether phone supports features.
766 * \param model Model information (you can get it using \ref GSM_GetModelInfo).
767 * \param feature GSM_Feature to check for.
769 * \return True if phone has defined this feature.
771 * \ingroup Info
773 gboolean GSM_IsPhoneFeatureAvailable(GSM_PhoneModel * model, GSM_Feature feature);
776 * Adds feature to phone configuration.
778 * \param model Model information (you can get it using \ref GSM_GetModelInfo).
779 * \param feature GSM_Feature to check for.
781 * \return True if phone has defined this feature.
783 * \ingroup Info
785 gboolean GSM_AddPhoneFeature(GSM_PhoneModel * model, GSM_Feature feature);
787 #include <gammu-statemachine.h>
790 * Reads manufacturer from phone.
792 * \param s State machine pointer.
793 * \param value Pointer where to store manufacturer name
795 * \return Error code.
797 * \ingroup Info
799 GSM_Error GSM_GetManufacturer(GSM_StateMachine * s, char *value);
802 * Reads model from phone.
804 * \param s State machine pointer.
805 * \param value Pointer where to store model name
807 * \return Error code.
809 * \ingroup Info
811 GSM_Error GSM_GetModel(GSM_StateMachine * s, char *value);
814 * Reads model info from state machine.
816 * \param s State machine pointer.
818 * \return Pointer to phone information structure.
820 * \ingroup Info
822 GSM_PhoneModel *GSM_GetModelInfo(GSM_StateMachine * s);
825 * Reads firmware information from phone.
827 * \param s State machine pointer.
828 * \param value Pointer where to store revision text
829 * \param date Pointer where to store revision date
830 * \param num Pointer where to store revision number
832 * \return Error code.
834 * \ingroup Info
836 GSM_Error GSM_GetFirmware(GSM_StateMachine * s, char *value, char *date,
837 double *num);
840 * Reads IMEI/serial number from phone.
842 * \param s State machine pointer.
843 * \param value Pointer where to store IMEI, NULL to ignore.
845 * \return Error code.
847 * \ingroup Info
849 GSM_Error GSM_GetIMEI(GSM_StateMachine * s, char *value);
852 * Gets date and time from phone.
854 * \ingroup Info
856 GSM_Error GSM_GetOriginalIMEI(GSM_StateMachine * s, char *value);
859 * Gets month when device was manufactured.
861 * \ingroup Info
863 GSM_Error GSM_GetManufactureMonth(GSM_StateMachine * s, char *value);
866 * Gets product code of device.
868 * \ingroup Info
870 GSM_Error GSM_GetProductCode(GSM_StateMachine * s, char *value);
873 * Gets hardware information about device.
875 * \ingroup Info
877 GSM_Error GSM_GetHardware(GSM_StateMachine * s, char *value);
880 * Gets PPM (Post Programmable Memory) info from phone
881 * (in other words for Nokia get, which language pack is in phone)
883 * \ingroup Info
885 GSM_Error GSM_GetPPM(GSM_StateMachine * s, char *value);
888 * Gets SIM IMSI from phone.
890 * \ingroup Info
892 GSM_Error GSM_GetSIMIMSI(GSM_StateMachine * s, char *IMSI);
895 * Gets information about batery charge and phone charging state.
897 * \ingroup Info
899 GSM_Error GSM_GetBatteryCharge(GSM_StateMachine * s, GSM_BatteryCharge * bat);
902 * Reads signal quality (strength and error rate).
904 * \ingroup Info
906 GSM_Error GSM_GetSignalQuality(GSM_StateMachine * s, GSM_SignalQuality * sig);
909 * Gets network information.
911 * \ingroup Info
913 GSM_Error GSM_GetNetworkInfo(GSM_StateMachine * s, GSM_NetworkInfo * netinfo);
916 * Acquired display status.
918 * \ingroup Info
920 GSM_Error GSM_GetDisplayStatus(GSM_StateMachine * s,
921 GSM_DisplayFeatures * features);
922 #endif
924 /* Editor configuration
925 * vim: noexpandtab sw=8 ts=8 sts=8 tw=72: