Documentation
¶
Index ¶
- Constants
- func DumpRSAPEM(pubKey *rsa.PublicKey) (pubPEM []byte)
- func GenerateRSAKeys() (*rsa.PrivateKey, *rsa.PublicKey)
- type P100Cipher
- type P100Device
- func (d *P100Device) CheckErrorCode(errorCode int) error
- func (d *P100Device) DoRequest(payload []byte) ([]byte, error)
- func (d *P100Device) GetDeviceInfo() (*P100Status, error)
- func (d *P100Device) GetURL() string
- func (d *P100Device) Handshake() (err error)
- func (d *P100Device) Login() (err error)
- func (d *P100Device) Switch(status bool) (err error)
- type P100Status
Constants ¶
View Source
const RSABits = 1024
View Source
const Timeout = time.Second * 15
Variables ¶
This section is empty.
Functions ¶
func DumpRSAPEM ¶
func GenerateRSAKeys ¶
func GenerateRSAKeys() (*rsa.PrivateKey, *rsa.PublicKey)
Types ¶
type P100Cipher ¶
type P100Cipher struct {
// contains filtered or unexported fields
}
func (*P100Cipher) Decrypt ¶
func (c *P100Cipher) Decrypt(payload []byte) []byte
func (*P100Cipher) Encrypt ¶
func (c *P100Cipher) Encrypt(payload []byte) []byte
type P100Device ¶
type P100Device struct {
// contains filtered or unexported fields
}
func New ¶
func New(ip, email, password string) *P100Device
func (*P100Device) CheckErrorCode ¶
func (d *P100Device) CheckErrorCode(errorCode int) error
func (*P100Device) GetDeviceInfo ¶
func (d *P100Device) GetDeviceInfo() (*P100Status, error)
func (*P100Device) GetURL ¶
func (d *P100Device) GetURL() string
func (*P100Device) Handshake ¶
func (d *P100Device) Handshake() (err error)
func (*P100Device) Login ¶
func (d *P100Device) Login() (err error)
func (*P100Device) Switch ¶
func (d *P100Device) Switch(status bool) (err error)
type P100Status ¶
type P100Status struct { ErrorCode int `json:"error_code"` Result struct { DeviceID string `json:"device_id"` FWVersion string `json:"fw_ver"` HWVersion string `json:"hw_ver"` Type string `json:"type"` Model string `json:"model"` MAC string `json:"mac"` HWID string `json:"hw_id"` FWID string `json:"fw_id"` OEMID string `json:"oem_id"` Specs string `json:"specs"` DeviceON bool `json:"device_on"` OnTime int `json:"on_time"` OverHeated bool `json:"overheated"` Nickname string `json:"nickname"` Location string `json:"location"` Avatar string `json:"avatar"` Longitude int `json:"longitude"` Latitude int `json:"latitude"` HasSetLocationInfo bool `json:"has_set_location_info"` IP string `json:"ip"` SSID string `json:"ssid"` SignalLevel int `json:"signal_level"` RSSI int `json:"rssi"` Region string `json:"Europe/Kiev"` TimeDiff int `json:"time_diff"` Lang string `json:"lang"` } `json:"result"` }
Click to show internal directories.
Click to hide internal directories.