@@ -4,11 +4,11 @@ import { serial } from "./serial.js";
44import WEBUSBDFU from "./protocols/webusbdfu" ;
55import { reactive } from "vue" ;
66import {
7- checkBrowserCompatibility ,
8- checkWebBluetoothSupport ,
9- checkWebSerialSupport ,
10- checkWebUSBSupport ,
11- } from "./utils/checkBrowserCompatibility .js" ;
7+ checkCompatibility ,
8+ checkBluetoothSupport ,
9+ checkSerialSupport ,
10+ checkUsbSupport ,
11+ } from "./utils/checkCompatibility .js" ;
1212
1313const DEFAULT_PORT = "noselection" ;
1414const DEFAULT_BAUDS = 115200 ;
@@ -34,11 +34,11 @@ const PortHandler = new (function () {
3434 this . dfuAvailable = false ;
3535 this . portAvailable = false ;
3636
37- checkBrowserCompatibility ( ) ;
37+ checkCompatibility ( ) ;
3838
39- this . showBluetoothOption = checkWebBluetoothSupport ( ) ;
40- this . showSerialOption = checkWebSerialSupport ( ) ;
41- this . showUsbOption = checkWebUSBSupport ( ) ;
39+ this . showBluetoothOption = checkBluetoothSupport ( ) ;
40+ this . showSerialOption = checkSerialSupport ( ) ;
41+ this . showUsbOption = checkUsbSupport ( ) ;
4242
4343 console . log ( `${ this . logHead } Bluetooth available: ${ this . showBluetoothOption } ` ) ;
4444 console . log ( `${ this . logHead } Serial available: ${ this . showSerialOption } ` ) ;
@@ -51,7 +51,7 @@ const PortHandler = new (function () {
5151
5252PortHandler . initialize = function ( ) {
5353 EventBus . $on ( "ports-input:request-permission-bluetooth" , ( ) => this . requestDevicePermission ( "webbluetooth" ) ) ;
54- EventBus . $on ( "ports-input:request-permission-serial" , ( ) => this . requestDevicePermission ( "webserial " ) ) ;
54+ EventBus . $on ( "ports-input:request-permission-serial" , ( ) => this . requestDevicePermission ( "serial " ) ) ;
5555 EventBus . $on ( "ports-input:request-permission-usb" , ( ) => this . requestDevicePermission ( "usb" ) ) ;
5656 EventBus . $on ( "ports-input:change" , this . onChangeSelectedPort . bind ( this ) ) ;
5757
@@ -62,7 +62,7 @@ PortHandler.initialize = function () {
6262 if ( detail ?. path ?. startsWith ( "bluetooth" ) ) {
6363 this . handleDeviceAdded ( detail , "webbluetooth" ) ;
6464 } else {
65- this . handleDeviceAdded ( detail , "webserial " ) ;
65+ this . handleDeviceAdded ( detail , "serial " ) ;
6666 }
6767 } ) ;
6868
@@ -81,7 +81,7 @@ PortHandler.initialize = function () {
8181PortHandler . refreshAllDeviceLists = async function ( ) {
8282 // Update all device lists in parallel
8383 return Promise . all ( [
84- this . updateDeviceList ( "webserial " ) ,
84+ this . updateDeviceList ( "serial " ) ,
8585 this . updateDeviceList ( "webbluetooth" ) ,
8686 this . updateDeviceList ( "usb" ) ,
8787 ] ) . then ( ( ) => {
@@ -112,7 +112,7 @@ PortHandler.removedSerialDevice = function (device) {
112112 if ( ! devicePath ) {
113113 console . warn ( `${ this . logHead } Device removal event missing path information` , device ) ;
114114 // Still update ports, but don't try to use the undefined path
115- this . updateDeviceList ( "webserial " ) . then ( ( ) => {
115+ this . updateDeviceList ( "serial " ) . then ( ( ) => {
116116 this . selectActivePort ( ) ;
117117 } ) ;
118118 return ;
@@ -121,7 +121,7 @@ PortHandler.removedSerialDevice = function (device) {
121121 // Update the appropriate ports list based on the device type
122122 const updatePromise = devicePath . startsWith ( "bluetooth" )
123123 ? this . updateDeviceList ( "webbluetooth" )
124- : this . updateDeviceList ( "webserial " ) ;
124+ : this . updateDeviceList ( "serial " ) ;
125125
126126 const wasSelectedPort = this . portPicker . selectedPort === devicePath ;
127127
@@ -274,7 +274,7 @@ PortHandler.handleDeviceAdded = function (device, deviceType) {
274274
275275 // Update the appropriate device list
276276 const updatePromise =
277- deviceType === "webbluetooth" ? this . updateDeviceList ( "webbluetooth" ) : this . updateDeviceList ( "webserial " ) ;
277+ deviceType === "webbluetooth" ? this . updateDeviceList ( "webbluetooth" ) : this . updateDeviceList ( "serial " ) ;
278278
279279 updatePromise . then ( ( ) => {
280280 const selectedPort = this . selectActivePort ( device ) ;
@@ -305,9 +305,9 @@ PortHandler.updateDeviceList = async function (deviceType) {
305305 ports = await WEBUSBDFU . getDevices ( ) ;
306306 }
307307 break ;
308- case "webserial " :
308+ case "serial " :
309309 if ( this . showSerialOption ) {
310- ports = await serial . getDevices ( "webserial " ) ;
310+ ports = await serial . getDevices ( "serial " ) ;
311311 }
312312 break ;
313313 default :
@@ -330,7 +330,7 @@ PortHandler.updateDeviceList = async function (deviceType) {
330330 this . currentUsbPorts = [ ...orderedPorts ] ;
331331 console . log ( `${ this . logHead } Found DFU port(s)` , orderedPorts ) ;
332332 break ;
333- case "webserial " :
333+ case "serial " :
334334 this . portAvailable = orderedPorts . length > 0 ;
335335 this . currentSerialPorts = [ ...orderedPorts ] ;
336336 console . log ( `${ this . logHead } Found serial port(s)` , orderedPorts ) ;
0 commit comments