DMR: Fix LRRP Report to File Format; #281

This commit is contained in:
lwvmobile
2025-02-25 11:11:28 -05:00
parent f6aba4a5a4
commit 69dd1d167b
3 changed files with 13 additions and 2 deletions

View File

@@ -1302,6 +1302,7 @@ char * getTimeC();
char * getTimeN(time_t t);
char * getDate();
char * getDateH();
char * getDateS();
char * getDateN(time_t t);
//dmr alg stuff

View File

@@ -433,8 +433,8 @@ void dmr_lrrp (dsd_opts * opts, dsd_state * state, uint16_t len, uint32_t source
FILE * pFile; //file pointer
if (opts->lrrp_file_output == 1)
{
char * timestr = getTime();
char * datestr = getDate();
char * timestr = getTimeC();
char * datestr = getDateS();
//open file by name that is supplied in the ncurses terminal, or cli
pFile = fopen (opts->lrrp_out_file, "a");

View File

@@ -60,6 +60,16 @@ char * getDateH()
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)
char * getDateN(time_t t)
{