feat: add a new 485 type weather station

This commit is contained in:
yarnom 2025-08-01 21:25:44 +08:00
parent 9a7d2b5f79
commit 43e71e4dd6

12
main.go
View File

@ -16,8 +16,6 @@ import (
"weatherstation/config" "weatherstation/config"
"weatherstation/model" "weatherstation/model"
"github.com/gin-gonic/gin"
) )
type UTF8Writer struct { type UTF8Writer struct {
@ -164,15 +162,7 @@ func startUDP() {
func main() { func main() {
setupLogger() setupLogger()
go startUDP() startUDP() // 直接运行UDP服务器不再使用goroutine
r := gin.Default()
r.LoadHTMLGlob("templates/*")
r.Static("/static", "static")
r.GET("/", func(c *gin.Context) {
c.HTML(200, "index.html", gin.H{})
})
r.Run(":10007")
} }
func hexDump(data []byte) string { func hexDump(data []byte) string {