qxwz_sdk_os.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef QXWZ_SDK_OS_H__
  2. #define QXWZ_SDK_OS_H__
  3. #include "gnss_config.h"
  4. //#include "qxwz_sdk_type.h"
  5. /**
  6. * sleep
  7. * params:
  8. time : the milliseconds
  9. * returns:
  10. 0 is ok
  11. */
  12. unsigned int qx_os_msleep(unsigned int time);
  13. /**
  14. * get current unix time
  15. * params:
  16. * returns:
  17. return current time, in units of millisecond
  18. */
  19. long long qx_os_gettime();
  20. /**
  21. * set current time for sdk use only
  22. * params:
  23. * returns:
  24. return current time, in units of millisecond
  25. */
  26. void qx_os_settime(unsigned long long tm);
  27. /**
  28. * memory alloc
  29. * params:
  30. size : size of the memory block to be allocated, in units of byte
  31. * returns:
  32. if success will return a void pointer to the allocated memory block. NULL if failed.
  33. */
  34. void *qx_os_malloc(unsigned int size);
  35. /**
  36. * free memory
  37. * params:
  38. * returns:
  39. return current time, in units of millisecond
  40. */
  41. void qx_os_free(void *p);
  42. void qx_os_memcpy(void *dst, const void *src, unsigned int size);
  43. void qx_os_memset(void *dst, int value, unsigned int size);
  44. /**
  45. * get memory malloc/free count for debug
  46. * params:
  47. * returns:
  48. return the difference between the count of malloc and free
  49. */
  50. int qx_os_get_memory_log();
  51. /**
  52. * print debug log
  53. * params:
  54. * returns:
  55. Upon successful return, these functions return the number of characters printed,
  56. If an output error is encountered, a negative value is returned.
  57. */
  58. int qx_os_printf(const char *format, ...);
  59. #endif