-void FpgaGatherVersion(char *dst, int len)
-{
- char *fpga_info;
- unsigned int fpga_info_len;
- dst[0] = 0;
- if(!bitparse_find_section('e', &fpga_info, &fpga_info_len)) {
- strncat(dst, "FPGA image: legacy image without version information", len-1);
- } else {
- strncat(dst, "FPGA image built", len-1);
- /* USB packets only have 48 bytes data payload, so be terse */
-#if 0
- if(bitparse_find_section('a', &fpga_info, &fpga_info_len) && fpga_info[fpga_info_len-1] == 0 ) {
- strncat(dst, " from ", len-1);
- strncat(dst, fpga_info, len-1);
- }
- if(bitparse_find_section('b', &fpga_info, &fpga_info_len) && fpga_info[fpga_info_len-1] == 0 ) {
- strncat(dst, " for ", len-1);
- strncat(dst, fpga_info, len-1);
- }
-#endif
- if(bitparse_find_section('c', &fpga_info, &fpga_info_len) && fpga_info[fpga_info_len-1] == 0 ) {
- strncat(dst, " on ", len-1);
- strncat(dst, fpga_info, len-1);
- }
- if(bitparse_find_section('d', &fpga_info, &fpga_info_len) && fpga_info[fpga_info_len-1] == 0 ) {
- strncat(dst, " at ", len-1);
- strncat(dst, fpga_info, len-1);
- }
+ unsigned int bitstream_length;
+ if (bitparse_find_section(bitstream_version, 'e', &bitstream_length, &compressed_fpga_stream, output_buffer)) {
+ DownloadFPGA(bitstream_version, bitstream_length, &compressed_fpga_stream, output_buffer);
+ downloaded_bitstream = bitstream_version;