openDAQ
Open data acquisition platform
IStreaming Struct Referenceabstract

Represents the client-side part of a streaming service responsible for initiating communication with the openDAQ device streaming server and processing the received data. Wraps the client-side implementation details of the particular data transfer protocol used by openDAQ to send processed/acquired data from devices running an openDAQ Server to an openDAQ Client. More...

+ Inheritance diagram for IStreaming:
+ Collaboration diagram for IStreaming:

Detailed Description

Represents the client-side part of a streaming service responsible for initiating communication with the openDAQ device streaming server and processing the received data. Wraps the client-side implementation details of the particular data transfer protocol used by openDAQ to send processed/acquired data from devices running an openDAQ Server to an openDAQ Client.

The Streaming is used as a selectable data source for mirrored signals. For this, it provides methods, allowing mirrored signals to be added/removed dynamically, to enable/disable the use of Streaming as a data source of these signals. Forwarding of packets received from the remote device through the data transfer protocol down to the signal path is enabled when the following conditions are met:

  • Streaming object itself is in active state.
  • Streaming is selected as an active source of the corresponding signal.

Usually, the data transfer protocol provides information about the signals whose data can be sent over the protocol. It allows the implementation to reject unsupported signals from being added to the streaming. Each Streaming object provides the string representation of a connection address used to connect to the streaming service of the device. This string representation is used as a unique ID to determine the streaming source for the mirrored signal.

When the generalized client-to-device streaming mechanism is employed, however, the roles are effectively switched: the server becomes a consumer of signal data, while the client-side Streaming object acts as the producer, sending signal data over the protocol. In this context, Streaming objects are expected to exist on the server side as well to interact with mirrored copies of client signals. In context of client-to-device streaming, in addition to signals, mirrored input ports can also be added or removed dynamically through the corresponding methods of the Streaming interface, similarly to mirrored signals.

The support for client-to-device streaming can be checked via getClientToDeviceStreamingEnabled. If it is not enabled or not supported by the protocol, the method provides false value, and adding or removing mirrored input ports is not allowed, therefore disabling any client-to-device streaming operations.

Public Member Functions

virtual ErrCode INTERFACE_FUNC getActive (Bool *active)=0
 Gets the active state of the Streaming. More...
 
virtual ErrCode INTERFACE_FUNC setActive (Bool active)=0
 Sets the Streaming to be either active or inactive. More...
 
virtual ErrCode INTERFACE_FUNC addSignals (IList *signals)=0
 Adds signals to the Streaming. More...
 
virtual ErrCode INTERFACE_FUNC removeSignals (IList *signals)=0
 Removes signals from the Streaming. More...
 
virtual ErrCode INTERFACE_FUNC removeAllSignals ()=0
 Removes all added signals from the Streaming.
 
virtual ErrCode INTERFACE_FUNC getConnectionString (IString **connectionString) const =0
 Gets the string representation of a connection address used to connect to the streaming service of the device. More...
 
virtual ErrCode INTERFACE_FUNC getConnectionStatus (IEnumeration **connectionStatus)=0
 Retrieves the current status of the streaming connection. More...
 
virtual ErrCode INTERFACE_FUNC addInputPorts (IList *inputPorts)=0
 Adds input ports to the Streaming. More...
 
virtual ErrCode INTERFACE_FUNC removeInputPorts (IList *inputPorts)=0
 Removes input ports from the Streaming. More...
 
virtual ErrCode INTERFACE_FUNC removeAllInputPorts ()=0
 Removes all added input ports from the Streaming.
 
virtual ErrCode INTERFACE_FUNC getOwnerDeviceRemoteId (IString **deviceRemoteId) const =0
 Gets the global ID of the device (as it appears on the remote instance) to which this streaming object establishes a connection. More...
 
virtual ErrCode INTERFACE_FUNC getProtocolId (IString **protocolId) const =0
 Gets the identifier of the data transfer protocol (e.g., "OpenDAQNativeStreaming", "OpenDAQLTStreaming") used by this streaming object. More...
 
virtual ErrCode INTERFACE_FUNC getClientToDeviceStreamingEnabled (Bool *enabled) const =0
 Checks whether client-to-device streaming is enabled for this streaming object. More...
 
- Public Member Functions inherited from IBaseObject
virtual ErrCode INTERFACE_FUNC borrowInterface (const IntfID &intfID, void **obj) const =0
 Returns another interface which is supported by the object without incrementing the reference count. More...
 
virtual ErrCode INTERFACE_FUNC dispose ()=0
 Disposes all references held by the object. More...
 
virtual ErrCode INTERFACE_FUNC getHashCode (SizeT *hashCode)=0
 Returns hash code of the object. More...
 
virtual ErrCode INTERFACE_FUNC equals (IBaseObject *other, Bool *equal) const =0
 Compares object to another object for equality. More...
 
virtual ErrCode INTERFACE_FUNC toString (CharPtr *str)=0
 Returns a string representation of the object. More...
 
- Public Member Functions inherited from IUnknown
virtual ErrCode INTERFACE_FUNC queryInterface (const IntfID &intfID, void **obj)=0
 Returns another interface which is supported by the object and increments the reference count. More...
 
virtual int INTERFACE_FUNC addRef ()=0
 Increments the reference count for an interface on an object. More...
 
virtual int INTERFACE_FUNC releaseRef ()=0
 Decrements the reference count for an interface on an object. More...
 

Member Function Documentation

◆ addInputPorts()

virtual ErrCode INTERFACE_FUNC addInputPorts ( IList inputPorts)
pure virtual

Adds input ports to the Streaming.

Parameters
inputPortsThe list of input ports to be added.
Return values
OPENDAQ_ERR_DUPLICATEITEMif an input port on the list is already added to the Streaming.
OPENDAQ_ERR_NOINTERFACEif an input port on the list is not a mirrored signal.

After an input port is added to the Streaming, the Streaming automatically appears in the list of available streaming sources of an input port.

◆ addSignals()

virtual ErrCode INTERFACE_FUNC addSignals ( IList signals)
pure virtual

Adds signals to the Streaming.

Parameters
signalsThe list of signals to be added.
Return values
OPENDAQ_ERR_DUPLICATEITEMif a signal on the list is already added to the Streaming.
OPENDAQ_ERR_NOINTERFACEif a signal on the list is not a mirrored signal.

After a signal is added to the Streaming, the Streaming automatically appears in the list of available streaming sources of a signal. Some signals, however, may be silently ignored without triggering an error - for example, private signals are excluded by default.

◆ getActive()

virtual ErrCode INTERFACE_FUNC getActive ( Bool *  active)
pure virtual

Gets the active state of the Streaming.

Parameters
[out]activeTrue if the Streaming is active; false otherwise.

◆ getClientToDeviceStreamingEnabled()

virtual ErrCode INTERFACE_FUNC getClientToDeviceStreamingEnabled ( Bool *  enabled) const
pure virtual

Checks whether client-to-device streaming is enabled for this streaming object.

Parameters
[out]enabledThe flag indicating if client-to-device streaming is enabled.

◆ getConnectionStatus()

virtual ErrCode INTERFACE_FUNC getConnectionStatus ( IEnumeration **  connectionStatus)
pure virtual

Retrieves the current status of the streaming connection.

Parameters
[out]connectionStatusThe connection status, represented as an enumeration of type "ConnectionStatusType" with possible values: "Connected", "Reconnecting", or "Unrecoverable".

◆ getConnectionString()

virtual ErrCode INTERFACE_FUNC getConnectionString ( IString **  connectionString) const
pure virtual

Gets the string representation of a connection address used to connect to the streaming service of the device.

Parameters
[out]connectionStringThe string used to connect to the streaming service.

◆ getOwnerDeviceRemoteId()

virtual ErrCode INTERFACE_FUNC getOwnerDeviceRemoteId ( IString **  deviceRemoteId) const
pure virtual

Gets the global ID of the device (as it appears on the remote instance) to which this streaming object establishes a connection.

Parameters
[out]deviceRemoteIdThe string representing the device's remote ID.

◆ getProtocolId()

virtual ErrCode INTERFACE_FUNC getProtocolId ( IString **  protocolId) const
pure virtual

Gets the identifier of the data transfer protocol (e.g., "OpenDAQNativeStreaming", "OpenDAQLTStreaming") used by this streaming object.

Parameters
[out]protocolIdThe string representing the protocol ID.

◆ removeInputPorts()

virtual ErrCode INTERFACE_FUNC removeInputPorts ( IList inputPorts)
pure virtual

Removes input ports from the Streaming.

Parameters
inputPortsThe list of input ports to be removed.
Return values
OPENDAQ_ERR_NOTFOUNDif an input port on the list was not added to the Streaming.

After an input port is removed from the Streaming, the Streaming is automatically excluded in the list of available streaming sources of an input port.

◆ removeSignals()

virtual ErrCode INTERFACE_FUNC removeSignals ( IList signals)
pure virtual

Removes signals from the Streaming.

Parameters
signalsThe list of signals to be removed.
Return values
OPENDAQ_ERR_NOTFOUNDif a signal on the list was not added to the Streaming.

After a signal is removed from the Streaming, the Streaming is automatically excluded in the list of available streaming sources of a signal.

◆ setActive()

virtual ErrCode INTERFACE_FUNC setActive ( Bool  active)
pure virtual

Sets the Streaming to be either active or inactive.

Parameters
activeThe new active state of the Streaming.