removed traceit() from CDVAPDongle class

pull/1/head
Tom Early 9 years ago
parent 6cc65d4f8a
commit e0f771895a

@ -26,6 +26,8 @@
#include <sys/file.h> #include <sys/file.h>
#include "DVAPDongle.h" #include "DVAPDongle.h"
extern void traceit(const char *fmt,...);
CDVAPDongle::CDVAPDongle() : MAX_REPL_CNT(20u) CDVAPDongle::CDVAPDongle() : MAX_REPL_CNT(20u)
{ {
} }
@ -761,26 +763,3 @@ int CDVAPDongle::KeepAlive()
dvapreg.nul = 0x0u; dvapreg.nul = 0x0u;
return write_to_dvp(&dvapreg, 3); 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(&ltime);
localtime_r(&ltime,&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;
}

@ -117,5 +117,4 @@ class CDVAPDongle
bool set_off(int offset); bool set_off(int offset);
bool set_freq(int frequency); bool set_freq(int frequency);
bool start_dvap(); bool start_dvap();
void traceit(const char *fmt,...);
}; };

@ -132,15 +132,12 @@ static struct sockaddr_in outaddr;
static int serfd = -1; static int serfd = -1;
static bool busy20000 = false; static bool busy20000 = false;
std::atomic<bool> keep_running(true); std::atomic<bool> 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 space = 0;
static unsigned int aseed = 0; static unsigned int aseed = 0;
/* helper routines */ /* helper routines */
static void traceit(const char *fmt,...); void traceit(const char *fmt,...);
static int read_config(const char *cfgFile); static int read_config(const char *cfgFile);
static void sig_catch(int signum); static void sig_catch(int signum);
static int open_sock(); static int open_sock();
@ -200,7 +197,7 @@ static void sig_catch(int signum)
} }
/* log the event */ /* log the event */
static void traceit(const char *fmt,...) void traceit(const char *fmt,...)
{ {
time_t ltime; time_t ltime;
struct tm mytm; struct tm mytm;

Loading…
Cancel
Save

Powered by TurnKey Linux.