mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-19 14:25:13 +03:00
Init
This commit is contained in:
parent
939f5af04b
commit
f24ccfc637
96 changed files with 16438 additions and 8058 deletions
|
@ -10,7 +10,7 @@ const ConnectionType = {
|
|||
class Connection {
|
||||
|
||||
constructor() {
|
||||
this._connectionId = false;
|
||||
this._connectionId = 0;
|
||||
this._openRequested = false;
|
||||
this._openCanceled = false;
|
||||
this._bitrate = 0;
|
||||
|
@ -145,7 +145,6 @@ class Connection {
|
|||
} else {
|
||||
this._openRequested = false;
|
||||
console.log('Failed to open');
|
||||
googleAnalytics.sendException('FailedToOpen', false);
|
||||
if (callback) {
|
||||
callback(false);
|
||||
}
|
||||
|
@ -163,13 +162,11 @@ class Connection {
|
|||
this.removeAllListeners();
|
||||
|
||||
this.disconnectImplementation(result => {
|
||||
this.checkChromeLastError();
|
||||
|
||||
if (result) {
|
||||
console.log('Connection with ID: ' + this._connectionId + ' closed, Sent: ' + this._bytesSent + ' bytes, Received: ' + this._bytesReceived + ' bytes');
|
||||
} else {
|
||||
console.log('Failed to close connection with ID: ' + this._connectionId + ' closed, Sent: ' + this._bytesSent + ' bytes, Received: ' + this._bytesReceived + ' bytes');
|
||||
googleAnalytics.sendException('Connection: FailedToClose', false);
|
||||
}
|
||||
|
||||
this._connectionId = false;
|
||||
|
@ -240,12 +237,6 @@ class Connection {
|
|||
}
|
||||
}
|
||||
|
||||
checkChromeLastError() {
|
||||
if (chrome.runtime.lastError) {
|
||||
console.error(chrome.runtime.lastError.message);
|
||||
}
|
||||
}
|
||||
|
||||
addOnReceiveCallback(callback) {
|
||||
throw new TypeError("Abstract method");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue