! API of the modules of the "Transports" subsystem
! API of the modules of the "Transports" subsystem
|-
|-
−
| Provide OpenSCADA communications through the interface, often it is the network one which is implemented by the module.
+
| Provides OpenSCADA communications through the interface, often it is the network one which is implemented by the module.
|-
|-
−
| '''[[Special:MyLanguage/Documents/API#TTypeTransport|TTypeTransport]]->[[Special:MyLanguage/Documents/API#TModule|TModule]]''' — the root module object of the "Transports" subsystem:
+
|'''[[Special:MyLanguage/Documents/API#TTypeTransport|TTypeTransport]]->[[Special:MyLanguage/Documents/API#TModule|TModule]]''' — the root module object of the "Transports" subsystem:
* ''virtual bool isNetwork( );'' — the sign of network implementation by this module.
* ''virtual bool isNetwork( );'' — the sign of network implementation by this module.
* ''virtual string outAddrHelp( );'' — address format help of the output transports.
* ''virtual string outAddrHelp( );'' — address format help of the output transports.
Line 16:
Line 16:
* ''virtual void start( );'' — starting the transport.
* ''virtual void start( );'' — starting the transport.
* ''virtual void stop( );'' — stopping the transport.
* ''virtual void stop( );'' — stopping the transport.
−
* ''virtual int writeTo( const string &sender, const string &data );'' — sending ''data'' backward to the ''sender''. Implemented in transports with support of the initiative sending, not only at a request!
+
* ''virtual int writeTo( const string &sender, const string &data );'' — sending ''data'' backward to the ''sender''. [[file:at.png]] Deprecated mostly and replaced by the polling mode of the [[Special:MyLanguage/Documents/API#TProtocolIn|input transport protocol]], Initially implemented in transports with support of the initiative sending, not only at a request.
|-
|-
|'''[[Special:MyLanguage/Documents/API#TTransportOut|TTransportOut]]''' — the output transport object:
|'''[[Special:MyLanguage/Documents/API#TTransportOut|TTransportOut]]''' — the output transport object:
Revision as of 10:59, 8 November 2022
|-
! API of the modules of the "Transports" subsystem
|-
| Provides OpenSCADA communications through the interface, often it is the network one which is implemented by the module.
|-
|TTypeTransport->TModule — the root module object of the "Transports" subsystem:
virtual bool isNetwork( ); — the sign of network implementation by this module.
virtual string outAddrHelp( ); — address format help of the output transports.
virtual TTransportIn *In( const string &id, const string &stor ); — called when a new input transport object is opened or created by this module with the identifier id and the storage stor.
virtual TTransportOut *Out( const string &name, const string &stor ); — called when a new output transport object is opened or created by this module with the identifier id and the storage stor.
virtual string getStatus( ); — getting the status of the transport.
virtual void start( ); — starting the transport.
virtual void stop( ); — stopping the transport.
virtual int writeTo( const string &sender, const string &data ); — sending data backward to the sender. Deprecated mostly and replaced by the polling mode of the input transport protocol, Initially implemented in transports with support of the initiative sending, not only at a request.
virtual unsigned short attempts( ); — connection attempts.
virtual string getStatus( ); — getting the status of the 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.
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 oLen, char *iBuf = NULL, int iLen = 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.