Tango Core Classes Reference  9.3.3
Tango::DeviceProxy Class Reference

High level class which provides the client with an easy-to-use interface to TANGO devices. More...

#include "tango.h"

Inheritance diagram for Tango::DeviceProxy:
Collaboration diagram for Tango::DeviceProxy:

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 CommandInfoListcommand_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 CommandInfoListget_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 AttributeInfoListExattribute_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 AttributeInfoListExget_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 DeviceAttributeread_attribute_reply (long id)
 Check if an asynchronous read_attribute (single attribute) call is arrived. More...
 
virtual DeviceAttributeread_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...
 

Detailed Description

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.

Author
taurel
Revision
1

Constructor & Destructor Documentation

◆ DeviceProxy() [1/2]

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 :

DeviceProxy *my_device = new DeviceProxy(“my/own/device”);

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.

Parameters
[in]nameThe device name
[in]orbPointer to the ORB. Default value is fine for 99 % of cases
Exceptions
WrongNameSyntax,ConnectionFailed

◆ DeviceProxy() [2/2]

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 :

DeviceProxy *my_device = new DeviceProxy(“my/own/device”);

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.

Parameters
[in]nameThe device name
[in]orbPointer to the ORB. Default value is fine for 99 % of cases
Exceptions
WrongNameSyntax,ConnectionFailed

Member Function Documentation

◆ add_logging_target() [1/2]

virtual void Tango::DeviceProxy::add_logging_target ( const char *  target_type_name)
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:

  • console
  • file
  • device

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.

Parameters
[in]target_type_nameThe target type and name
Exceptions
DevFailedfrom device

◆ add_logging_target() [2/2]

virtual void Tango::DeviceProxy::add_logging_target ( const string &  target_type_name)
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:

  • console
  • file
  • device

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.

Parameters
[in]target_type_nameThe target type and name
Exceptions
DevFailedfrom device

◆ adm_name()

virtual string Tango::DeviceProxy::adm_name ( )
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.

Returns
The administrator device name
Exceptions
ConnectionFailed,CommunicationFailed

◆ alias()

virtual string Tango::DeviceProxy::alias ( )
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.

Returns
The device alias
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ attribute_history() [1/2]

virtual vector<DeviceAttributeHistory>* Tango::DeviceProxy::attribute_history ( const char *  att_name,
int  depth 
)
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.

DeviceProxy dev = new DeviceProxy("...");
vector<DeviceAttributeHistory> *hist;
hist = dev->attribute_history("Current",5);
for (int i = 0;i < 5;i++)
{
bool fail = (*hist)[i].has_failed();
if (fail == false)
{
cout << "Attribute name = " << (*hist)[i].get_name() << endl;
cout << "Attribute quality factor = " << (*hist)[i].get_quality() << endl;
long value;
(*hist)[i] >> value;
cout << "Current = " << value << endl;
}
else
{
cout << "Attribute failed !" << endl;
cout << "Error level 0 desc = " << ((*hist)[i].get_err_stack())[0].desc << endl;
}
cout << "Date = " << (*hist)[i].get_date().tv_sec << endl;
}
delete hist;
Parameters
[in]att_nameAttribute name
[in]depthThe required history depth
Returns
The read attribute history data
Exceptions
NonSupportedFeature,ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ attribute_history() [2/2]

virtual vector<DeviceAttributeHistory>* Tango::DeviceProxy::attribute_history ( string &  att_name,
int  depth 
)
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.

DeviceProxy dev = new DeviceProxy("...");
vector<DeviceAttributeHistory> *hist;
hist = dev->attribute_history("Current",5);
for (int i = 0;i < 5;i++)
{
bool fail = (*hist)[i].has_failed();
if (fail == false)
{
cout << "Attribute name = " << (*hist)[i].get_name() << endl;
cout << "Attribute quality factor = " << (*hist)[i].get_quality() << endl;
long value;
(*hist)[i] >> value;
cout << "Current = " << value << endl;
}
else
{
cout << "Attribute failed !" << endl;
cout << "Error level 0 desc = " << ((*hist)[i].get_err_stack())[0].desc << endl;
}
cout << "Date = " << (*hist)[i].get_date().tv_sec << endl;
}
delete hist;
Parameters
[in]att_nameAttribute name
[in]depthThe required history depth
Returns
The read attribute history data
Exceptions
NonSupportedFeature,ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ attribute_list_query()

virtual AttributeInfoList* Tango::DeviceProxy::attribute_list_query ( )
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

Returns
A vector of AttributeInfo structures with one element per attribute
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ attribute_list_query_ex()

virtual AttributeInfoListEx* Tango::DeviceProxy::attribute_list_query_ex ( )
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

Returns
A vector of AttributeInfoEx structures with one element per attribute
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ attribute_query()

virtual AttributeInfoEx Tango::DeviceProxy::attribute_query ( string  att_name)
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

Parameters
[in]att_nameThe attribute name
Returns
The attribute information structure
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ black_box()

