feat: add a new 485 type weather station
This commit is contained in:
parent
9a7d2b5f79
commit
43e71e4dd6
12
main.go
12
main.go
@ -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 {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user