Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
Classes | Public Member Functions | List of all members
DBTClient01 Class Reference

This central BTRole::Master participant works with DBTServer00. More...

#include <dbt_client01.hpp>

Inheritance diagram for DBTClient01:
Collaboration diagram for DBTClient01:

Public Member Functions

 DBTClient01 (const std::string &adapterName_, const EUI48 useAdapter_, const BTMode btMode_, const bool do_disconnect_randomly_=false)
 
 ~DBTClient01 () override
 
void close (const std::string &msg) override
 
BTAdapterRef getAdapter () override
 Return the adapter for this endpoint. More...
 
int getDisconnectCount () override
 
std::string getName () override
 Return name of this endpoint, which becomes the adapter's name. More...
 
int getProtocolSessionsDoneSuccess () override
 
int getProtocolSessionsDoneTotal () override
 
int getProtocolSessionsLeft () override
 
bool initAdapter (BTAdapterRef adapter) override
 Initialize the given adapter for this endpoint. More...
 
void setAdapter (BTAdapterRef clientAdapter_) override
 Set the server adapter for this endpoint. More...
 
void setDisconnectDevice (const bool v) override
 Set disconnect after processing. More...
 
void setDiscoveryPolicy (const DiscoveryPolicy v) override
 Set DiscoveryPolicy. More...
 
void setProtocolSessionsLeft (const int v) override
 
void setRemoveDevice (const bool v) override
 Set remove device when disconnecting. More...
 
HCIStatusCode startDiscovery (const std::string &msg) override
 
HCIStatusCode stopDiscovery (const std::string &msg) override
 
virtual void setDisconnectDevice (const bool v)=0
 Set disconnect after processing. More...
 
virtual void setDiscoveryPolicy (const DiscoveryPolicy v)=0
 Set DiscoveryPolicy. More...
 
virtual void setRemoveDevice (const bool v)=0
 Set remove device when disconnecting. More...
 
virtual HCIStatusCode startDiscovery (const std::string &msg)=0
 
virtual HCIStatusCode stopDiscovery (const std::string &msg)=0
 
- Public Member Functions inherited from DBTEndpoint
virtual ~DBTEndpoint ()=default
 
virtual void close (const std::string &msg)=0
 
virtual BTAdapterRef getAdapter ()=0
 Return the adapter for this endpoint. More...
 
virtual int getDisconnectCount ()=0
 
virtual std::string getName ()=0
 Return name of this endpoint, which becomes the adapter's name. More...
 
virtual int getProtocolSessionsDoneSuccess ()=0
 
virtual int getProtocolSessionsDoneTotal ()=0
 
virtual int getProtocolSessionsLeft ()=0
 
virtual bool initAdapter (BTAdapterRef adapter)=0
 Initialize the given adapter for this endpoint. More...
 
virtual void setAdapter (BTAdapterRef a)=0
 Set the server adapter for this endpoint. More...
 
virtual void setProtocolSessionsLeft (const int v)=0
 

Additional Inherited Members

- Static Public Member Functions inherited from DBTClientTest
static void startDiscovery (const DBTClientTestRef &client, const bool current_exp_discovering_state, const std::string &msg)
 
static void stopDiscovery (const DBTClientTestRef &client, const bool current_exp_discovering_state, const std::string &msg)
 
- Static Public Member Functions inherited from DBTEndpoint
static void checkInitializedState (const DBTEndpointRef &endp)
 
static ChangedAdapterSetCallback initChangedAdapterSetListener (const BTManagerRef &manager, std::vector< DBTEndpointRef > endpts)
 
static void myChangedAdapterSetFunc (const bool added, BTAdapterRef &adapter)
 
static void startDiscovery (const BTAdapterRef &adapter, const bool current_exp_discovering_state)
 
static void stopDiscovery (const BTAdapterRef &adapter, const bool current_exp_discovering_state)
 
- Static Public Attributes inherited from DBTEndpoint
static std::vector< DBTEndpointRefcas_endpts
 
static std::mutex mtx_cas_endpts
 

Detailed Description

This central BTRole::Master participant works with DBTServer00.

Definition at line 43 of file dbt_client01.hpp.

Constructor & Destructor Documentation

◆ DBTClient01()

DBTClient01::DBTClient01 ( const std::string &  adapterName_,
const EUI48  useAdapter_,
const BTMode  btMode_,
const bool  do_disconnect_randomly_ = false 
)
inline