virtual vector<string>* Tango::DeviceProxy::black_box ( int  nb)
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.

Parameters
[in]nbNumber of requested records. If more records than available is requested, only the available records are returned
Returns
Black box content
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ command_history() [1/2]

virtual vector<DeviceDataHistory>* Tango::DeviceProxy::command_history ( const char *  cmd_name,
int  depth 
)
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.

DeviceProxy dev = new DeviceProxy("...");
vector<DeviceDataHistory> *hist;
hist = dev->command_history("Status",5);
for (int i = 0;i < 5;i++)
{
bool fail = (*hist)[i].has_failed();
if (fail == false)
{
string str;
(*hist)[i] >> str;
cout << "Status = " << str << endl;
}
else
{
cout << "Command failed !" << endl;
cout << "Error level 0 desc = " << ((*hist)[i].errors())[0].desc << endl;
}
cout << "Date = " << (*hist)[i].date().tv_sec << endl;
}
delete hist;
Parameters
[in]cmd_nameThe command name
[in]depthThe required history depth
Returns
The command information list: One CommandInfo structure per command
Exceptions
NonSupportedFeature,ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ command_history() [2/2]

virtual vector<DeviceDataHistory>* Tango::DeviceProxy::command_history ( string &  cmd_name,
int  depth 
)
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.

DeviceProxy dev = new DeviceProxy("...");
vector<DeviceDataHistory> *hist;
hist = dev->command_history("Status",5);
for (int i = 0;i < 5;i++)
{
bool fail = (*hist)[i].has_failed();
if (fail == false)
{
string str;
(*hist)[i] >> str;
cout << "Status = " << str << endl;
}
else
{
cout << "Command failed !" << endl;
cout << "Error level 0 desc = " << ((*hist)[i].errors())[0].desc << endl;
}
cout << "Date = " << (*hist)[i].date().tv_sec << endl;
}
delete hist;
Parameters
[in]cmd_nameThe command name
[in]depthThe required history depth
Returns
The command information list: One CommandInfo structure per command
Exceptions
NonSupportedFeature,ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ command_list_query()

virtual CommandInfoList* Tango::DeviceProxy::command_list_query ( )
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

Returns
The command information list: One CommandInfo structure per command
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ command_query()

virtual CommandInfo Tango::DeviceProxy::command_query ( string  cmd_name)
virtual

Query the device for single command information.

Query the device for information about a single command. This command returns a single CommandInfo type.

Parameters
[in]cmd_nameThe command name
Returns
The command information structure
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ delete_property() [1/3]

virtual void Tango::DeviceProxy::delete_property ( DbData &  db)
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.

Parameters
[in]dbThe property names
Exceptions
NonDbDevice,ConnectionFailed,CommunicationFailed,DevFailedfrom database device

◆ delete_property() [2/3]

virtual void Tango::DeviceProxy::delete_property ( string &  prop_name)
virtual

Delete a single device property.

Delete a single property for a device. The property to delete is specified as a string.

Parameters
[in]prop_nameThe property name
Exceptions
NonDbDevice,ConnectionFailed,CommunicationFailed,DevFailedfrom database device

◆ delete_property() [3/3]

virtual void Tango::DeviceProxy::delete_property ( vector< string > &  prop_names)
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.

Parameters
[in]prop_namesThe property names list
Exceptions
NonDbDevice,ConnectionFailed,CommunicationFailed,DevFailedfrom database device

◆ description()

virtual string Tango::DeviceProxy::description ( )
virtual

Returns the device description as a string.

Returns the device description as a string.

Returns
The device description
Exceptions
ConnectionFailed,CommunicationFailed

◆ dev_name()

virtual string Tango::DeviceProxy::dev_name ( )
inlinevirtual

Return the device name as it is stored locally.

Return the device name as it is stored locally

Returns
The device name

Implements Tango::Connection.

◆ event_queue_size()

virtual int Tango::DeviceProxy::event_queue_size ( int  event_id)
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.

Parameters
[in]event_idThe event identifier
Returns
The event number in queue
Exceptions
EventSystemFailed

◆ get_attribute_config() [1/2]

virtual AttributeInfoEx Tango::DeviceProxy::get_attribute_config ( const string &  att_name)
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

Parameters
[in]att_nameAttribute name
Returns
The extended attribute information
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_attribute_config() [2/2]

virtual AttributeInfoList* Tango::DeviceProxy::get_attribute_config ( vector< string > &  att_names)
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

Parameters
[in]att_namesAttributes name list
Returns
A vector of AttributeInfo structures with one element per attribute
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_attribute_config_ex()

virtual AttributeInfoListEx* Tango::DeviceProxy::get_attribute_config_ex ( vector< string > &  att_names)
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

Parameters
[in]att_namesAttributes name list
Returns
A vector of AttributeInfoEx structures with one element per attribute
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_attribute_list()

virtual vector<string>* Tango::DeviceProxy::get_attribute_list ( )
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.

Returns
A vector of string with one string per attribute
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_attribute_poll_period() [1/2]

