gForceSDK
gf::Device Class Referenceabstract

The abstract class of a gForce device. More...

#include <Device.h>

Public Member Functions

virtual GF_UINT8 getAddrType () const =0
 Gets the device address type. More...
 
virtual tstring getAddress () const =0
 Gets the string type of device address. More...
 
virtual tstring getName () const =0
 Gets the device name. More...
 
virtual GF_UINT getRssi () const =0
 Gets the device RSSI value. More...
 
virtual GF_RET_CODE identify (int msec=1000)=0
 Identifies a physical device using vibration or light, if the device supports. More...
 
virtual DeviceConnectionStatus getConnectionStatus () const =0
 Retrieves the connection status of the device. More...
 
virtual GF_RET_CODE setAlias (tstring alias)=0
 Sets an alias to the devie for identification. More...
 
virtual tstring getAlias () const =0
 Get the alias of the device set before. More...
 
virtual GF_RET_CODE connect (bool directConn=true)=0
 Connects to the device. More...
 
virtual GF_RET_CODE disconnect ()=0
 Disconnects from the device. More...
 
virtual GF_RET_CODE cancelConnect ()=0
 Cancels connecting to the device. More...
 
virtual gfsPtr< DeviceSettinggetDeviceSetting ()=0
 Get DeviceSetting of a device. More...
 

Protected Member Functions

virtual ~Device ()
 Virtual deconstructor.
 

Detailed Description

The abstract class of a gForce device.

Remarks
All Device objects are created and maintained by the Hub instance

Member Function Documentation

◆ cancelConnect()

virtual GF_RET_CODE gf::Device::cancelConnect ( )
pure virtual

Cancels connecting to the device.

Returns
GF_RET_CODE type to indicate if the command has been sent to device or not.
Remarks
The return value is not represent the connection state. The method may not work during Hub scanning.
See also
Device::connect() Device::disconnect() HubListener::onDeviceConnected() HubListener::onDeviceDisconnected()

◆ connect()

virtual GF_RET_CODE gf::Device::connect ( bool  directConn = true)
pure virtual

Connects to the device.

Parameters
directConn- bool
Returns
GF_RET_CODE type to indicate if the command has been sent to device or not.
Remarks
The return value is not represent the connection state. The method may not work during Hub scanning.
See also
Device::disconnect() Device::cancelConnect() HubListener::onDeviceConnected() HubListener::onDeviceDisconnected()

◆ disconnect()

virtual GF_RET_CODE gf::Device::disconnect ( )
pure virtual

Disconnects from the device.

Returns
GF_RET_CODE type to indicate if the command has been sent to device or not.
Remarks
The return value is not represent the connection state. The method may not work during Hub scanning.
See also
Device::connect() Device::cancelConnect() HubListener::onDeviceConnected() HubListener::onDeviceDisconnected()

◆ getAddress()

virtual tstring gf::Device::getAddress ( ) const
pure virtual

Gets the string type of device address.

Returns
The human-readable tstring type of device address, e.g. DD:DD:DD:DD:DD:DD

◆ getAddrType()

virtual GF_UINT8 gf::Device::getAddrType ( ) const
pure virtual

Gets the device address type.

Returns
The device address type is defined in BLE.

◆ getAlias()

virtual tstring gf::Device::getAlias ( ) const
pure virtual

Get the alias of the device set before.

See also
Device::setAlias()

◆ getConnectionStatus()

virtual DeviceConnectionStatus gf::Device::getConnectionStatus ( ) const
pure virtual

Retrieves the connection status of the device.

Returns
DeviceConnectionStatus type of device status.

◆ getDeviceSetting()

virtual gfsPtr<DeviceSetting> gf::Device::getDeviceSetting ( )
pure virtual

Get DeviceSetting of a device.

Returns
The device setting handler of this device
Remarks
A device based on simple BLE protocol has no config options, So the method will return an empty object in a simple BLE case.

◆ getName()

virtual tstring gf::Device::getName ( ) const
pure virtual

Gets the device name.

Returns
The tstring type of device name

◆ getRssi()

virtual GF_UINT gf::Device::getRssi ( ) const
pure virtual

Gets the device RSSI value.

Returns
The tstring type of device name
Remarks
Currently the return value is the RSSI while device is found during scan

◆ identify()

virtual GF_RET_CODE gf::Device::identify ( int  msec = 1000)
pure virtual

Identifies a physical device using vibration or light, if the device supports.

Returns
A GF_RET_CODE type of return value to indicate if the identify command is sent or not.

◆ setAlias()

virtual GF_RET_CODE gf::Device::setAlias ( tstring  alias)
pure virtual

Sets an alias to the devie for identification.

See also
Device::getAlias()

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