[chronojump] Discover can found an rfid (fast)
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Discover can found an rfid (fast)
- Date: Fri, 29 Apr 2022 18:10:55 +0000 (UTC)
commit 3b0636c3de67eec8ccd585b22aa6f3bd5d2aa0cf
Author: Xavier de Blas <xaviblas gmail com>
Date: Fri Apr 29 20:10:33 2022 +0200
Discover can found an rfid (fast)
src/execute/arduinoCapture.cs | 40 +++++++++++++++++++++++++---------------
1 file changed, 25 insertions(+), 15 deletions(-)
---
diff --git a/src/execute/arduinoCapture.cs b/src/execute/arduinoCapture.cs
index 9e228ea3b..1a026cb27 100644
--- a/src/execute/arduinoCapture.cs
+++ b/src/execute/arduinoCapture.cs
@@ -499,7 +499,6 @@ public class MicroDiscover : MicroComms
{
flush(); //after connect
if (! discoverDo115200 ())
- {
if (! discoverOldWichros ())
{
//try at 9600
@@ -511,7 +510,6 @@ public class MicroDiscover : MicroComms
discoverDo9600 ();
}
}
- }
} else
micro.Discovered = ChronopicRegisterPort.Types.UNKNOWN;
@@ -540,23 +538,35 @@ public class MicroDiscover : MicroComms
for (int i = 0; i < micro_l.Count; i ++)
{
if(! microDiscoverManage_l[i].ConnectOk)
- microDiscoverManage_l[i].Discovered = ChronopicRegisterPort.Types.UNKNOWN;
- else
{
- //wait the ms since connect
- while (! microDiscoverManage_l[i].PassedMsSinceConnect (2000))
- ;
+ microDiscoverManage_l[i].Discovered = ChronopicRegisterPort.Types.UNKNOWN;
+ micro.ClosePort (); //close even connect failed?
+ continue;
+ }
- //TODO: right now have to wait at each getVersion, improve it
- micro = micro_l[i]; //micro is the protected variable
- flush();
- if (! discoverDo115200 ())
- discoverOldWichros ();
+ //wait the ms since connect
+ while (! microDiscoverManage_l[i].PassedMsSinceConnect (2000))
+ ;
- microDiscoverManage_l[i].Discovered = micro.Discovered;
- }
+ //TODO: right now have to wait at each getVersion, improve it
+ micro = micro_l[i]; //micro is the protected variable
+ flush();
+ if (! discoverDo115200 ())
+ if (! discoverOldWichros ())
+ {
+ //try at 9600
+ micro.ClosePort ();
+ micro.Bauds = 9600;
+ if(connectAndSleep ())
+ {
+ flush(); //after connect
+ discoverDo9600 ();
+ }
+ }
- micro.ClosePort (); //close even connect failed?
+ microDiscoverManage_l[i].Discovered = micro.Discovered;
+
+ micro.ClosePort ();
discovered_l.Add(microDiscoverManage_l[i].ResultStr ());
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]