Results 1 to 7 of 7
  1. #1
    Khan05 is offline Member
    Join Date
    Jul 2011
    Posts
    27
    Rep Power
    0

    Default How download a file and update system firmware in Java

    Hi guys,
    I need help to download a file. I have to choose a file and then read it in the mean time I have to update my harware version.Basicly, I have to create software upload functionality. I have connected my Pc to a hardware via serial Port. If some have an Idia. I will really appreciate.Actually I have two variable filetype, and file size. I did not find any similar example on google.

  2. #2
    Mr777 is offline Devil
    Join Date
    Nov 2011
    Location
    Pakistan
    Posts
    12
    Rep Power
    0

    Default Re: How download a file and update system firmware in Java

    You want to download or upload?
    Ask specific questions and get a very specific answer.

  3. #3
    Khan05 is offline Member
    Join Date
    Jul 2011
    Posts
    27
    Rep Power
    0

    Default Re: How download a file and update system firmware in Java

    I have to load a software from a file. I need to create this functionality to load a software and update a hardware version.

  4. #4
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,058
    Rep Power
    5

    Default Re: How download a file and update system firmware in Java

    I'd love to know how to update hardware via software.

    I think what you mean is that you have a PC, and the PC has some unspecified device attached to it via serial port. You want to write a Java program that will select a firmware file and send it to the device on the serial port. Is that correct?
    Get in the habit of using standard Java naming conventions!

  5. #5
    Khan05 is offline Member
    Join Date
    Jul 2011
    Posts
    27
    Rep Power
    0

    Default Re: How download a file and update system firmware in Java

    Yes, I create an Interface to connect to a device via Serial port. Now I want to my select a firmware file and then update the device version Selecting part is fine I can handle it the only part it confusing me how to read and then start updating. I think I need some Checksum to check the file size. If you guys help I will appreciate. This is my first java project.

  6. #6
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,058
    Rep Power
    5

    Default Re: How download a file and update system firmware in Java

    Firmware files are binary, so you'll want to use an InputStream (not a Reader) to read the file into a byte[]. Then you'll want to verify that it is, in fact, the correct type of firmware file. Not knowing what it's for, I can only guess about how you'd do that. Probably it's a specific sequence of bytes near the beginning of the file. Then, as you suggested, you'd want to verify the checksum. Again, I can't be specific because I don't know what checksum algorithm it uses. Finally, you'll send the commands to the serial port to prepare the device and transmit the firmware. Again, can't tell you how to do that because I don't know what device you're using. But you'll probably use the Java Communications API to do it.
    Get in the habit of using standard Java naming conventions!

  7. #7
    Khan05 is offline Member
    Join Date
    Jul 2011
    Posts
    27
    Rep Power
    0

    Default Re: How download a file and update system firmware in Java

    Thanks for replying my post. I think, I have to read file in byte[] arrays. I don't have my source code now.I will give you my code soon.Yes, its have some file sequence no. File should be loaded according to sequence.

Similar Threads

  1. Java download file
    By Soljav22 in forum New To Java
    Replies: 4
    Last Post: 11-17-2010, 07:08 PM
  2. To download file, using java.nio
    By Jorik in forum Networking
    Replies: 3
    Last Post: 10-25-2010, 02:13 PM
  3. Download a file by Bluetooth in Java SE
    By danielpereira in forum New To Java
    Replies: 0
    Last Post: 10-06-2010, 08:56 PM
  4. Replies: 0
    Last Post: 03-05-2010, 04:21 AM
  5. using java dom to update file
    By newbieal in forum New To Java
    Replies: 6
    Last Post: 10-10-2008, 11:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •