You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.4 KiB

  1. #include "XNetSDKTest.h"
  2. void OnUpgradeCallback(EUpgradeStep nStep, int nProcess, int nTotalSize)
  3. {
  4. if(nStep == EUpgradeStep_Down)
  5. {
  6. printf("DownFile Process = %d/%d\r\n", nProcess,nTotalSize);
  7. }
  8. else if(nStep == EUpgradeStep_SendFile)
  9. {
  10. unsigned int nPos = 100 * nProcess / nTotalSize;
  11. printf("SendData Process = %d\r\n", nPos);
  12. }
  13. else if(nStep == EUpgradeStep_SendFile_Complete)
  14. {
  15. printf("EUpgradeStep_SendFile_Complete[%d]\r\n", nProcess);
  16. }
  17. else if(nStep == EUpgradeStep_Upgrade)
  18. {
  19. printf("Upgrade Process = %d\r\n", nProcess);
  20. }
  21. else if(nStep == EUpgradeStep_Upgrade_Complete )
  22. {
  23. printf("EUpgradeStep_Upgrade_Complete[%d]\r\n", nProcess);
  24. }
  25. else if(nStep == EUpgradeStep_Complete )
  26. {
  27. printf("EUpgradeStep_Complete Process = %d\r\n", nProcess);
  28. }
  29. else
  30. {
  31. printf("%s[Step:%d][Process:%d][TotalSize:%d]\r\n", __FUNCTION__, nStep, nProcess, nTotalSize);
  32. }
  33. }
  34. int TestUpgrade()
  35. {
  36. printf("%s\r\n", __FUNCTION__);
  37. char c = 0;
  38. do
  39. {
  40. switch(c)
  41. {
  42. case 's':
  43. {
  44. XSDK_DevUpgrade(g_hDevice, "/mnt/hgfs/myeye50/General_General_FBOX-804C-B2_V4.02.R11.7601.Nat.OnvifC.20180928.bin", 123, 5000);
  45. }
  46. break;
  47. case 'f':
  48. {
  49. XSDK_DevUpgrade(g_hDevice, "/mnt/hgfs/myeye50/General_General_FBOX-804C-B2_V4.03.R11.7601.Nat.OnvifC.20181123.bin", 123, 5000);
  50. }
  51. break;
  52. }
  53. }while((c = getchar()) != 'q');
  54. return 0;
  55. }