Documentation ¶
Index ¶
- func GetOnlineCount() int64
- func Load(id string) error
- func Set(id string, dev *Device)
- func Shutdown() error
- func Startup() error
- func SubscribePropertyStrict() error
- type Device
- func (d *Device) Push(values map[string]any)
- func (d *Device) SetAdapter(adapter protocol.Adapter)
- func (d *Device) UnWatch(handler int)
- func (d *Device) Values() map[string]any
- func (d *Device) Watch(fn func(map[string]any)) int
- func (d *Device) Write(point string, value any) error
- func (d *Device) WriteMany(values map[string]any) error
- type DeviceEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOnlineCount ¶
func GetOnlineCount() int64
func SubscribePropertyStrict ¶ added in v4.0.13
func SubscribePropertyStrict() error
Types ¶
type Device ¶
type Device struct { Id string `json:"id" xorm:"pk"` //ClientID ProductId string `json:"product_id,omitempty" xorm:"index"` Product string `json:"product,omitempty" xorm:"<-"` ProjectId string `json:"project_id,omitempty" xorm:"index"` Project string `json:"project,omitempty" xorm:"<-"` Name string `json:"name"` Description string `json:"description,omitempty"` Parameters map[string]any `json:"parameters,omitempty" xorm:"json"` //模型参数,用于报警检查 Disabled bool `json:"disabled,omitempty"` Created time.Time `json:"created,omitempty" xorm:"created"` Online bool `json:"online,omitempty" xorm:"-"` //通道ID TunnelId string `json:"tunnel_id,omitempty" xorm:"index"` Station map[string]any `json:"station,omitempty" xorm:"json"` //通道参数 保存从站号等 // contains filtered or unexported fields }
func (*Device) SetAdapter ¶ added in v4.1.2
Click to show internal directories.
Click to hide internal directories.