new pattern cmd format; send CRC format on console cmds

This commit is contained in:
2019-03-16 19:01:06 -04:00
parent e1f677a6a3
commit d711ee6df6

View File

@@ -141,7 +141,7 @@ public class MainActivity extends Activity implements RadioGroup.OnCheckedChange
try { try {
//send data to service //send data to service
value = message.getBytes("UTF-8"); value = message.getBytes("UTF-8");
mService.writeRXCharacteristic(value); mService.sendDataWithCRC(value);
//Update the log with time stamp //Update the log with time stamp
String currentDateTimeString = DateFormat.getTimeInstance().format(new Date()); String currentDateTimeString = DateFormat.getTimeInstance().format(new Date());
listAdapter.add("["+currentDateTimeString+"] TX: "+ message); listAdapter.add("["+currentDateTimeString+"] TX: "+ message);
@@ -161,11 +161,11 @@ public class MainActivity extends Activity implements RadioGroup.OnCheckedChange
byte[] value; byte[] value;
try { try {
//send data to service //send data to service
value = "!PR".getBytes("UTF-8"); value = "pr".getBytes("UTF-8");
mService.sendDataWithCRC(value); mService.sendDataWithCRC(value);
//Update the log with time stamp //Update the log with time stamp
String currentDateTimeString = DateFormat.getTimeInstance().format(new Date()); String currentDateTimeString = DateFormat.getTimeInstance().format(new Date());
listAdapter.add("["+currentDateTimeString+"] TX: "+ "!PR"); listAdapter.add("["+currentDateTimeString+"] TX: "+ "pr");
messageListView.smoothScrollToPosition(listAdapter.getCount() - 1); messageListView.smoothScrollToPosition(listAdapter.getCount() - 1);
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block