aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-02-22 15:36:06 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2015-02-22 15:36:06 +0100
commitba6324930118a62e05d3869f99543c4a7507f105 (patch)
tree8f23c2104c7d4338ef60f1097184b48a4d2849ed
parente5b99b359cebd2145a891932686bb9cdab751809 (diff)
downloadble-toys-ba6324930118a62e05d3869f99543c4a7507f105.tar.gz
ble-toys-ba6324930118a62e05d3869f99543c4a7507f105.tar.bz2
ble-toys-ba6324930118a62e05d3869f99543c4a7507f105.tar.xz
ble-toys-ba6324930118a62e05d3869f99543c4a7507f105.zip
o Splitting out public header files into it's own directory.
-rw-r--r--apps/CMakeLists.txt2
-rw-r--r--apps/ble-inspect-device.cpp7
-rw-r--r--apps/sm-get-value.cpp7
-rw-r--r--ble/Bluetooth.cpp2
-rw-r--r--ble/BluetoothImpl.h2
-rw-r--r--ble/ByteBuffer.cpp2
-rw-r--r--ble/CMakeLists.txt1
-rw-r--r--include/ble/Bluetooth.h (renamed from ble/Bluetooth.h)0
-rw-r--r--include/ble/ByteBuffer.h (renamed from ble/ByteBuffer.h)0
-rw-r--r--test/ByteBufferTest.cpp9
-rw-r--r--test/CMakeLists.txt1
11 files changed, 13 insertions, 20 deletions
diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt
index a138336..aefb0fb 100644
--- a/apps/CMakeLists.txt
+++ b/apps/CMakeLists.txt
@@ -10,7 +10,7 @@ pkg_check_modules(BLUEZ bluez REQUIRED)
find_package(Threads REQUIRED)
foreach(app ${APPS})
- include_directories("${PROJECT_SOURCE_DIR}/ble")
+ include_directories("${PROJECT_SOURCE_DIR}/include")
add_executable(${app} ${app}.cpp)
add_dependencies(${app} ble)
diff --git a/apps/ble-inspect-device.cpp b/apps/ble-inspect-device.cpp
index b9abe11..cdc8375 100644
--- a/apps/ble-inspect-device.cpp
+++ b/apps/ble-inspect-device.cpp
@@ -2,8 +2,7 @@
#include <iostream>
#include <vector>
#include <boost/uuid/uuid_io.hpp>
-#include "Bluetooth.h"
-#include "log.h"
+#include "ble/Bluetooth.h"
using namespace std;
using namespace trygvis::bluetooth;
@@ -50,10 +49,10 @@ int main(int argc, char *argv[]) {
return EXIT_SUCCESS;
} catch (std::runtime_error ex) {
- W << "std::runtime_error: " << ex.what();
+ cout << "std::runtime_error: " << ex.what() << endl;
return EXIT_FAILURE;
} catch (std::exception ex) {
- W << "std::exception: " << ex.what();
+ cout << "std::exception: " << ex.what() << endl;
return EXIT_FAILURE;
}
}
diff --git a/apps/sm-get-value.cpp b/apps/sm-get-value.cpp
index 66d35f1..e4ddc16 100644
--- a/apps/sm-get-value.cpp
+++ b/apps/sm-get-value.cpp
@@ -1,9 +1,8 @@
#include <iostream>
#include <boost/uuid/uuid_io.hpp>
#include <boost/optional.hpp>
-#include "Bluetooth.h"
+#include "ble/Bluetooth.h"
#include "soil-moisture.h"
-#include "log.h"
using namespace std;
using namespace trygvis::bluetooth;
@@ -135,10 +134,10 @@ int main(int argc, char *argv[]) {
return EXIT_SUCCESS;
} catch (std::runtime_error ex) {
- W << "std::runtime_error: " << ex.what();
+ cout << "std::runtime_error: " << ex.what() << endl;
return EXIT_FAILURE;
} catch (std::exception ex) {
- W << "std::exception: " << ex.what();
+ cout << "std::exception: " << ex.what() << endl;
return EXIT_FAILURE;
}
}
diff --git a/ble/Bluetooth.cpp b/ble/Bluetooth.cpp
index fe63b4f..66f97b7 100644
--- a/ble/Bluetooth.cpp
+++ b/ble/Bluetooth.cpp
@@ -1,4 +1,4 @@
-#include "Bluetooth.h"
+#include "ble/Bluetooth.h"
#include "BluetoothImpl.h"
#include <sstream>
diff --git a/ble/BluetoothImpl.h b/ble/BluetoothImpl.h
index c9ba80c..967c2e7 100644
--- a/ble/BluetoothImpl.h
+++ b/ble/BluetoothImpl.h
@@ -1,7 +1,7 @@
#ifndef BLUETOOTH_IMPL_H
#define BLUETOOTH_IMPL_H
-#include "Bluetooth.h"
+#include "ble/Bluetooth.h"
#include "log.h"
#include <boost/uuid/uuid_io.hpp>
#include <cstring>
diff --git a/ble/ByteBuffer.cpp b/ble/ByteBuffer.cpp
index 377334b..d1c923e 100644
--- a/ble/ByteBuffer.cpp
+++ b/ble/ByteBuffer.cpp
@@ -1,4 +1,4 @@
-#include "ByteBuffer.h"
+#include "ble/ByteBuffer.h"
#include <string.h>
#include <sstream>
#include <iomanip>
diff --git a/ble/CMakeLists.txt b/ble/CMakeLists.txt
index 1ecfb6c..405f125 100644
--- a/ble/CMakeLists.txt
+++ b/ble/CMakeLists.txt
@@ -1,3 +1,4 @@
file(GLOB SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
add_library(ble ${SOURCE_FILES})
+include_directories("${PROJECT_SOURCE_DIR}/include")
diff --git a/ble/Bluetooth.h b/include/ble/Bluetooth.h
index 1a1394e..1a1394e 100644
--- a/ble/Bluetooth.h
+++ b/include/ble/Bluetooth.h
diff --git a/ble/ByteBuffer.h b/include/ble/ByteBuffer.h
index f884d6e..f884d6e 100644
--- a/ble/ByteBuffer.h
+++ b/include/ble/ByteBuffer.h
diff --git a/test/ByteBufferTest.cpp b/test/ByteBufferTest.cpp
index bf18387..fb31da3 100644
--- a/test/ByteBufferTest.cpp
+++ b/test/ByteBufferTest.cpp
@@ -1,10 +1,9 @@
-#include "ByteBuffer.h"
+#include "ble/ByteBuffer.h"
#include "log.h"
#define BOOST_TEST_MODULE "ByteBuffer"
#include <boost/test/unit_test.hpp>
-#include "Bluetooth.h"
#define checkBuffer(buffer, capacity, size, cursor) \
if(false) {D << "capacity=" << buffer.getCapacity() << ", size=" << buffer.getSize() << ", cursor=" << buffer.getCursor();} \
@@ -14,12 +13,6 @@
using namespace std;
-template<typename T>
-struct do_nothing {
- void operator()(T *) {
- }
-};
-
class Bytes {
public:
Bytes(size_t size) : capacity(size) {
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index a417d2b..e9f217f 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -12,6 +12,7 @@ foreach(testSrc ${TEST_SRCS})
add_executable(${testName} ${testSrc})
include_directories("${PROJECT_SOURCE_DIR}/ble")
+ include_directories("${PROJECT_SOURCE_DIR}/include")
add_dependencies(${testName} ble)
target_link_libraries(${testName} ble)
target_link_libraries(${testName} pthread)