File tree Expand file tree Collapse file tree 4 files changed +27
-2
lines changed Expand file tree Collapse file tree 4 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 105105 "message" : " Set connection timeout to allow longer initialisation on device plugin or reboot" ,
106106 "description" : " Change timeout on auto-connect and reboot so the bus has more time to initialize after being detected by the system"
107107 },
108+ "showAllSerialDevices" : {
109+ "message" : " Show all serial devices (for manufacturers or development)" ,
110+ "description" : " Do not filter serial devices using VID/PID values (for manufacturers or development)"
111+ },
108112 "cordovaForceComputerUI" : {
109113 "message" : " Use computers interface instead of phones interface"
110114 },
Original file line number Diff line number Diff line change @@ -270,10 +270,13 @@ const serial = {
270270
271271 chrome . serial . getDevices ( function ( devices_array ) {
272272 const devices = [ ] ;
273+ let showAllSerialDevices = false ;
274+
273275 devices_array . forEach ( function ( device ) {
274- const isFC = self . serialDevices . some ( el => el . vendorId === device . vendorId ) && self . serialDevices . some ( el => el . productId === device . productId ) ;
276+ ConfigStorage . get ( 'showAllSerialDevices' , res => showAllSerialDevices = res . showAllSerialDevices ) ;
277+ const isKnownSerialDevice = self . serialDevices . some ( el => el . vendorId === device . vendorId ) && self . serialDevices . some ( el => el . productId === device . productId ) ;
275278
276- if ( isFC ) {
279+ if ( isKnownSerialDevice || showAllSerialDevices ) {
277280 devices . push ( {
278281 path : device . path ,
279282 displayName : device . displayName ,
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ options.initialize = function (callback) {
1515 TABS . options . initAnalyticsOptOut ( ) ;
1616 TABS . options . initCliAutoComplete ( ) ;
1717 TABS . options . initAutoConnectConnectionTimeout ( ) ;
18+ TABS . options . initShowAllSerialDevices ( ) ;
1819 TABS . options . initCordovaForceComputerUI ( ) ;
1920 TABS . options . initDarkTheme ( ) ;
2021
@@ -133,6 +134,17 @@ options.initAutoConnectConnectionTimeout = function () {
133134 } ) ;
134135} ;
135136
137+ options . initShowAllSerialDevices = function ( ) {
138+ const showAllSerialDevicesElement = $ ( 'div.showAllSerialDevices input' ) ;
139+ ConfigStorage . get ( 'showAllSerialDevices' , result => {
140+ showAllSerialDevicesElement
141+ . prop ( 'checked' , ! ! result . showAllSerialDevices )
142+ . on ( 'change' , ( ) => ConfigStorage . set ( { showAllSerialDevices : showAllSerialDevicesElement . is ( ':checked' ) } ) )
143+ . trigger ( 'change' ) ;
144+ } ) ;
145+
146+ } ;
147+
136148options . initCordovaForceComputerUI = function ( ) {
137149 if ( GUI . isCordova ( ) && cordovaUI . canChangeUI ) {
138150 ConfigStorage . get ( 'cordovaForceComputerUI' , function ( result ) {
Original file line number Diff line number Diff line change 4646 </ select >
4747 < span i18n ="connectionTimeout "> </ span >
4848 </ div >
49+ < div class ="showAllSerialDevices margin-bottom ">
50+ < div >
51+ < input type ="checkbox " class ="toggle " />
52+ </ div >
53+ < span class ="freelabel " i18n ="showAllSerialDevices "> </ span >
54+ </ div >
4955 < div class ="cordovaForceComputerUI margin-bottom ">
5056 < div >
5157 < input type ="checkbox " class ="toggle " />
You can’t perform that action at this time.
0 commit comments