| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
native send[Notification|Indication]() method.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
service start and stop is completed
|
| |
|
| |
|
|
|
|
| |
closing and listener this state might not be 'on time'
|
|
|
|
| |
check) in this error provoking method
|
|
|
|
| |
set by timout_func() instead of abort() producing a core dump
|
|
|
|
| |
DBTServerTest::stop(), which calls close()
|
|
|
|
| |
common test file dbt_client_server1x, ..
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
forward them via success==false, no direct off-thread Assert/REQUIRE causing issues
|
|
|
|
| |
and remove)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
== BTFactory.isInitialized()` in ctor, i.e. use w/o native libraries
DBTNativeDownlink:
- remove `static { BTFactory.checkInitialized() }`, not allowing constructing any specialization instance
AdapterStatusListener, BTGattCharListener:
- check BTFactory.isInitialized() in ctor and drop the nativeInstance w/ a System.err note
BTFactory:
- Fix isInitialized() query (duh!)
- Have initializedID be atomic and drop 'synchronized' locking on
- checkInitialized()
- isInitialized()
This tolerance is required to establish the behavior before
fixing the JNI lifecycle of AdapterStatusListener, BTGattCharListener,
i.e. allow testing using BTGattCharListener w/o a real BT subsystem.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
AdapterStatusListener derive from JavaUplink/DBTNativeDownlink
Was done in commit 9c5f25ccd1637728d6e79592279e4b38ecd32f59 to fix JNI Lifecycle
|
|
|
|
| |
impl::StatusListenerPair for BTDevice::addStatusListener() only -> Simplifying API
|
|
|
|
| |
`trial.org.direct_bt.TestDBTProvokeClientServer_i470` w/o crash, using `std::shared_ptr<T>`
|
|
|
|
| |
by using shared_ptr_ref<T>
|
|
|
|
| |
possible
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
shared_ptr_ref<T>; Made is{->Native}Valid() final for clarity
- Currently `initDownlink(..)` is intended for AdapterStatusListener
- Clarity `protected boolean isValid()` -> `protected final boolean isNativeValid()`
|
|
|
|
| |
examples/dbt_test_gattcharlifecycle01.cpp (we have our new trial tests)
|
|
|
|
| |
its static singleton instance nature, dtor only called at shutdown/exit
|
| |
|
| |
|
|
|
|
| |
survives while Java crashes (known issue)
|
|
|
|
| |
DBGatt{Service,Char,Desc} in BTGatt{Service,Char,Desc}
|
|
|
|
| |
already reading unallocated memory.
|
| |
|
|
|
|
| |
a paranoid safeguard - should never happen
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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`.
|
|
|
|
|
|
| |
abstraction to plug-in any client/server instance into DBTClientServer1x
Further add TestDBTProvokeClientServer_i470 (java trial, copied from native trial)
|
|
|
|
| |
BTObject::{isValid()->isValidInstance()} for clarity; BTAdapter adds `adapter_operational` flag for its own isValid()
|
| |
|
| |
|
|
|
|
| |
and mark super virtual requirement
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
to JavaUplink super class) instead of virtual and honor noexcept - don't inline overrides
JavaUplink Specializations Involved:
- BTAdapter
- BTDevice
- BTManager
|
|
|
|
|
|
| |
std::make_shared<jau::JavaGlobalObj>() ctor @ javaUplink->setJavaObject()
This avoids any jjobject destruction in-between
|
| |
|
| |
|
|
|
|
|
|
| |
call, avoiding their destructions
This is added for GATT retrieval functions only .. for now.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Here we use a new custom client and server code,
where client:
- does not filter found devices whether they are already connected
and server:
- disconnects 100 ms after Gatt MTU change,
disrupting client's getGattServices discovery process
+++
Note: Usage of dbt_client* and dbt_server* has been untangled
in the header files, i.e. included at top level.
|