From c73a3a5771a2d29d1bae666bfde12f751d66fc96 Mon Sep 17 00:00:00 2001 From: San Mehat Date: Mon, 15 Jun 2009 14:06:03 -0700 Subject: libsysutils: Move to a null terminated string protocol using space as a field separator. Also removes some debugging Signed-off-by: San Mehat --- include/sysutils/FrameworkCommand.h | 2 +- include/sysutils/FrameworkListener.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/sysutils/FrameworkCommand.h b/include/sysutils/FrameworkCommand.h index 5b50247..6c1fca6 100644 --- a/include/sysutils/FrameworkCommand.h +++ b/include/sysutils/FrameworkCommand.h @@ -29,7 +29,7 @@ public: FrameworkCommand(const char *cmd); virtual ~FrameworkCommand() { } - virtual int runCommand(SocketClient *c, char *data) = 0; + virtual int runCommand(SocketClient *c, int argc, char **argv) = 0; const char *getCommand() { return mCommand; } }; diff --git a/include/sysutils/FrameworkListener.h b/include/sysutils/FrameworkListener.h index 8a83c33..4e3d396 100644 --- a/include/sysutils/FrameworkListener.h +++ b/include/sysutils/FrameworkListener.h @@ -22,6 +22,8 @@ class SocketClient; class FrameworkListener : public SocketListener { +public: + static const int CMD_ARGS_MAX = 8; private: FrameworkCommandCollection *mCommands; @@ -34,6 +36,6 @@ protected: virtual bool onDataAvailable(SocketClient *c); private: - void dispatchCommand(SocketClient *c, char *cmd); + void dispatchCommand(SocketClient *c, char *data); }; #endif -- cgit v1.1