lightduer_timestamp.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /**
  2. * Copyright (2017) Baidu Inc. All rights reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. // Author: Su Hao (suhao@baidu.com)
  17. //
  18. // Description: The timestamp APIs.
  19. #ifndef BAIDU_IOT_TINYDU_IOT_OS_SRC_IOT_BAIDU_CA_SOURCE_BAIDU_CA_TIMESTAMP_H
  20. #define BAIDU_IOT_TINYDU_IOT_OS_SRC_IOT_BAIDU_CA_SOURCE_BAIDU_CA_TIMESTAMP_H
  21. #include "lightduer_types.h"
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /*
  26. * Obtain the system timestamp by milliseconds
  27. *
  28. * @Return duer_u32_t, the system timestamp by milliseconds
  29. */
  30. DUER_INT duer_u32_t duer_timestamp(void);
  31. /*
  32. * The timestamp callbacks
  33. * Return the timestamp by milliseconds
  34. */
  35. typedef duer_u32_t (*duer_timestamp_f)();
  36. /*
  37. * Initial the timestamp callbacks for Baidu CA
  38. *
  39. * @Param f_timestamp, in, the function obtain the timestamp
  40. */
  41. DUER_EXT void baidu_ca_timestamp_init(duer_timestamp_f f_timestamp);
  42. #ifdef __cplusplus
  43. }
  44. #endif
  45. #endif // BAIDU_IOT_TINYDU_IOT_OS_SRC_IOT_BAIDU_CA_SOURCE_BAIDU_CA_TIMESTAMP_H