コード例 #1
0
 protected Agent(String filepath, Agenttype agenttype, Callback_on_status_changed callback, Results results, Main_view mv)
 {
     this.filepath = filepath;
     this.agenttype = agenttype;
     this.callback = callback;
     this.results = results;
     this.main_view = mv;
 }
コード例 #2
0
        public Gsm_agent(String filepath, Agenttype agenttype, Callback_on_status_changed callback, Results results, Main_view mv) : base(filepath, agenttype, callback, results, mv)
        {

        }
コード例 #3
0
 public void on_transfer_speed_change(String report, Results results)
 {
     results.append_to_log(report);           
 }
コード例 #4
0
 public void on_signal_intensity_or_rssi_change(String report, Results results)
 {
     results.append_to_log(report);
 }
コード例 #5
0
 public void on_file_transfer_error(String report, Results results)
 {
     results.append_to_log(report);
 }
コード例 #6
0
 public void on_file_received(String report, Results results)
 {
     results.append_to_log(report);
 }
コード例 #7
0
        public Test(Testtype ttype, String filepath, String wifi_or_device_name, String ip_address_or_uuid, int port, Main_view mv)
        {
            _results = new Results(ttype);
            _main_view = mv;
                       
            _test_agents = new List<Agent>();

            _cancel_token_source = new CancellationTokenSource();
            _cancel_token = _cancel_token_source.Token;

            switch (ttype)
            {
                case Testtype.Test_1:
                    {
                        _test_agents.Add(new Wifi_agent(filepath, Agenttype.Wifi_agent, new Callback_Instance(), _results, _main_view));

                        _task = new Task(() =>
                        {
                            _test_agents.ElementAt(0).send_file(wifi_or_device_name, ip_address_or_uuid, port);

                        }, _cancel_token);
                        
                        break;
                    }

                case Testtype.Test_2:
                    {
                        _test_agents.Add(new Wifi_agent(filepath, Agenttype.Wifi_agent, new Callback_Instance(), _results, _main_view));

                        _task = new Task(() =>
                        {
                            _test_agents.ElementAt(0).receive_file(wifi_or_device_name, ip_address_or_uuid, port);

                        }, _cancel_token);                                                

                        break;
                    }

                case Testtype.Test_3:
                    {
                        _test_agents.Add(new Bluetooth_agent(filepath, Agenttype.Bluetooth_agent, new Callback_Instance(), _results, _main_view));

                        _task = new Task(() =>
                        {
                            _test_agents.ElementAt(0).send_file(wifi_or_device_name, ip_address_or_uuid, 0);

                        }, _cancel_token);

                        break;
                    }
                case Testtype.Test_4:
                    {
                        _test_agents.Add(new Bluetooth_agent(filepath, Agenttype.Bluetooth_agent, new Callback_Instance(), _results, _main_view));

                        _task = new Task(() =>
                        {
                            _test_agents.ElementAt(0).receive_file(wifi_or_device_name, ip_address_or_uuid, 0);

                        }, _cancel_token);
                    
                        break;
                    }                   
            }
        }