rename variable "sms_send_enable" to "sms_enable"
This commit is contained in:
parent
671d569f36
commit
73bdb15644
@ -71,7 +71,7 @@ int ipc_queue_loop()
|
|||||||
char dbg_txt[150];
|
char dbg_txt[150];
|
||||||
sprintf(dbg_txt,"Read IPC message - Type: %ld Text: %s", qbuf.mtype, qbuf.mtext);
|
sprintf(dbg_txt,"Read IPC message - Type: %ld Text: %s", qbuf.mtype, qbuf.mtext);
|
||||||
log_debug(dbg_txt,DEBUG_ALL);
|
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();
|
pid_t pid = fork();
|
||||||
if (pid < 0) {
|
if (pid < 0) {
|
||||||
@ -87,7 +87,7 @@ int ipc_queue_loop()
|
|||||||
// STUB: need to react on status, returned by thread
|
// STUB: need to react on status, returned by thread
|
||||||
waitpid(pid,NULL,0);
|
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);
|
log_debug(qbuf.mtext,DEBUG_BASE);
|
||||||
pid_t pid = fork();
|
pid_t pid = fork();
|
||||||
|
10
yasnd.c
10
yasnd.c
@ -11,7 +11,7 @@ cfg_t *cfg; // pointer to configuration structure
|
|||||||
host_decl* hosts=NULL; // structure with hosts' definitions
|
host_decl* hosts=NULL; // structure with hosts' definitions
|
||||||
int hosts_count=0; // count of hosts
|
int hosts_count=0; // count of hosts
|
||||||
int debug_flag=0;
|
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_device=NULL; // phone device for gammu, for example: "/dev/ttyACM0"
|
||||||
char* phone_model=NULL; // gammu phone model, for example: "at"
|
char* phone_model=NULL; // gammu phone model, for example: "at"
|
||||||
char* phone_connection=NULL; // gammu phone connection type, 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_INT("debug", &debug_flag),
|
||||||
CFG_SIMPLE_BOOL("lpt_enable", &lpt_enable),
|
CFG_SIMPLE_BOOL("lpt_enable", &lpt_enable),
|
||||||
CFG_SIMPLE_INT("lpt_port", &lpt_port),
|
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_device", &phone_device),
|
||||||
CFG_SIMPLE_STR("phone_model", &phone_connection),
|
CFG_SIMPLE_STR("phone_model", &phone_connection),
|
||||||
CFG_SIMPLE_STR("phone_connection", &phone_model),
|
CFG_SIMPLE_STR("phone_connection", &phone_model),
|
||||||
@ -117,8 +117,8 @@ void init()
|
|||||||
log_event("Error parsing config file");
|
log_event("Error parsing config file");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
// if SMS sending is enabled, all of phone parameters must be explicitly defined
|
// if SMS is enabled, all of phone parameters must be explicitly defined
|
||||||
if (sms_send_enable)
|
if (sms_enable)
|
||||||
{
|
{
|
||||||
if (phone_model==NULL)
|
if (phone_model==NULL)
|
||||||
{
|
{
|
||||||
@ -161,7 +161,7 @@ void init()
|
|||||||
hosts[i].reaction_obtained=false;
|
hosts[i].reaction_obtained=false;
|
||||||
}
|
}
|
||||||
// initialize gammu structures
|
// initialize gammu structures
|
||||||
if (sms_send_enable)
|
if (sms_enable)
|
||||||
gammu_init();
|
gammu_init();
|
||||||
// initialize LPT control circuit
|
// initialize LPT control circuit
|
||||||
if (lpt_enable)
|
if (lpt_enable)
|
||||||
|
2
yasnd.h
2
yasnd.h
@ -55,7 +55,7 @@ extern char* recipient_number;
|
|||||||
extern char* phone_device; // phone device for gammu, for example: "/dev/ttyACM0"
|
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_model; // gammu phone model, for example: "at"
|
||||||
extern char* phone_connection; // gammu phone connection type, 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;
|
extern int qid;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user