初始
This commit is contained in:
26
api/video_hat/ws_map.go
Normal file
26
api/video_hat/ws_map.go
Normal file
@ -0,0 +1,26 @@
|
||||
package video_hat
|
||||
|
||||
import (
|
||||
"github.com/tiger1103/gfast/v3/api/video_hat/ws2"
|
||||
)
|
||||
|
||||
type CommandHandler func(json string)
|
||||
|
||||
type SpecialCommandHandler func(json string) (interface{}, error)
|
||||
|
||||
var commandHandlers = map[string]CommandHandler{}
|
||||
|
||||
// 初始化对应函数处理的方法
|
||||
func InitWsMap() {
|
||||
commandHandlers[MALOGIN] = ws2.HandleLogin // 注册处理登录的函数【需要定义一个请求一个响应】
|
||||
commandHandlers[MAGETACTIVEDEVICES] = ws2.HandleLocation // 注册实时数据心跳的函数【需要定义一个请求一个响应】
|
||||
commandHandlers[MAOPENRTSP] = ws2.HandleDeviceEnablesPushFlow // 注册长链接发送报文指定设备开启推流
|
||||
commandHandlers[SERVERPUSHCASIPSOS] = ws2.HandlePushCaSipSos // 接收设备主动sos报警
|
||||
commandHandlers[MASTOPRTSP] = ws2.HandStopPush // 停止推流
|
||||
}
|
||||
|
||||
const MALOGIN = "ma_login" // 登录
|
||||
const MAGETACTIVEDEVICES = "ma_get_active_devices" // 获取实时、状态等心跳包
|
||||
const MAOPENRTSP = "ma_open_rtsp" // 长链接发送报文指定设备开启推流
|
||||
const SERVERPUSHCASIPSOS = "server_push_ca_sip_sos" // 接收设备主动sos报警
|
||||
const MASTOPRTSP = "ma_stop_rtsp" // 停止推流
|
Reference in New Issue
Block a user