Definition at line 298 of file dbt_client01.hpp.

◆ ~DBTClient01()

DBTClient01::~DBTClient01 ( )
inlineoverride

Definition at line 305 of file dbt_client01.hpp.

Member Function Documentation

◆ getName()

std::string DBTClient01::getName ( )
inlineoverridevirtual

Return name of this endpoint, which becomes the adapter's name.

Implements DBTEndpoint.

Definition at line 310 of file dbt_client01.hpp.

◆ setAdapter()

void DBTClient01::setAdapter ( BTAdapterRef  a)
inlineoverridevirtual

Set the server adapter for this endpoint.

This is done in ChangedAdapterSetListener#adapterAdded(BTAdapter) if initAdapter(BTAdapter) returned true.

Parameters
athe associate adapter for this endpoint.

Implements DBTEndpoint.

Definition at line 312 of file dbt_client01.hpp.

◆ getAdapter()

BTAdapterRef DBTClient01::getAdapter ( )
inlineoverridevirtual

Return the adapter for this endpoint.

Implements DBTEndpoint.

Definition at line 316 of file dbt_client01.hpp.

◆ setProtocolSessionsLeft()

void DBTClient01::setProtocolSessionsLeft ( const int  v)
inlineoverridevirtual

Implements DBTEndpoint.

Definition at line 318 of file dbt_client01.hpp.

◆ getProtocolSessionsLeft()

int DBTClient01::getProtocolSessionsLeft ( )
inlineoverridevirtual

Implements DBTEndpoint.

Definition at line 321 of file dbt_client01.hpp.

◆ getProtocolSessionsDoneTotal()

int DBTClient01::getProtocolSessionsDoneTotal ( )
inlineoverridevirtual

Implements DBTEndpoint.

Definition at line 324 of file dbt_client01.hpp.

◆ getProtocolSessionsDoneSuccess()

int DBTClient01::getProtocolSessionsDoneSuccess ( )
inlineoverridevirtual

Implements DBTEndpoint.

Definition at line 327 of file dbt_client01.hpp.

◆ getDisconnectCount()

int DBTClient01::getDisconnectCount ( )
inlineoverridevirtual

Implements DBTEndpoint.

Definition at line 330 of file dbt_client01.hpp.

◆ setDiscoveryPolicy()

void DBTClient01::setDiscoveryPolicy ( const DiscoveryPolicy  v)
inlineoverridevirtual

Set DiscoveryPolicy.

Default is DiscoveryPolicy#PAUSE_CONNECTED_UNTIL_READY

Implements DBTClientTest.

Definition at line 334 of file dbt_client01.hpp.

◆ setDisconnectDevice()

void DBTClient01::setDisconnectDevice ( const bool  v)
inlineoverridevirtual

Set disconnect after processing.

Default is true.

Implements DBTClientTest.

Definition at line 337 of file dbt_client01.hpp.

◆ setRemoveDevice()

void DBTClient01::setRemoveDevice ( const bool  v)
inlineoverridevirtual

Set remove device when disconnecting.

This removes the device from all instances within adapter and hence all potential side-effects of the current instance.

Default is false, since it is good to test whether such side-effects exists.

Implements DBTClientTest.

Definition at line 340 of file dbt_client01.hpp.

◆ startDiscovery()

HCIStatusCode DBTClient01::startDiscovery ( const std::string &  msg)
inlineoverridevirtual

Implements DBTClientTest.

Definition at line 647 of file dbt_client01.hpp.

◆ stopDiscovery()

HCIStatusCode DBTClient01::stopDiscovery ( const std::string &  msg)
inlineoverridevirtual

Implements DBTClientTest.

Definition at line 653 of file dbt_client01.hpp.

◆ close()

void DBTClient01::close ( const std::string &  msg)
inlineoverridevirtual

Implements DBTEndpoint.

Definition at line 659 of file dbt_client01.hpp.

◆ initAdapter()

bool DBTClient01::initAdapter ( BTAdapterRef  adapter)
inlineoverridevirtual

Initialize the given adapter for this endpoint.

The matching and successfully initialized adapter will become this endpoint's associated adapter via setAdapter(BTAdapter), as performed in in ChangedAdapterSetListener#adapterAdded(BTAdapter).

Parameters
adapterthe potential associated adapter for this endpoint.
Returns
true if successful and associated

Implements DBTEndpoint.

Definition at line 667 of file dbt_client01.hpp.


The documentation for this class was generated from the following file: