rename variable "sms_send_enable" to "sms_enable"

This commit is contained in:
Sergey Popov 2011-12-20 17:05:53 +04:00
parent 671d569f36
commit 73bdb15644
3 changed files with 8 additions and 8 deletions

View File

@ -71,7 +71,7 @@ int ipc_queue_loop()
char dbg_txt[150];
sprintf(dbg_txt,"Read IPC message - Type: %ld Text: %s", qbuf.mtype, qbuf.mtext);
log_debug(dbg_txt,DEBUG_ALL);
if (qbuf.mtype==SMS_RECEIVE_TYPE && sms_send_enable)
if (qbuf.mtype==SMS_RECEIVE_TYPE && sms_enable)
{
pid_t pid = fork();
if (pid < 0) {
@ -87,7 +87,7 @@ int ipc_queue_loop()
// STUB: need to react on status, returned by thread
waitpid(pid,NULL,0);
}
if (qbuf.mtype==SMS_SEND_TYPE && sms_send_enable)
if (qbuf.mtype==SMS_SEND_TYPE && sms_enable)
{
log_debug(qbuf.mtext,DEBUG_BASE);
pid_t pid = fork();

10
yasnd.c
View File

@ -11,7 +11,7 @@ cfg_t *cfg; // pointer to configuration structure
host_decl* hosts=NULL; // structure with hosts' definitions
int hosts_count=0; // count of hosts
int debug_flag=0;
bool sms_send_enable=false; // send or not send alerts via SMS
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"
@ -101,7 +101,7 @@ void init()
CFG_SIMPLE_INT("debug", &debug_flag),
CFG_SIMPLE_BOOL("lpt_enable", &lpt_enable),
CFG_SIMPLE_INT("lpt_port", &lpt_port),
CFG_SIMPLE_BOOL("sms_send_enable", &sms_send_enable),
CFG_SIMPLE_BOOL("sms_enable", &sms_enable),
CFG_SIMPLE_STR("phone_device", &phone_device),
CFG_SIMPLE_STR("phone_model", &phone_connection),
CFG_SIMPLE_STR("phone_connection", &phone_model),
@ -117,8 +117,8 @@ void init()
log_event("Error parsing config file");
exit(EXIT_FAILURE);
}
// if SMS sending is enabled, all of phone parameters must be explicitly defined
if (sms_send_enable)
// if SMS is enabled, all of phone parameters must be explicitly defined
if (sms_enable)
{
if (phone_model==NULL)
{
@ -161,7 +161,7 @@ void init()
hosts[i].reaction_obtained=false;
}
// initialize gammu structures
if (sms_send_enable)
if (sms_enable)
gammu_init();
// initialize LPT control circuit
if (lpt_enable)

View File

@ -55,7 +55,7 @@ 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_send_enable;
extern bool sms_enable;
extern int qid;
#endif