[chronojump/FS-TFT-Menu] Micro Discover finds encoder



commit cbea63ddb28b11786e7c867ad18247094c7de30b
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon May 2 10:59:33 2022 +0200

    Micro Discover finds encoder

 src/execute/arduinoCapture.cs | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
---
diff --git a/src/execute/arduinoCapture.cs b/src/execute/arduinoCapture.cs
index e119a549b..a62a5917d 100644
--- a/src/execute/arduinoCapture.cs
+++ b/src/execute/arduinoCapture.cs
@@ -491,7 +491,7 @@ public class MicroDiscover : MicroComms
        private string forceSensorStr = "Force_Sensor-";
        private string raceAnalyzerStr = "Race_Analyzer-";
        private string wichroStr = "Wifi-Controller-"; //Will be used for Wichro and Quick, then user will 
decide. "local:get_channel;" to know the channel
-       //Chronopic encoder will send a J (115200)
+       private string encoderStr = "J"; //for encoder send a J and receive a J
 
        //9600
        private string rfidStr = "YES Chronojump RFID";
@@ -635,6 +635,18 @@ public class MicroDiscover : MicroComms
                                success = true;
                        }
                }
+
+               if(! success)  //try encoder (send J, receive J)
+               {
+                       responseExpected_l = new List<string>();
+                       responseExpected_l.Add(encoderStr);
+                       if(getVersion ("J", responseExpected_l, true))
+                       {
+                               micro.Discovered = ChronopicRegisterPort.Types.ENCODER;
+                               success = true;
+                       }
+               }
+
                flush(); //empty the port for future use
                return success;
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]