deviceMsgEvent

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: AGPL-3.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func OtaVersionCheck

func OtaVersionCheck(ctx context.Context, svcCtx *svc.ServiceContext, msg devices.Core, version string, module string)

func ToDmDevicesBind

func ToDmDevicesBind(devices []*msgGateway.Device) (ret []*dm.DeviceGatewayBindDevice, err error)

func ToDmDevicesCore

func ToDmDevicesCore(devices []*msgGateway.Device) (ret []*dm.DeviceCore)

func ToDmDevicesInfoReq

func ToDmDevicesInfoReq(diDeviceBasicInfoDo *msgThing.DeviceBasicInfo) (dmDeviceInfoReq *dm.DeviceInfo)

Types

type ConfigLogic

type ConfigLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewConfigLogic

func NewConfigLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ConfigLogic

func (*ConfigLogic) Handle

func (l *ConfigLogic) Handle(msg *deviceMsg.PublishMsg) (respMsg *deviceMsg.PublishMsg, err error)

type ConnectedLogic

type ConnectedLogic struct {
	logx.Logger

	DiDB *relationDB.DeviceInfoRepo
	// contains filtered or unexported fields
}

func NewConnectedLogic

func NewConnectedLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ConnectedLogic

func (*ConnectedLogic) Handle

func (l *ConnectedLogic) Handle(msg *deviceStatus.ConnectMsg) error

func (*ConnectedLogic) UpdateLoginTime

func (l *ConnectedLogic) UpdateLoginTime()

type DeviceMsgHandle

type DeviceMsgHandle struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewDeviceMsgHandle

func NewDeviceMsgHandle(ctx context.Context, svcCtx *svc.ServiceContext) *DeviceMsgHandle

func (*DeviceMsgHandle) Config

func (l *DeviceMsgHandle) Config(msg *deviceMsg.PublishMsg) error

func (*DeviceMsgHandle) Connected

func (l *DeviceMsgHandle) Connected(msg *deviceStatus.ConnectMsg) error

func (*DeviceMsgHandle) Disconnected

func (l *DeviceMsgHandle) Disconnected(msg *deviceStatus.ConnectMsg) error

func (*DeviceMsgHandle) Ext

func (*DeviceMsgHandle) FixDisconnect

func (l *DeviceMsgHandle) FixDisconnect(msg *deviceMsg.PublishMsg)

func (*DeviceMsgHandle) Gateway

func (l *DeviceMsgHandle) Gateway(msg *deviceMsg.PublishMsg) error

func (*DeviceMsgHandle) Ota

func (*DeviceMsgHandle) SDKLog

func (l *DeviceMsgHandle) SDKLog(msg *deviceMsg.PublishMsg) error

func (*DeviceMsgHandle) Shadow

func (l *DeviceMsgHandle) Shadow(msg *deviceMsg.PublishMsg) error

func (*DeviceMsgHandle) Thing

func (l *DeviceMsgHandle) Thing(msg *deviceMsg.PublishMsg) error

type DisconnectedLogic

type DisconnectedLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewDisconnectedLogic

func NewDisconnectedLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DisconnectedLogic

func (*DisconnectedLogic) Handle

type ExtLogic

type ExtLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewExtLogic

func NewExtLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ExtLogic

func (*ExtLogic) DeviceResp

func (l *ExtLogic) DeviceResp(msg *deviceMsg.PublishMsg, err error, data any) *deviceMsg.PublishMsg

func (*ExtLogic) Handle

func (l *ExtLogic) Handle(msg *deviceMsg.PublishMsg) (respMsg *deviceMsg.PublishMsg, err error)

Handle for topics.DeviceUpExtAll

func (*ExtLogic) HandleGetNtpReply

func (l *ExtLogic) HandleGetNtpReply(msg *deviceMsg.PublishMsg, req msgExt.Req) (respMsg *deviceMsg.PublishMsg, err error)

ntp时间返回

func (*ExtLogic) HandleNtp

func (l *ExtLogic) HandleNtp(msg *deviceMsg.PublishMsg) (respMsg *deviceMsg.PublishMsg, err error)

ntp请求处理

type GatewayLogic

type GatewayLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewGatewayLogic

func NewGatewayLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GatewayLogic

func (*GatewayLogic) DeviceResp added in v1.0.5

func (l *GatewayLogic) DeviceResp(msg *deviceMsg.PublishMsg, err error, data any) *deviceMsg.PublishMsg

func (*GatewayLogic) Handle

func (l *GatewayLogic) Handle(msg *deviceMsg.PublishMsg) (respMsg *deviceMsg.PublishMsg, err error)

func (*GatewayLogic) HandleCreateSchema added in v1.0.5

func (l *GatewayLogic) HandleCreateSchema(msg *deviceMsg.PublishMsg, resp *msgGateway.Msg) (respMsg *msgGateway.Msg, err error)

func (*GatewayLogic) HandleDeleteSchema added in v1.0.5

func (l *GatewayLogic) HandleDeleteSchema(msg *deviceMsg.PublishMsg, resp *msgGateway.Msg) (respMsg *msgGateway.Msg, err error)

func (*GatewayLogic) HandlePropertyGetSchema added in v1.0.5

func (l *GatewayLogic) HandlePropertyGetSchema(msg *deviceMsg.PublishMsg, resp *msgGateway.Msg) (respMsg *msgGateway.Msg, err error)

func (*GatewayLogic) HandleRegister