virtual int Tango::DeviceProxy::get_attribute_poll_period ( const char *  att_name)
inlinevirtual

Get attribute polling period.

Returns the attribute "att_name" polling period in mS. If the attribute is not polled, it returns 0.

Parameters
[in]att_nameThe attribute name
Returns
The attribute polling period

◆ get_attribute_poll_period() [2/2]

virtual int Tango::DeviceProxy::get_attribute_poll_period ( string &  att_name)
virtual

Get attribute polling period.

Returns the attribute "att_name" polling period in mS. If the attribute is not polled, it returns 0.

Parameters
[in]att_nameThe attribute name
Returns
The attribute polling period

◆ get_command_config() [1/2]

virtual CommandInfo Tango::DeviceProxy::get_command_config ( const string &  cmd_name)
inlinevirtual

Get command information for a single command.

Return the command information for a single command.

Parameters
[in]cmd_nameCommand name
Returns
The command information
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_command_config() [2/2]

virtual CommandInfoList* Tango::DeviceProxy::get_command_config ( vector< string > &  cmd_names)
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.

Parameters
[in]cmd_namesCommand name list
Returns
A vector of CommadnInfo srtuctures with one element per command
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_command_list()

virtual vector<string>* Tango::DeviceProxy::get_command_list ( )
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.

Returns
A vector of string with one string per command
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_command_poll_period() [1/2]

virtual int Tango::DeviceProxy::get_command_poll_period ( const char *  cmd_name)
inlinevirtual

Get command polling period.

Returns the command "cmd_name" polling period in mS. If the command is not polled, it returns 0.

Parameters
[in]cmd_nameThe command name
Returns
The command polling period

◆ get_command_poll_period() [2/2]

virtual int Tango::DeviceProxy::get_command_poll_period ( string &  cmd_name)
virtual

Get command polling period.

Returns the command "cmd_name" polling period in mS. If the command is not polled, it returns 0.

Parameters
[in]cmd_nameThe command name
Returns
The command polling period

◆ get_events() [1/6]

virtual void Tango::DeviceProxy::get_events ( int  event_id,
AttrConfEventDataList &  event_list 
)
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.

Parameters
[in]event_idThe event identifier
[out]event_listThe event(s) list
Exceptions
EventSystemFailed

◆ get_events() [2/6]

virtual void Tango::DeviceProxy::get_events ( int  event_id,
CallBack cb 
)
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.

Parameters
[in]event_idThe event identifier
[in]cbThe callback object
Exceptions
EventSystemFailed

◆ get_events() [3/6]

virtual void Tango::DeviceProxy::get_events ( int  event_id,
DataReadyEventDataList &  event_list 
)
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.

Parameters
[in]event_idThe event identifier
[out]event_listThe event(s) list
Exceptions
EventSystemFailed

◆ get_events() [4/6]

virtual void Tango::DeviceProxy::get_events ( int  event_id,
DevIntrChangeEventDataList &  event_list 
)
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.

Parameters
[in]event_idThe event identifier
[out]event_listThe event(s) list
Exceptions
EventSystemFailed

◆ get_events() [5/6]

virtual void Tango::DeviceProxy::get_events ( int  event_id,
EventDataList &  event_list 
)
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.

Parameters
[in]event_idThe event identifier
[out]event_listThe event(s) list
Exceptions
EventSystemFailed

◆ get_events() [6/6]

virtual void Tango::DeviceProxy::get_events ( int  event_id,
PipeEventDataList &  event_list 
)
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.

Parameters
[in]event_idThe event identifier
[out]event_listThe event(s) list
Exceptions
EventSystemFailed

◆ get_last_event_date()

virtual TimeVal Tango::DeviceProxy::get_last_event_date ( int  event_id)
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.

Parameters
[in]event_idThe event identifier
Returns
The last event date
Exceptions
EventSystemFailed

◆ get_locker()

virtual bool Tango::DeviceProxy::get_locker ( LockerInfo &  li)
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

typedef union
{
pid_t LockerPid;
unsigned long UUID[4];
}LockerId;
enum LockerLanguage
{
CPP,
JAVA
};
struct LockerInfo
{
LockerLanguage ll;
LockerId li;
string locker_host;
string locker_class;
};
Parameters
[out]liDevice locking information
Returns
The device locked flag

◆ get_logging_level()

virtual int Tango::DeviceProxy::get_logging_level ( void  )
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).

Returns
The device logging level

◆ get_logging_target()

virtual vector<string> Tango::DeviceProxy::get_logging_target ( void  )
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.

Returns
List of loggin target

◆ get_pipe_config() [1/2]

virtual PipeInfo Tango::DeviceProxy::get_pipe_config ( const string &  pipe_name)
virtual

Get pipe configuration for a single pipe.

Return the pipe configuration for a single pipe.

Parameters
[in]pipe_namePipe name
Returns
The pipe information
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_pipe_config() [2/2]

virtual PipeInfoList* Tango::DeviceProxy::get_pipe_config ( vector< string > &  pipe_names)
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.

