@@ -255,7 +255,7 @@ private static void WriteEeprom() {
255255 string mode = Args [ 0 ] ;
256256 string filePath = Args . Length >= 4 ? Args [ 3 ] : "" ;
257257 bool silent = Args . Length >= 5 && Args [ 4 ] == "/silent" ;
258- byte i2CAddress = ( byte ) Int32 . Parse ( Args [ 2 ] ) ;
258+ byte i2CAddress = ( byte ) int . Parse ( Args [ 2 ] ) ;
259259
260260 if ( filePath . Length < 1 ) {
261261 throw new Exception ( "File path is mandatory for write mode." ) ;
@@ -325,7 +325,7 @@ private static void WriteEeprom() {
325325 private static void ReadEeprom ( ) {
326326 string filePath = Args . Length >= 4 ? Args [ 3 ] : "" ;
327327 bool silent = Args . Length >= 5 && Args [ 4 ] == "/silent" ;
328- byte i2CAddress = ( byte ) Int32 . Parse ( Args [ 2 ] ) ;
328+ byte i2CAddress = ( byte ) int . Parse ( Args [ 2 ] ) ;
329329 byte [ ] spdDump = new byte [ 0 ] ;
330330 string name ;
331331
@@ -354,7 +354,7 @@ private static void ReadEeprom() {
354354 }
355355 else {
356356 spdDump = new byte [ Smbus . MaxSpdSize ] ;
357- Smbus . BusNumber = ( byte ) Int32 . Parse ( Args [ 1 ] ) ;
357+ Smbus . BusNumber = ( byte ) int . Parse ( Args [ 1 ] ) ;
358358 Smbus . I2CAddress = i2CAddress ;
359359 name = $ "{ Smbus } ({ Smbus . BusNumber } )";
360360
@@ -417,7 +417,7 @@ private static void EnableRswp() {
417417
418418 if ( Args . Length == 3 ) { // Block # was specified
419419 try {
420- block = new [ ] { Int32 . Parse ( Args [ 2 ] ) } ;
420+ block = new [ ] { int . Parse ( Args [ 2 ] ) } ;
421421 }
422422 catch {
423423 throw new Exception ( "Block number should be specified in decimal notation." ) ;
@@ -467,7 +467,7 @@ private static void ScanDevice() {
467467 }
468468 else {
469469 int i = - 1 ;
470- Int32 . TryParse ( Args [ 1 ] , out i ) ;
470+ int . TryParse ( Args [ 1 ] , out i ) ;
471471 if ( i != - 1 ) {
472472 addresses = Smbus . Scan ( ) ;
473473 }
@@ -506,8 +506,7 @@ private static void Connect() {
506506
507507 // Check FW version
508508 string firmwareFile = Data . BytesToString ( Data . Gzip ( Resources . Firmware . SpdReaderWriter_ino , Data . GzipMethod . Decompress ) ) ;
509- if ( Reader . GetFirmwareVersion ( ) <
510- Int32 . Parse ( firmwareFile . Split ( new string [ ] { "#define VERSION " } , StringSplitOptions . None ) [ 1 ] . Split ( ' ' ) [ 0 ] . Trim ( ) ) ) {
509+ if ( Reader . GetFirmwareVersion ( ) < Arduino . IncludedFirmwareVersion ) {
511510 throw new Exception ( $ "The device on port { portName } requires its firmware to be updated.") ;
512511 }
513512
@@ -541,7 +540,7 @@ private static void FindDevice() {
541540 /// Looks for Arduino devices
542541 /// </summary>
543542 private static void FindArduino ( ) {
544- string [ ] devices = new Arduino ( ReaderSettings ) . Find ( ) ;
543+ string [ ] devices = Arduino . Find ( ReaderSettings ) ;
545544 if ( devices . Length > 0 ) {
546545 foreach ( string portName in devices ) {
547546 Console . WriteLine ( $ "Found Arduino on Serial Port: { portName } \n ") ;
0 commit comments