message

package
v0.0.0-...-0e7d11b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CmdTypeKeepalive = "Keepalive"
	CmdTypeCatalog   = "Catalog"
)
View Source
const EncodeGB2312 = "GB2312"
View Source
const EncodeUTF8 = "UTF-8"
View Source
const Header = `<?xml version="1.0" encoding="%s"?>` + "\n"
View Source
const MANSCDP = "Application/MANSCDP+xml"
View Source
const SDP = "application/sdp"

Variables

This section is empty.

Functions

func GenBranch

func GenBranch() string

IETF RFC3261 这个branch参数的值必须用”z9hG4bK”打头

func Marshal

func Marshal(v interface{}) []byte

* 必须换行,Indent设置换行无效 <?xml version="1.0" encoding="GB2312"?> <Query> <CmdType>Catalog</CmdType> <SN>1745</SN> <DeviceID>34020000001310000001</DeviceID> </Query>

func SsrcTostreamId

func SsrcTostreamId(ssrc string) string

zlm接收到的ssrc为16进制。发起请求的ssrc为10进制

func StatusMap

func StatusMap(s string) uint8

ON、OFF

func Unmarshal

func Unmarshal(payload []byte, v interface{}) error

Types

type CatalogResponse

type CatalogResponse struct {
	XMLName xml.Name `xml:"Response"`
	Payload
	SumNum     string
	DeviceList struct {
		Channels []Channel `xml:"Item"`
	} `xml:"DeviceList"`
}

下级SIP发送的设备信息

type Channel

type Channel struct {
	DeviceID     string
	Name         string
	Manufacturer string
	Model        string
	Owner        string
	CivilCode    string
	Address      string
	Parental     string
	ParentID     string
	RegisterWay  string
	Secrecy      int
	StreamNum    int
	IPAddress    string
	Status       string
	Info         Channelnfo
}

type Channelnfo

type Channelnfo struct {
	PTZType       int8
	DownloadSpeed string
}

type Keepalive

type Keepalive struct {
	Payload
	Status string `xml:"Status"`
}

type Payload

type Payload struct {
	CmdType  string `xml:"CmdType"`
	SN       string `xml:"SN"`
	DeviceID string `xml:"DeviceID"`
}

type PlayReq

type PlayReq struct {
	DeviceId  string
	ChannelId string
	Addr      string
	Port      uint16
}

请求实时播放

type Query

type Query struct {
	XMLName xml.Name `xml:"Query"`
	Payload
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL