On Wednesday, April 4, 2012 7:58:41 AM UTC-4, srinivasan shanmugam wrote:
Dear All,--As am new to this Java/android development, I'm using Android device to transmit array data. I want my results to be displayed on a PC terminal program using hyper terminal.
If I send ASCII characters such as 'a' 'b' 'c' 'd' ... etc, then my JAVA program displays those characters on screen with out any problem. So i know that my JAVA program does receive from the serial port and does work... but only for ASCII characters though.
Below is the code snippet of the JAVA code which actually receives data via serial port and displays it on screen when declared array as character by character.public final static byte[] buffer_RFID = {'A','D','4','9','8','6','5','2','3'}; try {mOutputStream.write(buffer_RFID,0,buffer_RFID.length); } catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}But when I declare the array as below am not able to see the values as 10, 20, 30, 40 in the hyperterminal through serial portpublic final static byte[] buffer_RFID = {10,20,30,40};try {mOutputStream.write(buffer_RFID,0,buffer_RFID.length); } catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}Please can someone look at it and kindly suggest why can i not print the ASCII values on screen, could any body please suggest me with any corrections to be done in the above code so that what ever the array contents gets displayed as it is in hyper terminal through serial portAny help would be greatly appreciatedAdvanced thanks,Srinivasan S
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
No comments:
Post a Comment