示例#1
0
 public JObject InsertDeviceCommand(StubWebSocketConnection connection,
                                    Guid deviceGuid, JObject command)
 {
     return(InvokeAction(connection, "command/insert", new JObject(
                             new JProperty("deviceGuid", deviceGuid),
                             new JProperty("command", command))));
 }
        protected JObject InvokeAction(StubWebSocketConnection connection, string actionName, JObject args)
        {
            JObject jsonMessage = null;

            connection.SendMessageHandler = msg => jsonMessage = JObject.Parse(msg);
            _controller.InvokeAction(connection, actionName, args);
            return(jsonMessage);
        }
示例#3
0
 public JObject UpdateDeviceCommand(StubWebSocketConnection connection, Guid deviceId, string deviceKey,
                                    int commandId, JObject command)
 {
     return(InvokeAction(connection, "command/update", new JObject(
                             new JProperty("commandId", commandId),
                             new JProperty("command", command),
                             new JProperty("deviceId", deviceId),
                             new JProperty("deviceKey", deviceKey))));
 }
示例#4
0
 public JObject UnsubscribeFromDeviceNotifications(StubWebSocketConnection connection, Guid[] devieGuids)
 {
     return(InvokeAction(connection, "notification/unsubscribe", new JObject(
                             new JProperty("deviceGuids", new JArray(devieGuids)))));
 }
示例#5
0
 public JObject UnsubscribeFromDeviceNotifications(StubWebSocketConnection connection)
 {
     return(InvokeAction(connection, "notification/unsubscribe", null));
 }
示例#6
0
 public JObject Authenticate(StubWebSocketConnection connection, string login, string password)
 {
     return(InvokeAction(connection, "authenticate", new JObject(
                             new JProperty("login", login),
                             new JProperty("password", password))));
 }
 public JObject SubscribeToDeviceNotifications(StubWebSocketConnection connection, string[] devieGuids)
 {
     return(InvokeAction(connection, "notification/subscribe", new JObject(
                             new JProperty("deviceGuids", new JArray(devieGuids)))));
 }
示例#8
0
 public JObject SaveDevice(StubWebSocketConnection connection, Guid deviceGuid, JObject device)
 {
     return(InvokeAction(connection, "device/save", new JObject(
                             new JProperty("deviceId", deviceGuid),
                             new JProperty("device", device))));
 }
示例#9
0
 public JObject GetDevice(StubWebSocketConnection connection)
 {
     return(InvokeAction(connection, "device/get", null));
 }
示例#10
0
 public JObject UnsubsrcibeFromDeviceCommands(StubWebSocketConnection connection)
 {
     return(InvokeAction(connection, "command/unsubscribe", null));
 }
示例#11
0
 public JObject InsertDeviceNotification(StubWebSocketConnection connection, JObject notification)
 {
     return(InvokeAction(connection, "notification/insert", new JObject(
                             new JProperty("notification", notification))));
 }
示例#12
0
 public JObject Authenticate(StubWebSocketConnection connection, Guid deviceId, string deviceKey)
 {
     return(InvokeAction(connection, "authenticate", new JObject(
                             new JProperty("deviceId", deviceId),
                             new JProperty("deviceKey", deviceKey))));
 }