123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- package psmodel
- const (
- PS_SOURCE_CENTER = 0x00
- PS_SOURCE_GUI = 0x01
- PS_SOURCE_ALARM = 0x02
- )
- const (
- PS_FRAME_MIN_LEN = 17
- PS_FRAME_MCPA_PAYLOAD_LEN = 260
- PS_FRAME_MCPB_PAYLOAD_LEN = 264
- PS_FRAME_MAX_LEN = 562
- PS_MCP_A_DATA_LEN = 64
- PS_MCP_B_DATA_LEN = 256
- PS_AP_END_FLAG = 0x7E
- )
- type AP_HEAD_T struct {
- StartFlag uint8 `json:"start_flag"`
- }
- type VP_HEAD_T struct {
- ProjectID int `json:"project_id"`
- PacketNo uint8 `json:"packet_no"`
- DeviceID int `json:"device_id"`
- VpFlag uint8 `json:"vp_flag"`
- McpType uint8 `json:"mcp_type"`
- }
- const (
- VP_RESP = 0x01
- VP_CMMD = 0x80
- )
- type MCP_HEAD_T struct {
- Comd uint8
- Resp uint8
- }
- const (
- MCP_A = 0x01
- MCP_B = 0x02
- )
- const (
- MCP_A_REPORT = 0x01
- MCP_A_QUERY = 0x02
- MCP_A_CONFIGURE = 0x03
- )
- const (
- MCP_B_CONTROL = 0x80
- MCP_B_FILE_TRANSFER = 0x81
- )
- const (
- MCP_RESP_SUCC = 0x01
- MCP_RESP_ERR = 0x02
- MCP_CMD = 0xFF
- )
- type LTV_T struct {
- Len uint16 `json:"len"`
- Tag uint16 `json:"tag"`
- AbyData [PS_MCP_A_DATA_LEN]uint8 `json:"aby_data"`
- }
- type LTV_B_T struct {
- Len uint16 `json:"len"`
- Tag uint16 `json:"tag"`
- AbyData [PS_MCP_B_DATA_LEN]uint8 `json:"aby_data"`
- }
- type PS_HEAD_T struct {
- StApHead AP_HEAD_T `json:"st_ap_head"`
- StVpHead VP_HEAD_T `json:"st_vp_head"`
- StMcpHead MCP_HEAD_T `json:"st_mcp_head"`
- }
- type PS_TAIL_T struct {
- Crc uint16 `json:"crc"`
- StopFlag uint8 `json:"stop_flag"`
- }
|