lightduer_engine.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. /**
  17. * File: lightduer_engine.h
  18. * Auth: Su Hao (suhao@baidu.com)
  19. * Desc: Light duer IoT CA engine.
  20. */
  21. #ifndef BAIDU_DUER_LIGHTDUER_INCLUDE_LIGHTDUER_ENGINE_H
  22. #define BAIDU_DUER_LIGHTDUER_INCLUDE_LIGHTDUER_ENGINE_H
  23. #include "baidu_json.h"
  24. #include "lightduer_types.h"
  25. #include "lightduer_coap_defs.h"
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. enum duer_engine_events_enum {
  30. DUER_EVT_CREATE,
  31. DUER_EVT_START,
  32. DUER_EVT_ADD_RESOURCES,
  33. DUER_EVT_SEND_DATA,
  34. DUER_EVT_DATA_AVAILABLE,
  35. DUER_EVT_STOP,
  36. DUER_EVT_DESTROY,
  37. DUER_EVENTS_TOTAL
  38. };
  39. typedef void (*duer_engine_notify_func)(int event, int status, int what, void *object);
  40. void duer_engine_register_notify(duer_engine_notify_func func);
  41. void duer_engine_create(int what, void *object);
  42. void duer_engine_set_response_callback(int what, void *object);
  43. void duer_engine_start(int what, void *object);
  44. void duer_engine_add_resources(int what, void *object);
  45. void duer_engine_data_available(int what, void *object);
  46. int duer_engine_enqueue_report_data(duer_context_t *context, const baidu_json *data);
  47. void duer_engine_send(int what, void *object);
  48. void duer_engine_stop(int what, void *object);
  49. void duer_engine_destroy(int what, void *object);
  50. int duer_engine_qcache_length(void);
  51. duer_bool duer_engine_is_started(void);
  52. void duer_engine_clear_data(int what, void *object);
  53. const char *duer_engine_get_uuid(void);
  54. const char *duer_engine_get_bind_token(void);
  55. const char *duer_engine_get_rsa_cacrt(void);
  56. #ifdef __cplusplus
  57. }
  58. #endif
  59. #endif/*BAIDU_DUER_LIGHTDUER_INCLUDE_LIGHTDUER_ENGINE_H*/