From 1c0e5d07d8545e5d4d86aa51422785fe7dd44961 Mon Sep 17 00:00:00 2001
From: Alessio Igor Bogani <alessio.bogani@elettra.eu>
Date: Thu, 18 Apr 2024 12:16:51 +0200
Subject: [PATCH] Port to Serial2/Socket2 version 2.x

---
 src/Agilent4uhv.cpp | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/Agilent4uhv.cpp b/src/Agilent4uhv.cpp
index 9cc7a42..f40b37e 100644
--- a/src/Agilent4uhv.cpp
+++ b/src/Agilent4uhv.cpp
@@ -261,15 +261,10 @@ void Agilent4uhv::init_device()
 		attr_Model_read[0] = new char[MAX_DEVSTRING_LENGTH];
 		attr_SerialNumber_read[0] = new char[MAX_DEVSTRING_LENGTH];
 
-		// Waiting the device
-		int retries = 0;
-		while(get_state2() == 9 && retries++ < 5) {
-			sleep(1);
-		}
-
 		/* Che if the mBar is pressure unit used */
 		int pressure_unit;
 		read_window(600, pressure_unit);
+
 		if (pressure_unit != 1) {
 			Tango::Except::throw_exception( "",
 					"mBar is not the pressure unit used",
@@ -366,7 +361,7 @@ void Agilent4uhv::init_device()
 		worker->start();
 	} catch(Tango::DevFailed &e) {
 		if (string(e.errors[0].reason) == "API_CommandNotAllowed")
-			init_error = "Initialization failed: " + get_status2();
+			init_error = "Initialization failed: " + get_status();
 		else
 			init_error = "Initialization failed: " + string(e.errors[0].desc);
 	} catch (...) {
-- 
GitLab