1 /* 2 3 S M S D 4 5 A Linux/Unix tool for the mobile phones. 6 7 This file is part of gnokii. 8 9 Gnokii is free software; you can redistribute it and/or modify 10 it under the terms of the GNU General Public License as published by 11 the Free Software Foundation; either version 2 of the License, or 12 (at your option) any later version. 13 14 Gnokii is distributed in the hope that it will be useful, 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 GNU General Public License for more details. 18 19 You should have received a copy of the GNU General Public License 20 along with gnokii; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 23 Copyright (C) 1999 Pavel Jan�k ml., Hugh Blemings 24 Copyright (C) 1999-2011 Jan Derfinak 25 26 */ 27 28 #ifndef LOWLEVEL_H 29 #define LOWLEVEL_H 30 31 #include <pthread.h> 32 #include <glib.h> 33 #include "gnokii.h" 34 35 #define MAX_CONSECUTIVE_ERRORS 5 36 37 typedef enum { 38 Event_SendSMSMessage, 39 Event_DeleteSMSMessage, 40 Event_Exit 41 } PhoneAction; 42 43 typedef struct { 44 PhoneAction event; 45 gpointer data; 46 } PhoneEvent; 47 48 typedef struct { 49 gn_sms *sms; 50 gn_error status; 51 } D_SMSMessage; 52 53 typedef struct { 54 struct { 55 const gchar *model; 56 const gchar *revision; 57 const gchar *version; 58 } phone; 59 struct { 60 // gint unRead; 61 gint number; 62 GSList *messages; 63 } sms; 64 gint supported; 65 } PhoneMonitor; 66 67 extern pthread_t monitor_th; 68 extern PhoneMonitor phoneMonitor; 69 extern pthread_mutex_t smsMutex; 70 extern pthread_cond_t smsCond; 71 extern pthread_mutex_t sendSMSMutex; 72 extern pthread_cond_t sendSMSCond; 73 extern void InitPhoneMonitor (void); 74 extern void *Connect (void *); 75 extern void InsertEvent (PhoneEvent *event); 76 77 #endif 78