1 /* (c) 2002-2009 by Marcin Wiacek & Michal Cihar */ 2 3 /** 4 * @file gsmreply.h 5 * @author Michal Čihař 6 * @author Marcin Wiacek 7 */ 8 9 /** 10 * \addtogroup StateMachine 11 * 12 * @{ 13 */ 14 15 #ifndef __gsm_reply_h 16 #define __gsm_reply_h 17 18 #include "protocol/protocol.h" 19 #include <gammu.h> 20 21 /** 22 * Phone requests identificators, these are used for internally identifying 23 * which operation is being performed. 24 */ 25 typedef enum { 26 ID_None=1, 27 ID_GetModel, 28 ID_GetFirmware, 29 ID_EnableSecurity, 30 ID_OpenFile, 31 ID_CloseFile, 32 ID_GetIMEI, 33 ID_GetDateTime, 34 ID_GetAlarm, 35 ID_GetMemory, 36 ID_GetMemoryStatus, 37 ID_GetSMSC, 38 ID_GetSMSMessage, 39 ID_EnableEcho, 40 ID_EnableErrorInfo, 41 ID_SetOBEX, 42 ID_SetUSSD, 43 ID_GetUSSD, 44 ID_GetNote, 45 ID_SetNote, 46 ID_GetSignalQuality, 47 ID_GetBatteryCharge, 48 ID_GetSMSFolders, 49 ID_GetSMSFolderStatus, 50 ID_GetSMSStatus, 51 ID_AddSMSFolder, 52 ID_ConfigureNetworkInfo, 53 ID_GetNetworkInfo, 54 ID_GetNetworkCode, 55 ID_GetNetworkName, 56 ID_GetRingtone, 57 ID_DialVoice, 58 ID_GetCalendarNotesInfo, 59 ID_GetCalendarNote, 60 ID_GetSecurityCode, 61 ID_GetWAPBookmark, 62 ID_GetBitmap, 63 ID_GetCRC, 64 ID_SetAttrib, 65 ID_SaveSMSMessage, 66 ID_CancelCall, 67 ID_SetDateTime, 68 ID_SetAlarm, 69 ID_DisableConnectFunc, 70 ID_EnableConnectFunc, 71 ID_AnswerCall, 72 ID_SetBitmap, 73 ID_SetRingtone, 74 ID_DeleteSMSMessage, 75 ID_DeleteCalendarNote, 76 ID_SetPath, 77 ID_SetSMSC, 78 ID_SetProfile, 79 ID_SetMemory, 80 ID_DeleteMemory, 81 ID_SetCalendarNote, 82 ID_AddCalendarNote, 83 ID_SetIncomingSMS, 84 ID_SetIncomingCB, 85 ID_SetIncomingCall, 86 ID_GetCNMIMode, 87 ID_GetCalendarNotePos, 88 ID_Initialise, 89 ID_Terminate, 90 ID_GetConnectSet, 91 ID_SetWAPBookmark, 92 ID_GetLocale, 93 ID_SetLocale, 94 ID_GetCalendarSettings, 95 ID_SetCalendarSettings, 96 ID_GetGPRSPoint, 97 ID_GetGPRSState, 98 ID_SetGPRSPoint, 99 ID_EnableGPRSPoint, 100 ID_DeleteWAPBookmark, 101 ID_Netmonitor, 102 ID_HoldCall, 103 ID_UnholdCall, 104 ID_ConferenceCall, 105 ID_SplitCall, 106 ID_TransferCall, 107 ID_SwitchCall, 108 ID_GetManufactureMonth, 109 ID_GetProductCode, 110 ID_GetOriginalIMEI, 111 ID_GetHardware, 112 ID_GetPPM, 113 ID_GetSMSMode, 114 ID_GetSMSMemories, 115 ID_GetManufacturer, 116 ID_SetMemoryType, 117 ID_GetMemoryCharset, 118 ID_SetMemoryCharset, 119 ID_SetSMSParameters, 120 ID_GetFMStation, 121 ID_SetFMStation, 122 ID_GetLanguage, 123 ID_SetFastSMSSending, 124 ID_Reset, 125 ID_GetToDoInfo, 126 ID_GetToDo, 127 ID_PressKey, 128 ID_DeleteAllToDo, 129 ID_SetLight, 130 ID_Divert, 131 ID_SetDivert, 132 ID_SetToDo, 133 ID_AddToDo, 134 ID_PlayTone, 135 ID_GetChatSettings, 136 ID_GetSyncMLSettings, 137 ID_GetSyncMLName, 138 ID_GetSecurityStatus, 139 ID_EnterSecurityCode, 140 ID_GetProfile, 141 ID_GetRingtonesInfo, 142 ID_MakeAuthentication, 143 ID_GetSpeedDial, 144 ID_ResetPhoneSettings, 145 ID_SendDTMF, 146 ID_GetDisplayStatus, 147 ID_SetAutoNetworkLogin, 148 ID_SetConnectSet, 149 ID_GetSIMIMSI, 150 ID_GetFileInfo, 151 ID_FileSystemStatus, 152 ID_GetFile, 153 ID_AddFile, 154 ID_AddFolder, 155 ID_DeleteFolder, 156 ID_DeleteFile, 157 ID_ModeSwitch, 158 ID_GetProtocol, 159 ID_Screenshot, 160 ID_GetScreenSize, 161 162 /* Alcatel AT mode */ 163 ID_SetFlowControl, 164 ID_AlcatelConnect, 165 ID_AlcatelProtocol, 166 167 /* Alcatel Binary mode */ 168 ID_AlcatelAttach, 169 ID_AlcatelDetach, 170 ID_AlcatelCommit, 171 ID_AlcatelCommit2, 172 ID_AlcatelEnd, 173 ID_AlcatelClose, 174 ID_AlcatelStart, 175 ID_AlcatelSelect1, 176 ID_AlcatelSelect2, 177 ID_AlcatelSelect3, 178 ID_AlcatelBegin1, 179 ID_AlcatelBegin2, 180 ID_AlcatelGetIds1, 181 ID_AlcatelGetIds2, 182 ID_AlcatelGetCategories1, 183 ID_AlcatelGetCategories2, 184 ID_AlcatelGetCategoryText1, 185 ID_AlcatelGetCategoryText2, 186 ID_AlcatelAddCategoryText1, 187 ID_AlcatelAddCategoryText2, 188 ID_AlcatelGetFields1, 189 ID_AlcatelGetFields2, 190 ID_AlcatelGetFieldValue1, 191 ID_AlcatelGetFieldValue2, 192 ID_AlcatelDeleteItem1, 193 ID_AlcatelDeleteItem2, 194 ID_AlcatelDeleteField, 195 ID_AlcatelCreateField, 196 ID_AlcatelUpdateField, 197 198 ID_SetPower, 199 200 ID_IncomingFrame, 201 ID_CheckCHUP, 202 203 ID_User1, 204 ID_User2, 205 ID_User3, 206 ID_User4, 207 ID_User5, 208 ID_User6, 209 ID_User7, 210 ID_User8, 211 ID_User9, 212 ID_User10, 213 214 ID_All, 215 ID_EachFrame 216 } GSM_Phone_RequestID; 217 218 /** 219 * Structure for defining reply functions. 220 * 221 * Function is called when requestID matches current operation or is 222 * ID_IncomingFrame and msgtype matches start message and (if msgtype is just 223 * one character) subtypechar is zero or subtypechar-th character of message 224 * matches subtype. 225 * 226 * Should be used in array with last element containing ID_None as requestID. 227 */ 228 typedef struct { 229 /** 230 * Pointer to function that should be executed. 231 */ 232 GSM_Error (*Function) (GSM_Protocol_Message *msg, GSM_StateMachine *s); 233 /** 234 * Message type, if it is longer than 1 character, it disables subtype 235 * checking. 236 */ 237 const unsigned char *msgtype; 238 /** 239 * Which character of message should be checked as subtype. Zero to 240 * disable subtype checking. 241 */ 242 const size_t subtypechar; 243 /** 244 * Subtype to be checked. 245 */ 246 const int subtype; 247 /** 248 * Phone request when this can be called, use ID_IncomingFrame when 249 * you want to use this in any state. 250 */ 251 const GSM_Phone_RequestID requestID; 252 } GSM_Reply_Function; 253 254 #endif 255 /*@}*/ 256 257 /* How should editor hadle tabs in this file? Add editor commands here. 258 * vim: noexpandtab sw=8 ts=8 sts=8: 259 */ 260