Tango Core Classes Reference
9.3.3
|
High level class which provides the client with an easy-to-use interface to TANGO devices. More...
#include "tango.h"
Public Member Functions | |
Constructors | |
DeviceProxy (string &name, CORBA::ORB *orb=NULL) | |
Create a DeviceProxy instance. More... | |
DeviceProxy (const char *name, CORBA::ORB *orb=NULL) | |
Create a DeviceProxy instance. More... | |
Miscellaneous methods | |
virtual DeviceInfo const & | info () |
Get device info. More... | |
virtual DevState | state () |
Get device state. More... | |
virtual string | status () |
Get device status. More... | |
virtual int | ping () |
Ping a device. More... | |
virtual vector< string > * | black_box (int nb) |
Get device black box content. More... | |
virtual string | name () |
Return the device name (from the device itself) More... | |
virtual string | adm_name () |
Return the administrator device name. More... | |
virtual string | dev_name () |
Return the device name as it is stored locally. More... | |
virtual string | description () |
Returns the device description as a string. More... | |
virtual string | alias () |
Returns device alias. More... | |
virtual DbDevImportInfo | import_info () |
Query the device for import info from the database. More... | |
virtual int | get_tango_lib_version () |
Get device Tango lib version. More... | |
Synchronous command related methods | |
virtual CommandInfo | command_query (string cmd_name) |
Query the device for single command information. More... | |
virtual CommandInfoList * | command_list_query () |
Query the device for all commands information. More... | |
virtual vector< string > * | get_command_list () |
Query all commands name. More... | |
virtual CommandInfo | get_command_config (const string &cmd_name) |
Get command information for a single command. More... | |
virtual CommandInfoList * | get_command_config (vector< string > &cmd_names) |
Get information for a set of commands. More... | |
virtual vector< DeviceDataHistory > * | command_history (string &cmd_name, int depth) |
Retrieve command history from polling buffer. More... | |
virtual vector< DeviceDataHistory > * | command_history (const char *cmd_name, int depth) |
Retrieve command history from polling buffer. More... | |
Synchronous attribute related methods | |
virtual AttributeInfoEx | attribute_query (string att_name) |
Query the device for attribute information. More... | |
virtual AttributeInfoList * | attribute_list_query () |
Query the device for information on all attributes. More... | |
virtual AttributeInfoListEx * | attribute_list_query_ex () |
Query the device for information on all attributes. More... | |
virtual vector< string > * | get_attribute_list () |
Query all attributes name. More... | |
virtual AttributeInfoList * | get_attribute_config (vector< string > &att_names) |
Get attribute configuration for a list of attributes. More... | |
virtual AttributeInfoListEx * | get_attribute_config_ex (vector< string > &att_names) |
Get attribute configuration (extended) for a list of attributes. More... | |
virtual AttributeInfoEx | get_attribute_config (const string &att_name) |
Get attribute configuration (extended) for a single attribute. More... | |
virtual void | set_attribute_config (AttributeInfoList &atts) |
Set attribute configuration. More... | |
virtual void | set_attribute_config (AttributeInfoListEx &atts) |
Set extended attribute configuration. More... | |
virtual vector< DeviceAttribute > * | read_attributes (vector< string > &att_names) |
Read the list of specified attributes. More... | |
virtual DeviceAttribute | read_attribute (string &att_name) |
Read a single attribute. More... | |
virtual DeviceAttribute | read_attribute (const char *att_name) |
Read the list of specified attributes. More... | |
virtual void | write_attributes (vector< DeviceAttribute > &attr_in) |
Write the specified attributes. More... | |
virtual void | write_attribute (DeviceAttribute &attr_in) |
Write a single attribute. More... | |
virtual DeviceAttribute | write_read_attribute (DeviceAttribute &attr_in) |
Write and read a single attribute. More... | |
virtual vector< DeviceAttribute > * | write_read_attributes (vector< DeviceAttribute > &attr_in, vector< string > &r_names) |
Write and read attribute(s) More... | |
virtual vector< DeviceAttributeHistory > * | attribute_history (string &att_name, int depth) |
Retrieve attribute history from polling buffer. More... | |
virtual vector< DeviceAttributeHistory > * | attribute_history (const char *att_name, int depth) |
Retrieve attribute history from polling buffer. More... | |
Pipe related methods | |
virtual PipeInfoList * | get_pipe_config (vector< string > &pipe_names) |
Get pipe configuration for a list of pipes. More... | |
virtual PipeInfo | get_pipe_config (const string &pipe_name) |
Get pipe configuration for a single pipe. More... | |
virtual void | set_pipe_config (PipeInfoList &pipes) |
Set pipe configuration. More... | |
virtual vector< string > * | get_pipe_list () |
Query all pipes name. More... | |
virtual DevicePipe | read_pipe (const string &pipe_name) |
Read a pipe. More... | |
virtual void | write_pipe (DevicePipe &pipe_data) |
Write a pipe. More... | |
virtual DevicePipe | write_read_pipe (DevicePipe &pipe_data) |
Write then read a pipe. More... | |
Asynchronous attribute related methods | |
virtual long | read_attribute_asynch (string &att_name) |
Read a single attribute asynchronously. More... | |
virtual long | read_attribute_asynch (const char *att_name) |
Read a single attribute asynchronously. More... | |
virtual long | read_attributes_asynch (vector< string > &att_names) |
Read asynchronously alist of attributes. More... | |
virtual vector< DeviceAttribute > * | read_attributes_reply (long id) |
Check if an asynchronous read_attributes call is arrived. More... | |
virtual vector< DeviceAttribute > * | read_attributes_reply (long id, long timeout) |
Check if an asynchronous read_attributes call is arrived (with timeout) More... | |
virtual DeviceAttribute * | read_attribute_reply (long id) |
Check if an asynchronous read_attribute (single attribute) call is arrived. More... | |
virtual DeviceAttribute * | read_attribute_reply (long id, long timeout) |
Check if an asynchronous read_attribute (single attribute) call is arrived (with timeout) More... | |
virtual long | write_attribute_asynch (DeviceAttribute &argin) |
Write a single attribute asynchronously. More... | |
virtual long | write_attributes_asynch (vector< DeviceAttribute > &argin) |
Write asynchronously alist of attributes. More... | |
virtual void | write_attribute_reply (long id) |
Check if the answer of one asynchronous write_attribute (single attribute) call is arrived. More... | |
virtual void | write_attribute_reply (long id, long timeout) |
Check if the answer of one asynchronous write_attribute call (single attribute) is arrived with timeout. More... | |
virtual void | write_attributes_reply (long id) |
Check if the answer of one asynchronous write_attributes call is arrived. More... | |
virtual void | write_attributes_reply (long id, long timeout) |
Check if the answer of one asynchronous write_attributes call is arrived with timeout. More... | |
virtual void | read_attribute_asynch (const char *att_name, CallBack &cb) |
Read a single attribute asynchronously in callback model. More... | |
virtual void | read_attribute_asynch (string &att_name, CallBack &cb) |
Read a single attribute asynchronously in callback model. More... | |
virtual void | read_attributes_asynch (vector< string > &att_names, CallBack &cb) |
Read asynchronously in callback model a list of attributes. More... | |
virtual void | write_attribute_asynch (DeviceAttribute &argin, CallBack &cb) |
Write asynchronously in callback model a single attribute. More... | |
virtual void | write_attributes_asynch (vector< DeviceAttribute > &argin, CallBack &cb) |
Write asynchronously in callback model a list of attributes. More... | |
Asynchronous related methods | |
virtual long | pending_asynch_call (asyn_req_type req) |
Get pending asynchronous request number. More... | |
Polling related methods | |
virtual bool | is_command_polled (string &cmd_name) |
Check if a command is polled. More... | |
virtual bool | is_command_polled (const char *cmd_name) |
Check if a command is polled. More... | |
virtual bool | is_attribute_polled (string &att_name) |
Check if one attribute is polled. More... | |
virtual bool | is_attribute_polled (const char *att_name) |
Check if one attribute is polled. More... | |
virtual int | get_command_poll_period (string &cmd_name) |
Get command polling period. More... | |
virtual int | get_command_poll_period (const char *cmd_name) |
Get command polling period. More... | |
virtual int | get_attribute_poll_period (string &att_name) |
Get attribute polling period. More... | |
virtual int | get_attribute_poll_period (const char *att_name) |
Get attribute polling period. More... | |
virtual vector< string > * | polling_status () |
Get polling status. More... | |
virtual void | poll_command (string &cmd_name, int polling_period) |
Poll a command. More... | |
virtual void | poll_command (const char *cmd_name, int polling_period) |
Poll a command. More... | |
virtual void | poll_attribute (string &att_name, int polling_period) |
Poll an attribute. More... | |
virtual void | poll_attribute (const char *att_name, int polling_period) |
Poll an attribute. More... | |
virtual void | stop_poll_command (string &cmd_name) |
Stop polling a command. More... | |
virtual void | stop_poll_command (const char *cmd_name) |
Stop polling a command. More... | |
virtual void | stop_poll_attribute (string &att_name) |
Stop polling an attribute. More... | |
virtual void | stop_poll_attribute (const char *att_name) |
Stop polling an attribute. More... | |
Event related methods | |
virtual int | subscribe_event (const string &att_name, EventType event, CallBack *cb) |
Subscribe for event reception. More... | |
virtual int | subscribe_event (const string &att_name, EventType event, CallBack *cb, bool stateless) |
Subscribe for event reception with stateless support. More... | |
virtual int | subscribe_event (const string &att_name, EventType event, int event_queue_size, bool stateless=false) |
Subscribe for event reception with event queue. More... | |
virtual int | subscribe_event (EventType event, CallBack *cb, bool stateless=false) |
Subscribe for device event reception with stateless support. More... | |
virtual int | subscribe_event (EventType event, int event_queue_size, bool stateless=false) |
Subscribe for device event reception with stateless support and event queue. More... | |
virtual void | unsubscribe_event (int event_id) |
Unsubscribe for event reception. More... | |
virtual void | get_events (int event_id, CallBack *cb) |
Fire event callback in event pull model. More... | |
virtual void | get_events (int event_id, EventDataList &event_list) |
Get arrived events from the event queue in event pull model. More... | |
virtual void | get_events (int event_id, AttrConfEventDataList &event_list) |
Get arrived events from event queue in event pull model. More... | |
virtual void | get_events (int event_id, DataReadyEventDataList &event_list) |
Get arrived events from event queue in event pull model. More... | |
virtual void | get_events (int event_id, DevIntrChangeEventDataList &event_list) |
Get arrived events from event queue in event pull model. More... | |
virtual void | get_events (int event_id, PipeEventDataList &event_list) |
Get arrived events from event queue in event pull model. More... | |
virtual int | event_queue_size (int event_id) |
Get event number in event queue. More... | |
virtual TimeVal | get_last_event_date (int event_id) |
Get date of the last event in queue. More... | |
virtual bool | is_event_queue_empty (int event_id) |
Check if the event queue is empty. More... | |
Property related methods | |
virtual void | get_property (string &prop_name, DbData &db) |
Get a single device property. More... | |
virtual void | get_property (vector< string > &prop_names, DbData &db) |
Get a list of device properties. More... | |
virtual void | get_property (DbData &db) |
Get property(ies) for a device. More... | |
virtual void | put_property (DbData &db) |
Put property(ies) for a device. More... | |
virtual void | delete_property (string &prop_name) |
Delete a single device property. More... | |
virtual void | delete_property (vector< string > &prop_names) |
Delete a list of device properties. More... | |
virtual void | delete_property (DbData &db) |
Delete property(ies) for a device. More... | |
virtual void | get_property_list (const string &filter, vector< string > &prop_list) |
Get list of property names for a device. More... | |
Logging related methods | |
virtual void | add_logging_target (const string &target_type_name) |
Add a logging target to the device. More... | |
virtual void | add_logging_target (const char *target_type_name) |
Add a logging target to the device. More... | |
virtual void | remove_logging_target (const string &target_type_name) |
Remove a logging target from the device. More... | |
virtual void | remove_logging_target (const char *target_type_name) |
Remove a logging target from the device. More... | |
virtual vector< string > | get_logging_target (void) |
Get current device's logging targets. More... | |
virtual int | get_logging_level (void) |
Get current device's logging level. More... | |
virtual void | set_logging_level (int level) |
Set the device logging level. More... | |
Locking related methods | |
virtual void | lock (int lock_validity=DEFAULT_LOCK_VALIDITY) |
Lock a device. More... | |
virtual void | unlock (bool force=false) |
Unlock a device. More... | |
virtual string | locking_status () |
Get device locking status. More... | |
virtual bool | is_locked () |
Check if the device is locked. More... | |
virtual bool | is_locked_by_me () |
Check if the device is locked by the caller. More... | |
virtual bool | get_locker (LockerInfo &li) |
Get device locking information. More... | |
Public Member Functions inherited from Tango::Connection | |
virtual void | set_timeout_millis (int timeout) |
Set device timeout. More... | |
virtual int | get_timeout_millis () |
Get device timeout. More... | |
int | get_idl_version () |
Get device IDL version. More... | |
virtual Tango::DevSource | get_source () |
Get device source. More... | |
virtual void | set_source (Tango::DevSource sou) |
Set device source. More... | |
virtual void | set_transparency_reconnection (bool val) |
Set device transparency (reconnection) mode. More... | |
virtual bool | get_transparency_reconnection () |
Get device transparency (reconnection) mode. More... | |
virtual DeviceData | command_inout (string &cmd_name) |
Execute a command (without input data) More... | |
virtual DeviceData | command_inout (const char *cmd_name) |
Execute a command (without input data) More... | |
virtual DeviceData | command_inout (string &cmd_name, DeviceData &d_in) |
Execute a command (with input data) More... | |
virtual DeviceData | command_inout (const char *cmd_name, DeviceData &d_in) |
Execute a command (with input data) More... | |
virtual long | command_inout_asynch (const char *cmd_name, DeviceData &argin, bool forget=false) |
Execute a command asynchronously (with input argument) More... | |
virtual long | command_inout_asynch (string &cmd_name, DeviceData &argin, bool forget=false) |
Execute a command asynchronously (with input argument) More... | |
virtual long | command_inout_asynch (const char *cmd_name, bool forget=false) |
Execute a command asynchronously. More... | |
virtual long | command_inout_asynch (string &cmd_name, bool forget=false) |
Execute a command asynchronously. More... | |
virtual DeviceData | command_inout_reply (long id) |
Check an asynchronous command_inout answer is arrived. More... | |
virtual DeviceData | command_inout_reply (long id, long timeout) |
Check an asynchronous command_inout answer is arrived with timeout. More... | |
virtual void | command_inout_asynch (string &cmd_name, CallBack &cb) |
Execute a command asynchronously with callback. More... | |
virtual void | command_inout_asynch (const char *cmd_name, CallBack &cb) |
Execute a command asynchronously with callback. More... | |
virtual void | command_inout_asynch (string &cmd_name, DeviceData &argin, CallBack &cb) |
Execute a command asynchronously with input value and callback. More... | |
virtual void | command_inout_asynch (const char *cmd_name, DeviceData &argin, CallBack &cb) |
Execute a command asynchronously with input value and callback. More... | |
virtual void | get_asynch_replies () |
Fire callback methods. More... | |
virtual void | get_asynch_replies (long timeout) |
Fire callback methds with timeout. More... | |
virtual void | cancel_asynch_request (long id) |
Cancel a pending asynchronous request. More... | |
virtual void | cancel_all_polling_asynch_request () |
Cancel all pending asynchronous request. More... | |
High level class which provides the client with an easy-to-use interface to TANGO devices.
The high level object which provides the client with an easy-to-use interface to TANGO devices. DeviceProxy is a handle to the real Device (hence the name Proxy) and is not the real Device (of course). DeviceProxy provides interfaces to all TANGO devices. The DeviceProxy manages timeouts, stateless connections (new DeviceProxy() nearly always works), and reconnection if the device server is restarted.
Tango::DeviceProxy::DeviceProxy | ( | string & | name, |
CORBA::ORB * | orb = NULL |
||
) |
Create a DeviceProxy instance.
Create a DeviceProxy to a device of the specified name. The TANGO_HOST environment variable is used to determine which TANGO database to connect to. The client can specify an ORB as argument if she wants to. The constructor will connect to the TANGO database, query for the client’s network address and build a connection to the device. If the device is defined in the TANGO database but the device server is not running DeviceProxy will try to build a connection every time the client tries to access the device. If the device is not defined an exception is thrown. Example :
See appendix on device naming in Tango book for all details about Tango device naming syntax. If an alias name is defined for the device, this alias name can be used to create the DeviceProxy instance.
[in] | name | The device name |
[in] | orb | Pointer to the ORB. Default value is fine for 99 % of cases |
WrongNameSyntax,ConnectionFailed |
Tango::DeviceProxy::DeviceProxy | ( | const char * | name, |
CORBA::ORB * | orb = NULL |
||
) |
Create a DeviceProxy instance.
Create a DeviceProxy to a device of the specified name. The TANGO_HOST environment variable is used to determine which TANGO database to connect to. The client can specify an ORB as argument if she wants to. The constructor will connect to the TANGO database, query for the client’s network address and build a connection to the device. If the device is defined in the TANGO database but the device server is not running DeviceProxy will try to build a connection every time the client tries to access the device. If the device is not defined an exception is thrown. Example :
See appendix on device naming in Tango book for all details about Tango device naming syntax. If an alias name is defined for the device, this alias name can be used to create the DeviceProxy instance.
[in] | name | The device name |
[in] | orb | Pointer to the ORB. Default value is fine for 99 % of cases |
WrongNameSyntax,ConnectionFailed |
|
inlinevirtual |
Add a logging target to the device.
Adds a new logging target to the device. The target_type_name input parameter must follow the format: target_type::target_name. Supported target types are:
For a device target, the target_name part of the target_type_target_name parameter must contain the name of a log consumer device (as defined in A.8). For a file target, target_name is the full path to the file to log to. If omitted, the device’s name is used to build the file name (which is something like domain_family_member.log). Finally, the target_name part of the target_type_target_name input parameter is ignored in case of a console target and can be omitted.
[in] | target_type_name | The target type and name |
DevFailed | from device |
|
virtual |
Add a logging target to the device.
Adds a new logging target to the device. The target_type_name input parameter must follow the format: target_type::target_name. Supported target types are:
For a device target, the target_name part of the target_type_target_name parameter must contain the name of a log consumer device (as defined in A.8). For a file target, target_name is the full path to the file to log to. If omitted, the device’s name is used to build the file name (which is something like domain_family_member.log). Finally, the target_name part of the target_type_target_name input parameter is ignored in case of a console target and can be omitted.
[in] | target_type_name | The target type and name |
DevFailed | from device |
|
virtual |
Return the administrator device name.
Returns the name of the corresponding administrator device. This is useful if you need to send an administration command to the device server e.g. restart it.
ConnectionFailed,CommunicationFailed |
|
virtual |
Returns device alias.
Returns the device alias name if one is defined otherwise, throws a DevFailed exception with the reason field set to Db_AliasNotDefined.
ConnectionFailed,CommunicationFailed,DevFailed | from device |
|
inlinevirtual |
Retrieve attribute history from polling buffer.
Retrieve attribute history from the attribute polling buffer. The first argument is the attribute name. The second argument is the wanted history depth. This method returns a vector of DeviceAttributeHistory types. This method allocates memory for the vector of DeviceAttributeHistory returned to the caller. It is the caller responsibility to delete this memory. See chapter on Advanced Feature in Tango book for all details regarding polling.
[in] | att_name | Attribute name |
[in] | depth | The required history depth |
NonSupportedFeature,ConnectionFailed,CommunicationFailed,DevFailed | from device |
|
virtual |
Retrieve attribute history from polling buffer.
Retrieve attribute history from the attribute polling buffer. The first argument is the attribute name. The second argument is the wanted history depth. This method returns a vector of DeviceAttributeHistory types. This method allocates memory for the vector of DeviceAttributeHistory returned to the caller. It is the caller responsibility to delete this memory. See chapter on Advanced Feature in Tango book for all details regarding polling.
[in] | att_name | Attribute name |
[in] | depth | The required history depth |
NonSupportedFeature,ConnectionFailed,CommunicationFailed,DevFailed | from device |
|
virtual |
Query the device for information on all attributes.
Query the device for info on all attributes. This method returns a vector of AttributeInfo types. This method allocates memory for the vector of AttributeInfo structures returned to the caller. It is the caller responsibility to delete this memory.
See DeviceProxy::attribute_query for a note about compatibility between attribute properties structure
ConnectionFailed,CommunicationFailed,DevFailed | from device |
|
virtual |
Query the device for information on all attributes.
Query the device for info on all attributes. This method returns a vector of AttributeInfoEx types. This method allocates memory for the vector of AttributeInfoEx structures returned to the caller. It is the caller responsibility to delete this memory.
See DeviceProxy::attribute_query for a note about compatibility between attribute properties structure
ConnectionFailed,CommunicationFailed,DevFailed | from device |
|
inlinevirtual |
Query the device for attribute information.
Query the device for information about a single attribute. This command returns a single AttributeInfoEx type.
NOTE on compatibility between Tango V4 and Tango V5 regarding attribute properties:
Between Tango V4 and Tango V5, attribute configuration has been modified to incorporate alarm and event related parameters. This explains why it exists two structure types for attribute configuration parameters. All Tango V4 parameters are defined in a structure called AttributeInfo and a new structure called AttributeInfoEx has been defined for all Tango V5 parameters. Nevertheless, AttributeInfoEx inherits from AttributeInfo and it is always possible to call the Tango V5 DeviceProxy::attribute_query() method and to store its result in one AttributeInfo structure thus allowing compatibility for client written for Tango V4 but linked with Tango V5. It is also possible for a client written and linked with Tango V5 to call Tango V5 DeviceProxy::attribute_query() method to all kind of Tango devices. For device using Tango V4, the alarm and event related parameters will be retrieved from the database instead of from the device
[in] | att_name | The attribute name |
ConnectionFailed,CommunicationFailed,DevFailed | from device |
|
virtual |
Get device black box content.
Get the last n commands executed on the device server and return a pointer to a vector of strings containing the date, time, command, and from which client computer the command was executed. This method allocates memory for the vector of strings returned to the caller. It is the caller responsibility to delete this memory.
[in] | nb | Number of requested records. If more records than available is requested, only the available records are returned |
ConnectionFailed,CommunicationFailed,DevFailed | from device |
|
inlinevirtual |
Retrieve command history from polling buffer.
Retrieve command history from the command polling buffer. The first argument is the command name. The second argument is the wanted history depth. This method returns a vector of DeviceDataHistory types. This method allocates memory for the vector of DeviceDataHistory returned to the caller. It is the caller responsibility to delete this memory. See chapter "Advanced Feature" Tango book for all details regarding polling.
[in] | cmd_name | The command name |
[in] | depth | The required history depth |
NonSupportedFeature,ConnectionFailed,CommunicationFailed,DevFailed | from device |
|
virtual |
Retrieve command history from polling buffer.
Retrieve command history from the command polling buffer. The first argument is the command name. The second argument is the wanted history depth. This method returns a vector of DeviceDataHistory types. This method allocates memory for the vector of DeviceDataHistory returned to the caller. It is the caller responsibility to delete this memory. See chapter "Advanced Feature" Tango book for all details regarding polling.
[in] | cmd_name | The command name |
[in] | depth | The required history depth |
NonSupportedFeature,ConnectionFailed,CommunicationFailed,DevFailed | from device |
|
virtual |
Query the device for all commands information.
Query the device for info on all commands. This method returns a vector of CommandInfo types. This method allocates memory for the vector of CommandInfo returned to the caller. It is the caller responsibility to delete this memory
ConnectionFailed,CommunicationFailed,DevFailed | from device |
|
virtual |
Query the device for single command information.
Query the device for information about a single command. This command returns a single CommandInfo type.
[in] | cmd_name | The command name |
ConnectionFailed,CommunicationFailed,DevFailed | from device |
|
virtual |
Delete property(ies) for a device.
Delete property(ies) for a device. Properties to delete are specified using the DbData type. Refer to DbDevice:: get_property() and DbData sections below for details.
[in] | db | The property names |
NonDbDevice,ConnectionFailed,CommunicationFailed,DevFailed | from database device |
|
virtual |
Delete a single device property.
Delete a single property for a device. The property to delete is specified as a string.
[in] | prop_name | The property name |
NonDbDevice,ConnectionFailed,CommunicationFailed,DevFailed | from database device |
|
virtual |
Delete a list of device properties.
Delete a list of properties for a device. The properties to delete are specified as a vector of strings.
[in] | prop_names | The property names list |
NonDbDevice,ConnectionFailed,CommunicationFailed,DevFailed | from database device |
|
virtual |
Returns the device description as a string.
Returns the device description as a string.
ConnectionFailed,CommunicationFailed |
|
inlinevirtual |
Return the device name as it is stored locally.
Return the device name as it is stored locally
Implements Tango::Connection.
|
virtual |
Get event number in event queue.
Returns the number of stored events in the event reception buffer. After every call to DeviceProxy:get_events(), the event queue size is 0. During event subscription the client must have chosen the pull model for this event. event_id is the event identifier returned by the DeviceProxy::subscribe_event() method.
[in] | event_id | The event identifier |
EventSystemFailed |
|
virtual |
Get attribute configuration (extended) for a single attribute.
Return the attribute configuration for a single attribute.
See DeviceProxy::attribute_query for a note about compatibility between attribute properties structure
[in] | att_name | Attribute name |
ConnectionFailed,CommunicationFailed,DevFailed | from device |
|
virtual |
Get attribute configuration for a list of attributes.
Return the attribute configuration for the list of specified attributes. To get all the attributes pass a vector containing the string AllAttr (defined in tango_const.h). This method allocates memory for the vector of AttributeInfo returned to the caller. It is the caller responsibility to delete this memory.
See DeviceProxy::attribute_query for a note about compatibility between attribute properties structure
[in] | att_names | Attributes name list |
ConnectionFailed,CommunicationFailed,DevFailed | from device |
|
virtual |
Get attribute configuration (extended) for a list of attributes.
Return the extended attribute configuration for the list of specified attributes. To get all the attributes pass a vector containing the define AllAttr (defined in tango_const.h). This method allocates memory for the vector of AttributeInfoEx returned to the caller. It is the caller responsibility to delete this memory.
See DeviceProxy::attribute_query for a note about compatibility between attribute properties structure
[in] | att_names | Attributes name list |
ConnectionFailed,CommunicationFailed,DevFailed | from device |
|
virtual |
Query all attributes name.
Return the names of all attributes implemented for this device as a vector of strings. This method allocates memory for the vector of strings returned to the caller. It is the caller responsibility to delete this memory.
ConnectionFailed,CommunicationFailed,DevFailed | from device |
|
inlinevirtual |
Get attribute polling period.
Returns the attribute "att_name" polling period in mS. If the attribute is not polled, it returns 0.
[in] | att_name | The attribute name |
|
virtual |
Get attribute polling period.
Returns the attribute "att_name" polling period in mS. If the attribute is not polled, it returns 0.
[in] | att_name | The attribute name |
|
inlinevirtual |
Get command information for a single command.
Return the command information for a single command.
[in] | cmd_name | Command name |
ConnectionFailed,CommunicationFailed,DevFailed | from device |
|
virtual |
Get information for a set of commands.
Return command information for the list of specified commands. This method allocates memory for the vector of CommandInfo returned to the caller. It is the caller responsibility to delete this memory.
[in] | cmd_names | Command name list |
ConnectionFailed,CommunicationFailed,DevFailed | from device |
|
virtual |
Query all commands name.
Return the names of all commands implemented for this device as a vector of strings. This method allocates memory for the vector of strings returned to the caller. It is the caller responsibility to delete this memory.
ConnectionFailed,CommunicationFailed,DevFailed | from device |
|
inlinevirtual |
Get command polling period.
Returns the command "cmd_name" polling period in mS. If the command is not polled, it returns 0.
[in] | cmd_name | The command name |
|
virtual |
Get command polling period.
Returns the command "cmd_name" polling period in mS. If the command is not polled, it returns 0.
[in] | cmd_name | The command name |
|
virtual |
Get arrived events from event queue in event pull model.
The method extracts all waiting attribute configuration events from the event reception buffer. The returned event_list is a vector of AttrConfEventData pointers. The AttrConfEventData object contains the event information as for the callback methods. During event subscription the client must have chosen the pull model for this event. event_id is the event identifier returned by the DeviceProxy::subscribe_event() method.
[in] | event_id | The event identifier |
[out] | event_list | The event(s) list |
EventSystemFailed |
|
virtual |
Fire event callback in event pull model.
The method extracts all waiting events from the event reception buffer and executes the callback method cb for every event. During event subscription the client must have chosen the pull model for this event. event_id is the event identifier returned by the DeviceProxy::subscribe_event() method.
[in] | event_id | The event identifier |
[in] | cb | The callback object |
EventSystemFailed |
|
virtual |
Get arrived events from event queue in event pull model.
The method extracts all waiting attribute configuration events from the event reception buffer. The returned event_list is a vector of DataReadyEventData pointers. The DataReadyEventData object contains the event information as for the callback methods. During event subscription the client must have chosen the pull model for this event. event_id is the event identifier returned by the DeviceProxy::subscribe_event() method.
[in] | event_id | The event identifier |
[out] | event_list | The event(s) list |
EventSystemFailed |
|
virtual |
Get arrived events from event queue in event pull model.
The method extracts all waiting attribute configuration events from the event reception buffer. The returned event_list is a vector of DevIntrChangeEventData pointers. The DevIntrChangeEventData object contains the event information as for the callback methods. During event subscription the client must have chosen the pull model for this event. event_id is the event identifier returned by the DeviceProxy::subscribe_event() method.
[in] | event_id | The event identifier |
[out] | event_list | The event(s) list |
EventSystemFailed |
|
virtual |
Get arrived events from the event queue in event pull model.
The method extracts all waiting events from the event reception buffer. The returned event_list is a vector of EventData pointers. The EventData object contains the event information as for the callback methods. During event subscription the client must have chosen the pull model for this event. event_id is the event identifier returned by the DeviceProxy::subscribe_event() method.
[in] | event_id | The event identifier |
[out] | event_list | The event(s) list |
EventSystemFailed |
|
virtual |
Get arrived events from event queue in event pull model.
The method extracts all waiting pipe events from the event reception buffer. The returned event_list is a vector of PipeEventData pointers. The PipeEventData object contains the event information as for the callback methods. During event subscription the client must have chosen the pull model for this event. event_id is the event identifier returned by the DeviceProxy::subscribe_event() method.
[in] | event_id | The event identifier |
[out] | event_list | The event(s) list |
EventSystemFailed |
|
virtual |
Get date of the last event in queue.
Returns the arrival time of the last event stored in the event reception buffer. After every call to Device- Proxy:get_events(), the event reception buffer is empty. In this case an exception will be returned. During event subscription the client must have chosen the pull model for this event. event_id is the event identifier returned by the DeviceProxy::subscribe_event() method.
[in] | event_id | The event identifier |
EventSystemFailed |
|
virtual |
Get device locking information.
If the device is locked, this method returns true an set some locker process informations in the structure passed as argument. If the device is not locked, the method returns false. The LockerInfo structure definition is
[out] | li | Device locking information |
|
virtual |
Get current device's logging level.
Returns the current device’s logging level (0=OFF, 1=FATAL, 2=ERROR, 3=WARNING, 4=INFO, 5=DEBUG).
|
virtual |
Get current device's logging targets.
Returns a vector of string containing the current device’s logging targets. Each vector element has the following format: target_type::target_name. An empty vector is returned is the device has no logging targets.
|
virtual |
Get pipe configuration for a single pipe.
Return the pipe configuration for a single pipe.
[in] | pipe_name | Pipe name |
ConnectionFailed,CommunicationFailed,DevFailed | from device |
|
virtual |
Get pipe configuration for a list of pipes.
Return the pipe configuration for the list of specified pipes. To get all the pipes pass a vector containing the define AllPipe (defined in tango_const.h). This method allocates memory for the vector of PipeInfo returned to the caller. It is the caller responsibility to delete this memory.
[in] | pipe_names | Pipes name list |
ConnectionFailed,CommunicationFailed,DevFailed | from device |
|
virtual |
Query all pipes name.
Return the names of all pipes implemented for this device as a vector of strings. This method allocates memory for the vector of strings returned to the caller. It is the caller responsibility to delete this memory.
ConnectionFailed,CommunicationFailed,DevFailed | from device |
|
virtual |
Get property(ies) for a device.
Get property(ies) for a device. Properties to get are specified using the DbData type. Refer to DbDevice:: get_property() and DbData sections below for details.
[in,out] | db | The property(ies) names and values |
NonDbDevice,ConnectionFailed,CommunicationFailed,DevFailed | from database device |
|
virtual |
Get a single device property.
Get a single property for a device. The property to get is specified as a string. Refer to DbDevice::get_property() and DbData sections below for details on the DbData type.
[in] | prop_name | The property name |
[out] | db | The property value |
NonDbDevice,ConnectionFailed,CommunicationFailed,DevFailed | from database device |
|
virtual |
Get a list of device properties.
Get a list of properties for a device. The properties to get are specified as a vector of strings. Refer to DbDevice::get_property() and DbData sections below for details on the DbData type.
[in] | prop_names | The property names |
[out] | db | The properties values |
NonDbDevice,ConnectionFailed,CommunicationFailed,DevFailed | from database device |
|
virtual |
Get list of property names for a device.
Get the list of property names for the device. The parameter filter allows the user to filter the returned name list. The wildcard character is ’*’. Only one wildcard character is allowed in the filter parameter. The name list is returned in the vector of strings passed as the method second argument.
[in] | filter | The filter |
[out] | prop_list | The device property list |
NonDbDevice,ConnectionFailed,CommunicationFailed,DevFailed | from database device |
|
virtual |
Get device Tango lib version.
Get the version of the Tango library used by the device
|
virtual |
Query the device for import info from the database.
Query the device for import info from the database.
ConnectionFailed,CommunicationFailed,NonDbDevice |
|
virtual |
Get device info.
A method which returns information on the device in a DeviceInfo structure. Example :
All DeviceInfo fields are strings except server_version which is a long integer.
ConnectionFailed,CommunicationFailed,DevFailed | from device |
|
inlinevirtual |
Check if one attribute is polled.
Returns true if the attribute "att_name" is polled. Otherwise, returns false.
[in] | att_name | The attribute name |
|
virtual |
Check if one attribute is polled.
Returns true if the attribute "att_name" is polled. Otherwise, returns false.
[in] | att_name | The attribute name |
|
inlinevirtual |
Check if a command is polled.
Returns true if the command "cmd_name" is polled. Otherwise, returns false.
[in] | cmd_name | The command name |
|
virtual |
Check if a command is polled.
Returns true if the command "cmd_name" is polled. Otherwise, returns false.
[in] | cmd_name | The command name |
|
virtual |
Check if the event queue is empty.
Returns true when the event reception buffer is empty. During event subscription the client must have chosen the pull model for this event. event_id is the event identifier returned by the DeviceProxy::subscribe_event() method.
[in] | event_id | The event identifier |
EventSystemFailed |
|
virtual |
Check if the device is locked.
Returns true if the device is locked. Otherwise, returns false
|
virtual |
Check if the device is locked by the caller.
Returns true if the device is locked by the caller. Otherwise, returns false (device not locked or locked by someone else)
|
virtual |
Lock a device.
Lock a device. The lock_validity is the time (in seconds) the lock is kept valid after the previous lock call. A default value of 10 seconds is provided and should be fine in most cases. In case it is necessary to change the lock validity, it’s not possible to ask for a validity less than a minimum value set to 2 seconds. The library provided an automatic system to periodically re lock the device until an unlock call. No code is needed to start/stop this automatic re-locking system. The locking system is re-entrant. It is then allowed to call this method on a device already locked by the same process. The locking system has the following features:
A locked device is protected against the following calls when executed by another client:
[in] | lock_validity | The lock validity (in seconds) |
|
virtual |
Get device locking status.
This method returns a plain string describing the device locking status. This string can be:
|
virtual |
Return the device name (from the device itself)
Return the device name (from the device itself)
ConnectionFailed,CommunicationFailed |
|
inlinevirtual |
Get pending asynchronous request number.
Return number of device asynchronous pending requests. The input parameter is an enumeration with three values which are:
[in] | req | The asynchronous request type |
|
virtual |
Ping a device.
A method which sends a ping to the device and returns the time elapsed as microseconds. Example :
ConnectionFailed,CommunicationFailed |
|
inlinevirtual |
Poll an attribute.
Add the attribute "att_name" to the list of polled attributes. The polling period is specified by "polling_period" (in mS). If the attribute is already polled, this method will update the polling period according to "polling_period".
[in] | att_name | The attribute name |
[in] | polling_period | The polling period |
|
virtual |
Poll an attribute.
Add the attribute "att_name" to the list of polled attributes. The polling period is specified by "polling_period" (in mS). If the attribute is already polled, this method will update the polling period according to "polling_period".
[in] | att_name | The attribute name |
[in] | polling_period | The polling period |
|
inlinevirtual |
Poll a command.
Add the command "cmd_name" to the list of polled command. The polling period is specified by "polling_period" (in mS). If the command is already polled, this method will update the polling period according to "polling_period".
[in] | cmd_name | The command name |
[in] | polling_period | The polling period |
|
virtual |
Poll a command.
Add the command "cmd_name" to the list of polled command. The polling period is specified by "polling_period" (in mS). If the command is already polled, this method will update the polling period according to "polling_period".
[in] | cmd_name | The command name |
[in] | polling_period | The polling period |
|
virtual |
Get polling status.
Returns the device polling status. There is one string for each polled command/attribute. Each string is multi-line string with :
This method allocates memory for the vector of string(s) returned to the caller. It is the caller responsibility to delete this memory.
|
virtual |
Put property(ies) for a device.
Put property(ies) for a device. Properties to put are specified using the DbData type. Refer to DbDevice:: put_property() and DbData sections below for details.
[in] | db | The property(ies) names and values |
NonDbDevice,ConnectionFailed,CommunicationFailed,DevFailed | from database device |
|
inlinevirtual |
Read the list of specified attributes.
Read a single attribute. To extract the value you have to use the operator of the class DeviceAttribute which corresponds to the data type of the attribute. NOTE: There is no automatic type conversion from the attribute native type to user type e.g. if an attribute returns a short you cannot extract it as a double (this will return 0) you have to extract it as a short. See usage eample in DeviceProxy::read_attributes
[in] | att_name | Attribute name |
ConnectionFailed,CommunicationFailed |
|
virtual |
Read a single attribute.
Read a single attribute. To extract the value you have to use the operator of the class DeviceAttribute which corresponds to the data type of the attribute. NOTE: There is no automatic type conversion from the attribute native type to user type e.g. if an attribute returns a short you cannot extract it as a double (this will return 0) you have to extract it as a short. See usage eample in DeviceProxy::read_attributes
[in] | att_name | Attribute name |
ConnectionFailed,CommunicationFailed |
|
inlinevirtual |
Read a single attribute asynchronously.
Read asynchronously (polling model) a single attribute. This call returns an asynchronous call identifier which is needed to get the attribute value.
[in] | att_name | The attributes name |
ConnectionFailed |
|
inlinevirtual |
Read a single attribute asynchronously in callback model.
Read asynchronously (callback model) a single attribute. The last argument is a reference to a callback object. This callback object should be an instance of a user class inheriting from the Tango::CallBack class with the attr_read() method overloaded.
[in] | att_name | The attribute name |
[in] | cb | The call-back object |
ConnectionFailed |
|
virtual |
Read a single attribute asynchronously.
Read asynchronously (polling model) a single attribute. This call returns an asynchronous call identifier which is needed to get the attribute value.
[in] | att_name | The attributes name |
ConnectionFailed |
|
virtual |
Read a single attribute asynchronously in callback model.
Read asynchronously (callback model) a single attribute. The last argument is a reference to a callback object. This callback object should be an instance of a user class inheriting from the Tango::CallBack class with the attr_read() method overloaded.
[in] | att_name | The attribute name |
[in] | cb | The call-back object |
ConnectionFailed |
|
virtual |
Check if an asynchronous read_attribute (single attribute) call is arrived.
Check if the answer of an asynchronous read_attribute is arrived (polling model). id is the asynchronous call identifier. If the reply is arrived and if it is a valid reply, it is returned to the caller in a DeviceAttribute. If the reply is an exception, it is re-thrown by this call. An exception is also thrown in case of the reply is not yet arrived. To extract attribute value, you have to use the operator of the class DeviceAttribute which corresponds to the data type of the attribute. NOTE: There is no automatic type conversion from the attribute native type to user type e.g. if an attribute returns a short you cannot extract it as a double, you have to extract it as a short. Memory has been allocated for the DeviceAttribute object returned to the caller. This is the caller responsibility to delete this memory.
[in] | id | The call identifier |
AsynCall,AsynReplyNotArrived,CommunicationFailed,DevFailed | from device |
|
virtual |
Check if an asynchronous read_attribute (single attribute) call is arrived (with timeout)
Check if the answer of an asynchronous read_attributes is arrived (polling model). id is the asynchronous call identifier. If the reply is arrived and if it is a valid reply, it is returned to the caller in a DeviceAttribute. If the reply is an exception, it is re-thrown by this call. If the reply is not yet arrived, the call will wait (blocking the process) for the time specified in timeout. If after timeout milliseconds, the reply is still not there, an exception is thrown. If timeout is set to 0, the call waits until the reply arrived. To extract attribute value, you have to use the operator of the class DeviceAttribute which corresponds to the data type of the attribute. NOTE: There is no automatic type conversion from the attribute native type to user type e.g. if an attribute returns a short you cannot extract it as a double, you have to extract it as a short. Memory has been allocated for the DeviceAttribute object returned to the caller. This is the caller responsibility to delete this memory.
[in] | id | The call identifier |
[in] | timeout | The timeout value |
AsynCall,AsynReplyNotArrived,CommunicationFailed,DevFailed | from device |
|
virtual |
Read the list of specified attributes.
Read the list of specified attributes. To extract the value you have to use the operator of the class DeviceAttribute which corresponds to the data type of the attribute. NOTE: There is no automatic type conversion from the attribute native type to user type e.g. if an attribute returns a short you cannot extract it as a double, you have to extract it as a short. By default, if the server reports error for one of the attribute in the list, this error will be passed to the user using exception when he (she) will try to extract the data form the corresponding See sub-chapter on DeviceAttribute to learn how to change this default behaviour. DeviceAttribute object. This method allocates memory for the vector of DeviceAttribute objects returned to the caller. This is the caller responsibility to delete this memory. Example :
[in] | att_names | Attribute names |
ConnectionFailed,CommunicationFailed |
|
virtual |
Read asynchronously alist of attributes.
Read asynchronously (polling model) the list of specified attributes. This call returns an asynchronous call identifier which is needed to get attributes value.
[in] | att_names | The attributes names |
ConnectionFailed |
|
virtual |
Read asynchronously in callback model a list of attributes.
Read asynchronously (callback model) an attribute list. The last argument is a reference to a callback object. This callback object should be an instance of a user class inheriting from the Tango::CallBack class with the attr_read() method overloaded.
[in] | att_names | The attribute name list |
[in] | cb | The call-back object |
ConnectionFailed |
|
virtual |
Check if an asynchronous read_attributes call is arrived.
Check if the answer of an asynchronous read_attribute is arrived (polling model). id is the asynchronous call identifier. If the reply is arrived and if it is a valid reply, it is returned to the caller in a DeviceAttribute object. If the reply is an exception, it is re-thrown by this call. An exception is also thrown in case of the reply is not yet arrived. To extract attribute value, you have to use the operator of the class DeviceAttribute which corresponds to the data type of the attribute. NOTE: There is no automatic type conversion from the attribute native type to user type e.g. if an attribute returns a short you cannot extract it as a double, you have to extract it as a short. Memory has been allocated for the DeviceAttribute object returned to the caller. This is the caller responsibility to delete this memory.
[in] | id | The call identifier |
AsynCall,AsynReplyNotArrived,CommunicationFailed,DevFailed | from device |
|
virtual |
Check if an asynchronous read_attributes call is arrived (with timeout)
Check if the answer of an asynchronous read_attribute is arrived (polling model). id is the asynchronous call identifier. If the reply is arrived and if it is a valid reply, it is returned to the caller in a DeviceAttribute object. If the reply is an exception, it is re-thrown by this call. If the reply is not yet arrived, the call will wait (blocking the process) for the time specified in timeout. If after timeout milliseconds, the reply is still not there, an exception is thrown. If timeout is set to 0, the call waits until the reply arrived. To extract attribute value, you have to use the operator of the class DeviceAttribute which corresponds to the data type of the attribute. NOTE: There is no automatic type conversion from the attribute native type to user type e.g. if an attribute returns a short you cannot extract it as a double, you have to extract it as a short. Memory has been allocated for the DeviceAttribute object returned to the caller. This is the caller responsibility to delete this memory.
[in] | id | The call identifier |
[in] | timeout | The timeout value |
AsynCall,AsynReplyNotArrived,CommunicationFailed,DevFailed | from device |
|
virtual |
Read a pipe.
Read a pipe.
[in] | pipe_name | Pipe name |
ConnectionFailed,CommunicationFailed |
|
inlinevirtual |
Remove a logging target from the device.
Removes a logging target from the device’s target list. The target_type_name input parameter must follow the format: target_type::target_name. Supported target types are:
For a device target, the target_name part of the target_type_target_name parameter must contain the name of a log consumer device (as defined in ). For a file target, target_name is the full path to the file to remove. If omitted, the default log file is removed. Finally, the target_name part of the target_type_target_name input parameter is ignored in case of a console target and can be omitted. If target_name is set to "*", all targets of the specified target_type are removed.
[in] | target_type_name | The target type and name |
|
virtual |
Remove a logging target from the device.
Removes a logging target from the device’s target list. The target_type_name input parameter must follow the format: target_type::target_name. Supported target types are:
For a device target, the target_name part of the target_type_target_name parameter must contain the name of a log consumer device (as defined in ). For a file target, target_name is the full path to the file to remove. If omitted, the default log file is removed. Finally, the target_name part of the target_type_target_name input parameter is ignored in case of a console target and can be omitted. If target_name is set to "*", all targets of the specified target_type are removed.
[in] | target_type_name | The target type and name |
|
virtual |
Set attribute configuration.
Change the attribute configuration for the specified attributes.
See DeviceProxy::attribute_query for a note about compatibility between attribute properties structure
[in] | atts | New attributes configuration |
ConnectionFailed,CommunicationFailed,DevUnlocked,DevFailed | from device |
|
virtual |
Set extended attribute configuration.
Change the extended attribute configuration for the specified attributes.
See DeviceProxy::attribute_query for a note about compatibility between attribute properties structure
[in] | atts | New extended attributes configuration |
ConnectionFailed,CommunicationFailed,DevUnlocked,DevFailed | from device |
|
virtual |
Set the device logging level.
Changes the device’s logging level. (0=OFF, 1=FATAL, 2=ERROR, 3=WARNING, 4=INFO, 5=DEBUG).
[in] | level | The new device logging level |
|
virtual |
Set pipe configuration.
Change the pipe configuration for the specified pipes.
[in] | pipes | New pipes configuration |
ConnectionFailed,CommunicationFailed,DevUnlocked,DevFailed | from device |
|
virtual |
Get device state.
A method which returns the state of the device as a Tango::DevState type. Example :
ConnectionFailed,CommunicationFailed |
|
virtual |
Get device status.
A method which returns the status of the device as a string. Example :
ConnectionFailed,CommunicationFailed |
|
inlinevirtual |
Stop polling an attribute.
Remove attribute "att_name" from the list of polled attributes
[in] | att_name | The attribute name |
|
virtual |
Stop polling an attribute.
Remove attribute "att_name" from the list of polled attributes
[in] | att_name | The attribute name |
|
inlinevirtual |
Stop polling a command.
Remove command "cmd_name" from the list of polled command.
[in] | cmd_name | The command name |
|
virtual |
Stop polling a command.
Remove command "cmd_name" from the list of polled command.
[in] | cmd_name | The command name |
|
inlinevirtual |
Subscribe for event reception.
The client call to subscribe for event reception in the push model. The client implements a callback method which is triggered when the event is received. Filtering is done based on the event type. For example when reading the state and the reason specified is "change" the event will be fired only when the state changes. Events consist of an attribute name and the event reason. A standard set of reasons are implemented by the system, additional device specific reasons can be implemented by device servers programmers. The attribute parameter is the device attribute name which will be sent as an event e.g. “current”, event parameter is the event reason, cb is a pointer to a class inheriting from the Tango CallBack class and implementing a push_event() method. The subscribe_event() call returns an event id which has to be specified when unsubscribing from this event. Please, note that the cb parameter is a pointer. The lifetime of the pointed to object must at least be equal to the time when events are requested because only the pointer is stored into the event machinery. The same thing is true for the DeviceProxy instance on which the subscribe_event() method is called.
[in] | att_name | The attribute name |
[in] | event | The event type |
[in] | cb | The callback object |
EventSystemFailed |
|
inlinevirtual |
Subscribe for event reception with stateless support.
The client call to subscribe for event reception in the push model. The client implements a callback method which is triggered when the event is received. Filtering is done based on the event type. For example when reading the state and the reason specified is "change" the event will be fired only when the state changes. Events consist of an attribute name and the event reason. A standard set of reasons are implemented by the system, additional device specific reasons can be implemented by device servers programmers. The attribute parameter is the device attribute name which will be sent as an event e.g. “current”, event parameter is the event reason, cb is a pointer to a class inheriting from the Tango CallBack class and implementing a push_event() method. The last call parameter is named stateless. When the stateless flag is set to false, an exception will be thrown when the event subscription encounters a problem. With the stateless flag set to true, the event subscription will always succeed, even if the corresponding device server is not running. The keep alive thread will try every 10 seconds to subscribe for the specified event. At every subscription retry, a callback is executed which contains the corresponding exception. The subscribe_event() call returns an event id which has to be specified when unsubscribing from this event. Please, note that the cb parameter is a pointer. The lifetime of the pointed to object must at least be equal to the time when events are requested because only the pointer is stored into the event machinery. The same thing is true for the DeviceProxy instance on which the subscribe_event() method is called.
[in] | att_name | The attribute name |
[in] | event | The event type |
[in] | cb | The callback object |
[in] | stateless | The stateless flag |
EventSystemFailed |
|
inlinevirtual |
Subscribe for event reception with event queue.
The client call to subscribe for event reception in the pull model. Instead of a callback method the client has to specify the size of the event reception buffer. The event reception buffer is implemented as a round robin buffer. This way the client can set-up different ways to receive events.
All other parameters (att_name, event, stateless) are similar to those described in DeviceProxy::subscribe_event(const string &,EventType,CallBack *,bool)
[in] | att_name | The attribute name |
[in] | event | The event type |
[in] | event_queue_size | The event queue size |
[in] | stateless | The stateless flag |
EventSystemFailed |
|
virtual |
Subscribe for device event reception with stateless support.
The client call to subscribe for device event reception in the push model. The client implements a callback method which is triggered when the event is received. Filtering is done based on the event type. Today, only one event type is supported for device event. This event type is a device interface change event. cb is a pointer to a class inheriting from the Tango CallBack class and implementing a push_event() method. The last call parameter is named stateless. When the stateless flag is set to false, an exception will be thrown when the event subscription encounters a problem. With the stateless flag set to true, the event subscription will always succeed, even if the corresponding device server is not running. The keep alive thread will try every 10 seconds to subscribe for the specified event. At every subscription retry, a callback is executed which contains the corresponding exception. The subscribe_event() call returns an event id which has to be specified when unsubscribing from this event. Please, note that the cb parameter is a pointer. The lifetime of the pointed to object must at least be equal to the time when events are requested because only the pointer is stored into the event machinery. The same thing is true for the DeviceProxy instance on which the subscribe_event() method is called.
[in] | event | The event type |
[in] | cb | The callback object |
[in] | stateless | The stateless flag |
EventSystemFailed |
|
virtual |
Subscribe for device event reception with stateless support and event queue.
The client call to subscribe for device event reception in the pull model. Today, only one event type is supported for device event. This event type is a device interface change event. Instead of a callback method the client has to specify the size of the event reception buffer. The event reception buffer is implemented as a round robin buffer. This way the client can set-up different ways to receive events.
[in] | event | The event type |
[in] | event_queue_size | The event queue size |
[in] | stateless | The stateless flag |
EventSystemFailed |
|
virtual |
Unlock a device.
Unlock a device. If used, the method argument provides a back door on the locking system. If this argument is set to true, the device will be unlocked even if the caller is not the locker. This feature is provided for administration purpose and should be used very carefully. If this feature is used, the locker will receive a DeviceUnlocked exception during the next call which is normally protected by the locking Tango system.
[in] | force | The force unlock flag |
|
virtual |
Unsubscribe for event reception.
Unsubscribe a client from receiving the event specified by event_id. event_id is the event identifier returned by the DeviceProxy::subscribe_event() method.
[in] | event_id | The event identifier |
EventSystemFailed |
|
virtual |
Write a single attribute.
Write a single attribute. To insert the value to write you have to use the operator of the class DeviceAttribute which corresponds to the data type of the attribute. NOTE: There is no automatic type conversion from the user type to the attribute native type e.g. if an attribute expects a short you cannot insert it as a double (this will throw an exception) you have to insert it as a short. See Deviceproxy::write_attributes for a usage example.
[in] | attr_in | Attribute name and value |
ConnectionFailed,CommunicationFailed,DeviceUnlocked,DevFailed | from device |
|
virtual |
Write a single attribute asynchronously.
Write asynchronously (polling model) a single attribute. To insert the value to write you have to use the operator of the class DeviceAttribute which corresponds to the data type of the attribute. NOTE: There is no automatic type conversion from the user type to the attribute native type e.g. if an attribute expects a short you cannot insert it as a double (this will throw an exception) you have to insert it as a short. This call returns an asynchronous call identifier which is needed to get the server reply.
[in] | argin | The attribute name and value |
ConnectionFailed |
|
virtual |
Write asynchronously in callback model a single attribute.
Write asynchronously (callback model) a single attribute. The last argument is a reference to a callback object. This callback object should be an instance of a user class inheriting from the Tango::CallBack class with the attr_written() method overloaded.
[in] | argin | The attribute name and value |
[in] | cb | The call-back object |
ConnectionFailed |
|
inlinevirtual |
Check if the answer of one asynchronous write_attribute (single attribute) call is arrived.
Check if the answer of an asynchronous write_attribute is arrived (polling model). id is the asynchronous call identifier. If the reply is arrived and if it is a valid reply, the call returned. If the reply is an exception, it is re-thrown by this call. An exception is also thrown in case of the reply is not yet arrived.
[in] | id | The call identifier |
AsynCall,AsynReplyNotArrived,CommunicationFailed,DevFailed | from device |
|
inlinevirtual |
Check if the answer of one asynchronous write_attribute call (single attribute) is arrived with timeout.
Check if the answer of an asynchronous write_attribute is arrived (polling model). id is the asynchronous call identifier. If the reply is arrived and if it is a valid reply, the call returned. If the reply is an exception, it is re-thrown by this call. If the reply is not yet arrived, the call will wait (blocking the process) for the time specified in timeout. If after timeout milliseconds, the reply is still not there, an exception is thrown. If timeout is set to 0, the call waits until the reply arrived.
[in] | id | The call identifier |
[in] | timeout | The timeout value |
AsynCall,AsynReplyNotArrived,CommunicationFailed,DevFailed | from device |
|
virtual |
Write the specified attributes.
Write the specified attributes. To insert the values to write you have to use the operator of the DeviceAttribute class which corresponds to the data type of the attribute. NOTE: There is no automatic type conversion from the user type to the attribute native type e.g. if an attribute expects a short you cannot insert it as a double (this will throw an exception) you have to insert it as a short. Note that this is the only API call which could throw a NamedDevFailedList exception. See Exception to get all the details on this exception. Example :
[in] | attr_in | Attributes name and value |
ConnectionFailed,CommunicationFailed,DeviceUnlocked,DevFailed | or NamedDevFailedList from device |
|
virtual |
Write asynchronously alist of attributes.
Write asynchronously (polling model) the specified attributes. To insert the value to write you have to use the operator of the class DeviceAttribute which corresponds to the data type of the attribute. NOTE: There is no automatic type conversion from the user type to the attribute native type e.g. if an attribute expects a short you cannot insert it as a double (this will throw an exception) you have to insert it as a short. This call returns an asynchronous call identifier which is needed to get the server reply.
[in] | argin | The attributes name and value |
ConnectionFailed |
|
virtual |
Write asynchronously in callback model a list of attributes.
Write asynchronously (callback model) an attribute list. The last argument is a reference to a callback object. This callback object should be an instance of a user class inheriting from the Tango::CallBack class with the attr_written() method overloaded.
[in] | argin | The attribute names and values |
[in] | cb | The call-back object |
ConnectionFailed |
|
virtual |
Check if the answer of one asynchronous write_attributes call is arrived.
Check if the answer of an asynchronous write_attributes is arrived (polling model). id is the asynchronous call identifier. If the reply is arrived and if it is a valid reply, the call returned. If the reply is an exception, it is re-thrown by this call. An exception is also thrown in case of the reply is not yet arrived.
[in] | id | The call identifier |
AsynCall,AsynReplyNotArrived,CommunicationFailed,DevFailed | from device |
|
virtual |
Check if the answer of one asynchronous write_attributes call is arrived with timeout.
Check if the answer of an asynchronous write_attributes is arrived (polling model). id is the asynchronous call identifier. If the reply is arrived and if it is a valid reply, the call returned. If the reply is an exception, it is re-thrown by this call. If the reply is not yet arrived, the call will wait (blocking the process) for the time specified in timeout. If after timeout milliseconds, the reply is still not there, an exception is thrown. If timeout is set to 0, the call waits until the reply arrived.
[in] | id | The call identifier |
[in] | timeout | The timeout value |
AsynCall,AsynReplyNotArrived,CommunicationFailed,DevFailed | from device |
|
virtual |
Write a pipe.
Write a pipe.
[in] | pipe_data | Data to be sent to the device through the pipe |
ConnectionFailed,CommunicationFailed |
|
virtual |
Write and read a single attribute.
Write then read a single attribute in a single network call. By default (serialisation by device), the execution of this call in the server can’t be interrupted by other clients. To insert/extract the value to write/read you have to use the operator of the class DeviceAttribute which corresponds to the data type of the attribute. NOTE: There is no automatic type conversion from the user type to the attribute native type e.g. if an attribute expects a short you cannot insert it as a double (this will throw an exception) you have to insert it as a short.
[in] | attr_in | Attribute name and value (to be written) |
ConnectionFailed,CommunicationFailed,DeviceUnlocked,DevFailed | from device |
|
virtual |
Write and read attribute(s)
Write then read attribute(s) in a single network call. By default (serialisation by device), the execution of this call in the server can’t be interrupted by other clients. On the server side, attribute(s) are first written and if no exception has been thrown during the write phase, attributes will be read. To insert/extract the value to write/read you have to use the operator of the class DeviceAttribute which corresponds to the data type of the attribute. NOTE: There is no automatic type conversion from the user type to the attribute native type e.g. if an attribute expects a short you cannot insert it as a double (this will throw an exception) you have to insert it as a short.
[in] | attr_in | The attribute(s) name and value (to be written) |
[in] | r_names | Names of attribute to be read |
ConnectionFailed,CommunicationFailed,DeviceUnlocked,DevFailed | from device |
|
virtual |
Write then read a pipe.
Write then read a pipe in a single network call. By default (serialisation by device), the execution of this call in the server can’t be interrupted by other clients.
[in] | pipe_data | Data to be sent to the device through the pipe |
ConnectionFailed,CommunicationFailed |