| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- #include <stdio.h>
- #include <stdint.h>
- #include <stdbool.h>
- #include <stdlib.h>
- #include <stdarg.h>
- #include <limits.h>
- #include <string.h>
- #include <ctype.h>
- #include <unistd.h>
- #include <stddef.h>
- #include <time.h>
- #include <errno.h>
- #include "main.h"
- #include "cmdopt.h"
- #include "error.h"
- #include "output.h"
- /////////////////////////////////////////////////////////////////////////////
- extern int g_nVerbosity;
- /////////////////////////////////////////////////////////////////////////////
- int GfaTfuPrintF(int verb, const char *pszFormat, ...)
- {
- if(verb <= g_nVerbosity)
- {
- int nRet;
- FILE *pf = (verb <= 1) ? stderr : stdout;
- va_list args;
- va_start(args, pszFormat);
- nRet = vfprintf(pf, pszFormat, args);
- fflush(pf);
- va_end(args);
- return nRet;
- }
- return 0;
- }
- /////////////////////////////////////////////////////////////////////////////
- void GfaTfuDumpImageInfo(const char *pszContext, LPCGFA_IMG_INFO pii)
- {
- if( (g_nVerbosity >= 2) &&
- pszContext &&
- pii &&
- (pii->nImgLength != 0xFFFFFFFF) &&
- (pii->nImgCRC32 != 0xFFFFFFFF))
- {
- TRACE2("%s Image Information:\n", pszContext);
- TRACE2(" Length: %u\n", pii->nImgLength);
- TRACE2(" CRC32: 0x%08X\n", pii->nImgCRC32);
- TRACE2(" Mat.Nr.: %s\n", pii->szImgMaterialNum);
- TRACE2(" Build: %s\n", pii->szImgNameBuild);
- }
- }
- /////////////////////////////////////////////////////////////////////////////
- void GfaTfuOnDownloadStatus(const char *pszFile, int nLine, uint8_t nNodeAddr, uint32_t nFlashStartAddr, uint32_t nCbData, int nCtx, int nErrorCode)
- {
- UNUSED(pszFile);
- UNUSED(nLine);
- UNUSED(nNodeAddr);
- UNUSED(nFlashStartAddr);
- UNUSED(nCbData);
- UNUSED(nCtx);
- UNUSED(nErrorCode);
- }
- /////////////////////////////////////////////////////////////////////////////
- void GfaTfuOnSendDataStatus(const char *pszFile, int nLine, uint8_t nNodeAddr, uint32_t nCbBlock, uint32_t nCbData, int nCtx, int nErrorCode)
- {
- UNUSED(pszFile);
- UNUSED(nLine);
- UNUSED(nNodeAddr);
- UNUSED(nCbBlock);
- UNUSED(nCbData);
- UNUSED(nCtx);
- UNUSED(nErrorCode);
- }
|