vrpn
07.33
Virtual Reality Peripheral Network
|
#include <vrpn_FunctionGenerator.h>
Static Public Member Functions | |
static int VRPN_CALLBACK | handle_channelReply_message (void *userdata, vrpn_HANDLERPARAM p) |
static int VRPN_CALLBACK | handle_startReply_message (void *userdata, vrpn_HANDLERPARAM p) |
static int VRPN_CALLBACK | handle_stopReply_message (void *userdata, vrpn_HANDLERPARAM p) |
static int VRPN_CALLBACK | handle_sampleRateReply_message (void *userdata, vrpn_HANDLERPARAM p) |
static int VRPN_CALLBACK | handle_interpreterReply_message (void *userdata, vrpn_HANDLERPARAM p) |
static int VRPN_CALLBACK | handle_error_message (void *userdata, vrpn_HANDLERPARAM p) |
Protected Member Functions | |
vrpn_int32 | decode_channel_reply (const char *buf, const vrpn_int32 len, vrpn_uint32 &channelNum) |
vrpn_int32 | decode_start_reply (const char *buf, const vrpn_int32 len, vrpn_bool &isStarted) |
vrpn_int32 | decode_stop_reply (const char *buf, const vrpn_int32 len, vrpn_bool &isStopped) |
vrpn_int32 | decode_sampleRate_reply (const char *buf, const vrpn_int32 len) |
vrpn_int32 | decode_interpreterDescription_reply (const char *buf, const vrpn_int32 len, char **desc) |
vrpn_int32 | decode_error_reply (const char *buf, const vrpn_int32 len, FGError &error, vrpn_int32 &channel) |
vrpn_int32 | encode_channel (char **buf, vrpn_int32 &len, const vrpn_uint32 channelNum, const vrpn_FunctionGenerator_channel *channel) |
vrpn_int32 | encode_channel_request (char **buf, vrpn_int32 &len, const vrpn_uint32 channelNum) |
vrpn_int32 | encode_sampleRate_request (char **buf, vrpn_int32 &len, const vrpn_float32 sampleRate) |
![]() | |
virtual int | register_types () |
Register the types of messages this device sends/receives. Return 0 on success, -1 on fail. More... | |
![]() | |
virtual int | init (void) |
Initialize things that the constructor can't. Returns 0 on success, -1 on failure. More... | |
virtual int | register_senders (void) |
Register the sender for this device (by default, the name of the device). Return 0 on success, -1 on fail. More... | |
![]() | |
int | register_autodeleted_handler (vrpn_int32 type, vrpn_MESSAGEHANDLER handler, void *userdata, vrpn_int32 sender=vrpn_ANY_SENDER) |
Registers a handler with the connection, and remembers to delete at destruction. More... | |
int | send_text_message (const char *msg, struct timeval timestamp, vrpn_TEXT_SEVERITY type=vrpn_TEXT_NORMAL, vrpn_uint32 level=0) |
Sends a NULL-terminated text message from the device d_sender_id. More... | |
SendTextMessageBoundCall | send_text_message (vrpn_TEXT_SEVERITY type=vrpn_TEXT_NORMAL) |
Returns an object you can stream into to send a text message from the device like send_text_message(vrpn_TEXT_WARNING) << "Value of i is: " << i; This use requires including vrpn_SendTextMessageStreamProxy.h. More... | |
void | server_mainloop (void) |
Handles functions that all servers should provide in their mainloop() (ping/pong, for example) Should be called by all servers in their mainloop() More... | |
void | client_mainloop (void) |
Handles functions that all clients should provide in their mainloop() (warning of no server, for example) Should be called by all clients in their mainloop() More... | |
Additional Inherited Members | |
![]() | |
enum | FGError { NO_FG_ERROR = 0, INTERPRETER_ERROR = 1, TAKING_TOO_LONG = 2, INVALID_RESULT_QUANTITY = 3, INVALID_RESULT_RANGE = 4 } |
![]() | |
bool | shutup |
vrpn_MESSAGEHANDLER | handler |
vrpn_int32 | sender |
vrpn_int32 | type |
void * | userdata |
![]() | |
static int | encode_text_message_to_buffer (char *buf, vrpn_TEXT_SEVERITY severity, vrpn_uint32 level, const char *msg) |
Encodes the body of the text message into a buffer, preparing for sending. More... | |
static int | decode_text_message_from_buffer (char *msg, vrpn_TEXT_SEVERITY *severity, vrpn_uint32 *level, const char *buf) |
Decodes the body of the text message from a buffer from the connection. More... | |
Definition at line 347 of file vrpn_FunctionGenerator.h.
vrpn_FunctionGenerator_Remote::vrpn_FunctionGenerator_Remote | ( | const char * | name, |
vrpn_Connection * | c = NULL |
||
) |
Definition at line 871 of file vrpn_FunctionGenerator.C.
References vrpn_FunctionGenerator::channelReplyMessageID, vrpn_BaseClassUnique::d_connection, vrpn_BaseClassUnique::d_sender_id, vrpn_FunctionGenerator::errorMessageID, handle_channelReply_message(), handle_error_message(), handle_interpreterReply_message(), handle_sampleRateReply_message(), handle_startReply_message(), handle_stopReply_message(), vrpn_FunctionGenerator::interpreterReplyMessageID, vrpn_BaseClassUnique::register_autodeleted_handler(), vrpn_FunctionGenerator::sampleRateReplyMessageID, vrpn_FunctionGenerator::startFunctionReplyMessageID, and vrpn_FunctionGenerator::stopFunctionReplyMessageID.
|
inlinevirtual |
Definition at line 351 of file vrpn_FunctionGenerator.h.
|
protected |
Definition at line 1608 of file vrpn_FunctionGenerator.C.
References vrpn_FunctionGenerator::channels, vrpn_FunctionGenerator_channel::decode_from(), vrpn_FUNCTION_CHANNELS_MAX, and vrpn_unbuffer().
Referenced by handle_channelReply_message().
|
protected |
Definition at line 1986 of file vrpn_FunctionGenerator.C.
References vrpn_FunctionGenerator::NO_FG_ERROR, and vrpn_unbuffer().
Referenced by handle_error_message().
|
protected |
Definition at line 1928 of file vrpn_FunctionGenerator.C.
References vrpn_unbuffer().
Referenced by handle_interpreterReply_message().
|
protected |
Definition at line 1872 of file vrpn_FunctionGenerator.C.
References vrpn_FunctionGenerator::sampleRate, and vrpn_unbuffer().
Referenced by handle_sampleRateReply_message().
|
protected |
Definition at line 1781 of file vrpn_FunctionGenerator.C.
References vrpn_unbuffer().
Referenced by handle_startReply_message().
|
protected |
Definition at line 1827 of file vrpn_FunctionGenerator.C.
References vrpn_unbuffer().
Referenced by handle_stopReply_message().
|
protected |
Definition at line 1478 of file vrpn_FunctionGenerator.C.
References vrpn_FunctionGenerator_channel::encode_to(), vrpn_buffer(), and vrpn_FUNCTION_CHANNELS_MAX.
Referenced by setChannel().
|
protected |
Definition at line 1649 of file vrpn_FunctionGenerator.C.
References vrpn_buffer().
Referenced by requestChannel().
|
protected |
Definition at line 1707 of file vrpn_FunctionGenerator.C.
References vrpn_FunctionGenerator::sampleRate, and vrpn_buffer().
Referenced by requestSampleRate().
|
static |
Definition at line 1293 of file vrpn_FunctionGenerator.C.
References vrpn_HANDLERPARAM::buffer, vrpn_Callback_List< CALLBACK_STRUCT >::call_handlers(), channel_reply_list, vrpn_FunctionGenerator::channels, decode_channel_reply(), vrpn_HANDLERPARAM::msg_time, vrpn_HANDLERPARAM::payload_len, vrpn_BaseClassUnique::userdata, and vrpn_FUNCTION_CHANNELS_MAX.
Referenced by vrpn_FunctionGenerator_Remote().
|
static |
Definition at line 1438 of file vrpn_FunctionGenerator.C.
References vrpn_HANDLERPARAM::buffer, vrpn_Callback_List< CALLBACK_STRUCT >::call_handlers(), decode_error_reply(), error_list, vrpn_HANDLERPARAM::msg_time, vrpn_HANDLERPARAM::payload_len, and vrpn_BaseClassUnique::userdata.
Referenced by vrpn_FunctionGenerator_Remote().
|
static |
Definition at line 1412 of file vrpn_FunctionGenerator.C.
References vrpn_HANDLERPARAM::buffer, vrpn_Callback_List< CALLBACK_STRUCT >::call_handlers(), decode_interpreterDescription_reply(), interpreter_reply_list, vrpn_HANDLERPARAM::msg_time, vrpn_HANDLERPARAM::payload_len, and vrpn_BaseClassUnique::userdata.
Referenced by vrpn_FunctionGenerator_Remote().
|
static |
Definition at line 1385 of file vrpn_FunctionGenerator.C.
References vrpn_HANDLERPARAM::buffer, vrpn_Callback_List< CALLBACK_STRUCT >::call_handlers(), decode_sampleRate_reply(), vrpn_HANDLERPARAM::msg_time, vrpn_HANDLERPARAM::payload_len, sample_rate_reply_list, vrpn_FunctionGenerator::sampleRate, and vrpn_BaseClassUnique::userdata.
Referenced by vrpn_FunctionGenerator_Remote().
|
static |
Definition at line 1329 of file vrpn_FunctionGenerator.C.
References vrpn_HANDLERPARAM::buffer, vrpn_Callback_List< CALLBACK_STRUCT >::call_handlers(), decode_start_reply(), vrpn_HANDLERPARAM::msg_time, vrpn_HANDLERPARAM::payload_len, start_reply_list, and vrpn_BaseClassUnique::userdata.
Referenced by vrpn_FunctionGenerator_Remote().
|
static |
Definition at line 1357 of file vrpn_FunctionGenerator.C.
References vrpn_HANDLERPARAM::buffer, vrpn_Callback_List< CALLBACK_STRUCT >::call_handlers(), decode_stop_reply(), vrpn_HANDLERPARAM::msg_time, vrpn_HANDLERPARAM::payload_len, stop_reply_list, and vrpn_BaseClassUnique::userdata.
Referenced by vrpn_FunctionGenerator_Remote().
|
virtual |
Called once through each main loop iteration to handle updates. Remote object mainloop() should call client_mainloop() and then call d_connection->mainloop(). Server object mainloop() should service the device and then call server_mainloop(), but should not normally call d_connection->mainloop().
Implements vrpn_BaseClass.
Definition at line 1185 of file vrpn_FunctionGenerator.C.
References vrpn_BaseClassUnique::client_mainloop(), vrpn_BaseClassUnique::d_connection, and vrpn_Connection::mainloop().
|
virtual |
Definition at line 1196 of file vrpn_FunctionGenerator.C.
References channel_reply_list, vrpn_BaseClassUnique::handler, vrpn_Callback_List< CALLBACK_STRUCT >::register_handler(), and vrpn_BaseClassUnique::userdata.
|
virtual |
Definition at line 1276 of file vrpn_FunctionGenerator.C.
References error_list, vrpn_BaseClassUnique::handler, vrpn_Callback_List< CALLBACK_STRUCT >::register_handler(), and vrpn_BaseClassUnique::userdata.
|
virtual |
Definition at line 1260 of file vrpn_FunctionGenerator.C.
References vrpn_BaseClassUnique::handler, interpreter_reply_list, vrpn_Callback_List< CALLBACK_STRUCT >::register_handler(), and vrpn_BaseClassUnique::userdata.
|
virtual |
Definition at line 1244 of file vrpn_FunctionGenerator.C.
References vrpn_BaseClassUnique::handler, vrpn_Callback_List< CALLBACK_STRUCT >::register_handler(), sample_rate_reply_list, and vrpn_BaseClassUnique::userdata.
|
virtual |
Definition at line 1212 of file vrpn_FunctionGenerator.C.
References vrpn_BaseClassUnique::handler, vrpn_Callback_List< CALLBACK_STRUCT >::register_handler(), start_reply_list, and vrpn_BaseClassUnique::userdata.
|
virtual |
Definition at line 1228 of file vrpn_FunctionGenerator.C.
References vrpn_BaseClassUnique::handler, vrpn_Callback_List< CALLBACK_STRUCT >::register_handler(), stop_reply_list, and vrpn_BaseClassUnique::userdata.
int vrpn_FunctionGenerator_Remote::requestAllChannels | ( | ) |
Definition at line 1009 of file vrpn_FunctionGenerator.C.
References vrpn_BaseClassUnique::d_connection, vrpn_FunctionGenerator::msgbuf, vrpn_Connection::pack_message(), vrpn_FunctionGenerator::timestamp, vrpn_CONNECTION_RELIABLE, vrpn_CONNECTION_TCP_BUFLEN, and vrpn_gettimeofday.
int vrpn_FunctionGenerator_Remote::requestChannel | ( | const vrpn_uint32 | channelNum | ) |
Definition at line 968 of file vrpn_FunctionGenerator.C.
References vrpn_BaseClassUnique::d_connection, encode_channel_request(), vrpn_FunctionGenerator::msgbuf, vrpn_Connection::pack_message(), vrpn_FunctionGenerator::timestamp, vrpn_CONNECTION_RELIABLE, vrpn_CONNECTION_TCP_BUFLEN, and vrpn_gettimeofday.
int vrpn_FunctionGenerator_Remote::requestInterpreterDescription | ( | ) |
Definition at line 1151 of file vrpn_FunctionGenerator.C.
References vrpn_BaseClassUnique::d_connection, vrpn_FunctionGenerator::msgbuf, vrpn_Connection::pack_message(), vrpn_FunctionGenerator::timestamp, vrpn_CONNECTION_RELIABLE, vrpn_CONNECTION_TCP_BUFLEN, and vrpn_gettimeofday.
int vrpn_FunctionGenerator_Remote::requestSampleRate | ( | const vrpn_float32 | rate | ) |
Definition at line 1111 of file vrpn_FunctionGenerator.C.
References vrpn_BaseClassUnique::d_connection, encode_sampleRate_request(), vrpn_FunctionGenerator::msgbuf, vrpn_Connection::pack_message(), vrpn_FunctionGenerator::timestamp, vrpn_CONNECTION_RELIABLE, vrpn_CONNECTION_TCP_BUFLEN, and vrpn_gettimeofday.
int vrpn_FunctionGenerator_Remote::requestStart | ( | ) |
Definition at line 1043 of file vrpn_FunctionGenerator.C.
References vrpn_BaseClassUnique::d_connection, vrpn_FunctionGenerator::msgbuf, vrpn_Connection::pack_message(), vrpn_FunctionGenerator::timestamp, vrpn_CONNECTION_RELIABLE, vrpn_CONNECTION_TCP_BUFLEN, and vrpn_gettimeofday.
int vrpn_FunctionGenerator_Remote::requestStop | ( | ) |
Definition at line 1077 of file vrpn_FunctionGenerator.C.
References vrpn_BaseClassUnique::d_connection, vrpn_FunctionGenerator::msgbuf, vrpn_Connection::pack_message(), vrpn_FunctionGenerator::timestamp, vrpn_CONNECTION_RELIABLE, vrpn_CONNECTION_TCP_BUFLEN, and vrpn_gettimeofday.
int vrpn_FunctionGenerator_Remote::setChannel | ( | const vrpn_uint32 | channelNum, |
const vrpn_FunctionGenerator_channel * | channel | ||
) |
Definition at line 928 of file vrpn_FunctionGenerator.C.
References vrpn_BaseClassUnique::d_connection, encode_channel(), vrpn_FunctionGenerator::msgbuf, vrpn_Connection::pack_message(), vrpn_FunctionGenerator::timestamp, vrpn_CONNECTION_RELIABLE, vrpn_CONNECTION_TCP_BUFLEN, and vrpn_gettimeofday.
|
virtual |
Definition at line 1204 of file vrpn_FunctionGenerator.C.
References channel_reply_list, vrpn_BaseClassUnique::handler, vrpn_Callback_List< CALLBACK_STRUCT >::unregister_handler(), and vrpn_BaseClassUnique::userdata.
|
virtual |
Definition at line 1284 of file vrpn_FunctionGenerator.C.
References error_list, vrpn_BaseClassUnique::handler, vrpn_Callback_List< CALLBACK_STRUCT >::unregister_handler(), and vrpn_BaseClassUnique::userdata.
|
virtual |
Definition at line 1268 of file vrpn_FunctionGenerator.C.
References vrpn_BaseClassUnique::handler, interpreter_reply_list, vrpn_Callback_List< CALLBACK_STRUCT >::unregister_handler(), and vrpn_BaseClassUnique::userdata.
|
virtual |
Definition at line 1252 of file vrpn_FunctionGenerator.C.
References vrpn_BaseClassUnique::handler, sample_rate_reply_list, vrpn_Callback_List< CALLBACK_STRUCT >::unregister_handler(), and vrpn_BaseClassUnique::userdata.
|
virtual |
Definition at line 1220 of file vrpn_FunctionGenerator.C.
References vrpn_BaseClassUnique::handler, start_reply_list, vrpn_Callback_List< CALLBACK_STRUCT >::unregister_handler(), and vrpn_BaseClassUnique::userdata.
|
virtual |
Definition at line 1236 of file vrpn_FunctionGenerator.C.
References vrpn_BaseClassUnique::handler, stop_reply_list, vrpn_Callback_List< CALLBACK_STRUCT >::unregister_handler(), and vrpn_BaseClassUnique::userdata.
|
protected |
Definition at line 406 of file vrpn_FunctionGenerator.h.
Referenced by handle_channelReply_message(), register_channel_reply_handler(), and unregister_channel_reply_handler().
|
protected |
Definition at line 411 of file vrpn_FunctionGenerator.h.
Referenced by handle_error_message(), register_error_handler(), and unregister_error_handler().
|
protected |
Definition at line 410 of file vrpn_FunctionGenerator.h.
Referenced by handle_interpreterReply_message(), register_interpreter_reply_handler(), and unregister_interpreter_reply_handler().
|
protected |
Definition at line 409 of file vrpn_FunctionGenerator.h.
Referenced by handle_sampleRateReply_message(), register_sample_rate_reply_handler(), and unregister_sample_rate_reply_handler().
|
protected |
Definition at line 407 of file vrpn_FunctionGenerator.h.
Referenced by handle_startReply_message(), register_start_reply_handler(), and unregister_start_reply_handler().
|
protected |
Definition at line 408 of file vrpn_FunctionGenerator.h.
Referenced by handle_stopReply_message(), register_stop_reply_handler(), and unregister_stop_reply_handler().