Uploading a bitmap file programmatically (again)
Posted: Fri Oct 12, 2007 7:31 am
About a month and a half ago I asked about how to upload a bitmap file to a GLK240128-25 since I couldn't get it to work as in the manual. Clark kindly posted a reply saying the manual was wrong and I should try this approach:
---------------------------------------------------------------
Host: Transmit(0xFE); //Command Prefix
Transmit(0x5E); //Bitmap file upload command
Transmit(0x05); //Reference ID for bitmap file
Transmit(0x19); //Transmit bitmap file size LSB
Transmit(0x00); //Transmit bitmap file size MSB
Module: FileFits(0x01); //Send confirmation that file fits
Host: Receive(); //Receive confirmation that file fits
Transmit(0x05); //Transmit first byte of file data
Module: Echo(0x05); //Echo first byte of file
Host: Receive(); //Receive echo
Confirm(0x05); //Confirm echo
Transmit(0x07); //Transmit second byte of file data
etc...
If any byte other than 0x01 is seen for confirmation by host or module (usually 0x08) the upload it aborted.
------------------------------------------------------------
well, life being what it is, I am now getting around to trying this approach. First, the line that says Confirm(0x05) should be Confirm(0x01), ie, send 0x01 as a confirmation. Second, while the above does indeed upload a file the file appears as garbage when the display shows it. The same bitmap (ie, Windows bitmap) file when uploaded through MOGD# looks just fine.
So, there is a step missing somewhere. Any ideas as to what it is?
Thanks!
Ron
---------------------------------------------------------------
Host: Transmit(0xFE); //Command Prefix
Transmit(0x5E); //Bitmap file upload command
Transmit(0x05); //Reference ID for bitmap file
Transmit(0x19); //Transmit bitmap file size LSB
Transmit(0x00); //Transmit bitmap file size MSB
Module: FileFits(0x01); //Send confirmation that file fits
Host: Receive(); //Receive confirmation that file fits
Transmit(0x05); //Transmit first byte of file data
Module: Echo(0x05); //Echo first byte of file
Host: Receive(); //Receive echo
Confirm(0x05); //Confirm echo
Transmit(0x07); //Transmit second byte of file data
etc...
If any byte other than 0x01 is seen for confirmation by host or module (usually 0x08) the upload it aborted.
------------------------------------------------------------
well, life being what it is, I am now getting around to trying this approach. First, the line that says Confirm(0x05) should be Confirm(0x01), ie, send 0x01 as a confirmation. Second, while the above does indeed upload a file the file appears as garbage when the display shows it. The same bitmap (ie, Windows bitmap) file when uploaded through MOGD# looks just fine.
So, there is a step missing somewhere. Any ideas as to what it is?
Thanks!
Ron