Parameters
[in]pipe_namesPipes name list
Returns
A vector of PipeInfo structures with one element per pipe
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_pipe_list()

virtual vector<string>* Tango::DeviceProxy::get_pipe_list ( )
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.

Returns
A vector of string with one string per pipe
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ get_property() [1/3]

virtual void Tango::DeviceProxy::get_property ( DbData &  db)
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.

Parameters
[in,out]dbThe property(ies) names and values
Exceptions
NonDbDevice,ConnectionFailed,CommunicationFailed,DevFailedfrom database device

◆ get_property() [2/3]

virtual void Tango::DeviceProxy::get_property ( string &  prop_name,
DbData &  db 
)
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.

Parameters
[in]prop_nameThe property name
[out]dbThe property value
Exceptions
NonDbDevice,ConnectionFailed,CommunicationFailed,DevFailedfrom database device

◆ get_property() [3/3]

virtual void Tango::DeviceProxy::get_property ( vector< string > &  prop_names,
DbData &  db 
)
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.

Parameters
[in]prop_namesThe property names
[out]dbThe properties values
Exceptions
NonDbDevice,ConnectionFailed,CommunicationFailed,DevFailedfrom database device

◆ get_property_list()

virtual void Tango::DeviceProxy::get_property_list ( const string &  filter,
vector< string > &  prop_list 
)
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.

Parameters
[in]filterThe filter
[out]prop_listThe device property list
Exceptions
NonDbDevice,ConnectionFailed,CommunicationFailed,DevFailedfrom database device

◆ get_tango_lib_version()

virtual int Tango::DeviceProxy::get_tango_lib_version ( )
virtual

Get device Tango lib version.

Get the version of the Tango library used by the device

Returns
The device Tango lib version

◆ import_info()

virtual DbDevImportInfo Tango::DeviceProxy::import_info ( )
virtual

Query the device for import info from the database.

Query the device for import info from the database.

Returns
The device import info
Exceptions
ConnectionFailed,CommunicationFailed,NonDbDevice

◆ info()

virtual DeviceInfo const& Tango::DeviceProxy::info ( )
virtual

Get device info.

A method which returns information on the device in a DeviceInfo structure. Example :

cout << " device info : " << endl
DeviceInfo dev_info = my_device->info() << endl;
cout << " dev_class " << dev_info.dev_class;
cout << " server_id " << dev_info.server_id;
cout << " server_host " << dev_info.server_host;
cout << " server_version " << dev_info.server_version;
cout << " doc_url " << dev_info.doc_url;
cout << " device_type " << dev_info.dev_type;

All DeviceInfo fields are strings except server_version which is a long integer.

Returns
Device information structure
Exceptions
ConnectionFailed,CommunicationFailed,DevFailedfrom device

◆ is_attribute_polled() [1/2]

virtual bool Tango::DeviceProxy::is_attribute_polled ( const char *  att_name)
inlinevirtual

Check if one attribute is polled.

Returns true if the attribute "att_name" is polled. Otherwise, returns false.

Parameters
[in]att_nameThe attribute name
Returns
Flag set to true if the attribute is polled

◆ is_attribute_polled() [2/2]

virtual bool Tango::DeviceProxy::is_attribute_polled ( string &  att_name)
virtual

Check if one attribute is polled.

Returns true if the attribute "att_name" is polled. Otherwise, returns false.

Parameters
[in]att_nameThe attribute name
Returns
Flag set to true if the attribute is polled

◆ is_command_polled() [1/2]

virtual bool Tango::DeviceProxy::is_command_polled ( const char *  cmd_name)
inlinevirtual

Check if a command is polled.

Returns true if the command "cmd_name" is polled. Otherwise, returns false.

Parameters
[in]cmd_nameThe command name
Returns
Flag set to true if the command is polled

◆ is_command_polled() [2/2]

virtual bool Tango::DeviceProxy::is_command_polled ( string &  cmd_name)
virtual

Check if a command is polled.

Returns true if the command "cmd_name" is polled. Otherwise, returns false.

Parameters
[in]cmd_nameThe command name
Returns
Flag set to true if the command is polled

◆ is_event_queue_empty()

virtual bool Tango::DeviceProxy::is_event_queue_empty ( int  event_id)
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.

Parameters
[in]event_idThe event identifier
Returns
true if the event queue is empty
Exceptions
EventSystemFailed

◆ is_locked()

virtual bool Tango::DeviceProxy::is_locked ( )
virtual

Check if the device is locked.

Returns true if the device is locked. Otherwise, returns false

Returns
The device locked flag

◆ is_locked_by_me()

virtual bool Tango::DeviceProxy::is_locked_by_me ( )
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)

Returns
The device locked flag

◆ lock()

virtual void Tango::DeviceProxy::lock ( int  lock_validity = DEFAULT_LOCK_VALIDITY)
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:

  • It is impossible to lock the database device or any device server process admin device
  • Destroying a locked DeviceProxy unlocks the device
  • Restarting a locked device keeps the lock
  • It is impossible to restart a device locked by someone else
  • Restarting a server breaks the lock

