diff --git a/src/js/tabs/cli.js b/src/js/tabs/cli.js index 46bc14ee3f0..e39f0059746 100644 --- a/src/js/tabs/cli.js +++ b/src/js/tabs/cli.js @@ -6,13 +6,15 @@ import BuildApi from '../BuildApi'; import { tracking } from '../Analytics'; import { reinitializeConnection } from "../serial_backend"; import CONFIGURATOR from "../data_storage"; -import serial from "../serial"; import CliAutoComplete from "../CliAutoComplete"; import UI_PHONES from "../phones_ui"; import { gui_log } from "../gui_log"; import jBox from "jbox"; import { checkChromeRuntimeError } from "../utils/common"; import $ from 'jquery'; +import { serialShim } from "../serial_shim"; + +const serial = serialShim(); const cli = { lineDelayMs: 15, @@ -446,7 +448,7 @@ cli.read = function (readInfo) { Windows understands (both) CRLF Chrome OS currently unknown */ - const data = new Uint8Array(readInfo.data); + const data = new Uint8Array(readInfo.data ?? readInfo); let validateText = ""; let sequenceCharsToSkip = 0; diff --git a/src/tabs/presets/CliEngine.js b/src/tabs/presets/CliEngine.js index 23b77304ff2..042c2785821 100644 --- a/src/tabs/presets/CliEngine.js +++ b/src/tabs/presets/CliEngine.js @@ -1,9 +1,11 @@ import GUI from "../../js/gui"; import { i18n } from "../../js/localization"; import CONFIGURATOR from "../../js/data_storage"; -import serial from "../../js/serial"; import { reinitializeConnection } from "../../js/serial_backend"; import { gui_log } from "../../js/gui_log"; +import { serialShim } from "../../js/serial_shim"; + +const serial = serialShim(); export default class CliEngine { @@ -186,7 +188,7 @@ export default class CliEngine Windows understands (both) CRLF Chrome OS currently unknown */ - const data = new Uint8Array(readInfo.data); + const data = new Uint8Array(readInfo.data ?? readInfo); let validateText = ""; let sequenceCharsToSkip = 0; for (const charCode of data) {