From 6b304334f3798ce642dc45932344941fe52317f7 Mon Sep 17 00:00:00 2001 From: Roland Jax Date: Tue, 3 Jun 2014 14:34:21 +0200 Subject: [PATCH] directories utils->lib and tools->tool renamed; ebusd_send changed to fit with all commands. --- ChangeLog | 1 + Makefile.am | 22 +++++++++++----------- README | 2 +- {utils => lib}/appl.cpp | 4 ++-- {utils => lib}/appl.h | 0 {utils => lib}/daemon.cpp | 0 {utils => lib}/daemon.h | 0 {utils => lib}/logger.cpp | 0 {utils => lib}/logger.h | 0 {utils => lib}/notify.h | 0 {utils => lib}/tcpsocket.cpp | 0 {utils => lib}/tcpsocket.h | 0 {utils => lib}/thread.cpp | 0 {utils => lib}/thread.h | 0 {utils => lib}/wqueue.h | 0 {tools => tool}/ebusd_feed.cpp | 0 {tools => tool}/ebusd_send.cpp | 10 +++------- 17 files changed, 18 insertions(+), 21 deletions(-) rename {utils => lib}/appl.cpp (97%) rename {utils => lib}/appl.h (100%) rename {utils => lib}/daemon.cpp (100%) rename {utils => lib}/daemon.h (100%) rename {utils => lib}/logger.cpp (100%) rename {utils => lib}/logger.h (100%) rename {utils => lib}/notify.h (100%) rename {utils => lib}/tcpsocket.cpp (100%) rename {utils => lib}/tcpsocket.h (100%) rename {utils => lib}/thread.cpp (100%) rename {utils => lib}/thread.h (100%) rename {utils => lib}/wqueue.h (100%) rename {tools => tool}/ebusd_feed.cpp (100%) rename {tools => tool}/ebusd_send.cpp (90%) diff --git a/ChangeLog b/ChangeLog index eeb9f1a3..09155bda 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ ebusd - ChangeLog 2014-06-03 Roland Jax * ebusd_send added. * class Appl: program arguments parsing improved. +* directories utils->lib and tools->tool renamed. * Version changed from 0.2.0 to 0.2.1 2014-05-11 Roland Jax diff --git a/Makefile.am b/Makefile.am index 43d12696..e18efb9e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,7 @@ AUTOMAKE_OPTIONS = subdir-objects ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} -AM_CXXFLAGS = $(LIBEBUS_CFLAGS) -I$(top_srcdir)/utils -fpic -Wall -Wextra +AM_CXXFLAGS = $(LIBEBUS_CFLAGS) -I$(top_srcdir)/lib -fpic -Wall -Wextra bin_PROGRAMS = ebusd \ ebusd_feed \ @@ -13,22 +13,22 @@ ebusd_SOURCES = src/main.cpp \ src/ebusloop.cpp \ src/cycdata.cpp \ src/network.cpp \ - utils/thread.cpp \ - utils/logger.cpp \ - utils/tcpsocket.cpp \ - utils/daemon.cpp \ - utils/appl.cpp + lib/thread.cpp \ + lib/logger.cpp \ + lib/tcpsocket.cpp \ + lib/daemon.cpp \ + lib/appl.cpp ebusd_LDADD = $(LIBEBUS_LIBS) \ -lpthread dist_noinst_SCRIPTS = autogen.sh -ebusd_feed_SOURCES = tools/ebusd_feed.cpp \ - utils/appl.cpp +ebusd_feed_SOURCES = tool/ebusd_feed.cpp \ + lib/appl.cpp ebusd_feed_LDADD = $(LIBEBUS_LIBS) -ebusd_send_SOURCES = tools/ebusd_send.cpp \ - utils/appl.cpp \ - utils/tcpsocket.cpp +ebusd_send_SOURCES = tool/ebusd_send.cpp \ + lib/appl.cpp \ + lib/tcpsocket.cpp diff --git a/README b/README index aca09886..22492a2a 100644 --- a/README +++ b/README @@ -48,7 +48,7 @@ Tools ----- ebusd_feed - send dump files via virtual serial device for debugging purpose. -ebusd_send - small client for sending commands (get, set, cyc and hex) to ebusd. +ebusd_send - small client for sending commands to ebusd. For usage and further information take a look on help page. diff --git a/utils/appl.cpp b/lib/appl.cpp similarity index 97% rename from utils/appl.cpp rename to lib/appl.cpp index 7d1d020b..2058d6b3 100644 --- a/utils/appl.cpp +++ b/lib/appl.cpp @@ -62,12 +62,12 @@ void Appl::addItem(const char* name, Param param, const char* shortname, void Appl::printArgs() { std::cerr << std::endl << "Usage:" << std::endl << " " - << m_argv[0].substr(2) << " [Options]" ; + << m_argv[0].substr(2) << " [OPTIONS...]" ; if (m_argTxt.size() != 0) std::cerr << " " << m_argTxt; - std::cerr << std::endl << std::endl << "Options:" << std::endl; + std::cerr << std::endl << std::endl; for (a_it = m_args.begin(); a_it < m_args.end(); a_it++) { const char* c = (strlen(a_it->shortname) == 1) ? a_it->shortname : " "; diff --git a/utils/appl.h b/lib/appl.h similarity index 100% rename from utils/appl.h rename to lib/appl.h diff --git a/utils/daemon.cpp b/lib/daemon.cpp similarity index 100% rename from utils/daemon.cpp rename to lib/daemon.cpp diff --git a/utils/daemon.h b/lib/daemon.h similarity index 100% rename from utils/daemon.h rename to lib/daemon.h diff --git a/utils/logger.cpp b/lib/logger.cpp similarity index 100% rename from utils/logger.cpp rename to lib/logger.cpp diff --git a/utils/logger.h b/lib/logger.h similarity index 100% rename from utils/logger.h rename to lib/logger.h diff --git a/utils/notify.h b/lib/notify.h similarity index 100% rename from utils/notify.h rename to lib/notify.h diff --git a/utils/tcpsocket.cpp b/lib/tcpsocket.cpp similarity index 100% rename from utils/tcpsocket.cpp rename to lib/tcpsocket.cpp diff --git a/utils/tcpsocket.h b/lib/tcpsocket.h similarity index 100% rename from utils/tcpsocket.h rename to lib/tcpsocket.h diff --git a/utils/thread.cpp b/lib/thread.cpp similarity index 100% rename from utils/thread.cpp rename to lib/thread.cpp diff --git a/utils/thread.h b/lib/thread.h similarity index 100% rename from utils/thread.h rename to lib/thread.h diff --git a/utils/wqueue.h b/lib/wqueue.h similarity index 100% rename from utils/wqueue.h rename to lib/wqueue.h diff --git a/tools/ebusd_feed.cpp b/tool/ebusd_feed.cpp similarity index 100% rename from tools/ebusd_feed.cpp rename to tool/ebusd_feed.cpp diff --git a/tools/ebusd_send.cpp b/tool/ebusd_send.cpp similarity index 90% rename from tools/ebusd_send.cpp rename to tool/ebusd_send.cpp index a66322d8..12d3562d 100644 --- a/tools/ebusd_send.cpp +++ b/tool/ebusd_send.cpp @@ -26,12 +26,8 @@ Appl& A = Appl::Instance(); void define_args() { - A.addArgs("Arg1 Arg2 Arg3 (Arg4)\n\n" - "Arg1-4:\n" - " get class cmd (sub)\n" - " set class cmd value\n" - " cyc class cmd (sub)\n" - " hex type value (value: ZZ PB SB NN Dx)", 3); + A.addArgs("COMMAND {ARGS...}\n\n" + " send 'help' for available commands", 1); A.addItem("p_server", Appl::Param("localhost"), "s", "server", "name or ip (localhost)", @@ -78,7 +74,7 @@ int main(int argc, char* argv[]) socket->send(message.c_str(), message.size()); - char data[256]; + char data[1024]; size_t datalen; datalen = socket->recv(data, sizeof(data)-1);