32,13 → 32,9 |
|
public String mk_url=""; // buffer the url which is given in the constuctor for reconnectin purposes |
|
|
// version Info from Flight Control |
public int version_major=-1; |
public int version_minor=-1; |
public int version_compatible=-1; |
|
public MKLCD LCD; |
public MKVersion version; |
public MKDebugData debug_data; |
|
public long connection_start_time=-1; |
|
62,7 → 58,7 |
/****************** Section: public Methods ************************************************/ |
public MKCommunicator(String url) // Constructor with URL string e.g. "btspp://XXXXXXXXXXXX:1" - the X-Part is the MAC-Adress of the Bluetooth-Device connected to the Fligth-Control |
{ |
|
version=new MKVersion(); |
debug_data=new MKDebugData(); |
mk_url=url; // remember URL for connecting / reconnecting later |
|
182,7 → 178,7 |
|
} |
|
MKDebugData debug_data; |
|
public void process_data(int[] data,int len) |
{ |
int[] decoded_data; |
192,20 → 188,13 |
{ |
|
case 'D': // debug Data |
decoded_data=Decode64(data,3,50); |
debug_data=new MKDebugData(decoded_data); |
|
|
debug_data_count++; |
debug_data.set_by_mk_data(Decode64(data,3,50),version); |
break; |
|
case 'V': // Version Info |
decoded_data=Decode64(data,3,6); |
version_major=decoded_data[0]; |
version_minor=decoded_data[1]; |
version_compatible=decoded_data[2]; |
version_data_count++; |
|
version.set_by_mk_data(Decode64(data,3,6)); |
break; |
|
case '0': |