device

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDevicePermissionForRoles

func AddDevicePermissionForRoles(device entity.Device, tx *gorm.DB) (err error)

AddDevicePermissionForRoles 为所有角色增加设备权限

func BatchInsertChildDevice added in v1.9.1

func BatchInsertChildDevice(d *entity.Device, das plugin.DeviceInstances, tx *gorm.DB) error

BatchInsertChildDevice 通过das批量插入子设备

func ControlPermissions

func ControlPermissions(d entity.Device) ([]types.Permission, error)

ControlPermissions 根据配置获取设备所有控制权限

func Create

func Create(areaID uint64, device *entity.Device) (err error)

func GetControlAttributes added in v1.9.1

func GetControlAttributes(d entity.Device) (attributes []entity.Attribute, err error)

GetControlAttributes 获取设备属性(不包括设备型号、厂商等属性)

func GetDeviceInstances added in v1.9.1

func GetDeviceInstances(d entity.Device, up entity.UserPermissions) (das plugin.DeviceInstances, err error)

GetDeviceInstances 获取设备的instance

func GetInstances added in v1.9.1

func GetInstances(areaID uint64, userID int, pluginID, identity string) (das plugin.DeviceInstances, err error)

GetInstances 获取用户设备的属性(包括权限)

func GetOrInitDeviceInstances added in v1.9.1

func GetOrInitDeviceInstances(d entity.Device, up entity.UserPermissions) (das plugin.DeviceInstances, err error)

func GetShadow added in v1.9.1

func GetShadow(d entity.Device) (shadow entity.Shadow, err error)

func GetThingModel added in v1.9.1

func GetThingModel(d entity.Device) (thingModel plugin.DeviceInstances, err error)

func GetUserDeviceInstances added in v1.9.1

func GetUserDeviceInstances(userID int, d entity.Device) (das plugin.DeviceInstances, err error)

GetUserDeviceInstances 获取用户设备的属性(包括权限)

func IsDeviceControlPermit

func IsDeviceControlPermit(areaID uint64, userID int, pluginID, identity string, data json.RawMessage) bool

IsDeviceControlPermit 控制设备的websocket命令 是否有权限

func IsPermit

func IsPermit(c *gin.Context, p types.Permission) bool

IsPermit 判断用户是否有权限

func ManagePermissions

func ManagePermissions(d entity.Device) []types.Permission

ManagePermissions 设备的管理权限

func Permissions

func Permissions(d entity.Device) (ps []types.Permission, err error)

Permissions 根据配置获取设备所有权限

func SyncDevice added in v1.9.1

func SyncDevice(d *entity.Device) (err error)

SyncDevice 同步设备属性

func UpdateDeviceShadow added in v1.9.1

func UpdateDeviceShadow(em event.EventMessage) error

func UpdateShadowReported added in v1.9.1

func UpdateShadowReported(d entity.Device, attr entity.Attribute) (err error)

UpdateShadowReported 更新设备影子属性报告值

Types

This section is empty.

Jump to

Keyboard shortcuts

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