From cdaf51206a95494d8de43fd5461313efff6badd7 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 15 Feb 2020 11:19:27 +0100 Subject: C++ tinyb_hci: Working HCIScanner showing AD packets, demonstrating new HCI classes See scripts/build-x86_64.sh and README.md for build instructions. See scripts/run-hci_scanner.sh to start new HCI scanner (C++). New HCI C++ implementation redised in libtinyb_hci.so w/o GLIB/DBus dependencies, but 'libbluetooth.so' dependency. Following Class datastructures are complete: - HCIUtil: Exception types, uint128_t and endian conversions - General UUID interface and its efficient UUID16, UUID32 + UUID128 implementation. Conversion 'toString', respecting endianess, and UUID* -> UUID128 conversion. Requird member comparison operations due to using interface - HCIAdapter with its opened HCISession, as well as its discovered HCIDevices - HCIAdapter discover includes multiple advertising AD records, up to 25 according to the spec. - HCIAdapter parses full AD segment. TODO: Handle few more AD types API/Impl Details: - Datastructures utilize 'vector>' collections. - Most attributes are specified 'const' -> immutable for efficancy - Convenient collection access member operations - etc .. RESULTS: - Fast AD scanning of multiple devices w/ UUID and RSSI - Proper integration into tinyb project TODO: - Handle few more AD types - Test multiple parallel HCISession from HCIAdapter - HCIAdapter.connect() - Represent GATT Service, Characteristics and Description - Catch up with the Java binding step by step --- java/jni/HCIGattDescriptor.cxx | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 java/jni/HCIGattDescriptor.cxx (limited to 'java/jni/HCIGattDescriptor.cxx') diff --git a/java/jni/HCIGattDescriptor.cxx b/java/jni/HCIGattDescriptor.cxx new file mode 100644 index 00000000..5060170b --- /dev/null +++ b/java/jni/HCIGattDescriptor.cxx @@ -0,0 +1,34 @@ +/* + * Author: Sven Gothel + * Copyright (c) 2020 Gothel Software e.K. + * Copyright (c) 2020 ZAFENA AB + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "tinyb_hci/HCITypes.hpp" + +#include "tinyb_hci_HCIGattDescriptor.h" + +#include "JNIMem.hpp" +#include "helper_base.hpp" + +using namespace tinyb_hci; + -- cgit v1.2.3