Documentation ¶
Index ¶
- Constants
- func AddHeader(cmd CMD, sid uint32, body []byte) (data []byte, err error)
- func DecryptBodyData(headerData, encryptBodyData []byte, cry *Encrypt) (data []byte, err error)
- func EncodeRespBody(base *RespBase) (data []byte)
- func FirmwareUpdateRespToData(firmwareUpdateResp *FirmwareUpdateResp) (data []byte, err error)
- func FirmwareUpdateToData(data []byte) (rData [][]byte, rLens []int, err error)
- func GenKeyData(mac []byte) (en []byte)
- func GetAesKeyAndAesIV(keyData []byte) (AesKey, AesIV []byte, err error)
- type CMD
- type CamDetected
- type CamDetectedConst
- type CamDetectedConstV2
- type CamDetectedLAN
- type CamDetectedLANConst
- type CamDetectedV2
- type CheckVersionResp
- type Data0To6GUpload
- type Data0To6GUploadConst
- type Encrypt
- type ErrType
- type Error
- type FirmwareUpdate
- type FirmwareUpdateResp
- type Header
- type Header16
- type HeaderAll
- type Login
- type RespBase
- type WifiInfoStart
- type WifiInfoStartBase
- type WifiInfoStartResp
- type WifiInfoUpdate
- type WifiInfoUpdateResp
- type WifiInfoUpdateRespStatus
- type WifiInfoUpdateUnit
- type WifiInfoUpdateUnitAP
- type WifiInfoUpdateUnitAPConst
- type WifiInfoUpdateUnitBase
- type WifiInfoUpdateUnitBegin
- type WifiInfoUpdateUnitEnd
- type WifiInfoUpdateUnitProbe
- type WifiInfoUpdateUnitRssi
- type WifiInfoUpdateUnitRssiAndStream
- type WifiInfoUpdateUnitRssiAndStreamOne
- type WifiInfoUpdateUnitRssiOne
- type WifiInfoUpdateUnitSTA
- type WifiInfoUpdateUnitStream
- type WifiInfoUpdateUnitStreamOne
- type WirelessRange
- type WirelessScanBegin
- type WirelessScanEnd
- type WirelessScanRangeSet
- type WirelessScanTypeSet
- type WirelessScanUpload
- type WirelessScanUploadOne
- type WirelessType
Constants ¶
View Source
const ( CMDAESKey CMD = 99 CMDLoginResp = -CMDLogin CMDHeartbeatResp = -CMDHeartbeat CMDLogoutResp = -CMDLogout CMDStopDetectResp = -CMDStopDetect CMDSetDetectPeriodResp = -CMDSetDetectPeriod CMDCamDetectedResp = -CMDCamDetected CMDDetectDataUploadResp = -CMDDetectDataUpload CMDWirelessSignalReportingResp = -CMDWirelessSignalReporting CMDWifiDetectedResp = -CMDWifiDetected CMDFirmwareUpdateResp = -CMDFirmwareUpdate CMDCheckVersionResp = -CMDCheckVersion CMDCamDetectedLANResp = -CMDCamDetectedLAN CMDCamDetectedV2Resp = -CMDCamDetectedV2 CMDWifiInfoStartResp = -CMDWifiInfoStart CMDWifiInfoUpdateResp = -CMDWifiInfoUpdate CMDWirelessScanTypeSetResp = -CMDWirelessScanTypeSet CMDWirelessScanRangeSetResp = -CMDWirelessScanRangeSet CMDWirelessScanBeginResp = -CMDWirelessScanBegin CMDWirelessScanEndResp = -CMDWirelessScanEnd CMDWirelessScanUploadResp = -CMDWirelessScanUpload )
View Source
const HeaderLen = 16
Variables ¶
This section is empty.
Functions ¶
func DecryptBodyData ¶
func EncodeRespBody ¶
func FirmwareUpdateRespToData ¶
func FirmwareUpdateRespToData(firmwareUpdateResp *FirmwareUpdateResp) (data []byte, err error)
func FirmwareUpdateToData ¶
func GenKeyData ¶
func GetAesKeyAndAesIV ¶
Types ¶
type CMD ¶
type CMD int16
const ( CMDErr CMD = iota CMDLogin CMDHeartbeat CMDLogout CMDStopDetect CMDSetDetectPeriod CMDCamDetected CMDDetectDataUpload CMDWirelessSignalReporting CMDWifiDetected CMDFirmwareUpdate CMDCheckVersion CMDCamDetectedLAN CMDCamDetectedV2 CMDWifiInfoStart CMDWifiInfoUpdate CMDWirelessScanTypeSet CMDWirelessScanRangeSet CMDWirelessScanBegin CMDWirelessScanEnd CMDWirelessScanUpload )
type CamDetected ¶
type CamDetected struct { CamDetectedConst SSID []uint8 }
func CamDetectedFromData ¶
func CamDetectedFromData(data []byte) (camDetected *CamDetected, err error)
type CamDetectedConst ¶
type CamDetectedConstV2 ¶
type CamDetectedConstV2 struct { Mac [6]uint8 ApIssi int8 Type uint8 Channel uint8 SecondChannel uint8 CamType uint8 //1: 是摄像头 LinkCnt uint8 Rev [16]uint8 SSIDLen uint8 }
func (CamDetectedConstV2) GetMac ¶
func (c CamDetectedConstV2) GetMac(split string) (mac string)
type CamDetectedLAN ¶
type CamDetectedLAN struct { CamDetectedLANConst Describe []uint8 }
func CamDetectedLANFromData ¶
func CamDetectedLANFromData(data []byte) (camDetectedLAN *CamDetectedLAN, err error)
type CamDetectedLANConst ¶
type CamDetectedV2 ¶
type CamDetectedV2 struct { CamDetectedConstV2 SSID []uint8 }
func CamDetectedV2FromData ¶
func CamDetectedV2FromData(data []byte) (camDetected *CamDetectedV2, err error)
func (*CamDetectedV2) ToBytes ¶
func (c *CamDetectedV2) ToBytes() (data []byte)
type CheckVersionResp ¶
type CheckVersionResp struct { HardwareMajor int8 HardwareMinor int8 FirmwareMajor int8 FirmwareMinor int8 FirmwareBuild int16 }
func CheckVersionRespFromData ¶
func CheckVersionRespFromData(data []byte) (checkVersionResp *CheckVersionResp, err error)
func (*CheckVersionResp) Firmware ¶
func (c *CheckVersionResp) Firmware() string
func (*CheckVersionResp) Hardware ¶
func (c *CheckVersionResp) Hardware() string
func (*CheckVersionResp) ToData ¶
func (c *CheckVersionResp) ToData() (data []byte)
type Data0To6GUpload ¶
type Data0To6GUpload struct { Data0To6GUploadConst PowerData []uint8 // 强度数据 }
func (*Data0To6GUpload) Parse ¶
func (d *Data0To6GUpload) Parse(data []byte) (err error)
type Data0To6GUploadConst ¶
type FirmwareUpdate ¶
func FirmwareUpdateFromData ¶
func FirmwareUpdateFromData(data []byte) (firmwareUpdate *FirmwareUpdate, data_ []byte, err error)
type FirmwareUpdateResp ¶
func FirmwareUpdateRespFromData ¶
func FirmwareUpdateRespFromData(data []byte) (firmwareUpdateResp *FirmwareUpdateResp, err error)
type WifiInfoStart ¶
type WifiInfoStart struct { WifiInfoStartBase Macs [][]byte }
func (*WifiInfoStart) ToBytes ¶
func (w *WifiInfoStart) ToBytes() (data []byte)
type WifiInfoStartBase ¶
type WifiInfoStartResp ¶
type WifiInfoStartResp struct {
Cnt int8
}
func (*WifiInfoStartResp) Parse ¶
func (w *WifiInfoStartResp) Parse(data []byte) (err error)
type WifiInfoUpdate ¶
type WifiInfoUpdate struct { MapNum int16 Units []WifiInfoUpdateUnit CRC16 int16 }
func (*WifiInfoUpdate) Parse ¶
func (w *WifiInfoUpdate) Parse(data []byte) (err error)
type WifiInfoUpdateResp ¶
type WifiInfoUpdateResp struct {
Status WifiInfoUpdateRespStatus
}
func NewWifiInfoUpdateResp ¶
func NewWifiInfoUpdateResp(status WifiInfoUpdateRespStatus) *WifiInfoUpdateResp
func (*WifiInfoUpdateResp) ToBytes ¶
func (w *WifiInfoUpdateResp) ToBytes() (data []byte)
type WifiInfoUpdateRespStatus ¶
type WifiInfoUpdateRespStatus int16
const ( WifiInfoUpdateRespStatus_Normal WifiInfoUpdateRespStatus = 0 WifiInfoUpdateRespStatus_CRCError WifiInfoUpdateRespStatus = 1 WifiInfoUpdateRespStatus_NoId WifiInfoUpdateRespStatus = 2 WifiInfoUpdateRespStatus_IDMacError WifiInfoUpdateRespStatus = 3 )
type WifiInfoUpdateUnit ¶
func NewWifiInfoUpdateUnitByData ¶
func NewWifiInfoUpdateUnitByData(r io.Reader) (w WifiInfoUpdateUnit, err error)
type WifiInfoUpdateUnitAP ¶
type WifiInfoUpdateUnitAP struct { WifiInfoUpdateUnitBase WifiInfoUpdateUnitAPConst SSID string }
type WifiInfoUpdateUnitBase ¶
type WifiInfoUpdateUnitBegin ¶
type WifiInfoUpdateUnitBegin struct {
WifiInfoUpdateUnitBase
}
type WifiInfoUpdateUnitEnd ¶
type WifiInfoUpdateUnitEnd struct {
WifiInfoUpdateUnitBase
}
type WifiInfoUpdateUnitProbe ¶
type WifiInfoUpdateUnitRssi ¶
type WifiInfoUpdateUnitRssi struct { WifiInfoUpdateUnitBase List []*WifiInfoUpdateUnitRssiOne }
type WifiInfoUpdateUnitRssiAndStream ¶
type WifiInfoUpdateUnitRssiAndStream struct { WifiInfoUpdateUnitBase List []*WifiInfoUpdateUnitRssiAndStreamOne }
type WifiInfoUpdateUnitSTA ¶
type WifiInfoUpdateUnitStream ¶
type WifiInfoUpdateUnitStream struct { WifiInfoUpdateUnitBase List []*WifiInfoUpdateUnitStreamOne }
type WirelessRange ¶
type WirelessRange int8
const ( WirelessRange_20cm WirelessRange = 1 WirelessRange_50cm WirelessRange = 2 WirelessRange_1M WirelessRange = 3 WirelessRange_3M WirelessRange = 4 WirelessRange_5M WirelessRange = 5 )
type WirelessScanBegin ¶
type WirelessScanBegin struct {
Value int8
}
func (*WirelessScanBegin) ToBytes ¶ added in v1.0.1
func (w *WirelessScanBegin) ToBytes() (data []byte)
type WirelessScanEnd ¶
type WirelessScanEnd struct {
Value int8
}
func (*WirelessScanEnd) ToBytes ¶ added in v1.0.1
func (w *WirelessScanEnd) ToBytes() (data []byte)
type WirelessScanRangeSet ¶
type WirelessScanRangeSet struct { Type WirelessType Range WirelessRange }
func (*WirelessScanRangeSet) ToBytes ¶ added in v1.0.1
func (w *WirelessScanRangeSet) ToBytes() (data []byte)
type WirelessScanTypeSet ¶
type WirelessScanTypeSet struct {
TypeList []WirelessType
}
func (*WirelessScanTypeSet) ToBytes ¶ added in v1.0.1
func (w *WirelessScanTypeSet) ToBytes() (data []byte)
type WirelessScanUpload ¶
type WirelessScanUpload struct { ScanCount int8 ScanList []*WirelessScanUploadOne }
func (*WirelessScanUpload) Parse ¶ added in v1.0.1
func (w *WirelessScanUpload) Parse(data []byte) (err error)
type WirelessScanUploadOne ¶
type WirelessScanUploadOne struct { ScanData int16 Type WirelessType Intensity int8 Info int16 DataQuantity uint16 }
func (*WirelessScanUploadOne) FlowKB ¶ added in v1.0.1
func (w *WirelessScanUploadOne) FlowKB() (kb int)
type WirelessType ¶
type WirelessType uint8
const ( WirelessType_All WirelessType = 0xFF WirelessType_CM_GSM900_1800 WirelessType = 1 WirelessType_CU_GSM900_1800 WirelessType = 2 WirelessType_CT_CDMA_2000 WirelessType = 3 WirelessType_CM_3G_TDSCDMA WirelessType = 4 WirelessType_CU_3G_WCDMA WirelessType = 5 WirelessType_CM_4GTDD_LTE WirelessType = 6 WirelessType_CU_4GFDD_LTE WirelessType = 7 WirelessType_CT_4G_FDD_LTE WirelessType = 8 WirelessType_433M_315M WirelessType = 0x09 WirelessType_WiFi_2_4G WirelessType = 0x0A WirelessType_ISM_2_4G WirelessType = 0x0B WirelessType_800M WirelessType = 0x0C )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.