From e6c81b3916494ef51edc21774a27402d0f16c49c Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期四, 24 八月 2023 17:21:04 +0800 Subject: [PATCH] plc配置支持serial和modbusTCP两种方式 --- constvar/const.go | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/constvar/const.go b/constvar/const.go index c64e44b..087eeb5 100644 --- a/constvar/const.go +++ b/constvar/const.go @@ -20,3 +20,14 @@ PlcAddressDataKeyFileName = "plc_address_key" PlcAddressDataValueFileName = "plc_address_value" ) + +type PlcMethod string + +const ( + PlcMethodModbusTCP PlcMethod = "modbusTCP" + PlcMethodSerial PlcMethod = "serial" +) + +func (slf PlcMethod) Valid() bool { + return slf == PlcMethodModbusTCP || slf == PlcMethodSerial +} -- Gitblit v1.8.0