mirror of
https://github.com/lwvmobile/dsd-fme.git
synced 2026-11-19 20:27:26 -05:00
DMR: Fix LRRP Report to File Format; #281
This commit is contained in:
@@ -1302,6 +1302,7 @@ char * getTimeC();
|
|||||||
char * getTimeN(time_t t);
|
char * getTimeN(time_t t);
|
||||||
char * getDate();
|
char * getDate();
|
||||||
char * getDateH();
|
char * getDateH();
|
||||||
|
char * getDateS();
|
||||||
char * getDateN(time_t t);
|
char * getDateN(time_t t);
|
||||||
|
|
||||||
//dmr alg stuff
|
//dmr alg stuff
|
||||||
|
|||||||
@@ -433,8 +433,8 @@ void dmr_lrrp (dsd_opts * opts, dsd_state * state, uint16_t len, uint32_t source
|
|||||||
FILE * pFile; //file pointer
|
FILE * pFile; //file pointer
|
||||||
if (opts->lrrp_file_output == 1)
|
if (opts->lrrp_file_output == 1)
|
||||||
{
|
{
|
||||||
char * timestr = getTime();
|
char * timestr = getTimeC();
|
||||||
char * datestr = getDate();
|
char * datestr = getDateS();
|
||||||
|
|
||||||
//open file by name that is supplied in the ncurses terminal, or cli
|
//open file by name that is supplied in the ncurses terminal, or cli
|
||||||
pFile = fopen (opts->lrrp_out_file, "a");
|
pFile = fopen (opts->lrrp_out_file, "a");
|
||||||
|
|||||||
@@ -60,6 +60,16 @@ char * getDateH()
|
|||||||
return curr;
|
return curr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//get YYYY-MM-DD with forward slash (LRRP files)
|
||||||
|
char * getDateS()
|
||||||
|
{
|
||||||
|
char * curr = calloc(27, sizeof(char));
|
||||||
|
time_t t = time(NULL);
|
||||||
|
struct tm * ptm = localtime(& t);
|
||||||
|
sprintf(curr, "%04d/%02d/%02d", ptm->tm_year+1900, ptm->tm_mon+1, ptm->tm_mday);
|
||||||
|
return curr;
|
||||||
|
}
|
||||||
|
|
||||||
//get YYYY-MM-DD with hyphen (Ncurses Call History)
|
//get YYYY-MM-DD with hyphen (Ncurses Call History)
|
||||||
char * getDateN(time_t t)
|
char * getDateN(time_t t)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user