A locked device is protected against the following calls when executed by another client:

  • command_inout call except for device state and status requested via command and for the set of commands defined as allowed following the definition of allowed command in the Tango control access schema.
  • write_attribute call
  • write_pipe call
  • write_read_attribute call
  • write_read_pipe call
  • set_attribute_config call
  • set_pipe_config call
Parameters
[in]lock_validityThe lock validity (in seconds)

◆ locking_status()

virtual string Tango::DeviceProxy::locking_status ( )
virtual

Get device locking status.

This method returns a plain string describing the device locking status. This string can be:

  • "Device <device name> is not locked" in case the device is not locked
  • "Device <device name> is locked by CPP or Python client with PID <pid> from host <host name>" in case the device is locked by a CPP client
  • "Device <device name> is locked by JAVA client class <main class> from host <host name>" in case the device is locked by a JAVA client
Returns
The device locking status

◆ name()

virtual string Tango::DeviceProxy::name ( )
virtual

Return the device name (from the device itself)

Return the device name (from the device itself)

Returns
The device name
Exceptions
ConnectionFailed,CommunicationFailed

◆ pending_asynch_call()

virtual long Tango::DeviceProxy::pending_asynch_call ( asyn_req_type  req)
inlinevirtual

Get pending asynchronous request number.

Return number of device asynchronous pending requests. The input parameter is an enumeration with three values which are:

  • POLLING : Returns only device polling model asynchronous request number
  • CALLBACK : Returns only device callback model asynchronous request number
  • ALL_ASYNCH : Returns device asynchronous request number
Parameters
[in]reqThe asynchronous request type
Returns
Pending asynchronous request number

◆ ping()

virtual int Tango::DeviceProxy::ping ( )
virtual

Ping a device.

A method which sends a ping to the device and returns the time elapsed as microseconds. Example :

cout << " device ping took " << my_device->ping() << " microseconds" << endl;
Exceptions
ConnectionFailed,CommunicationFailed

◆ poll_attribute() [1/2]

virtual void Tango::DeviceProxy::poll_attribute ( const char *  att_name,
int  polling_period 
)
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".

Parameters
[in]att_nameThe attribute name
[in]polling_periodThe polling period

◆ poll_attribute() [2/2]

