메소드 | 설명 | |
---|---|---|
CanConnectAsync ( ) : Task |
Checks if current channel object can be used to eshtablish connection to the DeviceHive server. The method returns true only if the DeviceHive server deployment supports WebSocket protocol.
|
|
CloseAsync ( ) : Task |
Closes the persistent connection to the DeviceHive server.
|
|
OpenAsync ( ) : Task |
Opens a persistent connection to the DeviceHive server.
|
|
SendCommandAsync ( string deviceGuid, Command command, Action |
Sends a command to the device.
|
|
SendNotificationAsync ( string deviceGuid, Notification notification ) : Task |
Sends a notification on behalf of device.
|
|
UpdateCommandAsync ( string deviceGuid, Command command ) : Task |
Updates a command on behalf of the device.
|
|
WaitCommandResultAsync ( string deviceGuid, int commandId, |
Waits until the command is completed and returns a Command object with filled Status and Result properties.
|
|
WebSocketChannel ( DeviceHive.Client.DeviceHiveConnectionInfo connectionInfo ) : Newtonsoft.Json.Linq |
Default constructor.
|
|
WebSocketChannel ( DeviceHive.Client.DeviceHiveConnectionInfo connectionInfo, IRestClient restClient ) : Newtonsoft.Json.Linq |
Constructor which allows to override IRestClient which makes HTTP requests to the DeviceHive server.
|
메소드 | 설명 | |
---|---|---|
SubscriptionAdding ( ISubscription subscription ) : Task |
Invoked before new subscription is added. The methods sends subscribe message to the DeviceHive server.
|
|
SubscriptionRemoving ( ISubscription subscription ) : Task |
Invoked before an existing subscription is removed. The methods sends unsubscribe message to the DeviceHive server.
|
메소드 | 설명 | |
---|---|---|
AuthenticateAsync ( ) : Task | ||
HandleConnectionClose ( ) : void | ||
HandleMessage ( MessageWebSocketMessageReceivedEventArgs args ) : void | ||
HandleMessage ( string message ) : void | ||
OpenWebSocketAsync ( ) : Task | ||
Reconnect ( ) : Task | ||
SendRequestAsync ( string action ) : Task |
public SendCommandAsync ( string deviceGuid, Command command, Action |
||
deviceGuid | string | Device unique identifier. |
command | Command | A |
callback | Action |
A callback action to invoke when the command is completed by the device. |
token | Cancellation token to cancel waiting for command result. | |
리턴 | Task |
public SendNotificationAsync ( string deviceGuid, Notification notification ) : Task |
||
deviceGuid | string | Device unique identifier. |
notification | Notification | A |
리턴 | Task |
protected SubscriptionAdding ( ISubscription subscription ) : Task |
||
subscription | ISubscription | A |
리턴 | Task |
protected SubscriptionRemoving ( ISubscription subscription ) : Task | ||
subscription | ISubscription | A |
리턴 | Task |
public UpdateCommandAsync ( string deviceGuid, Command command ) : Task | ||
deviceGuid | string | Device unique identifier. |
command | Command | A |
리턴 | Task |
public WaitCommandResultAsync ( string deviceGuid, int commandId, |
||
deviceGuid | string | Device unique identifier. |
commandId | int | Command identifier. |
token | Cancellation token to cancel waiting for command result. | |
리턴 | Task |
public WebSocketChannel ( DeviceHive.Client.DeviceHiveConnectionInfo connectionInfo ) : Newtonsoft.Json.Linq | ||
connectionInfo | DeviceHive.Client.DeviceHiveConnectionInfo | DeviceHive connection information. |
리턴 | Newtonsoft.Json.Linq |
public WebSocketChannel ( DeviceHive.Client.DeviceHiveConnectionInfo connectionInfo, IRestClient restClient ) : Newtonsoft.Json.Linq | ||
connectionInfo | DeviceHive.Client.DeviceHiveConnectionInfo | DeviceHive connection information. |
restClient | IRestClient | IRestClient implementation. |
리턴 | Newtonsoft.Json.Linq |