コード例 #1
0
        public void Reboot()
        {
            var Cmd = new AudacityCommand();

            Cmd.Module = (UInt16)module_t.modSystem;
            Cmd.Action = (UInt16)action_t.actSystemReboot;

            SendCommand(Cmd);
        }
コード例 #2
0
        public void CameraCapture()
        {
            var Cmd = new AudacityCommand();

            Cmd.Module = (UInt16)module_t.modCamera;
            Cmd.Action = (UInt16)action_t.actCameraCapture;

            SendCommand(Cmd);
        }
コード例 #3
0
        public void Stop()
        {
            var Cmd = new AudacityCommand();

            Cmd.Module = (UInt16)module_t.modRemotePilot;
            Cmd.Action = (UInt16)action_t.actRemotePilotStop;

            SendCommand(Cmd);
        }
コード例 #4
0
        public void Right(UInt16 ADegrees)
        {
            var Cmd = new AudacityCommand();

            Cmd.Module = (UInt16)module_t.modRemotePilot;
            Cmd.Action = (UInt16)action_t.actRemotePilotRight;
            Cmd.Param1 = ADegrees;

            SendCommand(Cmd);
        }
コード例 #5
0
        public void Backward(UInt16 AAmount)
        {
            var Cmd = new AudacityCommand();

            Cmd.Module = (UInt16)module_t.modRemotePilot;
            Cmd.Action = (UInt16)action_t.actRemotePilotBackward;
            Cmd.Param1 = AAmount;

            SendCommand(Cmd);
        }
コード例 #6
0
        private void SendCommand(AudacityCommand ACmd)
        {
            try
            {
                TcpClient client = new TcpClient(IP, Port);

                NetworkStream ns = client.GetStream();

                var cmdstr = ACmd.ToBinaryCommandStr();
                ns.Write(cmdstr, 0, cmdstr.Length);

                client.Close();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
        }