15 #include <gammu-types.h>
16 #include <gammu-error.h>
17 #include <gammu-limits.h>
20 * Find network name from given network code.
24 const unsigned char *GSM_GetNetworkName(const char *NetworkCode
);
27 * Find country name from given country code.
31 const unsigned char *GSM_GetCountryName(const char *CountryCode
);
34 * Structure for defining code-name mappings.
44 * List of network codes, terminated by empty name/code.
48 extern const GSM_CodeName GSM_Networks
[];
51 * List of country codes, terminated by empty name/code.
55 extern const GSM_CodeName GSM_Countries
[];
58 * Status of network logging
64 * Home network for used SIM card.
68 * No network available for used SIM card.
72 * SIM card uses roaming.
76 * Network registration denied - card blocked or expired or disabled.
78 GSM_RegistrationDenied
,
80 * Unknown network status.
82 GSM_NetworkStatusUnknown
,
84 * Network explicitely requested by user.
87 } GSM_NetworkInfo_State
;
90 * Status of GPRS connection.
98 GSM_GPRS_Detached
= 1,
106 * Structure for getting the current network info.
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).
129 * Name of current network like returned from phone (or empty).
131 unsigned char NetworkName
[15 * 2];
137 * Cell ID (CID) for packet network
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.
152 * Information about signal quality, all these should be -1 when unknown.
158 * Signal strength in dBm
162 * Signal strength in percent.
166 * Bit error rate in percent.
178 * Powered from battery
180 GSM_BatteryPowered
= 1,
182 * Powered from AC, battery connected
184 GSM_BatteryConnected
,
186 * Powered from AC, battery is charging
190 * Powered from AC, no battery
192 GSM_BatteryNotConnected
,
194 * Powered from AC, battery is fully charged
212 GSM_BatteryUnknown
= 0,
218 * Lithium Ion battery
222 * Lithium Polymer battery
234 * Signal strength in percent, -1 = unknown
240 GSM_ChargeState ChargeState
;
242 * Current battery voltage (in mV).
246 * Voltage from charger (in mV)
250 * Current from charger (in mA)
254 * Phone current consumption (in mA)
258 * Battery temperature (in degrees Celsius)
260 int BatteryTemperature
;
262 * Phone temperature (in degrees Celsius)
264 int PhoneTemperature
;
266 * Remaining battery capacity (in mAh)
272 GSM_BatteryType BatteryType
;
291 } GSM_DisplayFeature
;
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.
312 * Calendar,3310 style - 10 reminders, Unicode, 3 coding types
316 * Calendar,5210 style - full Unicode, etc.
320 * Calendar,8250 style - "normal", but with Unicode
324 * Ringtones returned in SM format - 33xx
332 * No phonebook in Unicode
348 * No Picture Images text in Unicode
360 * Startup logo is not animated
364 * Network and battery level get from netmonitor
368 * Phone profiles in 3310 style
372 * Phone profiles in 5110 style
376 * Phone can make authentication with magic bytes
380 * Phone can't send DTMF
384 * Phone return display status
388 * Phone does not return call info
394 * Day and month reversed in pbk, when compare to GSM models
400 * Phonebook in 3510 style with ringtones ID
404 * Phonebook in 7250 style with picture ID
408 * Phonebook with selecting ringtones from gallery
412 * Phonebook with SMS list
416 * Phonebook with user ID
420 * Caller groups like in 6230i
424 * Phone with FM radio
428 * ToDo in 6310 style - 0x55 msg type
432 * ToDo in 6610 style - like calendar, with date and other
436 * No ringtones in MIDI
444 * No images, ringtones, java saved in special filesystem
448 * No MMS sets in phone
452 * GPRS point are not useable
456 * Calendar,3510 style - Reminder,Call,Birthday
460 * Calendar,6510 style - CBMM, method 3
464 * WAP & MMS settings contains first & second proxy
468 * Phone with Chat settings
472 * Phone with SyncML settings
476 * Filesystem version 2
480 * No filesystem version 1
484 * WAP, MMS, etc. settings like in 6230i - unknown now
488 * Profiles support available
496 * SMS are read from filesystem files like in Series 40 3.0
500 * MMS storage as in 3320
504 /* n6510.c && n7110.c */
506 * Voice tags available
510 * Calendar,6210 style - Call,Birthday,Memo,Meeting
520 * Phone supports only sent/unsent messages
524 * CPBS on some memories can hang phone
528 * Siemens M20 like SMS handling
532 * Use slower writing which some phone need
536 * SMS in ME start from location 900 - case of Sagem
540 * Phone supports Alcatel protocol
544 * Phone can switch to OBEX protocol from AT mode
548 * Phone supports IrMC level 2 even if it doesn't report it
552 * Switching to OBEX mode is done using AT+MODE=22
556 * Locations of SMS memories start from 0
560 * Phone does not support UCS2 even if it reports it.
564 * Phone returns strings in utf-8 even if it reports GSM.
568 * Phone supports SM storage for SMS even if it does not report
573 * Phone supports ME storage for SMS even if it does not report
578 * Switching to OBEX mode is done using AT+XLNK.
582 * Submit messages can be saved on SM memory only.
586 * Prefer Unicode for phone book manipulations.
590 * Switching to OBEX mode using AT^SQWE=3.
594 * Do not use OBEX/AT switching even if available.
598 * Length of text for contact is in bytes and not chars.
602 * CMGL does not list real locations for CMGR, these should be
607 * Phonebook has extra numeric field at the end.
611 * Key presses can not be in unicode.
615 * OBEX switching using AT+CPROT even if phone does not report
620 * Phonebook with favorite messaging numbers
622 F_PBKFAVORITEMESSAGE
,
624 * No support for postal entry in phonebook.
628 * Encode number in HEX charset.
632 * Do not use CLIP (phone hangs on it).
636 * USSD propmts and responses are encoded like PDU in SMS
637 * (packed 7-bit GSM encoding).
641 * Phone has better support for SMS text mode (rather than PDU mode)
645 * Phone does not end CPIN reply with OK/ERROR.
649 * Phone require four digit year in time.
653 * Phone does not have a phone SMS memory even if it reports so.
657 * Phone does not have a SIM SMS memory even if it reports so.
661 * Phone supports Siemens style phonebook even if it does not
666 * Disable AT+SYNCML probing.
670 * Phone supports m-obex (usually Samsung phones).
674 * Phone supports m-obex (usually Samsung phones) using AT$TSSPCSW=1.
678 * Disable GetNext* operations on the dummy phone.
682 * Disable GetNextSMS operations on the dummy phone.
684 F_DISABLE_GETNEXTSMS
,
686 * CMGL hangs, so should not be used.
690 * Phone does not support UTF8 even if it reports it.
694 * Samsung B2100 in UCS-2 mode provides a garbled UTF-8 instead.
698 * SMS text is always UTF-8 encoded.
702 * Avoid forcibly stopping CUSD session.
706 * Reading og SMSes in text mode.
711 * Just marker of highest feature code, should not be used.
717 * Converts feature value to string.
721 * \param feature GSM_Feature to convert.
723 * \return Pointer to static string with string for specified feature,
726 const char *GSM_FeatureToString(GSM_Feature feature
);
729 * Converts feature string to value.
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.
746 * Model as returned by phone
750 * Identification by Gammu
754 * Model as used over IrDA
756 const char *irdamodel
;
758 * List of supported features
760 GSM_Feature features
[GSM_MAX_PHONE_FEATURES
+ 1];
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.
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.
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.
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.
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.
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.
836 GSM_Error
GSM_GetFirmware(GSM_StateMachine
* s
, char *value
, char *date
,
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.
849 GSM_Error
GSM_GetIMEI(GSM_StateMachine
* s
, char *value
);
852 * Gets date and time from phone.
856 GSM_Error
GSM_GetOriginalIMEI(GSM_StateMachine
* s
, char *value
);
859 * Gets month when device was manufactured.
863 GSM_Error
GSM_GetManufactureMonth(GSM_StateMachine
* s
, char *value
);
866 * Gets product code of device.
870 GSM_Error
GSM_GetProductCode(GSM_StateMachine
* s
, char *value
);
873 * Gets hardware information about device.
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)
885 GSM_Error
GSM_GetPPM(GSM_StateMachine
* s
, char *value
);
888 * Gets SIM IMSI from phone.
892 GSM_Error
GSM_GetSIMIMSI(GSM_StateMachine
* s
, char *IMSI
);
895 * Gets information about batery charge and phone charging state.
899 GSM_Error
GSM_GetBatteryCharge(GSM_StateMachine
* s
, GSM_BatteryCharge
* bat
);
902 * Reads signal quality (strength and error rate).
906 GSM_Error
GSM_GetSignalQuality(GSM_StateMachine
* s
, GSM_SignalQuality
* sig
);
909 * Gets network information.
913 GSM_Error
GSM_GetNetworkInfo(GSM_StateMachine
* s
, GSM_NetworkInfo
* netinfo
);
916 * Acquired display status.
920 GSM_Error
GSM_GetDisplayStatus(GSM_StateMachine
* s
,
921 GSM_DisplayFeatures
* features
);
924 /* Editor configuration
925 * vim: noexpandtab sw=8 ts=8 sts=8 tw=72: