Results 1 to 8 of 8

Thread: [RESOLVED] Send binary data without headers

Threaded View

  1. #1

    Thread Starter
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    Resolved [RESOLVED] Send binary data without headers

    Hey all,
    This is not really a programming question, but I think there are some smart people here that can help me.

    I need to send binary data over a serial port (usb, ethernet, or whatever) and I need to include header information so the receiver knows what the data is and how to handle it. Normally I would convert the data to ASCII before sending it (i.e to send "A" which has ASCII value = 0x41 I would send "4" & "1") then convert back to binary at the receiver. Doing this allows all ASCII values that are not "0" - "9" and "A" - "F" to be used as header data. The trade off is that you end up sending 2X number of bytes. Another way to do this would be to send a fixed length header before the data. This though doesn't really work well with my situation.

    What I am trying to create is an Explorino application that will allow me to view and manipulate the file system on my Arduino's SD card. This requires possibly sending files that could be megabytes in size making ASCII conversion as mentioned above not taste so good give the limited Arduino resources. I would also need to send a file path first so a packet could have 2 pieces of information; the file path and the file. I could do this with a fixed length header, but I would have to make sure the file path fit in the header. If I were sending the stream to a device with more resources this would not be an issue, but to make this application useful, I need to keep the receive data buffer as small as possible (64 or 128 bytes).


    Arduino aside, has anyone implemented a binary packet with headers other than sending ASCII text or sending fixed length headers?

    Yhanks for looking
    kevin
    Last edited by kebo; Aug 14th, 2018 at 10:51 AM.
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

Posting Permissions

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



Click Here to Expand Forum to Full Width