コード例 #1
0
 /// <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)));
 }
コード例 #2
0
ファイル: ProgramEngine.cs プロジェクト: macitynet/HomeGenie
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 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);
 }
コード例 #5
0
        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);
        }
コード例 #6
0
 private object InterfaceControl(Module module, MIGInterfaceCommand migCommand)
 {
     migCommand.Domain = module.Domain;
     migCommand.NodeId = module.Address;
     return(homegenie.InterfaceControl(migCommand));
 }
コード例 #7
0
 private void InterfaceControl(Module module, MIGInterfaceCommand migCommand)
 {
     migCommand.Domain = module.Domain;
     migCommand.NodeId = module.Address;
     homegenie.InterfaceControl(migCommand);
 }