aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* BTAdapter/HCIHandler::toString(): Show dev_id as 1st element w/o explicitly ↵Sven Gothel2022-09-152-4/+3
| | | | naming it.
* HCIHandler::resetAdapter(): Add optional HCIHandler::PostShutdownFunc ↵Sven Gothel2022-09-152-22/+38
| | | | | | | argument, allowing BTAdapter::reset() to wait until all devices are disconnected before powering-up again Waiting for all disconnections within reset after shutdown phase determines the state of all devices before powering up.
* BTAdapter: Align hasDevicesPausingDiscovery() -> ↵Sven Gothel2022-09-151-6/+6
| | | | getDevicesPausingDiscoveryCount() w/ getConnectedDeviceCount(), both return nsize_t
* BTAdapter::poweredOff(): Always use disconnectAllDevices() for proper device ↵Sven Gothel2022-09-151-6/+1
| | | | | | | | | pull-down to clear all its states instead of just deleting all refs if !active BTAdapter::poweredOff()'s active argument shall only impact issuing stopDiscoveryImpl(). Without disconnectAllDevices(), non removed devices will have states uncleared, e.g. isConnected, certain SMP states etc.
* BTAdapter::mgmtEvDeviceDisconnectedHCI(): printDeviceLists() in verbose mode ↵Sven Gothel2022-09-151-0/+3
| | | | if not connected
* BTAdapter::powerOff(): Add msg for debug tracingSven Gothel2022-09-151-13/+13
|
* direct_bt::to_string(<enum_type>): Remove NONE in bitfield enumerationsSven Gothel2022-09-153-10/+0
|
* HCIHandler::reset*(), [start|stop]Adapter(): Rewrap with DBG_PRINT() for tracingSven Gothel2022-09-151-28/+49
|
* HCIHandler: ERR_PRINT remove function header, ensure dev_id shownSven Gothel2022-09-151-56/+44
|
* HCIHandler: DBG_PRINT add function header w/ dev_id, WARN_PRINT remove ↵Sven Gothel2022-09-151-93/+94
| | | | function header, ensure dev_id shown
* BTAdapter: Use jau::service_runner to ensure singleton pattern on background ↵Sven Gothel2022-09-141-20/+23
| | | | | | discovery startDiscoveryBackground() -> discovery_service + discoveryServerWork()
* BTAdapter::removeDevicePausingDiscovery(): Drop 'off_thread' argument, ↵Sven Gothel2022-09-141-12/+8
| | | | always perform off thread BTAdapter::startDiscoveryBackground()
* jau::service_runner CB BTAdapter::l2capServer*(): Add 'noexcept'Sven Gothel2022-09-141-3/+3
|
* BTAdapter::mgmtEvDeviceDiscoveringAny(): Drop 'off_thread' argument, which ↵Sven Gothel2022-09-141-14/+10
| | | | | | is always used with value 'true' Hence BTAdapter::startDiscoveryBackground() is always started off-thread.
* BTAdapter::startDiscoveryBackground(): Fix retry==true endless thread: Set ↵Sven Gothel2022-09-141-1/+2
| | | | retry=false @ action block start, then determine retry or not
* Add jaulib base_codec.cpp for file_util.cpp, i.e. encode() integer for copy dirsSven Gothel2022-09-061-0/+1
|
* FreeBSD Support: Add patches. Build complete on GNU/Linux and FreeBSD. ↵Sven Gothel2022-07-264-24/+58
| | | | Missing: FreeBSD kernel BT functionality (currently just aborts)
* Adapt to `file_stats::to_string()` .. dropped 'use_space' paramter (jaulib ↵Sven Gothel2022-07-221-4/+4
| | | | c88abd8359be48b19425dffe154b0eb469401bb9)
* Adopt to jau::fs::dir_item changeSven Gothel2022-07-071-3/+3
|
* gcc 11.2 (Ubuntu 22.04): Fix unused variable rspSize warning -> errorSven Gothel2022-06-181-0/+1
|
* BTAdapter::setDefaultConnParam() may fail w/ UNKNOWN_COMMAND on GNU/Linux < ↵Sven Gothel2022-06-184-23/+33
| | | | 5.9 (Ubuntu 20.04), tolerate it.
* Simplify bitmask to_string() code, simply testing each bit via template ↵Sven Gothel2022-06-173-319/+170
| | | | macro w/o for-loop and switch
* C++: Shorten is*Set() -> is_set(), fix test requiring all bits set to `bit ↵Sven Gothel2022-06-172-14/+14
| | | | == ( mask & bit )`
* C++: Shorten is*Set() -> is_set() and set*() -> set() for bit-type enums; ↵Sven Gothel2022-06-164-52/+52
| | | | Fix is_set() bit-type enum: '0 != ( mask & bit )' -> 'bit == ( mask & bit )'
* Adopt to jaulib jau::jni namespace changesSven Gothel2022-06-061-3/+3
|
* Bump jaulib v0.10.1-1-g6eea830 and adapt to minor changesSven Gothel2022-05-231-2/+2
|
* Adding C++ module/groups to separate the C++ API levels for the user; Adding ↵v2.7.1Sven Gothel2022-05-221-0/+2
| | | | reference to perihperal-server mode to overview.
* Adopt jau/file_util.hpp: Replacing code in SMPKeyBin and trial dbt_utils.hppSven Gothel2022-05-182-62/+28
|
* Remove BTDeviceRegistry's 'device processing' listSven Gothel2022-05-161-42/+0
| | | | | | See commits - cc53af990263bfa09947ad3127e0de6a6ffcb493 - ca228cd0512be4642a41468ff92e688dbf296fcd
* Removes using the 'device processing' list, as already the case for the ↵Sven Gothel2022-05-161-1/+1
| | | | | | | | | | 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.
* noexcept: BTGattHandler::send*(): Fix BTGattHandler's discover*(): Return ↵Sven Gothel2022-05-161-8/+7
| | | | | | | | | | | | | true == no_ioerror, initClientGatt() checks content. Fix in commit 82ecfd8e19c88e3e4d0ddb04796874834292a05e contains bugs in its BTGattHandler discovery: - discoverDescriptors() shall just return true == no_ioerror, its OK to have no descriptors - discoverCharacteristics() shall just return true == no_ioerror, we may tolerate to have no characteristics - discoverPrimaryServices() shall just return true == no_ioerror, we check services later on - discoverCompletePrimaryServices() shall only return false if above signaled an ioerror, we check services later on - initClientGatt() bails out on ioerror or failed services content - here we perform the services checks. Fixed
* Trial C++/Java: Validate BTAdapter::[add|remove]StatusListener() expected resultSven Gothel2022-05-161-1/+1
|
* Trial C++/Java: Fix BaseDBTClientServer::setupTest(): Add ↵Sven Gothel2022-05-161-0/+6
| | | | | | | | | | | | | | | | 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()
* noexcept: BTGattHandler::send*(): Simplify error check in BTGattHandler::send()Sven Gothel2022-05-151-14/+13
|
* noexcept: BTGattHandler::send*(): Fix BTDevice::getGattService(): Return ↵Sven Gothel2022-05-152-38/+55
| | | | | | | | | | | | | | | | | | | | zero sized array of BTGattServices on error BTGattHandler::discoverCompletePrimaryServices(): - just discover the services and its characteristics and descriptors - return bool, success of failor as returned by discovery methods (incl. their send*() command) BTGattHandler::initClientGatt(): - clear services before retrieval and on error - error response on - BTGattHandler::discoverCompletePrimaryServices() failure - no services - no GenericAccess services - only return true and leave services if no error BTDevice::getGattService(): - perform BTGattHandler::initClientGatt() error checks as well - update method API doc, describing failure included no GenericAccess service
* C++/JNI Lifecycle Fix: BTManager must be passed as shared_ptr<> and hold as ↵Sven Gothel2022-05-143-64/+60
| | | | | | | | 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.
* JNI Lifecycle Fix: BTGattCharListener: Adopt full Java/Native link via ↵Sven Gothel2022-05-105-159/+136
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove AdapterStatusListener::matchDevice(), moved to ↵Sven Gothel2022-05-091-9/+9
| | | | impl::StatusListenerPair for BTDevice::addStatusListener() only -> Simplifying API
* Use typedef of shared_pre<T> 'TRef' and pass `const shared_pre<T>&` where ↵Sven Gothel2022-05-092-20/+23
| | | | possible
* JNI Lifecycle Fix: Have AdapterStatusListener derive from ↵Sven Gothel2022-05-091-8/+10
| | | | | | | 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>
* BTManager: Call `jau::root_environment::set_terminating()` at dtor. Due to ↵Sven Gothel2022-05-091-0/+5
| | | | its static singleton instance nature, dtor only called at shutdown/exit
* BTAdapter::mgmtEvDeviceFoundHCI(): Drop deviceFound() if already connected, ↵Sven Gothel2022-05-061-17/+21
| | | | a paranoid safeguard - should never happen
* API Change: AdapterStatusListener::deviceConnected(): `const uint16_t ↵Sven Gothel2022-05-061-7/+16
| | | | | | | | | | | | | | | 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`.
* Adopt to JavaUplink::checkValidInstance(): ↵Sven Gothel2022-05-052-11/+11
| | | | BTObject::{isValid()->isValidInstance()} for clarity; BTAdapter adds `adapter_operational` flag for its own isValid()
* Use fraction_i64::to_ms() w/ PRIi64 in printfSven Gothel2022-05-053-12/+12
|
* SMPKeyBin Cleanup, use explicit :: anonymous namespace for externalsSven Gothel2022-05-011-3/+3
|
* Bump jaulib v0.9.1 and adopt to fraction changes, use wait_until() w/ ↵Sven Gothel2022-05-018-74/+77
| | | | out-of-loop absolute timeout_time, avoiding deadlocks
* cmake: Add jaulib/src/simple_timer.cpp to libSven Gothel2022-04-241-0/+1
|
* BTAdapter::smp_timeoutfunc(): Stop if shall_stop() at start and return 0 if ↵Sven Gothel2022-04-241-4/+7
| | | | shall_stop()
* Only use libunwind if specified (USE_LIBUNWIND via jaulib)Sven Gothel2022-04-241-1/+1
|