function send(ws, id, url, freq = -1, expectedResponse = undefined) {
	let msg = {id:id, q:url};
	if (freq >= 0) {
		msg['repeat'] = {freq:freq};
	}
	logToConsole("Sending message: " + JSON.stringify(msg));

	console.log("Ready state ", ws.readyState);

  	ws.send(JSON.stringify(msg));
  	return waitForResponse(id, expectedResponse);
}
/**
 * Sends a message to the web socket.
 *
 * If freq >= 0 then the message is repeated every X seconds.
 * To sample at 4 times a second freq = 0.25.
 *
 * An expected response can also be defined. This will resolve/reject the promise
 * if the returning response does not match.
 * This can be used to validate that sent messages have been received and are valid.
 */
Sends a message to the web socket.
If freq >= 0 then the message is repeated every X seconds.
To sample at 4 times a second freq = 0.25.

An expected response can also be defined. This will resolve/reject the promise
if the returning response does not match.
This can be used to validate that sent messages have been received and are valid.
Sends a message to the web socket . If freq > = 0 then the message is repeated every X seconds . To sample at 4 times a second freq = 0 . 25 . An expected response can also be defined . This will resolve / reject the promise if the returning response does not match . This can be used to validate that sent messages have been received and are valid .
function send(ws, id, url, freq = -1, expectedResponse = undefined) {
	let msg = {id:id, q:url};
	if (freq >= 0) {
		msg['repeat'] = {freq:freq};
	}
	logToConsole("Sending message: " + JSON.stringify(msg));
	console.log("Ready state ", ws.readyState);
  	ws.send(JSON.stringify(msg));
  	return waitForResponse(id, expectedResponse);
}
function send ( ws , id , url , freq = - 1 , expectedResponse = undefined ) { let msg = { id : id , q : url } ; if ( freq >= 0 ) { msg [ 'repeat' ] = { freq : freq } ; } logToConsole ( "Sending message: " + JSON . stringify ( msg ) ) ; console . log ( "Ready state " , ws . readyState ) ; ws . send ( JSON . stringify ( msg ) ) ; return waitForResponse ( id , expectedResponse ) ; }
Sends a message to the web socket.
Sends a message to the web socket .