Weart client, used to connect to the Weart middleware, perform operations and receive messages.
More...
#include <WeArtClient.h>
Weart client, used to connect to the Weart middleware, perform operations and receive messages.
WEART - Common TCP Client https://www.weart.it/
◆ MessageCallback
◆ ErrorType
Enumerator |
---|
ConnectionError | |
SendMessageError | |
ReceiveMessageError | |
◆ WeArtClient()
WeArtClient::WeArtClient |
( |
PCSTR |
ip_address, |
|
|
PCSTR |
port |
|
) |
| |
◆ AddConnectionStatusCallback()
void WeArtClient::AddConnectionStatusCallback |
( |
std::function< void(bool)> |
callback | ) |
|
Adds a callback for the connection status (true = connected, false = disconnected)
- Parameters
-
callback | The callback to be called whenever the connection status changes |
◆ AddErrorCallback()
Adds a callback for errors (connection, send or receive errors)
- Parameters
-
callback | The callback to be called whenever an error occurs |
◆ AddMessageCallback()
Adds a message callback called when a message is received.
- Parameters
-
◆ AddMessageListener()
Adds a message listener object to the client, allowing it to receive messages.
- Parameters
-
listener | The listener to add |
◆ AddThimbleAnalogRawSensor()
Adds a analog raw data sensors observer to the client, allowing it to receive messages.
- Parameters
-
analogSensorData | Raw sensors data object to add |
◆ AddThimbleRawSensors()
Adds a raw data sensors observer to the client, allowing it to receive messages.
- Parameters
-
trackingObjects | Raw sensors data object to add |
◆ AddThimbleTracking()
Adds a thimble tracking object to the client, allowing it to receive messages.
- Parameters
-
trackingObjects | Thimble tracking object to add |
◆ Close()
void WeArtClient::Close |
( |
| ) |
|
Close the network connection.
◆ IsConnected()
bool WeArtClient::IsConnected |
( |
| ) |
|
Tells whether the client is connected to the Weart middleware.
- Returns
- true if the client is connected, false otherwise
◆ OnReceive()
void WeArtClient::OnReceive |
( |
| ) |
|
|
protected |
◆ RemoveMessageCallback()
Remove a given callback from the client.
- Parameters
-
callback | Callback to remove |
◆ RemoveMessageListener()
Removes the given listener from the client. From now on the listener will not receive messages.
- Parameters
-
listener | The listener to remove from the client |
◆ Run()
void WeArtClient::Run |
( |
| ) |
|
Starts and runs the network connection thread.
◆ SendMessage()
void WeArtClient::SendMessage |
( |
WeArtMessage * |
message | ) |
|
Sends a message to the Weart middleware.
- Parameters
-
◆ SizeThimbles()
int WeArtClient::SizeThimbles |
( |
| ) |
|
- Returns
- The number of thimbles added to the connection
◆ Start()
void WeArtClient::Start |
( |
TrackingType |
trackType = TrackingType::WEART_HAND | ) |
|
Send a start command to the middleware.
- Parameters
-
trackType | Type of tracking requested |
◆ StartCalibration()
void WeArtClient::StartCalibration |
( |
| ) |
|
Starts the device calibration procedure.
◆ StartRawData()
void WeArtClient::StartRawData |
( |
| ) |
|
Ask the middleware to send raw sensors data to the sdk.
◆ Stop()
void WeArtClient::Stop |
( |
| ) |
|
Send a stop command to the middleware.
◆ StopCalibration()
void WeArtClient::StopCalibration |
( |
| ) |
|
Stops the device calibration procedure.
◆ StopRawData()
void WeArtClient::StopRawData |
( |
| ) |
|
Ask the middleware to stop sending raw sensors data to the sdk.
◆ messageSerializer
WeArtMessageSerializer WeArtClient::messageSerializer |
|
protected |
The documentation for this class was generated from the following files: