26 lines
517 B
Go
26 lines
517 B
Go
package electrical_machinery
|
|
|
|
import (
|
|
"fmt"
|
|
"joylink.club/bj-rtsts-server/third_party/message"
|
|
"joylink.club/bj-rtsts-server/third_party/udp"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestServer(t *testing.T) {
|
|
udpServer := udp.NewServer(fmt.Sprintf("127.0.0.1:%d", 9999), handleCanetFrames)
|
|
udpServer.Listen()
|
|
select {}
|
|
}
|
|
func handleCanetFrames(d []byte) {
|
|
msg := &message.ElectricMachinery{}
|
|
msg.Decode(d)
|
|
}
|
|
|
|
func TestOther(t *testing.T) {
|
|
dd := 1714024680 - time.Now().Unix()
|
|
fmt.Println(dd)
|
|
fmt.Println(int32(dd))
|
|
}
|