sensors/zones: place in namespace and cleanup

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I527dbc8477a232945f696227a7b0b2adbee45175
diff --git a/main.cpp b/main.cpp
index 1dbb072..5a94efb 100644
--- a/main.cpp
+++ b/main.cpp
@@ -49,6 +49,9 @@
 #include "dbus/dbusconfiguration.hpp"
 #endif
 
+namespace pid_control
+{
+
 /* The configuration converted sensor list. */
 std::map<std::string, struct conf::SensorConfig> sensorConfig = {};
 /* The configuration converted PID list. */
@@ -56,6 +59,8 @@
 /* The configuration converted Zone configuration. */
 std::map<int64_t, struct conf::ZoneConfig> zoneDetailsConfig = {};
 
+} // namespace pid_control
+
 /** the swampd daemon will check for the existence of this file. */
 constexpr auto jsonConfigurationPath = "/usr/share/swampd/config.json";
 std::string configPath = "";
@@ -70,6 +75,9 @@
 static sdbusplus::asio::connection
     passiveBus(io, sdbusplus::bus::new_system().release());
 
+namespace pid_control
+{
+
 void restartControlLoops()
 {
     static SensorManager mgmr;
@@ -150,6 +158,8 @@
     return;
 }
 
+} // namespace pid_control
+
 int main(int argc, char* argv[])
 {
     loggingPath = "";
@@ -182,7 +192,7 @@
      * it.
      */
 
-    tryRestartControlLoops();
+    pid_control::tryRestartControlLoops();
 
     io.run();
     return 0;