Gammu internals
1.38.0
|
#include <stdarg.h>
#include <string.h>
#include <errno.h>
#include <limits.h>
#include <gammu-call.h>
#include <gammu-settings.h>
#include <gammu-unicode.h>
#include <gammu-config.h>
#include <gammu-misc.h>
#include "debug.h"
#include "gsmcomon.h"
#include "gsmphones.h"
#include "gsmstate.h"
#include "misc/coding/coding.h"
#include "misc/misc.h"
#include "device/devfunc.h"
#include "../helper/string.h"
Go to the source code of this file.
Data Structures | |
struct | GSM_ConnectionInfo |
Macros | |
#define | _GNU_SOURCE /* For strcasestr */ |
#define | FALLBACK_GAMMURC "/etc/gammurc" |
#define | GAMMURC_NAME "/.gammurc" |
#define | XDG_GAMMURC_NAME "/gammu/config" |
#define | DEFAULT_DEVICE "/dev/ttyUSB0" |
#define | DEFAULT_MODEL "" |
#define | DEFAULT_CONNECTION "at" |
#define | DEFAULT_SYNCHRONIZE_TIME FALSE |
#define | DEFAULT_DEBUG_FILE "" |
#define | DEFAULT_DEBUG_LEVEL "" |
#define | DEFAULT_LOCK_DEVICE FALSE |
#define | DEFAULT_START_INFO FALSE |
Variables | |
static const GSM_ConnectionInfo | GSM_Connections [] |
GSM_Device_Functions | NoneDevice |
GSM_Protocol_Functions | NoProtocol |
#define _GNU_SOURCE /* For strcasestr */ |
Definition at line 5 of file gsmstate.c.
#define DEFAULT_CONNECTION "at" |
Definition at line 59 of file gsmstate.c.
Referenced by GSM_ReadConfig().
#define DEFAULT_DEBUG_FILE "" |
Definition at line 61 of file gsmstate.c.
Referenced by GSM_ReadConfig().
#define DEFAULT_DEBUG_LEVEL "" |
Definition at line 62 of file gsmstate.c.
Referenced by GSM_ReadConfig().
#define DEFAULT_DEVICE "/dev/ttyUSB0" |
Definition at line 56 of file gsmstate.c.
Referenced by GSM_ReadConfig().
#define DEFAULT_LOCK_DEVICE FALSE |
Definition at line 63 of file gsmstate.c.
Referenced by GSM_ReadConfig().
#define DEFAULT_MODEL "" |
Definition at line 58 of file gsmstate.c.
Referenced by GSM_ReadConfig().
#define DEFAULT_START_INFO FALSE |
Definition at line 64 of file gsmstate.c.
Referenced by GSM_ReadConfig().
#define DEFAULT_SYNCHRONIZE_TIME FALSE |
Definition at line 60 of file gsmstate.c.
Referenced by GSM_ReadConfig().
#define FALLBACK_GAMMURC "/etc/gammurc" |
Definition at line 42 of file gsmstate.c.
Referenced by GSM_FindGammuRC().
#define GAMMURC_NAME "/.gammurc" |
Definition at line 43 of file gsmstate.c.
Referenced by GSM_FindGammuRC().
#define XDG_GAMMURC_NAME "/gammu/config" |
Definition at line 45 of file gsmstate.c.
Referenced by GSM_FindGammuRC().
|
static |
Definition at line 1077 of file gsmstate.c.
References GSM_Protocol_Message::Buffer, GSM_Phone::Data, ERR_FRAMENOTREQUESTED, ERR_NONE, ERR_UNKNOWNFRAME, FALSE, ID_EachFrame, ID_IncomingFrame, ID_None, GSM_Protocol_Message::Length, _GSM_StateMachine::Phone, GSM_Phone_Data::RequestID, GSM_Phone_Data::RequestMsg, GSM_Reply_Function::subtype, GSM_Reply_Function::subtypechar, TRUE, and GSM_Protocol_Message::Type.
Referenced by GSM_DispatchMessage().
GSM_Error GSM_CloseConnection | ( | GSM_StateMachine * | s | ) |
Internal function which just closes connection and cleans up structures.
Definition at line 589 of file gsmstate.c.
References GSM_Device_Functions::CloseDevice, GSM_Phone::Data, _GSM_StateMachine::Device, ERR_NONE, GSM_Device::Functions, GSM_Protocol::Functions, _GSM_StateMachine::LockFile, GSM_Phone_Data::Manufacturer, GSM_Phone_Data::Model, GSM_Phone_Data::ModelInfo, _GSM_StateMachine::Phone, _GSM_StateMachine::Protocol, smprintf(), GSM_Protocol_Functions::Terminate, unlock_device(), GSM_Phone_Data::VerDate, GSM_Phone_Data::VerNum, and GSM_Phone_Data::Version.
Referenced by GSM_InitConnection_Log(), and GSM_TerminateConnection().
void GSM_DumpMessageBinary_Custom | ( | GSM_StateMachine * | s, |
unsigned const char * | message, | ||
size_t | messagesize, | ||
int | type, | ||
int | direction | ||
) |
Definition at line 1565 of file gsmstate.c.
References _GSM_Debug_Info::dl, DL_BINARY, GSM_GetDI(), and smprintf().
Referenced by GSM_DumpMessageBinary(), and GSM_DumpMessageBinaryRecv().
void GSM_DumpMessageText_Custom | ( | GSM_StateMachine * | s, |
unsigned const char * | message, | ||
size_t | messagesize, | ||
int | type, | ||
const char * | text | ||
) |
Definition at line 1538 of file gsmstate.c.
References _GSM_Debug_Info::dl, DL_TEXT, DL_TEXTALL, DL_TEXTALLDATE, DL_TEXTDATE, DumpMessage(), GSM_GetDI(), and smprintf().
Referenced by GSM_DumpMessageText(), and GSM_DumpMessageTextRecv().
void GSM_ExpandUserPath | ( | char ** | string | ) |
Expand path to user home.
Definition at line 1326 of file gsmstate.c.
Referenced by GSM_ReadConfig().
GSM_Error GSM_OpenConnection | ( | GSM_StateMachine * | s | ) |
Opens connection to device and initiates protocol layer.
Definition at line 560 of file gsmstate.c.
References _GSM_StateMachine::CurrentConfig, GSM_Config::Device, _GSM_StateMachine::Device, ERR_NONE, GSM_Device::Functions, GSM_Protocol::Functions, GSM_Protocol_Functions::Initialise, lock_device(), GSM_Config::LockDevice, _GSM_StateMachine::LockFile, GSM_Device_Functions::OpenDevice, _GSM_StateMachine::opened, _GSM_StateMachine::Protocol, TRUE, and unlock_device().
Referenced by GSM_InitConnection_Log(), and GSM_TryGetModel().
|
static |
Definition at line 197 of file gsmstate.c.
References GSM_ConnectionInfo::Connection, _GSM_StateMachine::ConnectionType, _GSM_StateMachine::Device, ERR_DISABLED, ERR_MOREMEMORY, ERR_NONE, ERR_UNKNOWNCONNECTIONTYPESTRING, FALSE, FindSerialSpeed(), GSM_Device::Functions, GSM_Protocol::Functions, GCT_AT, GCT_BLUEAT, GCT_BLUEFBUS2, GCT_BLUEGNAPBUS, GCT_BLUEOBEX, GCT_BLUEPHONET, GCT_BLUES60, GCT_DKU2AT, GCT_DKU2PHONET, GCT_DKU5FBUS2, GCT_FBUS2, GCT_FBUS2BLUE, GCT_FBUS2DLR3, GCT_FBUS2IRDA, GCT_FBUS2PL2303, GCT_FBUS2USB, GCT_IRDAAT, GCT_IRDAGNAPBUS, GCT_IRDAOBEX, GCT_IRDAPHONET, GCT_MBUS2, GCT_NONE, GCT_PHONETBLUE, GCT_PROXYAT, GCT_PROXYFBUS2, GCT_PROXYGNAPBUS, GCT_PROXYOBEX, GCT_PROXYPHONET, GCT_PROXYS60, GSM_Connections, GSM_RegisterConnection(), _GSM_StateMachine::NoPowerCable, _GSM_StateMachine::Protocol, ProxyDevice, GSM_ConnectionInfo::SkipDtrRts, _GSM_StateMachine::SkipDtrRts, smprintf(), _GSM_StateMachine::Speed, and TRUE.
Referenced by GSM_InitConnection_Log().
|
static |
Definition at line 81 of file gsmstate.c.
References _GSM_StateMachine::ConnectionType, _GSM_StateMachine::Device, GSM_Device::Functions, GSM_Protocol::Functions, and _GSM_StateMachine::Protocol.
Referenced by GSM_RegisterAllConnections().
|
static |
Definition at line 360 of file gsmstate.c.
References _GSM_StateMachine::CurrentConfig, GSM_Phone::Data, GSM_Phone::Functions, GetModelData(), GSM_Config::Model, GSM_Phone_Data::Model, GSM_PhoneModel::model, GSM_Phone_Functions::models, _GSM_StateMachine::Phone, and smprintf().
Referenced by GSM_RegisterAllPhoneModules().
GSM_Error GSM_TryGetModel | ( | GSM_StateMachine * | s | ) |
Tries to read model using configured phone connection.
Definition at line 623 of file gsmstate.c.
References _GSM_StateMachine::ConnectionType, GSM_Phone::Data, DUMMYPhone, ERR_NONE, ERR_UNKNOWN, GSM_Phone::Functions, GCT_AT, GCT_BLUEAT, GCT_BLUEFBUS2, GCT_BLUEGNAPBUS, GCT_BLUEOBEX, GCT_BLUEPHONET, GCT_BLUES60, GCT_DKU2AT, GCT_DKU2PHONET, GCT_DKU5FBUS2, GCT_FBUS2, GCT_FBUS2BLUE, GCT_FBUS2DLR3, GCT_FBUS2IRDA, GCT_FBUS2PL2303, GCT_FBUS2USB, GCT_IRDAAT, GCT_IRDAGNAPBUS, GCT_IRDAOBEX, GCT_IRDAPHONET, GCT_MBUS2, GCT_NONE, GCT_PHONETBLUE, GCT_PROXYAT, GCT_PROXYFBUS2, GCT_PROXYGNAPBUS, GCT_PROXYOBEX, GCT_PROXYPHONET, GCT_PROXYS60, GSM_Phone_Functions::GetModel, GSM_OpenConnection(), GSM_Phone_Functions::Initialise, GSM_Phone_Data::Model, NAUTOPhone, _GSM_StateMachine::Phone, smprintf(), and GSM_Phone_Functions::Terminate.
Referenced by GSM_InitConnection_Log().
GSM_Error GSM_TryReadGammuRC | ( | const char * | path, |
INI_Section ** | result | ||
) |
Definition at line 1203 of file gsmstate.c.
References dbgprintf, FALSE, and INI_ReadFile().
Referenced by GSM_FindGammuRC().
|
static |
Mapping of connection names to internal identifications.
Definition at line 111 of file gsmstate.c.
Referenced by GSM_RegisterAllConnections().
GSM_Device_Functions NoneDevice |
Definition at line 180 of file gsmstate.c.
GSM_Protocol_Functions NoProtocol |
Definition at line 190 of file gsmstate.c.