C# 클래스 DeviceHive.EquipmentEngine

Implementation of common equipment functionality
Implementers should derive from this class when creating their own custom equipment. See Switch class for more details.
상속: Equipment
파일 보기 프로젝트 열기: devicehive/devicehive-.net-mf

공개 메소드들

메소드 설명
EquipmentEngine ( DeviceEngine dev ) : Microsoft.SPOT

Constricts an equipment for the specififed parent device

OnCommand ( DeviceCommand cmd ) : bool

Executes an equipment commmand

Implementers should override this function with an equipment-specific command code. Common approact is to check the command code and perform actions accordingly

Register ( ) : bool

Registers the equipment

When the device initializes, it initializes all the equipment it has. By overriding this function an equipment can provide custom initialization steps.

SendNotification ( string DataName, object DataValue ) : bool

Common functionality for sending equipment notifications

Implementers can use this functuions in their custom code to notify of equipment value changes.

Unregister ( ) : bool

Unregisters the equipment

When the device is disconnected from the network or enters the fault state, it tries to unregister all its equipment. Implementers should override this function to provide custon uninitialization steps (closing files or handles, stopping timers, etc.).

메소드 상세

EquipmentEngine() 공개 메소드

Constricts an equipment for the specififed parent device
public EquipmentEngine ( DeviceEngine dev ) : Microsoft.SPOT
dev DeviceEngine Device for which the equipment is created
리턴 Microsoft.SPOT

OnCommand() 공개 추상적인 메소드

Executes an equipment commmand
Implementers should override this function with an equipment-specific command code. Common approact is to check the command code and perform actions accordingly
public abstract OnCommand ( DeviceCommand cmd ) : bool
cmd DeviceCommand Command data structure
리턴 bool

Register() 공개 메소드

Registers the equipment
When the device initializes, it initializes all the equipment it has. By overriding this function an equipment can provide custom initialization steps.
public Register ( ) : bool
리턴 bool

SendNotification() 공개 메소드

Common functionality for sending equipment notifications
Implementers can use this functuions in their custom code to notify of equipment value changes.
public SendNotification ( string DataName, object DataValue ) : bool
DataName string Name of the equipment
DataValue object New value of the equipment
리턴 bool

Unregister() 공개 메소드

Unregisters the equipment
When the device is disconnected from the network or enters the fault state, it tries to unregister all its equipment. Implementers should override this function to provide custon uninitialization steps (closing files or handles, stopping timers, etc.).
public Unregister ( ) : bool
리턴 bool