From OpenSCADAWiki
Jump to: navigation, search

Public methods:

  • TTransportOut( const string &id, const string &db, TElem *el ); — Initializing constructor.
  • bool isNetwork( ); — The sign — "The transport is network one", what is specified by the timeouts in seconds.
  • bool isFromInput( ); — The sign of the output transport created by the input transport for the initiative connection.
  • string id( ); — Transport's Id.
  • string workId( ); — Full ID including the ID of the module.
  • string name( ); — Transport name.
  • string dscr( ); — Transport description.
  • string addr( ) const; — Transport address.
  • virtual string timings( ); — Transport timeouts.
  • virtual unsigned short attempts( ); — Connection attempts.
  • TVariant prm( const string &id, const TVariant &val = TVariant(), bool toWr = false ); — Getting for value the addition parameter id with default one val, or setting to the value val at toWr. The additional parameters can store the connection time parameters at pointing id in the form "{id}\n{SRC}[\n{NAME}[\n{HELP}]]". The additional parameters stored in XML of the configuration field "A_PRMS".
  • TVariant conPrm( const string &id, const TVariant &val = TVariant(), const string &cfg = "" ); — Getting for value the connection time parameter id and setting the parameter at specifying the value val. If the connection time parameter also is a configuration from an external source, you specify the argument cfg in the form "{SRC}[\n{NAME}[\n{HELP}]]". Configuration of the external sources is read only by this function with setting the value val and configuration cfg once at initialisation, all changes for value the configuration performed by user from control interface of the transport.
  • bool startStat( ); — Status "Running".
  • time_t startTm( ); — Status "Time of starting/connection".
  • int64_t lstReqTm( ); — Status "Last request time".
  • virtual string getStatus( ); — Getting the status of the transport.
  • string DB( bool qTop = false ) const; — Transport's storage address, qTop for the storage queue top.
  • string tbl( ) const; — Transport's DB table.
  • string fullDB( bool qTop = false ) const; — Full name of the transport's DB table, qTop for the storage queue top.
  • void setName( const string &inm ); — Setting the name of transport.
  • void setDscr( const string &idscr ); — Setting the description of transport.
  • void setAddr( const string &addr ); — Setting the address of transport.
  • virtual void setTimings( const string &vl, bool isDef = false ); — Setting the transport timeouts, as default one for isDef.
  • virtual void setAttempts( unsigned short vl ); — Setting the connection attempts.
  • void clearConPrm( const string &id = "" ); — Clearing the connection time parameter id at non empty, all ones at empty and the external source configuration at "CFG:".
  • void setDB( const string &vl, bool qTop = false ); — Setting of the transport's storage address, qTop for the storage queue top.
  • virtual void start( int time = 0 ); — Starting the transport with the connection timeout time. When you start the output transport the actual connection to the remote station is established for the interfaces that works by the connection. At this time the errors can occur if the connection is impossible and the transport should return to the stopped state.
  • virtual void stop( ); — Stopping the transport.
  • virtual int messIO( const char *obuf, int len_ob, char *ibuf = NULL, int len_ib = 0, int time = 0 ); — Sending of the data over the transport. The waiting timeout time of the connection in milliseconds. The time in negative disables the transport's request/respond mode and allows for the independently reading/writing to a buffer IO, with the reading timeout time in absolute.
  • void messProtIO( XMLNode &io, const string &prot ); — Sending of the data in the XML tree in over the transport using the transport protocol prot.
  • TTypeTransport &owner( ) const; — Type of transport - the owner of output transport.
  • ResMtx &reqRes( ); — The requesting resource, needs to global lock into protocols with fragments receiving.