123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- #ifndef PPSTHREAD_H
- #define PPSTHREAD_H
- #include <time.h>
- #ifndef TIMEDELTA_DEFINED
- #define TIMEDELTA_DEFINED
- struct timedelta_t {
- struct timespec real;
- struct timespec clock;
- };
- #endif
- struct pps_thread_t {
- void *context;
- socket_t devicefd;
- char *devicename;
- char *(*report_hook)(volatile struct pps_thread_t *,
- struct timedelta_t *);
- void (*log_hook)(volatile struct pps_thread_t *,
- int errlevel, const char *fmt, ...);
- struct timedelta_t fix_in;
- struct timedelta_t pps_out;
- int ppsout_count;
-
- long qErr;
-
- struct timespec qErr_time;
- };
- #define THREAD_ERROR 0
- #define THREAD_WARN 1
- #define THREAD_INF 2
- #define THREAD_PROG 3
- #define THREAD_RAW 4
- extern void pps_thread_activate(volatile struct pps_thread_t *);
- extern void pps_thread_deactivate(volatile struct pps_thread_t *);
- extern void pps_thread_fixin(volatile struct pps_thread_t *,
- volatile struct timedelta_t *);
- extern void pps_thread_qErrin(volatile struct pps_thread_t *pps_thread,
- long qErr, struct timespec qErr_time);
- extern int pps_thread_ppsout(volatile struct pps_thread_t *,
- volatile struct timedelta_t *);
- int pps_check_fake(const char *);
- char *pps_get_first(void);
- #endif
|