From de38500b8f07747491490e99a522eea3f84fff5a Mon Sep 17 00:00:00 2001 From: Sergey Popov Date: Thu, 22 Mar 2012 17:54:27 +0400 Subject: [PATCH] move phone variables to gammu-related part of yasnd library --- daemon/yasnd.c | 3 --- lib/yasnd-gammu.c | 3 +++ yasnd-gammu.h | 5 +++++ yasnd.h | 3 --- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/daemon/yasnd.c b/daemon/yasnd.c index c97e140..8237a03 100644 --- a/daemon/yasnd.c +++ b/daemon/yasnd.c @@ -14,9 +14,6 @@ char pidfile[]="/var/run/yasnd.pid"; // pidfile path host_decl* hosts=NULL; // structure with hosts' definitions int hosts_count=0; // count of hosts bool sms_enable=false; // use SMS messages for control and reports? -char* phone_device=NULL; // phone device for gammu, for example: "/dev/ttyACM0" -char* phone_model=NULL; // gammu phone model, for example: "at" -char* phone_connection=NULL; // gammu phone connection type, for example: "at" char* recipient_number=NULL; // recipient of sms alerts bool loop_locked=false; // flag for locking main loop while config re-reading int failures_first=0; // count of failures while hosts checking, that triggers SMS sending diff --git a/lib/yasnd-gammu.c b/lib/yasnd-gammu.c index a2b6d84..1cdffde 100644 --- a/lib/yasnd-gammu.c +++ b/lib/yasnd-gammu.c @@ -2,6 +2,9 @@ #include "yasnd.h" #include "yasnd-log.h" +char* phone_device=NULL; // phone device for gammu, for example: "/dev/ttyACM0" +char* phone_model=NULL; // gammu phone model, for example: "at" +char* phone_connection=NULL; // gammu phone connection type, for example: "at" GSM_Error error; // structure to store possible gammu errors GSM_StateMachine *state_machine=NULL; // structure to interact with mobile phones volatile gboolean gammu_shutdown=FALSE; // variable that indicates gammu shutdown diff --git a/yasnd-gammu.h b/yasnd-gammu.h index ef341c3..fd9ce84 100644 --- a/yasnd-gammu.h +++ b/yasnd-gammu.h @@ -1,6 +1,11 @@ #ifndef YASND_GAMMU_H #define YASND_GAMMU_H +// External variables +extern char* phone_device; // phone device for gammu, for example: "/dev/ttyACM0" +extern char* phone_model; // gammu phone model, for example: "at" +extern char* phone_connection; // gammu phone connection type, for example: "at" + // External functions extern bool gammu_init(); extern bool gammu_send_sms(const char* message); diff --git a/yasnd.h b/yasnd.h index b6f7663..e182e3a 100644 --- a/yasnd.h +++ b/yasnd.h @@ -41,9 +41,6 @@ extern int send_message(int qid, mymsgbuf* qbuf); // External variables extern int hosts_count; // count of hosts extern char* recipient_number; -extern char* phone_device; // phone device for gammu, for example: "/dev/ttyACM0" -extern char* phone_model; // gammu phone model, for example: "at" -extern char* phone_connection; // gammu phone connection type, for example: "at" extern bool sms_enable; extern int qid;