C# 클래스 DeviceHive.DeviceEngine

Base class for DeviceHive .NET Micro Framework devices. All custom devices should be inherited from it.
파일 보기 프로젝트 열기: devicehive/devicehive-.net-mf 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
DcClient IFrameworkClient

공개 메소드들

메소드 설명
Connect ( ) : bool

Connects device to network

This function should be called by implementers to make the device connect to DeviceHive network.

Init ( ) : bool

Initializes the device

This function should be called by implementers before any calls to other DeveiceEngine's functions.

ProcessCommands ( ) : bool

Default command processing

This function performs a default command processing, including handling equipment commands and firing events. It should be invoked by implementers to perform a single command processing loop. So, it should be ran continuously.

SendNotification ( INotification notification ) : bool

Sends a notification to the DeviceHive network

This function can be used by implementers to send device-specific notifications.

보호된 메소드들

메소드 설명
CreateDeviceData ( ) : Device

This function should be overridden by implementers to return a specific DeviceData structure.

CreateEquipment ( ) : void

Initializes device equipment structure

This function should be overridden by implementers to construct device equipment and fill DeviceData equipment hashtable with equipment. This function is invoked after the device has connected to data network and registered itself. Normally, the constructed equipment should be initialized and send its status to DeviceHive network.

비공개 메소드들

메소드 설명
FindDevice ( string code ) : EquipmentEngine

Locates an equipment by a specified code

RegisterEquipment ( ) : bool

Registers all equipment in DeviceHive network

UnregisterEquipment ( ) : bool

Unregisters equipment

메소드 상세

Connect() 공개 메소드

Connects device to network
This function should be called by implementers to make the device connect to DeviceHive network.
public Connect ( ) : bool
리턴 bool

CreateDeviceData() 보호된 추상적인 메소드

This function should be overridden by implementers to return a specific DeviceData structure.
protected abstract CreateDeviceData ( ) : Device
리턴 Device

CreateEquipment() 보호된 추상적인 메소드

Initializes device equipment structure
This function should be overridden by implementers to construct device equipment and fill DeviceData equipment hashtable with equipment. This function is invoked after the device has connected to data network and registered itself. Normally, the constructed equipment should be initialized and send its status to DeviceHive network.
protected abstract CreateEquipment ( ) : void
리턴 void

Init() 공개 메소드

Initializes the device
This function should be called by implementers before any calls to other DeveiceEngine's functions.
public Init ( ) : bool
리턴 bool

ProcessCommands() 공개 메소드

Default command processing
This function performs a default command processing, including handling equipment commands and firing events. It should be invoked by implementers to perform a single command processing loop. So, it should be ran continuously.
public ProcessCommands ( ) : bool
리턴 bool

SendNotification() 공개 메소드

Sends a notification to the DeviceHive network
This function can be used by implementers to send device-specific notifications.
public SendNotification ( INotification notification ) : bool
notification INotification Notification to be sent
리턴 bool

프로퍼티 상세

DcClient 보호되어 있는 프로퍼티

DeviceHive client used to handle API calls.
protected IFrameworkClient DcClient
리턴 IFrameworkClient