Kallisto Linux API
Library for interacting with Kallisto devices
BluetoothAdapter Class Reference

#include <bluetooth_adapter.hpp>

Data Structures

class  Listener
 
class  ScanListener
 

Public Member Functions

 BluetoothAdapter (std::string id)
 
 ~BluetoothAdapter ()
 
 BluetoothAdapter (BluetoothAdapter const &)=delete
 
void operator= (BluetoothAdapter const &)=delete
 
 BluetoothAdapter (BluetoothAdapter &&other)
 
BluetoothAdapteroperator= (BluetoothAdapter &&other)
 
std::string getId () const
 
error::KallistoDetailedResult enable ()
 
error::KallistoDetailedResult disable ()
 
bool isEnabled ()
 
const std::vector< BluetoothDevice * > getDevices ()
 
BluetoothDevicegetDevice (std::string address)
 
error::KallistoDetailedResult registerListener (BluetoothAdapter::Listener &listener)
 
void unregisterListener ()
 
bool isScanning ()
 
error::KallistoDetailedResult startScan (BluetoothAdapter::ScanListener &listener)
 
error::KallistoDetailedResult stopScan ()
 
bool operator== (const BluetoothAdapter &other) const
 
bool operator!= (const BluetoothAdapter &other) const
 

Detailed Description

Class that handles a Bluetooth adapter

TODO: Should BluetoothAdapterManager be friend of this class and hide all methods?

Constructor & Destructor Documentation

◆ BluetoothAdapter() [1/3]

BluetoothAdapter ( std::string  id)

Constructor.

◆ ~BluetoothAdapter()

Destructor.

◆ BluetoothAdapter() [2/3]

BluetoothAdapter ( BluetoothAdapter const &  )
delete

Remove copy.

◆ BluetoothAdapter() [3/3]

Move constructor.

Member Function Documentation

◆ disable()

Disables the Bluetooth adapter.

Returns
A detailed result.

◆ enable()

Tries to enable the Bluetooth adapter. Async method, should wait for the callback.

Returns
A detailed result.

◆ getDevice()

BluetoothDevice* getDevice ( std::string  address)

Returns the device with the passed address.

Returns
The device with the passed address or nullptr if not found.

◆ getDevices()

const std::vector<BluetoothDevice*> getDevices ( )

Returns a list with all the devices available in the system.

Returns
The device list.

◆ getId()

std::string getId ( ) const
inline

Returns this adapter id.

Returns
This adapter id.
Here is the call graph for this function:

◆ isEnabled()

bool isEnabled ( )

Checks if the Bluetooth adapter is already enabled.

Returns
true if the adapter is enabled.

◆ isScanning()

bool isScanning ( )

Checks if the Bluetooth adapter is scanning

Returns
true if the adapter is scanning.

◆ operator=()

BluetoothAdapter& operator= ( BluetoothAdapter &&  other)

Move assigment.

◆ registerListener()

Registers a listener for adapter changes. If a previous listener was registered, it will be replaced.

Parameters
listenerThe listener to report events to.
Returns
A detailed result.

◆ startScan()

Starts scanning.

Returns
A detailed result.

◆ stopScan()

Stops an on-going scan.

Returns
A detailed result.

◆ unregisterListener()

void unregisterListener ( )

Unregisters the listener for adapter changes.


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