gateway.c 873 B

1234567891011121314151617181920212223242526272829
  1. /**
  2. * @Author: 李建
  3. * @Date: 12/17/2023, 8:54:41 PM
  4. * @LastEditors: 李建
  5. * @LastEditTime: 12/17/2023, 8:54:41 PM
  6. * Description: 网关组件,负责执行接入平台的任务
  7. * Copyright: Copyright (©)}) 2023 永续绿建. All rights reserved.
  8. */
  9. #include "gateway.h"
  10. #include "esp_log.h"
  11. #include "gateway_defs.h"
  12. #include "register.h"
  13. #include "../sub_device/zero_device.h"
  14. #include "freertos/FreeRTOS.h"
  15. #include "freertos/task.h"
  16. static const char *TAG = "GATEWAY";
  17. bool is_zero_init = false;
  18. void yxlj_gateway_init() {
  19. ESP_LOGI(TAG, "gateway init....");
  20. if (!is_zero_init) sparrow_zero_device_init();
  21. // start device register task;
  22. BaseType_t result = xTaskCreate(&device_register_task, "register task", 1024 * 4, NULL, 1, NULL);
  23. if(result != pdPASS) {
  24. ESP_LOGE(TAG, "gateway init fault....");
  25. esp_restart();
  26. }
  27. }