2.0.0-alpha.4
const for datalink protocol for web sockets, DataLink1.0
Type: string
const for query mode, QUERY
Type: string
const for streaming mode, STREAM
Type: string
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 error response, ERROR
Type: string
Type: string
Type: string
Type: string
Type: string
A websocket based Datalink connection to a ringserver. https://raw.githubusercontent.com/iris-edu/libdali/master/doc/DataLink.protocol
(string)
websocket url to the ringserver
(function (packet: DataLinkPacket): void)
callback for packets as they arrive
(function (error: Error): void)
callback for errors
Type: function (packet: DataLinkPacket): void
Type: (null | function (close: CloseEvent): void)
(function (close: CloseEvent): void)
creates the websocket connection and sends the client ID. Returns a Promise that resolves to the server's ID.
gets the current mode, QUERY_MODE or STREAM_MODE
Switches to streaming mode to receive data packets from the ringserver.
void
Switches back to query mode to enable commands to be sent to the ringserver.
void
Closes the connection and the underlying websocket. No communication is possible until connect() is called again.
void
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.
(string)
(Uint8Array?)
ArrayBuffer
sends the header with optional binary data as the data section. Size of the data is appended to the header before sending if present.
(string)
header to send
(Uint8Array?)
optional data to send
void
sends the command as header with optional dataString as the data section. Size of the dataString is appended to the header before sending.
void
Send a DataLink Command and await the response. Command is a string.
(string)
(Uint8Array?)
Promise<string>
:
a Promise that resolves with the webSocket MessageEvent.
Writes data to the ringserver and awaits a acknowledgement.
Represents a Datalink packet from the ringserver. Note this cannot connect directly to a native TCP socket, instead it sends the datalink protocol over a websocket. Currently only the IRIS ringserver supports websockets, but it may be possible to use thrid party tools to proxy the websocket to a TCP datalink socket.
Type: (null | miniseed.DataRecord)
Packet start time as a moment.
Type: moment
moment
:
start time
Packet end time as a moment.
Type: moment
moment
:
end time
Packet time as a moment.
Type: moment
moment
:
packet time
Parsed payload as a miniseed data record, if the streamid ends with '/MSEED', null otherwise.
Convert moment to a HPTime number.
(moment)
moment to convert
number
:
microseconds since epoch
Convert moment to a HPTime number.
(number)
(any)
moment to convert
moment
:
microseconds since epoch
Encode string into a Uint8Array.
(string?)
String to encode.
(Uint8Array | void)
:
String as bytes in Uint8Array.