virtual void Tango::DeviceProxy::poll_attribute ( string &  att_name,
int  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".

Parameters
[in]att_nameThe attribute name
[in]polling_periodThe polling period

◆ poll_command() [1/2]

virtual void Tango::DeviceProxy::poll_command ( const char *  cmd_name,
int  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".

Parameters
[in]cmd_nameThe command name
[in]polling_periodThe polling period

◆ poll_command() [2/2]

virtual void Tango::DeviceProxy::poll_command ( string &  cmd_name,
int  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".

Parameters
[in]cmd_nameThe command name
[in]polling_periodThe polling period

◆ polling_status()

virtual vector<string>* Tango::DeviceProxy::polling_status ( )
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 :

  • The attribute/command name
  • The attribute/command polling period (in mS)
  • The attribute/command polling ring buffer depth
  • The time needed for the last command/attribute execution (in mS)
  • The time since data in the ring buffer has not been updated
  • The delta time between the last records in the ring buffer
  • The exception parameters in case of the last command/attribute execution failed

This method allocates memory for the vector of string(s) returned to the caller. It is the caller responsibility to delete this memory.

Returns
The polling status

◆ put_property()

virtual void Tango::DeviceProxy::put_property ( DbData &  db)
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.

Parameters
[in]dbThe property(ies) names and values
Exceptions
NonDbDevice,ConnectionFailed,CommunicationFailed,DevFailedfrom database device

◆ read_attribute() [1/2]

virtual DeviceAttribute Tango::DeviceProxy::read_attribute ( const char *  att_name)
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

Parameters
[in]att_nameAttribute name
Returns
The attribute value in a DeviceAttribute instance
Exceptions
ConnectionFailed,CommunicationFailed

◆ read_attribute() [2/2]

virtual DeviceAttribute Tango::DeviceProxy::read_attribute ( string &  att_name)
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

Parameters
[in]att_nameAttribute name
Returns
The attribute value in a DeviceAttribute instance
Exceptions
ConnectionFailed,CommunicationFailed

◆ read_attribute_asynch() [1/4]

virtual long Tango::DeviceProxy::read_attribute_asynch ( const char *  att_name)
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.

Parameters
[in]att_nameThe attributes name
Returns
The call identifier
Exceptions
ConnectionFailed

◆ read_attribute_asynch() [2/4]

virtual void Tango::DeviceProxy::read_attribute_asynch ( const char *  att_name,
CallBack cb 
)
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.

Parameters
[in]att_nameThe attribute name
[in]cbThe call-back object
Exceptions
ConnectionFailed

◆ read_attribute_asynch() [3/4]

virtual long Tango::DeviceProxy::read_attribute_asynch ( string &  att_name)
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.

Parameters
[in]att_nameThe attributes name
Returns
The call identifier
Exceptions
ConnectionFailed

◆ read_attribute_asynch() [4/4]

virtual void Tango::DeviceProxy::read_attribute_asynch ( string &  att_name,
CallBack cb 
)
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.

Parameters
[in]att_nameThe attribute name
[in]cbThe call-back object
Exceptions
ConnectionFailed

◆ read_attribute_reply() [1/2]

virtual DeviceAttribute* Tango::DeviceProxy::read_attribute_reply ( long  id)
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.

Parameters
[in]idThe call identifier
Returns
The attribute data
Exceptions
AsynCall,AsynReplyNotArrived,CommunicationFailed,DevFailedfrom device

◆ read_attribute_reply() [2/2]

virtual DeviceAttribute* Tango::DeviceProxy::read_attribute_reply ( long  id,
long  timeout 
)
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.

Parameters
[in]idThe call identifier
[in]timeoutThe timeout value
Returns
The attribute data
Exceptions
AsynCall,AsynReplyNotArrived,CommunicationFailed,DevFailedfrom device

◆ read_attributes()

virtual vector<DeviceAttribute>* Tango::DeviceProxy::read_attributes ( vector< string > &  att_names)
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 :

vector<DeviceAttribute> *devattr;
vector<string> attr_names;
attr_names.push_back("attribute_1");
attr_names.push_back("attribute_2");
devattr = device->read_attributes(attr_names);
short short_attr_1;
long long_attr_2;
(*devattr)[0] >> short_attr_1;
(*devattr)[1] >> long_attr_2;
cout << "my_attribute value " << short_attr;
delete devattr;
Parameters
[in]att_namesAttribute names
Returns
A vector of DeviceAttribute instances with one element for each read attribute
Exceptions
ConnectionFailed,CommunicationFailed

◆ read_attributes_asynch() [1/2]

virtual long Tango::DeviceProxy::read_attributes_asynch ( vector< string > &  att_names)
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.

Parameters
[in]att_namesThe attributes names
Returns
The call identifier
Exceptions
ConnectionFailed

◆ read_attributes_asynch() [2/2]

virtual void Tango::DeviceProxy::read_attributes_asynch ( vector< string > &  att_names,
CallBack cb 
)
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.

Parameters
[in]att_namesThe attribute name list
[in]cbThe call-back object
Exceptions
ConnectionFailed

◆ read_attributes_reply() [1/2]

virtual vector<DeviceAttribute>* Tango::DeviceProxy::read_attributes_reply ( long  id)
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.

Parameters
[in]idThe call identifier
Returns
The attribute(s) data
Exceptions
AsynCall,AsynReplyNotArrived,CommunicationFailed,DevFailedfrom device

◆ read_attributes_reply() [2/2]

virtual vector<DeviceAttribute>* Tango::DeviceProxy::read_attributes_reply ( long  id,
long  timeout 
)
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.

Parameters
[in]idThe call identifier
[in]timeoutThe timeout value
Returns
The attribute(s) data
Exceptions
AsynCall,AsynReplyNotArrived,CommunicationFailed,DevFailedfrom device

◆ read_pipe()

virtual DevicePipe Tango::DeviceProxy::read_pipe ( const string &  pipe_name)
virtual

Read a pipe.

Read a pipe.

Parameters
[in]pipe_namePipe name
Returns
The pipe value in a DevicePipe instance
Exceptions
ConnectionFailed,CommunicationFailed

◆ remove_logging_target() [1/2]

virtual void Tango::DeviceProxy::remove_logging_target ( const char *  target_type_name)
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:

  • console
  • file
  • device

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.

Parameters
[in]target_type_nameThe target type and name

◆ remove_logging_target() [2/2]

virtual void Tango::DeviceProxy::remove_logging_target ( const string &  target_type_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:

  • console
  • file
  • device

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.

Parameters
[in]target_type_nameThe target type and name

◆ set_attribute_config() [1/2]

virtual void Tango::DeviceProxy::set_attribute_config ( AttributeInfoList &  atts)
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

Parameters
[in]attsNew attributes configuration
Exceptions
ConnectionFailed,CommunicationFailed,DevUnlocked,DevFailedfrom device

◆ set_attribute_config() [2/2]

virtual void Tango::DeviceProxy::set_attribute_config ( AttributeInfoListEx atts)
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

Parameters
[in]attsNew extended attributes configuration
Exceptions
ConnectionFailed,CommunicationFailed,DevUnlocked,DevFailedfrom device

◆ set_logging_level()

virtual void Tango::DeviceProxy::set_logging_level ( int  level)
virtual

Set the device logging level.

Changes the device’s logging level. (0=OFF, 1=FATAL, 2=ERROR, 3=WARNING, 4=INFO, 5=DEBUG).

Parameters
[in]levelThe new device logging level

◆ set_pipe_config()

virtual void Tango::DeviceProxy::set_pipe_config ( PipeInfoList &  pipes)
virtual

Set pipe configuration.

Change the pipe configuration for the specified pipes.

Parameters
[in]pipesNew pipes configuration
Exceptions
ConnectionFailed,CommunicationFailed,DevUnlocked,DevFailedfrom device

◆ state()

virtual DevState Tango::DeviceProxy::state ( )
virtual

Get device state.

A method which returns the state of the device as a Tango::DevState type. Example :

Tango::DevState dev_state = my_device->state();
Returns
Device state enumeration
Exceptions
ConnectionFailed,CommunicationFailed

◆ status()

virtual string Tango::DeviceProxy::status ( )
virtual

Get device status.

A method which returns the status of the device as a string. Example :

cout << "device status: " << my_device->status() << endl;
Returns
Device status
Exceptions
ConnectionFailed,CommunicationFailed

◆ stop_poll_attribute() [1/2]

virtual void Tango::DeviceProxy::stop_poll_attribute ( const char *  att_name)
inlinevirtual

Stop polling an attribute.

Remove attribute "att_name" from the list of polled attributes

Parameters
[in]att_nameThe attribute name

◆ stop_poll_attribute() [2/2]

virtual void Tango::DeviceProxy::stop_poll_attribute ( string &  att_name)
virtual

Stop polling an attribute.

Remove attribute "att_name" from the list of polled attributes

Parameters
[in]att_nameThe attribute name

◆ stop_poll_command() [1/2]

virtual void Tango::DeviceProxy::stop_poll_command ( const char *  cmd_name)
inlinevirtual

Stop polling a command.

Remove command "cmd_name" from the list of polled command.

Parameters
[in]cmd_nameThe command name

◆ stop_poll_command() [2/2]

virtual void Tango::DeviceProxy::stop_poll_command ( string &  cmd_name)
virtual

Stop polling a command.

Remove command "cmd_name" from the list of polled command.

Parameters
[in]cmd_nameThe command name

◆ subscribe_event() [1/5]

int Tango::DeviceProxy::subscribe_event ( const string &  att_name,
EventType  event,
CallBack cb 
)
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.

Parameters
[in]att_nameThe attribute name
[in]eventThe event type
[in]cbThe callback object
Returns
The event identifier
Exceptions
EventSystemFailed

◆ subscribe_event() [2/5]

int Tango::DeviceProxy::subscribe_event ( const string &  att_name,
EventType  event,
CallBack cb,
bool  stateless 
)
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.

Parameters
[in]att_nameThe attribute name
[in]eventThe event type
[in]cbThe callback object
[in]statelessThe stateless flag
Returns
The event identifier
Exceptions
EventSystemFailed

◆ subscribe_event() [3/5]

int Tango::DeviceProxy::subscribe_event ( const string &  att_name,
EventType  event,
int  event_queue_size,
bool  stateless = false 
)
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.

  • Event reception buffer size = 1 : The client is interested only in the value of the last event received. All other events that have been received since the last reading are discarded.
  • Event reception buffer size > 1 : The client has chosen to keep an event history of a given size. When more events arrive since the last reading, older events will be discarded.
  • Event reception buffer size = ALL_EVENTS : The client buffers all received events. The buffer size is unlimited and only restricted by the available memory for the client.

All other parameters (att_name, event, stateless) are similar to those described in DeviceProxy::subscribe_event(const string &,EventType,CallBack *,bool)

Parameters
[in]att_nameThe attribute name
[in]eventThe event type
[in]event_queue_sizeThe event queue size
[in]statelessThe stateless flag
Returns
The event identifier
Exceptions
EventSystemFailed

◆ subscribe_event() [4/5]

virtual int Tango::DeviceProxy::subscribe_event ( EventType  event,
CallBack cb,
bool  stateless = false 
)
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.

Parameters
[in]eventThe event type
[in]cbThe callback object
[in]statelessThe stateless flag
Returns
The event identifier
Exceptions
EventSystemFailed

◆ subscribe_event() [5/5]

virtual int Tango::DeviceProxy::subscribe_event ( EventType  event,
int  event_queue_size,
bool  stateless = false 
)
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.

  • Event reception buffer size = 1 : The client is interested only in the value of the last event received. All other events that have been received since the last reading are discarded.
  • Event reception buffer size > 1 : The client has chosen to keep an event history of a given size. When more events arrive since the last reading, older events will be discarded.
  • Event reception buffer size = ALL_EVENTS : The client buffers all received events. The buffer size is unlimited and only restricted by the available memory for the client. 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.
Parameters
[in]eventThe event type
[in]event_queue_sizeThe event queue size
[in]statelessThe stateless flag
Returns
The event identifier
Exceptions
EventSystemFailed

◆ unlock()

virtual void Tango::DeviceProxy::unlock ( bool  force = false)
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.

Parameters
[in]forceThe force unlock flag

◆ unsubscribe_event()

virtual void Tango::DeviceProxy::unsubscribe_event ( int  event_id)
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.

Parameters
[in]event_idThe event identifier
Exceptions
EventSystemFailed

◆ write_attribute()

virtual void Tango::DeviceProxy::write_attribute ( DeviceAttribute attr_in)
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.

Parameters
[in]attr_inAttribute name and value
Exceptions
ConnectionFailed,CommunicationFailed,DeviceUnlocked,DevFailedfrom device

◆ write_attribute_asynch() [1/2]

virtual long Tango::DeviceProxy::write_attribute_asynch ( DeviceAttribute argin)
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.

Parameters
[in]arginThe attribute name and value
Returns
The call identifier
Exceptions
ConnectionFailed

◆ write_attribute_asynch() [2/2]

virtual void Tango::DeviceProxy::write_attribute_asynch ( DeviceAttribute argin,
CallBack cb 
)
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.

Parameters
[in]arginThe attribute name and value
[in]cbThe call-back object
Exceptions
ConnectionFailed

◆ write_attribute_reply() [1/2]

virtual void Tango::DeviceProxy::write_attribute_reply ( long  id)
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.

Parameters
[in]idThe call identifier
Exceptions
AsynCall,AsynReplyNotArrived,CommunicationFailed,DevFailedfrom device

◆ write_attribute_reply() [2/2]

virtual void Tango::DeviceProxy::write_attribute_reply ( long  id,
long  timeout 
)
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.

Parameters
[in]idThe call identifier
[in]timeoutThe timeout value
Exceptions
AsynCall,AsynReplyNotArrived,CommunicationFailed,DevFailedfrom device

◆ write_attributes()

virtual void Tango::DeviceProxy::write_attributes ( vector< DeviceAttribute > &  attr_in)
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 :

vector<DeviceAttribute> attr_in;
string att1_name("First_attr");
string att2_name("Second_attr");
short short_attr = ...;
double double_attr = ...;
attr_in.push_back(DeviceAttribute(att1_name,short_attr));
attr_in.push_back(DeviceAttribute(att2_name,double_attr));
device->write_attributes(attr_in);
Parameters
[in]attr_inAttributes name and value
Exceptions
ConnectionFailed,CommunicationFailed,DeviceUnlocked,DevFailedor NamedDevFailedList from device

◆ write_attributes_asynch() [1/2]

virtual long Tango::DeviceProxy::write_attributes_asynch ( vector< DeviceAttribute > &  argin)
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.

Parameters
[in]arginThe attributes name and value
Returns
The call identifier
Exceptions
ConnectionFailed

◆ write_attributes_asynch() [2/2]

virtual void Tango::DeviceProxy::write_attributes_asynch ( vector< DeviceAttribute > &  argin,
CallBack cb 
)
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.

Parameters
[in]arginThe attribute names and values
[in]cbThe call-back object
Exceptions
ConnectionFailed

◆ write_attributes_reply() [1/2]

virtual void Tango::DeviceProxy::write_attributes_reply ( long  id)
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.

Parameters
[in]idThe call identifier
Exceptions
AsynCall,AsynReplyNotArrived,CommunicationFailed,DevFailedfrom device

◆ write_attributes_reply() [2/2]

virtual void Tango::DeviceProxy::write_attributes_reply ( long  id,
long  timeout 
)
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.

Parameters
[in]idThe call identifier
[in]timeoutThe timeout value
Exceptions
AsynCall,AsynReplyNotArrived,CommunicationFailed,DevFailedfrom device

◆ write_pipe()

virtual void Tango::DeviceProxy::write_pipe ( DevicePipe pipe_data)
virtual

Write a pipe.

Write a pipe.

Parameters
[in]pipe_dataData to be sent to the device through the pipe
Exceptions
ConnectionFailed,CommunicationFailed

◆ write_read_attribute()

virtual DeviceAttribute Tango::DeviceProxy::write_read_attribute ( DeviceAttribute attr_in)
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.

Parameters
[in]attr_inAttribute name and value (to be written)
Returns
The read attribute data
Exceptions
ConnectionFailed,CommunicationFailed,DeviceUnlocked,DevFailedfrom device

◆ write_read_attributes()

virtual vector<DeviceAttribute>* Tango::DeviceProxy::write_read_attributes ( vector< DeviceAttribute > &  attr_in,
vector< string > &  r_names 
)
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.

Parameters
[in]attr_inThe attribute(s) name and value (to be written)
[in]r_namesNames of attribute to be read
Returns
The read attribute(s) data
Exceptions
ConnectionFailed,CommunicationFailed,DeviceUnlocked,DevFailedfrom device

◆ write_read_pipe()

virtual DevicePipe Tango::DeviceProxy::write_read_pipe ( DevicePipe pipe_data)
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.

Parameters
[in]pipe_dataData to be sent to the device through the pipe
Returns
The pipe value in a DevicePipe instance
Exceptions
ConnectionFailed,CommunicationFailed

The documentation for this class was generated from the following file:
Tango::DeviceProxy::DeviceProxy
DeviceProxy(string &name, CORBA::ORB *orb=NULL)
Create a DeviceProxy instance.