Urbi SDK Remote for C++  2.7.5
urbiscript code.

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.

Detailed Description

All the send functions are expected to be asynchronous by default: they return immediately, and send the data in a separate thread.


Function Documentation

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 685 of file uabstractclient.cc.

References urbi::UAbstractClient::send(), urbi::UAbstractClient::sendBin(), and urbi::LockableOstream::sendBufferLock.

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 ( std::istream &  is)
UAbstractClient::error_type urbi::UAbstractClient::sendBin ( const void *  buffer,
size_t  len 
)
UAbstractClient::error_type urbi::UAbstractClient::sendBin ( const void *  buffer,
size_t  len,
const char *  header,
  ... 
)
UAbstractClient::error_type urbi::UAbstractClient::sendBinary ( const void *  data,
size_t  len,
const std::string &  header 
)
UCallbackID urbi::UAbstractClient::sendCommand ( UCallback  cb,
const char *  cmd,
  ... 
)
UCallbackID urbi::UAbstractClient::sendCommand ( UCustomCallback  cb,
void *  cbData,
const char *  cmd,
  ... 
)
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 
)