mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-25 01:05:15 +03:00
serial error events hookup
This commit is contained in:
parent
cf9ee40353
commit
f269c8a8b4
1 changed files with 3 additions and 0 deletions
|
@ -23,6 +23,7 @@ var serial = {
|
||||||
|
|
||||||
self.onReceiveError.addListener(function watch_for_on_receive_errors(info) {
|
self.onReceiveError.addListener(function watch_for_on_receive_errors(info) {
|
||||||
console.error(info);
|
console.error(info);
|
||||||
|
ga_tracker.sendEvent('Error', 'Serial', info.error);
|
||||||
|
|
||||||
// valid conditions are 'disconnected', 'timeout', 'device_lost', 'system_error'
|
// valid conditions are 'disconnected', 'timeout', 'device_lost', 'system_error'
|
||||||
if (info.error == 'system_error') {
|
if (info.error == 'system_error') {
|
||||||
|
@ -38,6 +39,7 @@ var serial = {
|
||||||
callback(connectionInfo);
|
callback(connectionInfo);
|
||||||
} else {
|
} else {
|
||||||
console.log('SERIAL: Failed to open serial port');
|
console.log('SERIAL: Failed to open serial port');
|
||||||
|
ga_tracker.sendEvent('Error', 'Serial', 'FailedToOpen');
|
||||||
callback(false);
|
callback(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -61,6 +63,7 @@ var serial = {
|
||||||
console.log('SERIAL: Connection with ID: ' + self.connectionId + ' closed');
|
console.log('SERIAL: Connection with ID: ' + self.connectionId + ' closed');
|
||||||
} else {
|
} else {
|
||||||
console.log('SERIAL: Failed to close connection with ID: ' + self.connectionId + ' closed');
|
console.log('SERIAL: Failed to close connection with ID: ' + self.connectionId + ' closed');
|
||||||
|
ga_tracker.sendEvent('Error', 'Serial', 'FailedToClose');
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('SERIAL: Statistics - Sent: ' + self.bytes_sent + ' bytes, Received: ' + self.bytes_received + ' bytes');
|
console.log('SERIAL: Statistics - Sent: ' + self.bytes_sent + ' bytes, Received: ' + self.bytes_received + ' bytes');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue