abstractnew OSH.DataReceiver.DataSource(name, properties)
| Name | Type | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
string |
the datasource name |
||||||||||||||||||
properties |
Object |
the datasource properties
|
Methods
-
buildUrl(properties){string}
-
Builds the full url.
Name Type Description propertiesobject Name Type Description protocolstring the connector protocol
endpointUrlstring the endpoint url
servicestring the service
offeringIDstring the offeringID
observedPropertystring the observed property
startTimestring the start time (ISO format)
endTimestring the end time (ISO format)
replaySpeednumber the replay factor
responseFormatnumber the response format (e.g video/mp4)
Returns:
Type Description string the full url -
buildUrl(properties){string}
-
Builds the full url.
Name Type Description propertiesobject Name Type Description protocolstring the connector protocol
endpointUrlstring the endpoint url
servicestring the service
offeringIDstring the offeringID
observedPropertystring the observed property
startTimestring the start time (ISO format)
endTimestring the end time (ISO format)
replaySpeednumber the replay factor
responseFormatnumber the response format (e.g video/mp4)
Returns:
Type Description string the full url -
Connect the dataSource then the connector will be opened as well.
-
disconnect()
-
Disconnect the dataSource then the connector will be closed as well.
-
getId(){string}
-
Gets the datasource id.
Returns:
Type Description string the datasource id -
getName(){*}
-
Gets the datasource name.
Returns:
Type Description * -
initDataSource(properties)
-
Inits the datasource with the constructor properties.
Name Type Description properties -
onData(data)
-
Name Type Description dataObject the data object
Example
data is represented as
data = {
timeStamp: timeStamp // number
data: data // data to render
}; -
parseData(data){String|Object|number|ArrayBuffer|*}
-
The default timestamp parser
Name Type Description datathe full data message returned by the connector
Returns:
Type Description String | Object | number | ArrayBuffer | * data the formatted data -
parseTimeStamp(data){number}
-
The default timestamp parser
Name Type Description datathe full data message returned by the connector
Returns:
Type Description number the formatted timestamp
Type Definitions
-
onMessage
-
The callback which receives data.