diff options
-rw-r--r-- | api/tinyb_hci/BTDataTypes.hpp (renamed from api/tinyb_hci/DataTypes.hpp) | 8 | ||||
-rw-r--r-- | api/tinyb_hci/BasicTypes.hpp (renamed from api/tinyb_hci/HCIUtil.hpp) | 9 | ||||
-rw-r--r-- | api/tinyb_hci/HCITypes.hpp | 5 | ||||
-rw-r--r-- | api/tinyb_hci/UUID.hpp | 2 | ||||
-rw-r--r-- | src/tinyb_hci/BTDataTypes.cpp (renamed from src/tinyb_hci/DataTypes.cpp) | 14 | ||||
-rw-r--r-- | src/tinyb_hci/BasicTypes.cpp (renamed from src/tinyb_hci/HCIUtil.cpp) | 2 | ||||
-rw-r--r-- | src/tinyb_hci/CMakeLists.txt | 4 |
7 files changed, 24 insertions, 20 deletions
diff --git a/api/tinyb_hci/DataTypes.hpp b/api/tinyb_hci/BTDataTypes.hpp index d51767e4..f47c6262 100644 --- a/api/tinyb_hci/DataTypes.hpp +++ b/api/tinyb_hci/BTDataTypes.hpp @@ -23,8 +23,8 @@ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef DATATYPES_HPP_ -#define DATATYPES_HPP_ +#ifndef BTDATATYPES_HPP_ +#define BTDATATYPES_HPP_ #pragma once #include <cstring> @@ -33,7 +33,7 @@ #include <cstdint> #include <vector> -#include "HCIUtil.hpp" +#include "BasicTypes.hpp" #include "UUID.hpp" namespace tinyb_hci { @@ -370,4 +370,4 @@ public: } // namespace tinyb_hci -#endif /* DATATYPES_HPP_ */ +#endif /* BTDATATYPES_HPP_ */ diff --git a/api/tinyb_hci/HCIUtil.hpp b/api/tinyb_hci/BasicTypes.hpp index 31a931a7..2436547f 100644 --- a/api/tinyb_hci/HCIUtil.hpp +++ b/api/tinyb_hci/BasicTypes.hpp @@ -23,8 +23,8 @@ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef HCIUTIL_HPP_ -#define HCIUTIL_HPP_ +#ifndef BASICTYPES_HPP_ +#define BASICTYPES_HPP_ #pragma once #include <cstring> @@ -37,9 +37,6 @@ extern "C" { #include <byteswap.h> } -#define JAVA_MAIN_PACKAGE "org/tinyb" -#define JAVA_HCI_PACKAGE "tinyb/hci" - namespace tinyb_hci { /** @@ -314,4 +311,4 @@ namespace tinyb_hci { } // namespace tinyb_hci -#endif /* HCIUTIL_HPP_ */ +#endif /* BASICTYPES_HPP_ */ diff --git a/api/tinyb_hci/HCITypes.hpp b/api/tinyb_hci/HCITypes.hpp index 5bc71d66..f9330986 100644 --- a/api/tinyb_hci/HCITypes.hpp +++ b/api/tinyb_hci/HCITypes.hpp @@ -37,7 +37,10 @@ #include <atomic> #include "UUID.hpp" -#include "DataTypes.hpp" +#include "BTDataTypes.hpp" + +#define JAVA_MAIN_PACKAGE "org/tinyb" +#define JAVA_HCI_PACKAGE "tinyb/hci" namespace tinyb_hci { diff --git a/api/tinyb_hci/UUID.hpp b/api/tinyb_hci/UUID.hpp index d1cb6731..b51c5361 100644 --- a/api/tinyb_hci/UUID.hpp +++ b/api/tinyb_hci/UUID.hpp @@ -33,7 +33,7 @@ #include <cstdint> #include <vector> -#include "HCIUtil.hpp" +#include "BasicTypes.hpp" namespace tinyb_hci { diff --git a/src/tinyb_hci/DataTypes.cpp b/src/tinyb_hci/BTDataTypes.cpp index f1da89dd..f17aa9da 100644 --- a/src/tinyb_hci/DataTypes.cpp +++ b/src/tinyb_hci/BTDataTypes.cpp @@ -32,12 +32,12 @@ #include <algorithm> -#include "DataTypes.hpp" +#include "BTDataTypes.hpp" -extern "C" { - // bt_compidtostr - #include <bluetooth/bluetooth.h> -} +/** + * TODO libbluetooth replacement: + * - bt_compidtostr + */ #define VERBOSE_ON 1 @@ -54,6 +54,10 @@ static inline const int8_t * const_uint8_to_const_int8_ptr(const uint8_t* p) { return static_cast<const int8_t *>( static_cast<void *>( const_cast<uint8_t*>( p ) ) ); } +static std::string bt_compidtostr(const uint16_t companyid) { + return std::to_string(companyid); +} + std::string EUI48::toString() const { char cstr[17+1]; diff --git a/src/tinyb_hci/HCIUtil.cpp b/src/tinyb_hci/BasicTypes.cpp index 6cb78d67..97ef1cfc 100644 --- a/src/tinyb_hci/HCIUtil.cpp +++ b/src/tinyb_hci/BasicTypes.cpp @@ -23,7 +23,7 @@ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "HCIUtil.hpp" +#include "BasicTypes.hpp" // #define _USE_BACKTRACE_ 1 diff --git a/src/tinyb_hci/CMakeLists.txt b/src/tinyb_hci/CMakeLists.txt index 33884786..d50d40c6 100644 --- a/src/tinyb_hci/CMakeLists.txt +++ b/src/tinyb_hci/CMakeLists.txt @@ -10,9 +10,9 @@ include_directories( ) set (tinyb_hci_LIB_SRCS - ${PROJECT_SOURCE_DIR}/src/tinyb_hci/HCIUtil.cpp + ${PROJECT_SOURCE_DIR}/src/tinyb_hci/BasicTypes.cpp ${PROJECT_SOURCE_DIR}/src/tinyb_hci/UUID.cpp - ${PROJECT_SOURCE_DIR}/src/tinyb_hci/DataTypes.cpp + ${PROJECT_SOURCE_DIR}/src/tinyb_hci/BTDataTypes.cpp ${PROJECT_SOURCE_DIR}/src/tinyb_hci/HCIAdapter.cpp ${PROJECT_SOURCE_DIR}/src/tinyb_hci/HCIDevice.cpp # autogenerated files |