/usr/include/gammu/gammu-statemachine.h is in libgammu-dev 1.33.0-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | /**
* \file gammu-statemachine.h
* \author Michal Čihař
*
* State machine data.
*/
#ifndef __gammu_statemachine_h
#define __gammu_statemachine_h
/**
* \defgroup StateMachine State machine
* Generic state machine layer.
*/
#include <gammu-types.h>
#include <gammu-error.h>
#include <gammu-inifile.h>
/**
* Callback function for logging.
*
* \param text Text to be printed, \n will be also sent (as a separate
* message).
*/
typedef void (*GSM_Log_Function) (const char *text, void *data);
/**
* Private structure holding information about phone connection. Should
* be allocated by \ref GSM_AllocStateMachine and freed by
* \ref GSM_FreeStateMachine.
*
* \ingroup StateMachine
*/
typedef struct _GSM_StateMachine GSM_StateMachine;
#include <gammu-info.h>
/**
* Configuration of state machine.
*
* \ingroup StateMachine
*/
typedef struct {
/**
* Model from config file
*/
char Model[50];
/**
* Debug level
*/
char DebugLevel[50];
/**
* Device name from config file
*/
char *Device;
/**
* Connection type as string
*/
char *Connection;
/**
* Synchronize time on startup?
*/
gboolean SyncTime;
/**
* Lock device ? (Unix)
*/
gboolean LockDevice;
/**
* Name of debug file
*/
char *DebugFile;
/**
* Display something during start ?
*/
gboolean StartInfo;
/**
* Should we use global debug file?
*/
gboolean UseGlobalDebugFile;
/**
* Text for reminder calendar entry category in local language
*/
char TextReminder[32];
/**
* Text for meeting calendar entry category in local language
*/
char TextMeeting[32];
/**
* Text for call calendar entry category in local language
*/
char TextCall[32];
/**
* Text for birthday calendar entry category in local language
*/
char TextBirthday[32];
/**
* Text for memo calendar entry category in local language
*/
char TextMemo[32];
/**
* Phone features override.
*/
GSM_Feature PhoneFeatures[GSM_MAX_PHONE_FEATURES + 1];
} GSM_Config;
/**
* Connection types definitions.
*/
typedef enum {
GCT_MBUS2 = 1,
GCT_FBUS2,
GCT_FBUS2DLR3,
GCT_DKU2AT,
GCT_DKU2PHONET,
GCT_DKU5FBUS2,
GCT_ARK3116FBUS2,
GCT_FBUS2PL2303,
GCT_FBUS2BLUE,
GCT_FBUS2IRDA,
GCT_PHONETBLUE,
GCT_AT,
GCT_BLUEGNAPBUS,
GCT_IRDAOBEX,
GCT_IRDAGNAPBUS,
GCT_IRDAAT,
GCT_IRDAPHONET,
GCT_BLUEFBUS2,
GCT_BLUEAT,
GCT_BLUEPHONET,
GCT_BLUEOBEX,
GCT_FBUS2USB,
GCT_BLUES60,
GCT_NONE
} GSM_ConnectionType;
/**
* Initiates connection with custom logging callback.
*
* \ingroup StateMachine
*
* \param s State machine data
* \param ReplyNum Number of replies to await (usually 3).
* \param log_function Logging function, see GSM_SetDebugFunction.
* \param user_data User data for logging function, see GSM_SetDebugFunction.
* \return Error code
* \see GSM_SetDebugFunction
*/
GSM_Error GSM_InitConnection_Log(GSM_StateMachine * s, int ReplyNum,
GSM_Log_Function log_function,
void *user_data);
/**
* Initiates connection.
*
* \ingroup StateMachine
*
* \param s State machine data
* \param ReplyNum Number of replies to await (usually 3).
* \return Error code
*/
GSM_Error GSM_InitConnection(GSM_StateMachine * s, int ReplyNum);
/**
* Terminates connection.
*
* \ingroup StateMachine
*
* \param s State machine data
* \return Error code
*/
GSM_Error GSM_TerminateConnection(GSM_StateMachine * s);
/**
* Aborts current operation.
*
* This is thread safe call to abort any existing operations with the
* phone.
*
* \ingroup StateMachine
*
* \param s State machine data
* \return Error code
*/
GSM_Error GSM_AbortOperation(GSM_StateMachine * s);
/**
* Attempts to read data from phone. This can be used for getting
* status of incoming events, which would not be found out without
* polling device.
*
* \ingroup StateMachine
*
* \param s State machine data
* \param waitforreply Whether to wait for some event
* \return Number of read bytes
*/
int GSM_ReadDevice(GSM_StateMachine * s, gboolean waitforreply);
/**
* Detects whether state machine is connected.
*
* \ingroup StateMachine
*
* \param s State machine data
* \return Whether phone is connected.
*/
gboolean GSM_IsConnected(GSM_StateMachine * s);
/**
* Finds and reads gammu configuration file. The search order depends on
* platform. On POSIX systems it looks for ~/.gammurc and then for
* /etc/gammurc, on Windows for gammurc in Application data folder, then
* in home and last fallback is in current driectory.
*
* \param result Ini file representation
* \param force_config Forcing of custom path instead of autodetected
* one (if NULL, autodetection is performed).
*
* \return Error code
*
* \ingroup StateMachine
*/
GSM_Error GSM_FindGammuRC(INI_Section ** result, const char *force_config);
/**
* Processes gammu configuration.
*
* \param cfg_info Ini file representation.
* \param cfg Where to store configuration.
* \param num Number of section to read.
* \return Whether we got valid configuration. Especially check for
* ERR_USING_DEFAULTS.
*
* \ingroup StateMachine
*
* \see GSM_FallbackConfig
*/
GSM_Error GSM_ReadConfig(INI_Section * cfg_info, GSM_Config * cfg, int num);
/**
* Gets gammu configuration from state machine. This actually returns
* pointer to internal configuration storage, so you can use it also for
* updating existing settings.
*
* \param s State machine data
* \param num Number of section to read, -1 for currently used.
* \return Pointer to configuration.
*
* \ingroup StateMachine
*/
GSM_Config *GSM_GetConfig(GSM_StateMachine * s, int num);
/**
* Gets number of active gammu configurations.
*
* \param s State machine data
* \return Number of sections.
*
* \ingroup StateMachine
*/
int GSM_GetConfigNum(const GSM_StateMachine * s);
/**
* Gets number of active gammu configurations.
*
* \param s State machine data
* \param sections Number of sections.
*
* \ingroup StateMachine
*/
void GSM_SetConfigNum(GSM_StateMachine * s, int sections);
/**
* Allocates new clean state machine structure. You should free it then
* by \ref GSM_FreeStateMachine.
*
* \return Pointer to state machine structure.
*
* \ingroup StateMachine
*/
GSM_StateMachine *GSM_AllocStateMachine(void);
/**
* Frees state machine structure allocated by
* \ref GSM_AllocStateMachine.
*
* \param s Pointer to state machine structure.
*
* \ingroup StateMachine
*/
void GSM_FreeStateMachine(GSM_StateMachine * s);
/**
* Gets number of active gammu configurations.
*
* \param s State machine data
* \return Connection type.
*
* \ingroup StateMachine
*/
GSM_ConnectionType GSM_GetUsedConnection(GSM_StateMachine * s);
/**
* Installs applet required for configured connection to the phone.
*
* \param s State machine data.
* \param ExtraPath Extra path where to search for installation data.
* \param Minimal Whether to do minimal installation (eg. without support
* libraries), useful for applet updates
* \return Result of operation.
*
* \ingroup StateMachine
*/
GSM_Error GSM_Install(GSM_StateMachine *s, const char *ExtraPath, gboolean Minimal);
#endif
/* Editor configuration
* vim: noexpandtab sw=8 ts=8 sts=8 tw=72:
*/
|