sdk

package
v0.0.0-...-9b663ca Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//WSURL websocket服务地址
	WSURL = GetEnvStr("WS_URL", "ws://localhost:8080/ws/iot/device")
)

Functions

func GetEnvStr

func GetEnvStr(key, value string) string

GetEnvStr ..

Types

type CronJob

type CronJob struct {
	Spec string
	Cmd  func()
}

CronJob ..

type IotSDK

type IotSDK struct {
	DeviceInfo *pb.LoginReplyMsg
	// contains filtered or unexported fields
}

IotSDK IotSDK

func NewIotSDK

func NewIotSDK() *IotSDK

NewIotSDK init iot sdk

func (*IotSDK) ReplyCameraCapture

func (sdk *IotSDK) ReplyCameraCapture(subject string, ok bool)

ReplyCameraCapture ..

func (*IotSDK) Run

func (sdk *IotSDK) Run(works []func(), jobs []*CronJob, handleMsg func(iotSDK *IotSDK, msg []byte))

Run 运行iot数据采集程序

func (*IotSDK) SavePicture

func (sdk *IotSDK) SavePicture(pr PictureRequest) error

SavePicture ..

func (*IotSDK) SendPresignedURLMsg

func (sdk *IotSDK) SendPresignedURLMsg()

SendPresignedURLMsg ..

func (*IotSDK) SetDeviceAttributes

func (sdk *IotSDK) SetDeviceAttributes(attributeMap map[uint32]string)

SetDeviceAttributes set device attributes

func (*IotSDK) SetDeviceTelemetries

func (sdk *IotSDK) SetDeviceTelemetries(telemetryMap map[uint32]float64, now *timestamppb.Timestamp)

SetDeviceTelemetries upload device telemetries

type PictureRequest

type PictureRequest struct {
	RequestURL      string
	OssPrefix       string
	SecureOssPrefix string
	Picture         []byte
}

PictureRequest ..

Jump to

Keyboard shortcuts

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