fix: MML-UPF标准版5002数据行约有400+

This commit is contained in:
TsMask
2024-06-21 15:28:38 +08:00
parent e91ec1b9d2
commit a434d1003d
4 changed files with 16 additions and 10 deletions

View File

@@ -73,7 +73,7 @@ mml:
port2: 5002 port2: 5002
sleep: 200 sleep: 200
deadLine: 10 deadLine: 10
sizeRow: 100 sizeRow: 600
sizeCol: 128 sizeCol: 128
bufferSize: 65535 bufferSize: 65535
user: admin user: admin

View File

@@ -54,8 +54,8 @@ var (
var ( var (
TIME_DELAY_AFTER_WRITE time.Duration = 200 TIME_DELAY_AFTER_WRITE time.Duration = 200
TIME_DEAD_LINE time.Duration = 10 TIME_DEAD_LINE time.Duration = 10
WIN_ROW_SIZE byte = 100 WIN_ROW_SIZE int16 = 200
WIN_COL_SIZE byte = 100 WIN_COL_SIZE int16 = 120
BUFFER_SIZE int = 65535 BUFFER_SIZE int = 65535
) )
@@ -118,9 +118,15 @@ func PostMML2ToNF(w http.ResponseWriter, r *http.Request) {
// services.ResponseWithJson(w, http.StatusOK, response) // services.ResponseWithJson(w, http.StatusOK, response)
// return // return
// } // }
// 发送窗口大小设置命令 // 发送窗口大小设置命令
conn.Write([]byte{255, 251, 31}) // 发送WILL WINDOW SIZE conn.Write([]byte{255, 251, 31}) // 发送WILL WINDOW SIZE
conn.Write([]byte{255, 250, 31, 0, WIN_ROW_SIZE, 0, WIN_COL_SIZE, 255, 240}) // 发送设置 WINDOW SIZE conn.Write([]byte{
255, 250, 31,
byte(WIN_COL_SIZE >> 8), byte(WIN_COL_SIZE & 0xFF),
byte(WIN_ROW_SIZE >> 8), byte(WIN_ROW_SIZE & 0xFF),
255, 240,
}) // 发送设置 WINDOW SIZE
conn.SetDeadline(time.Now().Add(TIME_DEAD_LINE * time.Second)) conn.SetDeadline(time.Now().Add(TIME_DEAD_LINE * time.Second))
loginStr := fmt.Sprintf("%s\n%s\n", config.GetYamlConfig().MML.User, config.GetYamlConfig().MML.Password) loginStr := fmt.Sprintf("%s\n%s\n", config.GetYamlConfig().MML.User, config.GetYamlConfig().MML.Password)

View File

@@ -177,8 +177,8 @@ type MMLParam struct {
Port2 int `yaml:"port2"` Port2 int `yaml:"port2"`
Sleep int64 `yaml:"sleep"` Sleep int64 `yaml:"sleep"`
DeadLine int64 `yaml:"deadLine"` DeadLine int64 `yaml:"deadLine"`
SizeRow byte `yaml:"sizeRow"` SizeRow int16 `yaml:"sizeRow"`
SizeCol byte `yaml:"sizeCol"` SizeCol int16 `yaml:"sizeCol"`
BufferSize int `yaml:"bufferSize"` BufferSize int `yaml:"bufferSize"`
User string `yaml:"user"` User string `yaml:"user"`
Password string `ymal:"password"` Password string `ymal:"password"`
@@ -226,8 +226,8 @@ func NewYamlConfig() YamlConfig {
ConnParam: "charset=utf8mb4&collation=utf8mb4_general_ci&parseTime=True&interpolateParams=True", ConnParam: "charset=utf8mb4&collation=utf8mb4_general_ci&parseTime=True&interpolateParams=True",
}, },
MML: MMLParam{ MML: MMLParam{
SizeRow: 100, SizeRow: 200,
SizeCol: 128, SizeCol: 120,
BufferSize: 65535, BufferSize: 65535,
}, },
Alarm: AlarmConfig{ Alarm: AlarmConfig{

View File

@@ -73,7 +73,7 @@ mml:
port2: 5002 port2: 5002
sleep: 200 sleep: 200
deadLine: 10 deadLine: 10
sizeRow: 100 sizeRow: 600
sizeCol: 128 sizeCol: 128
bufferSize: 65535 bufferSize: 65535
user: admin user: admin