nexus: Switch controllers to use abstracted properties and refactor command protocol
Also fixes a select() bug and removes debugging
Signed-off-by: San Mehat <san@google.com>
nexus: fix whitespace
diff --git a/nexus/NetworkManager.h b/nexus/NetworkManager.h
index 0ac4a4d..bd00849 100644
--- a/nexus/NetworkManager.h
+++ b/nexus/NetworkManager.h
@@ -19,6 +19,7 @@
#include <sysutils/SocketListener.h>
#include "Controller.h"
+#include "PropertyCollection.h"
class NetworkManager {
private:
@@ -27,6 +28,7 @@
private:
ControllerCollection *mControllers;
SocketListener *mBroadcaster;
+ PropertyCollection *mProperties;
public:
virtual ~NetworkManager() {}
@@ -37,6 +39,10 @@
Controller *findController(const char *name);
+ const PropertyCollection &getProperties();
+ int setProperty(const char *name, char *value);
+ const char *getProperty(const char *name, char *buffer, size_t maxsize);
+
void setBroadcaster(SocketListener *sl) { mBroadcaster = sl; }
SocketListener *getBroadcaster() { return mBroadcaster; }
@@ -45,6 +51,9 @@
private:
int startControllers();
int stopControllers();
+ int registerProperty(const char *name);
+ int unregisterProperty(const char *name);
+
NetworkManager();
public: