CyberAtom C++ Library

2.5.0

Public Member Functions | Static Public Member Functions | List of all members
cyberatom::UsbConnection Class Reference

Provides connection to the device via computer's USB port. More...

#include <cyberatom.hpp>

Inheritance diagram for cyberatom::UsbConnection:
cyberatom::IConnection

Public Member Functions

 UsbConnection ()
 
 UsbConnection (const char *serialNumber)
 Connects to USB device that has specific serial number. More...
 
virtual void sendMessage (uint8_t code, const uint8_t *payload, size_t len) override
 
virtual void checkForMessages (IDevice &receiver) override
 

Static Public Member Functions

static std::vector< std::string > enumerateDevices ()
 

Detailed Description

Provides connection to the device via computer's USB port.

Construction of this class automatically opens connection to CyberAtom USB device. The connection is closed when the object is deleted (released).

Constructor & Destructor Documentation

cyberatom::UsbConnection::UsbConnection ( )
Note
This constructor creates connection to first CyberAtom device found on USB device list.
Exceptions
DeviceNotFoundException
CannotOpenDeviceException
cyberatom::UsbConnection::UsbConnection ( const char *  serialNumber)

Connects to USB device that has specific serial number.

Parameters
serialNumberA serial number of the USB device to connect to.
Note
This constructor can be used more than one USB devices are in use at the same time.
Exceptions
DeviceNotFoundException
CannotOpenDeviceException

Member Function Documentation

virtual void cyberatom::UsbConnection::sendMessage ( uint8_t  code,
const uint8_t *  payload,
size_t  len 
)
overridevirtual
Parameters
code
payload
len

Implements cyberatom::IConnection.


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