C# Class 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.
Inheritance: Equipment
Afficher le fichier Open project: devicehive/devicehive-.net-mf

Méthodes publiques

Méthode Description
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.).

Method Details

EquipmentEngine() public méthode

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

OnCommand() public abstract méthode

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
Résultat bool

Register() public méthode

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
Résultat bool

SendNotification() public méthode

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
Résultat bool

Unregister() public méthode

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
Résultat bool