Handle other PLDM_STATE_SET_OPERATIONAL states

- Code will no longer assume the OCC is not running if an unexpected
state is received. It will continue to look for a good/known state.
- Added code that will throttle the occ-control pldm journal traces
if unable to read the OCC active sensor states. In some error
conditions, this tracing would flood the trace and the repeated traces
are not helpful for debug.
- Change some journal entries to ERR when the state indicated that the
system was in safe mode (OCCs disabled)
- If request for occ active sensor state was sent, and then a PLDM
sensor event comes in for that instance, the event status is used and
the response is ignored.
- Added README for occ-control

Signed-off-by: Chris Cain <cjcain@us.ibm.com>
Change-Id: Ic26f1d0c4dc59e7a61b965b052d649e4bc152fde
diff --git a/occ_manager.cpp b/occ_manager.cpp
index 5386c43..630d85d 100644
--- a/occ_manager.cpp
+++ b/occ_manager.cpp
@@ -206,6 +206,13 @@
                                 instance)
                                 .c_str());
                         tracedSensorWait = true;
+                        // Make sure traces are not throttled
+#ifdef PLDM
+                        pldmHandle->setTraceThrottle(false);
+                        // Start timer to throttle pldm traces when timer
+                        // expires
+                        throttleTraceTimer->restartOnce(5min);
+#endif
                     }
 #ifdef PLDM
                     pldmHandle->checkActiveSensor(obj->getOccInstanceID());
@@ -232,6 +239,14 @@
         {
             discoverTimer->setEnabled(false);
         }
+#ifdef PLDM
+        if (throttleTraceTimer->isEnabled())
+        {
+            // Disable throttle timer and make sure traces are not throttled
+            throttleTraceTimer->setEnabled(false);
+            pldmHandle->setTraceThrottle(false);
+        }
+#endif
 
         if (waitingForAllOccActiveSensors)
         {
@@ -506,7 +521,9 @@
                     "updateOCCActive: Waiting for Host and all OCC Active Sensors");
                 waitingForAllOccActiveSensors = true;
             }
+#ifdef POWER10
             discoverTimer->restartOnce(30s);
+#endif
             return false;
         }
         else
@@ -1325,6 +1342,17 @@
 
     validateOccMaster();
 }
+
+#ifdef PLDM
+// Called when throttleTraceTimer expires.
+// If this timer expires, that indicates there is still no confirmed OCC status
+//   which will trigger pldm traces to be throttled.
+void Manager::throttleTraceExpired()
+{
+    // Throttle traces
+    pldmHandle->setTraceThrottle(true);
+}
+#endif // PLDM
 #endif // POWER10
 
 // Verify single master OCC and start presence monitor