C# Class DeviceHive.CommonEquipment.Switch

Definition of a switch equipment
Switch represents a varitey of simple 2-state equipment like LEDs, endswitches, buttons, etc.
Inheritance: EquipmentEngine
显示文件 Open project: devicehive/devicehive-.net-mf

Public Methods

Method Description
OnCommand ( DeviceCommand cmd ) : bool

Sets switch value according to input command

Register ( ) : bool

Registers the switch

SendNotification ( int value ) : bool

Sends switch change notification

Switch ( DeviceEngine dev, Cpu pin, string Code, bool InitialState ) : System

Constructs a switch by given parameters

Private Methods

Method Description
SetValue ( int i, DeviceCommand cmd ) : void

Sets switch value

Method Details

OnCommand() public method

Sets switch value according to input command
public OnCommand ( DeviceCommand cmd ) : bool
cmd DeviceCommand Input command
return bool

Register() public method

Registers the switch
public Register ( ) : bool
return bool

SendNotification() public method

Sends switch change notification
public SendNotification ( int value ) : bool
value int switch value
return bool

Switch() public method

Constructs a switch by given parameters
public Switch ( DeviceEngine dev, Cpu pin, string Code, bool InitialState ) : System
dev DeviceEngine Parent device
pin Microsoft.SPOT.Hardware.Cpu Device pin number
Code string Equipment code
InitialState bool Initial state
return System