OSDN Git Service

Move the definition of time server state.
authorJohn Grossman <johngro@google.com>
Tue, 17 Jan 2012 18:20:12 +0000 (10:20 -0800)
committerJohn Grossman <johngro@google.com>
Sat, 4 Feb 2012 01:45:17 +0000 (17:45 -0800)
Move the State enum up to the ICommonClock interface so it can be
returned for status/debugging up to clients.

Change-Id: I81fef5b96ffc69a4f2e9801b3744feea099ccd47

include/common_time/ICommonClock.h

index d723d1b..65f0c01 100644 (file)
@@ -70,6 +70,25 @@ class ICommonClock : public IInterface {
         sp<ICommonClock> clk = interface_cast<ICommonClock>(binder);
         return clk;
     }
+
+    enum State {
+        // the device just came up and is trying to discover the master
+        STATE_INITIAL,
+
+        // the device is a client of a master
+        STATE_CLIENT,
+
+        // the device is acting as master
+        STATE_MASTER,
+
+        // the device has lost contact with its master and needs to participate
+        // in the election of a new master
+        STATE_RONIN,
+
+        // the device is waiting for announcement of the newly elected master
+        STATE_WAIT_FOR_ELECTION,
+    };
+
 };
 
 class BnCommonClock : public BnInterface<ICommonClock> {