summaryrefslogtreecommitdiffstats
path: root/trial/direct_bt/dbt_server00.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'trial/direct_bt/dbt_server00.hpp')
-rw-r--r--trial/direct_bt/dbt_server00.hpp32
1 files changed, 21 insertions, 11 deletions
diff --git a/trial/direct_bt/dbt_server00.hpp b/trial/direct_bt/dbt_server00.hpp
index 362b0141..9565e0b1 100644
--- a/trial/direct_bt/dbt_server00.hpp
+++ b/trial/direct_bt/dbt_server00.hpp
@@ -70,9 +70,11 @@ class DBTServer00 : public DBTServerTest {
bool use_SC = true;
BTSecurityLevel adapterSecurityLevel = BTSecurityLevel::UNSET;
- // DBGattServerRef dbGattServer = std::make_shared<DBGattServer>(
- // DBGattServerRef dbGattServer = new DBGattServer(
- // DBGattServerRef dbGattServer( new DBGattServer(
+ jau::sc_atomic_int disconnectCount = 0;
+ jau::sc_atomic_int servedProtocolSessionsTotal = 0;
+ jau::sc_atomic_int servedProtocolSessionsSuccess = 0;
+ jau::sc_atomic_int servingProtocolSessionsLeft = 1;
+
DBGattServerRef dbGattServer = std::make_shared<DBGattServer>(
/* services: */
jau::make_darray( // DBGattService
@@ -152,14 +154,6 @@ class DBTServer00 : public DBTServerTest {
std::mutex mtx_sync;
BTDeviceRef connectedDevice;
- public:
- jau::sc_atomic_int disconnectCount = 0;
- jau::sc_atomic_int servedProtocolSessionsTotal = 0;
- jau::sc_atomic_int servedProtocolSessionsSuccess = 0;
- jau::sc_atomic_int servingProtocolSessionsLeft = 1;
-
- private:
-
void setDevice(BTDeviceRef cd) {
const std::lock_guard<std::mutex> lock(mtx_sync); // RAII-style acquire and relinquish via destructor
connectedDevice = cd;
@@ -618,6 +612,22 @@ class DBTServer00 : public DBTServerTest {
fprintf_td(stderr, "****** Server Close.X: %s\n", msg.c_str());
}
+ void setProtocolSessionsLeft(const int v) override {
+ servingProtocolSessionsLeft = v;
+ }
+ int getProtocolSessionsLeft() override {
+ return servingProtocolSessionsLeft;
+ }
+ int getProtocolSessionsDoneTotal() override {
+ return servedProtocolSessionsTotal;
+ }
+ int getProtocolSessionsDoneSuccess() override {
+ return servedProtocolSessionsSuccess;
+ }
+ int getDisconnectCount() override {
+ return disconnectCount;
+ }
+
private:
HCIStatusCode stopAdvertising(std::string msg) {
HCIStatusCode status = serverAdapter->stopAdvertising();