PPS-Client
1.4.0
Client for synchronizing the system clock to a GPS PPS source
|
The pps-files.cpp file contains functions and structures for saving files intended for PPS-Client status monitoring and analysis. More...
#include "../client/pps-client.h"
Go to the source code of this file.
Data Structures | |
struct | ppsFilesVars |
Functions | |
void | initFileLocalData (void) |
int | sysCommand (const char *cmd) |
char * | getString (int key) |
bool | hasString (int key, const char *string) |
bool | isEnabled (int key) |
bool | isDisabled (int key) |
void | couldNotOpenMsgTo (char *logbuf, const char *filename) |
void | errorReadingMsgTo (char *logbuf, const char *filename) |
void | writeToLogNoTimestamp (char *logbuf) |
void | writeToLog (char *logbuf) |
void | bufferStatusMsg (const char *msg) |
int | writeStatusStrings (void) |
int | read_logerr (int fd, char *buf, int sz, const char *filename) |
int | open_logerr (const char *filename, int flags) |
int | writeFileMsgToLogbuf (const char *filename, char *logbuf) |
int | writeFileMsgToLog (const char *filename) |
pid_t | getChildPID (void) |
bool | ppsIsRunning (void) |
int | createPIDfile (void) |
bool | configHasValue (int config_val, void *value) |
int | getDriverGPIOvals (void) |
int | readConfigFile (void) |
void | writeDistribution (int distrib[], int len, int scaleZero, int count, int *last_epoch, const char *distrib_file, const char *last_distrib_file) |
void | writeMultipleDistrib (int label[], int distrib[][INTRPT_DISTRIB_LEN], int len, int scaleZero, int count, int *last_epoch, const char *distrib_file, const char *last_distrib_file) |
void | writeIntrptDistribFile (void) |
void | writeSysdelayDistribFile (void) |
void | writeJitterDistribFile (void) |
void | writeErrorDistribFile (void) |
void | writeOffsets (const char *filename) |
void | writeFrequencyVars (const char *filename) |
int | saveDoubleArray (double distrib[], const char *filename, int len, int arrayZero) |
int | processWriteRequest (void) |
int | processFiles (void) |
void | writeSysDelay (void) |
void | writeTimestamp (double timestamp) |
int | alignNumbersAfter (const char *token, char *buf, int len) |
int | alignTokens (const char *refToken, int offset, const char *token, char *buf, int len) |
int | bufferStateParams (void) |
int | restartNTP (void) |
int | replaceNTPConfig (const char *fbuf) |
void | removeConfigKeys (const char *key1, const char *key2, char *fbuf) |
int | disableNTP (void) |
int | enableNTP (void) |
char * | copyMajorTo (char *majorPos) |
char * | getLinuxVersion (void) |
int | driver_load (int ppsGPIO, int outputGPIO, int intrptGPIO) |
void | driver_unload () |
int | getSeqNum (const char *pbuf) |
void | showStatusEachSecond (void) |
void | INThandler (int sig) |
bool | missingArg (int argc, char *argv[], int i) |
int | daemonSaveArray (const char *requestStr, const char *filename) |
void | printAcceptedArgs (void) |
int | parseSaveDataRequest (int argc, char *argv[], const char *requestStr) |
int | accessDaemon (int argc, char *argv[]) |
void | buildErrorDistrib (int timeCorrection) |
void | buildJitterDistrib (int rawError) |
void | TERMhandler (int sig) |
void | HUPhandler (int sig) |
int | getDelayIndex (int sysDelay) |
void | buildInterruptDistrib (int intrptDelay) |
void | buildSysDelayDistrib (int sysDelay) |
void | recordFrequencyVars (void) |
void | recordOffsets (int timeCorrection) |
Variables | |
struct G | g |
Declares the global variables defined in pps-client.h. More... | |
const char * | last_distrib_file = "/var/local/pps-error-distrib" |
Stores the completed distribution of offset corrections. More... | |
const char * | distrib_file = "/var/local/pps-error-distrib-forming" |
Stores a forming distribution of offset corrections. More... | |
const char * | last_jitter_distrib_file = "/var/local/pps-jitter-distrib" |
Stores the completed distribution of offset corrections. More... | |
const char * | jitter_distrib_file = "/var/local/pps-jitter-distrib-forming" |
Stores a forming distribution of offset corrections. More... | |
const char * | log_file = "/var/log/pps-client.log" |
Stores activity and errors. More... | |
const char * | old_log_file = "/var/log/pps-client.old.log" |
Stores activity and errors. More... | |
const char * | last_intrpt_distrib_file = "/var/local/pps-intrpt-distrib" |
Stores the completed distribution of offset corrections. More... | |
const char * | intrpt_distrib_file = "/var/local/pps-intrpt-distrib-forming" |
Stores a forming distribution of offset corrections. More... | |
const char * | sysDelay_distrib_file = "/var/local/pps-sysDelay-distrib-forming" |
Stores a forming distribution of sysDelay values. More... | |
const char * | last_sysDelay_distrib_file = "/var/local/pps-sysDelay-distrib" |
Stores a distribution of sysDelay. More... | |
const char * | pidFilename = "/var/run/pps-client.pid" |
Stores the PID of PPS-Client. More... | |
const char * | config_file = "/etc/pps-client.conf" |
The PPS-Client configuration file. More... | |
const char * | ntp_config_file = "/etc/ntp.conf" |
The NTP configuration file. More... | |
const char * | ntp_config_bac = "/etc/ntp.conf.bac" |
Backup of the NTP configuration file. More... | |
const char * | ntp_config_part = "/etc/ntp.conf.part" |
Temporary filename for an NTP config file during copy. More... | |
const char * | sysDelay_file = "/run/shm/pps-sysDelay" |
The current sysDelay value updated each second. More... | |
const char * | assert_file = "/run/shm/pps-assert" |
The timestamps of the time corrections each second. More... | |
const char * | displayParams_file = "/run/shm/pps-display-params" |
Temporary file storing params for the status display. More... | |
const char * | arrayData_file = "/run/shm/pps-save-data" |
Stores a request sent to the PPS-Client daemon. More... | |
const char * | space = " " |
const char * | num = "0123456789." |
const char * | version |
Program version 1.4.0 created on 17 Dec 2017. More... | |
const char * | valid_config [] |
struct saveFileData | arrayData [] |
The pps-files.cpp file contains functions and structures for saving files intended for PPS-Client status monitoring and analysis.
Copyright (C) 2016-2018 Raymond S. Connell
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Definition in file pps-files.cpp.
int accessDaemon | ( | int | argc, |
char * | argv[] | ||
) |
Provides command line access to the PPS-Client daemon.
Checks if program is running. If not, returns -1. If an error occurs returns -2. If the program is running then returns 0 and prints a message to that effect.
Recognizes data save requests (-s) and forwards these to the daemon interface.
If verbose flag (-v) is read then also displays status params of the running program to the terminal.
[in] | argc | System command line arg |
[in] | argv | System command line arg |
Definition at line 1989 of file pps-files.cpp.
int alignNumbersAfter | ( | const char * | token, |
char * | buf, | ||
int | len | ||
) |
Provides formatting for console printf() strings.
Horizontally left-aligns a number following token, ignoring numeric sign, in a buffer generated by sprintf() by padding the buffer with spaces preceding the number to be aligned and returning the adjusted length of the buffer.
[in] | token | The token string preceding the number to be aligned. |
[in,out] | buf | The buffer containing the token. |
[in] | len | The initial length of the buffer. |
Definition at line 1211 of file pps-files.cpp.
int alignTokens | ( | const char * | refToken, |
int | offset, | ||
const char * | token, | ||
char * | buf, | ||
int | len | ||
) |
Provides formatting for console printf() strings.
Horizontally aligns token by a fixed number of characters from the end of refToken by padding the buffer with spaces at the end of the number following refToken.
[in] | refToken | The reference token which is followed by a number having a variable length. |
[in] | offset | The number of characters in the adjusted buffer from the end of refToken to the start of token. |
[in] | token | The token to be aligned. |
[out] | buf | The buffer containing the tokens. |
[in] | len | the initial length of the buffer. |
Definition at line 1252 of file pps-files.cpp.
int bufferStateParams | ( | void | ) |
Records a state params string to a buffer, savebuf, that is saved to a tmpfs memory file by writeStatusStrings() along with other relevant messages recorded during the same second.
Definition at line 1291 of file pps-files.cpp.
void bufferStatusMsg | ( | const char * | msg | ) |
Concatenates msg to a message buffer, savebuf, which is saved to a tmpfs memory file by writeStatusStrings() each second. These messages can be read and displayed to the command line by showStatusEachSecond().
[in] | msg | Pointer to the message to be concatenated. |
Definition at line 290 of file pps-files.cpp.
void buildErrorDistrib | ( | int | timeCorrection | ) |
Constructs a distribution of time correction values with zero offset at middle index that can be saved to disk for analysis.
A time correction is the raw time error passed through a hard limitter to remove jitter and then scaled by the proportional gain constant.
[in] | timeCorrection | The time correction value to be accumulated to a distribution. |
Definition at line 2043 of file pps-files.cpp.
void buildInterruptDistrib | ( | int | intrptDelay | ) |
Accumulates a distribution of interrupt delay.
[in] | intrptDelay | The interrupt delay value returned from the PPS-Client device driver. |
Definition at line 2137 of file pps-files.cpp.
void buildJitterDistrib | ( | int | rawError | ) |
Constructs a distribution of jitter that can be saved to disk for analysis.
All jitter is collected including delay spikes.
[in] | rawError | The raw error jitter value to save to the distribution. |
Definition at line 2067 of file pps-files.cpp.
void buildSysDelayDistrib | ( | int | sysDelay | ) |
Accumulates a distribution of sysDelay that can be saved to disk for analysis.
[in] | sysDelay | The sysDelay value to be recorded to the distribution. |
Definition at line 2161 of file pps-files.cpp.
bool configHasValue | ( | int | config_val, |
void * | value | ||
) |
Tests configuration strings from /etc/pps-client.conf for a numeric value and returns it in the value pointer. The numeric value may be either int or double with the value pointer and the presence of a decimal point determining int or double.
[in] | config_val | The configuration identifier value. |
[out] | value | The returned numeric value as int or double. |
Definition at line 550 of file pps-files.cpp.
char* copyMajorTo | ( | char * | majorPos | ) |
Reads the major number assigned to gps-pps-io from "/proc/devices" as a string which is returned in the majorPos char pointer. This value is used to load the hardware driver that PPS-Client requires to load PPS interrupt times.
[in,out] | majorPos | A string possibly containing the major number. |
Definition at line 1583 of file pps-files.cpp.
void couldNotOpenMsgTo | ( | char * | logbuf, |
const char * | filename | ||
) |
Constructs an error message.
Definition at line 191 of file pps-files.cpp.
int createPIDfile | ( | void | ) |
Creates a PID file for the PPS-Client daemon.
Definition at line 515 of file pps-files.cpp.
int daemonSaveArray | ( | const char * | requestStr, |
const char * | filename | ||
) |
Transmits a data save request to the PPS-Client daemon via data written to a tmpfs shared memory file.
[in] | requestStr | The request string. |
[in] | filename | The shared memory file to write to. |
Definition at line 1874 of file pps-files.cpp.
int disableNTP | ( | void | ) |
Disables NTP control of system time by appending "disable ntp" to the NTP config file and then restarting NTP.
Definition at line 1462 of file pps-files.cpp.
int driver_load | ( | int | ppsGPIO, |
int | outputGPIO, | ||
int | intrptGPIO | ||
) |
Loads the hardware driver required by PPS-Client which is expected to be available in the file: "/lib/modules/`uname -r`/kernel/drivers/misc/gps-pps-io.ko".
[in] | ppsGPIO | A GPIO number to be assigned to the driver. |
[in] | outputGPIO | A GPIO number to be assigned to the driver. |
[in] | intrptGPIO | A GPIO number to be assigned to the driver. |
Definition at line 1668 of file pps-files.cpp.
void driver_unload | ( | ) |
Unloads the gps-pps-io hardware driver.
Definition at line 1733 of file pps-files.cpp.
int enableNTP | ( | void | ) |
Enables NTP control of system time by removing "disable ntp" from the NTP config file and then restarting NTP.
Definition at line 1527 of file pps-files.cpp.
void errorReadingMsgTo | ( | char * | logbuf, |
const char * | filename | ||
) |
Constructs an error message.
Definition at line 202 of file pps-files.cpp.
pid_t getChildPID | ( | void | ) |
Reads the PID of the child process when the parent process needs to kill it.
Definition at line 447 of file pps-files.cpp.
int getDelayIndex | ( | int | sysDelay | ) |
Generates an unordered list of unique sysDelay values in the g.delayLabel array and returns the index in the array of any sysDelay value.
[in] | sysDelay | The value. |
Definition at line 2114 of file pps-files.cpp.
int getDriverGPIOvals | ( | void | ) |
Reads PPS-Client driver GPIO number assignments from "/etc/pps-client.conf" and stores them as temporary values in the global variables struct to be passed to the PPS-Client driver when it is loaded.
These values are not persistent.
Definition at line 575 of file pps-files.cpp.
char* getLinuxVersion | ( | void | ) |
Definition at line 1638 of file pps-files.cpp.
int getSeqNum | ( | const char * | pbuf | ) |
Extracts the sequence number g.seq_num from a char string and returns the value.
[in] | pbuf | The string to search. |
Definition at line 1747 of file pps-files.cpp.
char* getString | ( | int | key | ) |
Retrieves the string from the config file assigned to the valid_config string with value key.
[in] | key | The config key corresponding to a string in the valid_config[] array above. |
Definition at line 108 of file pps-files.cpp.
bool hasString | ( | int | key, |
const char * | string | ||
) |
Tests configuration strings from /etc/pps-client.conf for the specified string. To avoid searching the config file more than once, the config key is a bit position in g.config_select that is set or not set if the corresponding config string is found in the config file when it is first read. In that case an array g.configVals[], constructed when the config file was read, will contain the string from the config file that followed the valid_config. That string will be g.configVals[log2(key)].
[in] | key | The config key corresponding to a string in the valid_config[] array above. |
[in] | string | The string that must be matched by the string that follows the config string name from the valid_config[] array. |
Definition at line 137 of file pps-files.cpp.
void HUPhandler | ( | int | sig | ) |
Catches the SIGHUP signal, causing it to be ignored.
[in] | sig | The signal from the system. |
Definition at line 2101 of file pps-files.cpp.
void initFileLocalData | ( | void | ) |
void INThandler | ( | int | sig | ) |
Responds to the ctrl-c key combination by setting the exit_loop flag. This causes an exit from the showStatusEachSecond() function.
[in] | sig | The signal returned by the system. |
Definition at line 1842 of file pps-files.cpp.
bool isDisabled | ( | int | key | ) |
Tests configuration strings from /etc/pps-client.conf for the "disable" keyword.
[in] | key | The config key corresponding to a string in the valid_config[] array above. |
Definition at line 173 of file pps-files.cpp.
bool isEnabled | ( | int | key | ) |
Tests configuration strings from /etc/pps-client.conf for the "enable" keyword.
[in] | key | The config key corresponding to a string in the valid_config[] array above. |
Definition at line 159 of file pps-files.cpp.
bool missingArg | ( | int | argc, |
char * | argv[], | ||
int | i | ||
) |
Checks for and reports on missing arguments in a command line request.
[in] | argc | System command line arg |
[in] | argv | System command line arg |
[in] | i | The number of args. |
Definition at line 1857 of file pps-files.cpp.
int open_logerr | ( | const char * | filename, |
int | flags | ||
) |
Opens a file with error logging and sets standard file permissions for O_CREAT.
[in] | filename | The file to open. |
[in] | flags | The file open flags. |
Definition at line 366 of file pps-files.cpp.
int parseSaveDataRequest | ( | int | argc, |
char * | argv[], | ||
const char * | requestStr | ||
) |
Reads a command line save data request and either forwards the data to the daemon interface or prints entry errors back to the terminal.
[in] | argc | System command line arg |
[in] | argv | System command line arg |
[in] | requestStr | The request string. |
Definition at line 1923 of file pps-files.cpp.
bool ppsIsRunning | ( | void | ) |
Uses a system call to pidof to see if PPS-Client is running.
Definition at line 475 of file pps-files.cpp.
void printAcceptedArgs | ( | void | ) |
Prints a list to the terminal of the command line args for saving data that are recognized by PPS-Client.
Definition at line 1904 of file pps-files.cpp.
int processFiles | ( | void | ) |
Processes the files and configuration settings specified by the PPS-Client config file.
Definition at line 1086 of file pps-files.cpp.
int processWriteRequest | ( | void | ) |
From within the daemon, reads the data label and filename of an array to write to disk from a request made from the command line with "pps-client -s [label] <filename>". Then matches the requestStr to the corresponding arrayData which is then passed to a routine that saves the array identified by the data label.
Definition at line 1033 of file pps-files.cpp.
int read_logerr | ( | int | fd, |
char * | buf, | ||
int | sz, | ||
const char * | filename | ||
) |
Reads a file with error logging.
[in] | fd | The file descriptor. |
[out] | buf | The buffer to hold the file data. |
[in] | sz | The number of bytes to read. |
[in] | filename | The filename of the file being read. |
Definition at line 347 of file pps-files.cpp.
int readConfigFile | ( | void | ) |
Reads the PPS-Client config file and sets bits in g.config_select to 1 or 0 corresponding to whether a particular g.configVals appears in the config file. The g.configVals from the file is then copied to fbuf and a pointer to that string is placed in the g.configVals array.
If the g.configVals did not occur in the config file then g.configVals has a NULL char* in the corresponding location.
Definition at line 626 of file pps-files.cpp.
void recordFrequencyVars | ( | void | ) |
Accumulates the clock frequency offset over the last 5 minutes and records offset difference each minute over the previous 5 minute interval. This function is called once each minute.
The values of offset difference, g.freqOffsetDiff[], are used to calculate the Allan deviation of the clock frequency offset which is determined so that it can be saved to disk. g.freqOffsetSum is used to calculate the average clock frequency offset in each 5 minute interval so that value can also be saved to disk.
Definition at line 2185 of file pps-files.cpp.
void recordOffsets | ( | int | timeCorrection | ) |
Each second, records the time correction that was applied to the system clock and also records the last clock frequency offset (in parts per million) that was applied to the system clock.
These values are recorded so that they may be saved to disk for analysis.
[in] | timeCorrection | The time correction value to be recorded. |
Definition at line 2231 of file pps-files.cpp.
void removeConfigKeys | ( | const char * | key1, |
const char * | key2, | ||
char * | fbuf | ||
) |
Removes all lines containing "key1 key2" from the text in fbuf.
[in] | key1 | |
[in] | key2 | |
[out] | fbuf | The text buffer to process. |
Definition at line 1413 of file pps-files.cpp.
int replaceNTPConfig | ( | const char * | fbuf | ) |
Replaces the NTP config file with the text in fbuf using write before replace after first backing up /etc/ntp.conf if the backup does not already exist.
[in] | fbuf | The replacement text. |
Definition at line 1369 of file pps-files.cpp.
int restartNTP | ( | void | ) |
Restarts NTP with error message handling.
Definition at line 1350 of file pps-files.cpp.
int saveDoubleArray | ( | double | distrib[], |
const char * | filename, | ||
int | len, | ||
int | arrayZero | ||
) |
Saves a distribution consisting of an array of doubles.
[in] | distrib | The distribution array. |
[in] | filename | The file to save to. |
[in] | len | The length of the array. |
[in] | arrayZero | The array index of distribution value zero. |
Definition at line 991 of file pps-files.cpp.
void showStatusEachSecond | ( | void | ) |
Reads the state params saved to shared memory by the PPS-Client daemon and prints the param string to the console each second.
Definition at line 1767 of file pps-files.cpp.
int sysCommand | ( | const char * | cmd | ) |
Definition at line 89 of file pps-files.cpp.
void TERMhandler | ( | int | sig | ) |
Responds to the SIGTERM signal by starting the exit sequence in the daemon.
[in] | sig | The signal from the system. |
Definition at line 2088 of file pps-files.cpp.
void writeDistribution | ( | int | distrib[], |
int | len, | ||
int | scaleZero, | ||
int | count, | ||
int * | last_epoch, | ||
const char * | distrib_file, | ||
const char * | last_distrib_file | ||
) |
Writes an accumulating statistical distribution to disk and rolls over the accumulating data to a new file every epoch counts and begins a new distribution file. An epoch is 86,400 counts.
[in] | distrib | The array containing the distribution. |
[in] | len | The length of the array. |
[in] | scaleZero | The array index corresponding to distribution zero. |
[in] | count | The current number of samples in the distribution. |
[out] | last_epoch | The saved count of the previous epoch. |
[in] | distrib_file | The filename of the last completed distribution file. |
[in] | last_distrib_file | The filename of the currently forming distribution file. |
Definition at line 759 of file pps-files.cpp.
void writeErrorDistribFile | ( | void | ) |
Writes a distribution to disk approximately once a minute containing 60 additional time correction samples derived from the PPS interrupt. The distribution is rolled over to a new file every 24 hours.
Definition at line 917 of file pps-files.cpp.
int writeFileMsgToLog | ( | const char * | filename | ) |
Writes the message saved in the file to pps-client.log.
[in] | filename | File containg a message. |
Definition at line 437 of file pps-files.cpp.
int writeFileMsgToLogbuf | ( | const char * | filename, |
char * | logbuf | ||
) |
Writes the message saved in the file to pps-client.log.
This function is used by threads in pps-sntp.cpp.
[in] | filename | File containg a message. |
[out] | logbuf | The log file buffer. |
Definition at line 393 of file pps-files.cpp.
void writeFrequencyVars | ( | const char * | filename | ) |
Writes the last 24 hours of clock frequency offset and Allan deviation in each 5 minute interval indexed by the timestamp at each interval.
[in] | filename | The file to write to. |
Definition at line 958 of file pps-files.cpp.
void writeIntrptDistribFile | ( | void | ) |
Writes a multiple distribution to disk containing 60 additional calibration interrupt delays approximately every minute. One is generated for each diffent sysDelay that occurs over the test period.
Collects one day of interrupt delay samples before rolling over a new file.
Definition at line 878 of file pps-files.cpp.
void writeJitterDistribFile | ( | void | ) |
Writes a distribution to disk approximately once a minute containing 60 additional jitter samples recorded at the occurrance of the PPS interrupt. The distribution is rolled over to a new file every 24 hours.
Definition at line 903 of file pps-files.cpp.
void writeMultipleDistrib | ( | int | label[], |
int | distrib[][INTRPT_DISTRIB_LEN], | ||
int | len, | ||
int | scaleZero, | ||
int | count, | ||
int * | last_epoch, | ||
const char * | distrib_file, | ||
const char * | last_distrib_file | ||
) |
Writes multiple distributions with a separate distribution in each column of the file after the first for each sysDelay value that occurs.
The first line of the file lists the sysDelay values as column headings. The second line of the file lists the column total samples.
Rolls over the accumulating data to a new file every epoch counts and begins a new distribution file. An epoch is 86,400 counts.
[in] | label | The sysDelay values for each column. |
[in] | distrib | The arrays containing the distributions. |
[in] | len | The length of the distrib[] arrays. |
[in] | scaleZero | The array index corresponding to distribution zero. |
[in] | count | The current total number of samples in the distributions. |
[out] | last_epoch | The saved count of the previous epoch. |
[in] | distrib_file | The filename of the last completed distribution file. |
[in] | last_distrib_file | The filename of the currently forming file. |
Definition at line 810 of file pps-files.cpp.
void writeOffsets | ( | const char * | filename | ) |
Writes the previously completed list of 10 minutes of recorded time offsets and applied frequency offsets indexed by seq_num.
[in] | filename | The file to write to. |
Definition at line 931 of file pps-files.cpp.
int writeStatusStrings | ( | void | ) |
Writes status strings accumulated in a message buffer, g.savebuf, from bufferStateParams() and other sources to a tmpfs memory file, displayParams_file, once each second. This file can be displayed in real time by invoking the PPS-Client program with the -v command line flag while the PPS-Client daemon is running.
Definition at line 316 of file pps-files.cpp.
void writeSysDelay | ( | void | ) |
Write g.sysDelay to a temporary file each second.
The sysDelay value can be read by other programs that are timing external interrupts.
Definition at line 1157 of file pps-files.cpp.
void writeSysdelayDistribFile | ( | void | ) |
Writes a distribution to disk containing 60 additional sysDelay samples approximately every minute. Collects one day of sysDelay samples before rolling over a new file.
Definition at line 890 of file pps-files.cpp.
void writeTimestamp | ( | double | timestamp | ) |
Write a timestamp provided as a double to a temporary file each second.
[in] | timestamp | The timestamp value. |
Definition at line 1179 of file pps-files.cpp.
void writeToLog | ( | char * | logbuf | ) |
Appends logbuf to the log file with a timestamp.
[in,out] | logbuf | Pointer to the log buffer. |
Definition at line 247 of file pps-files.cpp.
void writeToLogNoTimestamp | ( | char * | logbuf | ) |
Appends logbuf to the log file.
[in,out] | logbuf | Pointer to the log buffer. |
Definition at line 215 of file pps-files.cpp.
struct saveFileData arrayData[] |
Data associations for PPS-Client command line save data requests with the -s flag.
Definition at line 181 of file pps-files.cpp.
const char* arrayData_file = "/run/shm/pps-save-data" |
Stores a request sent to the PPS-Client daemon.
Definition at line 45 of file pps-files.cpp.
const char* assert_file = "/run/shm/pps-assert" |
The timestamps of the time corrections each second.
Definition at line 43 of file pps-files.cpp.
const char* config_file = "/etc/pps-client.conf" |
The PPS-Client configuration file.
Definition at line 37 of file pps-files.cpp.
const char* displayParams_file = "/run/shm/pps-display-params" |
Temporary file storing params for the status display.
Definition at line 44 of file pps-files.cpp.
const char* distrib_file = "/var/local/pps-error-distrib-forming" |
Stores a forming distribution of offset corrections.
Definition at line 26 of file pps-files.cpp.
struct G g |
Declares the global variables defined in pps-client.h.
Definition at line 53 of file pps-client.cpp.
const char* intrpt_distrib_file = "/var/local/pps-intrpt-distrib-forming" |
Stores a forming distribution of offset corrections.
Definition at line 32 of file pps-files.cpp.
const char* jitter_distrib_file = "/var/local/pps-jitter-distrib-forming" |
Stores a forming distribution of offset corrections.
Definition at line 28 of file pps-files.cpp.
const char* last_distrib_file = "/var/local/pps-error-distrib" |
Stores the completed distribution of offset corrections.
Definition at line 25 of file pps-files.cpp.
const char* last_intrpt_distrib_file = "/var/local/pps-intrpt-distrib" |
Stores the completed distribution of offset corrections.
Definition at line 31 of file pps-files.cpp.
const char* last_jitter_distrib_file = "/var/local/pps-jitter-distrib" |
Stores the completed distribution of offset corrections.
Definition at line 27 of file pps-files.cpp.
const char* last_sysDelay_distrib_file = "/var/local/pps-sysDelay-distrib" |
Stores a distribution of sysDelay.
Definition at line 34 of file pps-files.cpp.
const char* log_file = "/var/log/pps-client.log" |
Stores activity and errors.
Definition at line 29 of file pps-files.cpp.
const char* ntp_config_bac = "/etc/ntp.conf.bac" |
Backup of the NTP configuration file.
Definition at line 39 of file pps-files.cpp.
const char* ntp_config_file = "/etc/ntp.conf" |
The NTP configuration file.
Definition at line 38 of file pps-files.cpp.
const char* ntp_config_part = "/etc/ntp.conf.part" |
Temporary filename for an NTP config file during copy.
Definition at line 40 of file pps-files.cpp.
const char* num = "0123456789." |
Definition at line 48 of file pps-files.cpp.
const char* old_log_file = "/var/log/pps-client.old.log" |
Stores activity and errors.
Definition at line 30 of file pps-files.cpp.
const char* pidFilename = "/var/run/pps-client.pid" |
Stores the PID of PPS-Client.
Definition at line 35 of file pps-files.cpp.
const char* space = " " |
Definition at line 47 of file pps-files.cpp.
const char* sysDelay_distrib_file = "/var/local/pps-sysDelay-distrib-forming" |
Stores a forming distribution of sysDelay values.
Definition at line 33 of file pps-files.cpp.
const char* sysDelay_file = "/run/shm/pps-sysDelay" |
The current sysDelay value updated each second.
Definition at line 42 of file pps-files.cpp.
const char* valid_config[] |
Recognized configuration strings for the PPS-Client configuration file.
Definition at line 69 of file pps-files.cpp.
const char* version |
Program version 1.4.0 created on 17 Dec 2017.
Definition at line 51 of file pps-client.cpp.