aboutsummaryrefslogtreecommitdiffstats
path: root/trial
Commit message (Collapse)AuthorAgeFilesLines
* Align to jaulib 1.3.3: Full cmake-presets usage w/ vscode support update; ↵v3.3.3Sven Göthel2024-08-092-0/+6
| | | | | | | | | | also use cmake target_{link|compile}_options instead of globals Example run scripts were also adopted. Unit and trial tests passed on amd64 machine. VSCode(ium) IDE integration manually tested.
* Fix or silent clang-tidy issuesSven Göthel2024-05-251-2/+2
|
* Adopt to jaulib: clangd/cland-tidy integration; Use VersionNumberSven Göthel2024-05-252-1/+2
|
* Adjust clang-tidy setup, project wide and per unit tests (drop ↵Sven Göthel2024-05-201-0/+3
| | | | 'bugprone-chained-comparison' for Catch2)
* Add jaulib jau::os::get_platform_info() (jau::os, jau::cpu) code and show ↵Sven Göthel2024-05-121-0/+3
| | | | info in test.
* jaulib: Bump and adopt to enum type name changes, added '_t'Sven Göthel2024-05-122-4/+4
|
* Build Environment: Better CMake Usage incl. Eclipse (IDE) default CDT CMake; ↵Sven Göthel2024-05-071-1/+1
| | | | | | | Default is C++20 now (analog to jaulib) Further: - Java Trial: Use native libs from build (not install dist dir), avoid install requirement
* Bump jaulib and adopt to jaulib byte_util API change (commit ↵Sven Göthel2024-03-022-4/+4
| | | | 147e17b0b41a123b2f4040cbd6df5b73b7e97164)
* BTAdapter: Remove redundant startDiscovery overload w/o DBGattServerRef and ↵Sven Gothel2023-10-291-1/+1
| | | | have full startDiscovery variant use DBGattServerRef default nullptr arg
* BTGattHandler::BTGattHandler: Pick BTAdapter::getGATTServerData() also in ↵Sven Gothel2023-10-271-1/+1
| | | | | | | | | | | | | GATTRole::Client; BTAdapter::startDiscovery() add DBGattServerRef ref A GattServerHandler(DBGattServer) is also possible for LL master (GATT client) connections where the server inquires certain data points within the client's GATT. User can pass DBGattServer to BTAdapter::startDiscovery() to enable the GattServerHandler for such cause. Test case: Avalun's LabPad device - DBTLabPadClient01.java - dbt_labpadclient01.cpp
* Convenience: Add DBGattValue.make(..) for java and 'POctets make_gvalue(..)' ↵Sven Gothel2023-10-272-72/+32
| | | | for C++ for general use (commonly used to ctor a DBGattServer)
* GATT Server Auth: Prepare dbt_peripheral00 (C++ and java), add ↵Sven Gothel2023-10-253-3/+3
| | | | | | | | | | | 'SMPIOCapability adapter_sec_io_cap' commandline param to enable IO for auth Currently I limit my tests for ENC + AUTH to: - BTSecurityLevel: ENC_AUTH (3) and ENC_AUTH_FIPS(4) - SMPIOCapability.DISPLAY_ONLY (0) to have a PASSKEY being display by the user application. Current unit tests cover the ENC_ONLY(2) with IO NONE (0xff) only and shall be enhanced for these enc+auth cases as well.
* Sync Java with C++ and tag API changes; All trial unit tests passedSven Gothel2023-10-224-30/+20
| | | | | | | | API Changes for v3.2.0: - BTAdapter: - setPrivacy(bool) added - initialize() w/o args or default args removed - initialize(final BTMode btMode, boolean powerOn) added
* clang-tidy fixes part-4 / 4: Use 'const T&' for arguments on listener typesSven Gothel2022-11-283-26/+26
| | | | | | - AdapterStatusListener - BTGattHandler::NativeGattCharListener - DBGattServer::Listener
* clang-tidy fixes part-3 / 4, adding Check `performance-*`Sven Gothel2022-11-288-27/+27
| | | | | | | | | | | | | | See also jaulib commit 9160f9a4b74f5e5ae07f715025ea4d3aafdf6ab3 Details: - Using 'const T&' as method argument type where applicable, i.e. not when required to pass value off-thread. - Notable: Can also hold a default value! - Using `const T&` in range-loop where applicable - Drop std::move for trivial types - ...
* clang-tidy fixes part-1Sven Gothel2022-11-273-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Details - Use 'size_type' instead of 'int', propagate same 'size_type' into 'darray' etc. - Use 'std::make_shared', 'std::make_unique' - Use range-based for loops - Remove redundant 'virtual', use 'override' in derived classes - Use 'nullptr' - Use default impl for dtor, ctor (incomplete) - Use copy and std::move (incomplete) - Explcitly catch std::bad_alloc in 'new' in 'noexcept' -> 'abort' - 'abort' was issued implicitly in noexcept methods - L2CAPServer, L2CAPClient, NopGattServerHandler, DBGattServerHandler, FwdGattServerHandler - Use local close_impl(), usable in virtual destructor - L2CAPClient::read, HCIComm::read - preset 'poll' result 'n', avoid garbage comparison - BTAdapter::enableListening - loop through addMgmtEventCallback() result - JNI code - explicit size_type is cast to jsize or jint w/o check - unchanged semantics
* Change all callback return type: dummy 'bool' -> 'void', now enabled by ↵Sven Gothel2022-09-161-4/+3
| | | | jau::function<void(A...)>
* Adopt to jau::function<R(A...)> from jau::FunctionDef<>Sven Gothel2022-09-163-5/+5
|
* Trial Unit Test: Add adapter reset test_client_server40_resetSven Gothel2022-09-158-4/+275
|
* Trial Unit Tests: Reorg and cleanup to be expanded (for reset test)Sven Gothel2022-09-1511-105/+145
| | | | | - When passing client and server in test8x_fullCycle() overload, expect them to be setup already. - client: KEEP_CONNECTED -> do_disconnect for clarity and along do_disconnect_randomly
* Use jaulib's BasicTypes, PrintUtil and Clock, drop duplicates in BTUtilSven Gothel2022-07-087-188/+195
|
* cmake trial launch: Use `-E` for sudo to pass environmentSven Gothel2022-07-072-2/+2
|
* Catch2: Adopt tests to v3.0.1Sven Gothel2022-06-198-24/+0
|
* BTAdapter::setDefaultConnParam() may fail w/ UNKNOWN_COMMAND on GNU/Linux < ↵Sven Gothel2022-06-182-2/+6
| | | | 5.9 (Ubuntu 20.04), tolerate it.
* trials: Initialize the environment first for 'direct_bt' keySven Gothel2022-06-171-0/+1
|
* Bump jaulib v0.13.1-14-g7c88cff and adoptSven Gothel2022-06-161-2/+2
|
* Bump jaulib v0.10.1-1-g6eea830 and adapt to minor changesSven Gothel2022-05-231-1/+1
|
* Adopt jau/file_util.hpp: Replacing code in SMPKeyBin and trial dbt_utils.hppSven Gothel2022-05-181-165/+5
|
* Removes using the 'device processing' list, as already the case for the ↵Sven Gothel2022-05-166-14/+4
| | | | | | | | | | trial tests Commit ca228cd0512be4642a41468ff92e688dbf296fcd defined that AdapterstatusListener::deviceFound() is only called if not already connected and if initially found . This change removes using the 'device processing' list, as already the case for the trial tests.
* Trial C++/Java: Validate BTAdapter::[add|remove]StatusListener() expected resultSven Gothel2022-05-166-10/+10
|
* Trial C++/Java: Fix BaseDBTClientServer::setupTest(): Add ↵Sven Gothel2022-05-162-55/+32
| | | | | | | | | | | | | | | | a.removeAllStatusListener() and new mngr.removeAllChangedAdapterSet{Callbacks|Listener}() ensuring clean state even if previous test failed. On the C++ trials using Catch2, not having issued at test launch via setupTest(): - adapter.removeAllStatusListener() - manager.removeAllChangedAdapterSetCallbacks() and if first test failed, the second tests had two ChangedAdapterSetCallbacks registered and hence added the AdapterStatusListener twice as well still had the previous test listener included. This in turn lead to a SIGSEGV when the previous AdapterStatusListener::deviceDisconnected() has been called in the server's processDisconnectedDevice()
* C++ Trial: Client/Server: close() and dtor waits for pending running_threads ↵Sven Gothel2022-05-162-0/+35
| | | | | | | using jau::latch - Helps avoiding runaway threads at unit test closing and object destruction (if at all) - Shows running_thread count
* Trial Tests C++/Java: Used merger dbt_[client|server]01 test code, drop ↵Sven Gothel2022-05-1612-3046/+77
| | | | | | dbt_[client|server]00 to simplify maintenance Client code adds success dependency to completedGATTCommands >= 1, considered a fix.
* C++/JNI Lifecycle Fix: BTManager must be passed as shared_ptr<> and hold as ↵Sven Gothel2022-05-144-31/+38
| | | | | | | | such in BTAdapter, ... (API CHANGE) BTAdapter removes itself from BTManager, hence needs to ensure BTManager is not yet destructed. This goes well along with our new JNI mapping, holding the shared_ptr reference in nativeInstance.
* C++ Trial / Example: Server: Use robust jau::service_runner, ensuring ↵Sven Gothel2022-05-132-98/+80
| | | | service start and stop is completed
* DBTServerTest::stop(): Remove `current_exp_advertising_state`, due to ↵Sven Gothel2022-05-1310-10/+10
| | | | closing and listener this state might not be 'on time'
* Trial: Server01::disconnectDevice(): Catch an already deleted device (null ↵Sven Gothel2022-05-122-4/+12
| | | | check) in this error provoking method
* Trial C++: Query BaseDBTClientServer::is_timedout() having an atomic flag ↵Sven Gothel2022-05-122-7/+11
| | | | set by timout_func() instead of abort() producing a core dump
* Trial C++: trial/direct_bt/dbt_client_server1x.hpp: Only use ↵Sven Gothel2022-05-121-2/+1
| | | | DBTServerTest::stop(), which calls close()
* Trial C++: Move `static BaseDBTClientServer& base_test_framework` into ↵Sven Gothel2022-05-128-21/+3
| | | | common test file dbt_client_server1x, ..
* Trial: Server: Unify stop + close, ensuring AdapterStatusListener is removed ↵Sven Gothel2022-05-127-80/+59
| | | | | | | | | first; Native dtor must check for pulseSenderThread and join if still running Ensuring AdapterStatusListener is removed first, otherwise it may kick off another 'action off-thread' for disconnect. Native dtor must check for pulseSenderThread and join if still running, otherwise C++ gives us a terminate.
* Trials: Client: Detect BTGattChar::[add|remove]CharListener() errors, ↵Sven Gothel2022-05-124-19/+82
| | | | forward them via success==false, no direct off-thread Assert/REQUIRE causing issues
* C++ Trial: Complete file_stats and file_utils in dbt_utils.hpp (namely mkdir ↵Sven Gothel2022-05-111-96/+110
| | | | and remove)
* JNI Lifecycle Fix: BTGattCharListener: Adopt full Java/Native link via ↵Sven Gothel2022-05-104-190/+213
| | | | | | | | | | | | | | | | | | | | | | | | DBTNativeDownlink and JavaUplink like AdapterStatusListener change, clean listener API + impl. AdapterStatusListener adopted fully linked via DBTNativeDownlink (java->native) and JavaUplink (native->java). This allows intrinsic lifecycle management. Native destruction leads to its reference removal from the java object and destruction of the java object removes its reference from the native object. Both reference removals may lead to their destruction if reaching zero. (was commit 9c5f25ccd1637728d6e79592279e4b38ecd32f59) Same applies to BTGattCharListener: - This removed BTGattChar::Listener, simply use BTGattCharListener - Using private BTGattHandler::GattCharListenerPair struct for BTGattChar mapping - No more manual or exposed BTGattChar mapping - Java: An added BTGattCharListener instance can be used for removal now, no more wrapper object magic returned. Further: - moved removed `namespace impl`, moved StatusListenerPair into private BTAdapter - have all add/remove*Listener methods noexcept Unit tests validating BTGattCharListener add and remove.
* JNI Lifecycle Fix: Have AdapterStatusListener derive from ↵Sven Gothel2022-05-095-5/+5
| | | | | | | JavaUplink/DBTNativeDownlink, resolving BTAdapter::removeAllStatusListener() and use shared_ptr_ref<T> - AdapterStatusListener's native instance is now created at java object construction, etc .. same pattern like BTDevice .. - Java/Native object relation is inherently thread safe due to using use shared_ptr_ref<T>
* trial i470 test_provoke (C++) / TestDBTProvoke (Java) demonstrating C++ ↵Sven Gothel2022-05-078-381/+430
| | | | survives while Java crashes (known issue)
* API Change: AdapterStatusListener::deviceConnected(): `const uint16_t ↵Sven Gothel2022-05-068-20/+20
| | | | | | | | | | | | | | | handle` -> `const bool discovered` Motivation: - the connection handle is known to the device already and can be retrieved, redundant information - the flag discovered gives information whether BTAdapter has sent out a deviceFound message, i.e. the user actually issued the connection (default). We like to detect issues where devices are automatically connected by the underlying host implementation, i.e. BlueZ/kernel's whitelist mechanism or otherwise - an unsusal and undesired situation. In such case, no `DEVICE FOUND` advertising is promoted and the underlying BlueZ/kernel issues the connection itself. Here `discovered` will be `false`.
* Trial (Java + C++): DBTEndpoint, DBTClientTest, DBTServerTest: Add ↵Sven Gothel2022-05-0532-441/+2098
| | | | | | abstraction to plug-in any client/server instance into DBTClientServer1x Further add TestDBTProvokeClientServer_i470 (java trial, copied from native trial)
* jaulib: JavaUplink::{checkValid() -> checkValidInstance()} changeSven Gothel2022-05-051-0/+0
|
* C++ Trial: DBTServer*: Remove unused sync_data atomicSven Gothel2022-05-052-18/+0
|