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); }
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)))); }
public JObject UnsubscribeFromDeviceNotifications(StubWebSocketConnection connection, Guid[] devieGuids) { return(InvokeAction(connection, "notification/unsubscribe", new JObject( new JProperty("deviceGuids", new JArray(devieGuids))))); }
public JObject UnsubscribeFromDeviceNotifications(StubWebSocketConnection connection) { return(InvokeAction(connection, "notification/unsubscribe", null)); }
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))))); }
public JObject SaveDevice(StubWebSocketConnection connection, Guid deviceGuid, JObject device) { return(InvokeAction(connection, "device/save", new JObject( new JProperty("deviceId", deviceGuid), new JProperty("device", device)))); }
public JObject GetDevice(StubWebSocketConnection connection) { return(InvokeAction(connection, "device/get", null)); }
public JObject UnsubsrcibeFromDeviceCommands(StubWebSocketConnection connection) { return(InvokeAction(connection, "command/unsubscribe", null)); }
public JObject InsertDeviceNotification(StubWebSocketConnection connection, JObject notification) { return(InvokeAction(connection, "notification/insert", new JObject( new JProperty("notification", notification)))); }
public JObject Authenticate(StubWebSocketConnection connection, Guid deviceId, string deviceKey) { return(InvokeAction(connection, "authenticate", new JObject( new JProperty("deviceId", deviceId), new JProperty("deviceKey", deviceKey)))); }