Remove dead code
This commit is contained in:
parent
ef3654f0b1
commit
611f0dedda
|
@ -1,63 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
/**
|
||||
* A modem via UART, like https://github.com/ewiger/jsmodem
|
||||
* Not particlarly useful for anything, superseded by network.js
|
||||
*
|
||||
* @constructor
|
||||
*/
|
||||
function ModemAdapter()
|
||||
{
|
||||
this.send_char = function() {};
|
||||
|
||||
this.enabled = true;
|
||||
this.socket = new WebSocket("ws://localhost:2080");
|
||||
|
||||
this.socket.onopen = this.onopen.bind(this);
|
||||
this.socket.onmessage = this.onmessage.bind(this);
|
||||
this.socket.onclose = this.onclose.bind(this);
|
||||
this.socket.onerror = this.onerror.bind(this);
|
||||
|
||||
this.opened = false;
|
||||
}
|
||||
|
||||
ModemAdapter.prototype.onmessage = function(e)
|
||||
{
|
||||
console.log("onmessage", e);
|
||||
};
|
||||
|
||||
ModemAdapter.prototype.onclose = function(e)
|
||||
{
|
||||
console.log("onclose", e);
|
||||
this.opened = false;
|
||||
};
|
||||
|
||||
ModemAdapter.prototype.onopen = function(e)
|
||||
{
|
||||
console.log("open", e);
|
||||
this.opened = true;
|
||||
};
|
||||
|
||||
ModemAdapter.prototype.onerror = function(e)
|
||||
{
|
||||
console.log("onerror", e);
|
||||
};
|
||||
|
||||
ModemAdapter.prototype.init = function(code_fn)
|
||||
{
|
||||
this.destroy();
|
||||
this.send_char = code_fn;
|
||||
};
|
||||
|
||||
ModemAdapter.prototype.destroy = function()
|
||||
{
|
||||
};
|
||||
|
||||
ModemAdapter.prototype.put_chr = function(chr)
|
||||
{
|
||||
console.log("put_chr", chr);
|
||||
if(this.opened)
|
||||
{
|
||||
this.socket.send(chr);
|
||||
}
|
||||
};
|
Loading…
Reference in a new issue