add support to build sensors from json

Add support to build sensors from a json configuration file.

Change-Id: Ic5bcbcd01e085ab0d4efaed314af8dc7e82b0b9d
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/sensors/buildjson.hpp b/sensors/buildjson.hpp
new file mode 100644
index 0000000..c5aacc7
--- /dev/null
+++ b/sensors/buildjson.hpp
@@ -0,0 +1,20 @@
+#pragma once
+
+#include "conf.hpp"
+
+#include <map>
+#include <nlohmann/json.hpp>
+#include <string>
+
+using json = nlohmann::json;
+
+/**
+ * Given a json object generated from a configuration file, build the sensor
+ * configuration representation. This expecteds the json configuration to be
+ * valid.
+ *
+ * @param[in] data - the json data
+ * @return a map of sensors.
+ */
+std::map<std::string, struct SensorConfig>
+    buildSensorsFromJson(const json& data);