diff --git a/config/etc/default/restconf.yaml b/config/etc/default/restconf.yaml index bd9e658b..cf274876 100644 --- a/config/etc/default/restconf.yaml +++ b/config/etc/default/restconf.yaml @@ -73,7 +73,7 @@ mml: port2: 5002 sleep: 200 deadLine: 10 - sizeRow: 100 + sizeRow: 600 sizeCol: 128 bufferSize: 65535 user: admin diff --git a/features/mml/mml.go b/features/mml/mml.go index 1df4fcae..04417737 100644 --- a/features/mml/mml.go +++ b/features/mml/mml.go @@ -54,8 +54,8 @@ var ( var ( TIME_DELAY_AFTER_WRITE time.Duration = 200 TIME_DEAD_LINE time.Duration = 10 - WIN_ROW_SIZE byte = 100 - WIN_COL_SIZE byte = 100 + WIN_ROW_SIZE int16 = 200 + WIN_COL_SIZE int16 = 120 BUFFER_SIZE int = 65535 ) @@ -118,9 +118,15 @@ func PostMML2ToNF(w http.ResponseWriter, r *http.Request) { // services.ResponseWithJson(w, http.StatusOK, response) // return // } + // 发送窗口大小设置命令 - 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, 251, 31}) // 发送WILL 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)) loginStr := fmt.Sprintf("%s\n%s\n", config.GetYamlConfig().MML.User, config.GetYamlConfig().MML.Password) diff --git a/restagent/config/config.go b/restagent/config/config.go index 181cbefd..59585c83 100644 --- a/restagent/config/config.go +++ b/restagent/config/config.go @@ -177,8 +177,8 @@ type MMLParam struct { Port2 int `yaml:"port2"` Sleep int64 `yaml:"sleep"` DeadLine int64 `yaml:"deadLine"` - SizeRow byte `yaml:"sizeRow"` - SizeCol byte `yaml:"sizeCol"` + SizeRow int16 `yaml:"sizeRow"` + SizeCol int16 `yaml:"sizeCol"` BufferSize int `yaml:"bufferSize"` User string `yaml:"user"` Password string `ymal:"password"` @@ -226,8 +226,8 @@ func NewYamlConfig() YamlConfig { ConnParam: "charset=utf8mb4&collation=utf8mb4_general_ci&parseTime=True&interpolateParams=True", }, MML: MMLParam{ - SizeRow: 100, - SizeCol: 128, + SizeRow: 200, + SizeCol: 120, BufferSize: 65535, }, Alarm: AlarmConfig{ diff --git a/restagent/etc/restconf-t.yaml b/restagent/etc/restconf-t.yaml index 223e2cb5..9b447119 100644 --- a/restagent/etc/restconf-t.yaml +++ b/restagent/etc/restconf-t.yaml @@ -73,7 +73,7 @@ mml: port2: 5002 sleep: 200 deadLine: 10 - sizeRow: 100 + sizeRow: 600 sizeCol: 128 bufferSize: 65535 user: admin