i want to send a hex file to a serial port in java..so i need code for it.as a example.i am a student so m new in dis field.plz help me asap.
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
i want to send a hex file to a serial port in java..so i need code for it.as a example.i am a student so m new in dis field.plz help me asap.
Do you have the code to send any file to a serial port?
What is a hex file? Does mean a non-text file that has bytes that can contain any of 256 values: 0x00 to 0xFF
If you don't understand my answer, don't ignore it, ask a question.
no i dnt hav the code 2 send file..bt til now wat i kno is i cn send a file to serial port as a data or collection of bytes..bt nt as a whole file..so plz explain the way 2 do it!!
and 1 more thing , while sending a hex file i want 2 completely ignore the line feed..
What class and what method are you using to send what you are sending?
What is a hex file? Does mean a non-text file that has bytes that can contain any of 256 values: 0x00 to 0xFF
If the file contains binary data, it can have a byte with any value including a line feed character.
If you don't understand my answer, don't ignore it, ask a question.
after finding serial ports and connecting to it, m making a file output stream for serial port.n passing ma hex file name to outputstream.
What is the name of the class you are using to write to the serial port with?
Does it have methods for writing bytes?
If you don't understand my answer, don't ignore it, ask a question.
name of the class is outputstream and it has a write method which take argument of byte 2 b written on serial port
What is 2 b?
Please use English.
There is no Java SE class: outputstream. Java is case sensitive and all classes start with a uppercase letter.
If you don't understand my answer, don't ignore it, ask a question.
yes..OutputStream is the class name..and sorry for using shortcut language. hey Norm can you give me a simple code to send bytes from a file to serial port?
Last edited by Himali; April 1st, 2012 at 03:08 PM.
Can you explain what the problem is when you write the contents of a file? Your descriptions have been vague.
Post the code you are using to write the file and the code you are using to read the file.
If you don't understand my answer, don't ignore it, ask a question.