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.

34 lines
652 B

  1. #include "XNetSDKTest.h"
  2. #include "TestFuns.h"
  3. #include <time.h>
  4. void OnDevSnap(int nResult, const char *pData, int nDataLen, int nSeq)
  5. {
  6. printf("%s->Result[%d]\r\n", __FUNCTION__, nResult);
  7. if (nResult >= 0)
  8. {
  9. static int s_index = 0;
  10. char szFile[256] = {0};
  11. sprintf(szFile, "%d_%d.jpg", s_index++, (int)time(NULL));
  12. ToFile(szFile, pData, nDataLen);
  13. }
  14. }
  15. int TestDevSnap()
  16. {
  17. printf("%s\r\n", __FUNCTION__);
  18. char c = 'a';
  19. printf("q-->To exit.\r\n", __FUNCTION__);
  20. while((c = getchar()) != 'q')
  21. {
  22. switch(c)
  23. {
  24. case 'g':
  25. {
  26. XSDK_DevSnap(g_hDevice, 0, "", 0);
  27. }
  28. break;
  29. }
  30. }
  31. return 0;
  32. }