Rev 303 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 303 | Rev 314 | ||
---|---|---|---|
Line 27... | Line 27... | ||
27 | public MKLCD LCD; |
27 | public MKLCD LCD; |
28 | public MKVersion version; |
28 | public MKVersion version; |
29 | public MKDebugData debug_data; |
29 | public MKDebugData debug_data; |
30 | public MKParamsParser params; |
30 | public MKParamsParser params; |
31 | public MKWatchDog watchdog; |
31 | public MKWatchDog watchdog; |
- | 32 | public MKProxy proxy=null; |
|
Line 32... | Line 33... | ||
32 | 33 | ||
Line 33... | Line 34... | ||
33 | public long connection_start_time=-1; |
34 | public long connection_start_time=-1; |
Line 48... | Line 49... | ||
48 | public int other_data_count=0; |
49 | public int other_data_count=0; |
49 | public int lcd_data_count=0; |
50 | public int lcd_data_count=0; |
50 | public int params_data_count=0; |
51 | public int params_data_count=0; |
Line -... | Line 52... | ||
- | 52 | ||
51 | 53 | ||
Line 52... | Line 54... | ||
52 | 54 | ||
53 | String name; |
55 | String name; |
54 | 56 | ||
Line 64... | Line 66... | ||
64 | watchdog=new MKWatchDog(this); |
66 | watchdog=new MKWatchDog(this); |
65 | new Thread( this ).start(); // fire up main Thread |
67 | new Thread( this ).start(); // fire up main Thread |
66 | } |
68 | } |
Line -... | Line 69... | ||
- | 69 | ||
- | 70 | ||
- | 71 | public void do_proxy(String proxy_url) |
|
- | 72 | { |
|
Line 67... | Line 73... | ||
67 | 73 | proxy=new MKProxy(proxy_url); |
|
68 | 74 | } |
|
69 | 75 | ||
70 | // URL string: "btspp://XXXXXXXXXXXX:1" - the X-Part is the MAC-Adress of the Bluetooth-Device connected to the Fligth-Control |
76 | // URL string: "btspp://XXXXXXXXXXXX:1" - the X-Part is the MAC-Adress of the Bluetooth-Device connected to the Fligth-Control |
Line 240... | Line 246... | ||
240 | case 'L': |
246 | case 'L': |
241 | case 'M': |
247 | case 'M': |
242 | case 'N': |
248 | case 'N': |
243 | case 'O': |
249 | case 'O': |
244 | case 'P': |
250 | case 'P': |
245 | params.set_by_mk_data(Decode64(data,3,58),version); |
251 | params.set_by_mk_data((int)(data[2]-'L'),Decode64(data,3,58),version); |
246 | params_data_count++; |
252 | params_data_count++; |
247 | break; |
253 | break; |
Line 248... | Line 254... | ||
248 | 254 | ||
249 | default: |
255 | default: |
Line 295... | Line 301... | ||
295 | pos=0; |
301 | pos=0; |
296 | input=0; |
302 | input=0; |
297 | // recieve data-set |
303 | // recieve data-set |
298 | while ((input != 13)) // &&(input!=-1)) |
304 | while ((input != 13)) // &&(input!=-1)) |
299 | { |
305 | { |
- | 306 | ||
300 | input = reader.read() ; |
307 | input = reader.read() ; |
- | 308 | if (proxy!=null) |
|
- | 309 | proxy.writer.write(input); |
|
301 | if (input==-1) throw new Exception("test"); |
310 | if (input==-1) throw new Exception("test"); |
302 | data_set[pos]=input; |
311 | data_set[pos]=input; |
303 | pos++; |
312 | pos++; |
Line 304... | Line 313... | ||
304 | 313 | ||
- | 314 | } |
|
- | 315 | ||
- | 316 | if (proxy!=null) |
|
- | 317 | { |
|
- | 318 | proxy.writer.write('\r'); |
|
- | 319 | proxy.writer.write('\n'); |
|
- | 320 | proxy.writer.flush(); |
|
- | 321 | } |
|
305 | } |
322 | |
Line 306... | Line 323... | ||
306 | process_data(data_set,pos); |
323 | process_data(data_set,pos); |
307 | 324 | ||
308 | } |
325 | } |