-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 {
- /* USB packets only have 48 bytes data payload, so be terse */
- if(bitparse_find_section('a', &fpga_info, &fpga_info_len) && fpga_info[fpga_info_len-1] == 0 ) {
- if (!memcmp("fpga_lf", fpga_info, 7))
- strncat(dst, "LF ", len-1);
- else if (!memcmp("fpga_hf", fpga_info, 7))
- strncat(dst, "HF ", len-1);
- }
- strncat(dst, "FPGA image built", len-1);
-#if 0
- 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);
- }
- }
-}