1234567891011121314151617181920212223242526272829 |
- /**
- * @Author: 李建
- * @Date: 12/17/2023, 8:54:41 PM
- * @LastEditors: 李建
- * @LastEditTime: 12/17/2023, 8:54:41 PM
- * Description: 网关组件,负责执行接入平台的任务
- * Copyright: Copyright (©)}) 2023 永续绿建. All rights reserved.
- */
- #include "gateway.h"
- #include "esp_log.h"
- #include "gateway_defs.h"
- #include "register.h"
- #include "../sub_device/zero_device.h"
- #include "freertos/FreeRTOS.h"
- #include "freertos/task.h"
- static const char *TAG = "GATEWAY";
- bool is_zero_init = false;
- void yxlj_gateway_init() {
- ESP_LOGI(TAG, "gateway init....");
- if (!is_zero_init) sparrow_zero_device_init();
- // start device register task;
- BaseType_t result = xTaskCreate(&device_register_task, "register task", 1024 * 4, NULL, 1, NULL);
- if(result != pdPASS) {
- ESP_LOGE(TAG, "gateway init fault....");
- esp_restart();
- }
- }
|