File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,7 +67,11 @@ abstract class Connection {
6767 abstract disconnect ( ) : Promise < void > ;
6868 abstract isConnected ( ) : boolean ;
6969
70- isNanoXRP ( ) : boolean { return false ; }
70+ private _isNanoXRP : boolean = false ;
71+
72+ isNanoXRP ( ) : boolean { return this . _isNanoXRP ; }
73+
74+ setNanoXRP ( val : boolean ) : void { this . _isNanoXRP = val ; }
7175
7276 /**
7377 * HandleEsc
Original file line number Diff line number Diff line change @@ -263,15 +263,6 @@ export class USBConnection extends Connection {
263263 return this . connectionStates === ConnectionState . Connected ;
264264 }
265265
266- public isNanoXRP ( ) : boolean {
267- if ( this . port ) {
268- const info = this . port . getInfo ( ) ;
269- return info . usbProductId === this . USB_PRODUCT_ID_NANOXRP &&
270- info . usbVendorId === this . USB_VENDOR_ID_NANOXRP ;
271- }
272- return false ;
273- }
274-
275266 /**
276267 * connection - creates an async connection and return result via promise
277268 */
Original file line number Diff line number Diff line change @@ -227,7 +227,8 @@ export class CommandToXRPMgr {
227227 this . PROCESSOR = 2350 ;
228228 } else if ( hiddenLines [ 1 ] . includes ( 'RP2040' ) ) {
229229 this . PROCESSOR = 2040 ;
230- this . is_NanoXRP = this . connection ?. isNanoXRP ( ) ?? false ;
230+ this . is_NanoXRP = hiddenLines [ 1 ] . includes ( 'NanoXRP' ) ;
231+ this . connection ?. setNanoXRP ( this . is_NanoXRP ) ;
231232 }
232233 }
233234 if ( hiddenLines [ 1 ] . includes ( 'XRP' ) ) { //is this an XRP version of microPython?
@@ -253,7 +254,8 @@ export class CommandToXRPMgr {
253254 this . lastRun = undefined ;
254255 this . HAS_MICROPYTHON = true ; // this is set after connection is successful
255256 this . is_NanoXRP = false ;
256-
257+ this . connection ?. setNanoXRP ( false ) ;
258+
257259 //get version information from the XRP
258260 const info = await this . getVersionInfo ( ) ;
259261
You can’t perform that action at this time.
0 commit comments