3.2.6const for websocket subprotocol for datalink, DataLink1.0
Type: string
enum for modes, either QUERY or STREAM
const for query mode, QUERY
const for streaming mode, STREAM
const for maximum process number to create fake number for datalink id, 2^16-2
const for fake user name for datalink id, browser
Type: string
const for fake program name for datalink id, seisplotjs
Type: string
const for fake architecture for datalink id, javascript
Type: string
const for error response, ERROR
Type: string
const for ok response, OK
Type: string
const for info response, INFO
Type: string
const for id response, ID
Type: string
Type: string
Type: string
Type: string
Type: string
Type: string
Type: string
Type: string
(any)
A websocket based Datalink connection.
Note this cannot connect directly to a native TCP socket, instead it sends the datalink protocol over a websocket.
Currently only the IRIS ringserver, https://github.com/EarthScope/ringserver, supports websockets, but it may be possible to use third party tools to proxy the websocket to a TCP datalink socket.
The datalink protocol is documented here https://earthscope.github.io/libdali/datalink-protocol.html
(any)
websocket url to the ringserver
(any)
callback for packets as they arrive
(any)
callback for errors
Makes sure a response actually is a DataLinkResponse
(any)
datalink packet/response
any:
DataLinkResponse after checking instanceof
Makes sure a response actually is a DataLinkPacket
(any)
datalink packet/response
any:
DataLinkPacket after checking instanceof
Set a callback function called when the connection is closed.
(any)
callback function
creates the websocket connection and sends the client ID.
any:
a Promise that resolves to the server's ID.
any:
true if the websocket is connected (non-null)
any:
the current mode, QUERY_MODE or STREAM_MODE
Switches to streaming mode to receive data packets from the ringserver.
any:
promise to the response
Switches back to query mode to enable commands to be sent to the ringserver.
Closes the connection and the underlying websocket. No communication is possible until connect() is called again.
Send a ID Command. Command is a string.
any:
a Promise that resolves to the response from the ringserver.
encodes as a Datalink packet, header with optional data section as binary Uint8Array. Size of the binary data is appended to the header if present.
(any)
the command/header string
(any)
optional data portion
any:
datalink packet as an ArrayBufferLike
sends the header with optional binary data as the data section. Size of the data is appended to the header before sending if present.
(any)
header to send
(any)
optional data to send
sends the command as header with optional dataString as the data section. Size of the dataString is appended to the header before sending.
(any)
the command/header string
(any)
optional data portion of packet
Send a DataLink Command and await the response. Command is a string.
(any)
packet header
(any)
optional data portion of packet
any:
a Promise that resolves with the webSocket MessageEvent.
Send a DataLink Command and await the response. Command is a string. Returns a Promise that resolves with the webSocket MessageEvent.
(any)
the command/header string
(any)
optional data portion of packet
any:
promise to server's response
Writes data to the ringserver and awaits a acknowledgement.
(any)
stream id for packet header
(any)
start of timewindow the packet covers
(any)
end of timewindow the packet covers
(any)
optional data to send
any:
promise to server's response
Send id and await server's response. All of these are can more or less be filled with dummy values. They are mostly used for logging and debugging on the server side.
(any)
name of program, ex seisplotjs
(any)
name of user, ex browser
(any)
process number, used to differentiate between multiple running instances
(any)
cpu architecture, ex javascript
any:
promise to servers response
Send info command for infoType.
(any)
type to get info for
any:
promise to server's response
Send position after command.
(any)
time to position after
any:
promise to server's response
Send position after command.
(any)
time to position after
any:
promise to server's response
Send match command.
(any)
regular expression to match streams
any:
promise to server's response
Send reject command.
(any)
regular expression to reject streams
any:
promise to server's response
Read a single packet for the given id.
(any)
id of the packet of interest
any:
promise to server's response
(any)
Datalink response, used for ID, INFO, OK and ERROR responses.
(any)
(any)
(any)
(any)
(any)
Represents a Datalink packet from the ringserver.
(any)
(any)
Packet start time as a DateTime.
any:
start time
Packet end time as a DateTime.
any:
end time
Packet time as a DateTime.
any:
packet time
is this packet a miniseed packet
any:
true if it is miniseed
Parsed payload as a miniseed data record, if the streamid ends with '/MSEED', null otherwise.
any:
miniseed DataRecord or null
is this packet a miniseed3 packet
any:
true if it is miniseed3
Parsed payload as a miniseed3 data record, if the data format is 3, null otherwise.
any:
miniseed3 DataRecord or null
is this packet a json packet
any:
true if it is json
Parsed payload as a json if is json, null otherwise.
any:
JSON object or null
(any)
(any)
(any)
Parses the attributes of a xml element.
(any)
DataLink XML element
any:
the id stats
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
Parses the attributes of a xml element.
(any)
DataLink
XML element
any:
the stats
(any)
(any)
(any)
Parses the attributes of a xml element.
(any)
DataLink
XML element
any:
the stats
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
(any)
Non implementation, just stores xml as a string. Unlikely to be useful remotely as ringserver doesn't allow.
(any)
raw xml form server
(any)
(any)
Convert DataLink style dates, like "2022-10-04 15:11:24.786990" to ISO form for DateTime
(any)
datalink time
any:
DateTime
Convert DateTime to a HPTime number.
(any)
DateTime to convert
any:
microseconds since epoch
Convert hptime number to a DateTime.
(any)
hptime to convert
any:
DateTime in utc for the hptime
Encode string into a Uint8Array.
(any)
String to encode.
any:
String as bytes in Uint8Array.