47 lines
1.1 KiB
Go
47 lines
1.1 KiB
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
|
|
"joylink.club/bj-rtsts-server/config"
|
|
"joylink.club/bj-rtsts-server/third_party/example/rssp/ci"
|
|
"joylink.club/bj-rtsts-server/third_party/message"
|
|
)
|
|
|
|
func main() {
|
|
// message.InitRsspCrcTable()
|
|
ci.InitCiServerCodePoints()
|
|
//
|
|
cfg := &config.RsspAxleConfig{}
|
|
cfg.City = "北京"
|
|
cfg.LineId = "12"
|
|
cfg.CentralizedStation = "酒仙桥"
|
|
cfg.RsspCfg.SrcAddr = 0x01
|
|
cfg.RsspCfg.DstAddr = 0x02
|
|
cfg.RsspCfg.DataVer1 = 0x0011
|
|
cfg.RsspCfg.DataVer2 = 0x0012
|
|
cfg.RsspCfg.SID1 = 0x10000000
|
|
cfg.RsspCfg.SID2 = 0x00000001
|
|
cfg.RsspCfg.SINIT1 = 0x01
|
|
cfg.RsspCfg.SINIT2 = 0x02
|
|
cfg.RsspCfg.SendingPeriod = 500
|
|
cfg.RsspCfg.SsrRsspTimeout = 3
|
|
cfg.RsspCfg.Mtv = 3
|
|
cfg.RsspCfg.DeviceA = true
|
|
cfg.RsspCfg.PicType = message.PIC_MASTER
|
|
cfg.RsspCfg.RemoteIp = "192.168.3.5"
|
|
cfg.RsspCfg.RemoteUdpPort = 6666
|
|
cfg.RsspCfg.LocalUdpPort = 7777
|
|
//
|
|
ciServer := ci.NewRsspCiServer(cfg)
|
|
ciServer.Start()
|
|
fmt.Println("==>>ci server ...")
|
|
for {
|
|
time.Sleep(2 * time.Second)
|
|
ciServer.SendSectionReset("北京_12_酒仙桥_9G", true, false)
|
|
}
|
|
//
|
|
time.Sleep(3600 * time.Second)
|
|
}
|