This class is used track device connections to the computer. It also provides instrument handlers specific to each connected device which provide control of the relevant device.
#include <AisDeviceTracker.h>
#include <AisDeviceTracker.h>
|
void | newDeviceConnected (const QString &deviceName) |
| a signal to be emitted whenever a new connection has been successfully established with a device.
|
|
void | deviceDisconnected (const QString &deviceName) |
| a signal to be emitted whenever a device has been disconnected.
|
|
void | firmwareUpdateNotification (const QString &message) |
| a signal which is emitted regularaly during a firmware update, providing information about the progress of the update.
|
|
◆ connectAllPluggedInDevices()
int AisDeviceTracker::connectAllPluggedInDevices |
( |
| ) |
|
This will automatically detect all the communication ports that have devices plugged in and establish a connection with each.
- Returns
- the number of new devices that have successfully established a connection with the computer. If a device has already been connected before calling this function, it will not be counted in the return value.
- Note
- emits newDeviceConnected() signal with the device name for each successful connection.
◆ connectToDeviceOnComPort()
AisErrorCode AisDeviceTracker::connectToDeviceOnComPort |
( |
const QString & | comPort | ) |
|
- Parameters
-
comPort | the communication port to connect through. |
- Returns
- AisErrorCode::Success if a connection was established with the device through the given communication port. If not successful, possible returned errors are:
- Note
- emits newDeviceConnected() signal with the device name if establishing the connection was successful.
-
You need to specify the communication port specific to your computer. For example, on PC, you may find your port number through the 'device manager'. An example would be "COM15".
◆ deviceDisconnected
void AisDeviceTracker::deviceDisconnected |
( |
const QString & | deviceName | ) |
|
|
signal |
◆ firmwareUpdateNotification
void AisDeviceTracker::firmwareUpdateNotification |
( |
const QString & | message | ) |
|
|
signal |
- Parameters
-
message | a string containing the progress percentage message. |
- Examples
- firmwareUpdate.cpp.
◆ getConnectedDevices()
const std::list< QString > AisDeviceTracker::getConnectedDevices |
( |
| ) |
const |
- Returns
- a list of all the connected devices.
◆ getInstrumentHandler()
const AisInstrumentHandler & AisDeviceTracker::getInstrumentHandler |
( |
const QString & | deviceName | ) |
const |
- Parameters
-
deviceName | the name of the connected device to get the instrument handler for (case sensitive). |
- Returns
- the instrument handler that controls the specified device.
- Note
- You may get a list of the connected devices using getConnectedDevices(). Also, whenever a device has been connected by calling connectToDeviceOnComPort(), a signal is emitted with the device name.
- See also
- AisInstrumentHandler
-
AisdeviceTracker::connectToDeviceOnComPort()
-
AisdeviceTracker::getConnectedDevices()
◆ Instance()
◆ newDeviceConnected
void AisDeviceTracker::newDeviceConnected |
( |
const QString & | deviceName | ) |
|
|
signal |
◆ saveLogToFile()
void AisDeviceTracker::saveLogToFile |
( |
bool | save | ) |
|
- Note
- by default it will be true.
- Parameters
-
save | When set to 'false,' it will not write logs to the file. When set to 'true,' it will begin writing device error logs to the file. |
- See also
- setLogFilePath
◆ setLogFilePath()
void AisDeviceTracker::setLogFilePath |
( |
const QString & | path | ) |
|
- Note
- by default it will be Document/Admiral Instrument/API
- Parameters
-
path | Set the path value at which you want to save the log file. |
- Note
- If you set 'false' for 'saveLogToFile,' it will not generate the log file. It is recommended to set it to 'true' or leave the permission as the default setting.
- See also
- saveLogToFile
◆ updateFirmwareOnAllAvailableDevices()
int AisDeviceTracker::updateFirmwareOnAllAvailableDevices |
( |
| ) |
|
This will automatically detect devices not currently in use and update firmware if necessary.
- Returns
- the number of devices that have successfully requested for firmware update. If a device has already been updated firmware before calling this function, it will not be counted in the return value. If any error is generated while requesting firmware update, it will not be counted in the return value.
- Note
- emits firmwareUpdateNotification() signal will provide notification regarding firmware update of all devices.
-
You can update firmware when you reset the device physically through reset button.
- See also
- updateFirmwareOnComPort
◆ updateFirmwareOnComPort()
AisErrorCode AisDeviceTracker::updateFirmwareOnComPort |
( |
const QString & | comport | ) |
const |
- Parameters
-
comport | the communication port to connect through. |
- Returns
- AisErrorCode::Success if firmware update successfully initiated through the given communication port. If not successful, possible returned errors are:
- Note
- emits firmwareUpdateNotification() signal to provide firmware update progress.
-
You need to specify the communication port specific to your computer. For example, on PC, you may find your port number through the 'device manager'. An example would be "COM15".
The documentation for this class was generated from the following file: