Warning: do not use this library. It is unstable and most of the routines here have been superseded by other libraries (e.g. rosgraph). These routines will likely be deleted in future releases.
Exception |
|
Exception to represent errors decoding handshake |
Function | create |
Determine the XMLRPC URI for local servers. This handles the search logic of checking ROS environment variables, the known hostname, and local interface IP addresses to determine the best possible URI. |
Function | decode |
Decode serialized ROS handshake header into a Python dictionary |
Function | encode |
Encode ROS handshake header as a byte string. Each header field is a string key value pair. The encoded header is prefixed by a length field, as is each field key/value pair. key/value pairs a separated by a '=' equals sign. |
Function | get |
@return: ROS_IP/ROS_HOSTNAME override or None @rtype: str @raise ValueError: if ROS_IP/ROS_HOSTNAME/__ip/__hostname are invalidly specified |
Function | get |
@param address: (optional) address to compare against @type address: str @return: address TCP/IP sockets should use for binding. This is generally 0.0.0.0, but if \x07 address or ROS_IP/ROS_HOSTNAME is set to localhost it will return 127... |
Function | get |
if ROS_IP/ROS_HOSTNAME is set, use that address |
Function | get |
@return: default local IP address (e.g. eth0). May be overridden by ROS_IP/ROS_HOSTNAME/__ip/__hostname @rtype: str |
Function | get |
@return: known local addresses. Not affected by ROS_IP/ROS_HOSTNAME @rtype: [str] |
Function | is |
@param hostname: host name/address @type hostname: str @return True: if hostname maps to a local address, False otherwise. False conditions include invalid hostnames. |
Function | read |
Read in tcpros header off the socket \x07 sock using buffer \x07 b. |
Function | write |
Write ROS handshake header header to socket sock @param sock: socket to write to (must be in blocking mode) @type sock: socket.socket @param header: header field keys/values @type header: {str : str} @return: Number of bytes sent (for statistics) @rtype: int... |
Constant | ROS |
Undocumented |
Constant | ROS |
Undocumented |
Variable | python3 |
Undocumented |
Variable | SIOCGIFADDR |
Undocumented |
Variable | SIOCGIFCONF |
Undocumented |
Function | _is |
@return: true if the platform conforms to UNIX/POSIX-style APIs @rtype: bool |
Variable | _local |
Undocumented |
Variable | _use |
Undocumented |
Determine the XMLRPC URI for local servers. This handles the search logic of checking ROS environment variables, the known hostname, and local interface IP addresses to determine the best possible URI.
@param port: port that server is running on @type port: int @return: XMLRPC URI @rtype: str
Decode serialized ROS handshake header into a Python dictionary
header is a list of string key=value pairs, each prefixed by a 4-byte length field. It is preceeded by a 4-byte length field for the entire header.
@param header_str: encoded header string. May contain extra data at the end. @type header_str: str @return: key value pairs encoded in \x07 header_str @rtype: {str: str}
Encode ROS handshake header as a byte string. Each header field is a string key value pair. The encoded header is prefixed by a length field, as is each field key/value pair. key/value pairs a separated by a '=' equals sign.
FORMAT: (4-byte length + [4-byte field length + field=value ]*)
@param header: header field keys/values @type header: dict @return: header encoded as byte string @rtype: str
@return: ROS_IP/ROS_HOSTNAME override or None @rtype: str @raise ValueError: if ROS_IP/ROS_HOSTNAME/__ip/__hostname are invalidly specified
@param address: (optional) address to compare against @type address: str @return: address TCP/IP sockets should use for binding. This is generally 0.0.0.0, but if \x07 address or ROS_IP/ROS_HOSTNAME is set to localhost it will return 127.0.0.1 @rtype: str
- Determine host-name for use in host-name-based addressing (e.g. XML-RPC URIs):
- if ROS_IP/ROS_HOSTNAME is set, use that address
- if the hostname returns a non-localhost value, use that
- use whatever L{get_local_address()} returns
@return: default local IP address (e.g. eth0). May be overridden by ROS_IP/ROS_HOSTNAME/__ip/__hostname @rtype: str
@param hostname: host name/address @type hostname: str @return True: if hostname maps to a local address, False otherwise. False conditions include invalid hostnames.
Read in tcpros header off the socket \x07 sock using buffer \x07 b.
@param sock: socket must be in blocking mode @type sock: socket @param b: buffer to use @type b: StringIO for Python2, BytesIO for Python 3 @param buff_size: incoming buffer size to use @type buff_size: int @return: key value pairs encoded in handshake @rtype: {str: str} @raise ROSHandshakeException: If header format does not match expected
Write ROS handshake header header to socket sock @param sock: socket to write to (must be in blocking mode) @type sock: socket.socket @param header: header field keys/values @type header: {str : str} @return: Number of bytes sent (for statistics) @rtype: int