class Bus removed.

This commit is contained in:
Roland Jax
2014-11-07 22:36:21 +01:00
parent 6b0f58b291
commit d53afc8701
5 changed files with 0 additions and 541 deletions
-4
View File
@@ -6,7 +6,6 @@ AM_CXXFLAGS = -fpic \
noinst_PROGRAMS = test_port \
test_symbol \
test_data \
test_bus \
test_commands \
test_configfile \
test_decode \
@@ -21,9 +20,6 @@ test_symbol_LDADD = $(top_srcdir)/src/lib/ebus/libebus.a
test_data_SOURCES = test_data.cpp
test_data_LDADD = $(top_srcdir)/src/lib/ebus/libebus.a
test_bus_SOURCES = test_bus.cpp
test_bus_LDADD = $(top_srcdir)/src/lib/ebus/libebus.a
test_commands_SOURCES = test_commands.cpp
test_commands_LDADD = $(top_srcdir)/src/lib/ebus/libebus.a
-58
View File
@@ -1,58 +0,0 @@
/*
* Copyright (C) Roland Jax 2012-2014 <ebusd@liwest.at>
*
* This file is part of ebusd.
*
* ebusd is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ebusd is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ebusd. If not, see http://www.gnu.org/licenses/.
*/
#include "bus.h"
#include <iostream>
#include <iomanip>
using namespace libebus;
int main ()
{
Bus bus("/dev/ttyUSB0", true, 15000, "/tmp/dump_bus.bin", 100, false);
bus.connect();
if (bus.isConnected() == true)
std::cout << "connect successful." << std::endl;
int cout = 0;
while (cout++ < 1000) {
if (bus.isConnected() == true) {
bus.printBytes();
} else {
sleep(5);
bus.connect();
if (bus.isConnected() == false)
std::cout << "can't open /dev/ttyUSB0" << std::endl;
else
std::cout << "reconnect successful." << std::endl;
}
}
bus.disconnect();
if (bus.isConnected() == false)
std::cout << "disconnect successful." << std::endl;
return 0;
}