diff options
author | Sven Gothel <[email protected]> | 2022-05-09 01:47:34 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2022-05-09 01:47:34 +0200 |
commit | 9c5f25ccd1637728d6e79592279e4b38ecd32f59 (patch) | |
tree | 265b733ff97873a822619f3bff904303072f3ff9 /trial/direct_bt | |
parent | 6c1dbe6d7474283a343eca93c79549cda705bca4 (diff) |
JNI Lifecycle Fix: Have AdapterStatusListener derive from 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>
Diffstat (limited to 'trial/direct_bt')
-rw-r--r-- | trial/direct_bt/dbt_client00.hpp | 2 | ||||
-rw-r--r-- | trial/direct_bt/dbt_client01.hpp | 2 | ||||
-rw-r--r-- | trial/direct_bt/dbt_client_server1x.hpp | 2 | ||||
-rw-r--r-- | trial/direct_bt/dbt_server00.hpp | 2 | ||||
-rw-r--r-- | trial/direct_bt/dbt_server01.hpp | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/trial/direct_bt/dbt_client00.hpp b/trial/direct_bt/dbt_client00.hpp index e0fe8145..36508f8a 100644 --- a/trial/direct_bt/dbt_client00.hpp +++ b/trial/direct_bt/dbt_client00.hpp @@ -222,7 +222,7 @@ class DBTClient00 : public DBTClientTest { dc.detach(); } - std::string toString() const override { + std::string toString() const noexcept override { return "Client MyAdapterStatusListener[this "+to_hexstring(this)+"]"; } diff --git a/trial/direct_bt/dbt_client01.hpp b/trial/direct_bt/dbt_client01.hpp index 2f86976d..99e93b44 100644 --- a/trial/direct_bt/dbt_client01.hpp +++ b/trial/direct_bt/dbt_client01.hpp @@ -239,7 +239,7 @@ class DBTClient01 : public DBTClientTest { dc.detach(); } - std::string toString() const override { + std::string toString() const noexcept override { return "Client MyAdapterStatusListener[this "+to_hexstring(this)+"]"; } diff --git a/trial/direct_bt/dbt_client_server1x.hpp b/trial/direct_bt/dbt_client_server1x.hpp index 9952042a..012d5234 100644 --- a/trial/direct_bt/dbt_client_server1x.hpp +++ b/trial/direct_bt/dbt_client_server1x.hpp @@ -131,7 +131,7 @@ class DBTClientServer1x { fprintf_td(stderr, "XXXXXX Client Ready: %s\n", device->toString(true).c_str()); } - std::string toString() const override { return "DBTClientServer1x::Client"; } + std::string toString() const noexcept override { return "DBTClientServer1x::Client"; } }; std::shared_ptr<AdapterStatusListener> clientAdapterStatusListener = std::make_shared<MyAdapterStatusListener>(*this); REQUIRE( true == client->getAdapter()->addStatusListener(clientAdapterStatusListener) ); diff --git a/trial/direct_bt/dbt_server00.hpp b/trial/direct_bt/dbt_server00.hpp index 67ce53f2..4bd990f7 100644 --- a/trial/direct_bt/dbt_server00.hpp +++ b/trial/direct_bt/dbt_server00.hpp @@ -297,7 +297,7 @@ class DBTServer00 : public DBTServerTest { (void)timestamp; } - std::string toString() const override { + std::string toString() const noexcept override { return "Server MyAdapterStatusListener[this "+to_hexstring(this)+"]"; } diff --git a/trial/direct_bt/dbt_server01.hpp b/trial/direct_bt/dbt_server01.hpp index 7dfe07ed..1b652c50 100644 --- a/trial/direct_bt/dbt_server01.hpp +++ b/trial/direct_bt/dbt_server01.hpp @@ -301,7 +301,7 @@ class DBTServer01 : public DBTServerTest { (void)timestamp; } - std::string toString() const override { + std::string toString() const noexcept override { return "Server MyAdapterStatusListener[this "+to_hexstring(this)+"]"; } |