I'm trying to send a binary file stored on the SDCard to a webserver using HTTPCMD. Since the file could be fairly large I have to process it in pieces so I read some bytes into a byte array then send it to the webserver. The server can use a process called "chunked transfer encoding" which will allow me to make multiple HTTP PUT calls, each with a piece of the file I'm attempting to send. So far, so good.
Since chunked-mode isn't implemented in the BRX I'm 'rolling my own'. This means that I send the length of the data I want to transfer followed by a CRLF, then the data and finally another CRLF. This repeats until I'm done, when I send a final PUT with just CRLF. Certainly doable on the BRX.
Where I'm struggling is putting the pieces together to send out. My thought was to MEMCOPY the string containing the length and the initial CRLF to the front of the byte array, then copy in the data from the file, and then MEMCOPY another string with the back-end CRLF. This has presented a problem though - if I look at the front of the byte array there are additional characters in the high-order byte of the first word.
So - I'm trying to send "1000<CR><LF>" which is 49 48 48 48 13 10 in ASCII decimal notation. What I see is: 64 00 06 00 49 48 48 48 13 10
I know I could push the CRLF as values (MOVE 13 to byte array, same for 10) but I don't know how to convert the ASCII values to decimal.
I'd be grateful for ideas and/or suggestions.
Thanks, Andrew.