From c688f083caf965cd13f640098ad204d8fd8c9e69 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期二, 19 十二月 2023 17:21:01 +0800
Subject: [PATCH] 接收字节序参数
---
constvar/const.go | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/constvar/const.go b/constvar/const.go
index 152d582..d92819b 100644
--- a/constvar/const.go
+++ b/constvar/const.go
@@ -20,6 +20,18 @@
PlcStartAddressTypeTotalNumberWrite PlcStartAddressType = 3
)
+type EndianType string
+
+const (
+ EndianTypeBig EndianType = "big"
+ EndianTypeLittle EndianType = "little"
+ EndianTypeMix EndianType = "mix"
+)
+
+func (t EndianType) Valid() bool {
+ return t == EndianTypeBig || t == EndianTypeLittle || t == EndianTypeMix
+}
+
type PlcStartAddressValueType string
const (
--
Gitblit v1.8.0