1 /** 2 * \file gammu-settings.h 3 * \author Michal Čihař 4 * 5 * Phone settings data and functions. 6 */ 7 #ifndef __gammu_settings_h 8 #define __gammu_settings_h 9 10 #ifdef __cplusplus 11 extern "C" { 12 #endif 13 14 /** 15 * \defgroup Settings Settings 16 * Phone settings manipulations. 17 */ 18 19 #include <gammu-wap.h> 20 #include <gammu-limits.h> 21 22 typedef struct { 23 int Location; 24 gboolean Active; 25 gboolean SyncPhonebook; 26 gboolean SyncCalendar; 27 char Name[(20 + 1) * 2]; 28 char PhonebookDataBase[(50 + 1) * 2]; 29 char CalendarDataBase[(50 + 1) * 2]; 30 char User[(30 + 1) * 2]; 31 char Password[(20 + 1) * 2]; 32 char Server[(128 + 1) * 2]; 33 GSM_MultiWAPSettings Connection; 34 } GSM_SyncMLSettings; 35 36 /* ------------------------------------------------------------------------ */ 37 38 typedef enum { 39 GSM_RESET_PHONESETTINGS = 1, 40 GSM_RESET_USERINTERFACE, 41 GSM_RESET_USERINTERFACE_PHONESETTINGS, 42 GSM_RESET_DEVICE, 43 GSM_RESET_FULLFACTORY 44 } GSM_ResetSettingsType; 45 46 typedef struct { 47 char Name[(50 + 1) * 2]; 48 char HomePage[(200 + 1) * 2]; 49 char User[(50 + 1) * 2]; 50 char Password[(50 + 1) * 2]; 51 int Location; 52 gboolean Active; 53 GSM_MultiWAPSettings Connection; 54 } GSM_ChatSettings; 55 56 typedef enum { 57 PROFILE_KEYPAD_LEVEL1 = 1, 58 PROFILE_KEYPAD_LEVEL2, 59 PROFILE_KEYPAD_LEVEL3, 60 PROFILE_KEYPAD_OFF, 61 PROFILE_CALLALERT_RINGING, 62 PROFILE_CALLALERT_BEEPONCE, 63 PROFILE_CALLALERT_OFF, 64 PROFILE_CALLALERT_RINGONCE, 65 PROFILE_CALLALERT_ASCENDING, 66 PROFILE_CALLALERT_CALLERGROUPS, 67 PROFILE_VOLUME_LEVEL1, 68 PROFILE_VOLUME_LEVEL2, 69 PROFILE_VOLUME_LEVEL3, 70 PROFILE_VOLUME_LEVEL4, 71 PROFILE_VOLUME_LEVEL5, 72 PROFILE_MESSAGE_NOTONE, 73 PROFILE_MESSAGE_STANDARD, 74 PROFILE_MESSAGE_SPECIAL, 75 PROFILE_MESSAGE_BEEPONCE, 76 PROFILE_MESSAGE_ASCENDING, 77 PROFILE_MESSAGE_PERSONAL, 78 PROFILE_VIBRATION_OFF, 79 PROFILE_VIBRATION_ON, 80 PROFILE_VIBRATION_FIRST, 81 PROFILE_WARNING_ON, 82 PROFILE_WARNING_OFF, 83 PROFILE_AUTOANSWER_ON, 84 PROFILE_AUTOANSWER_OFF, 85 PROFILE_LIGHTS_OFF, 86 PROFILE_LIGHTS_AUTO, 87 PROFILE_SAVER_ON, 88 PROFILE_SAVER_OFF, 89 PROFILE_SAVER_TIMEOUT_5SEC, 90 PROFILE_SAVER_TIMEOUT_20SEC, 91 PROFILE_SAVER_TIMEOUT_1MIN, 92 PROFILE_SAVER_TIMEOUT_2MIN, 93 PROFILE_SAVER_TIMEOUT_5MIN, 94 PROFILE_SAVER_TIMEOUT_10MIN 95 } GSM_Profile_Feat_Value; 96 97 typedef enum { 98 Profile_KeypadTone = 1, 99 Profile_CallAlert, 100 Profile_RingtoneVolume, 101 Profile_MessageTone, 102 Profile_Vibration, 103 Profile_WarningTone, 104 Profile_AutoAnswer, 105 Profile_Lights, 106 Profile_ScreenSaverTime, 107 Profile_ScreenSaver, 108 109 Profile_ScreenSaverNumber, 110 Profile_RingtoneID, 111 Profile_MessageToneID, 112 Profile_CallerGroups 113 } GSM_Profile_Feat_ID; 114 115 /** 116 * It contains phone profiles 117 */ 118 typedef struct { 119 gboolean Active; 120 121 /** 122 * Profile number 123 */ 124 int Location; 125 /** 126 * Profile name 127 */ 128 char Name[40 * 2]; 129 /** 130 * Is it default name for profile ? 131 */ 132 gboolean DefaultName; 133 gboolean HeadSetProfile; 134 gboolean CarKitProfile; 135 136 int FeaturesNumber; 137 GSM_Profile_Feat_Value FeatureValue[15]; 138 GSM_Profile_Feat_ID FeatureID[15]; 139 140 gboolean CallerGroups[5]; 141 } GSM_Profile; 142 143 typedef struct { 144 int Location; 145 double Frequency; 146 char StationName[(GSM_MAX_FMSTATION_LENGTH + 1) * 2]; 147 } GSM_FMStation; 148 149 typedef struct { 150 int Location; 151 gboolean Active; 152 unsigned char Name[(GSM_MAX_GPRS_AP_NAME_LENGTH + 1) * 2]; 153 unsigned char URL[(GSM_MAX_GPRS_AP_URL_LENGTH + 1) * 2]; 154 } GSM_GPRSAccessPoint; 155 156 typedef enum { 157 GSM_Date_DDMMYYYY = 1, 158 GSM_Date_MMDDYYYY, 159 GSM_Date_YYYYMMDD, 160 GSM_Date_DDMMMYY, 161 GSM_Date_MMDDYY, 162 GSM_Date_DDMMYY, 163 GSM_Date_YYMMDD, 164 GSM_Date_OFF 165 } GSM_DateFormat; 166 167 typedef struct { 168 char DateSeparator; 169 GSM_DateFormat DateFormat; 170 gboolean AMPMTime; 171 } GSM_Locale; 172 173 typedef struct { 174 GSM_Profile_Feat_ID ID; 175 GSM_Profile_Feat_Value Value; 176 unsigned char PhoneID; 177 unsigned char PhoneValue; 178 } GSM_Profile_PhoneTableValue; 179 180 /** 181 * Gets locale from phone. 182 */ 183 GSM_Error GSM_GetLocale(GSM_StateMachine * s, GSM_Locale * locale); 184 185 /** 186 * Sets locale of phone. 187 */ 188 GSM_Error GSM_SetLocale(GSM_StateMachine * s, GSM_Locale * locale); 189 190 /** 191 * Acquires SyncML settings. 192 */ 193 GSM_Error GSM_GetSyncMLSettings(GSM_StateMachine * s, 194 GSM_SyncMLSettings * settings); 195 /** 196 * Changes SyncML settings. 197 */ 198 GSM_Error GSM_SetSyncMLSettings(GSM_StateMachine * s, 199 GSM_SyncMLSettings * settings); 200 /** 201 * Acquires chat/presence settings. 202 */ 203 GSM_Error GSM_GetChatSettings(GSM_StateMachine * s, 204 GSM_ChatSettings * settings); 205 /** 206 * Changes chat/presence settings. 207 */ 208 GSM_Error GSM_SetChatSettings(GSM_StateMachine * s, 209 GSM_ChatSettings * settings); 210 /** 211 * Acquires MMS settings. 212 */ 213 GSM_Error GSM_GetMMSSettings(GSM_StateMachine * s, 214 GSM_MultiWAPSettings * settings); 215 /** 216 * Changes MMS settings. 217 */ 218 GSM_Error GSM_SetMMSSettings(GSM_StateMachine * s, 219 GSM_MultiWAPSettings * settings); 220 /** 221 * Enables network auto login. 222 */ 223 GSM_Error GSM_SetAutoNetworkLogin(GSM_StateMachine * s); 224 225 /** 226 * Performs phone reset. 227 */ 228 GSM_Error GSM_Reset(GSM_StateMachine * s, gboolean hard); 229 230 /** 231 * Resets phone settings. 232 */ 233 GSM_Error GSM_ResetPhoneSettings(GSM_StateMachine * s, 234 GSM_ResetSettingsType Type); 235 /** 236 * Reads profile. 237 */ 238 GSM_Error GSM_GetProfile(GSM_StateMachine * s, GSM_Profile * Profile); 239 240 /** 241 * Updates profile. 242 */ 243 GSM_Error GSM_SetProfile(GSM_StateMachine * s, GSM_Profile * Profile); 244 245 /** 246 * Reads FM station. 247 */ 248 GSM_Error GSM_GetFMStation(GSM_StateMachine * s, GSM_FMStation * FMStation); 249 250 /** 251 * Sets FM station. 252 */ 253 GSM_Error GSM_SetFMStation(GSM_StateMachine * s, GSM_FMStation * FMStation); 254 255 /** 256 * Clears defined FM stations. 257 */ 258 GSM_Error GSM_ClearFMStations(GSM_StateMachine * s); 259 260 /** 261 * Gets GPRS access point. 262 */ 263 GSM_Error GSM_GetGPRSAccessPoint(GSM_StateMachine * s, 264 GSM_GPRSAccessPoint * point); 265 /** 266 * Sets GPRS access point. 267 */ 268 GSM_Error GSM_SetGPRSAccessPoint(GSM_StateMachine * s, 269 GSM_GPRSAccessPoint * point); 270 #ifdef __cplusplus 271 } 272 #endif 273 #endif 274 275 /* Editor configuration 276 * vim: noexpandtab sw=8 ts=8 sts=8 tw=72: 277 */ 278