aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* scripts/run-*-scanner10.sh: Have capsh user being configured and include ↵Sven Gothel2020-10-272-4/+8
| | | | 'ulimit -c unlimited' in capsh'ed execution for core dumps
* Document Direct-BT Non-Root Usage via setcap or preferrably capsh.Sven Gothel2020-10-272-4/+39
|
* Add ChangedAdapterSetCallback (C++), ChangedAdapterSetListener (Java) for ↵Sven Gothel2020-10-251-0/+4
| | | | [DBT|Bluetooth]Manager, enabling fully event driven workflow w/ adapter add/remove
* Update valgrind.suppSven Gothel2020-10-221-5/+46
|
* cmake: Expose different instrumentation (-fsanitize=) modulesSven Gothel2020-10-211-0/+2
|
* run-dbt-scanner10: Use export for VALGRIND invocation macroSven Gothel2020-10-191-4/+4
|
* Update valgrind.supp fileSven Gothel2020-10-191-71/+115
|
* Build: Separate GCC sanitize flags from DEBUG=ON, enable via INSTRUMENTATION=ONSven Gothel2020-10-181-0/+1
|
* Align run-java-scanner10.sh with run-dbt-scanner10.sh scriptSven Gothel2020-10-142-8/+41
|
* run-dbt-scanner10.sh: Added current valgrind (memcheck, drd and callgrind) ↵Sven Gothel2020-10-091-11/+37
| | | | | | commented-out options Example with callgrind enabled: "../scripts/run-dbt_scanner10.sh -log ~/dbt_scanner10-arm64-30 -dev_id 1 -disconnect -count 1 -Ndebug -dbt_debug false -quiet -mac C0:26:DA:01:DA:B1 -mac C0:26:DF:01:E5:CA -mac C0:26:DA:00:03:DC -mac C0:26:DA:05:EF:5B"
* valgrind.supp: Add DRD suppressions equivalent to Helgrind (No errors)Sven Gothel2020-10-091-1/+210
|
* helgrind suppressions file: 0 errors (from initial 3716)Sven Gothel2020-10-082-3/+21
| | | | | | | | | | | | | Note on completion.. Most reported issues were due to helgrind's lack of analyzing the atomic macros used in C++ atomic<T>. Most issues related to 'direct_bt::LFRingbuffer::*', utilizing SC-DRF atomic acquire (read) and release (write) not detected by helgrind. This mechanism is well tested, see unit test test_mm_sc_drf (passed). However, we have fixed around 6 issues - mostly lock order related.
* helgrind suppressions file added: 10 errors left (from 3716), analyzed and ↵Sven Gothel2020-10-083-0/+370
| | | | | | suppressed - or - fixed Also adding the suppression extraction scripts from <https://wiki.wxwidgets.org/Parse_valgrind_suppressions.sh>
* run-java-scanner10.sh: Add uncommented check:jni and valgrind variantsSven Gothel2020-09-301-1/+5
|
* scripts/build.sh: Add commented out CLANG_ARGS (documentation, convenience)Sven Gothel2020-09-301-2/+3
|
* run-dbt-scanner10.sh: Add commented out VALGRIND optionSven Gothel2020-09-291-1/+4
|
* Adding kernel-bt-[debug|reload].sh scriptsSven Gothel2020-09-252-0/+41
|
* Java Example: Rename ScannerTinyB10 -> DBTScanner10: Requiring Direct-BT, ↵Sven Gothel2020-09-251-2/+2
| | | | name aligned with dbt_scanner10.cpp
* dbt_scanner10.cpp: Add cmdline args '-dbt_verbose, -dbt_debug, -dbt_mgmt, ↵Sven Gothel2020-09-201-1/+1
| | | | | | -dbt_hci, -dbt_gatt', setting their env-vars like ScannerTinyB10.java Aligning example apps for same experience and invocation.
* scripts/run-dbt_scanner10.sh: Add another commented out direct_bt_debug variant.Sven Gothel2020-09-191-0/+1
|
* script/run-java-scanner10.sh: Add commented out debug flagsSven Gothel2020-09-181-1/+5
|
* DBTEnv API Doc: Mention missing 'direct_bt.debug.adapter.event', order ↵Sven Gothel2020-09-181-2/+5
| | | | alphabetical
* scripts/run*: Enable core dump per defaultSven Gothel2020-09-187-0/+11
|
* test scripts/run-*.sh: Add commented out example for env-var ↵Sven Gothel2020-09-167-0/+33
| | | | 'direct_bt_debug'; Echo COMMANDLINE and debug env-var.
* DBTEnv: Resolve using environment vars under Unix shells, e.g. try ↵Sven Gothel2020-09-151-0/+3
| | | | 'direct_bt_debug' if ''direct_bt.debug' wasn't found.
* CMake: Support full parallel build by adding target dependenciesSven Gothel2020-09-152-3/+8
| | | | | | | | | | | | | | | | C++ Libs -> none (2x) Java Jar -> none Java JNI Libs -> C++ Lib + Java Jar (2x) C++ Examples -> C++ Libs Java Examples -> Java Jar Test -> C++ Lib +++ scripts/[re]build.sh uses `getconf _NPROCESSORS_ONLN` for the make -j <number of parallel processes>.
* scripts/build.sh: Default to RELEASESven Gothel2020-09-141-2/+2
|
* run scripts: Set LANG and LC_MEASUREMENT to en_US.UTF-8 for unified log filesSven Gothel2020-08-267-0/+35
| | | | LC_MEASUREMENT also to have the thousands separator in the elapsed time field
* scripts/run-*.sh: Remove dependency to 'libtinyb.so', which could be skipped ↵Sven Gothel2020-08-257-7/+7
| | | | @ compile time
* cmake: CMAKE_EXE_LINKER_FLAGS += '-latomic' to fix gcc-8 on Raspberry: ↵Sven Gothel2020-08-251-0/+1
| | | | undefined reference to `__atomic_store_8'
* Add convenient GNU/Linux start/stop scripts for bluetoothdv2.1.18Sven Gothel2020-07-272-0/+14
|
* scripts/setup-machine-arch.sh: aarch64Sven Gothel2020-07-021-0/+6
| | | | Original commit by Xerxes Rånby <[email protected]>
* Build direct_bt with DEBUG symbols enabled .. for the time beingv2.1.8Sven Gothel2020-06-271-1/+2
|
* remove executable flag in script filesSven Gothel2020-06-189-0/+0
|
* Use generic 'setup-machine-arch.sh' for unified build.sh and rebuild.sh scriptsSven Gothel2020-06-187-98/+112
|
* Add debugging tool ScannerTinyB02; ScannerTinyB01 adds any device option.Sven Gothel2020-06-182-0/+19
|
* AdapterStatusListener(C++/Java): Expose 'HCIErrorCode reason' on disconnect ↵Sven Gothel2020-05-312-3/+22
| | | | | | | (split deviceConnectionChanged up), align args of deviceUpdated The 'HCIErrorCode reason' gives us valuable information of the disconnect reason, hence we shall expose it to the user level on the C++ and Java side.
* ScannerTinyB10: Multi-device and -threading Java example equivalent to C++ ↵Sven Gothel2020-05-281-0/+13
| | | | | | | | | | dbt_scanner10 Some issues still: - disconnect HCI command failure (same w/ native code, need to check) - Whitelist command OK but no connection at all. '-mac address' use-case is working
* dbt_scanner00/10, ScannerTinyB01: Use getUTF8String(..) for GATT ↵Sven Gothel2020-05-281-0/+1
| | | | Characteristic values, exposing human readable string portions
* ScannerTinyB10.java needs to be aligned to dbt_scanner10.cpp for ↵Sven Gothel2020-05-241-0/+14
| | | | multithreading test
* sloccount: Adding java/jni and test codeSven Gothel2020-05-171-1/+5
|
* Working GATT Java Side; GATT Types made fully functional for user to avoid ↵Sven Gothel2020-05-175-14/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'technical' GATTHandler GATT Types made fully functional for user to avoid 'technical' GATTHandler (C++) > GATTService, GATTCharacteristic, GATTDescriptor -- Reside in their own respective files -- Added semantic methods (readValue(), ..) implemented using DBTDevice -> GATTHandler -- GATTDescriptor owns its value -- GATTHandler setSendIndicationConfirmation(..) defaults to true -- Allow user to cirvumvent using GATTHandler manually completely, device 1--*> services 1--*> characteristics 1--*> descriptor -- C++ GATT types aligned 1:1 to TinyB (Java) > Merged GATTIndicationListener + GATTNotificationListener -> GATTCharacteristicListener -- Simplifying usage, unifying notification and indication -- Now using a list of shared_ptr<GATTCharacteristicListener> allowing multiple actors instead of just a one shot entry. Similar to AdapterStatusListener, we utilize this also on the Java side to implement the TinyB notifications. See dbt_scanner00.cpp: Simplified high-level usage. See dbt_scanner01.cpp: Lower-level technical usage w/ GATTHandler. +++ > Simplified more names > Removed redundancy in listener callbacks, -- don't pass adapter when device is already given. device <*--1> adapter -- don't pass GATT handle explicitly when characteristic is passed > Comparison of all GATT types are done by their respective unique handle Attribute handles are unique for each device (server) (BT Core Spec v5.2: Vol 3, Part F Protocol..: 3.2.2 Attribute Handle) > GATTHandler: Own L2CAPComm instance directly, instead of shared_ptr. > JNIMem: Added JNICriticalArray class for RAII style release ++++ ++++ Working GATT Java Side > All toString() methods return the C++ toString() via JNI for better representation. > DBTDevice.java/JNI: Resolved the odd 'adapter' reference issue: -- Was not passing the jobject of DBTAdapter, but its shared container refeference ;-) > All GATT types receive their GATT handler for equal test and identity @ ctor > GATT read/write Value update the cached value as well as issue the notifyValue on change, including GATTCharacteristic notification/indication listener
* add rebuild script .. convenient faster build, install and test after ↵Sven Gothel2020-05-031-0/+21
| | | | initial build
* sloccount_direct_bt: drop *Ioctl.hpp filesSven Gothel2020-04-281-1/+8
|
* test clang++ compiler script fixSven Gothel2020-04-261-1/+1
|
* Use Kernel BlueZ Manager for Discovery, Connect, etc. (Initial Commit - Java ↵Sven Gothel2020-04-251-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | part probably broken) We have experienced the following using the official HCI communication channel: - Lower connect performance with discovery enabled - Instability with enabled discovery and breaking general BT adapter state requiring a 'hciconfig hci0 reset' - Lack of notifications: start/stop discovery/connect/... - Lack of certain settings in general: pin, .. This commit implements discovery including listening to all BlueZ kernel events from the BlueZ Manager channel using DBTManager. TODO: Figure out how to enforce quick connect! - EInfoReport (EIR) added: FLAGS, DEVICE_CLASS, APPEARANCE, HASH, RANDOMIZER and DEVICE_ID - including parsing new segments in read_data(..) and dataSetToString(..) exposure - DBTManager adds: - manager-reader thread, putting all command status/completes to its ringbuffer and sending out all other events to its listener. - Respecting the chosen BTMode (side-effect to discovery etc) - add: start/stop discovery - add: connect/disconnect (incomplete) - DBTAdapter: - discoverDevices -> discoverDevicesMgmt is becoming redundant, now simply waiting for the DeviceFound event. Will be deleted - TODO! - mgmtEvDeviceFoundCB shall perform remaining EIR parsing and enqueing the devices plus issuing respective discovery callbacks! TODO. - DBTDevice adds: - BDAddressType - HCISession's HCIComm is now no more used (to be deleted!) - HCIComm adds generic read/write methods, mutex free. - Remaining HCI 'managment' methods are also subject to deletion! - GATTHandler / DBTManager: only use a mtx_write for communication, as reading is performed on their respective threads using a ringbuffer. Here only concurrent write access needs to be managed. (DBTManager uses its own HCIComm's mutex.) - MgmtTypes adds: - BTMode for dual, BREDR or LE only. - MgmtRequest -> MgmtCommand - Unifies the command opcodes to global 'MgmtOpcode', removing duplicate MgmtCommand::Opcode (which was also incomplete) - Adding MgmtDisconnectCmd, MgmtEvtDiscovering, MgmtEvtDeviceFound MgmtEvtDeviceConnected, MgmtEvtDeviceDisconnected - TOctets adding get_int8(..) and get_eui48(..) - TOctets adding put_eui48(..) ++++++++++++++ New ClassFunction: Introducing versatile C++ function-method type used for our DBTManager callbacks. In contrast to std::function and std::bind, ClassFunction allows using its specific type (return- and argument types) and offering the equality operation to test its identity. The latter is essential to remove a callback ClassFunction from a list of callbacks. +++++++++++++++++ Further code cleanup is also included - Address_T -> BDAddressType(incl string presentation) + HCIAddressType - ManufactureSpecificData using POctets - Convenient default param: uint*HexString(.., const bool leading0X=true); - MgmtTypes's get/put for events and commands use MGMT_HEADER_SIZE offset - MgmtTypes: Remove doubled 'btohs', as the pdu.get* commands already perform endian conversion. - EInfoReport::read_data(..) validate segment size before type conversion
* Refine: DBT API, HCISession/DBTAdapter lifecycle, API doc and C++ and ↵Sven Gothel2020-04-211-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C++/JNI exception handling - HCISession: Handle multiple connections - DBTDevice holds le_conn_handle and provides the le_disconnect as well - HCISession maintains a vector of connected devices - HCISession/DBTAdapter: Cleanup shutdown and refine lifecycle - DBTDevice/DBTAdapter: Drop explicit HCISession argument, simply use the attached HCISession of DBTAdapter. - Refine API doc in general +++ - Device Java/JNI: Add a few more methods to test connect/disconnect. +++ Refine C++ and C++/JNI exception handling: - Use new java_exception_check_and_throw(..): Throw C++ exception on pending Java exception, retrieving toString() message. - Use new java_exception_check(..): Return immediately from JNI on pending Java exception. - Replace macro CATCH_EXCEPTION_AND_RAISE_JAVA(..) with new rethrow_and_raise_java_exception(..), re-trhowing exception and raising detailed Java exception.
* Initial working Java binding for the direct_bt C++ moduleSven Gothel2020-04-204-7/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example ScannerTinyB01 demonstrates efficient scanning devices using the new BluetoothDeviceDiscoveryListener interface. The C++ HCIObject extends JavaUplink, which handles the java object references via 'std::shared_ptr<JavaAnonObj>', where JavaAnonObj relies on later polymorph specialization. JavaAnonObj gets derived in the java/jni of direct_bt, where the JNI header + libraries are available. +++ The java inplementing NativeDownlink implementations store the nativeInstance to the C++ instances as well as handle their java references within the native instances. The C++ JavaUplink and Java NativeDownlink interfaces are complete the cross referencing java <-> native. +++ Native libraries are now split into pairs: - tinyb + javatinyb - direct_bt + javadirect_bt TODO: BluetoothFactory must chose the proper bundle! +++ The Java Adapter received a BluetoothDeviceDiscoveryListener hook, matching C++ Adapter's HCIDeviceDiscoveryListener. Since the Java Adapter implements its own discovery thread, using the BluetoothDeviceDiscoveryListener is more efficient then polling over a list of Devices fetched. ++++ TODO: Align Java and C++ class names, foremost in the C++ direct_bt space. TODO: Bind the whole C++ GATT functionality More testing.
* build scripts: log outputv2.1.0Sven Gothel2020-04-122-29/+44
|
* Implement direct_bt: Direct Bluetooth access via Linux's Kernel BlueZ ↵Sven Gothel2020-04-096-10/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | protocol stack w/o D-Bus bluetoothd. By dropping BlueZ userspace D-Bus bluetoothd, we target high-performance reliable bluetooth support with least dependencies for embedded device configurations. See COPYING, describing which Linux Kernel BlueZ IOCTL information has been included in the source tree. We claim Linus Torvalds's Linux Kernel license exception regarding kernel syscalls (ioctl): <https://github.com/torvalds/linux/blob/master/LICENSES/exceptions/Linux-syscall-note> and hence maintain this project's license. The new direct_bt feature set is organized as follows - include/cppunit - api/direct_bt - api/ieee11073 - src/direct_bt - examples/direct_bt Note that the C++ direct_bt layer is not backward compatible to tinyb. Since the Java layer still needs to be completed, it has to be seen whether we will achieve compatibility or drop the original D-Bus tinyb module altogether in favor of a more streamlined API and implementation. Current state allows scanning for LE devices, connecting and parsing GATT plus receiving notifications and indications. See examples/direct_bt_scanner/dbt_scanner.cpp. The Linux Kernel BlueZ is configured via module MgmtComm.[hpp/cpp]