BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
Public Member Functions | Static Protected Member Functions
BeeeOn::BluezHciInterface Class Reference
Inheritance diagram for BeeeOn::BluezHciInterface:
BeeeOn::HciInterface BeeeOn::Loggable

Public Member Functions

 BluezHciInterface (const std::string &name)
 
void up () const override
 
void reset () const override
 
bool detect (const MACAddress &address) const override
 
std::map< MACAddress, std::string > scan () const override
 
std::map< MACAddress, std::string > lescan (const Poco::Timespan &seconds) const override
 
HciInfo info () const override
 
HciConnection::Ptr connect (const MACAddress &address, const Poco::Timespan &timeout) const override
 
void watch (const MACAddress &address, Poco::SharedPtr< WatchCallback > callBack) override
 
void unwatch (const MACAddress &address) override
 

Static Protected Member Functions

static std::string parseLEName (uint8_t *eir, size_t length)
 

Additional Inherited Members

- Public Types inherited from BeeeOn::HciInterface
typedef Poco::SharedPtr
< HciInterface
Ptr
 
typedef std::function< void(const
MACAddress &, std::vector
< unsigned char > &)> 
WatchCallback
 

Member Function Documentation

HciConnection::Ptr BluezHciInterface::connect ( const MACAddress address,
const Poco::Timespan &  timeout 
) const
overridevirtual

Connects to device defined by MAC address and loads it's services.

Exceptions
IOExceptionin case of a failure

Implements BeeeOn::HciInterface.

bool BluezHciInterface::detect ( const MACAddress address) const
overridevirtual

Check state of device with MACAddress.

Returns
true if the device was detected or false
Exceptions
IOExceptionwhen the detection fails for some reason

Implements BeeeOn::HciInterface.

HciInfo BluezHciInterface::info ( ) const
overridevirtual

Read information about the iterface.

Implements BeeeOn::HciInterface.

map< MACAddress, string > BluezHciInterface::lescan ( const Poco::Timespan &  seconds) const
overridevirtual

Full scan of low energy bluetooth network. Sets parameters for low energy scan and open socket.

Returns
list of MAC addresses with names
Exceptions
IOExceptionwhen the detection fails for some reason

Implements BeeeOn::HciInterface.

string BluezHciInterface::parseLEName ( uint8_t *  eir,
size_t  length 
)
staticprotected

Find device name in le_advertising_info struct

Returns
name of found device or an empty string otherwise
void BluezHciInterface::reset ( ) const
overridevirtual

Reset hci interface - turn down & up.

Exceptions
IOExceptionin case of a failure

Implements BeeeOn::HciInterface.

map< MACAddress, string > BluezHciInterface::scan ( ) const
overridevirtual

Full scan of bluetooth network. This can find only visible devices.

Returns
map of MAC addresses with names

Implements BeeeOn::HciInterface.

void BluezHciInterface::unwatch ( const MACAddress address)
overridevirtual

Unregister device to process advertising data.

Implements BeeeOn::HciInterface.

void BluezHciInterface::up ( ) const
overridevirtual

Try to set hci interface up. The root priviledges of the system might be required.

Exceptions
IOExceptionin case of a failure

Implements BeeeOn::HciInterface.

void BluezHciInterface::watch ( const MACAddress address,
Poco::SharedPtr< WatchCallback >  callBack 
)
overridevirtual

Register device to process advertising data. After recieving advertising data, the callBack is called.

Exceptions
IOExceptionin case of a failure

Implements BeeeOn::HciInterface.


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