Add basic main and meson.build

Main just runs very 1 second, based on the asio timer example.

Tested: Added a debug fprint and verified that it runs every 1 second

Signed-off-by: Brandon Kim <brandonkim@google.com>
Change-Id: I75c98a39f43d3f7103583171979ce87515c9083d
diff --git a/src/main.cpp b/src/main.cpp
new file mode 100644
index 0000000..9db1969
--- /dev/null
+++ b/src/main.cpp
@@ -0,0 +1,31 @@
+#include <boost/asio.hpp>
+
+#include <chrono>
+#include <functional>
+
+namespace
+{
+// Set the read loop interval to be 1 second for now
+// TODO: Make this a configuration option
+static constexpr std::chrono::seconds readIntervalSec(1);
+} // namespace
+
+// boost::async_wait requires `const boost::system::error_code&` parameter
+void readLoop(boost::asio::steady_timer* t, const boost::system::error_code&)
+{
+    /* This will run every readIntervalSec second for now */
+    t->expires_from_now(readIntervalSec);
+    t->async_wait(std::bind_front(readLoop, t));
+}
+
+int main()
+{
+    boost::asio::io_context io;
+    boost::asio::steady_timer t(io, readIntervalSec);
+
+    t.async_wait(std::bind_front(readLoop, &t));
+
+    io.run();
+
+    return 0;
+}