From e0f771895adcd60bbc36776cf9a4ae385d00ec67 Mon Sep 17 00:00:00 2001 From: Tom Early Date: Tue, 28 Feb 2017 11:51:04 -0500 Subject: [PATCH] removed traceit() from CDVAPDongle class --- DVAPDongle.cpp | 25 ++----------------------- DVAPDongle.h | 1 - dvap_rptr.cpp | 7 ++----- 3 files changed, 4 insertions(+), 29 deletions(-) diff --git a/DVAPDongle.cpp b/DVAPDongle.cpp index c58299e..4958ad9 100644 --- a/DVAPDongle.cpp +++ b/DVAPDongle.cpp @@ -26,6 +26,8 @@ #include #include "DVAPDongle.h" +extern void traceit(const char *fmt,...); + CDVAPDongle::CDVAPDongle() : MAX_REPL_CNT(20u) { } @@ -761,26 +763,3 @@ int CDVAPDongle::KeepAlive() dvapreg.nul = 0x0u; return write_to_dvp(&dvapreg, 3); } - -void CDVAPDongle::traceit(const char *fmt,...) -{ - time_t ltime; - struct tm mytm; - const int TRACE_BFSZ = 256; - char trace_buf[TRACE_BFSZ]; - - time(<ime); - localtime_r(<ime,&mytm); - - snprintf(trace_buf,TRACE_BFSZ - 1,"%02d/%02d/%02d %02d:%02d:%02d:", - mytm.tm_mon+1,mytm.tm_mday,mytm.tm_year % 100, - mytm.tm_hour,mytm.tm_min,mytm.tm_sec); - - va_list args; - va_start(args,fmt); - vsnprintf(trace_buf + strlen(trace_buf), TRACE_BFSZ - strlen(trace_buf) - 1, fmt, args); - va_end(args); - - fprintf(stdout, "%s", trace_buf); - return; -} diff --git a/DVAPDongle.h b/DVAPDongle.h index 619b8e9..d0aff5e 100644 --- a/DVAPDongle.h +++ b/DVAPDongle.h @@ -117,5 +117,4 @@ class CDVAPDongle bool set_off(int offset); bool set_freq(int frequency); bool start_dvap(); - void traceit(const char *fmt,...); }; diff --git a/dvap_rptr.cpp b/dvap_rptr.cpp index 91a94fe..690e3bb 100644 --- a/dvap_rptr.cpp +++ b/dvap_rptr.cpp @@ -132,15 +132,12 @@ static struct sockaddr_in outaddr; static int serfd = -1; static bool busy20000 = false; std::atomic keep_running(true); -static const unsigned char DVP_REPL_HDR[] = { 0x2F, 0x60 }; -static const unsigned char DVP_REPL_PTT[] = {0x05, 0x20, 0x18, 0x01, 0x00}; -static const unsigned char DVP_STS[] = {0x07, 0x20, 0x90, 0x00, 0x00, 0x00, 0x00}; static unsigned int space = 0; static unsigned int aseed = 0; /* helper routines */ -static void traceit(const char *fmt,...); +void traceit(const char *fmt,...); static int read_config(const char *cfgFile); static void sig_catch(int signum); static int open_sock(); @@ -200,7 +197,7 @@ static void sig_catch(int signum) } /* log the event */ -static void traceit(const char *fmt,...) +void traceit(const char *fmt,...) { time_t ltime; struct tm mytm;