The abstract of a gForce Hub.
More...
#include <Hub.h>
The abstract of a gForce Hub.
The Hub is mantained by HubManager as a singleton instance. See HubManager for more detail about the life cycle.
◆ deinit()
De-initialize the Hub instance.
- Returns
- The result of de-initalization.
◆ enumDevices()
| virtual void gf::Hub::enumDevices |
( |
std::function< bool(SPDEVICE)> & |
funEnum, |
|
|
bool |
bConnectedOnly = true |
|
) |
| |
|
pure virtual |
Enumurate devices.
- Parameters
-
| funEnum | The enumurate function |
| bConnectedOnly | true if only want to get connected devices,
false if want to get all devices. |
◆ findDevice()
Find a gForce device.
- Returns
- The weak pointer of the device found, nullptr if not found.
◆ getDescString()
| virtual tstring gf::Hub::getDescString |
( |
| ) |
const |
|
pure virtual |
A description text of the hub.
- Returns
- A text string
◆ getNumOfDevices()
| virtual GF_SIZE gf::Hub::getNumOfDevices |
( |
bool |
bConnectedOnly = true | ) |
const |
|
pure virtual |
Get the number of all devices found.
- Parameters
-
| bConnectedOnly | true if only want to get number of connected devices,
false if want to get all devices. |
- Returns
- The Number of all devices
◆ getState()
Get hub state.
- Returns
- The current hub state
◆ getWorkMode()
| virtual WorkMode gf::Hub::getWorkMode |
( |
| ) |
const |
|
pure virtual |
Get work mode.
- Returns
- The current work mode
◆ init()
Initialize the Hub instance.
- Parameters
-
| comPort | Specify the COM port the physical Hub is connecting with. 0 means to enumuate COM ports and find one automatically. |
- Returns
- The result of initalization.
◆ registerListener()
Register HubListener.
- Parameters
-
| listener | The client listener to be registered |
- Returns
- The result of registration.
◆ run()
run message polling
- Parameters
-
| ms | The method will return after ms milliseconds. No matter messages are processed or not. |
| once | If true, method will return if one message is processed, or ms milliseconds expired. |
- Returns
- Possible return values:
- GF_RET_CODE::GF_ERROR_BAD_STATE: the method already been called in other threads, or not in proper WorkMode.
- GF_RET_CODE::GF_ERROR_TIMEOUT: ms milliseconds expired.
- GF_RET_CODE::GF_SUCCESS: return with no error.
◆ setWorkMode()
| virtual void gf::Hub::setWorkMode |
( |
WorkMode |
newMode | ) |
|
|
pure virtual |
Set work mode.
- Returns
- The current work mode
◆ startScan()
Start gForce scan.
- Parameters
-
| rssiThreshold | The threshold to filter devices.
0 - use preset default value. |
- Returns
- GF_RET_CODE type to indicate if the command sent to hub or not
◆ stopScan()
Stop gForce scan.
- Returns
- GF_RET_CODE type to indicate if the command succeeded or not
◆ unRegisterListener()
Un-register HubListener.
- Parameters
-
| listener | The client listener to be un-registered |
- Returns
- The result of un-registration.
The documentation for this class was generated from the following file: