comparison include/ClockSync.h @ 152:8f98b32d0e23 ClockSync

Last commit on this branch for a while. Overall not very succesful
author Giulio Moro <giuliomoro@yahoo.it>
date Mon, 05 Oct 2015 13:06:14 +0100
parents 134bff10e561
children
comparison
equal deleted inserted replaced
151:e9c9404e3d1f 152:8f98b32d0e23
49 int receiveLoopTimeout; 49 int receiveLoopTimeout;
50 char buffer[kSyncMessageLength]; 50 char buffer[kSyncMessageLength];
51 VirtualClock *virtualClock; 51 VirtualClock *virtualClock;
52 void resetTs(); 52 void resetTs();
53 bool areTsValid(); 53 bool areTsValid();
54 void processOffset(double offset); 54 void processOffset();
55 float offset;
56 float nlOffset;
57 float iirOffset;
55 Pid pid; 58 Pid pid;
56 public: 59 public:
57 ClockSync(){}; 60 ClockSync(){};
58 ClockSync(bool thisIsSlave, int aPort, VirtualClock &aVirtualClock); 61 ClockSync(bool thisIsSlave, int aPort, VirtualClock &aVirtualClock);
59 void init(bool thisIsSlave, int aPort, VirtualClock &aVirtualClock); 62 void init(bool thisIsSlave, int aPort, VirtualClock &aVirtualClock);
65 void setVirtualClock(VirtualClock &aVirtualClock); 68 void setVirtualClock(VirtualClock &aVirtualClock);
66 void setPort(int aPort); 69 void setPort(int aPort);
67 void setType(int clockSyncType); 70 void setType(int clockSyncType);
68 void setTimestamp(myClock_t timestamp); 71 void setTimestamp(myClock_t timestamp);
69 void print(); 72 void print();
73 float getOffset();
74 float getIirOffset();
75
70 /** 76 /**
71 * sends a clockSync without blocking, checks results and returns the timestamp 77 * sends a clockSync without blocking, checks results and returns the timestamp
72 * immediately after the clockSync has been sent or -1 if there was an error or timeout expired. 78 * immediately after the clockSync has been sent or -1 if there was an error or timeout expired.
73 */ 79 */
74 myClock_t send(); 80 myClock_t send();