Network client used to send and receive message to/from the hardware middleware. This class is meant to be used internally but can also be used by developers who want to communicate with the hardware in a direct way.
More...
|
Task | Start (TrackingType trackingType=TrackingType.WEART_HAND) |
| Establishes a connection to the middleware and send the StartFromClientMessage
|
|
async Task< bool > | Stop () |
| Stops the middleware and the established connection.
|
|
void | StartCalibration () |
| Starts the calibration procedure.
|
|
void | StopCalibration () |
| Stops the calibration procedure.
|
|
void | StartRawData () |
| Asks the middleware to start sending raw data events to the sdk.
|
|
void | StopRawData () |
| Tells the middleware to stop sending raw data events.
|
|
async Task< T > | SendAndWaitForMessage< T > (IWeArtMessage message, int timeoutMs) |
| Send the given message to the middleware and waits for a given type of response within the given timeout.
|
|
async Task< T > | SendAndWaitForMessage< T > (IWeArtMessage message, Func< T, bool > predicate, int timeoutMs) |
| Send the given message to the middleware and waits for a response (with a given condition applied) within the given timeout.
|
|
async Task< T > | WaitForMessage< T > (int timeoutMs) |
| Waits for any message with the given type for the given timeout.
|
|
async Task< T > | WaitForMessage< T > (Func< T, bool > predicate, int timeoutMs) |
| Waits for any message with the given type and condition for the given timeout.
|
|
void | SendMessage (IWeArtMessage message) |
| Sends a message to the middleware.
|
|
|
bool | IsConnected [get] |
| True if a connection to the middleware has been established.
|
|
string | IpAddress [get, set] |
| The IP address of the middleware network endpoint.
|
|
int | Port [get, set] |
| The port of the middleware network endpoint.
|
|
Network client used to send and receive message to/from the hardware middleware. This class is meant to be used internally but can also be used by developers who want to communicate with the hardware in a direct way.
◆ ErrorType
Possible error types.
Enumerator |
---|
ConnectionError | |
SendMessageError | |
ReceiveMessageError | |
◆ MessageType
Possible message types.
Enumerator |
---|
MessageSent | |
MessageReceived | |
◆ SendAndWaitForMessage< T >() [1/2]
async Task< T > WeArt.Core.WeArtClient.SendAndWaitForMessage< T > |
( |
IWeArtMessage |
message, |
|
|
Func< T, bool > |
predicate, |
|
|
int |
timeoutMs |
|
) |
| |
|
inline |
Send the given message to the middleware and waits for a response (with a given condition applied) within the given timeout.
- Template Parameters
-
T | Type of the message to wait for |
- Parameters
-
message | Message to send before waiting |
predicate | The condition the received message must pass to be considered |
timeoutMs | Time to wait for the given message type |
- Returns
- The received response message
- Exceptions
-
TimeoutException | Thrown when the correct message is not received withih the given timeout |
◆ SendAndWaitForMessage< T >() [2/2]
async Task< T > WeArt.Core.WeArtClient.SendAndWaitForMessage< T > |
( |
IWeArtMessage |
message, |
|
|
int |
timeoutMs |
|
) |
| |
|
inline |
Send the given message to the middleware and waits for a given type of response within the given timeout.
- Template Parameters
-
T | Type of the message to wait for |
- Parameters
-
message | Message to send before waiting |
timeoutMs | Time to wait for the given message type |
- Returns
- The received response message
- Exceptions
-
TimeoutException | Thrown when the correct message is not received withih the given timeout |
◆ SendMessage()
void WeArt.Core.WeArtClient.SendMessage |
( |
IWeArtMessage |
message | ) |
|
|
inline |
Sends a message to the middleware.
- Parameters
-
◆ Start()
Establishes a connection to the middleware and send the StartFromClientMessage
- Returns
- The task running during the entire life of the network connection
◆ StartCalibration()
void WeArt.Core.WeArtClient.StartCalibration |
( |
| ) |
|
|
inline |
Starts the calibration procedure.
◆ StartRawData()
void WeArt.Core.WeArtClient.StartRawData |
( |
| ) |
|
|
inline |
Asks the middleware to start sending raw data events to the sdk.
◆ Stop()
async Task< bool > WeArt.Core.WeArtClient.Stop |
( |
| ) |
|
|
inline |
Stops the middleware and the established connection.
- Returns
- True if the middleware was stopped correctly and the connection closed, false otherwise
◆ StopCalibration()
void WeArt.Core.WeArtClient.StopCalibration |
( |
| ) |
|
|
inline |
Stops the calibration procedure.
◆ StopRawData()
void WeArt.Core.WeArtClient.StopRawData |
( |
| ) |
|
|
inline |
Tells the middleware to stop sending raw data events.
◆ WaitForMessage< T >() [1/2]
async Task< T > WeArt.Core.WeArtClient.WaitForMessage< T > |
( |
Func< T, bool > |
predicate, |
|
|
int |
timeoutMs |
|
) |
| |
|
inline |
Waits for any message with the given type and condition for the given timeout.
- Template Parameters
-
T | Type of the message to wait |
- Parameters
-
predicate | Condition that the message must fullfill to be considered ok |
timeoutMs | Timeout to wait for the correct message |
- Returns
- The received message
- Exceptions
-
TimeoutException | Thrown when the correct message is not received withih the given timeout |
◆ WaitForMessage< T >() [2/2]
async Task< T > WeArt.Core.WeArtClient.WaitForMessage< T > |
( |
int |
timeoutMs | ) |
|
|
inline |
Waits for any message with the given type for the given timeout.
- Template Parameters
-
T | Type of the message to wait |
- Parameters
-
timeoutMs | Timeout to wait for the correct message |
- Returns
- The received message
- Exceptions
-
TimeoutException | Thrown when the correct message is not received withih the given timeout |
◆ IpAddress
string WeArt.Core.WeArtClient.IpAddress |
|
getset |
The IP address of the middleware network endpoint.
◆ IsConnected
bool WeArt.Core.WeArtClient.IsConnected |
|
get |
True if a connection to the middleware has been established.
◆ Port
int WeArt.Core.WeArtClient.Port |
|
getset |
The port of the middleware network endpoint.
◆ OnCalibrationFinish
Action<HandSide> WeArt.Core.WeArtClient.OnCalibrationFinish |
Called when the calibration procedure ends.
◆ OnCalibrationResultFail
Action<HandSide> WeArt.Core.WeArtClient.OnCalibrationResultFail |
Called when the calibration procedure faild.
◆ OnCalibrationResultSuccess
Action<HandSide> WeArt.Core.WeArtClient.OnCalibrationResultSuccess |
Called when the calibration procedure is successful.
◆ OnCalibrationStart
Action<HandSide> WeArt.Core.WeArtClient.OnCalibrationStart |
Called when the calibration procedure starts.
◆ OnConnectionStatusChanged
Action<bool> WeArt.Core.WeArtClient.OnConnectionStatusChanged |
Called when the connection has been established (true) and when it is closed (false)
◆ OnError
Action<ErrorType, Exception> WeArt.Core.WeArtClient.OnError |
Called when an error occurs.
◆ OnMessage
Action<MessageType, IWeArtMessage> WeArt.Core.WeArtClient.OnMessage |
Called when a IWeArtMessage is sent or received.
◆ OnMiddlewareStatusUpdate
Called when a status update is received from the middleware.
◆ OnTextMessage
Action<MessageType, string> WeArt.Core.WeArtClient.OnTextMessage |
Called when a IWeArtMessage is serialized or deserialized.
The documentation for this class was generated from the following file: