|
Urbi SDK Remote for C++
2.7.3
|
All the send functions are expected to be asynchronous by default: they return immediately, and send the data in a separate thread. More...
Functions | |
| error_type | urbi::UAbstractClient::send (const char *format,...) |
| Send an Urbi command. | |
| error_type | urbi::UAbstractClient::send (const std::string &s) |
| A C++ string. | |
| error_type | urbi::UAbstractClient::send (const urbi::UValue &v) |
| Send the value without any prefix or terminator. | |
| error_type | urbi::UAbstractClient::send (std::istream &is) |
| Send the remainder of the stream. | |
| error_type | urbi::UAbstractClient::sendBinary (const void *data, size_t len, const std::string &header) |
| Send an urbi Binary value. | |
| error_type | urbi::UAbstractClient::sendBin (const void *, size_t len) |
| Send binary data. | |
| error_type | urbi::UAbstractClient::sendBin (const void *, size_t len, const char *header,...) |
| Send an Urbi header followed by binary data. | |
| error_type | urbi::UAbstractClient::startPack () |
| Lock the send buffer (for backward compatibility, will be removed in future versions). | |
| error_type | urbi::UAbstractClient::endPack () |
| Unlock the send buffer (for backward compatibility, will be removed in future versions). | |
| error_type | urbi::UAbstractClient::pack (const char *format,...) |
| Append Urbi commands to the send buffer (for backward compatibility, will be removed in future versions). | |
| error_type | urbi::UAbstractClient::vpack (const char *format, va_list args) |
| va_list version of pack. | |
| error_type | urbi::UAbstractClient::sendFile (const std::string &f) |
| Send urbi commands contained in a file. | |
| UCallbackID | urbi::UAbstractClient::sendCommand (UCallback, const char *,...) |
| Send a command, prefixing it with a tag, and associate the given callback with this tag. | |
| UCallbackID | urbi::UAbstractClient::sendCommand (UCustomCallback, void *, const char *,...) |
| Send a command, prefixing it with a tag, and associate the given callback with this tag. | |
| error_type | urbi::UAbstractClient::sendSound (const char *device, const urbi::USound &sound, const char *tag=0) |
| Send sound data to the robot for immediate playback. | |
| error_type | urbi::UAbstractClient::putFile (const char *localName, const char *remoteName=0) |
| Put a file on the robot's mass storage device. | |
| error_type | urbi::UAbstractClient::putFile (const void *buffer, size_t length, const char *remoteName) |
| Save a buffer to a file on the robot. | |
All the send functions are expected to be asynchronous by default: they return immediately, and send the data in a separate thread.
| UAbstractClient::error_type urbi::UAbstractClient::endPack | ( | ) |
Unlock the send buffer (for backward compatibility, will be removed in future versions).
Definition at line 237 of file uabstractclient.cc.
References urbi::UAbstractClient::effective_send(), urbi::UAbstractClient::sendBuffer, and urbi::LockableOstream::sendBufferLock.
Referenced by urbi::impl::call_result(), urbi::impl::RemoteUContextImpl::send(), urbi::UAbstractClient::send(), urbi::UAbstractClient::sendCommand(), urbi::impl::RemoteUVarImpl::transmit(), urbi::impl::RemoteUVarImpl::transmitSerialized(), and urbi::impl::RemoteUContextImpl::uobject_unarmorAndSend().
| UAbstractClient::error_type urbi::UAbstractClient::pack | ( | const char * | command, |
| ... | |||
| ) |
Append Urbi commands to the send buffer (for backward compatibility, will be removed in future versions).
Passing `0' is supported as means `""', but with no warning.
This function must only be called between a startPack() and the corresponding endPack(). Data is queued in the send buffer, and sent when endPack() is called.
Definition at line 338 of file uabstractclient.cc.
References urbi::UAbstractClient::rc, and urbi::UAbstractClient::vpack().
Referenced by urbi::USyncClient::syncGet_().
| UAbstractClient::error_type urbi::UAbstractClient::putFile | ( | const char * | localName, |
| const char * | remoteName = 0 |
||
| ) |
Put a file on the robot's mass storage device.
Definition at line 672 of file uabstractclient.cc.
References urbi::UAbstractClient::send(), urbi::LockableOstream::sendBufferLock, and urbi::UAbstractClient::sendFile().
| UAbstractClient::error_type urbi::UAbstractClient::putFile | ( | const void * | buffer, |
| size_t | length, | ||
| const char * | remoteName | ||
| ) |
Save a buffer to a file on the robot.
Definition at line 690 of file uabstractclient.cc.
References urbi::UAbstractClient::send(), urbi::UAbstractClient::sendBin(), and urbi::LockableOstream::sendBufferLock.
| UAbstractClient::error_type urbi::UAbstractClient::send | ( | const char * | format, |
| ... | |||
| ) |
Send an Urbi command.
The syntax is similar to the printf() function. Passing `0' is supported as means `""', but with no warning.
Definition at line 246 of file uabstractclient.cc.
References urbi::UAbstractClient::endPack(), urbi::UAbstractClient::rc, urbi::LockableOstream::sendBufferLock, and urbi::UAbstractClient::vpack().
Referenced by urbi::impl::call_result(), urbi::UClient::onConnect(), urbi::UAbstractClient::onConnection(), urbi::UAbstractClient::putFile(), urbi::UAbstractClient::send(), urbi::UAbstractClient::sendFile(), urbi::UClient::sendPing(), urbi::UAbstractClient::sendSound(), urbi::UAbstractClient::setVersion(), urbi::USyncClient::syncGetImage(), and urbi::USyncClient::syncGetSound().
| UAbstractClient::error_type urbi::UAbstractClient::send | ( | const std::string & | s | ) |
A C++ string.
Definition at line 264 of file uabstractclient.cc.
References urbi::UAbstractClient::send().
| UAbstractClient::error_type urbi::UAbstractClient::send | ( | const urbi::UValue & | v | ) |
Send the value without any prefix or terminator.
Definition at line 270 of file uabstractclient.cc.
References urbi::UValue::binary, urbi::BINARY_NONE, urbi::BINARY_UNKNOWN, urbi::UBinary::buildMessage(), urbi::UBinary::common, urbi::DATA_BINARY, urbi::DATA_DICTIONARY, urbi::DATA_DOUBLE, urbi::DATA_LIST, urbi::DATA_SLOTNAME, urbi::DATA_STRING, urbi::DATA_VOID, urbi::UValue::dictionary, urbi::UValue::list, urbi::UBinary::message, urbi::UAbstractClient::send(), urbi::UAbstractClient::sendBinary(), urbi::UBinary::type, and urbi::UValue::type.
| UAbstractClient::error_type urbi::UAbstractClient::send | ( | std::istream & | is | ) |
Send the remainder of the stream.
Definition at line 316 of file uabstractclient.cc.
References urbi::UAbstractClient::effective_send(), urbi::UAbstractClient::rc, urbi::UAbstractClient::sendBuffer, urbi::LockableOstream::sendBufferLock, and urbi::UAbstractClient::sendBufSize.
| UAbstractClient::error_type urbi::UAbstractClient::sendBin | ( | const void * | buffer, |
| size_t | len | ||
| ) |
Send binary data.
Definition at line 398 of file uabstractclient.cc.
Referenced by urbi::UAbstractClient::putFile(), urbi::UAbstractClient::sendBinary(), and urbi::UAbstractClient::sendSound().
| UAbstractClient::error_type urbi::UAbstractClient::sendBin | ( | const void * | buffer, |
| size_t | len, | ||
| const char * | header, | ||
| ... | |||
| ) |
Send an Urbi header followed by binary data.
Definition at line 405 of file uabstractclient.cc.
References urbi::UAbstractClient::effective_send(), urbi::UAbstractClient::rc, urbi::UAbstractClient::sendBuffer, urbi::LockableOstream::sendBufferLock, and urbi::UAbstractClient::vpack().
| UAbstractClient::error_type urbi::UAbstractClient::sendBinary | ( | const void * | data, |
| size_t | len, | ||
| const std::string & | header | ||
| ) |
Send an urbi Binary value.
Definition at line 427 of file uabstractclient.cc.
References urbi::UAbstractClient::effective_send(), urbi::UAbstractClient::kernelMajor(), urbi::UAbstractClient::rc, urbi::UAbstractClient::sendBin(), and urbi::LockableOstream::sendBufferLock.
Referenced by urbi::UAbstractClient::send(), and urbi::impl::RemoteUVarImpl::transmit().
| UCallbackID urbi::UAbstractClient::sendCommand | ( | UCallback | cb, |
| const char * | cmd, | ||
| ... | |||
| ) |
Send a command, prefixing it with a tag, and associate the given callback with this tag.
Definition at line 633 of file uabstractclient.cc.
References urbi::UAbstractClient::deleteCallback(), urbi::UAbstractClient::endPack(), urbi::UAbstractClient::fresh(), urbi::LockableOstream::sendBufferLock, urbi::UAbstractClient::setCallback(), UINVALIDCALLBACKID, and urbi::UAbstractClient::vpack().
| UCallbackID urbi::UAbstractClient::sendCommand | ( | UCustomCallback | cb, |
| void * | cbData, | ||
| const char * | cmd, | ||
| ... | |||
| ) |
Send a command, prefixing it with a tag, and associate the given callback with this tag.
Definition at line 652 of file uabstractclient.cc.
References urbi::UAbstractClient::deleteCallback(), urbi::UAbstractClient::endPack(), urbi::UAbstractClient::fresh(), urbi::LockableOstream::sendBufferLock, urbi::UAbstractClient::setCallback(), UINVALIDCALLBACKID, and urbi::UAbstractClient::vpack().
| UAbstractClient::error_type urbi::UAbstractClient::sendFile | ( | const std::string & | f | ) |
Send urbi commands contained in a file.
The file "/dev/stdin" is recognized as referring to std::cin.
Definition at line 382 of file uabstractclient.cc.
References urbi::UAbstractClient::send().
Referenced by urbi::initialize(), and urbi::UAbstractClient::putFile().
| UAbstractClient::error_type urbi::UAbstractClient::sendSound | ( | const char * | device, |
| const urbi::USound & | sound, | ||
| const char * | tag = 0 |
||
| ) |
Send sound data to the robot for immediate playback.
If tag is set, an URBI system "stop" message with this tag will be generated when the sound has been played. The sound data is copied in case of asynchronous send, and may be safely deleted as soon as this function returns.
Definition at line 520 of file uabstractclient.cc.
References urbi::USound::channels, urbi::USound::data, urbi::UAbstractClient::deleteCallback(), urbi::UAbstractClient::fresh(), urbi::USound::rate, urbi::USound::sampleFormat, urbi::USound::sampleSize, urbi::UAbstractClient::send(), urbi::UAbstractClient::sendBin(), urbi::sendSound_(), urbi::UAbstractClient::setCallback(), urbi::USound::size, urbi::SOUND_MP3, urbi::SOUND_OGG, urbi::SOUND_RAW, urbi::SOUND_WAV, urbi::USound::soundFormat, urbi::URBI_CONTINUE, and urbi::URBI_REMOVE.
| UAbstractClient::error_type urbi::UAbstractClient::startPack | ( | ) |
Lock the send buffer (for backward compatibility, will be removed in future versions).
In threaded environnments, this function lock()s the send buffer so that only the calling thread can call the send functions. Otherwise do nothing.
Definition at line 230 of file uabstractclient.cc.
References urbi::LockableOstream::sendBufferLock.
Referenced by urbi::impl::call_result(), urbi::impl::RemoteUContextImpl::send(), urbi::impl::RemoteUVarImpl::transmit(), urbi::impl::RemoteUVarImpl::transmitSerialized(), and urbi::impl::RemoteUContextImpl::uobject_unarmorAndSend().
| UAbstractClient::error_type urbi::UAbstractClient::vpack | ( | const char * | format, |
| va_list | args | ||
| ) |
va_list version of pack.
Passing `0' is supported as means `""', but with no warning.
Definition at line 351 of file uabstractclient.cc.
References urbi::UAbstractClient::rc, urbi::UAbstractClient::sendBuffer, urbi::LockableOstream::sendBufferLock, and urbi::UAbstractClient::sendBufSize.
Referenced by urbi::UAbstractClient::pack(), urbi::UAbstractClient::send(), urbi::UAbstractClient::sendBin(), urbi::UAbstractClient::sendCommand(), and urbi::USyncClient::syncGet_().