Receiving data

Data Structures

struct  evas_body_markers_t
 Marker positions for one body. More...
struct  evas_body_segments_t
 Segments coordinates for one body. More...
struct  evas_body_dofs_t
 Dofs positions for one body. More...
struct  evas_unrecognized_markers_t
 Unrecognized markers positions. More...
struct  evas_msg_t
 Messages streamed by the server. More...

Typedefs

typedef struct evas_body_markers_t evas_body_markers_t
 Marker positions for one body.
typedef struct evas_body_segments_t evas_body_segments_t
 Segments coordinates for one body.
typedef struct evas_body_dofs_t evas_body_dofs_t
 Dofs positions for one body.
typedef struct
evas_unrecognized_markers_t 
evas_unrecognized_markers_t
 Unrecognized markers positions.
typedef enum evas_msgtype_t evas_msgtype_t
 Messages types from the server.
typedef struct evas_msg_t evas_msg_t
 Messages streamed by the server.

Enumerations

enum  evas_msgtype_t {
  EVAS_NONE, EVAS_MSG, EVAS_ACQUIRE, EVAS_RECORD,
  EVAS_FPS, EVAS_BODY_LIST, EVAS_BODY_MARKERS_LIST, EVAS_BODY_MARKERS,
  EVAS_UNRECOGNIZED_MARKERS, EVAS_BODY_SEGMENTS_LIST, EVAS_BODY_SEGMENTS, EVAS_BODY_DOFS_LIST,
  EVAS_BODY_DOFS, EVAS_KEEPALIVE = 0xff
}
 

Messages types from the server.

More...

Functions

void evas_sethandler (int(*handler)(const evas_msg_t *, void *), void *data)
 Register a callback function to be invoked when new data is received.
int evas_fps (float *fps)
 Get marker data frame rate.
void evas_listen ()
 Block and process received data.
const evas_msg_tevas_recv (evas_msg_t *msg, double timeout)
 Poll for some data.

Typedef Documentation

Marker positions for one body.

This is a variable-length structure that contains a list of marker positions for a specific body. The body identity can be found in the index and name fields and the markers array contains the list of marker positions, from index 0 to nmarkers-1. Each position is itself an array of X,Y and Z coordinates.

Segments coordinates for one body.

This is a variable-length structure that contains a list of segments configuration for a specific body. The body identity can be found in the index and name fields and the segments array contains the list of segments configuration, from index 0 to nsegments-1. Each position is itself a structure of X,Y,Z,Rx,Ry,Rz coordinates and L length.

Dofs positions for one body.

This is a variable-length structure that contains a list of DOFs positions for a specific body. The body identity can be found in the index and name fields and the dofs array contains the list of dofs positions, from index 0 to ndofs-1.

Unrecognized markers positions.

This is a variable-length structure that contains a list of unrecognized marker positions. The markers array contains the list of marker positions, from index 0 to nmarkers-1. Each position is itself an array of X,Y and Z coordinates.

Messages types from the server.

This is the enumeration of all possible messages types that can be received the the evart-stream server.

typedef struct evas_msg_t evas_msg_t

Messages streamed by the server.

This structure is the basis of all data streamed by the evart-server. Every function receiving data from the server will be passed such messages (see evas_sethandler(), evas_recv()).

The structure contains several fields, depending on the actual type of the message. Use only the field correspondig to the type member, as other fields will typically contain garbage.


Enumeration Type Documentation

Messages types from the server.

This is the enumeration of all possible messages types that can be received the the evart-stream server.

Enumerator:
EVAS_NONE 

No message, or invalid message.

EVAS_MSG 

Raw text message.

EVAS_ACQUIRE 

Marker tracking.

EVAS_RECORD 

Control data recording on the host.

EVAS_FPS 

Get marker data frame rate.

EVAS_BODY_LIST 

List of tracked bodies.

EVAS_BODY_MARKERS_LIST 

List of marker names for one body.

EVAS_BODY_MARKERS 

Marker positions for one body.

EVAS_UNRECOGNIZED_MARKERS 

Unrecognized marker positions.

EVAS_BODY_SEGMENTS_LIST 

List of segment names for one body.

EVAS_BODY_SEGMENTS 

Segment coordinates for one body.

EVAS_BODY_DOFS_LIST 

List of DOF names for one body.

EVAS_BODY_DOFS 

DOF values for one body.

EVAS_KEEPALIVE 

Keepalive requests.


Function Documentation

void evas_sethandler ( int(*)(const evas_msg_t *, void *)  handler,
void *  data 
)

Register a callback function to be invoked when new data is received.

Use this function in conjunction with evas_listen() to process the data from the server. The handler() callback function is called each time a new message is received, provided that the evas_listen() function is being executed. handler() is also called if an irrelevant message is received when a blocking function of the API is waiting for an answer, so this is the preferred mechanism for receiving data since no message can be lost.

The handler() function should normally return zero. If it returns some other value, evas_listen() will stop listening for data and return immediately.

Parameters:
[in] handler The callback function. If NULL, the callback mechanism is disabled.
[in] data Pointer to user data that gets passed to each invocation of handler.
int evas_fps ( float *  fps  ) 

Get marker data frame rate.

This function asks the EVaRT software for the marker data frame rate. evas_fps() will block until it gets the response from the evas-stream server. If other messages are received in the meantime and a callback has been defined (see evas_sethandler()), the callback is invoked with those messages.

Parameters:
[out] fps Frame rate value, in frames per second.
Returns:
0 on success, anything else in case of error.
void evas_listen ( void   ) 

Block and process received data.

This function blocks on message reception infinitely. It is useless to call this function if you do not have setup a callback (with evas_sethandler()) beforehand.

As soon as a message is received, the registered callback (if any) is invoked with the message. If the callbak function returns anything else than 0, the evas_listen() function returns immediately after this. Otherwise, evas_listen() waits for the next message and loops forever.

const evas_msg_t* evas_recv ( evas_msg_t msg,
double  timeout 
)

Poll for some data.

This function blocks until a message is received and returns that message. Any registered callback (with evas_sethandler()) is not called.

You can use this function if you want to make your own event processing (for instance if you have several event channels to listen for).

Parameters:
[in] msg Pointer on a user-allocated message, filled by the function.
[in] timeout Maximum time in seconds to wait for a message, or 0 to wait forever.
Returns:
A pointer to the received message, or NULL in case of error.
 All Data Structures Variables
Generated on Thu Aug 2 10:25:35 2012 for evart-client by  doxygen 1.6.3