16#include <forward_list>
109 bool Connected =
false;
111 SOCKET ConnectSocket;
113 std::vector<WeArtThimbleTrackingObject*> thimbleTrackingObjects;
114 std::vector<WeArtMessageListener*> messageListeners;
115 std::vector<MessageCallback> messageCallbacks;
117 void ForwardingMessages(std::vector<WeArtMessage*> messages);
120 std::vector<std::function<void(
bool)>> connectionStatusCallbacks;
121 std::vector<std::function<void(
ErrorType)>> errorCallbacks;
122 std::forward_list<std::future<void>> pendingCallbacks;
124 void NotifyConnectionStatus(
bool connected);
126 void ClearProcessedCallbacks();
TrackingType
Definition: WeArtCommon.h:12
Definition: WeArtAnalogSensorData.h:14
Weart client, used to connect to the Weart middleware, perform operations and receive messages.
Definition: WeArtClient.h:19
void StartRawData()
Ask the middleware to send raw sensors data to the sdk.
Definition: WeArtClient.cpp:259
std::function< void(WeArtMessage *)> MessageCallback
Definition: WeArtClient.h:21
void AddMessageCallback(MessageCallback callback)
Adds a message callback called when a message is received.
Definition: WeArtClient.cpp:341
void SendMessage(WeArtMessage *message)
Sends a message to the Weart middleware.
Definition: WeArtClient.cpp:269
int SizeThimbles()
Definition: WeArtClient.cpp:333
void RemoveMessageListener(WeArtMessageListener *listener)
Removes the given listener from the client. From now on the listener will not receive messages.
Definition: WeArtClient.cpp:346
void OnReceive()
Definition: WeArtClient.cpp:135
void AddThimbleAnalogRawSensor(WeArtAnalogSensorData *analogRawSensorData)
Adds a analog raw data sensors observer to the client, allowing it to receive messages.
Definition: WeArtClient.cpp:382
ErrorType
Definition: WeArtClient.h:93
@ ConnectionError
Definition: WeArtClient.h:94
@ SendMessageError
Definition: WeArtClient.h:95
@ ReceiveMessageError
Definition: WeArtClient.h:96
void Start(TrackingType trackType=TrackingType::WEART_HAND)
Send a start command to the middleware.
Definition: WeArtClient.cpp:221
void AddConnectionStatusCallback(std::function< void(bool)> callback)
Adds a callback for the connection status (true = connected, false = disconnected)
Definition: WeArtClient.cpp:365
void AddThimbleTracking(WeArtThimbleTrackingObject *trackingObjects)
Adds a thimble tracking object to the client, allowing it to receive messages.
Definition: WeArtClient.cpp:373
WeArtMessageSerializer messageSerializer
Definition: WeArtClient.h:104
void StopRawData()
Ask the middleware to stop sending raw sensors data to the sdk.
Definition: WeArtClient.cpp:264
void Run()
Starts and runs the network connection thread.
Definition: WeArtClient.cpp:42
bool IsConnected()
Tells whether the client is connected to the Weart middleware.
Definition: WeArtClient.cpp:130
void RemoveMessageCallback(MessageCallback callback)
Remove a given callback from the client.
Definition: WeArtClient.cpp:352
void AddThimbleRawSensors(WeArtTrackingRawData *rawSensorData)
Adds a raw data sensors observer to the client, allowing it to receive messages.
Definition: WeArtClient.cpp:378
void AddErrorCallback(std::function< void(WeArtClient::ErrorType)> callback)
Adds a callback for errors (connection, send or receive errors)
Definition: WeArtClient.cpp:369
void Close()
Close the network connection.
Definition: WeArtClient.cpp:231
void Stop()
Send a stop command to the middleware.
Definition: WeArtClient.cpp:226
void AddMessageListener(WeArtMessageListener *listener)
Adds a message listener object to the client, allowing it to receive messages.
Definition: WeArtClient.cpp:337
void StopCalibration()
Stops the device calibration procedure.
Definition: WeArtClient.cpp:254
void StartCalibration()
Starts the device calibration procedure.
Definition: WeArtClient.cpp:249
Message Listener basic interface.
Definition: WeArtMessageListener.h:9
Object used to track a single thimble object and its closure value.
Definition: WeArtThimbleTrackingObject.h:12
Object used to track the raw sensors data for a single thimble.
Definition: WeArtTrackingRawData.h:13