[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] file hex form converter reference

From: Leo Hendrawan
Subject: [avr-gcc-list] file hex form converter reference
Date: Mon, 29 Nov 2004 11:19:42 +0000 (GMT)


i/m looking for a C/C++ reference/source which could convert any file type
(esp. imag files) to hex form that could be included inside a C source for
AVR-gcc application.

for example:

instead of writing this in my source code:
const char ProgMemString PROGMEM = {"abc"};

i want it to be in this kind of hex form:
const char ProgMemString PROGMEM = {0x61 0x62 0x63 0x00};

i want to use for storing image file inside my embedded web server app.

i have made a source in C++ using ftream.h, which only read the source
file byte per byte using ifstream.get() func and store it into a temporary
buffer, then unsing sprinft("%c", buff[i]) to convert it in desired hex
form. and off course adding the NULL terminator at the end of the output
file. it does work for my html source files, but not for the image files.
i think because of the .eof() func i used.

the following attached file shows my program in C++.

Thank you very much for any advice.

Best regards,

 Leo Hendrawan
 at 11:07 Nov 29

Attachment: T2HC.cpp
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]