Subversion Repositories FlightCtrl

Rev

Rev 495 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 495 Rev 502
Line 58... Line 58...
58
    {
58
    {
59
        root=root_;
59
        root=root_;
60
        version=new MKVersion();
60
        version=new MKVersion();
61
        debug_data=new MKDebugData();
61
        debug_data=new MKDebugData();
62
        params=new MKParamsParser();
62
        params=new MKParamsParser();
63
        //      mk_url=url; // remember URL for connecting / reconnecting later
-
 
64
 
-
 
65
                LCD= new MKLCD(this);
63
        LCD= new MKLCD(this);
66
                watchdog=new MKWatchDog(this);
64
        watchdog=new MKWatchDog(this);
67
        new Thread( this ).start(); // fire up main Thread 
65
        new Thread( this ).start(); // fire up main Thread 
68
    }
66
    }
Line 69... Line 67...
69
 
67
 
Line 74... Line 72...
74
    }
72
    }
Line 75... Line 73...
75
 
73
 
76
    //  URL string: "btspp://XXXXXXXXXXXX:1" - the X-Part is the MAC-Adress of the Bluetooth-Device connected to the Fligth-Control
74
    //  URL string: "btspp://XXXXXXXXXXXX:1" - the X-Part is the MAC-Adress of the Bluetooth-Device connected to the Fligth-Control
77
    public void connect_to(String _url,String _name)
75
    public void connect_to(String _url,String _name)
78
    {
76
    {
79
        mk_url=_url;
77
        mk_url=_url; // remember URL for connecting / reconnecting later
80
        name=_name;
78
        name=_name;
81
        force_disconnect=false;
79
        force_disconnect=false;
82
        connected=false;
80
        connected=false;
Line 172... Line 170...
172
            }
170
            }
Line 173... Line 171...
173
 
171
 
174
        send_command(0,'q',params);
172
        send_command(0,'q',params);
Line -... Line 173...
-
 
173
    }
-
 
174
 
-
 
175
 
-
 
176
    public void get_debug_name(int id)
-
 
177
    {
-
 
178
        int[] params=new int[1];
-
 
179
        params[0]=id;
-
 
180
 
-
 
181
        while(sending)
-
 
182
            {try { Thread.sleep(50); }
-
 
183
            catch (Exception e)  {   }
-
 
184
            }
-
 
185
 
-
 
186
        send_command(0,'a',params);
-
 
187
    }
-
 
188
 
-
 
189
 
175
    }
190
 
176
 
191
 
177
    public void trigger_LCD(int key)
192
   public void trigger_LCD(int key)
Line 178... Line 193...
178
    {
193
    {
Line 265... Line 280...
265
           
280
           
266
            case 'D': // debug Data
281
            case 'D': // debug Data
267
                debug_data_count++;
282
                debug_data_count++;
268
                debug_data.set_by_mk_data(Decode64(data,3,len-3),version);
283
                debug_data.set_by_mk_data(Decode64(data,3,len-3),version);
-
 
284
                break;
-
 
285
 
-
 
286
            case 'A': // debug Data Names
-
 
287
                //debug_data_count++;
-
 
288
                debug_data.set_names_by_mk_data(data[1]-'0',Decode64(data,3,len-3));
Line 269... Line 289...
269
                break;
289
                break;
270
               
290
               
271
            case 'V': // Version Info
291
            case 'V': // Version Info
272
                version_data_count++;
292
                version_data_count++;