/// <summary> /// Invoke an API command and get the result. /// </summary> /// <returns>The API command response.</returns> /// <param name="apiCommand">Any MIG/APP API command without the `/api/` prefix.</param> public object ApiCall(string apiCommand) { if (apiCommand.StartsWith("/api/")) { apiCommand = apiCommand.Substring(5); } return(homegenie.InterfaceControl(new MigInterfaceCommand(apiCommand))); }
private void ExecuteProgramCommand(ProgramCommand programCommand) { string command = programCommand.Domain + "/" + programCommand.Target + "/" + programCommand.CommandString + "/" + System.Uri.EscapeDataString(programCommand.CommandArguments); var interfaceCommand = new MIGInterfaceCommand(command); homegenie.InterfaceControl(interfaceCommand); }
private void _mcp_executeCommand(ProgramCommand c) { string wrequest = c.Domain + "/" + c.Target + "/" + c.CommandString + "/" + c.CommandArguments; MIGInterfaceCommand cmd = new MIGInterfaceCommand(wrequest); _homegenie.InterfaceControl(cmd); _homegenie.WaitOnPending(c.Domain); }
private void _interfacecontrol(Module module, MIGInterfaceCommand cmd) { cmd.domain = module.Domain; cmd.nodeid = module.Address; //string options = ""; //for (int o = 0; o < cmd.options.Length; o++ ) //{ // options += cmd.options[o] + "/"; //} _homegenie.InterfaceControl(cmd); //new Command("/" + module.Domain + "/" + module.Address + "/" + cmd.command + "/" + options)); _homegenie.WaitOnPending(module.Domain); }
private object InterfaceControl(Module module, MigInterfaceCommand migCommand) { object response = null; migCommand.Domain = module.Domain; migCommand.Address = module.Address; try { response = homegenie.InterfaceControl(migCommand); } catch (Exception e) { // TODO: should report the error? } return(response); }
private object InterfaceControl(Module module, MIGInterfaceCommand migCommand) { migCommand.Domain = module.Domain; migCommand.NodeId = module.Address; return(homegenie.InterfaceControl(migCommand)); }
private void InterfaceControl(Module module, MIGInterfaceCommand migCommand) { migCommand.Domain = module.Domain; migCommand.NodeId = module.Address; homegenie.InterfaceControl(migCommand); }