From d9c3fbc92d2a775674943d4ab882fbd77f0db688 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期二, 08 七月 2025 20:31:34 +0800
Subject: [PATCH] 1.增加日期时间同步功能和测试;

---
 SourceCode/Bond/Servo/HsmsPassive.cpp |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/SourceCode/Bond/Servo/HsmsPassive.cpp b/SourceCode/Bond/Servo/HsmsPassive.cpp
index 7c53585..9e4a5ab 100644
--- a/SourceCode/Bond/Servo/HsmsPassive.cpp
+++ b/SourceCode/Bond/Servo/HsmsPassive.cpp
@@ -68,11 +68,7 @@
 
 void CHsmsPassive::setListener(SECSListener listener)
 {
-	m_listener.onEQOffLine = listener.onEQOffLine;
-	m_listener.onEQOnLine = listener.onEQOnLine;
-	m_listener.onCommand = listener.onCommand;
-	m_listener.onEQConstantRequest = listener.onEQConstantRequest;
-	m_listener.onEQConstantSend = listener.onEQConstantSend;
+	m_listener = listener;
 }
 
 void CHsmsPassive::setActionTimeout(int nSecond)
@@ -623,6 +619,9 @@
 		time.wYear = atoi(&szBuffer[0]);
 		time.wMilliseconds = 0;
 		SetLocalTime(&time);
+		if (m_listener.onDatetimeSync != nullptr) {
+			m_listener.onDatetimeSync(this, time);
+		}
 	}
 
 	replyAck(2, 32, pRecv->getHeader()->systemBytes, BYTE(0), "TIACK");

--
Gitblit v1.9.3