func (l *GatewayLogic) HandleRegister(msg *deviceMsg.PublishMsg, resp *msgGateway.Msg) (respMsg *msgGateway.Msg, err error)

func (*GatewayLogic) HandleStatus

func (l *GatewayLogic) HandleStatus(msg *deviceMsg.PublishMsg) (respMsg *msgGateway.Msg, err error)

func (*GatewayLogic) HandleThing added in v1.0.5

func (l *GatewayLogic) HandleThing(msg *deviceMsg.PublishMsg) (respMsg *msgGateway.Msg, err error)

func (*GatewayLogic) HandleTopo

func (l *GatewayLogic) HandleTopo(msg *deviceMsg.PublishMsg) (respMsg *msgGateway.Msg, err error)

type OtaLogic

type OtaLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewOtaLogic

func NewOtaLogic(ctx context.Context, svcCtx *svc.ServiceContext) *OtaLogic

func (*OtaLogic) DeviceResp

func (l *OtaLogic) DeviceResp(msg *deviceMsg.PublishMsg, err error, data any) *deviceMsg.PublishMsg

func (*OtaLogic) Handle

func (l *OtaLogic) Handle(msg *deviceMsg.PublishMsg) (respMsg *deviceMsg.PublishMsg, err error)

func (*OtaLogic) HandleProgress

func (l *OtaLogic) HandleProgress(msg *deviceMsg.PublishMsg) (err error)

type SDKLogLogic

type SDKLogLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewSDKLogLogic

func NewSDKLogLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SDKLogLogic

func (*SDKLogLogic) DeviceResp

func (l *SDKLogLogic) DeviceResp(msg *deviceMsg.PublishMsg, err error, data any) *deviceMsg.PublishMsg

func (*SDKLogLogic) GetLogLevel

func (l *SDKLogLogic) GetLogLevel(msg *deviceMsg.PublishMsg) (respMsg *deviceMsg.PublishMsg, err error)

获取当前日志等级

func (*SDKLogLogic) Handle

func (l *SDKLogLogic) Handle(msg *deviceMsg.PublishMsg) (respMsg *deviceMsg.PublishMsg, err error)

func (*SDKLogLogic) ReportLogContent

func (l *SDKLogLogic) ReportLogContent(msg *deviceMsg.PublishMsg) (respMsg *deviceMsg.PublishMsg, err error)

获取设备上传的调试日志内容

type ShadowLogic

type ShadowLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewShadowLogic

func NewShadowLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ShadowLogic

func (*ShadowLogic) Handle

func (l *ShadowLogic) Handle(msg *deviceMsg.PublishMsg) (respMsg *deviceMsg.PublishMsg, err error)

type ThingLogic

type ThingLogic struct {
	logx.Logger
	// contains filtered or unexported fields
}

func NewThingLogic

func NewThingLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ThingLogic

func (*ThingLogic) DeviceResp

func (l *ThingLogic) DeviceResp(msg *deviceMsg.PublishMsg, err error, data any) *deviceMsg.PublishMsg

func (*ThingLogic) DeviceSchemaReportAutoCreate added in v1.0.4

func (l *ThingLogic) DeviceSchemaReportAutoCreate(mode product.DeviceSchemaMode, productID, deviceName string, params map[string]any, tp map[string]msgThing.Param) (err error)

func (*ThingLogic) Handle

func (l *ThingLogic) Handle(msg *deviceMsg.PublishMsg) (respMsg *deviceMsg.PublishMsg, err error)

Handle for topics.DeviceUpThingAll

func (*ThingLogic) HandleAction

func (l *ThingLogic) HandleAction(msg *deviceMsg.PublishMsg) (respMsg *deviceMsg.PublishMsg, err error)

func (*ThingLogic) HandleControl

func (l *ThingLogic) HandleControl(msg *deviceMsg.PublishMsg) (respMsg *deviceMsg.PublishMsg, err error)

func (*ThingLogic) HandleEvent

func (l *ThingLogic) HandleEvent(msg *deviceMsg.PublishMsg) (respMsg *deviceMsg.PublishMsg, err error)

func (*ThingLogic) HandlePackReport

func (l *ThingLogic) HandlePackReport(msg *deviceMsg.PublishMsg, req msgThing.Req) (respMsg *deviceMsg.PublishMsg, err error)

设备属性上报

func (*ThingLogic) HandleProperty

func (l *ThingLogic) HandleProperty(msg *deviceMsg.PublishMsg) (respMsg *deviceMsg.PublishMsg, err error)

属性上报

func (*ThingLogic) HandlePropertyGetStatus

func (l *ThingLogic) HandlePropertyGetStatus(msg *deviceMsg.PublishMsg) (respMsg *deviceMsg.PublishMsg, err error)

设备请求获取 云端记录的最新设备信息

func (*ThingLogic) HandlePropertyReport

func (l *ThingLogic) HandlePropertyReport(msg *deviceMsg.PublishMsg, req msgThing.Req) (respMsg *deviceMsg.PublishMsg, err error)

设备属性上报

func (*ThingLogic) HandlePropertyReportInfo

func (l *ThingLogic) HandlePropertyReportInfo(msg *deviceMsg.PublishMsg, req msgThing.Req) (respMsg *deviceMsg.PublishMsg, err error)

设备基础信息上报

func (*ThingLogic) InsertPackReport

func (l *ThingLogic) InsertPackReport(msg *deviceMsg.PublishMsg, t *schema.Model, device devices.Core, properties []*deviceMsg.TimeParams, events []*deviceMsg.TimeParams) (err error)

Jump to

Keyboard shortcuts

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