19 lines
396 B
Go
19 lines
396 B
Go
package electrical_machinery
|
|
|
|
import (
|
|
"fmt"
|
|
"joylink.club/bj-rtsts-server/third_party/message"
|
|
"joylink.club/bj-rtsts-server/third_party/udp"
|
|
"testing"
|
|
)
|
|
|
|
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)
|
|
}
|