1 /* (c) 2002-2004 by Marcin Wiacek & Michal Cihar */
6 * @author Marcin Wiacek
10 * \addtogroup StateMachine
20 #include <gammu-file.h>
21 #include <gammu-info.h>
22 #include <gammu-config.h>
23 #include <gammu-keys.h>
24 #include <gammu-security.h>
25 #include <gammu-callback.h>
26 #include <gammu-settings.h>
27 #include <gammu-misc.h>
28 #include <gammu-category.h>
29 #include <gammu-backup.h>
32 typedef struct _GSM_User GSM_User
;
34 #ifdef GSM_ENABLE_NOKIA3650
35 # include "phone/nokia/wd2/n3650.h"
37 #ifdef GSM_ENABLE_NOKIA650
38 # include "phone/nokia/dct3/n0650.h"
40 #ifdef GSM_ENABLE_NOKIA6110
41 # include "phone/nokia/dct3/n6110.h"
43 #ifdef GSM_ENABLE_NOKIA3320
44 # include "phone/nokia/dct4s40/n3320.h"
46 #ifdef GSM_ENABLE_NOKIA6510
47 # include "phone/nokia/dct4s40/6510/n6510.h"
49 #ifdef GSM_ENABLE_NOKIA7110
50 # include "phone/nokia/dct3/n7110.h"
52 #ifdef GSM_ENABLE_NOKIA9210
53 # include "phone/nokia/dct3/n9210.h"
55 #ifdef GSM_ENABLE_ATGEN
56 # include "phone/at/atgen.h"
58 #ifdef GSM_ENABLE_ALCATEL
59 # include "phone/alcatel/alcatel.h"
61 #ifdef GSM_ENABLE_ATOBEX
62 # include "phone/atobex/atobex.h"
64 #ifdef GSM_ENABLE_OBEXGEN
65 # include "phone/obex/obexgen.h"
67 #ifdef GSM_ENABLE_GNAPGEN
68 # include "phone/symbian/gnapgen.h"
71 # include "phone/s60/s60phone.h"
73 # include "phone/dummy/dummy.h"
75 #ifndef GSM_USED_MBUS2
76 # undef GSM_ENABLE_MBUS2
78 #ifndef GSM_USED_FBUS2
79 # undef GSM_ENABLE_FBUS2
81 #ifndef GSM_USED_FBUS2DLR3
82 # undef GSM_ENABLE_FBUS2DLR3
84 #ifndef GSM_USED_DKU2PHONET
85 # undef GSM_ENABLE_DKU2PHONET
87 #ifndef GSM_USED_DKU2AT
88 # undef GSM_ENABLE_DKU2AT
90 #ifndef GSM_USED_DKU5FBUS2
91 # undef GSM_ENABLE_DKU5FBUS2
93 #ifndef GSM_USED_FBUS2PL2303
94 # undef GSM_ENABLE_FBUS2PL2303
96 #ifndef GSM_USED_FBUS2BLUE
97 # undef GSM_ENABLE_FBUS2BLUE
99 #ifndef GSM_USED_FBUS2IRDA
100 # undef GSM_ENABLE_FBUS2IRDA
102 #ifndef GSM_USED_PHONETBLUE
103 # undef GSM_ENABLE_PHONETBLUE
106 # undef GSM_ENABLE_AT
108 #ifndef GSM_USED_ALCABUS
109 # undef GSM_ENABLE_ALCABUS
111 #ifndef GSM_USED_IRDAPHONET
112 # undef GSM_ENABLE_IRDAPHONET
114 #ifndef GSM_USED_IRDAAT
115 # undef GSM_ENABLE_IRDAAT
117 #ifndef GSM_USED_IRDAOBEX
118 # undef GSM_ENABLE_IRDAOBEX
120 #ifndef GSM_USED_BLUEFBUS2
121 # undef GSM_ENABLE_BLUEFBUS2
123 #ifndef GSM_USED_BLUEOBEX
124 # undef GSM_ENABLE_BLUEOBEX
126 #ifndef GSM_USED_BLUEPHONET
127 # undef GSM_ENABLE_BLUEPHONET
129 #ifndef GSM_USED_BLUEAT
130 # undef GSM_ENABLE_BLUEAT
132 #ifndef GSM_USED_BLUEGNAPBUS
133 # undef GSM_ENABLE_BLUEGNAPBUS
136 #include "protocol/protocol.h"
137 #if defined(GSM_ENABLE_FBUS2) || defined(GSM_ENABLE_FBUS2IRDA) || defined(GSM_ENABLE_FBUS2DLR3) || defined(GSM_ENABLE_FBUS2BLUE) || defined(GSM_ENABLE_BLUEFBUS2) || defined(GSM_ENABLE_DKU5FBUS2) || defined(GSM_ENABLE_FBUS2PL2303)
138 # include "protocol/nokia/fbus2.h"
140 #ifdef GSM_ENABLE_MBUS2
141 # include "protocol/nokia/mbus2.h"
143 #if defined(GSM_ENABLE_PHONETBLUE) || defined(GSM_ENABLE_IRDAPHONET) || defined(GSM_ENABLE_BLUEPHONET) || defined(GSM_ENABLE_DKU2PHONET)
144 # include "protocol/nokia/phonet.h"
146 #if defined(GSM_ENABLE_AT) || defined(GSM_ENABLE_BLUEAT) || defined(GSM_ENABLE_IRDAAT) || defined(GSM_ENABLE_DKU2AT)
147 # include "protocol/at/at.h"
149 #ifdef GSM_ENABLE_ALCABUS
150 # include "protocol/alcatel/alcabus.h"
152 #if defined(GSM_ENABLE_IRDAOBEX) || defined(GSM_ENABLE_BLUEOBEX) || defined(GSM_ENABLE_ATOBEX)
153 # include "protocol/obex/obex.h"
155 #if defined(GSM_ENABLE_BLUEGNAPBUS) || defined(GSM_ENABLE_IRDAGNAPBUS)
156 # include "protocol/symbian/gnapbus.h"
158 #if defined(GSM_ENABLE_S60)
159 # include "protocol/s60/s60.h"
162 #define GSM_ENABLE_SERIALDEVICE
163 #ifndef GSM_USED_SERIALDEVICE
164 # undef GSM_ENABLE_SERIALDEVICE
167 #define GSM_ENABLE_USBDEVICE
169 #ifndef GSM_USED_USBDEVICE
170 # undef GSM_ENABLE_USBDEVICE
172 #define GSM_ENABLE_IRDADEVICE
173 #ifndef GSM_USED_IRDADEVICE
174 # undef GSM_ENABLE_IRDADEVICE
176 #if defined(BLUEZ_FOUND) || defined(BSD_BLUE_FOUND) || defined(OSX_BLUE_FOUND) || defined(WIN32)
177 # define GSM_ENABLE_BLUETOOTHDEVICE
179 #ifndef GSM_USED_BLUETOOTHDEVICE
180 # undef GSM_ENABLE_BLUETOOTHDEVICE
184 # undef GSM_ENABLE_IRDADEVICE
185 # undef GSM_ENABLE_IRDAPHONET
186 # undef GSM_ENABLE_IRDAOBEX
187 # undef GSM_ENABLE_IRDAAT
188 # undef GSM_ENABLE_IRDAGNAPBUS
189 # undef GSM_ENABLE_DKU2AT
190 # undef GSM_ENABLE_FBUS2IRDA
191 # undef GSM_ENABLE_BLUETOOTHDEVICE
192 # undef GSM_ENABLE_BLUEPHONET
193 # undef GSM_ENABLE_BLUEOBEX
194 # undef GSM_ENABLE_BLUEAT
195 # undef GSM_ENABLE_BLUEFBUS2
196 # undef GSM_ENABLE_BLUEGNAPBUS
197 # undef GSM_ENABLE_PHONETBLUE
198 # undef GSM_ENABLE_FBUS2BLUE
201 #ifdef GSM_ENABLE_SERIALDEVICE
202 # include "device/serial/ser_w32.h"
203 # include "device/serial/ser_unx.h"
204 # include "device/serial/ser_djg.h"
206 #ifdef GSM_ENABLE_USBDEVICE
207 # include "device/usb/usb.h"
209 #ifdef GSM_ENABLE_IRDADEVICE
210 # include "device/irda/irda.h"
212 #ifdef GSM_ENABLE_BLUETOOTHDEVICE
213 # include "device/bluetoth/bluetoth.h"
217 #include "gsmreply.h"
220 /* ------------------------- Device layer ---------------------------------- */
223 * Device functions, each device has to provide these.
229 GSM_Error (*OpenDevice
) (GSM_StateMachine
*s
);
233 GSM_Error (*CloseDevice
) (GSM_StateMachine
*s
);
235 * Sets parity for device.
237 GSM_Error (*DeviceSetParity
) (GSM_StateMachine
*s
, gboolean parity
);
239 * Sets dtr (data to read) and rts (ready to send) flags.
241 GSM_Error (*DeviceSetDtrRts
) (GSM_StateMachine
*s
, gboolean dtr
, gboolean rts
);
245 GSM_Error (*DeviceSetSpeed
) (GSM_StateMachine
*s
, int speed
);
247 * Attempts to read nbytes from device.
249 int (*ReadDevice
) (GSM_StateMachine
*s
, void *buf
, size_t nbytes
);
251 * Attempts to read nbytes from device.
253 int (*WriteDevice
) (GSM_StateMachine
*s
, const void *buf
, size_t nbytes
);
254 } GSM_Device_Functions
;
256 #ifdef GSM_ENABLE_SERIALDEVICE
258 * Serial device functions.
260 extern GSM_Device_Functions SerialDevice
;
262 #ifdef GSM_ENABLE_IRDADEVICE
264 * IrDA device functions.
266 extern GSM_Device_Functions IrdaDevice
;
268 #ifdef GSM_ENABLE_BLUETOOTHDEVICE
270 * Bluetooth device functions.
272 extern GSM_Device_Functions BlueToothDevice
;
274 #ifdef GSM_ENABLE_USBDEVICE
276 * Serial device functions.
278 extern GSM_Device_Functions FBUSUSBDevice
;
282 * Structure containing device specific data and pointer to device functions -
283 * @ref GSM_Device_Functions. The data are in a union, so you can use only
284 * one device at one time.
289 * Fake memeber to ensure union has always at least one member.
292 #ifdef GSM_ENABLE_SERIALDEVICE
294 * Data for serial port device.
296 GSM_Device_SerialData Serial
;
298 #ifdef GSM_ENABLE_IRDADEVICE
300 * Data for IrDA port device.
302 GSM_Device_IrdaData Irda
;
304 #ifdef GSM_ENABLE_BLUETOOTHDEVICE
306 * Data for Bluetooth port device.
308 GSM_Device_BlueToothData BlueTooth
;
310 #ifdef GSM_ENABLE_USBDEVICE
312 * Data for libusb-1.0 backend.
314 GSM_Device_USBData USB
;
318 * Functions for currently used device.
320 GSM_Device_Functions
*Functions
;
323 /* ---------------------- Protocol layer ----------------------------------- */
326 * Protocol functions, each protocol has to implement these.
330 * Writes message to device.
332 GSM_Error (*WriteMessage
) (GSM_StateMachine
*s
, unsigned const char *buffer
,
333 int length
, int type
);
335 * This one is called when character is received from device.
337 GSM_Error (*StateMachine
) (GSM_StateMachine
*s
, unsigned char rx_char
);
339 * Protocol initialisation.
341 GSM_Error (*Initialise
) (GSM_StateMachine
*s
);
343 * Protocol termination.
345 GSM_Error (*Terminate
) (GSM_StateMachine
*s
);
346 } GSM_Protocol_Functions
;
348 #ifdef GSM_ENABLE_MBUS2
349 extern GSM_Protocol_Functions MBUS2Protocol
;
351 #if defined(GSM_ENABLE_FBUS2) || defined(GSM_ENABLE_FBUS2IRDA) || defined(GSM_ENABLE_FBUS2DLR3) || defined(GSM_ENABLE_DKU5FBUS2) || defined(GSM_ENABLE_FBUS2BLUE) || defined(GSM_ENABLE_BLUEFBUS2) || defined(GSM_ENABLE_FBUS2PL2303)
352 extern GSM_Protocol_Functions FBUS2Protocol
;
354 #if defined(GSM_ENABLE_PHONETBLUE) || defined(GSM_ENABLE_IRDAPHONET) || defined(GSM_ENABLE_BLUEPHONET) || defined(GSM_ENABLE_DKU2PHONET)
355 extern GSM_Protocol_Functions PHONETProtocol
;
357 #if defined(GSM_ENABLE_AT) || defined(GSM_ENABLE_BLUEAT) || defined(GSM_ENABLE_IRDAAT) || defined(GSM_ENABLE_DKU2AT)
358 extern GSM_Protocol_Functions ATProtocol
;
360 #ifdef GSM_ENABLE_ALCABUS
361 extern GSM_Protocol_Functions ALCABUSProtocol
;
363 #if defined(GSM_ENABLE_IRDAOBEX) || defined(GSM_ENABLE_BLUEOBEX) || defined(GSM_ENABLE_ATOBEX)
364 extern GSM_Protocol_Functions OBEXProtocol
;
366 #if defined(GSM_ENABLE_BLUEGNAPBUS) || defined(GSM_ENABLE_IRDAGNAPBUS)
367 extern GSM_Protocol_Functions GNAPBUSProtocol
;
369 #if defined(GSM_ENABLE_S60)
370 extern GSM_Protocol_Functions S60Protocol
;
374 * Structure containing protocol specific data and pointer to protocol
375 * functions - @ref GSM_Protocol_Functions. The data are in a structure, so
376 * you may use more protocols at once and switch between them.
381 #ifdef GSM_ENABLE_MBUS2
382 GSM_Protocol_MBUS2Data MBUS2
;
384 #if defined(GSM_ENABLE_FBUS2) || defined(GSM_ENABLE_FBUS2IRDA) || defined(GSM_ENABLE_FBUS2DLR3) || defined(GSM_ENABLE_DKU5FBUS2) || defined(GSM_ENABLE_FBUS2PL2303) || defined(GSM_ENABLE_FBUS2BLUE) || defined(GSM_ENABLE_BLUEFBUS2)
385 GSM_Protocol_FBUS2Data FBUS2
;
387 #if defined(GSM_ENABLE_PHONETBLUE) || defined(GSM_ENABLE_IRDAPHONET) || defined(GSM_ENABLE_BLUEPHONET) || defined(GSM_ENABLE_DKU2PHONET)
388 GSM_Protocol_PHONETData PHONET
;
390 #if defined(GSM_ENABLE_AT) || defined(GSM_ENABLE_BLUEAT) || defined(GSM_ENABLE_IRDAAT) || defined(GSM_ENABLE_DKU2AT)
391 GSM_Protocol_ATData AT
;
393 #ifdef GSM_ENABLE_ALCABUS
394 GSM_Protocol_ALCABUSData ALCABUS
;
396 #if defined(GSM_ENABLE_IRDAOBEX) || defined(GSM_ENABLE_BLUEOBEX) || defined(GSM_ENABLE_ATOBEX)
397 GSM_Protocol_OBEXData OBEX
;
399 #if defined(GSM_ENABLE_BLUEGNAPBUS) || defined(GSM_ENABLE_IRDAGNAPBUS)
400 GSM_Protocol_GNAPBUSData GNAPBUS
;
402 #if defined(GSM_ENABLE_S60)
403 GSM_Protocol_S60Data S60
;
407 * Functions for currently used protocol layer.
409 GSM_Protocol_Functions
*Functions
;
412 /* -------------------------- Phone layer ---------------------------------- */
416 * Phone related data are stored here.
420 * Phone IMEI (or serial number).
422 char IMEI
[GSM_MAX_IMEI_LENGTH
+ 1];
424 * Phone manufacturer as reported by phone.
426 char Manufacturer
[GSM_MAX_MANUFACTURER_LENGTH
+ 1];
428 * Phone model as reported by phone.
430 char Model
[GSM_MAX_MODEL_LENGTH
+ 1];
432 * Model information, pointer to static @ref allmodels array.
434 GSM_PhoneModel
*ModelInfo
;
436 * Phone version as reported by phone. It doesn't have to be numerical
439 char Version
[GSM_MAX_VERSION_LENGTH
+ 1];
441 * Phone version date, might be empty for some models.
443 char VerDate
[GSM_MAX_VERSION_DATE_LENGTH
+ 1];
445 * Phone version as number, if applicable.
449 * Cache for hardware version used by some modules.
451 char HardwareCache
[50];
453 * Cache for product code version used by some modules.
455 char ProductCodeCache
[50];
458 * Counter used for disabling startup info on phone, see
459 * @ref GSM_Phone_Functions::ShowStartInfo . After this is 0, the startup info is hidden.
461 int StartInfoCounter
;
464 * Pointer to structure used internally by phone drivers.
466 GSM_GPRSAccessPoint
*GPRSPoint
;
468 * Pointer to structure used internally by phone drivers.
470 GSM_SpeedDial
*SpeedDial
;
472 * Pointer to structure used internally by phone drivers.
474 GSM_DateTime
*DateTime
;
476 * Pointer to structure used internally by phone drivers.
480 * Pointer to structure used internally by phone drivers.
482 GSM_MemoryEntry
*Memory
;
484 * Pointer to structure used internally by phone drivers.
486 GSM_MemoryStatus
*MemoryStatus
;
488 * Pointer to structure used internally by phone drivers.
492 * Pointer to structure used internally by phone drivers.
494 GSM_MultiSMSMessage
*GetSMSMessage
;
496 * Pointer to structure used internally by phone drivers.
498 GSM_SMSMessage
*SaveSMSMessage
;
500 * Pointer to structure used internally by phone drivers.
502 GSM_SMSMemoryStatus
*SMSStatus
;
504 * Pointer to structure used internally by phone drivers.
506 GSM_SMSFolders
*SMSFolders
;
508 * Used internally by phone drivers.
512 * Used internally by phone drivers.
516 * Pointer to structure used internally by phone drivers.
518 GSM_SignalQuality
*SignalQuality
;
520 * Pointer to structure used internally by phone drivers.
522 GSM_BatteryCharge
*BatteryCharge
;
524 * Pointer to structure used internally by phone drivers.
526 GSM_NetworkInfo
*NetworkInfo
;
528 * Pointer to structure used internally by phone drivers.
530 GSM_Ringtone
*Ringtone
;
532 * Pointer to structure used internally by phone drivers.
534 GSM_CalendarEntry
*Cal
;
538 GSM_CalendarStatus
*CalStatus
;
542 GSM_ToDoStatus
*ToDoStatus
;
544 * Used internally by phone drivers.
546 unsigned char *SecurityCode
;
548 * Pointer to structure used internally by phone drivers.
550 GSM_WAPBookmark
*WAPBookmark
;
552 * Pointer to structure used internally by phone drivers.
554 GSM_MultiWAPSettings
*WAPSettings
;
556 * Pointer to structure used internally by phone drivers.
560 * Used internally by phone drivers.
562 unsigned char *Netmonitor
;
564 * Pointer to call diversion structure used internally by phone drivers.
566 GSM_MultiCallDivert
*Divert
;
568 * Pointer to todo structure used internally by phone drivers.
572 * Pointer to note structure used internally by phone drivers.
576 * Pointer to picture structure used internally by phone drivers.
578 GSM_BinaryPicture
*Picture
;
580 * Used internally by phone drivers.
584 * Pointer to structure used internally by phone drivers.
586 GSM_SecurityCodeType
*SecurityStatus
;
588 * Pointer to structure used internally by phone drivers.
590 GSM_Profile
*Profile
;
592 * Pointer to structure used internally by phone drivers.
594 GSM_AllRingtonesInfo
*RingtonesInfo
;
596 * Pointer to structure used internally by phone drivers.
598 GSM_DisplayFeatures
*DisplayFeatures
;
600 * Pointer to structure used internally by phone drivers.
602 GSM_FMStation
*FMStation
;
604 * Pointer to structure used internally by phone drivers.
608 * Pointer to structure used internally by phone drivers.
610 GSM_CalendarSettings
*CalendarSettings
;
612 * Used internally by phone drivers.
614 unsigned char *PhoneString
;
617 * Used internally by phone drivers.
619 int StartPhoneString
;
621 * Pointer to structure used internally by phone drivers.
625 * Pointer to structure used internally by phone drivers.
629 * Pointer to structure used internally by phone drivers.
631 GSM_FileSystemStatus
*FileSystemStatus
;
633 * Pointer to structure used internally by phone drivers.
635 GSM_ChatSettings
*ChatSettings
;
637 * Pointer to structure used internally by phone drivers.
639 GSM_SyncMLSettings
*SyncMLSettings
;
642 * Should phone notify about incoming calls?
644 gboolean EnableIncomingCall
;
646 * Should phone notify about incoming SMSes?
648 gboolean EnableIncomingSMS
;
650 * Should phone notify about incoming CBs?
652 gboolean EnableIncomingCB
;
654 * Should phone notify about incoming USSDs?
656 gboolean EnableIncomingUSSD
;
659 * Last message received from phone.
661 GSM_Protocol_Message
*RequestMsg
;
663 * Last message sent by Gammu.
665 GSM_Protocol_Message
*SentMsg
;
667 * What operation is being performed now, see @ref GSM_Phone_RequestID
668 * for possible values.
670 GSM_Phone_RequestID RequestID
;
672 * Error returned by function in phone module.
674 GSM_Error DispatchError
;
677 * Structure with private phone modules data.
680 #ifdef GSM_ENABLE_NOKIA3320
681 GSM_Phone_N3320Data N3320
;
683 #ifdef GSM_ENABLE_NOKIA3650
684 GSM_Phone_N3650Data N3650
;
686 #ifdef GSM_ENABLE_NOKIA650
687 GSM_Phone_N650Data N650
;
689 #ifdef GSM_ENABLE_NOKIA6110
690 GSM_Phone_N6110Data N6110
;
692 #ifdef GSM_ENABLE_NOKIA6510
693 GSM_Phone_N6510Data N6510
;
695 #ifdef GSM_ENABLE_NOKIA7110
696 GSM_Phone_N7110Data N7110
;
698 #ifdef GSM_ENABLE_ATGEN
699 GSM_Phone_ATGENData ATGEN
;
701 #ifdef GSM_ENABLE_ALCATEL
702 GSM_Phone_ALCATELData ALCATEL
;
704 #ifdef GSM_ENABLE_ATOBEX
705 GSM_Phone_ATOBEXData ATOBEX
;
707 #ifdef GSM_ENABLE_OBEXGEN
708 GSM_Phone_OBEXGENData OBEXGEN
;
710 #ifdef GSM_ENABLE_GNAPGEN
711 GSM_Phone_GNAPGENData GNAPGEN
;
713 #ifdef GSM_ENABLE_S60
714 GSM_Phone_S60Data S60
;
716 GSM_Phone_DUMMYData DUMMY
;
721 * Structure defining phone functions.
725 * Names of supported models separated by |. Must contain at least one
730 * Array of reply functions for the phone, see
731 * @ref GSM_Reply_Function for details about it.
733 GSM_Reply_Function
*ReplyFunctions
;
735 * Installs required applets to the phone.
737 GSM_Error (*Install
) (GSM_StateMachine
*s
, const char *ExtraPath
, gboolean Minimal
);
741 GSM_Error (*Initialise
) (GSM_StateMachine
*s
);
743 * Terminates phone communication.
745 GSM_Error (*Terminate
) (GSM_StateMachine
*s
);
747 * Dispatches messages from phone, at the end it should call
748 * @ref GSM_DispatchMessage.
750 GSM_Error (*DispatchMessage
) (GSM_StateMachine
*s
);
752 * Enables showing information on phone display.
754 GSM_Error (*ShowStartInfo
) (GSM_StateMachine
*s
, gboolean enable
);
756 * Reads manufacturer from phone.
758 GSM_Error (*GetManufacturer
) (GSM_StateMachine
*s
);
760 * Reads model from phone.
762 GSM_Error (*GetModel
) (GSM_StateMachine
*s
);
764 * Reads firmware information from phone.
766 GSM_Error (*GetFirmware
) (GSM_StateMachine
*s
);
768 * Reads IMEI/serial number from phone.
770 GSM_Error (*GetIMEI
) (GSM_StateMachine
*s
);
772 * Gets date and time from phone.
774 GSM_Error (*GetOriginalIMEI
) (GSM_StateMachine
*s
, char *value
);
776 * Gets month when device was manufactured.
778 GSM_Error (*GetManufactureMonth
)(GSM_StateMachine
*s
, char *value
);
780 * Gets product code of device.
782 GSM_Error (*GetProductCode
) (GSM_StateMachine
*s
, char *value
);
784 * Gets hardware information about device.
786 GSM_Error (*GetHardware
) (GSM_StateMachine
*s
, char *value
);
788 * Gets PPM (Post Programmable Memory) info from phone
789 * (in other words for Nokia get, which language pack is in phone)
791 GSM_Error (*GetPPM
) (GSM_StateMachine
*s
, char *value
);
793 * Gets SIM IMSI from phone.
795 GSM_Error (*GetSIMIMSI
) (GSM_StateMachine
*s
, char *IMSI
);
797 * Reads date and time from phone.
799 GSM_Error (*GetDateTime
) (GSM_StateMachine
*s
, GSM_DateTime
*date_time
);
801 * Sets date and time in phone.
803 GSM_Error (*SetDateTime
) (GSM_StateMachine
*s
, GSM_DateTime
*date_time
);
805 * Reads alarm set in phone.
807 GSM_Error (*GetAlarm
) (GSM_StateMachine
*s
, GSM_Alarm
*Alarm
);
809 * Sets alarm in phone.
811 GSM_Error (*SetAlarm
) (GSM_StateMachine
*s
, GSM_Alarm
*Alarm
);
813 * Gets locale from phone.
815 GSM_Error (*GetLocale
) (GSM_StateMachine
*s
, GSM_Locale
*locale
);
817 * Sets locale of phone.
819 GSM_Error (*SetLocale
) (GSM_StateMachine
*s
, GSM_Locale
*locale
);
821 * Emulates key press or key release.
823 GSM_Error (*PressKey
) (GSM_StateMachine
*s
, GSM_KeyCode Key
, gboolean Press
);
825 * Performs phone reset.
827 GSM_Error (*Reset
) (GSM_StateMachine
*s
, gboolean hard
);
829 * Resets phone settings.
831 GSM_Error (*ResetPhoneSettings
) (GSM_StateMachine
*s
, GSM_ResetSettingsType Type
);
833 * Enters security code (PIN, PUK,...) .
835 GSM_Error (*EnterSecurityCode
) (GSM_StateMachine
*s
, GSM_SecurityCode
*Code
);
837 * Queries whether some security code needs to be entered./
839 GSM_Error (*GetSecurityStatus
) (GSM_StateMachine
*s
, GSM_SecurityCodeType
*Status
);
841 * Acquired display status.
843 GSM_Error (*GetDisplayStatus
) (GSM_StateMachine
*s
, GSM_DisplayFeatures
*features
);
845 * Enables network auto login.
847 GSM_Error (*SetAutoNetworkLogin
)(GSM_StateMachine
*s
);
849 * Gets information about batery charge and phone charging state.
851 GSM_Error (*GetBatteryCharge
) (GSM_StateMachine
*s
, GSM_BatteryCharge
*bat
);
853 * Reads signal quality (strength and error rate).
855 GSM_Error (*GetSignalQuality
) (GSM_StateMachine
*s
, GSM_SignalQuality
*sig
);
857 * Gets network information.
859 GSM_Error (*GetNetworkInfo
) (GSM_StateMachine
*s
, GSM_NetworkInfo
*netinfo
);
861 * Reads category from phone.
863 GSM_Error (*GetCategory
) (GSM_StateMachine
*s
, GSM_Category
*Category
);
865 * Adds category to phone.
867 GSM_Error (*AddCategory
) (GSM_StateMachine
*s
, GSM_Category
*Category
);
869 * Reads category status (number of used entries) from phone.
871 GSM_Error (*GetCategoryStatus
) (GSM_StateMachine
*s
, GSM_CategoryStatus
*Status
);
873 * Gets memory (phonebooks or calls) status (eg. number of used and
876 GSM_Error (*GetMemoryStatus
) (GSM_StateMachine
*s
, GSM_MemoryStatus
*status
);
878 * Reads entry from memory (phonebooks or calls). Which entry should
879 * be read is defined in entry.
881 GSM_Error (*GetMemory
) (GSM_StateMachine
*s
, GSM_MemoryEntry
*entry
);
883 * Reads entry from memory (phonebooks or calls). Which entry should
884 * be read is defined in entry. This can be easily used for reading all entries.
886 GSM_Error (*GetNextMemory
) (GSM_StateMachine
*s
, GSM_MemoryEntry
*entry
, gboolean start
);
888 * Sets memory (phonebooks or calls) entry.
890 GSM_Error (*SetMemory
) (GSM_StateMachine
*s
, GSM_MemoryEntry
*entry
);
892 * Deletes memory (phonebooks or calls) entry.
894 GSM_Error (*AddMemory
) (GSM_StateMachine
*s
, GSM_MemoryEntry
*entry
);
896 * Deletes memory (phonebooks or calls) entry.
898 GSM_Error (*DeleteMemory
) (GSM_StateMachine
*s
, GSM_MemoryEntry
*entry
);
900 * Deletes all memory (phonebooks or calls) entries of specified type.
902 GSM_Error (*DeleteAllMemory
) (GSM_StateMachine
*s
, GSM_MemoryType MemoryType
);
906 GSM_Error (*GetSpeedDial
) (GSM_StateMachine
*s
, GSM_SpeedDial
*Speed
);
910 GSM_Error (*SetSpeedDial
) (GSM_StateMachine
*s
, GSM_SpeedDial
*Speed
);
912 * Gets SMS Service Center number and SMS settings.
914 GSM_Error (*GetSMSC
) (GSM_StateMachine
*s
, GSM_SMSC
*smsc
);
916 * Sets SMS Service Center number and SMS settings.
918 GSM_Error (*SetSMSC
) (GSM_StateMachine
*s
, GSM_SMSC
*smsc
);
920 * Gets information about SMS memory (read/unread/size of memory for
921 * both SIM and phone).
923 GSM_Error (*GetSMSStatus
) (GSM_StateMachine
*s
, GSM_SMSMemoryStatus
*status
);
927 GSM_Error (*GetSMS
) (GSM_StateMachine
*s
, GSM_MultiSMSMessage
*sms
);
929 * Reads next (or first if start set) SMS message. This might be
930 * faster for some phones than using @ref GetSMS for each message.
932 GSM_Error (*GetNextSMS
) (GSM_StateMachine
*s
, GSM_MultiSMSMessage
*sms
, gboolean start
);
936 GSM_Error (*SetSMS
) (GSM_StateMachine
*s
, GSM_SMSMessage
*sms
);
938 * Adds SMS to specified folder.
940 GSM_Error (*AddSMS
) (GSM_StateMachine
*s
, GSM_SMSMessage
*sms
);
944 GSM_Error (*DeleteSMS
) (GSM_StateMachine
*s
, GSM_SMSMessage
*sms
);
948 GSM_Error (*SendSMS
) (GSM_StateMachine
*s
, GSM_SMSMessage
*sms
);
950 * Sends SMS already saved in phone.
952 GSM_Error (*SendSavedSMS
) (GSM_StateMachine
*s
, int Folder
, int Location
);
954 * Configures fast SMS sending.
956 GSM_Error (*SetFastSMSSending
) (GSM_StateMachine
*s
, gboolean enable
);
958 * Enable/disable notification on incoming SMS.
960 GSM_Error (*SetIncomingSMS
) (GSM_StateMachine
*s
, gboolean enable
);
962 * Gets network information from phone.
964 GSM_Error (*SetIncomingCB
) (GSM_StateMachine
*s
, gboolean enable
);
966 * Returns SMS folders information.
968 GSM_Error (*GetSMSFolders
) (GSM_StateMachine
*s
, GSM_SMSFolders
*folders
);
970 * Creates SMS folder.
972 GSM_Error (*AddSMSFolder
) (GSM_StateMachine
*s
, unsigned char *name
);
974 * Deletes SMS folder.
976 GSM_Error (*DeleteSMSFolder
) (GSM_StateMachine
*s
, int ID
);
978 * Dials number and starts voice call.
980 GSM_Error (*DialVoice
) (GSM_StateMachine
*s
, char *Number
, GSM_CallShowNumber ShowNumber
);
982 * Dials service number (usually for USSD).
984 GSM_Error (*DialService
) (GSM_StateMachine
*s
, char *Number
);
986 * Accept current incoming call.
988 GSM_Error (*AnswerCall
) (GSM_StateMachine
*s
, int ID
, gboolean all
);
990 * Deny current incoming call.
992 GSM_Error (*CancelCall
) (GSM_StateMachine
*s
, int ID
, gboolean all
);
996 GSM_Error (*HoldCall
) (GSM_StateMachine
*s
, int ID
);
1000 GSM_Error (*UnholdCall
) (GSM_StateMachine
*s
, int ID
);
1002 * Initiates conference call.
1004 GSM_Error (*ConferenceCall
) (GSM_StateMachine
*s
, int ID
);
1008 GSM_Error (*SplitCall
) (GSM_StateMachine
*s
, int ID
);
1012 GSM_Error (*TransferCall
) (GSM_StateMachine
*s
, int ID
, gboolean next
);
1016 GSM_Error (*SwitchCall
) (GSM_StateMachine
*s
, int ID
, gboolean next
);
1018 * Gets call diverts.
1020 GSM_Error (*GetCallDivert
) (GSM_StateMachine
*s
, GSM_CallDivert
*request
, GSM_MultiCallDivert
*result
);
1022 * Sets call diverts.
1024 GSM_Error (*SetCallDivert
) (GSM_StateMachine
*s
, GSM_CallDivert
*divert
);
1026 * Cancels all diverts.
1028 GSM_Error (*CancelAllDiverts
) (GSM_StateMachine
*s
);
1030 * Activates/deactivates noticing about incoming calls.
1032 GSM_Error (*SetIncomingCall
) (GSM_StateMachine
*s
, gboolean enable
);
1034 * Activates/deactivates noticing about incoming USSDs (UnStructured Supplementary Services).
1036 GSM_Error (*SetIncomingUSSD
) (GSM_StateMachine
*s
, gboolean enable
);
1038 * Sends DTMF (Dual Tone Multi Frequency) tone.
1040 GSM_Error (*SendDTMF
) (GSM_StateMachine
*s
, char *sequence
);
1042 * Gets ringtone from phone.
1044 GSM_Error (*GetRingtone
) (GSM_StateMachine
*s
, GSM_Ringtone
*Ringtone
, gboolean PhoneRingtone
);
1046 * Sets ringtone in phone.
1048 GSM_Error (*SetRingtone
) (GSM_StateMachine
*s
, GSM_Ringtone
*Ringtone
, int *maxlength
);
1050 * Acquires ringtone informaiton.
1052 GSM_Error (*GetRingtonesInfo
) (GSM_StateMachine
*s
, GSM_AllRingtonesInfo
*Info
);
1054 * Deletes user defined ringtones from phone.
1056 GSM_Error (*DeleteUserRingtones
)(GSM_StateMachine
*s
);
1060 GSM_Error (*PlayTone
) (GSM_StateMachine
*s
, int Herz
, unsigned char Volume
, gboolean start
);
1062 * Reads WAP bookmark.
1064 GSM_Error (*GetWAPBookmark
) (GSM_StateMachine
*s
, GSM_WAPBookmark
*bookmark
);
1066 * Sets WAP bookmark.
1068 GSM_Error (*SetWAPBookmark
) (GSM_StateMachine
*s
, GSM_WAPBookmark
*bookmark
);
1070 * Deletes WAP bookmark.
1072 GSM_Error (*DeleteWAPBookmark
) (GSM_StateMachine
*s
, GSM_WAPBookmark
*bookmark
);
1074 * Acquires WAP settings.
1076 GSM_Error (*GetWAPSettings
) (GSM_StateMachine
*s
, GSM_MultiWAPSettings
*settings
);
1078 * Changes WAP settings.
1080 GSM_Error (*SetWAPSettings
) (GSM_StateMachine
*s
, GSM_MultiWAPSettings
*settings
);
1082 * Acquires SyncML settings.
1084 GSM_Error (*GetSyncMLSettings
) (GSM_StateMachine
*s
, GSM_SyncMLSettings
*settings
);
1086 * Changes SyncML settings.
1088 GSM_Error (*SetSyncMLSettings
) (GSM_StateMachine
*s
, GSM_SyncMLSettings
*settings
);
1090 * Acquires chat/presence settings.
1092 GSM_Error (*GetChatSettings
) (GSM_StateMachine
*s
, GSM_ChatSettings
*settings
);
1094 * Changes chat/presence settings.
1096 GSM_Error (*SetChatSettings
) (GSM_StateMachine
*s
, GSM_ChatSettings
*settings
);
1098 * Acquires MMS settings.
1100 GSM_Error (*GetMMSSettings
) (GSM_StateMachine
*s
, GSM_MultiWAPSettings
*settings
);
1102 * Changes MMS settings.
1104 GSM_Error (*SetMMSSettings
) (GSM_StateMachine
*s
, GSM_MultiWAPSettings
*settings
);
1106 * Lists MMS folders.
1108 GSM_Error (*GetMMSFolders
) (GSM_StateMachine
*s
, GSM_MMSFolders
*folders
);
1110 * Retrieves next part of MMS file information.
1112 GSM_Error (*GetNextMMSFileInfo
) (GSM_StateMachine
*s
, unsigned char *FileID
, int *MMSFolder
, gboolean start
);
1116 GSM_Error (*GetBitmap
) (GSM_StateMachine
*s
, GSM_Bitmap
*Bitmap
);
1120 GSM_Error (*SetBitmap
) (GSM_StateMachine
*s
, GSM_Bitmap
*Bitmap
);
1122 * Gets status of ToDos (count of used entries).
1124 GSM_Error (*GetToDoStatus
) (GSM_StateMachine
*s
, GSM_ToDoStatus
*status
);
1126 * Reads ToDo from phone.
1128 GSM_Error (*GetToDo
) (GSM_StateMachine
*s
, GSM_ToDoEntry
*ToDo
);
1130 * Reads ToDo from phone.
1132 GSM_Error (*GetNextToDo
) (GSM_StateMachine
*s
, GSM_ToDoEntry
*ToDo
, gboolean start
);
1134 * Sets ToDo in phone.
1136 GSM_Error (*SetToDo
) (GSM_StateMachine
*s
, GSM_ToDoEntry
*ToDo
);
1138 * Adds ToDo in phone.
1140 GSM_Error (*AddToDo
) (GSM_StateMachine
*s
, GSM_ToDoEntry
*ToDo
);
1142 * Deletes ToDo entry in phone.
1144 GSM_Error (*DeleteToDo
) (GSM_StateMachine
*s
, GSM_ToDoEntry
*ToDo
);
1146 * Deletes all todo entries in phone.
1148 GSM_Error (*DeleteAllToDo
) (GSM_StateMachine
*s
);
1150 * Retrieves calendar status (number of used entries).
1152 GSM_Error (*GetCalendarStatus
) (GSM_StateMachine
*s
, GSM_CalendarStatus
*Status
);
1154 * Retrieves calendar entry.
1156 GSM_Error (*GetCalendar
) (GSM_StateMachine
*s
, GSM_CalendarEntry
*Note
);
1158 * Retrieves calendar entry. This is useful for continuous reading of all
1161 GSM_Error (*GetNextCalendar
) (GSM_StateMachine
*s
, GSM_CalendarEntry
*Note
, gboolean start
);
1163 * Sets calendar entry
1165 GSM_Error (*SetCalendar
) (GSM_StateMachine
*s
, GSM_CalendarEntry
*Note
);
1167 * Adds calendar entry.
1169 GSM_Error (*AddCalendar
) (GSM_StateMachine
*s
, GSM_CalendarEntry
*Note
);
1171 * Deletes calendar entry.
1173 GSM_Error (*DeleteCalendar
) (GSM_StateMachine
*s
, GSM_CalendarEntry
*Note
);
1175 * Deletes all calendar entries.
1177 GSM_Error (*DeleteAllCalendar
) (GSM_StateMachine
*s
);
1179 * Reads calendar settings.
1181 GSM_Error (*GetCalendarSettings
)(GSM_StateMachine
*s
, GSM_CalendarSettings
*settings
);
1183 * Sets calendar settings.
1185 GSM_Error (*SetCalendarSettings
)(GSM_StateMachine
*s
, GSM_CalendarSettings
*settings
);
1187 * Retrieves notes status (number of used entries).
1189 GSM_Error (*GetNotesStatus
) (GSM_StateMachine
*s
, GSM_ToDoStatus
*status
);
1191 * Retrieves notes entry.
1193 GSM_Error (*GetNote
) (GSM_StateMachine
*s
, GSM_NoteEntry
*Note
);
1195 * Retrieves note entry. This is useful for continuous reading of all
1198 GSM_Error (*GetNextNote
) (GSM_StateMachine
*s
, GSM_NoteEntry
*Note
, gboolean start
);
1202 GSM_Error (*SetNote
) (GSM_StateMachine
*s
, GSM_NoteEntry
*Note
);
1206 GSM_Error (*AddNote
) (GSM_StateMachine
*s
, GSM_NoteEntry
*Note
);
1208 * Deletes note entry.
1210 GSM_Error (*DeleteNote
) (GSM_StateMachine
*s
, GSM_NoteEntry
*Note
);
1212 * Deletes all notes entries.
1214 GSM_Error (*DeleteAllNotes
) (GSM_StateMachine
*s
);
1218 GSM_Error (*GetProfile
) (GSM_StateMachine
*s
, GSM_Profile
*Profile
);
1222 GSM_Error (*SetProfile
) (GSM_StateMachine
*s
, GSM_Profile
*Profile
);
1226 GSM_Error (*GetFMStation
) (GSM_StateMachine
*s
, GSM_FMStation
*FMStation
);
1230 GSM_Error (*SetFMStation
) (GSM_StateMachine
*s
, GSM_FMStation
*FMStation
);
1232 * Clears defined FM stations.
1234 GSM_Error (*ClearFMStations
) (GSM_StateMachine
*s
);
1236 * Gets next filename from filesystem.
1238 GSM_Error (*GetNextFileFolder
) (GSM_StateMachine
*s
, GSM_File
*File
, gboolean start
);
1240 * Gets file part from filesystem.
1242 GSM_Error (*GetFolderListing
) (GSM_StateMachine
*s
, GSM_File
*File
, gboolean start
);
1244 * Gets next root folder.
1246 GSM_Error (*GetNextRootFolder
) (GSM_StateMachine
*s
, GSM_File
*File
);
1248 * Sets file system attributes.
1250 GSM_Error (*SetFileAttributes
) (GSM_StateMachine
*s
, GSM_File
*File
);
1252 * Retrieves file part.
1254 GSM_Error (*GetFilePart
) (GSM_StateMachine
*s
, GSM_File
*File
, int *Handle
, int *Size
);
1256 * Adds file part to filesystem.
1258 GSM_Error (*AddFilePart
) (GSM_StateMachine
*s
, GSM_File
*File
, int *Pos
, int *Handle
);
1260 * Sends file to phone, it's up to phone to decide what to do with it.
1262 GSM_Error (*SendFilePart
) (GSM_StateMachine
*s
, GSM_File
*File
, int *Pos
, int *Handle
);
1264 * Acquires filesystem status.
1266 GSM_Error (*GetFileSystemStatus
)(GSM_StateMachine
*s
, GSM_FileSystemStatus
*Status
);
1268 * Deletes file from filessytem.
1270 GSM_Error (*DeleteFile
) (GSM_StateMachine
*s
, unsigned char *ID
);
1272 * Adds folder to filesystem.
1274 GSM_Error (*AddFolder
) (GSM_StateMachine
*s
, GSM_File
*File
);
1276 * Deletes folder from filesystem.
1278 GSM_Error (*DeleteFolder
) (GSM_StateMachine
*s
, unsigned char *ID
);
1280 * Gets GPRS access point.
1282 GSM_Error (*GetGPRSAccessPoint
) (GSM_StateMachine
*s
, GSM_GPRSAccessPoint
*point
);
1284 * Sets GPRS access point.
1286 GSM_Error (*SetGPRSAccessPoint
) (GSM_StateMachine
*s
, GSM_GPRSAccessPoint
*point
);
1288 * Gets phone screenshot
1290 GSM_Error (*GetScreenshot
) (GSM_StateMachine
*s
, GSM_BinaryPicture
*picture
);
1291 } GSM_Phone_Functions
;
1293 extern GSM_Phone_Functions NAUTOPhone
;
1294 #ifdef GSM_ENABLE_NOKIA3320
1295 extern GSM_Phone_Functions N3320Phone
;
1297 #ifdef GSM_ENABLE_NOKIA3650
1298 extern GSM_Phone_Functions N3650Phone
;
1300 #ifdef GSM_ENABLE_NOKIA6110
1301 extern GSM_Phone_Functions N6110Phone
;
1303 #ifdef GSM_ENABLE_NOKIA650
1304 extern GSM_Phone_Functions N650Phone
;
1306 #ifdef GSM_ENABLE_NOKIA6510
1307 extern GSM_Phone_Functions N6510Phone
;
1309 #ifdef GSM_ENABLE_NOKIA7110
1310 extern GSM_Phone_Functions N7110Phone
;
1312 #ifdef GSM_ENABLE_NOKIA9210
1313 extern GSM_Phone_Functions N9210Phone
;
1315 #ifdef GSM_ENABLE_ATGEN
1316 extern GSM_Phone_Functions ATGENPhone
;
1318 #ifdef GSM_ENABLE_ALCATEL
1319 extern GSM_Phone_Functions ALCATELPhone
;
1321 #ifdef GSM_ENABLE_ATOBEX
1322 extern GSM_Phone_Functions ATOBEXPhone
;
1324 #ifdef GSM_ENABLE_OBEXGEN
1325 extern GSM_Phone_Functions OBEXGENPhone
;
1327 #ifdef GSM_ENABLE_GNAPGEN
1328 extern GSM_Phone_Functions GNAPGENPhone
;
1330 #ifdef GSM_ENABLE_S60
1331 extern GSM_Phone_Functions S60Phone
;
1333 extern GSM_Phone_Functions DUMMYPhone
;
1336 * Phone functions and private data.
1340 * Private data for current phone driver.
1342 GSM_Phone_Data Data
;
1344 * Functions for current phone driver.
1346 GSM_Phone_Functions
*Functions
;
1349 /* --------------------------- User layer ---------------------------------- */
1352 GSM_Reply_Function
*UserReplyFunctions
;
1354 IncomingCallCallback IncomingCall
;
1355 IncomingSMSCallback IncomingSMS
;
1356 IncomingCBCallback IncomingCB
;
1357 IncomingUSSDCallback IncomingUSSD
;
1358 SendSMSStatusCallback SendSMSStatus
;
1359 void * IncomingCallUserData
;
1360 void * IncomingSMSUserData
;
1361 void * IncomingCBUserData
;
1362 void * IncomingUSSDUserData
;
1363 void * SendSMSStatusUserData
;
1366 /* --------------------------- Statemachine layer -------------------------- */
1370 * Maximum number of concurrent configurations.
1372 #define MAX_CONFIG_NUM 5
1374 struct _GSM_StateMachine
{
1375 GSM_ConnectionType ConnectionType
; /**< Type of connection as int */
1377 * Skip lowlevel serial handling, cable is known to be broken.
1379 gboolean SkipDtrRts
;
1381 * Do not give power supply to cable on DTR/RTS signals.
1383 gboolean NoPowerCable
;
1384 char *LockFile
; /**< Lock file name for Unix */
1385 GSM_Debug_Info di
; /**< Debug information */
1386 gboolean opened
; /**< Is connection opened ? */
1387 GSM_Config Config
[MAX_CONFIG_NUM
+ 1]; /**< Configuration data */
1388 GSM_Config
*CurrentConfig
; /**< Config file (or Registry or...) variables */
1389 int ConfigNum
; /**< Number of actual configurations */
1390 int ReplyNum
; /**< How many times make sth. */
1391 int Speed
; /**< For some protocols used speed */
1394 * Flag for interrupting communication.
1396 volatile gboolean Abort
;
1398 GSM_Device Device
; /**< Device driver data and functions */
1399 GSM_Protocol Protocol
; /**< Protocol driver data and functions */
1400 GSM_Phone Phone
; /**< Phone driver data and functions */
1401 GSM_User User
; /**< User defined functions */
1404 /* ------------------------ Other general definitions ---------------------- */
1407 * Tries to register all modules to find one matching current configuration.
1409 * \param s State machine pointer.
1411 * \return Error code, ERR_NONE on success.
1413 GSM_Error
GSM_RegisterAllPhoneModules (GSM_StateMachine
*s
);
1415 GSM_Error
GSM_WaitForOnce (GSM_StateMachine
*s
, unsigned const char *buffer
,
1416 int length
, int type
, int timeout
);
1419 * Wait for reply from the phone.
1421 * \param s State machine pointer.
1422 * \param buffer Data to write to phone.
1423 * \param length Length of data in buffer.
1424 * \param type Type of request (for protocols where it makes sense).
1425 * \param timeout How long to wait for reply.
1426 * \param request ID of request
1428 * \return Error code, ERR_NONE on sucecss.
1430 GSM_Error
GSM_WaitFor (GSM_StateMachine
*s
, unsigned const char *buffer
,
1431 int length
, int type
, int timeout
,
1432 GSM_Phone_RequestID request
) WARNUNUSED
;
1435 * Wait for reply from the phone for ASCII strings without given length.
1436 * This is just a convenience wrapper around GSM_WaitFor which fills in
1439 * \param s State machine pointer.
1440 * \param buffer Data to write to phone.
1441 * \param type Type of request (for protocols where it makes sense).
1442 * \param timeout How long to wait for reply.
1443 * \param request ID of request
1445 * \return Error code, ERR_NONE on sucecss.
1447 #define GSM_WaitForAutoLen(s,buffer,type,timeout,request) \
1448 GSM_WaitFor(s,buffer,strlen(buffer),type,timeout,request)
1450 GSM_Error
GSM_DispatchMessage (GSM_StateMachine
*s
);
1452 void GSM_DumpMessageLevel2 (GSM_StateMachine
*s
, unsigned const char *message
, int messagesize
, int type
);
1453 void GSM_DumpMessageLevel2Recv (GSM_StateMachine
*s
, unsigned const char *message
, int messagesize
, int type
);
1454 void GSM_DumpMessageLevel3 (GSM_StateMachine
*s
, unsigned const char *message
, int messagesize
, int type
);
1455 void GSM_DumpMessageLevel3Recv(GSM_StateMachine
*s
, unsigned const char *message
, int messagesize
, int type
);
1458 void GSM_OSErrorInfo(GSM_StateMachine
*s
, const char *description
);
1463 /* How should editor hadle tabs in this file? Add editor commands here.
1464 * vim: noexpandtab sw=8 ts=8 sts=8: