From d03acb4530e2b380c0f3cdaabbeefb79bc92b9cf Mon Sep 17 00:00:00 2001 From: Krishna Kumar Sah Date: Wed, 14 Feb 2024 17:21:04 +0545 Subject: [PATCH 01/27] working on wss: testing example --- CMakeLists.txt | 2 +- main/CMakeLists.txt | 4 +- main/certs/cacert.pem | 19 +++ main/certs/prvtkey.pem | 28 ++++ main/component.mk | 7 + main/wss_keep_alive.c | 229 ++++++++++++++++++++++++++++++ main/wss_keep_alive.h | 96 +++++++++++++ main/wss_server.c | 306 +++++++++++++++++++++++++++++++++++++++++ sdkconfig | 44 +++++- sdkconfig.old | 14 +- 10 files changed, 739 insertions(+), 10 deletions(-) create mode 100644 main/certs/cacert.pem create mode 100644 main/certs/prvtkey.pem create mode 100644 main/component.mk create mode 100644 main/wss_keep_alive.c create mode 100644 main/wss_keep_alive.h create mode 100644 main/wss_server.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e2b7171f..523f03212 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,7 +53,7 @@ foreach(component ${external_components_list}) LIST(APPEND ALL_COMPONENTS ${SUBDIRS}) endforeach() -set(EXTRA_COMPONENT_DIRS ${ALL_COMPONENTS}) # add the list of directories 'SUBDIRS' to 'EXTRA_COMPONENT_DIRS'(ESP32 VARIABLES), links the external components +set(EXTRA_COMPONENT_DIRS ${ALL_COMPONENTS} $ENV{IDF_PATH}/examples/common_components/protocol_examples_common) # add the list of directories 'SUBDIRS' to 'EXTRA_COMPONENT_DIRS'(ESP32 VARIABLES), links the external components message(STATUS "EXTRA_COMPONENTS_DIRS: ${EXTRA_COMPONENTS_DIRS}\r\n") ## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ## diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 43d1de443..812b3a18d 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -57,11 +57,13 @@ set(EZLOPI_SERVICES ) # Register the components -idf_component_register(SRCS "${config_src}" +idf_component_register(SRCS "wss_server.c" "${config_src}" INCLUDE_DIRS "." REQUIRES ${EZLOPI_CORE_COMPONENTS} ${EZLOPI_HAL_COMPONENTS} ${EZLOPI_CLOUD_COMPONENTS} ${EZLOPI_SENSOR_DEVICE_COMPONENTS} ${EZLOPI_SERVICES} + EMBED_TXTFILES "certs/cacert.pem" + "certs/prvtkey.pem" ) diff --git a/main/certs/cacert.pem b/main/certs/cacert.pem new file mode 100644 index 000000000..cd2b80c82 --- /dev/null +++ b/main/certs/cacert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDKzCCAhOgAwIBAgIUBxM3WJf2bP12kAfqhmhhjZWv0ukwDQYJKoZIhvcNAQEL +BQAwJTEjMCEGA1UEAwwaRVNQMzIgSFRUUFMgc2VydmVyIGV4YW1wbGUwHhcNMTgx +MDE3MTEzMjU3WhcNMjgxMDE0MTEzMjU3WjAlMSMwIQYDVQQDDBpFU1AzMiBIVFRQ +UyBzZXJ2ZXIgZXhhbXBsZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +ALBint6nP77RCQcmKgwPtTsGK0uClxg+LwKJ3WXuye3oqnnjqJCwMEneXzGdG09T +sA0SyNPwrEgebLCH80an3gWU4pHDdqGHfJQa2jBL290e/5L5MB+6PTs2NKcojK/k +qcZkn58MWXhDW1NpAnJtjVniK2Ksvr/YIYSbyD+JiEs0MGxEx+kOl9d7hRHJaIzd +GF/vO2pl295v1qXekAlkgNMtYIVAjUy9CMpqaQBCQRL+BmPSJRkXBsYk8GPnieS4 +sUsp53DsNvCCtWDT6fd9D1v+BB6nDk/FCPKhtjYOwOAZlX4wWNSZpRNr5dfrxKsb +jAn4PCuR2akdF4G8WLUeDWECAwEAAaNTMFEwHQYDVR0OBBYEFMnmdJKOEepXrHI/ +ivM6mVqJgAX8MB8GA1UdIwQYMBaAFMnmdJKOEepXrHI/ivM6mVqJgAX8MA8GA1Ud +EwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBADiXIGEkSsN0SLSfCF1VNWO3 +emBurfOcDq4EGEaxRKAU0814VEmU87btIDx80+z5Dbf+GGHCPrY7odIkxGNn0DJY +W1WcF+DOcbiWoUN6DTkAML0SMnp8aGj9ffx3x+qoggT+vGdWVVA4pgwqZT7Ybntx +bkzcNFW0sqmCv4IN1t4w6L0A87ZwsNwVpre/j6uyBw7s8YoJHDLRFT6g7qgn0tcN +ZufhNISvgWCVJQy/SZjNBHSpnIdCUSJAeTY2mkM4sGxY0Widk8LnjydxZUSxC3Nl +hb6pnMh3jRq4h0+5CZielA4/a+TdrNPv/qok67ot/XJdY3qHCCd8O2b14OVq9jo= +-----END CERTIFICATE----- diff --git a/main/certs/prvtkey.pem b/main/certs/prvtkey.pem new file mode 100644 index 000000000..70d29078c --- /dev/null +++ b/main/certs/prvtkey.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCwYp7epz++0QkH +JioMD7U7BitLgpcYPi8Cid1l7snt6Kp546iQsDBJ3l8xnRtPU7ANEsjT8KxIHmyw +h/NGp94FlOKRw3ahh3yUGtowS9vdHv+S+TAfuj07NjSnKIyv5KnGZJ+fDFl4Q1tT +aQJybY1Z4itirL6/2CGEm8g/iYhLNDBsRMfpDpfXe4URyWiM3Rhf7ztqZdveb9al +3pAJZIDTLWCFQI1MvQjKamkAQkES/gZj0iUZFwbGJPBj54nkuLFLKedw7DbwgrVg +0+n3fQ9b/gQepw5PxQjyobY2DsDgGZV+MFjUmaUTa+XX68SrG4wJ+DwrkdmpHReB +vFi1Hg1hAgMBAAECggEAaTCnZkl/7qBjLexIryC/CBBJyaJ70W1kQ7NMYfniWwui +f0aRxJgOdD81rjTvkINsPp+xPRQO6oOadjzdjImYEuQTqrJTEUnntbu924eh+2D9 +Mf2CAanj0mglRnscS9mmljZ0KzoGMX6Z/EhnuS40WiJTlWlH6MlQU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8v/X2CFll96 +-----END PRIVATE KEY----- diff --git a/main/component.mk b/main/component.mk new file mode 100644 index 000000000..b120d66e5 --- /dev/null +++ b/main/component.mk @@ -0,0 +1,7 @@ +# +# "main" pseudo-component makefile. +# +# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) + +COMPONENT_EMBED_TXTFILES := certs/cacert.pem +COMPONENT_EMBED_TXTFILES += certs/prvtkey.pem diff --git a/main/wss_keep_alive.c b/main/wss_keep_alive.c new file mode 100644 index 000000000..cc1e302d0 --- /dev/null +++ b/main/wss_keep_alive.c @@ -0,0 +1,229 @@ +/* Keep Alive engine for wss server example + + This example code is in the Public Domain (or CC0 licensed, at your option.) + + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. +*/ + +#include +#include +#include "freertos/FreeRTOS.h" +#include "freertos/queue.h" +#include "freertos/task.h" +#include "wss_keep_alive.h" +#include "esp_timer.h" + +typedef enum { + NO_CLIENT = 0, + CLIENT_FD_ADD, + CLIENT_FD_REMOVE, + CLIENT_UPDATE, + CLIENT_ACTIVE, + STOP_TASK, +} client_fd_action_type_t; + +typedef struct { + client_fd_action_type_t type; + int fd; + uint64_t last_seen; +} client_fd_action_t; + +typedef struct wss_keep_alive_storage { + size_t max_clients; + wss_check_client_alive_cb_t check_client_alive_cb; + wss_check_client_alive_cb_t client_not_alive_cb; + size_t keep_alive_period_ms; + size_t not_alive_after_ms; + void * user_ctx; + QueueHandle_t q; + client_fd_action_t clients[]; +} wss_keep_alive_storage_t; + +typedef struct wss_keep_alive_storage* wss_keep_alive_t; + +static const char *TAG = "wss_keep_alive"; + +static uint64_t _tick_get_ms(void) +{ + return esp_timer_get_time()/1000; +} + +// Goes over active clients to find out how long we could sleep before checking who's alive +static uint64_t get_max_delay(wss_keep_alive_t h) +{ + int64_t check_after_ms = 30000; // max delay, no need to check anyone + for (int i=0; imax_clients; ++i) { + if (h->clients[i].type == CLIENT_ACTIVE) { + uint64_t check_this_client_at = h->clients[i].last_seen + h->keep_alive_period_ms; + if (check_this_client_at < check_after_ms + _tick_get_ms()) { + check_after_ms = check_this_client_at - _tick_get_ms(); + if (check_after_ms < 0) { + check_after_ms = 1000; // min delay, some client(s) not responding already + } + } + } + } + return check_after_ms; +} + + +static bool update_client(wss_keep_alive_t h, int sockfd, uint64_t timestamp) +{ + for (int i=0; imax_clients; ++i) { + if (h->clients[i].type == CLIENT_ACTIVE && h->clients[i].fd == sockfd) { + h->clients[i].last_seen = timestamp; + return true; + } + } + return false; +} + +static bool remove_client(wss_keep_alive_t h, int sockfd) +{ + for (int i=0; imax_clients; ++i) { + if (h->clients[i].type == CLIENT_ACTIVE && h->clients[i].fd == sockfd) { + h->clients[i].type = NO_CLIENT; + h->clients[i].fd = -1; + return true; + } + } + return false; +} +static bool add_new_client(wss_keep_alive_t h,int sockfd) +{ + for (int i=0; imax_clients; ++i) { + if (h->clients[i].type == NO_CLIENT) { + h->clients[i].type = CLIENT_ACTIVE; + h->clients[i].fd = sockfd; + h->clients[i].last_seen = _tick_get_ms(); + return true; // success + } + } + return false; +} + +static void keep_alive_task(void* arg) +{ + wss_keep_alive_storage_t *keep_alive_storage = arg; + bool run_task = true; + client_fd_action_t client_action; + while (run_task) { + if (xQueueReceive(keep_alive_storage->q, (void *) &client_action, + get_max_delay(keep_alive_storage) / portTICK_PERIOD_MS) == pdTRUE) { + switch (client_action.type) { + case CLIENT_FD_ADD: + if (!add_new_client(keep_alive_storage, client_action.fd)) { + ESP_LOGE(TAG, "Cannot add new client"); + } + break; + case CLIENT_FD_REMOVE: + if (!remove_client(keep_alive_storage, client_action.fd)) { + ESP_LOGE(TAG, "Cannot remove client fd:%d", client_action.fd); + } + break; + case CLIENT_UPDATE: + if (!update_client(keep_alive_storage, client_action.fd, client_action.last_seen)) { + ESP_LOGE(TAG, "Cannot find client fd:%d", client_action.fd); + } + break; + case STOP_TASK: + run_task = false; + break; + default: + ESP_LOGE(TAG, "Unexpected client action"); + break; + } + } else { + // timeout: check if PING message needed + for (int i=0; imax_clients; ++i) { + if (keep_alive_storage->clients[i].type == CLIENT_ACTIVE) { + if (keep_alive_storage->clients[i].last_seen + keep_alive_storage->keep_alive_period_ms <= _tick_get_ms()) { + ESP_LOGD(TAG, "Haven't seen the client (fd=%d) for a while", keep_alive_storage->clients[i].fd); + if (keep_alive_storage->clients[i].last_seen + keep_alive_storage->not_alive_after_ms <= _tick_get_ms()) { + ESP_LOGE(TAG, "Client (fd=%d) not alive!", keep_alive_storage->clients[i].fd); + keep_alive_storage->client_not_alive_cb(keep_alive_storage, keep_alive_storage->clients[i].fd); + } else { + keep_alive_storage->check_client_alive_cb(keep_alive_storage, keep_alive_storage->clients[i].fd); + } + } + } + } + } + } + vQueueDelete(keep_alive_storage->q); + free(keep_alive_storage); + + vTaskDelete(NULL); +} + +wss_keep_alive_t wss_keep_alive_start(wss_keep_alive_config_t *config) +{ + size_t queue_size = config->max_clients/2; + size_t client_list_size = config->max_clients + queue_size; + wss_keep_alive_t keep_alive_storage = calloc(1, + sizeof(wss_keep_alive_storage_t) + client_list_size* sizeof(client_fd_action_t)); + if (keep_alive_storage == NULL) { + return false; + } + keep_alive_storage->check_client_alive_cb = config->check_client_alive_cb; + keep_alive_storage->client_not_alive_cb = config->client_not_alive_cb; + keep_alive_storage->max_clients = config->max_clients; + keep_alive_storage->not_alive_after_ms = config->not_alive_after_ms; + keep_alive_storage->keep_alive_period_ms = config->keep_alive_period_ms; + keep_alive_storage->user_ctx = config->user_ctx; + keep_alive_storage->q = xQueueCreate(queue_size, sizeof(client_fd_action_t)); + if (xTaskCreate(keep_alive_task, "keep_alive_task", config->task_stack_size, + keep_alive_storage, config->task_prio, NULL) != pdTRUE) { + wss_keep_alive_stop(keep_alive_storage); + return false; + } + return keep_alive_storage; +} + +void wss_keep_alive_stop(wss_keep_alive_t h) +{ + client_fd_action_t stop = { .type = STOP_TASK }; + xQueueSendToBack(h->q, &stop, 0); + // internal structs will be de-allocated in the task +} + +esp_err_t wss_keep_alive_add_client(wss_keep_alive_t h, int fd) +{ + client_fd_action_t client_fd_action = { .fd = fd, .type = CLIENT_FD_ADD}; + if (xQueueSendToBack(h->q, &client_fd_action, 0) == pdTRUE) { + return ESP_OK; + } + return ESP_FAIL; +} + +esp_err_t wss_keep_alive_remove_client(wss_keep_alive_t h, int fd) +{ + client_fd_action_t client_fd_action = { .fd = fd, .type = CLIENT_FD_REMOVE}; + if (xQueueSendToBack(h->q, &client_fd_action, 0) == pdTRUE) { + return ESP_OK; + } + return ESP_FAIL; +} + +esp_err_t wss_keep_alive_client_is_active(wss_keep_alive_t h, int fd) +{ + client_fd_action_t client_fd_action = { .fd = fd, .type = CLIENT_UPDATE, + .last_seen = _tick_get_ms()}; + if (xQueueSendToBack(h->q, &client_fd_action, 0) == pdTRUE) { + return ESP_OK; + } + return ESP_FAIL; + +} + +void wss_keep_alive_set_user_ctx(wss_keep_alive_t h, void *ctx) +{ + h->user_ctx = ctx; +} + +void* wss_keep_alive_get_user_ctx(wss_keep_alive_t h) +{ + return h->user_ctx; +} diff --git a/main/wss_keep_alive.h b/main/wss_keep_alive.h new file mode 100644 index 000000000..add3b68f1 --- /dev/null +++ b/main/wss_keep_alive.h @@ -0,0 +1,96 @@ +/* Keep Alive engine for wss server example + + This example code is in the Public Domain (or CC0 licensed, at your option.) + + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. +*/ +#pragma once + +#define KEEP_ALIVE_CONFIG_DEFAULT() \ + { \ + .max_clients = 10, \ + .task_stack_size = 2048, \ + .task_prio = tskIDLE_PRIORITY+1, \ + .keep_alive_period_ms = 5000, \ + .not_alive_after_ms = 10000, \ +} + +struct wss_keep_alive_storage; +typedef struct wss_keep_alive_storage* wss_keep_alive_t; +typedef bool (*wss_check_client_alive_cb_t)(wss_keep_alive_t h, int fd); +typedef bool (*wss_client_not_alive_cb_t)(wss_keep_alive_t h, int fd); + +/** + * @brief Confiuration struct + */ +typedef struct { + size_t max_clients; /*!< max number of clients */ + size_t task_stack_size; /*!< stack size of the created task */ + size_t task_prio; /*!< priority of the created task */ + size_t keep_alive_period_ms; /*!< check every client after this time */ + size_t not_alive_after_ms; /*!< consider client not alive after this time */ + wss_check_client_alive_cb_t check_client_alive_cb; /*!< callback function to check if client is alive */ + wss_client_not_alive_cb_t client_not_alive_cb; /*!< callback function to notify that the client is not alive */ + void *user_ctx; /*!< user context available in the keep-alive handle */ +} wss_keep_alive_config_t; + +/** + * @brief Adds a new client to internal set of clients to keep an eye on + * + * @param h keep-alive handle + * @param fd socket file descriptor for this client + * @return ESP_OK on success + */ +esp_err_t wss_keep_alive_add_client(wss_keep_alive_t h, int fd); + +/** + * @brief Removes this client from the set + * + * @param h keep-alive handle + * @param fd socket file descriptor for this client + * @return ESP_OK on success + */ +esp_err_t wss_keep_alive_remove_client(wss_keep_alive_t h, int fd); + +/** + * @brief Notify that this client is alive + * + * @param h keep-alive handle + * @param fd socket file descriptor for this client + * @return ESP_OK on success + */ + +esp_err_t wss_keep_alive_client_is_active(wss_keep_alive_t h, int fd); + +/** + * @brief Starts keep-alive engine + * + * @param config keep-alive configuration + * @return keep alive handle + */ +wss_keep_alive_t wss_keep_alive_start(wss_keep_alive_config_t *config); + +/** + * @brief Stops keep-alive engine + * + * @param h keep-alive handle + */ +void wss_keep_alive_stop(wss_keep_alive_t h); + +/** + * @brief Sets user defined context + * + * @param h keep-alive handle + * @param ctx user context + */ +void wss_keep_alive_set_user_ctx(wss_keep_alive_t h, void *ctx); + +/** + * @brief Gets user defined context + * + * @param h keep-alive handle + * @return ctx user context + */ +void* wss_keep_alive_get_user_ctx(wss_keep_alive_t h); diff --git a/main/wss_server.c b/main/wss_server.c new file mode 100644 index 000000000..42dd6013b --- /dev/null +++ b/main/wss_server.c @@ -0,0 +1,306 @@ +/* Simple HTTP + SSL + WS Server Example + + This example code is in the Public Domain (or CC0 licensed, at your option.) + + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. +*/ + +#include +#include +#include +#include +#include +#include "esp_netif.h" +#include "esp_eth.h" +// #include "protocol_examples_common.h" +#include "lwip/sockets.h" +#include +#include "wss_keep_alive.h" +#include "../build/config/sdkconfig.h" + +#if !CONFIG_HTTPD_WS_SUPPORT +#error This example cannot be used unless HTTPD_WS_SUPPORT is enabled in esp-http-server component configuration +#endif + +static httpd_handle_t server = NULL; + +struct async_resp_arg +{ + httpd_handle_t hd; + int fd; +}; + +// HTTPD_WS_SUPPORT + +static const char *TAG = "wss_echo_server"; +static const size_t max_clients = 4; + +static esp_err_t ws_handler(httpd_req_t *req) +{ + if (req->method == HTTP_GET) + { + ESP_LOGI(TAG, "Handshake done, the new connection was opened"); + return ESP_OK; + } + httpd_ws_frame_t ws_pkt; + uint8_t *buf = NULL; + memset(&ws_pkt, 0, sizeof(httpd_ws_frame_t)); + + // First receive the full ws message + /* Set max_len = 0 to get the frame len */ + esp_err_t ret = httpd_ws_recv_frame(req, &ws_pkt, 0); + if (ret != ESP_OK) + { + ESP_LOGE(TAG, "httpd_ws_recv_frame failed to get frame len with %d", ret); + return ret; + } + ESP_LOGI(TAG, "frame len is %d", ws_pkt.len); + if (ws_pkt.len) + { + /* ws_pkt.len + 1 is for NULL termination as we are expecting a string */ + buf = calloc(1, ws_pkt.len + 1); + if (buf == NULL) + { + ESP_LOGE(TAG, "Failed to calloc memory for buf"); + return ESP_ERR_NO_MEM; + } + ws_pkt.payload = buf; + /* Set max_len = ws_pkt.len to get the frame payload */ + ret = httpd_ws_recv_frame(req, &ws_pkt, ws_pkt.len); + if (ret != ESP_OK) + { + ESP_LOGE(TAG, "httpd_ws_recv_frame failed with %d", ret); + free(buf); + return ret; + } + } + // If it was a PONG, update the keep-alive + if (ws_pkt.type == HTTPD_WS_TYPE_PONG) + { + ESP_LOGD(TAG, "Received PONG message"); + free(buf); + return wss_keep_alive_client_is_active(httpd_get_global_user_ctx(req->handle), + httpd_req_to_sockfd(req)); + + // If it was a TEXT message, just echo it back + } + else if (ws_pkt.type == HTTPD_WS_TYPE_TEXT || ws_pkt.type == HTTPD_WS_TYPE_PING || ws_pkt.type == HTTPD_WS_TYPE_CLOSE) + { + if (ws_pkt.type == HTTPD_WS_TYPE_TEXT) + { + ESP_LOGI(TAG, "Received packet with message: %s", ws_pkt.payload); + } + else if (ws_pkt.type == HTTPD_WS_TYPE_PING) + { + // Response PONG packet to peer + ESP_LOGI(TAG, "Got a WS PING frame, Replying PONG"); + ws_pkt.type = HTTPD_WS_TYPE_PONG; + } + else if (ws_pkt.type == HTTPD_WS_TYPE_CLOSE) + { + // Response CLOSE packet with no payload to peer + ws_pkt.len = 0; + ws_pkt.payload = NULL; + } + ret = httpd_ws_send_frame(req, &ws_pkt); + if (ret != ESP_OK) + { + ESP_LOGE(TAG, "httpd_ws_send_frame failed with %d", ret); + } + ESP_LOGI(TAG, "ws_handler: httpd_handle_t=%p, sockfd=%d, client_info:%d", req->handle, + httpd_req_to_sockfd(req), httpd_ws_get_fd_info(req->handle, httpd_req_to_sockfd(req))); + free(buf); + return ret; + } + free(buf); + return ESP_OK; +} + +esp_err_t wss_open_fd(httpd_handle_t hd, int sockfd) +{ + ESP_LOGI(TAG, "New client connected %d", sockfd); + wss_keep_alive_t h = httpd_get_global_user_ctx(hd); + return wss_keep_alive_add_client(h, sockfd); +} + +void wss_close_fd(httpd_handle_t hd, int sockfd) +{ + ESP_LOGI(TAG, "Client disconnected %d", sockfd); + wss_keep_alive_t h = httpd_get_global_user_ctx(hd); + wss_keep_alive_remove_client(h, sockfd); + close(sockfd); +} + +static const httpd_uri_t ws = { + .uri = "/ws", + .method = HTTP_GET, + .handler = ws_handler, + .user_ctx = NULL, + .is_websocket = true, + .handle_ws_control_frames = true}; + +static void send_hello(void *arg) +{ + static const char *data = "Hello client"; + struct async_resp_arg *resp_arg = arg; + httpd_handle_t hd = resp_arg->hd; + int fd = resp_arg->fd; + httpd_ws_frame_t ws_pkt; + memset(&ws_pkt, 0, sizeof(httpd_ws_frame_t)); + ws_pkt.payload = (uint8_t *)data; + ws_pkt.len = strlen(data); + ws_pkt.type = HTTPD_WS_TYPE_TEXT; + + httpd_ws_send_frame_async(hd, fd, &ws_pkt); + free(resp_arg); +} + +static void send_ping(void *arg) +{ + struct async_resp_arg *resp_arg = arg; + httpd_handle_t hd = resp_arg->hd; + int fd = resp_arg->fd; + httpd_ws_frame_t ws_pkt; + memset(&ws_pkt, 0, sizeof(httpd_ws_frame_t)); + ws_pkt.payload = NULL; + ws_pkt.len = 0; + ws_pkt.type = HTTPD_WS_TYPE_PING; + + httpd_ws_send_frame_async(hd, fd, &ws_pkt); + free(resp_arg); +} + +bool client_not_alive_cb(wss_keep_alive_t h, int fd) +{ + ESP_LOGE(TAG, "Client not alive, closing fd %d", fd); + httpd_sess_trigger_close(wss_keep_alive_get_user_ctx(h), fd); + return true; +} + +bool check_client_alive_cb(wss_keep_alive_t h, int fd) +{ + ESP_LOGD(TAG, "Checking if client (fd=%d) is alive", fd); + struct async_resp_arg *resp_arg = malloc(sizeof(struct async_resp_arg)); + resp_arg->hd = wss_keep_alive_get_user_ctx(h); + resp_arg->fd = fd; + + if (httpd_queue_work(resp_arg->hd, send_ping, resp_arg) == ESP_OK) + { + return true; + } + return false; +} + +static httpd_handle_t start_wss_echo_server(void) +{ + // Prepare keep-alive engine + wss_keep_alive_config_t keep_alive_config = KEEP_ALIVE_CONFIG_DEFAULT(); + keep_alive_config.max_clients = max_clients; + keep_alive_config.client_not_alive_cb = client_not_alive_cb; + keep_alive_config.check_client_alive_cb = check_client_alive_cb; + wss_keep_alive_t keep_alive = wss_keep_alive_start(&keep_alive_config); + + // Start the httpd server + httpd_handle_t server = NULL; + ESP_LOGI(TAG, "Starting server"); + + httpd_ssl_config_t conf = HTTPD_SSL_CONFIG_DEFAULT(); + conf.httpd.max_open_sockets = max_clients; + conf.httpd.global_user_ctx = keep_alive; + conf.httpd.open_fn = wss_open_fd; + conf.httpd.close_fn = wss_close_fd; + + extern const unsigned char cacert_pem_start[] asm("_binary_cacert_pem_start"); + extern const unsigned char cacert_pem_end[] asm("_binary_cacert_pem_end"); + conf.cacert_pem = cacert_pem_start; + conf.cacert_len = cacert_pem_end - cacert_pem_start; + + extern const unsigned char prvtkey_pem_start[] asm("_binary_prvtkey_pem_start"); + extern const unsigned char prvtkey_pem_end[] asm("_binary_prvtkey_pem_end"); + conf.prvtkey_pem = prvtkey_pem_start; + conf.prvtkey_len = prvtkey_pem_end - prvtkey_pem_start; + + esp_err_t ret = httpd_ssl_start(&server, &conf); + if (ESP_OK != ret) + { + ESP_LOGI(TAG, "Error starting server!"); + return NULL; + } + + // Set URI handlers + ESP_LOGI(TAG, "Registering URI handlers"); + httpd_register_uri_handler(server, &ws); + wss_keep_alive_set_user_ctx(keep_alive, server); + + return server; +} + +static void stop_wss_echo_server(httpd_handle_t server) +{ + // Stop keep alive thread + wss_keep_alive_stop(httpd_get_global_user_ctx(server)); + // Stop the httpd server + httpd_ssl_stop(server); +} + +static void disconnect_handler(void *arg, esp_event_base_t event_base, + int32_t event_id, void *event_data) +{ + httpd_handle_t *server = (httpd_handle_t *)arg; + if (*server) + { + stop_wss_echo_server(*server); + *server = NULL; + } +} + +static void connect_handler(void *arg, esp_event_base_t event_base, + int32_t event_id, void *event_data) +{ + httpd_handle_t *server = (httpd_handle_t *)arg; + if (*server == NULL) + { + *server = start_wss_echo_server(); + } +} + +// Get all clients and send async message +esp_err_t wss_server_broadcast_messages(httpd_handle_t *server) +{ + esp_err_t ret = ESP_OK; + + if (server && server) + { + bool send_messages = true; + size_t clients = max_clients; + int client_fds[max_clients]; + if (httpd_get_client_list(*server, &clients, client_fds) == ESP_OK) + { + for (size_t i = 0; i < clients; ++i) + { + int sock = client_fds[i]; + if (httpd_ws_get_fd_info(*server, sock) == HTTPD_WS_CLIENT_WEBSOCKET) + { + ESP_LOGI(TAG, "Active client (fd=%d) -> sending async message", sock); + struct async_resp_arg *resp_arg = malloc(sizeof(struct async_resp_arg)); + resp_arg->hd = *server; + resp_arg->fd = sock; + if (httpd_queue_work(resp_arg->hd, send_hello, resp_arg) != ESP_OK) + { + ESP_LOGE(TAG, "httpd_queue_work failed!"); + send_messages = false; + break; + } + } + } + } + else + { + ESP_LOGE(TAG, "httpd_get_client_list failed!"); + } + } + + return ret; +} \ No newline at end of file diff --git a/sdkconfig b/sdkconfig index 16fd34865..03a13159f 100644 --- a/sdkconfig +++ b/sdkconfig @@ -144,6 +144,42 @@ CONFIG_PARTITION_TABLE_OFFSET=0x8000 CONFIG_PARTITION_TABLE_MD5=y # end of Partition Table +# +# Example Connection Configuration +# +CONFIG_EXAMPLE_GPIO_RANGE_MIN=0 +CONFIG_EXAMPLE_GPIO_RANGE_MAX=48 +CONFIG_EXAMPLE_CONNECT_WIFI=y +CONFIG_EXAMPLE_WIFI_SSID="myssid" +CONFIG_EXAMPLE_WIFI_PASSWORD="mypassword" +# CONFIG_EXAMPLE_WIFI_SCAN_METHOD_FAST is not set +CONFIG_EXAMPLE_WIFI_SCAN_METHOD_ALL_CHANNEL=y + +# +# WiFi Scan threshold +# +CONFIG_EXAMPLE_WIFI_SCAN_RSSI_THRESHOLD=-127 +CONFIG_EXAMPLE_WIFI_AUTH_OPEN=y +# CONFIG_EXAMPLE_WIFI_AUTH_WEP is not set +# CONFIG_EXAMPLE_WIFI_AUTH_WPA_PSK is not set +# CONFIG_EXAMPLE_WIFI_AUTH_WPA2_PSK is not set +# CONFIG_EXAMPLE_WIFI_AUTH_WPA_WPA2_PSK is not set +# CONFIG_EXAMPLE_WIFI_AUTH_WPA2_ENTERPRISE is not set +# CONFIG_EXAMPLE_WIFI_AUTH_WPA3_PSK is not set +# CONFIG_EXAMPLE_WIFI_AUTH_WPA2_WPA3_PSK is not set +# CONFIG_EXAMPLE_WIFI_AUTH_WAPI_PSK is not set +# end of WiFi Scan threshold + +CONFIG_EXAMPLE_WIFI_CONNECT_AP_BY_SIGNAL=y +# CONFIG_EXAMPLE_WIFI_CONNECT_AP_BY_SECURITY is not set +# CONFIG_EXAMPLE_CONNECT_ETHERNET is not set +CONFIG_EXAMPLE_CONNECT_IPV6=y +CONFIG_EXAMPLE_CONNECT_IPV6_PREF_LOCAL_LINK=y +# CONFIG_EXAMPLE_CONNECT_IPV6_PREF_GLOBAL is not set +# CONFIG_EXAMPLE_CONNECT_IPV6_PREF_SITE_LOCAL is not set +# CONFIG_EXAMPLE_CONNECT_IPV6_PREF_UNIQUE_LOCAL is not set +# end of Example Connection Configuration + # # Compiler options # @@ -564,7 +600,9 @@ CONFIG_EFUSE_MAX_BLK_LEN=256 CONFIG_ESP_TLS_USING_MBEDTLS=y CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y # CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set -# CONFIG_ESP_TLS_SERVER is not set +CONFIG_ESP_TLS_SERVER=y +# CONFIG_ESP_TLS_SERVER_SESSION_TICKETS is not set +# CONFIG_ESP_TLS_SERVER_MIN_AUTH_MODE_OPTIONAL is not set # CONFIG_ESP_TLS_PSK_VERIFICATION is not set # CONFIG_ESP_TLS_INSECURE is not set # end of ESP-TLS @@ -692,7 +730,7 @@ CONFIG_HTTPD_MAX_URI_LEN=512 CONFIG_HTTPD_ERR_RESP_NO_DELAY=y CONFIG_HTTPD_PURGE_BUF_LEN=32 # CONFIG_HTTPD_LOG_PURGE_DATA is not set -# CONFIG_HTTPD_WS_SUPPORT is not set +CONFIG_HTTPD_WS_SUPPORT=y # end of HTTP Server # @@ -704,7 +742,7 @@ CONFIG_HTTPD_PURGE_BUF_LEN=32 # # ESP HTTPS server # -# CONFIG_ESP_HTTPS_SERVER_ENABLE is not set +CONFIG_ESP_HTTPS_SERVER_ENABLE=y # end of ESP HTTPS server # diff --git a/sdkconfig.old b/sdkconfig.old index c379090b4..48a1ae7a6 100644 --- a/sdkconfig.old +++ b/sdkconfig.old @@ -564,7 +564,9 @@ CONFIG_EFUSE_MAX_BLK_LEN=256 CONFIG_ESP_TLS_USING_MBEDTLS=y CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y # CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set -# CONFIG_ESP_TLS_SERVER is not set +CONFIG_ESP_TLS_SERVER=y +# CONFIG_ESP_TLS_SERVER_SESSION_TICKETS is not set +# CONFIG_ESP_TLS_SERVER_MIN_AUTH_MODE_OPTIONAL is not set # CONFIG_ESP_TLS_PSK_VERIFICATION is not set # CONFIG_ESP_TLS_INSECURE is not set # end of ESP-TLS @@ -692,7 +694,7 @@ CONFIG_HTTPD_MAX_URI_LEN=512 CONFIG_HTTPD_ERR_RESP_NO_DELAY=y CONFIG_HTTPD_PURGE_BUF_LEN=32 # CONFIG_HTTPD_LOG_PURGE_DATA is not set -# CONFIG_HTTPD_WS_SUPPORT is not set +CONFIG_HTTPD_WS_SUPPORT=y # end of HTTP Server # @@ -704,7 +706,7 @@ CONFIG_HTTPD_PURGE_BUF_LEN=32 # # ESP HTTPS server # -# CONFIG_ESP_HTTPS_SERVER_ENABLE is not set +CONFIG_ESP_HTTPS_SERVER_ENABLE=y # end of ESP HTTPS server # @@ -1227,7 +1229,10 @@ CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096 -# CONFIG_MBEDTLS_DYNAMIC_BUFFER is not set +CONFIG_MBEDTLS_DYNAMIC_BUFFER=y +CONFIG_MBEDTLS_DYNAMIC_FREE_PEER_CERT=y +CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA=y +CONFIG_MBEDTLS_DYNAMIC_FREE_CA_CERT=y # CONFIG_MBEDTLS_DEBUG is not set # @@ -1237,7 +1242,6 @@ CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096 CONFIG_MBEDTLS_ECDH_LEGACY_CONTEXT=y # CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK is not set # CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION is not set -CONFIG_MBEDTLS_SSL_KEEP_PEER_CERTIFICATE=y # end of mbedTLS v2.28.x related # From 1878140fcda6faab5ee4b3520924a61261b701ed Mon Sep 17 00:00:00 2001 From: Krishna Kumar Sah Date: Thu, 15 Feb 2024 18:17:21 +0545 Subject: [PATCH 02/27] wss --- main/CMakeLists.txt | 1 + release-notes.md | 13 +++++++++++ sdkconfig | 17 ++++++--------- sdkconfig.old | 53 ++++++++++++++++++++++++++++++++++++--------- 4 files changed, 64 insertions(+), 20 deletions(-) create mode 100644 release-notes.md diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 812b3a18d..7bf4b7b1b 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -4,6 +4,7 @@ file(GLOB_RECURSE config_src "*.c") # Define SDK components set(EZLOPI_SDK_COMPONENTS driver + esp_https_server ) # Define ezlopi-components diff --git a/release-notes.md b/release-notes.md new file mode 100644 index 000000000..3499ead8a --- /dev/null +++ b/release-notes.md @@ -0,0 +1,13 @@ +## New Features : +* feature-1: Description + +## New features: Local meshbots +* Implementation of ROOM API: +* Implementation of device-name-set: [EZPI-211](https://jira.mios.com/browse/EZPI-211) +* Addition of framework for house-modes: [EZPI-280](https://jira.mios.com/browse/EZPI-280) + +## Fixes +* segregated populator-functions from scene to make clean code: +5. Debugging issue with 'hub.scene.edit' in team and fixed +6. Found issue with room-and-device logics and fixed +7. encountered several linking issues and fixed \ No newline at end of file diff --git a/sdkconfig b/sdkconfig index 03a13159f..7c4f0e8ef 100644 --- a/sdkconfig +++ b/sdkconfig @@ -106,12 +106,12 @@ CONFIG_ESPTOOLPY_FLASHFREQ="40m" # CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y -# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y # CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE="8MB" +CONFIG_ESPTOOLPY_FLASHSIZE="16MB" CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y CONFIG_ESPTOOLPY_BEFORE_RESET=y # CONFIG_ESPTOOLPY_BEFORE_NORESET is not set @@ -982,10 +982,7 @@ CONFIG_FATFS_PER_FILE_CACHE=y # # Modbus configuration # -CONFIG_FMB_COMM_MODE_TCP_EN=y -CONFIG_FMB_TCP_PORT_DEFAULT=502 -CONFIG_FMB_TCP_PORT_MAX_CONN=5 -CONFIG_FMB_TCP_CONNECTION_TOUT_SEC=20 +# CONFIG_FMB_COMM_MODE_TCP_EN is not set CONFIG_FMB_COMM_MODE_RTU_EN=y CONFIG_FMB_COMM_MODE_ASCII_EN=y CONFIG_FMB_MASTER_TIMEOUT_MS_RESPOND=150 @@ -1032,7 +1029,7 @@ CONFIG_FREERTOS_ASSERT_FAIL_ABORT=y # CONFIG_FREERTOS_ASSERT_DISABLE is not set CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536 CONFIG_FREERTOS_ISR_STACKSIZE=1536 -# CONFIG_FREERTOS_LEGACY_HOOKS is not set +CONFIG_FREERTOS_LEGACY_HOOKS=y CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16 CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y # CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP is not set @@ -1108,7 +1105,7 @@ CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y # # LWIP # -CONFIG_LWIP_LOCAL_HOSTNAME="espressif" +CONFIG_LWIP_LOCAL_HOSTNAME="ezlopi" # CONFIG_LWIP_NETIF_API is not set CONFIG_LWIP_TCPIP_TASK_PRIO=18 # CONFIG_LWIP_TCPIP_CORE_LOCKING is not set @@ -1656,7 +1653,7 @@ CONFIG_LUA_ROOT="/lua" # # Compatibility options # -# CONFIG_LEGACY_INCLUDE_COMMON_HEADERS is not set +CONFIG_LEGACY_INCLUDE_COMMON_HEADERS=y # end of Compatibility options # Deprecated options for backward compatibility diff --git a/sdkconfig.old b/sdkconfig.old index 48a1ae7a6..7c4f0e8ef 100644 --- a/sdkconfig.old +++ b/sdkconfig.old @@ -106,12 +106,12 @@ CONFIG_ESPTOOLPY_FLASHFREQ="40m" # CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y -# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y # CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE="8MB" +CONFIG_ESPTOOLPY_FLASHSIZE="16MB" CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y CONFIG_ESPTOOLPY_BEFORE_RESET=y # CONFIG_ESPTOOLPY_BEFORE_NORESET is not set @@ -144,6 +144,42 @@ CONFIG_PARTITION_TABLE_OFFSET=0x8000 CONFIG_PARTITION_TABLE_MD5=y # end of Partition Table +# +# Example Connection Configuration +# +CONFIG_EXAMPLE_GPIO_RANGE_MIN=0 +CONFIG_EXAMPLE_GPIO_RANGE_MAX=48 +CONFIG_EXAMPLE_CONNECT_WIFI=y +CONFIG_EXAMPLE_WIFI_SSID="myssid" +CONFIG_EXAMPLE_WIFI_PASSWORD="mypassword" +# CONFIG_EXAMPLE_WIFI_SCAN_METHOD_FAST is not set +CONFIG_EXAMPLE_WIFI_SCAN_METHOD_ALL_CHANNEL=y + +# +# WiFi Scan threshold +# +CONFIG_EXAMPLE_WIFI_SCAN_RSSI_THRESHOLD=-127 +CONFIG_EXAMPLE_WIFI_AUTH_OPEN=y +# CONFIG_EXAMPLE_WIFI_AUTH_WEP is not set +# CONFIG_EXAMPLE_WIFI_AUTH_WPA_PSK is not set +# CONFIG_EXAMPLE_WIFI_AUTH_WPA2_PSK is not set +# CONFIG_EXAMPLE_WIFI_AUTH_WPA_WPA2_PSK is not set +# CONFIG_EXAMPLE_WIFI_AUTH_WPA2_ENTERPRISE is not set +# CONFIG_EXAMPLE_WIFI_AUTH_WPA3_PSK is not set +# CONFIG_EXAMPLE_WIFI_AUTH_WPA2_WPA3_PSK is not set +# CONFIG_EXAMPLE_WIFI_AUTH_WAPI_PSK is not set +# end of WiFi Scan threshold + +CONFIG_EXAMPLE_WIFI_CONNECT_AP_BY_SIGNAL=y +# CONFIG_EXAMPLE_WIFI_CONNECT_AP_BY_SECURITY is not set +# CONFIG_EXAMPLE_CONNECT_ETHERNET is not set +CONFIG_EXAMPLE_CONNECT_IPV6=y +CONFIG_EXAMPLE_CONNECT_IPV6_PREF_LOCAL_LINK=y +# CONFIG_EXAMPLE_CONNECT_IPV6_PREF_GLOBAL is not set +# CONFIG_EXAMPLE_CONNECT_IPV6_PREF_SITE_LOCAL is not set +# CONFIG_EXAMPLE_CONNECT_IPV6_PREF_UNIQUE_LOCAL is not set +# end of Example Connection Configuration + # # Compiler options # @@ -946,10 +982,7 @@ CONFIG_FATFS_PER_FILE_CACHE=y # # Modbus configuration # -CONFIG_FMB_COMM_MODE_TCP_EN=y -CONFIG_FMB_TCP_PORT_DEFAULT=502 -CONFIG_FMB_TCP_PORT_MAX_CONN=5 -CONFIG_FMB_TCP_CONNECTION_TOUT_SEC=20 +# CONFIG_FMB_COMM_MODE_TCP_EN is not set CONFIG_FMB_COMM_MODE_RTU_EN=y CONFIG_FMB_COMM_MODE_ASCII_EN=y CONFIG_FMB_MASTER_TIMEOUT_MS_RESPOND=150 @@ -996,7 +1029,7 @@ CONFIG_FREERTOS_ASSERT_FAIL_ABORT=y # CONFIG_FREERTOS_ASSERT_DISABLE is not set CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536 CONFIG_FREERTOS_ISR_STACKSIZE=1536 -# CONFIG_FREERTOS_LEGACY_HOOKS is not set +CONFIG_FREERTOS_LEGACY_HOOKS=y CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16 CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y # CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP is not set @@ -1072,7 +1105,7 @@ CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y # # LWIP # -CONFIG_LWIP_LOCAL_HOSTNAME="espressif" +CONFIG_LWIP_LOCAL_HOSTNAME="ezlopi" # CONFIG_LWIP_NETIF_API is not set CONFIG_LWIP_TCPIP_TASK_PRIO=18 # CONFIG_LWIP_TCPIP_CORE_LOCKING is not set @@ -1620,7 +1653,7 @@ CONFIG_LUA_ROOT="/lua" # # Compatibility options # -# CONFIG_LEGACY_INCLUDE_COMMON_HEADERS is not set +CONFIG_LEGACY_INCLUDE_COMMON_HEADERS=y # end of Compatibility options # Deprecated options for backward compatibility From 885a4befb5308e2ba9cf2e96c16a30cc9d6b9910 Mon Sep 17 00:00:00 2001 From: Krishna Kumar Sah Date: Fri, 16 Feb 2024 12:36:25 +0545 Subject: [PATCH 03/27] minor --- main/CMakeLists.txt | 5 +- main/ezlopi_main.c | 2 + main/wss_server.c | 307 +++++++++++++++----------------------------- sdkconfig | 2 +- 4 files changed, 110 insertions(+), 206 deletions(-) diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 7bf4b7b1b..9e2477312 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -4,7 +4,8 @@ file(GLOB_RECURSE config_src "*.c") # Define SDK components set(EZLOPI_SDK_COMPONENTS driver - esp_https_server + nghttp + esp_http_server ) # Define ezlopi-components @@ -58,7 +59,7 @@ set(EZLOPI_SERVICES ) # Register the components -idf_component_register(SRCS "wss_server.c" "${config_src}" +idf_component_register(SRCS "ezlopi_main.c" "wss_server.c" "${config_src}" INCLUDE_DIRS "." REQUIRES ${EZLOPI_CORE_COMPONENTS} ${EZLOPI_HAL_COMPONENTS} diff --git a/main/ezlopi_main.c b/main/ezlopi_main.c index 836d41094..d127ac5f8 100644 --- a/main/ezlopi_main.c +++ b/main/ezlopi_main.c @@ -23,6 +23,7 @@ #define ENABLE_HEARTBIT_LED 0 static void blinky(void *pv); +// extern void wss_server_init(void); void app_main(void) { @@ -36,6 +37,7 @@ void app_main(void) web_provisioning_init(); ota_service_init(); ezlopi_service_modes_init(); + // wss_server_init(); xTaskCreate(blinky, "blinky", 2 * 2048, NULL, 1, NULL); } diff --git a/main/wss_server.c b/main/wss_server.c index 42dd6013b..4aae006e6 100644 --- a/main/wss_server.c +++ b/main/wss_server.c @@ -1,4 +1,4 @@ -/* Simple HTTP + SSL + WS Server Example +/* WebSocket Echo Server Example This example code is in the Public Domain (or CC0 licensed, at your option.) @@ -7,37 +7,65 @@ CONDITIONS OF ANY KIND, either express or implied. */ -#include #include -#include +#include +#include +#include #include #include -#include "esp_netif.h" -#include "esp_eth.h" +#include +#include +#include +#include // #include "protocol_examples_common.h" -#include "lwip/sockets.h" -#include -#include "wss_keep_alive.h" -#include "../build/config/sdkconfig.h" - -#if !CONFIG_HTTPD_WS_SUPPORT -#error This example cannot be used unless HTTPD_WS_SUPPORT is enabled in esp-http-server component configuration -#endif -static httpd_handle_t server = NULL; +/* A simple example that demonstrates using websocket echo server + */ +static const char *TAG = "ws_echo_server"; +/* + * Structure holding server handle + * and internal socket fd in order + * to use out of request send + */ struct async_resp_arg { httpd_handle_t hd; int fd; }; -// HTTPD_WS_SUPPORT +/* + * async send function, which we put into the httpd work queue + */ +static void ws_async_send(void *arg) +{ + static const char *data = "Async data"; + struct async_resp_arg *resp_arg = arg; + httpd_handle_t hd = resp_arg->hd; + int fd = resp_arg->fd; + httpd_ws_frame_t ws_pkt; + memset(&ws_pkt, 0, sizeof(httpd_ws_frame_t)); + ws_pkt.payload = (uint8_t *)data; + ws_pkt.len = strlen(data); + ws_pkt.type = HTTPD_WS_TYPE_TEXT; + + httpd_ws_send_frame_async(hd, fd, &ws_pkt); + free(resp_arg); +} -static const char *TAG = "wss_echo_server"; -static const size_t max_clients = 4; +static esp_err_t trigger_async_send(httpd_handle_t handle, httpd_req_t *req) +{ + struct async_resp_arg *resp_arg = malloc(sizeof(struct async_resp_arg)); + resp_arg->hd = req->handle; + resp_arg->fd = httpd_req_to_sockfd(req); + return httpd_queue_work(handle, ws_async_send, resp_arg); +} -static esp_err_t ws_handler(httpd_req_t *req) +/* + * This handler echos back the received ws data + * and triggers an async send if certain message received + */ +static esp_err_t echo_handler(httpd_req_t *req) { if (req->method == HTTP_GET) { @@ -47,8 +75,7 @@ static esp_err_t ws_handler(httpd_req_t *req) httpd_ws_frame_t ws_pkt; uint8_t *buf = NULL; memset(&ws_pkt, 0, sizeof(httpd_ws_frame_t)); - - // First receive the full ws message + ws_pkt.type = HTTPD_WS_TYPE_TEXT; /* Set max_len = 0 to get the frame len */ esp_err_t ret = httpd_ws_recv_frame(req, &ws_pkt, 0); if (ret != ESP_OK) @@ -75,174 +102,55 @@ static esp_err_t ws_handler(httpd_req_t *req) free(buf); return ret; } + ESP_LOGI(TAG, "Got packet with message: %s", ws_pkt.payload); } - // If it was a PONG, update the keep-alive - if (ws_pkt.type == HTTPD_WS_TYPE_PONG) + ESP_LOGI(TAG, "Packet type: %d", ws_pkt.type); + if (ws_pkt.type == HTTPD_WS_TYPE_TEXT && + strcmp((char *)ws_pkt.payload, "Trigger async") == 0) { - ESP_LOGD(TAG, "Received PONG message"); free(buf); - return wss_keep_alive_client_is_active(httpd_get_global_user_ctx(req->handle), - httpd_req_to_sockfd(req)); - - // If it was a TEXT message, just echo it back + return trigger_async_send(req->handle, req); } - else if (ws_pkt.type == HTTPD_WS_TYPE_TEXT || ws_pkt.type == HTTPD_WS_TYPE_PING || ws_pkt.type == HTTPD_WS_TYPE_CLOSE) + + ret = httpd_ws_send_frame(req, &ws_pkt); + if (ret != ESP_OK) { - if (ws_pkt.type == HTTPD_WS_TYPE_TEXT) - { - ESP_LOGI(TAG, "Received packet with message: %s", ws_pkt.payload); - } - else if (ws_pkt.type == HTTPD_WS_TYPE_PING) - { - // Response PONG packet to peer - ESP_LOGI(TAG, "Got a WS PING frame, Replying PONG"); - ws_pkt.type = HTTPD_WS_TYPE_PONG; - } - else if (ws_pkt.type == HTTPD_WS_TYPE_CLOSE) - { - // Response CLOSE packet with no payload to peer - ws_pkt.len = 0; - ws_pkt.payload = NULL; - } - ret = httpd_ws_send_frame(req, &ws_pkt); - if (ret != ESP_OK) - { - ESP_LOGE(TAG, "httpd_ws_send_frame failed with %d", ret); - } - ESP_LOGI(TAG, "ws_handler: httpd_handle_t=%p, sockfd=%d, client_info:%d", req->handle, - httpd_req_to_sockfd(req), httpd_ws_get_fd_info(req->handle, httpd_req_to_sockfd(req))); - free(buf); - return ret; + ESP_LOGE(TAG, "httpd_ws_send_frame failed with %d", ret); } free(buf); - return ESP_OK; -} - -esp_err_t wss_open_fd(httpd_handle_t hd, int sockfd) -{ - ESP_LOGI(TAG, "New client connected %d", sockfd); - wss_keep_alive_t h = httpd_get_global_user_ctx(hd); - return wss_keep_alive_add_client(h, sockfd); -} - -void wss_close_fd(httpd_handle_t hd, int sockfd) -{ - ESP_LOGI(TAG, "Client disconnected %d", sockfd); - wss_keep_alive_t h = httpd_get_global_user_ctx(hd); - wss_keep_alive_remove_client(h, sockfd); - close(sockfd); + return ret; } static const httpd_uri_t ws = { .uri = "/ws", .method = HTTP_GET, - .handler = ws_handler, + .handler = echo_handler, .user_ctx = NULL, - .is_websocket = true, - .handle_ws_control_frames = true}; + .is_websocket = true}; -static void send_hello(void *arg) +static httpd_handle_t start_webserver(void) { - static const char *data = "Hello client"; - struct async_resp_arg *resp_arg = arg; - httpd_handle_t hd = resp_arg->hd; - int fd = resp_arg->fd; - httpd_ws_frame_t ws_pkt; - memset(&ws_pkt, 0, sizeof(httpd_ws_frame_t)); - ws_pkt.payload = (uint8_t *)data; - ws_pkt.len = strlen(data); - ws_pkt.type = HTTPD_WS_TYPE_TEXT; - - httpd_ws_send_frame_async(hd, fd, &ws_pkt); - free(resp_arg); -} - -static void send_ping(void *arg) -{ - struct async_resp_arg *resp_arg = arg; - httpd_handle_t hd = resp_arg->hd; - int fd = resp_arg->fd; - httpd_ws_frame_t ws_pkt; - memset(&ws_pkt, 0, sizeof(httpd_ws_frame_t)); - ws_pkt.payload = NULL; - ws_pkt.len = 0; - ws_pkt.type = HTTPD_WS_TYPE_PING; - - httpd_ws_send_frame_async(hd, fd, &ws_pkt); - free(resp_arg); -} - -bool client_not_alive_cb(wss_keep_alive_t h, int fd) -{ - ESP_LOGE(TAG, "Client not alive, closing fd %d", fd); - httpd_sess_trigger_close(wss_keep_alive_get_user_ctx(h), fd); - return true; -} - -bool check_client_alive_cb(wss_keep_alive_t h, int fd) -{ - ESP_LOGD(TAG, "Checking if client (fd=%d) is alive", fd); - struct async_resp_arg *resp_arg = malloc(sizeof(struct async_resp_arg)); - resp_arg->hd = wss_keep_alive_get_user_ctx(h); - resp_arg->fd = fd; - - if (httpd_queue_work(resp_arg->hd, send_ping, resp_arg) == ESP_OK) - { - return true; - } - return false; -} - -static httpd_handle_t start_wss_echo_server(void) -{ - // Prepare keep-alive engine - wss_keep_alive_config_t keep_alive_config = KEEP_ALIVE_CONFIG_DEFAULT(); - keep_alive_config.max_clients = max_clients; - keep_alive_config.client_not_alive_cb = client_not_alive_cb; - keep_alive_config.check_client_alive_cb = check_client_alive_cb; - wss_keep_alive_t keep_alive = wss_keep_alive_start(&keep_alive_config); - - // Start the httpd server httpd_handle_t server = NULL; - ESP_LOGI(TAG, "Starting server"); - - httpd_ssl_config_t conf = HTTPD_SSL_CONFIG_DEFAULT(); - conf.httpd.max_open_sockets = max_clients; - conf.httpd.global_user_ctx = keep_alive; - conf.httpd.open_fn = wss_open_fd; - conf.httpd.close_fn = wss_close_fd; - - extern const unsigned char cacert_pem_start[] asm("_binary_cacert_pem_start"); - extern const unsigned char cacert_pem_end[] asm("_binary_cacert_pem_end"); - conf.cacert_pem = cacert_pem_start; - conf.cacert_len = cacert_pem_end - cacert_pem_start; - - extern const unsigned char prvtkey_pem_start[] asm("_binary_prvtkey_pem_start"); - extern const unsigned char prvtkey_pem_end[] asm("_binary_prvtkey_pem_end"); - conf.prvtkey_pem = prvtkey_pem_start; - conf.prvtkey_len = prvtkey_pem_end - prvtkey_pem_start; + httpd_config_t config = HTTPD_DEFAULT_CONFIG(); - esp_err_t ret = httpd_ssl_start(&server, &conf); - if (ESP_OK != ret) + // Start the httpd server + ESP_LOGI(TAG, "Starting server on port: '%d'", config.server_port); + if (httpd_start(&server, &config) == ESP_OK) { - ESP_LOGI(TAG, "Error starting server!"); - return NULL; + // Registering the ws handler + ESP_LOGI(TAG, "Registering URI handlers"); + httpd_register_uri_handler(server, &ws); + return server; } - // Set URI handlers - ESP_LOGI(TAG, "Registering URI handlers"); - httpd_register_uri_handler(server, &ws); - wss_keep_alive_set_user_ctx(keep_alive, server); - - return server; + ESP_LOGI(TAG, "Error starting server!"); + return NULL; } -static void stop_wss_echo_server(httpd_handle_t server) +static void stop_webserver(httpd_handle_t server) { - // Stop keep alive thread - wss_keep_alive_stop(httpd_get_global_user_ctx(server)); // Stop the httpd server - httpd_ssl_stop(server); + httpd_stop(server); } static void disconnect_handler(void *arg, esp_event_base_t event_base, @@ -251,7 +159,8 @@ static void disconnect_handler(void *arg, esp_event_base_t event_base, httpd_handle_t *server = (httpd_handle_t *)arg; if (*server) { - stop_wss_echo_server(*server); + ESP_LOGI(TAG, "Stopping webserver"); + stop_webserver(*server); *server = NULL; } } @@ -262,45 +171,37 @@ static void connect_handler(void *arg, esp_event_base_t event_base, httpd_handle_t *server = (httpd_handle_t *)arg; if (*server == NULL) { - *server = start_wss_echo_server(); + ESP_LOGI(TAG, "Starting webserver"); + *server = start_webserver(); } } -// Get all clients and send async message -esp_err_t wss_server_broadcast_messages(httpd_handle_t *server) +void app_main(void) { - esp_err_t ret = ESP_OK; - - if (server && server) - { - bool send_messages = true; - size_t clients = max_clients; - int client_fds[max_clients]; - if (httpd_get_client_list(*server, &clients, client_fds) == ESP_OK) - { - for (size_t i = 0; i < clients; ++i) - { - int sock = client_fds[i]; - if (httpd_ws_get_fd_info(*server, sock) == HTTPD_WS_CLIENT_WEBSOCKET) - { - ESP_LOGI(TAG, "Active client (fd=%d) -> sending async message", sock); - struct async_resp_arg *resp_arg = malloc(sizeof(struct async_resp_arg)); - resp_arg->hd = *server; - resp_arg->fd = sock; - if (httpd_queue_work(resp_arg->hd, send_hello, resp_arg) != ESP_OK) - { - ESP_LOGE(TAG, "httpd_queue_work failed!"); - send_messages = false; - break; - } - } - } - } - else - { - ESP_LOGE(TAG, "httpd_get_client_list failed!"); - } - } - - return ret; -} \ No newline at end of file + static httpd_handle_t server = NULL; + + ESP_ERROR_CHECK(nvs_flash_init()); + ESP_ERROR_CHECK(esp_netif_init()); + ESP_ERROR_CHECK(esp_event_loop_create_default()); + + /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. + * Read "Establishing Wi-Fi or Ethernet Connection" section in + * examples/protocols/README.md for more information about this function. + */ + ESP_ERROR_CHECK(example_connect()); + + /* Register event handlers to stop the server when Wi-Fi or Ethernet is disconnected, + * and re-start it upon connection. + */ +#ifdef CONFIG_EXAMPLE_CONNECT_WIFI + ESP_ERROR_CHECK(esp_event_handler_register(IP_EVENT, IP_EVENT_STA_GOT_IP, &connect_handler, &server)); + ESP_ERROR_CHECK(esp_event_handler_register(WIFI_EVENT, WIFI_EVENT_STA_DISCONNECTED, &disconnect_handler, &server)); +#endif // CONFIG_EXAMPLE_CONNECT_WIFI +#ifdef CONFIG_EXAMPLE_CONNECT_ETHERNET + ESP_ERROR_CHECK(esp_event_handler_register(IP_EVENT, IP_EVENT_ETH_GOT_IP, &connect_handler, &server)); + ESP_ERROR_CHECK(esp_event_handler_register(ETH_EVENT, ETHERNET_EVENT_DISCONNECTED, &disconnect_handler, &server)); +#endif // CONFIG_EXAMPLE_CONNECT_ETHERNET + + /* Start the server for the first time */ + server = start_webserver(); +} diff --git a/sdkconfig b/sdkconfig index 7c4f0e8ef..e08707c3d 100644 --- a/sdkconfig +++ b/sdkconfig @@ -1653,7 +1653,7 @@ CONFIG_LUA_ROOT="/lua" # # Compatibility options # -CONFIG_LEGACY_INCLUDE_COMMON_HEADERS=y +# CONFIG_LEGACY_INCLUDE_COMMON_HEADERS is not set # end of Compatibility options # Deprecated options for backward compatibility From f251182c9852f38de69d0bb98399cd7c59de463e Mon Sep 17 00:00:00 2001 From: Krishna Kumar Sah Date: Sat, 17 Feb 2024 00:30:32 +0545 Subject: [PATCH 04/27] testing esp's ws-server, creating own ws-server --- CMakeLists.txt | 4 +- .../ezlopi-core-ws-server/CMakeLists.txt | 62 +++++ .../ezlopi-core-ws-server/component.mk | 8 + .../ezlopi_core_ws_server.c | 99 ++++++++ .../ezlopi_core_ws_server.h | 9 + .../ezlopi_core_ws_server_conn.c | 68 ++++++ .../ezlopi_core_ws_server_conn.h | 20 ++ main/CMakeLists.txt | 22 +- main/certs/cacert.pem | 19 -- main/certs/prvtkey.pem | 28 --- main/component.mk | 3 +- main/ezlopi_main.c | 10 + main/wss_keep_alive.c | 229 ------------------ main/wss_keep_alive.h | 96 -------- main/wss_server.c | 207 ---------------- sdkconfig | 36 --- sdkconfig.old | 38 +-- 17 files changed, 284 insertions(+), 674 deletions(-) create mode 100644 ezlopi-core/ezlopi-core-ws-server/CMakeLists.txt create mode 100644 ezlopi-core/ezlopi-core-ws-server/component.mk create mode 100644 ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.c create mode 100644 ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.h create mode 100644 ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.c create mode 100644 ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.h delete mode 100644 main/certs/cacert.pem delete mode 100644 main/certs/prvtkey.pem delete mode 100644 main/wss_keep_alive.c delete mode 100644 main/wss_keep_alive.h delete mode 100644 main/wss_server.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 523f03212..92a218de8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,8 +53,8 @@ foreach(component ${external_components_list}) LIST(APPEND ALL_COMPONENTS ${SUBDIRS}) endforeach() -set(EXTRA_COMPONENT_DIRS ${ALL_COMPONENTS} $ENV{IDF_PATH}/examples/common_components/protocol_examples_common) # add the list of directories 'SUBDIRS' to 'EXTRA_COMPONENT_DIRS'(ESP32 VARIABLES), links the external components -message(STATUS "EXTRA_COMPONENTS_DIRS: ${EXTRA_COMPONENTS_DIRS}\r\n") +set(EXTRA_COMPONENT_DIRS ${ALL_COMPONENTS} ) # add the list of directories 'SUBDIRS' to 'EXTRA_COMPONENT_DIRS'(ESP32 VARIABLES), links the external components +message(STATUS "EXTRA_COMPONENTS_DIRS: ${EXTRA_COMPONENT_DIRS}\r\n") ## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ## project(Ezlo_Pi_v3x) diff --git a/ezlopi-core/ezlopi-core-ws-server/CMakeLists.txt b/ezlopi-core/ezlopi-core-ws-server/CMakeLists.txt new file mode 100644 index 000000000..ea1c896f5 --- /dev/null +++ b/ezlopi-core/ezlopi-core-ws-server/CMakeLists.txt @@ -0,0 +1,62 @@ +file(GLOB_RECURSE config_src "*.c") + +# Define SDK components +set(EZLOPI_SDK_COMPONENTS + driver + nghttp + esp_http_server + protocol_examples_common +) + +# Define ezlopi-components +set(EZLOPI_COMPONENTS + ezlopi-util-trace +) + +# Define core components +set(EZLOPI_CORE_COMPONENTS + ezlopi-core-ble + ezlopi-core-sntp + ezlopi-core-cloud + ezlopi-core-ezlopi + ezlopi-core-scenes + ezlopi-core-actions + ezlopi-core-devices +) + +# Define HAL components +set(EZLOPI_HAL_COMPONENTS + ezlopi-hal-adc + ezlopi-hal-pwm + ezlopi-hal-i2c + ezlopi-hal-spi + ezlopi-hal-uart + ezlopi-hal-gpio + ezlopi-hal-onewire +) + +# Define cloud components +set(EZLOPI_CLOUD_COMPONENTS + ezlopi-cloud-settings +) + +# Define sensor device components +set(EZLOPI_SENSOR_DEVICE_COMPONENTS + + # Add other sensor device components here +) + +# Define service components +set(EZLOPI_SERVICES + +) + +# Register the components +idf_component_register(SRCS "${config_src}" + INCLUDE_DIRS "." + REQUIRES ${EZLOPI_CORE_COMPONENTS} + ${EZLOPI_HAL_COMPONENTS} + ${EZLOPI_CLOUD_COMPONENTS} + ${EZLOPI_SENSOR_DEVICE_COMPONENTS} + ${EZLOPI_SERVICES} +) diff --git a/ezlopi-core/ezlopi-core-ws-server/component.mk b/ezlopi-core/ezlopi-core-ws-server/component.mk new file mode 100644 index 000000000..608de873e --- /dev/null +++ b/ezlopi-core/ezlopi-core-ws-server/component.mk @@ -0,0 +1,8 @@ +# +# "main" pseudo-component makefile. +# +# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) + + +COMPONENT_ADD_SRCDIRS := .. +COMPONENT_ADD_INCLUDEDIRS := .. \ No newline at end of file diff --git a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.c b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.c new file mode 100644 index 000000000..bbe0b49a3 --- /dev/null +++ b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.c @@ -0,0 +1,99 @@ +#include +#include +#include +#include + +#include +#include + +#include "ezlopi_util_trace.h" +#include "ezlopi_core_ws_server.h" +#include "ezlopi_core_ws_server_conn.h" + +static TaskHandle_t gs_task_handle = NULL; + +static void __server_init(void); +static void __server_process(void *pv); + +void ezlopi_core_ws_server_deinit(void) +{ + if (gs_task_handle) + { + vTaskDelete(gs_task_handle); + } +} + +void ezlopi_core_ws_server_init(void) +{ + if (NULL == gs_task_handle) + { + xTaskCreate(__server_process, "ws-server-process", 2048, NULL, 4, &gs_task_handle); + } +} + +typedef struct s_ws_connections +{ + TaskHandle_t task_handle; + struct netconn *conn; + + struct s_ws_connections *next; +} s_ws_connections_t; + +static s_ws_connections_t *conn_head = NULL; + +static void __connection_process(void *pv) +{ + struct netconn *conn = (struct netconn *)pv; + + while (1) + { + struct netbuf * net_buffer = NULL; + err_t err = netconn_recv(conn, &net_buffer); + + } +} + +static void __server_process(void *pv) +{ + struct netconn *listen_con = netconn_new(NETCONN_TCP); + + if (listen_con) + { + netconn_bind(listen_con, NULL, 80); + err_t err = netconn_listen(listen_con); + if (err) + { + while (1) + { + struct netconn *new_con = NULL; + err = netconn_accept(listen_con, &new_con); + TRACE_W("new-conn: %s", lwip_strerr(err)); + + if ((ERR_OK == err) && new_con) + { + TaskHandle_t conn_handle = NULL; + xTaskCreate(__connection_process, "ws-connection", 4 * 1024, new_con, 5, &conn_handle); + if (ezlopi_core_ws_server_conn_add_new_conn(conn_handle, new_con)) + { + if (conn_handle) + { + vTaskDelete(conn_handle); + } + + if (new_con) + { + netconn_delete(new_con); + } + } + } + } + } + else + { + netconn_delete(listen_con); + } + } + + gs_task_handle = NULL; + vTaskDelete(NULL); +} \ No newline at end of file diff --git a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.h b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.h new file mode 100644 index 000000000..db21d2210 --- /dev/null +++ b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.h @@ -0,0 +1,9 @@ +#ifndef __EZLOPI_CORE_WS_H__ +#define __EZLOPI_CORE_WS_H__ + +typedef struct s_ezlopi_ws_server +{ + +} s_ezlopi_ws_server_t; + +#endif // __EZLOPI_CORE_WS_H__ diff --git a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.c b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.c new file mode 100644 index 000000000..081b876dd --- /dev/null +++ b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.c @@ -0,0 +1,68 @@ +#include +#include "ezlopi_core_ws_server_conn.h" + +static s_ws_server_new_connections_t *conn_head = NULL; + +static s_ws_server_new_connections_t *__create_new_conn(TaskHandle_t handle, struct netconn *conn); + +int ezlopi_core_ws_server_conn_add_new_conn(TaskHandle_t handle, struct netconn *conn) +{ + int ret = 0; + if (conn_head) + { + s_ws_server_new_connections_t *curr_conn = conn_head; + while (curr_conn->next) + { + curr_conn = curr_conn->next; + } + + curr_conn->next = __create_new_conn(handle, conn); + } + else + { + conn_head = __create_new_conn(handle, conn); + } + + return ret; +} + +int ezlopi_core_ws_server_conn_remove_conn(struct netconn *conn) +{ + int ret = 0; + + if (conn == conn_head->conn) + { + netconn_delete(conn); + + } + else + { + s_ws_server_new_connections_t *curr_conn = conn_head; + while (curr_conn->next) + { + if (curr_conn->next == conn) + { + break; + } + + curr_conn = curr_conn->next; + } + } + + return ret; +} + +static s_ws_server_new_connections_t *__create_new_conn(TaskHandle_t handle, struct netconn *conn) +{ + s_ws_server_new_connections_t *new_ws_conn = malloc(sizeof(s_ws_server_new_connections_t)); + if (new_ws_conn) + { + memset(new_ws_conn, 0, sizeof(s_ws_server_new_connections_t)); + + new_ws_conn->conn = conn; + new_ws_conn->handle = handle; + new_ws_conn->next = NULL; + } + + return new_ws_conn; +} \ No newline at end of file diff --git a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.h b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.h new file mode 100644 index 000000000..131967eb2 --- /dev/null +++ b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.h @@ -0,0 +1,20 @@ +#ifndef __EZLOPI_CORE_WS_SERVER_CONN_H__ +#define __EZLOPI_CORE_WS_SERVER_CONN_H__ + +#include +#include +#include +#include +#include + +typedef struct s_ws_server_new_connections +{ + TaskHandle_t handle; + struct netconn *conn; + + struct s_ws_server_new_connections *next; +} s_ws_server_new_connections_t; + +int ezlopi_core_ws_server_conn_add_new_conn(TaskHandle_t handle, struct netconn *conn); + +#endif // __EZLOPI_CORE_WS_SERVER_CONN_H__ diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 9e2477312..101724d8c 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -6,6 +6,7 @@ set(EZLOPI_SDK_COMPONENTS driver nghttp esp_http_server + # protocol_examples_common ) # Define ezlopi-components @@ -15,34 +16,21 @@ set(EZLOPI_COMPONENTS # Define core components set(EZLOPI_CORE_COMPONENTS - ezlopi-core-ble - ezlopi-core-sntp - ezlopi-core-cloud ezlopi-core-ezlopi - ezlopi-core-scenes - ezlopi-core-actions - ezlopi-core-devices ) # Define HAL components set(EZLOPI_HAL_COMPONENTS - ezlopi-hal-adc - ezlopi-hal-pwm - ezlopi-hal-i2c - ezlopi-hal-spi - ezlopi-hal-uart - ezlopi-hal-gpio - ezlopi-hal-onewire + ) # Define cloud components set(EZLOPI_CLOUD_COMPONENTS - ezlopi-cloud-settings + ) # Define sensor device components set(EZLOPI_SENSOR_DEVICE_COMPONENTS - device-0001-digitalOut-generic # Add other sensor device components here ) @@ -59,13 +47,11 @@ set(EZLOPI_SERVICES ) # Register the components -idf_component_register(SRCS "ezlopi_main.c" "wss_server.c" "${config_src}" +idf_component_register(SRCS "${config_src}" INCLUDE_DIRS "." REQUIRES ${EZLOPI_CORE_COMPONENTS} ${EZLOPI_HAL_COMPONENTS} ${EZLOPI_CLOUD_COMPONENTS} ${EZLOPI_SENSOR_DEVICE_COMPONENTS} ${EZLOPI_SERVICES} - EMBED_TXTFILES "certs/cacert.pem" - "certs/prvtkey.pem" ) diff --git a/main/certs/cacert.pem b/main/certs/cacert.pem deleted file mode 100644 index cd2b80c82..000000000 --- a/main/certs/cacert.pem +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDKzCCAhOgAwIBAgIUBxM3WJf2bP12kAfqhmhhjZWv0ukwDQYJKoZIhvcNAQEL -BQAwJTEjMCEGA1UEAwwaRVNQMzIgSFRUUFMgc2VydmVyIGV4YW1wbGUwHhcNMTgx -MDE3MTEzMjU3WhcNMjgxMDE0MTEzMjU3WjAlMSMwIQYDVQQDDBpFU1AzMiBIVFRQ -UyBzZXJ2ZXIgZXhhbXBsZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB -ALBint6nP77RCQcmKgwPtTsGK0uClxg+LwKJ3WXuye3oqnnjqJCwMEneXzGdG09T -sA0SyNPwrEgebLCH80an3gWU4pHDdqGHfJQa2jBL290e/5L5MB+6PTs2NKcojK/k -qcZkn58MWXhDW1NpAnJtjVniK2Ksvr/YIYSbyD+JiEs0MGxEx+kOl9d7hRHJaIzd -GF/vO2pl295v1qXekAlkgNMtYIVAjUy9CMpqaQBCQRL+BmPSJRkXBsYk8GPnieS4 -sUsp53DsNvCCtWDT6fd9D1v+BB6nDk/FCPKhtjYOwOAZlX4wWNSZpRNr5dfrxKsb -jAn4PCuR2akdF4G8WLUeDWECAwEAAaNTMFEwHQYDVR0OBBYEFMnmdJKOEepXrHI/ -ivM6mVqJgAX8MB8GA1UdIwQYMBaAFMnmdJKOEepXrHI/ivM6mVqJgAX8MA8GA1Ud -EwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBADiXIGEkSsN0SLSfCF1VNWO3 -emBurfOcDq4EGEaxRKAU0814VEmU87btIDx80+z5Dbf+GGHCPrY7odIkxGNn0DJY -W1WcF+DOcbiWoUN6DTkAML0SMnp8aGj9ffx3x+qoggT+vGdWVVA4pgwqZT7Ybntx -bkzcNFW0sqmCv4IN1t4w6L0A87ZwsNwVpre/j6uyBw7s8YoJHDLRFT6g7qgn0tcN -ZufhNISvgWCVJQy/SZjNBHSpnIdCUSJAeTY2mkM4sGxY0Widk8LnjydxZUSxC3Nl -hb6pnMh3jRq4h0+5CZielA4/a+TdrNPv/qok67ot/XJdY3qHCCd8O2b14OVq9jo= ------END CERTIFICATE----- diff --git a/main/certs/prvtkey.pem b/main/certs/prvtkey.pem deleted file mode 100644 index 70d29078c..000000000 --- a/main/certs/prvtkey.pem +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCwYp7epz++0QkH -JioMD7U7BitLgpcYPi8Cid1l7snt6Kp546iQsDBJ3l8xnRtPU7ANEsjT8KxIHmyw -h/NGp94FlOKRw3ahh3yUGtowS9vdHv+S+TAfuj07NjSnKIyv5KnGZJ+fDFl4Q1tT -aQJybY1Z4itirL6/2CGEm8g/iYhLNDBsRMfpDpfXe4URyWiM3Rhf7ztqZdveb9al -3pAJZIDTLWCFQI1MvQjKamkAQkES/gZj0iUZFwbGJPBj54nkuLFLKedw7DbwgrVg -0+n3fQ9b/gQepw5PxQjyobY2DsDgGZV+MFjUmaUTa+XX68SrG4wJ+DwrkdmpHReB -vFi1Hg1hAgMBAAECggEAaTCnZkl/7qBjLexIryC/CBBJyaJ70W1kQ7NMYfniWwui -f0aRxJgOdD81rjTvkINsPp+xPRQO6oOadjzdjImYEuQTqrJTEUnntbu924eh+2D9 -Mf2CAanj0mglRnscS9mmljZ0KzoGMX6Z/EhnuS40WiJTlWlH6MlQU/FDnwC6U34y -JKy6/jGryfsx+kGU/NRvKSru6JYJWt5v7sOrymHWD62IT59h3blOiP8GMtYKeQlX -49om9Mo1VTIFASY3lrxmexbY+6FG8YO+tfIe0tTAiGrkb9Pz6tYbaj9FjEWOv4Vc -+3VMBUVdGJjgqvE8fx+/+mHo4Rg69BUPfPSrpEg7sQKBgQDlL85G04VZgrNZgOx6 -pTlCCl/NkfNb1OYa0BELqWINoWaWQHnm6lX8YjrUjwRpBF5s7mFhguFjUjp/NW6D -0EEg5BmO0ePJ3dLKSeOA7gMo7y7kAcD/YGToqAaGljkBI+IAWK5Su5yldrECTQKG -YnMKyQ1MWUfCYEwHtPvFvE5aPwKBgQDFBWXekpxHIvt/B41Cl/TftAzE7/f58JjV -MFo/JCh9TDcH6N5TMTRS1/iQrv5M6kJSSrHnq8pqDXOwfHLwxetpk9tr937VRzoL -CuG1Ar7c1AO6ujNnAEmUVC2DppL/ck5mRPWK/kgLwZSaNcZf8sydRgphsW1ogJin -7g0nGbFwXwKBgQCPoZY07Pr1TeP4g8OwWTu5F6dSvdU2CAbtZthH5q98u1n/cAj1 -noak1Srpa3foGMTUn9CHu+5kwHPIpUPNeAZZBpq91uxa5pnkDMp3UrLIRJ2uZyr8 -4PxcknEEh8DR5hsM/IbDcrCJQglM19ZtQeW3LKkY4BsIxjDf45ymH407IQKBgE/g -Ul6cPfOxQRlNLH4VMVgInSyyxWx1mODFy7DRrgCuh5kTVh+QUVBM8x9lcwAn8V9/ -nQT55wR8E603pznqY/jX0xvAqZE6YVPcw4kpZcwNwL1RhEl8GliikBlRzUL3SsW3 -q30AfqEViHPE3XpE66PPo6Hb1ymJCVr77iUuC3wtAoGBAIBrOGunv1qZMfqmwAY2 -lxlzRgxgSiaev0lTNxDzZkmU/u3dgdTwJ5DDANqPwJc6b8SGYTp9rQ0mbgVHnhIB -jcJQBQkTfq6Z0H6OoTVi7dPs3ibQJFrtkoyvYAbyk36quBmNRjVh6rc8468bhXYr -v/t+MeGJP/0Zw8v/X2CFll96 ------END PRIVATE KEY----- diff --git a/main/component.mk b/main/component.mk index b120d66e5..17fe35eb4 100644 --- a/main/component.mk +++ b/main/component.mk @@ -3,5 +3,4 @@ # # (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) -COMPONENT_EMBED_TXTFILES := certs/cacert.pem -COMPONENT_EMBED_TXTFILES += certs/prvtkey.pem + diff --git a/main/ezlopi_main.c b/main/ezlopi_main.c index d127ac5f8..2cdc119ab 100644 --- a/main/ezlopi_main.c +++ b/main/ezlopi_main.c @@ -25,6 +25,16 @@ static void blinky(void *pv); // extern void wss_server_init(void); +void vApplicationIdleHook(void) +{ + TRACE_D("vApplicationIdleHook"); +} + +void vApplicationTickHook(void) +{ + TRACE_D("vApplicationTickHook"); +} + void app_main(void) { gpio_install_isr_service(0); diff --git a/main/wss_keep_alive.c b/main/wss_keep_alive.c deleted file mode 100644 index cc1e302d0..000000000 --- a/main/wss_keep_alive.c +++ /dev/null @@ -1,229 +0,0 @@ -/* Keep Alive engine for wss server example - - This example code is in the Public Domain (or CC0 licensed, at your option.) - - Unless required by applicable law or agreed to in writing, this - software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - CONDITIONS OF ANY KIND, either express or implied. -*/ - -#include -#include -#include "freertos/FreeRTOS.h" -#include "freertos/queue.h" -#include "freertos/task.h" -#include "wss_keep_alive.h" -#include "esp_timer.h" - -typedef enum { - NO_CLIENT = 0, - CLIENT_FD_ADD, - CLIENT_FD_REMOVE, - CLIENT_UPDATE, - CLIENT_ACTIVE, - STOP_TASK, -} client_fd_action_type_t; - -typedef struct { - client_fd_action_type_t type; - int fd; - uint64_t last_seen; -} client_fd_action_t; - -typedef struct wss_keep_alive_storage { - size_t max_clients; - wss_check_client_alive_cb_t check_client_alive_cb; - wss_check_client_alive_cb_t client_not_alive_cb; - size_t keep_alive_period_ms; - size_t not_alive_after_ms; - void * user_ctx; - QueueHandle_t q; - client_fd_action_t clients[]; -} wss_keep_alive_storage_t; - -typedef struct wss_keep_alive_storage* wss_keep_alive_t; - -static const char *TAG = "wss_keep_alive"; - -static uint64_t _tick_get_ms(void) -{ - return esp_timer_get_time()/1000; -} - -// Goes over active clients to find out how long we could sleep before checking who's alive -static uint64_t get_max_delay(wss_keep_alive_t h) -{ - int64_t check_after_ms = 30000; // max delay, no need to check anyone - for (int i=0; imax_clients; ++i) { - if (h->clients[i].type == CLIENT_ACTIVE) { - uint64_t check_this_client_at = h->clients[i].last_seen + h->keep_alive_period_ms; - if (check_this_client_at < check_after_ms + _tick_get_ms()) { - check_after_ms = check_this_client_at - _tick_get_ms(); - if (check_after_ms < 0) { - check_after_ms = 1000; // min delay, some client(s) not responding already - } - } - } - } - return check_after_ms; -} - - -static bool update_client(wss_keep_alive_t h, int sockfd, uint64_t timestamp) -{ - for (int i=0; imax_clients; ++i) { - if (h->clients[i].type == CLIENT_ACTIVE && h->clients[i].fd == sockfd) { - h->clients[i].last_seen = timestamp; - return true; - } - } - return false; -} - -static bool remove_client(wss_keep_alive_t h, int sockfd) -{ - for (int i=0; imax_clients; ++i) { - if (h->clients[i].type == CLIENT_ACTIVE && h->clients[i].fd == sockfd) { - h->clients[i].type = NO_CLIENT; - h->clients[i].fd = -1; - return true; - } - } - return false; -} -static bool add_new_client(wss_keep_alive_t h,int sockfd) -{ - for (int i=0; imax_clients; ++i) { - if (h->clients[i].type == NO_CLIENT) { - h->clients[i].type = CLIENT_ACTIVE; - h->clients[i].fd = sockfd; - h->clients[i].last_seen = _tick_get_ms(); - return true; // success - } - } - return false; -} - -static void keep_alive_task(void* arg) -{ - wss_keep_alive_storage_t *keep_alive_storage = arg; - bool run_task = true; - client_fd_action_t client_action; - while (run_task) { - if (xQueueReceive(keep_alive_storage->q, (void *) &client_action, - get_max_delay(keep_alive_storage) / portTICK_PERIOD_MS) == pdTRUE) { - switch (client_action.type) { - case CLIENT_FD_ADD: - if (!add_new_client(keep_alive_storage, client_action.fd)) { - ESP_LOGE(TAG, "Cannot add new client"); - } - break; - case CLIENT_FD_REMOVE: - if (!remove_client(keep_alive_storage, client_action.fd)) { - ESP_LOGE(TAG, "Cannot remove client fd:%d", client_action.fd); - } - break; - case CLIENT_UPDATE: - if (!update_client(keep_alive_storage, client_action.fd, client_action.last_seen)) { - ESP_LOGE(TAG, "Cannot find client fd:%d", client_action.fd); - } - break; - case STOP_TASK: - run_task = false; - break; - default: - ESP_LOGE(TAG, "Unexpected client action"); - break; - } - } else { - // timeout: check if PING message needed - for (int i=0; imax_clients; ++i) { - if (keep_alive_storage->clients[i].type == CLIENT_ACTIVE) { - if (keep_alive_storage->clients[i].last_seen + keep_alive_storage->keep_alive_period_ms <= _tick_get_ms()) { - ESP_LOGD(TAG, "Haven't seen the client (fd=%d) for a while", keep_alive_storage->clients[i].fd); - if (keep_alive_storage->clients[i].last_seen + keep_alive_storage->not_alive_after_ms <= _tick_get_ms()) { - ESP_LOGE(TAG, "Client (fd=%d) not alive!", keep_alive_storage->clients[i].fd); - keep_alive_storage->client_not_alive_cb(keep_alive_storage, keep_alive_storage->clients[i].fd); - } else { - keep_alive_storage->check_client_alive_cb(keep_alive_storage, keep_alive_storage->clients[i].fd); - } - } - } - } - } - } - vQueueDelete(keep_alive_storage->q); - free(keep_alive_storage); - - vTaskDelete(NULL); -} - -wss_keep_alive_t wss_keep_alive_start(wss_keep_alive_config_t *config) -{ - size_t queue_size = config->max_clients/2; - size_t client_list_size = config->max_clients + queue_size; - wss_keep_alive_t keep_alive_storage = calloc(1, - sizeof(wss_keep_alive_storage_t) + client_list_size* sizeof(client_fd_action_t)); - if (keep_alive_storage == NULL) { - return false; - } - keep_alive_storage->check_client_alive_cb = config->check_client_alive_cb; - keep_alive_storage->client_not_alive_cb = config->client_not_alive_cb; - keep_alive_storage->max_clients = config->max_clients; - keep_alive_storage->not_alive_after_ms = config->not_alive_after_ms; - keep_alive_storage->keep_alive_period_ms = config->keep_alive_period_ms; - keep_alive_storage->user_ctx = config->user_ctx; - keep_alive_storage->q = xQueueCreate(queue_size, sizeof(client_fd_action_t)); - if (xTaskCreate(keep_alive_task, "keep_alive_task", config->task_stack_size, - keep_alive_storage, config->task_prio, NULL) != pdTRUE) { - wss_keep_alive_stop(keep_alive_storage); - return false; - } - return keep_alive_storage; -} - -void wss_keep_alive_stop(wss_keep_alive_t h) -{ - client_fd_action_t stop = { .type = STOP_TASK }; - xQueueSendToBack(h->q, &stop, 0); - // internal structs will be de-allocated in the task -} - -esp_err_t wss_keep_alive_add_client(wss_keep_alive_t h, int fd) -{ - client_fd_action_t client_fd_action = { .fd = fd, .type = CLIENT_FD_ADD}; - if (xQueueSendToBack(h->q, &client_fd_action, 0) == pdTRUE) { - return ESP_OK; - } - return ESP_FAIL; -} - -esp_err_t wss_keep_alive_remove_client(wss_keep_alive_t h, int fd) -{ - client_fd_action_t client_fd_action = { .fd = fd, .type = CLIENT_FD_REMOVE}; - if (xQueueSendToBack(h->q, &client_fd_action, 0) == pdTRUE) { - return ESP_OK; - } - return ESP_FAIL; -} - -esp_err_t wss_keep_alive_client_is_active(wss_keep_alive_t h, int fd) -{ - client_fd_action_t client_fd_action = { .fd = fd, .type = CLIENT_UPDATE, - .last_seen = _tick_get_ms()}; - if (xQueueSendToBack(h->q, &client_fd_action, 0) == pdTRUE) { - return ESP_OK; - } - return ESP_FAIL; - -} - -void wss_keep_alive_set_user_ctx(wss_keep_alive_t h, void *ctx) -{ - h->user_ctx = ctx; -} - -void* wss_keep_alive_get_user_ctx(wss_keep_alive_t h) -{ - return h->user_ctx; -} diff --git a/main/wss_keep_alive.h b/main/wss_keep_alive.h deleted file mode 100644 index add3b68f1..000000000 --- a/main/wss_keep_alive.h +++ /dev/null @@ -1,96 +0,0 @@ -/* Keep Alive engine for wss server example - - This example code is in the Public Domain (or CC0 licensed, at your option.) - - Unless required by applicable law or agreed to in writing, this - software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - CONDITIONS OF ANY KIND, either express or implied. -*/ -#pragma once - -#define KEEP_ALIVE_CONFIG_DEFAULT() \ - { \ - .max_clients = 10, \ - .task_stack_size = 2048, \ - .task_prio = tskIDLE_PRIORITY+1, \ - .keep_alive_period_ms = 5000, \ - .not_alive_after_ms = 10000, \ -} - -struct wss_keep_alive_storage; -typedef struct wss_keep_alive_storage* wss_keep_alive_t; -typedef bool (*wss_check_client_alive_cb_t)(wss_keep_alive_t h, int fd); -typedef bool (*wss_client_not_alive_cb_t)(wss_keep_alive_t h, int fd); - -/** - * @brief Confiuration struct - */ -typedef struct { - size_t max_clients; /*!< max number of clients */ - size_t task_stack_size; /*!< stack size of the created task */ - size_t task_prio; /*!< priority of the created task */ - size_t keep_alive_period_ms; /*!< check every client after this time */ - size_t not_alive_after_ms; /*!< consider client not alive after this time */ - wss_check_client_alive_cb_t check_client_alive_cb; /*!< callback function to check if client is alive */ - wss_client_not_alive_cb_t client_not_alive_cb; /*!< callback function to notify that the client is not alive */ - void *user_ctx; /*!< user context available in the keep-alive handle */ -} wss_keep_alive_config_t; - -/** - * @brief Adds a new client to internal set of clients to keep an eye on - * - * @param h keep-alive handle - * @param fd socket file descriptor for this client - * @return ESP_OK on success - */ -esp_err_t wss_keep_alive_add_client(wss_keep_alive_t h, int fd); - -/** - * @brief Removes this client from the set - * - * @param h keep-alive handle - * @param fd socket file descriptor for this client - * @return ESP_OK on success - */ -esp_err_t wss_keep_alive_remove_client(wss_keep_alive_t h, int fd); - -/** - * @brief Notify that this client is alive - * - * @param h keep-alive handle - * @param fd socket file descriptor for this client - * @return ESP_OK on success - */ - -esp_err_t wss_keep_alive_client_is_active(wss_keep_alive_t h, int fd); - -/** - * @brief Starts keep-alive engine - * - * @param config keep-alive configuration - * @return keep alive handle - */ -wss_keep_alive_t wss_keep_alive_start(wss_keep_alive_config_t *config); - -/** - * @brief Stops keep-alive engine - * - * @param h keep-alive handle - */ -void wss_keep_alive_stop(wss_keep_alive_t h); - -/** - * @brief Sets user defined context - * - * @param h keep-alive handle - * @param ctx user context - */ -void wss_keep_alive_set_user_ctx(wss_keep_alive_t h, void *ctx); - -/** - * @brief Gets user defined context - * - * @param h keep-alive handle - * @return ctx user context - */ -void* wss_keep_alive_get_user_ctx(wss_keep_alive_t h); diff --git a/main/wss_server.c b/main/wss_server.c deleted file mode 100644 index 4aae006e6..000000000 --- a/main/wss_server.c +++ /dev/null @@ -1,207 +0,0 @@ -/* WebSocket Echo Server Example - - This example code is in the Public Domain (or CC0 licensed, at your option.) - - Unless required by applicable law or agreed to in writing, this - software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - CONDITIONS OF ANY KIND, either express or implied. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -// #include "protocol_examples_common.h" - -/* A simple example that demonstrates using websocket echo server - */ -static const char *TAG = "ws_echo_server"; - -/* - * Structure holding server handle - * and internal socket fd in order - * to use out of request send - */ -struct async_resp_arg -{ - httpd_handle_t hd; - int fd; -}; - -/* - * async send function, which we put into the httpd work queue - */ -static void ws_async_send(void *arg) -{ - static const char *data = "Async data"; - struct async_resp_arg *resp_arg = arg; - httpd_handle_t hd = resp_arg->hd; - int fd = resp_arg->fd; - httpd_ws_frame_t ws_pkt; - memset(&ws_pkt, 0, sizeof(httpd_ws_frame_t)); - ws_pkt.payload = (uint8_t *)data; - ws_pkt.len = strlen(data); - ws_pkt.type = HTTPD_WS_TYPE_TEXT; - - httpd_ws_send_frame_async(hd, fd, &ws_pkt); - free(resp_arg); -} - -static esp_err_t trigger_async_send(httpd_handle_t handle, httpd_req_t *req) -{ - struct async_resp_arg *resp_arg = malloc(sizeof(struct async_resp_arg)); - resp_arg->hd = req->handle; - resp_arg->fd = httpd_req_to_sockfd(req); - return httpd_queue_work(handle, ws_async_send, resp_arg); -} - -/* - * This handler echos back the received ws data - * and triggers an async send if certain message received - */ -static esp_err_t echo_handler(httpd_req_t *req) -{ - if (req->method == HTTP_GET) - { - ESP_LOGI(TAG, "Handshake done, the new connection was opened"); - return ESP_OK; - } - httpd_ws_frame_t ws_pkt; - uint8_t *buf = NULL; - memset(&ws_pkt, 0, sizeof(httpd_ws_frame_t)); - ws_pkt.type = HTTPD_WS_TYPE_TEXT; - /* Set max_len = 0 to get the frame len */ - esp_err_t ret = httpd_ws_recv_frame(req, &ws_pkt, 0); - if (ret != ESP_OK) - { - ESP_LOGE(TAG, "httpd_ws_recv_frame failed to get frame len with %d", ret); - return ret; - } - ESP_LOGI(TAG, "frame len is %d", ws_pkt.len); - if (ws_pkt.len) - { - /* ws_pkt.len + 1 is for NULL termination as we are expecting a string */ - buf = calloc(1, ws_pkt.len + 1); - if (buf == NULL) - { - ESP_LOGE(TAG, "Failed to calloc memory for buf"); - return ESP_ERR_NO_MEM; - } - ws_pkt.payload = buf; - /* Set max_len = ws_pkt.len to get the frame payload */ - ret = httpd_ws_recv_frame(req, &ws_pkt, ws_pkt.len); - if (ret != ESP_OK) - { - ESP_LOGE(TAG, "httpd_ws_recv_frame failed with %d", ret); - free(buf); - return ret; - } - ESP_LOGI(TAG, "Got packet with message: %s", ws_pkt.payload); - } - ESP_LOGI(TAG, "Packet type: %d", ws_pkt.type); - if (ws_pkt.type == HTTPD_WS_TYPE_TEXT && - strcmp((char *)ws_pkt.payload, "Trigger async") == 0) - { - free(buf); - return trigger_async_send(req->handle, req); - } - - ret = httpd_ws_send_frame(req, &ws_pkt); - if (ret != ESP_OK) - { - ESP_LOGE(TAG, "httpd_ws_send_frame failed with %d", ret); - } - free(buf); - return ret; -} - -static const httpd_uri_t ws = { - .uri = "/ws", - .method = HTTP_GET, - .handler = echo_handler, - .user_ctx = NULL, - .is_websocket = true}; - -static httpd_handle_t start_webserver(void) -{ - httpd_handle_t server = NULL; - httpd_config_t config = HTTPD_DEFAULT_CONFIG(); - - // Start the httpd server - ESP_LOGI(TAG, "Starting server on port: '%d'", config.server_port); - if (httpd_start(&server, &config) == ESP_OK) - { - // Registering the ws handler - ESP_LOGI(TAG, "Registering URI handlers"); - httpd_register_uri_handler(server, &ws); - return server; - } - - ESP_LOGI(TAG, "Error starting server!"); - return NULL; -} - -static void stop_webserver(httpd_handle_t server) -{ - // Stop the httpd server - httpd_stop(server); -} - -static void disconnect_handler(void *arg, esp_event_base_t event_base, - int32_t event_id, void *event_data) -{ - httpd_handle_t *server = (httpd_handle_t *)arg; - if (*server) - { - ESP_LOGI(TAG, "Stopping webserver"); - stop_webserver(*server); - *server = NULL; - } -} - -static void connect_handler(void *arg, esp_event_base_t event_base, - int32_t event_id, void *event_data) -{ - httpd_handle_t *server = (httpd_handle_t *)arg; - if (*server == NULL) - { - ESP_LOGI(TAG, "Starting webserver"); - *server = start_webserver(); - } -} - -void app_main(void) -{ - static httpd_handle_t server = NULL; - - ESP_ERROR_CHECK(nvs_flash_init()); - ESP_ERROR_CHECK(esp_netif_init()); - ESP_ERROR_CHECK(esp_event_loop_create_default()); - - /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig. - * Read "Establishing Wi-Fi or Ethernet Connection" section in - * examples/protocols/README.md for more information about this function. - */ - ESP_ERROR_CHECK(example_connect()); - - /* Register event handlers to stop the server when Wi-Fi or Ethernet is disconnected, - * and re-start it upon connection. - */ -#ifdef CONFIG_EXAMPLE_CONNECT_WIFI - ESP_ERROR_CHECK(esp_event_handler_register(IP_EVENT, IP_EVENT_STA_GOT_IP, &connect_handler, &server)); - ESP_ERROR_CHECK(esp_event_handler_register(WIFI_EVENT, WIFI_EVENT_STA_DISCONNECTED, &disconnect_handler, &server)); -#endif // CONFIG_EXAMPLE_CONNECT_WIFI -#ifdef CONFIG_EXAMPLE_CONNECT_ETHERNET - ESP_ERROR_CHECK(esp_event_handler_register(IP_EVENT, IP_EVENT_ETH_GOT_IP, &connect_handler, &server)); - ESP_ERROR_CHECK(esp_event_handler_register(ETH_EVENT, ETHERNET_EVENT_DISCONNECTED, &disconnect_handler, &server)); -#endif // CONFIG_EXAMPLE_CONNECT_ETHERNET - - /* Start the server for the first time */ - server = start_webserver(); -} diff --git a/sdkconfig b/sdkconfig index e08707c3d..ecab942a1 100644 --- a/sdkconfig +++ b/sdkconfig @@ -144,42 +144,6 @@ CONFIG_PARTITION_TABLE_OFFSET=0x8000 CONFIG_PARTITION_TABLE_MD5=y # end of Partition Table -# -# Example Connection Configuration -# -CONFIG_EXAMPLE_GPIO_RANGE_MIN=0 -CONFIG_EXAMPLE_GPIO_RANGE_MAX=48 -CONFIG_EXAMPLE_CONNECT_WIFI=y -CONFIG_EXAMPLE_WIFI_SSID="myssid" -CONFIG_EXAMPLE_WIFI_PASSWORD="mypassword" -# CONFIG_EXAMPLE_WIFI_SCAN_METHOD_FAST is not set -CONFIG_EXAMPLE_WIFI_SCAN_METHOD_ALL_CHANNEL=y - -# -# WiFi Scan threshold -# -CONFIG_EXAMPLE_WIFI_SCAN_RSSI_THRESHOLD=-127 -CONFIG_EXAMPLE_WIFI_AUTH_OPEN=y -# CONFIG_EXAMPLE_WIFI_AUTH_WEP is not set -# CONFIG_EXAMPLE_WIFI_AUTH_WPA_PSK is not set -# CONFIG_EXAMPLE_WIFI_AUTH_WPA2_PSK is not set -# CONFIG_EXAMPLE_WIFI_AUTH_WPA_WPA2_PSK is not set -# CONFIG_EXAMPLE_WIFI_AUTH_WPA2_ENTERPRISE is not set -# CONFIG_EXAMPLE_WIFI_AUTH_WPA3_PSK is not set -# CONFIG_EXAMPLE_WIFI_AUTH_WPA2_WPA3_PSK is not set -# CONFIG_EXAMPLE_WIFI_AUTH_WAPI_PSK is not set -# end of WiFi Scan threshold - -CONFIG_EXAMPLE_WIFI_CONNECT_AP_BY_SIGNAL=y -# CONFIG_EXAMPLE_WIFI_CONNECT_AP_BY_SECURITY is not set -# CONFIG_EXAMPLE_CONNECT_ETHERNET is not set -CONFIG_EXAMPLE_CONNECT_IPV6=y -CONFIG_EXAMPLE_CONNECT_IPV6_PREF_LOCAL_LINK=y -# CONFIG_EXAMPLE_CONNECT_IPV6_PREF_GLOBAL is not set -# CONFIG_EXAMPLE_CONNECT_IPV6_PREF_SITE_LOCAL is not set -# CONFIG_EXAMPLE_CONNECT_IPV6_PREF_UNIQUE_LOCAL is not set -# end of Example Connection Configuration - # # Compiler options # diff --git a/sdkconfig.old b/sdkconfig.old index 7c4f0e8ef..ecab942a1 100644 --- a/sdkconfig.old +++ b/sdkconfig.old @@ -144,42 +144,6 @@ CONFIG_PARTITION_TABLE_OFFSET=0x8000 CONFIG_PARTITION_TABLE_MD5=y # end of Partition Table -# -# Example Connection Configuration -# -CONFIG_EXAMPLE_GPIO_RANGE_MIN=0 -CONFIG_EXAMPLE_GPIO_RANGE_MAX=48 -CONFIG_EXAMPLE_CONNECT_WIFI=y -CONFIG_EXAMPLE_WIFI_SSID="myssid" -CONFIG_EXAMPLE_WIFI_PASSWORD="mypassword" -# CONFIG_EXAMPLE_WIFI_SCAN_METHOD_FAST is not set -CONFIG_EXAMPLE_WIFI_SCAN_METHOD_ALL_CHANNEL=y - -# -# WiFi Scan threshold -# -CONFIG_EXAMPLE_WIFI_SCAN_RSSI_THRESHOLD=-127 -CONFIG_EXAMPLE_WIFI_AUTH_OPEN=y -# CONFIG_EXAMPLE_WIFI_AUTH_WEP is not set -# CONFIG_EXAMPLE_WIFI_AUTH_WPA_PSK is not set -# CONFIG_EXAMPLE_WIFI_AUTH_WPA2_PSK is not set -# CONFIG_EXAMPLE_WIFI_AUTH_WPA_WPA2_PSK is not set -# CONFIG_EXAMPLE_WIFI_AUTH_WPA2_ENTERPRISE is not set -# CONFIG_EXAMPLE_WIFI_AUTH_WPA3_PSK is not set -# CONFIG_EXAMPLE_WIFI_AUTH_WPA2_WPA3_PSK is not set -# CONFIG_EXAMPLE_WIFI_AUTH_WAPI_PSK is not set -# end of WiFi Scan threshold - -CONFIG_EXAMPLE_WIFI_CONNECT_AP_BY_SIGNAL=y -# CONFIG_EXAMPLE_WIFI_CONNECT_AP_BY_SECURITY is not set -# CONFIG_EXAMPLE_CONNECT_ETHERNET is not set -CONFIG_EXAMPLE_CONNECT_IPV6=y -CONFIG_EXAMPLE_CONNECT_IPV6_PREF_LOCAL_LINK=y -# CONFIG_EXAMPLE_CONNECT_IPV6_PREF_GLOBAL is not set -# CONFIG_EXAMPLE_CONNECT_IPV6_PREF_SITE_LOCAL is not set -# CONFIG_EXAMPLE_CONNECT_IPV6_PREF_UNIQUE_LOCAL is not set -# end of Example Connection Configuration - # # Compiler options # @@ -1653,7 +1617,7 @@ CONFIG_LUA_ROOT="/lua" # # Compatibility options # -CONFIG_LEGACY_INCLUDE_COMMON_HEADERS=y +# CONFIG_LEGACY_INCLUDE_COMMON_HEADERS is not set # end of Compatibility options # Deprecated options for backward compatibility From d4395815567f2f210bbf78253848f1cf1ba93f35 Mon Sep 17 00:00:00 2001 From: Krishna Kumar Sah Date: Sat, 17 Feb 2024 16:20:09 +0545 Subject: [PATCH 05/27] added uuid-generater/parser in util lib --- .../ezlopi-core-ws-server/CMakeLists.txt | 1 + ezlopi-util/ezlopi-util-uuid/cMakeLIsts.txt | 4 + .../ezlopi-util-uuid/ezlopi_util_uuid.c | 105 ++++++++++++++++++ .../ezlopi-util-uuid/ezlopi_util_uuid.h | 15 +++ .../ezlopi-util-version/CMakeLists.txt | 2 +- 5 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 ezlopi-util/ezlopi-util-uuid/cMakeLIsts.txt create mode 100644 ezlopi-util/ezlopi-util-uuid/ezlopi_util_uuid.c create mode 100644 ezlopi-util/ezlopi-util-uuid/ezlopi_util_uuid.h diff --git a/ezlopi-core/ezlopi-core-ws-server/CMakeLists.txt b/ezlopi-core/ezlopi-core-ws-server/CMakeLists.txt index ea1c896f5..fd961fc19 100644 --- a/ezlopi-core/ezlopi-core-ws-server/CMakeLists.txt +++ b/ezlopi-core/ezlopi-core-ws-server/CMakeLists.txt @@ -10,6 +10,7 @@ set(EZLOPI_SDK_COMPONENTS # Define ezlopi-components set(EZLOPI_COMPONENTS + ezlopi-util-uuid ezlopi-util-trace ) diff --git a/ezlopi-util/ezlopi-util-uuid/cMakeLIsts.txt b/ezlopi-util/ezlopi-util-uuid/cMakeLIsts.txt new file mode 100644 index 000000000..a92951b35 --- /dev/null +++ b/ezlopi-util/ezlopi-util-uuid/cMakeLIsts.txt @@ -0,0 +1,4 @@ +file(GLOB_RECURSE config_src "*.c*") + +idf_component_register(SRCS "${config_src}" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/ezlopi-util/ezlopi-util-uuid/ezlopi_util_uuid.c b/ezlopi-util/ezlopi-util-uuid/ezlopi_util_uuid.c new file mode 100644 index 000000000..6b1278a17 --- /dev/null +++ b/ezlopi-util/ezlopi-util-uuid/ezlopi_util_uuid.c @@ -0,0 +1,105 @@ +#include +#include + +#include "config.h" +#include "ezlopi_util_uuid.h" + +const unsigned char hex[16] = "0123456789abcdef"; + +static int __hex2dec(char c); + +void ezlopi_util_uuid_generate_random(uuid_t out) +{ + int i, j, rnd; + static int seeded = 0; + + if (!seeded) + { + srand(time(NULL)); + seeded = 1; + } + + for (i = 0; i < (16 / RAND_LENGTH); i++) + { + rnd = rand(); + + for (j = 0; j < RAND_LENGTH; j++) + { + out[i * RAND_LENGTH + j] = (0xff & rnd >> (8 * j)); + } + } + + // set the version to 4 + out[6] = (out[6] & 0x0f) | 0x40; + + // set the variant to 1 (a) + out[8] = (out[8] & 0x0f) | 0xa0; +} + +void ezlopi_util_uuid_parse(const char *in, uuid_t uuid) +{ + int i, j; + + i = j = 0; + + do + { + switch (in[i]) + { + case '-': + break; + default: + uuid[j++] = (__hex2dec(in[i++]) << 4) | __hex2dec(in[i]); + } + + i++; + } while (j < 16 && i < 36); +} + +void ezlopi_util_uuid_unparse(const uuid_t uuid, char *out) +{ + int i, j; + + i = j = 0; + + do + { + switch (j) + { + case 4: + case 6: + case 8: + case 10: + out[i++] = '-'; + } + + out[i++] = hex[(uuid[j] >> 4)]; + out[i++] = hex[(0xf & uuid[j])]; + + j++; + } while (j < 16); + + out[36] = 0; +} + +void ezlopi_util_uuid_copy(uuid_t dst, const uuid_t src) +{ + int i; + for (i = 0; i < sizeof(uuid_t); i++) + { + dst[i] = src[i]; + } +} + +static int __hex2dec(char c) +{ + int i; + + for (i = 0; i < 16; i++) + { + if (hex[i] == c) + return i; + } + + return -1; +} diff --git a/ezlopi-util/ezlopi-util-uuid/ezlopi_util_uuid.h b/ezlopi-util/ezlopi-util-uuid/ezlopi_util_uuid.h new file mode 100644 index 000000000..86cec0c39 --- /dev/null +++ b/ezlopi-util/ezlopi-util-uuid/ezlopi_util_uuid.h @@ -0,0 +1,15 @@ +#ifndef __EZLOPI_UTIL_UUID_H__ +#define __EZLOPI_UTIL_UUID_H__ + +#define RAND_LENGTH 4 + +typedef unsigned char uuid_t[16]; + +#define uuid_generate(out) ezlopi_util_uuid_generate_random(out) + +void ezlopi_util_uuid_generate_random(uuid_t out); +void ezlopi_util_uuid_unparse(const uuid_t uuid, char *out); +void ezlopi_util_uuid_copy(uuid_t dst, const uuid_t src); +void ezlopi_util_uuid_parse(const char *in, uuid_t uuid); + +#endif // __EZLOPI_UTIL_UUID_H__ \ No newline at end of file diff --git a/ezlopi-util/ezlopi-util-version/CMakeLists.txt b/ezlopi-util/ezlopi-util-version/CMakeLists.txt index 615e56a08..a92951b35 100644 --- a/ezlopi-util/ezlopi-util-version/CMakeLists.txt +++ b/ezlopi-util/ezlopi-util-version/CMakeLists.txt @@ -1,4 +1,4 @@ -file(GLOB_RECURSE config_src "src/*.c*") +file(GLOB_RECURSE config_src "*.c*") idf_component_register(SRCS "${config_src}" INCLUDE_DIRS ".") \ No newline at end of file From 42979a78d229d9b0f662f69bb4466215f08593e4 Mon Sep 17 00:00:00 2001 From: Krishna Kumar Sah Date: Wed, 21 Feb 2024 14:43:34 +0545 Subject: [PATCH 06/27] testing out ws-server --- ezlopi-core/ezlopi-core-ezlopi/CMakeLists.txt | 3 +- .../ezlopi-core-ezlopi/ezlopi_core_ezlopi.c | 2 + .../ezlopi-core-ws-server/CMakeLists.txt | 9 +- .../ezlopi_core_ws_server.c | 124 ++++++++++++++---- .../ezlopi_core_ws_server.h | 2 + .../ezlopi_core_ws_server_config.h | 6 + .../ezlopi_core_ws_server_conn.c | 69 +++++++--- .../ezlopi_core_ws_server_conn.h | 12 +- .../ezlopi_service_webprov.c | 2 +- ezlopi-util/ezlopi-util-uuid/CMakeLists.txt | 7 + ezlopi-util/ezlopi-util-uuid/cMakeLIsts.txt | 4 - ezlopi-util/ezlopi-util-uuid/component.mk | 8 ++ .../ezlopi-util-uuid/ezlopi_util_uuid.c | 19 ++- .../ezlopi-util-uuid/ezlopi_util_uuid.h | 10 +- main/CMakeLists.txt | 2 +- main/ezlopi_main.c | 22 +--- sdkconfig | 66 ++++++---- sdkconfig.old | 60 +++++---- 18 files changed, 295 insertions(+), 132 deletions(-) create mode 100644 ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_config.h create mode 100644 ezlopi-util/ezlopi-util-uuid/CMakeLists.txt delete mode 100644 ezlopi-util/ezlopi-util-uuid/cMakeLIsts.txt create mode 100644 ezlopi-util/ezlopi-util-uuid/component.mk diff --git a/ezlopi-core/ezlopi-core-ezlopi/CMakeLists.txt b/ezlopi-core/ezlopi-core-ezlopi/CMakeLists.txt index 45dcb11c1..538abceec 100644 --- a/ezlopi-core/ezlopi-core-ezlopi/CMakeLists.txt +++ b/ezlopi-core/ezlopi-core-ezlopi/CMakeLists.txt @@ -6,8 +6,9 @@ set(EZLOPI_CORE_COMPONENTS ezlopi-core-wifi ezlopi-core-modes ezlopi-core-sntp + ezlopi-core-ws-server ) -idf_component_register(SRCS "${config_src}" +idf_component_register(SRCS "ezlopi_core_ezlopi.c" "${config_src}" INCLUDE_DIRS "." REQUIRES ${EZLOPI_CORE_COMPONENTS}) diff --git a/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi.c b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi.c index ca51f94cf..b6d003c8c 100644 --- a/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi.c +++ b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi.c @@ -9,6 +9,7 @@ #include "ezlopi_core_room.h" #include "ezlopi_core_timer.h" #include "ezlopi_core_modes.h" +#include "ezlopi_core_ws_server.h" #include "ezlopi_core_event_queue.h" #include "ezlopi_core_event_group.h" #include "ezlopi_core_factory_info.h" @@ -60,6 +61,7 @@ void ezlopi_init(void) ezlopi_ping_init(); ezlopi_core_sntp_init(); ezlopi_timer_start_1000ms(); + ezlopi_core_ws_server_init(); #endif } diff --git a/ezlopi-core/ezlopi-core-ws-server/CMakeLists.txt b/ezlopi-core/ezlopi-core-ws-server/CMakeLists.txt index fd961fc19..075e15c53 100644 --- a/ezlopi-core/ezlopi-core-ws-server/CMakeLists.txt +++ b/ezlopi-core/ezlopi-core-ws-server/CMakeLists.txt @@ -6,6 +6,8 @@ set(EZLOPI_SDK_COMPONENTS nghttp esp_http_server protocol_examples_common + wpa_supplicant + esp_https_server ) # Define ezlopi-components @@ -53,11 +55,12 @@ set(EZLOPI_SERVICES ) # Register the components -idf_component_register(SRCS "${config_src}" +idf_component_register(SRCS "ezlopi_core_ws_server.c" "ezlopi_core_ws_server_conn.c" "${config_src}" INCLUDE_DIRS "." - REQUIRES ${EZLOPI_CORE_COMPONENTS} + REQUIRES ${EZLOPI_SERVICES} + ${EZLOPI_COMPONENTS} ${EZLOPI_HAL_COMPONENTS} + ${EZLOPI_CORE_COMPONENTS} ${EZLOPI_CLOUD_COMPONENTS} ${EZLOPI_SENSOR_DEVICE_COMPONENTS} - ${EZLOPI_SERVICES} ) diff --git a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.c b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.c index bbe0b49a3..9c561ec30 100644 --- a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.c +++ b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.c @@ -1,15 +1,21 @@ +#include + #include #include #include #include - +#include #include #include +#include "ezlopi_util_uuid.h" #include "ezlopi_util_trace.h" + #include "ezlopi_core_ws_server.h" #include "ezlopi_core_ws_server_conn.h" +#include "ezlopi_core_ws_server_config.h" +static const char *gsc_sec_key_name = "Sec-WebSocket-Key:"; static TaskHandle_t gs_task_handle = NULL; static void __server_init(void); @@ -21,6 +27,8 @@ void ezlopi_core_ws_server_deinit(void) { vTaskDelete(gs_task_handle); } + + s_ws_server_connections_t *curr_con = ezlopi_core_ws_server_conn_get_head(); } void ezlopi_core_ws_server_init(void) @@ -33,6 +41,8 @@ void ezlopi_core_ws_server_init(void) typedef struct s_ws_connections { + ezlopi_uuid_t server_uuid; + ezlopi_uuid_t client_uuid; TaskHandle_t task_handle; struct netconn *conn; @@ -43,57 +53,127 @@ static s_ws_connections_t *conn_head = NULL; static void __connection_process(void *pv) { - struct netconn *conn = (struct netconn *)pv; + s_ws_connections_t *ws_conn = (s_ws_connections_t *)pv; + + if (ws_conn) + { + if (ws_conn->conn) + { + while (1) + { + TRACE_D("here"); + struct netbuf *net_buffer = NULL; + err_t err = netconn_recv(ws_conn->conn, &net_buffer); + + if ((ESP_OK == err) && net_buffer) + { + char *data_str = NULL; + uint32_t data_len = 0; - while (1) + netbuf_data(net_buffer, &data_str, &data_len); + + TRACE_D("ws-rx-data: %s", data_str); + } + + vTaskDelay(100 / portTICK_PERIOD_MS); + } + + netconn_delete(ws_conn->conn); + ws_conn->conn = NULL; + ws_conn->task_handle = NULL; + } + } + else { - struct netbuf * net_buffer = NULL; - err_t err = netconn_recv(conn, &net_buffer); - + TRACE_E("ws-conn is NULL"); } + + vTaskDelete(NULL); } static void __server_process(void *pv) { + TRACE_D("Here"); struct netconn *listen_con = netconn_new(NETCONN_TCP); if (listen_con) { - netconn_bind(listen_con, NULL, 80); + netconn_bind(listen_con, IP4_ADDR_ANY, 80); err_t err = netconn_listen(listen_con); - if (err) + if (ERR_OK == err) { + TRACE_D("listening..."); while (1) { struct netconn *new_con = NULL; - err = netconn_accept(listen_con, &new_con); - TRACE_W("new-conn: %s", lwip_strerr(err)); + TRACE_D("waiting for new connection..."); + err = netconn_accept(listen_con, &new_con); if ((ERR_OK == err) && new_con) { - TaskHandle_t conn_handle = NULL; - xTaskCreate(__connection_process, "ws-connection", 4 * 1024, new_con, 5, &conn_handle); - if (ezlopi_core_ws_server_conn_add_new_conn(conn_handle, new_con)) + s_ws_server_connections_t *ws_conn = ezlopi_core_ws_server_conn_add_ws_conn(new_con); + if (ws_conn) { - if (conn_handle) - { - vTaskDelete(conn_handle); - } - - if (new_con) - { - netconn_delete(new_con); - } + xTaskCreate(__connection_process, "ws-connection", 4 * 1024, ws_conn, 5, &ws_conn->handle); + } + else + { + netconn_delete(new_con); } } } } else { + TRACE_E("error[%d]: %s", err, lwip_strerr(err)); netconn_delete(listen_con); + TRACE_E("failed"); } } + else + { + TRACE_E("FAILED"); + } gs_task_handle = NULL; vTaskDelete(NULL); +} + +static int __new_connection_handsake(s_ws_connections_t *ws_conn) +{ + int ret = 0; + + if (ws_conn && ws_conn->conn) + { + struct netbuf *net_buffer = NULL; + err_t err = netconn_recv(ws_conn->conn, &net_buffer); + + if (err && net_buffer) + { + char *net_buf_data = NULL; + uint32_t data_size = 0; + + netbuf_data(net_buffer, net_buf_data, data_size); + + if (net_buf_data) + { + TRACE_D("handsake-data: %s", net_buf_data); + + char *client_sec_key = strstr(net_buf_data, gsc_sec_key_name); + if (client_sec_key) + { + char concated_strings[80]; + client_sec_key += strlen(gsc_sec_key_name) + 1; + uint32_t client_sec_key_len = strstr(client_sec_key, "\r\n") - (uint32_t)client_sec_key; + + ezlopi_util_uuid_generate_random(ws_conn->server_uuid); + uint32_t tmp_len = snprintf(concated_strings, sizeof(concated_strings), "%.*s", client_sec_key_len, client_sec_key); + ezlopi_util_uuid_unparse(ws_conn->server_uuid, concated_strings + tmp_len); + + // esp_sha(SHA1, ) + } + } + } + } + return ret; } \ No newline at end of file diff --git a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.h b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.h index db21d2210..bb92c1ef8 100644 --- a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.h +++ b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.h @@ -6,4 +6,6 @@ typedef struct s_ezlopi_ws_server } s_ezlopi_ws_server_t; +void ezlopi_core_ws_server_init(void); + #endif // __EZLOPI_CORE_WS_H__ diff --git a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_config.h b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_config.h new file mode 100644 index 000000000..7e88708b6 --- /dev/null +++ b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_config.h @@ -0,0 +1,6 @@ +#ifndef __EZLOPI_CORE_WS_SERVER_CONFIG_H__ +#define __EZLOPI_CORE_WS_SERVER_CONFIG_H__ + +#define WEBSOCKET_CLIENT_KEY_LEN 24 + +#endif // __EZLOPI_CORE_WS_SERVER_CONFIG_H__ diff --git a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.c b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.c index 081b876dd..b96cae354 100644 --- a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.c +++ b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.c @@ -1,47 +1,73 @@ #include +#include +#include + +#include "ezlopi_util_uuid.h" #include "ezlopi_core_ws_server_conn.h" -static s_ws_server_new_connections_t *conn_head = NULL; +static s_ws_server_connections_t *ws_conn_head = NULL; -static s_ws_server_new_connections_t *__create_new_conn(TaskHandle_t handle, struct netconn *conn); +static s_ws_server_connections_t *__create_ws_conn(struct netconn *conn); -int ezlopi_core_ws_server_conn_add_new_conn(TaskHandle_t handle, struct netconn *conn) +s_ws_server_connections_t *ezlopi_core_ws_server_conn_get_head(void) { - int ret = 0; - if (conn_head) + return ws_conn_head; +} + +s_ws_server_connections_t *ezlopi_core_ws_server_conn_add_ws_conn(struct netconn *new_net_conn) +{ + s_ws_server_connections_t *ws_conn = NULL; + if (ws_conn_head) { - s_ws_server_new_connections_t *curr_conn = conn_head; + s_ws_server_connections_t *curr_conn = ws_conn_head; while (curr_conn->next) { curr_conn = curr_conn->next; } - curr_conn->next = __create_new_conn(handle, conn); + curr_conn->next = __create_ws_conn(new_net_conn); + ws_conn = curr_conn->next; } else { - conn_head = __create_new_conn(handle, conn); + ws_conn_head = __create_ws_conn(new_net_conn); + ws_conn = ws_conn_head; } - return ret; + return ws_conn; } -int ezlopi_core_ws_server_conn_remove_conn(struct netconn *conn) +int ezlopi_core_ws_server_conn_remove(s_ws_server_connections_t *remove_con) { int ret = 0; - if (conn == conn_head->conn) + if (remove_con) { - netconn_delete(conn); - + } + + return ret; +} + +s_ws_server_connections_t *ezlopi_core_ws_server_conn_pop(struct netconn *conn) +{ + s_ws_server_connections_t *pop_con = NULL; + + if (conn == ws_conn_head->conn) + { + pop_con = ws_conn_head; + ws_conn_head = ws_conn_head->next; + pop_con->next = NULL; } else { - s_ws_server_new_connections_t *curr_conn = conn_head; + s_ws_server_connections_t *curr_conn = ws_conn_head; while (curr_conn->next) { - if (curr_conn->next == conn) + if (curr_conn->next->conn == conn) { + pop_con = curr_conn->next; + curr_conn->next = curr_conn->next->next; + pop_con->next = NULL; break; } @@ -49,18 +75,19 @@ int ezlopi_core_ws_server_conn_remove_conn(struct netconn *conn) } } - return ret; + return pop_con; } -static s_ws_server_new_connections_t *__create_new_conn(TaskHandle_t handle, struct netconn *conn) +static s_ws_server_connections_t *__create_ws_conn(struct netconn *new_net_conn) { - s_ws_server_new_connections_t *new_ws_conn = malloc(sizeof(s_ws_server_new_connections_t)); + s_ws_server_connections_t *new_ws_conn = malloc(sizeof(s_ws_server_connections_t)); if (new_ws_conn) { - memset(new_ws_conn, 0, sizeof(s_ws_server_new_connections_t)); + memset(new_ws_conn, 0, sizeof(s_ws_server_connections_t)); - new_ws_conn->conn = conn; - new_ws_conn->handle = handle; + new_ws_conn->handle = NULL; + new_ws_conn->conn = new_net_conn; + ezlopi_util_uuid_generate_random(new_ws_conn->uuid); new_ws_conn->next = NULL; } diff --git a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.h b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.h index 131967eb2..5defd1b84 100644 --- a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.h +++ b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.h @@ -7,14 +7,18 @@ #include #include -typedef struct s_ws_server_new_connections +#include "ezlopi_util_uuid.h" + +typedef struct s_ws_server_connections { + ezlopi_uuid_t uuid; TaskHandle_t handle; struct netconn *conn; - struct s_ws_server_new_connections *next; -} s_ws_server_new_connections_t; + struct s_ws_server_connections *next; +} s_ws_server_connections_t; -int ezlopi_core_ws_server_conn_add_new_conn(TaskHandle_t handle, struct netconn *conn); +s_ws_server_connections_t *ezlopi_core_ws_server_conn_get_head(void); +s_ws_server_connections_t *ezlopi_core_ws_server_conn_add_ws_conn(struct netconn *conn); #endif // __EZLOPI_CORE_WS_SERVER_CONN_H__ diff --git a/ezlopi-services/ezlopi-service-webprov/ezlopi_service_webprov.c b/ezlopi-services/ezlopi-service-webprov/ezlopi_service_webprov.c index a6901f6af..83be96994 100644 --- a/ezlopi-services/ezlopi-service-webprov/ezlopi_service_webprov.c +++ b/ezlopi-services/ezlopi-service-webprov/ezlopi_service_webprov.c @@ -357,7 +357,7 @@ static void web_provisioning_config_check(void *pv) if (NULL != response) { - TRACE_S("Statuc Code : %d", response->status_code); + TRACE_S("Status Code : %d", response->status_code); switch (response->status_code) { diff --git a/ezlopi-util/ezlopi-util-uuid/CMakeLists.txt b/ezlopi-util/ezlopi-util-uuid/CMakeLists.txt new file mode 100644 index 000000000..25bb8ac5f --- /dev/null +++ b/ezlopi-util/ezlopi-util-uuid/CMakeLists.txt @@ -0,0 +1,7 @@ +# set(config_src "config.cpp") + +file(GLOB_RECURSE config_src "./*.c") + +idf_component_register(SRCS "ezlopi_util_uuid.c" "${config_src}" + INCLUDE_DIRS "." + REQUIRES ) \ No newline at end of file diff --git a/ezlopi-util/ezlopi-util-uuid/cMakeLIsts.txt b/ezlopi-util/ezlopi-util-uuid/cMakeLIsts.txt deleted file mode 100644 index a92951b35..000000000 --- a/ezlopi-util/ezlopi-util-uuid/cMakeLIsts.txt +++ /dev/null @@ -1,4 +0,0 @@ -file(GLOB_RECURSE config_src "*.c*") - -idf_component_register(SRCS "${config_src}" - INCLUDE_DIRS ".") \ No newline at end of file diff --git a/ezlopi-util/ezlopi-util-uuid/component.mk b/ezlopi-util/ezlopi-util-uuid/component.mk new file mode 100644 index 000000000..608de873e --- /dev/null +++ b/ezlopi-util/ezlopi-util-uuid/component.mk @@ -0,0 +1,8 @@ +# +# "main" pseudo-component makefile. +# +# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) + + +COMPONENT_ADD_SRCDIRS := .. +COMPONENT_ADD_INCLUDEDIRS := .. \ No newline at end of file diff --git a/ezlopi-util/ezlopi-util-uuid/ezlopi_util_uuid.c b/ezlopi-util/ezlopi-util-uuid/ezlopi_util_uuid.c index 6b1278a17..46c8466f2 100644 --- a/ezlopi-util/ezlopi-util-uuid/ezlopi_util_uuid.c +++ b/ezlopi-util/ezlopi-util-uuid/ezlopi_util_uuid.c @@ -8,7 +8,7 @@ const unsigned char hex[16] = "0123456789abcdef"; static int __hex2dec(char c); -void ezlopi_util_uuid_generate_random(uuid_t out) +void ezlopi_util_uuid_generate_random(ezlopi_uuid_t out) { int i, j, rnd; static int seeded = 0; @@ -36,7 +36,7 @@ void ezlopi_util_uuid_generate_random(uuid_t out) out[8] = (out[8] & 0x0f) | 0xa0; } -void ezlopi_util_uuid_parse(const char *in, uuid_t uuid) +void ezlopi_util_uuid_parse(const char *in, ezlopi_uuid_t uuid) { int i, j; @@ -47,16 +47,21 @@ void ezlopi_util_uuid_parse(const char *in, uuid_t uuid) switch (in[i]) { case '-': + { break; + } default: - uuid[j++] = (__hex2dec(in[i++]) << 4) | __hex2dec(in[i]); + { + uuid[j++] = (__hex2dec(in[i]) << 4) | __hex2dec(in[i + 1]); + } } - i++; + i+=2; + } while (j < 16 && i < 36); } -void ezlopi_util_uuid_unparse(const uuid_t uuid, char *out) +void ezlopi_util_uuid_unparse(const ezlopi_uuid_t uuid, char *out) { int i, j; @@ -82,10 +87,10 @@ void ezlopi_util_uuid_unparse(const uuid_t uuid, char *out) out[36] = 0; } -void ezlopi_util_uuid_copy(uuid_t dst, const uuid_t src) +void ezlopi_util_uuid_copy(ezlopi_uuid_t dst, const ezlopi_uuid_t src) { int i; - for (i = 0; i < sizeof(uuid_t); i++) + for (i = 0; i < sizeof(ezlopi_uuid_t); i++) { dst[i] = src[i]; } diff --git a/ezlopi-util/ezlopi-util-uuid/ezlopi_util_uuid.h b/ezlopi-util/ezlopi-util-uuid/ezlopi_util_uuid.h index 86cec0c39..8205acb7d 100644 --- a/ezlopi-util/ezlopi-util-uuid/ezlopi_util_uuid.h +++ b/ezlopi-util/ezlopi-util-uuid/ezlopi_util_uuid.h @@ -3,13 +3,13 @@ #define RAND_LENGTH 4 -typedef unsigned char uuid_t[16]; +typedef unsigned char ezlopi_uuid_t[16]; #define uuid_generate(out) ezlopi_util_uuid_generate_random(out) -void ezlopi_util_uuid_generate_random(uuid_t out); -void ezlopi_util_uuid_unparse(const uuid_t uuid, char *out); -void ezlopi_util_uuid_copy(uuid_t dst, const uuid_t src); -void ezlopi_util_uuid_parse(const char *in, uuid_t uuid); +void ezlopi_util_uuid_generate_random(ezlopi_uuid_t out); +void ezlopi_util_uuid_unparse(const ezlopi_uuid_t uuid, char *out); +void ezlopi_util_uuid_copy(ezlopi_uuid_t dst, const ezlopi_uuid_t src); +void ezlopi_util_uuid_parse(const char *in, ezlopi_uuid_t uuid); #endif // __EZLOPI_UTIL_UUID_H__ \ No newline at end of file diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 101724d8c..043851d6f 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -47,7 +47,7 @@ set(EZLOPI_SERVICES ) # Register the components -idf_component_register(SRCS "${config_src}" +idf_component_register(SRCS "ezlopi_main.c" "${config_src}" INCLUDE_DIRS "." REQUIRES ${EZLOPI_CORE_COMPONENTS} ${EZLOPI_HAL_COMPONENTS} diff --git a/main/ezlopi_main.c b/main/ezlopi_main.c index 2cdc119ab..019f231f0 100644 --- a/main/ezlopi_main.c +++ b/main/ezlopi_main.c @@ -25,28 +25,18 @@ static void blinky(void *pv); // extern void wss_server_init(void); -void vApplicationIdleHook(void) -{ - TRACE_D("vApplicationIdleHook"); -} - -void vApplicationTickHook(void) -{ - TRACE_D("vApplicationTickHook"); -} - void app_main(void) { gpio_install_isr_service(0); qt_serial_init(); gpio_isr_service_init(); ezlopi_init(); - ezlopi_ble_service_init(); - timer_service_init(); - ezlopi_scenes_meshbot_init(); - web_provisioning_init(); - ota_service_init(); - ezlopi_service_modes_init(); + // ezlopi_ble_service_init(); + // timer_service_init(); + // ezlopi_scenes_meshbot_init(); + // web_provisioning_init(); + // ota_service_init(); + // ezlopi_service_modes_init(); // wss_server_init(); xTaskCreate(blinky, "blinky", 2 * 2048, NULL, 1, NULL); diff --git a/sdkconfig b/sdkconfig index ecab942a1..79b441d36 100644 --- a/sdkconfig +++ b/sdkconfig @@ -106,12 +106,12 @@ CONFIG_ESPTOOLPY_FLASHFREQ="40m" # CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y +CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y +# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE="16MB" +CONFIG_ESPTOOLPY_FLASHSIZE="8MB" CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y CONFIG_ESPTOOLPY_BEFORE_RESET=y # CONFIG_ESPTOOLPY_BEFORE_NORESET is not set @@ -700,7 +700,7 @@ CONFIG_HTTPD_WS_SUPPORT=y # # ESP HTTPS OTA # -# CONFIG_OTA_ALLOW_HTTP is not set +CONFIG_OTA_ALLOW_HTTP=y # end of ESP HTTPS OTA # @@ -904,8 +904,19 @@ CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM=7 # Core dump # # CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH is not set -# CONFIG_ESP_COREDUMP_ENABLE_TO_UART is not set -CONFIG_ESP_COREDUMP_ENABLE_TO_NONE=y +CONFIG_ESP_COREDUMP_ENABLE_TO_UART=y +# CONFIG_ESP_COREDUMP_ENABLE_TO_NONE is not set +# CONFIG_ESP_COREDUMP_DATA_FORMAT_BIN is not set +CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF=y +CONFIG_ESP_COREDUMP_CHECKSUM_CRC32=y +CONFIG_ESP_COREDUMP_ENABLE=y +CONFIG_ESP_COREDUMP_LOGS=y +CONFIG_ESP_COREDUMP_MAX_TASKS_NUM=64 +CONFIG_ESP_COREDUMP_UART_DELAY=0 +CONFIG_ESP_COREDUMP_STACK_SIZE=0 +CONFIG_ESP_COREDUMP_DECODE_INFO=y +# CONFIG_ESP_COREDUMP_DECODE_DISABLE is not set +CONFIG_ESP_COREDUMP_DECODE="info" # end of Core dump # @@ -948,21 +959,18 @@ CONFIG_FATFS_PER_FILE_CACHE=y # # CONFIG_FMB_COMM_MODE_TCP_EN is not set CONFIG_FMB_COMM_MODE_RTU_EN=y -CONFIG_FMB_COMM_MODE_ASCII_EN=y +# CONFIG_FMB_COMM_MODE_ASCII_EN is not set CONFIG_FMB_MASTER_TIMEOUT_MS_RESPOND=150 CONFIG_FMB_MASTER_DELAY_MS_CONVERT=200 CONFIG_FMB_QUEUE_LENGTH=20 CONFIG_FMB_PORT_TASK_STACK_SIZE=4096 CONFIG_FMB_SERIAL_BUF_SIZE=256 -CONFIG_FMB_SERIAL_ASCII_BITS_PER_SYMB=8 -CONFIG_FMB_SERIAL_ASCII_TIMEOUT_RESPOND_MS=1000 CONFIG_FMB_PORT_TASK_PRIO=10 # CONFIG_FMB_PORT_TASK_AFFINITY_NO_AFFINITY is not set CONFIG_FMB_PORT_TASK_AFFINITY_CPU0=y # CONFIG_FMB_PORT_TASK_AFFINITY_CPU1 is not set CONFIG_FMB_PORT_TASK_AFFINITY=0x0 -CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT=y -CONFIG_FMB_CONTROLLER_SLAVE_ID=0x00112233 +# CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT is not set CONFIG_FMB_CONTROLLER_NOTIFY_TIMEOUT=20 CONFIG_FMB_CONTROLLER_NOTIFY_QUEUE_SIZE=20 CONFIG_FMB_CONTROLLER_STACK_SIZE=4096 @@ -992,8 +1000,8 @@ CONFIG_FREERTOS_ASSERT_FAIL_ABORT=y # CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE is not set # CONFIG_FREERTOS_ASSERT_DISABLE is not set CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536 -CONFIG_FREERTOS_ISR_STACKSIZE=1536 -CONFIG_FREERTOS_LEGACY_HOOKS=y +CONFIG_FREERTOS_ISR_STACKSIZE=2096 +# CONFIG_FREERTOS_LEGACY_HOOKS is not set CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16 CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y # CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP is not set @@ -1177,8 +1185,8 @@ CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS=5 # ICMP # CONFIG_LWIP_ICMP=y -# CONFIG_LWIP_MULTICAST_PING is not set -# CONFIG_LWIP_BROADCAST_PING is not set +CONFIG_LWIP_MULTICAST_PING=y +CONFIG_LWIP_BROADCAST_PING=y # end of ICMP # @@ -1190,7 +1198,7 @@ CONFIG_LWIP_MAX_RAW_PCBS=16 # # SNTP # -CONFIG_LWIP_SNTP_MAX_SERVERS=1 +CONFIG_LWIP_SNTP_MAX_SERVERS=3 # CONFIG_LWIP_DHCP_GET_NTP_SRV is not set CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 # end of SNTP @@ -1287,7 +1295,7 @@ CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y # end of TLS Key Exchange Methods CONFIG_MBEDTLS_SSL_RENEGOTIATION=y -# CONFIG_MBEDTLS_SSL_PROTO_SSL3 is not set +CONFIG_MBEDTLS_SSL_PROTO_SSL3=y CONFIG_MBEDTLS_SSL_PROTO_TLS1=y CONFIG_MBEDTLS_SSL_PROTO_TLS1_1=y CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y @@ -1371,10 +1379,9 @@ CONFIG_MDNS_MULTIPLE_INSTANCE=y # # ESP-MQTT Configurations # -CONFIG_MQTT_PROTOCOL_311=y -CONFIG_MQTT_TRANSPORT_SSL=y -CONFIG_MQTT_TRANSPORT_WEBSOCKET=y -CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y +# CONFIG_MQTT_PROTOCOL_311 is not set +# CONFIG_MQTT_TRANSPORT_SSL is not set +# CONFIG_MQTT_TRANSPORT_WEBSOCKET is not set # CONFIG_MQTT_MSG_ID_INCREMENTAL is not set # CONFIG_MQTT_SKIP_PUBLISH_IF_DISCONNECTED is not set # CONFIG_MQTT_REPORT_DELETED_MESSAGES is not set @@ -1880,16 +1887,25 @@ CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y CONFIG_TIMER_TASK_STACK_SIZE=3584 CONFIG_SW_COEXIST_ENABLE=y # CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set -# CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set -CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y +CONFIG_ESP32_ENABLE_COREDUMP_TO_UART=y +# CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE is not set +# CONFIG_ESP32_COREDUMP_DATA_FORMAT_BIN is not set +CONFIG_ESP32_COREDUMP_DATA_FORMAT_ELF=y +CONFIG_ESP32_COREDUMP_CHECKSUM_CRC32=y +CONFIG_ESP32_ENABLE_COREDUMP=y +CONFIG_ESP32_CORE_DUMP_MAX_TASKS_NUM=64 +CONFIG_ESP32_CORE_DUMP_UART_DELAY=0 +CONFIG_ESP32_CORE_DUMP_STACK_SIZE=0 +CONFIG_ESP32_CORE_DUMP_DECODE_INFO=y +# CONFIG_ESP32_CORE_DUMP_DECODE_DISABLE is not set +CONFIG_ESP32_CORE_DUMP_DECODE="info" CONFIG_MB_MASTER_TIMEOUT_MS_RESPOND=150 CONFIG_MB_MASTER_DELAY_MS_CONVERT=200 CONFIG_MB_QUEUE_LENGTH=20 CONFIG_MB_SERIAL_TASK_STACK_SIZE=4096 CONFIG_MB_SERIAL_BUF_SIZE=256 CONFIG_MB_SERIAL_TASK_PRIO=10 -CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT=y -CONFIG_MB_CONTROLLER_SLAVE_ID=0x00112233 +# CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT is not set CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT=20 CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE=20 CONFIG_MB_CONTROLLER_STACK_SIZE=4096 diff --git a/sdkconfig.old b/sdkconfig.old index ecab942a1..3749415e8 100644 --- a/sdkconfig.old +++ b/sdkconfig.old @@ -700,7 +700,7 @@ CONFIG_HTTPD_WS_SUPPORT=y # # ESP HTTPS OTA # -# CONFIG_OTA_ALLOW_HTTP is not set +CONFIG_OTA_ALLOW_HTTP=y # end of ESP HTTPS OTA # @@ -904,8 +904,19 @@ CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM=7 # Core dump # # CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH is not set -# CONFIG_ESP_COREDUMP_ENABLE_TO_UART is not set -CONFIG_ESP_COREDUMP_ENABLE_TO_NONE=y +CONFIG_ESP_COREDUMP_ENABLE_TO_UART=y +# CONFIG_ESP_COREDUMP_ENABLE_TO_NONE is not set +# CONFIG_ESP_COREDUMP_DATA_FORMAT_BIN is not set +CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF=y +CONFIG_ESP_COREDUMP_CHECKSUM_CRC32=y +CONFIG_ESP_COREDUMP_ENABLE=y +CONFIG_ESP_COREDUMP_LOGS=y +CONFIG_ESP_COREDUMP_MAX_TASKS_NUM=64 +CONFIG_ESP_COREDUMP_UART_DELAY=0 +CONFIG_ESP_COREDUMP_STACK_SIZE=0 +CONFIG_ESP_COREDUMP_DECODE_INFO=y +# CONFIG_ESP_COREDUMP_DECODE_DISABLE is not set +CONFIG_ESP_COREDUMP_DECODE="info" # end of Core dump # @@ -948,21 +959,18 @@ CONFIG_FATFS_PER_FILE_CACHE=y # # CONFIG_FMB_COMM_MODE_TCP_EN is not set CONFIG_FMB_COMM_MODE_RTU_EN=y -CONFIG_FMB_COMM_MODE_ASCII_EN=y +# CONFIG_FMB_COMM_MODE_ASCII_EN is not set CONFIG_FMB_MASTER_TIMEOUT_MS_RESPOND=150 CONFIG_FMB_MASTER_DELAY_MS_CONVERT=200 CONFIG_FMB_QUEUE_LENGTH=20 CONFIG_FMB_PORT_TASK_STACK_SIZE=4096 CONFIG_FMB_SERIAL_BUF_SIZE=256 -CONFIG_FMB_SERIAL_ASCII_BITS_PER_SYMB=8 -CONFIG_FMB_SERIAL_ASCII_TIMEOUT_RESPOND_MS=1000 CONFIG_FMB_PORT_TASK_PRIO=10 # CONFIG_FMB_PORT_TASK_AFFINITY_NO_AFFINITY is not set CONFIG_FMB_PORT_TASK_AFFINITY_CPU0=y # CONFIG_FMB_PORT_TASK_AFFINITY_CPU1 is not set CONFIG_FMB_PORT_TASK_AFFINITY=0x0 -CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT=y -CONFIG_FMB_CONTROLLER_SLAVE_ID=0x00112233 +# CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT is not set CONFIG_FMB_CONTROLLER_NOTIFY_TIMEOUT=20 CONFIG_FMB_CONTROLLER_NOTIFY_QUEUE_SIZE=20 CONFIG_FMB_CONTROLLER_STACK_SIZE=4096 @@ -992,8 +1000,8 @@ CONFIG_FREERTOS_ASSERT_FAIL_ABORT=y # CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE is not set # CONFIG_FREERTOS_ASSERT_DISABLE is not set CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536 -CONFIG_FREERTOS_ISR_STACKSIZE=1536 -CONFIG_FREERTOS_LEGACY_HOOKS=y +CONFIG_FREERTOS_ISR_STACKSIZE=2096 +# CONFIG_FREERTOS_LEGACY_HOOKS is not set CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16 CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y # CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP is not set @@ -1177,8 +1185,8 @@ CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS=5 # ICMP # CONFIG_LWIP_ICMP=y -# CONFIG_LWIP_MULTICAST_PING is not set -# CONFIG_LWIP_BROADCAST_PING is not set +CONFIG_LWIP_MULTICAST_PING=y +CONFIG_LWIP_BROADCAST_PING=y # end of ICMP # @@ -1190,7 +1198,7 @@ CONFIG_LWIP_MAX_RAW_PCBS=16 # # SNTP # -CONFIG_LWIP_SNTP_MAX_SERVERS=1 +CONFIG_LWIP_SNTP_MAX_SERVERS=3 # CONFIG_LWIP_DHCP_GET_NTP_SRV is not set CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 # end of SNTP @@ -1287,7 +1295,7 @@ CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y # end of TLS Key Exchange Methods CONFIG_MBEDTLS_SSL_RENEGOTIATION=y -# CONFIG_MBEDTLS_SSL_PROTO_SSL3 is not set +CONFIG_MBEDTLS_SSL_PROTO_SSL3=y CONFIG_MBEDTLS_SSL_PROTO_TLS1=y CONFIG_MBEDTLS_SSL_PROTO_TLS1_1=y CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y @@ -1371,10 +1379,9 @@ CONFIG_MDNS_MULTIPLE_INSTANCE=y # # ESP-MQTT Configurations # -CONFIG_MQTT_PROTOCOL_311=y -CONFIG_MQTT_TRANSPORT_SSL=y -CONFIG_MQTT_TRANSPORT_WEBSOCKET=y -CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y +# CONFIG_MQTT_PROTOCOL_311 is not set +# CONFIG_MQTT_TRANSPORT_SSL is not set +# CONFIG_MQTT_TRANSPORT_WEBSOCKET is not set # CONFIG_MQTT_MSG_ID_INCREMENTAL is not set # CONFIG_MQTT_SKIP_PUBLISH_IF_DISCONNECTED is not set # CONFIG_MQTT_REPORT_DELETED_MESSAGES is not set @@ -1880,16 +1887,25 @@ CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y CONFIG_TIMER_TASK_STACK_SIZE=3584 CONFIG_SW_COEXIST_ENABLE=y # CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set -# CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set -CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y +CONFIG_ESP32_ENABLE_COREDUMP_TO_UART=y +# CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE is not set +# CONFIG_ESP32_COREDUMP_DATA_FORMAT_BIN is not set +CONFIG_ESP32_COREDUMP_DATA_FORMAT_ELF=y +CONFIG_ESP32_COREDUMP_CHECKSUM_CRC32=y +CONFIG_ESP32_ENABLE_COREDUMP=y +CONFIG_ESP32_CORE_DUMP_MAX_TASKS_NUM=64 +CONFIG_ESP32_CORE_DUMP_UART_DELAY=0 +CONFIG_ESP32_CORE_DUMP_STACK_SIZE=0 +CONFIG_ESP32_CORE_DUMP_DECODE_INFO=y +# CONFIG_ESP32_CORE_DUMP_DECODE_DISABLE is not set +CONFIG_ESP32_CORE_DUMP_DECODE="info" CONFIG_MB_MASTER_TIMEOUT_MS_RESPOND=150 CONFIG_MB_MASTER_DELAY_MS_CONVERT=200 CONFIG_MB_QUEUE_LENGTH=20 CONFIG_MB_SERIAL_TASK_STACK_SIZE=4096 CONFIG_MB_SERIAL_BUF_SIZE=256 CONFIG_MB_SERIAL_TASK_PRIO=10 -CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT=y -CONFIG_MB_CONTROLLER_SLAVE_ID=0x00112233 +# CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT is not set CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT=20 CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE=20 CONFIG_MB_CONTROLLER_STACK_SIZE=4096 From d1acc02836034c905baca6884ac71fb10c6aae1a Mon Sep 17 00:00:00 2001 From: ezlo-rikenm Date: Wed, 21 Feb 2024 16:01:53 +0545 Subject: [PATCH 07/27] added necessary 'item->user_arg' and valueFormatted malloc guards. EZPI-311. https://jira.mios.com/issues/?filter=-1 --- .../device_0001_digitalOut_generic.c | 179 +++--- .../device_0002_digitalOut_relay.c | 188 +++--- .../device_0003_digitalOut_plug.c | 180 +++--- .../device_0004_digitalIn_generic.c | 36 +- .../CMakeLists.txt | 4 +- .../device_0009_other_RMT_SK6812.c | 147 +++-- .../device_0022_PWM_dimmable_lamp.c | 85 ++- .../device_0036_PWM_servo_MG996R.c | 106 ++-- .../device_0038_other_RGB.c | 274 ++++---- .../sensor-0005-I2C-MPU6050/mpu6050.c | 67 +- .../sensor_0005_I2C_MPU6050.c | 295 +++++---- .../sensor_0006_I2C_ADXL345.c | 135 ++-- .../sensor_0007_I2C_GY271.c | 311 ++++----- .../sensor_0008_I2C_LTR303ALS.c | 71 ++- .../sensor_0010_I2C_BME680.c | 218 ++++--- .../sensor_0012_I2C_BME280.c | 131 ++-- .../sensor_0015_oneWire_DHT11.c | 49 +- .../sensor_0016_oneWire_DHT22.c | 42 +- .../sensor_0017_ADC_potentiometer.c | 69 +- .../sensor_0018_other_internal_hall_effect.c | 186 +++--- .../sensor_0019_digitalIn_PIR.c | 16 +- .../sensor_0020_other_2axis_joystick.c | 236 ++++--- .../sensor_0021_UART_MB1013.c | 69 +- ...nsor_0023_digitalIn_touch_switch_TTP223B.c | 36 +- .../sensor_0024_other_HCSR04.c | 115 ++-- .../sensor_0025_digitalIn_LDR.c | 18 +- .../sensor-0026-ADC-LDR/sensor_0026_ADC_LDR.c | 26 +- .../sensor_0027_ADC_waterLeak.c | 15 +- .../sensor_0028_other_GY61.c | 117 ++-- .../sensor_0029_I2C_GXHTC3.c | 32 +- .../sensor_0030_oneWire_DS18B20.c | 91 ++- .../sensor_0031_other_JSNSR04T.c | 15 +- .../sensor_0032_ADC_soilMoisture.c | 32 +- .../sensor_0033_ADC_turbidity.c | 72 +-- .../sensor_0034_digitalIn_proximity.c | 48 +- ...nsor_0035_digitalIn_touch_sensor_TPP223B.c | 26 +- .../sensor-0037-pms5003-sensor/CMakeLists.txt | 1 + .../sensor_0037_pms5003_sensor.c | 115 ++-- .../sensor_0040_other_TCS230.c | 136 ++-- .../sensor_0041_ADC_FC28_soilMoisture.c | 71 ++- .../sensor_0042_ADC_shunt_voltmeter.c | 75 ++- .../sensor_0043_ADC_GYML8511_UV_intensity.c | 69 +- .../sensor_0044_I2C_TSL256_luminosity.c | 60 +- .../sensor_0046_ADC_ACS712_05B_currentmeter.c | 143 +++-- .../sensor_0047_other_HX711_loadcell.c | 272 ++++---- .../sensor_0048_other_MQ4_CH4_detector.c | 281 +++++---- .../sensor_0049_other_MQ2_LPG_detector.c | 251 ++++---- .../sensor_0050_other_MQ3_alcohol_detector.c | 386 ++++++----- .../sensor_0051_other_MQ8_H2_detector.c | 285 +++++---- .../sensor_0052_other_MQ135_NH3_detector.c | 291 +++++---- .../sensor_0053_UART_GYGPS6MV2.c | 385 ++++++----- .../sensor_0054_PWM_YFS201_flowmeter.c | 209 +++--- .../sensor_0055_ADC_FlexResistor.c | 78 ++- .../sensor_0055_ADC_FlexResistor.h | 2 +- ...sensor_0056_ADC_Force_Sensitive_Resistor.c | 90 ++- ...sensor_0056_ADC_Force_Sensitive_Resistor.h | 2 +- .../sensor_0057_other_KY026_FlameDetector.c | 140 ++-- .../sensor_0057_other_KY026_FlameDetector.h | 2 +- .../sensor_0059_other_MQ6_LPG_detector.c | 284 +++++---- ...sensor_0060_digitalIn_vibration_detector.c | 13 +- .../sensor_0061_digitalIn_reed_switch.c | 21 +- .../sensor_0062_other_MQ7_CO_detector.c | 372 ++++++----- ...or_0063_other_MQ9_LPG_flameable_detector.c | 282 +++++---- .../sensor_0065_digitalIn_float_switch.c | 9 +- .../sensor_0066_other_R307_FingerPrint.c | 597 +++++++++--------- .../sensor_0067_hilink_presence_sensor.c | 59 +- .../ezlopi-util-trace/ezlopi_util_trace.h | 8 +- sdkconfig | 3 + 68 files changed, 4865 insertions(+), 3864 deletions(-) diff --git a/ezlopi-sensors-devices/device-0001-digitalOut-generic/device_0001_digitalOut_generic.c b/ezlopi-sensors-devices/device-0001-digitalOut-generic/device_0001_digitalOut_generic.c index 1bc25901f..d03f815fc 100644 --- a/ezlopi-sensors-devices/device-0001-digitalOut-generic/device_0001_digitalOut_generic.c +++ b/ezlopi-sensors-devices/device-0001-digitalOut-generic/device_0001_digitalOut_generic.c @@ -371,34 +371,37 @@ static int __init(l_ezlopi_item_t *item) int ret = 0; if (item) { - if (255 != item->interface.gpio.gpio_out.gpio_num) + if (GPIO_IS_VALID_OUTPUT_GPIO(item->interface.gpio.gpio_out.gpio_num) && + (255 != item->interface.gpio.gpio_out.gpio_num)) { - if (GPIO_IS_VALID_OUTPUT_GPIO(item->interface.gpio.gpio_out.gpio_num)) + const gpio_config_t io_conf = { + .pin_bit_mask = (1ULL << item->interface.gpio.gpio_out.gpio_num), + .mode = GPIO_MODE_OUTPUT, + .pull_up_en = ((item->interface.gpio.gpio_out.pull == GPIO_PULLUP_ONLY) || + (item->interface.gpio.gpio_out.pull == GPIO_PULLUP_PULLDOWN)) + ? GPIO_PULLUP_ENABLE + : GPIO_PULLUP_DISABLE, + .pull_down_en = ((item->interface.gpio.gpio_out.pull == GPIO_PULLDOWN_ONLY) || + (item->interface.gpio.gpio_out.pull == GPIO_PULLUP_PULLDOWN)) + ? GPIO_PULLDOWN_ENABLE + : GPIO_PULLDOWN_DISABLE, + .intr_type = GPIO_INTR_DISABLE, + }; + + if (0 == gpio_config(&io_conf)) { - const gpio_config_t io_conf = { - .pin_bit_mask = (1ULL << item->interface.gpio.gpio_out.gpio_num), - .mode = GPIO_MODE_OUTPUT, - .pull_up_en = ((item->interface.gpio.gpio_out.pull == GPIO_PULLUP_ONLY) || - (item->interface.gpio.gpio_out.pull == GPIO_PULLUP_PULLDOWN)) - ? GPIO_PULLUP_ENABLE - : GPIO_PULLUP_DISABLE, - .pull_down_en = ((item->interface.gpio.gpio_out.pull == GPIO_PULLDOWN_ONLY) || - (item->interface.gpio.gpio_out.pull == GPIO_PULLUP_PULLDOWN)) - ? GPIO_PULLDOWN_ENABLE - : GPIO_PULLDOWN_DISABLE, - .intr_type = GPIO_INTR_DISABLE, - }; - - gpio_config(&io_conf); // digital_io_write_gpio_value(item); __write_gpio_value(item); ret = 1; } + else + { + ret = -1; + } } - - if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num) && - (-1 != item->interface.gpio.gpio_in.gpio_num) && - (255 != item->interface.gpio.gpio_in.gpio_num)) + else if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num) && + (-1 != item->interface.gpio.gpio_in.gpio_num) && + (255 != item->interface.gpio.gpio_in.gpio_num)) { const gpio_config_t io_conf = { .pin_bit_mask = (1ULL << item->interface.gpio.gpio_in.gpio_num), @@ -416,18 +419,20 @@ static int __init(l_ezlopi_item_t *item) : GPIO_INTR_NEGEDGE, }; - gpio_config(&io_conf); - gpio_isr_service_register_v3(item, __interrupt_upcall, 1000); - ret = 1; + if (0 == gpio_config(&io_conf)) + { + gpio_isr_service_register_v3(item, __interrupt_upcall, 1000); + ret = 1; + } + else + { + ret = -1; + } } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } @@ -437,14 +442,16 @@ static int __init(l_ezlopi_item_t *item) static int __get_value_cjson(l_ezlopi_item_t *item, void *arg) { int ret = 0; - cJSON *cjson_propertise = (cJSON *)arg; - if (cjson_propertise) + if (item && arg) { - cJSON_AddBoolToObject(cjson_propertise, ezlopi_value_str, item->interface.gpio.gpio_out.value); - cJSON_AddStringToObject(cjson_propertise, ezlopi_valueFormatted_str, ezlopi_valueformatter_bool(item->interface.gpio.gpio_out.value ? true : false)); - ret = 1; + cJSON *cjson_propertise = (cJSON *)arg; + if (cjson_propertise) + { + cJSON_AddBoolToObject(cjson_propertise, ezlopi_value_str, item->interface.gpio.gpio_out.value); + cJSON_AddStringToObject(cjson_propertise, ezlopi_valueFormatted_str, ezlopi_valueformatter_bool(item->interface.gpio.gpio_out.value ? true : false)); + ret = 1; + } } - return ret; } @@ -457,72 +464,74 @@ static void __set_gpio_value(l_ezlopi_item_t *item, int value) static int __set_value(l_ezlopi_item_t *item, void *arg) { int ret = 0; - cJSON *cjson_params = (cJSON *)arg; - - if (NULL != cjson_params) + if (item && arg) { - CJSON_TRACE("cjson_params", cjson_params); + cJSON *cjson_params = (cJSON *)arg; - int value = 0; - cJSON *cj_value = cJSON_GetObjectItem(cjson_params, ezlopi_value_str); - if (cj_value) + if (NULL != cjson_params) { - switch (cj_value->type) + CJSON_TRACE("cjson_params", cjson_params); + + int value = 0; + cJSON *cj_value = cJSON_GetObjectItem(cjson_params, ezlopi_value_str); + if (cj_value) { - case cJSON_False: - value = 0; - break; - case cJSON_True: - value = 1; - break; - case cJSON_Number: - value = cj_value->valueint; - break; - - default: - break; + switch (cj_value->type) + { + case cJSON_False: + value = 0; + break; + case cJSON_True: + value = 1; + break; + case cJSON_Number: + value = cj_value->valueint; + break; + + default: + break; + } } - } - TRACE_S("item_name: %s", item->cloud_properties.item_name); - TRACE_S("gpio_num: %d", item->interface.gpio.gpio_out.gpio_num); - TRACE_S("item_id: 0x%08x", item->cloud_properties.item_id); - TRACE_S("prev value: %d", item->interface.gpio.gpio_out.value); - TRACE_S("cur value: %d", value); + TRACE_I("item_name: %s", item->cloud_properties.item_name); + TRACE_I("gpio_num: %d", item->interface.gpio.gpio_out.gpio_num); + TRACE_I("item_id: 0x%08x", item->cloud_properties.item_id); + TRACE_I("prev value: %d", item->interface.gpio.gpio_out.value); + TRACE_I("cur value: %d", value); - if (255 != item->interface.gpio.gpio_out.gpio_num) - { - if (GPIO_IS_VALID_OUTPUT_GPIO(item->interface.gpio.gpio_out.gpio_num)) + if (255 != item->interface.gpio.gpio_out.gpio_num) { - __set_gpio_value(item, value); - ezlopi_device_value_updated_from_device_v3(item); + if (GPIO_IS_VALID_OUTPUT_GPIO(item->interface.gpio.gpio_out.gpio_num)) + { + __set_gpio_value(item, value); + ezlopi_device_value_updated_from_device_v3(item); + } } - } - else - { - l_ezlopi_device_t *curr_device = ezlopi_device_get_head(); - while (curr_device) + else { - l_ezlopi_item_t *curr_item = curr_device->items; - while (curr_item) + l_ezlopi_device_t *curr_device = ezlopi_device_get_head(); + while (curr_device) { - if ((EZLOPI_DEVICE_INTERFACE_DIGITAL_OUTPUT == curr_item->interface_type) && (255 != curr_item->interface.gpio.gpio_out.gpio_num)) + l_ezlopi_item_t *curr_item = curr_device->items; + while (curr_item) { - TRACE_D("GPIO-pin: %d", curr_item->interface.gpio.gpio_out.gpio_num); - TRACE_D("value: %d", value); - __set_gpio_value(curr_item, value); - ezlopi_device_value_updated_from_device_v3(curr_item); + if ((EZLOPI_DEVICE_INTERFACE_DIGITAL_OUTPUT == curr_item->interface_type) && (255 != curr_item->interface.gpio.gpio_out.gpio_num)) + { + TRACE_D("GPIO-pin: %d", curr_item->interface.gpio.gpio_out.gpio_num); + TRACE_D("value: %d", value); + __set_gpio_value(curr_item, value); + ezlopi_device_value_updated_from_device_v3(curr_item); + } + curr_item = curr_item->next; } - curr_item = curr_item->next; + curr_device = curr_device->next; } - curr_device = curr_device->next; - } - item->interface.gpio.gpio_out.value = value; - ezlopi_device_value_updated_from_device_v3(item); + item->interface.gpio.gpio_out.value = value; + ezlopi_device_value_updated_from_device_v3(item); + } } } - return ret; } diff --git a/ezlopi-sensors-devices/device-0002-digitalOut-relay/device_0002_digitalOut_relay.c b/ezlopi-sensors-devices/device-0002-digitalOut-relay/device_0002_digitalOut_relay.c index a8bacd456..a5f9a1fc0 100644 --- a/ezlopi-sensors-devices/device-0002-digitalOut-relay/device_0002_digitalOut_relay.c +++ b/ezlopi-sensors-devices/device-0002-digitalOut-relay/device_0002_digitalOut_relay.c @@ -144,34 +144,37 @@ static int __init(l_ezlopi_item_t *item) int ret = 0; if (item) { - if (255 != item->interface.gpio.gpio_out.gpio_num) + if (GPIO_IS_VALID_OUTPUT_GPIO(item->interface.gpio.gpio_out.gpio_num) && + (255 != item->interface.gpio.gpio_out.gpio_num)) { - if (GPIO_IS_VALID_OUTPUT_GPIO(item->interface.gpio.gpio_out.gpio_num)) + const gpio_config_t io_conf = { + .pin_bit_mask = (1ULL << item->interface.gpio.gpio_out.gpio_num), + .mode = GPIO_MODE_OUTPUT, + .pull_up_en = ((item->interface.gpio.gpio_out.pull == GPIO_PULLUP_ONLY) || + (item->interface.gpio.gpio_out.pull == GPIO_PULLUP_PULLDOWN)) + ? GPIO_PULLUP_ENABLE + : GPIO_PULLUP_DISABLE, + .pull_down_en = ((item->interface.gpio.gpio_out.pull == GPIO_PULLDOWN_ONLY) || + (item->interface.gpio.gpio_out.pull == GPIO_PULLUP_PULLDOWN)) + ? GPIO_PULLDOWN_ENABLE + : GPIO_PULLDOWN_DISABLE, + .intr_type = GPIO_INTR_DISABLE, + }; + + if (0 == gpio_config(&io_conf)) { - const gpio_config_t io_conf = { - .pin_bit_mask = (1ULL << item->interface.gpio.gpio_out.gpio_num), - .mode = GPIO_MODE_OUTPUT, - .pull_up_en = ((item->interface.gpio.gpio_out.pull == GPIO_PULLUP_ONLY) || - (item->interface.gpio.gpio_out.pull == GPIO_PULLUP_PULLDOWN)) - ? GPIO_PULLUP_ENABLE - : GPIO_PULLUP_DISABLE, - .pull_down_en = ((item->interface.gpio.gpio_out.pull == GPIO_PULLDOWN_ONLY) || - (item->interface.gpio.gpio_out.pull == GPIO_PULLUP_PULLDOWN)) - ? GPIO_PULLDOWN_ENABLE - : GPIO_PULLDOWN_DISABLE, - .intr_type = GPIO_INTR_DISABLE, - }; - - gpio_config(&io_conf); // digital_io_write_gpio_value(item); __write_gpio_value(item); ret = 1; } + else + { + ret = -1; + } } - - if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num) && - (-1 != item->interface.gpio.gpio_in.gpio_num) && - (255 != item->interface.gpio.gpio_in.gpio_num)) + else if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num) && + (-1 != item->interface.gpio.gpio_in.gpio_num) && + (255 != item->interface.gpio.gpio_in.gpio_num)) { const gpio_config_t io_conf = { .pin_bit_mask = (1ULL << item->interface.gpio.gpio_in.gpio_num), @@ -188,19 +191,20 @@ static int __init(l_ezlopi_item_t *item) ? GPIO_INTR_POSEDGE : GPIO_INTR_NEGEDGE, }; - - gpio_config(&io_conf); - gpio_isr_service_register_v3(item, __interrupt_upcall, 1000); - ret = 1; + if (0 == gpio_config(&io_conf)) + { + gpio_isr_service_register_v3(item, __interrupt_upcall, 1000); + ret = 1; + } + else + { + ret = -1; + } } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } @@ -210,14 +214,16 @@ static int __init(l_ezlopi_item_t *item) static int __get_value_cjson(l_ezlopi_item_t *item, void *arg) { int ret = 0; - cJSON *cjson_propertise = (cJSON *)arg; - if (cjson_propertise) + if (item && arg) { - cJSON_AddBoolToObject(cjson_propertise, ezlopi_value_str, item->interface.gpio.gpio_out.value); - cJSON_AddStringToObject(cjson_propertise, ezlopi_valueFormatted_str, ezlopi_valueformatter_bool(item->interface.gpio.gpio_out.value ? true : false)); - ret = 1; + cJSON *cjson_propertise = (cJSON *)arg; + if (cjson_propertise) + { + cJSON_AddBoolToObject(cjson_propertise, ezlopi_value_str, item->interface.gpio.gpio_out.value); + cJSON_AddStringToObject(cjson_propertise, ezlopi_valueFormatted_str, ezlopi_valueformatter_bool(item->interface.gpio.gpio_out.value ? true : false)); + ret = 1; + } } - return ret; } @@ -230,79 +236,75 @@ static void __set_gpio_value(l_ezlopi_item_t *item, int value) static int __set_value(l_ezlopi_item_t *item, void *arg) { int ret = 0; - cJSON *cjson_params = (cJSON *)arg; - - if (NULL != cjson_params) + if (item && arg) { - CJSON_TRACE("cjson_params", cjson_params); + cJSON *cjson_params = (cJSON *)arg; - int value = 0; - cJSON *cj_value = cJSON_GetObjectItem(cjson_params, ezlopi_value_str); - if (cj_value) + if (NULL != cjson_params) { - switch (cj_value->type) - { - case cJSON_False: - { - value = 0; - break; - } - case cJSON_True: - { - value = 1; - break; - } - case cJSON_Number: - { - value = cj_value->valueint; - break; - } + CJSON_TRACE("cjson_params", cjson_params); - default: - break; + int value = 0; + cJSON *cj_value = cJSON_GetObjectItem(cjson_params, ezlopi_value_str); + if (cj_value) + { + switch (cj_value->type) + { + case cJSON_False: + value = 0; + break; + case cJSON_True: + value = 1; + break; + case cJSON_Number: + value = cj_value->valueint; + break; + + default: + break; + } } - } - TRACE_S("item_name: %s", item->cloud_properties.item_name); - TRACE_S("gpio_num: %d", item->interface.gpio.gpio_out.gpio_num); - TRACE_S("item_id: %08x", item->cloud_properties.item_id); - TRACE_S("prev value: %d", item->interface.gpio.gpio_out.value); - TRACE_S("cur value: %d", value); + TRACE_S("item_name: %s", item->cloud_properties.item_name); + TRACE_S("gpio_num: %d", item->interface.gpio.gpio_out.gpio_num); + TRACE_S("item_id: 0x%08x", item->cloud_properties.item_id); + TRACE_S("prev value: %d", item->interface.gpio.gpio_out.value); + TRACE_S("cur value: %d", value); - if (255 != item->interface.gpio.gpio_out.gpio_num) - { - if (GPIO_IS_VALID_OUTPUT_GPIO(item->interface.gpio.gpio_out.gpio_num)) + if (255 != item->interface.gpio.gpio_out.gpio_num) { - __set_gpio_value(item, value); - ezlopi_device_value_updated_from_device_v3(item); + if (GPIO_IS_VALID_OUTPUT_GPIO(item->interface.gpio.gpio_out.gpio_num)) + { + __set_gpio_value(item, value); + ezlopi_device_value_updated_from_device_v3(item); + } } - } - else - { - // in case of master switch - l_ezlopi_device_t *curr_device = ezlopi_device_get_head(); - while (curr_device) + else { - l_ezlopi_item_t *curr_item = curr_device->items; - while (curr_item) + // in case of master switch + l_ezlopi_device_t *curr_device = ezlopi_device_get_head(); + while (curr_device) { - if ((EZLOPI_DEVICE_INTERFACE_DIGITAL_OUTPUT == curr_item->interface_type) && (255 != curr_item->interface.gpio.gpio_out.gpio_num)) + l_ezlopi_item_t *curr_item = curr_device->items; + while (curr_item) { - TRACE_D("GPIO-pin: %d", curr_item->interface.gpio.gpio_out.gpio_num); - TRACE_D("value: %d", value); - __set_gpio_value(curr_item, value); - ezlopi_device_value_updated_from_device_v3(curr_item); + if ((EZLOPI_DEVICE_INTERFACE_DIGITAL_OUTPUT == curr_item->interface_type) && (255 != curr_item->interface.gpio.gpio_out.gpio_num)) + { + TRACE_D("GPIO-pin: %d", curr_item->interface.gpio.gpio_out.gpio_num); + TRACE_D("value: %d", value); + __set_gpio_value(curr_item, value); + ezlopi_device_value_updated_from_device_v3(curr_item); + } + curr_item = curr_item->next; } - curr_item = curr_item->next; + curr_device = curr_device->next; } - curr_device = curr_device->next; - } - item->interface.gpio.gpio_out.value = value; - ezlopi_device_value_updated_from_device_v3(item); + item->interface.gpio.gpio_out.value = value; + ezlopi_device_value_updated_from_device_v3(item); + } } } - return ret; } diff --git a/ezlopi-sensors-devices/device-0003-digitalOut-plug/device_0003_digitalOut_plug.c b/ezlopi-sensors-devices/device-0003-digitalOut-plug/device_0003_digitalOut_plug.c index 6fada8c98..f12816d9b 100644 --- a/ezlopi-sensors-devices/device-0003-digitalOut-plug/device_0003_digitalOut_plug.c +++ b/ezlopi-sensors-devices/device-0003-digitalOut-plug/device_0003_digitalOut_plug.c @@ -145,34 +145,38 @@ static int __init(l_ezlopi_item_t *item) int ret = 0; if (item) { - if (255 != item->interface.gpio.gpio_out.gpio_num) + + if (GPIO_IS_VALID_OUTPUT_GPIO(item->interface.gpio.gpio_out.gpio_num) && + (255 != item->interface.gpio.gpio_out.gpio_num)) { - if (GPIO_IS_VALID_OUTPUT_GPIO(item->interface.gpio.gpio_out.gpio_num)) + const gpio_config_t io_conf = { + .pin_bit_mask = (1ULL << item->interface.gpio.gpio_out.gpio_num), + .mode = GPIO_MODE_OUTPUT, + .pull_up_en = ((item->interface.gpio.gpio_out.pull == GPIO_PULLUP_ONLY) || + (item->interface.gpio.gpio_out.pull == GPIO_PULLUP_PULLDOWN)) + ? GPIO_PULLUP_ENABLE + : GPIO_PULLUP_DISABLE, + .pull_down_en = ((item->interface.gpio.gpio_out.pull == GPIO_PULLDOWN_ONLY) || + (item->interface.gpio.gpio_out.pull == GPIO_PULLUP_PULLDOWN)) + ? GPIO_PULLDOWN_ENABLE + : GPIO_PULLDOWN_DISABLE, + .intr_type = GPIO_INTR_DISABLE, + }; + + if (0 == gpio_config(&io_conf)) { - const gpio_config_t io_conf = { - .pin_bit_mask = (1ULL << item->interface.gpio.gpio_out.gpio_num), - .mode = GPIO_MODE_OUTPUT, - .pull_up_en = ((item->interface.gpio.gpio_out.pull == GPIO_PULLUP_ONLY) || - (item->interface.gpio.gpio_out.pull == GPIO_PULLUP_PULLDOWN)) - ? GPIO_PULLUP_ENABLE - : GPIO_PULLUP_DISABLE, - .pull_down_en = ((item->interface.gpio.gpio_out.pull == GPIO_PULLDOWN_ONLY) || - (item->interface.gpio.gpio_out.pull == GPIO_PULLUP_PULLDOWN)) - ? GPIO_PULLDOWN_ENABLE - : GPIO_PULLDOWN_DISABLE, - .intr_type = GPIO_INTR_DISABLE, - }; - - gpio_config(&io_conf); // digital_io_write_gpio_value(item); __write_gpio_value(item); ret = 1; } + else + { + ret = -1; + } } - - if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num) && - (-1 != item->interface.gpio.gpio_in.gpio_num) && - (255 != item->interface.gpio.gpio_in.gpio_num)) + else if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num) && + (-1 != item->interface.gpio.gpio_in.gpio_num) && + (255 != item->interface.gpio.gpio_in.gpio_num)) { const gpio_config_t io_conf = { .pin_bit_mask = (1ULL << item->interface.gpio.gpio_in.gpio_num), @@ -190,18 +194,20 @@ static int __init(l_ezlopi_item_t *item) : GPIO_INTR_NEGEDGE, }; - gpio_config(&io_conf); - gpio_isr_service_register_v3(item, __interrupt_upcall, 1000); - ret = 1; + if (0 == gpio_config(&io_conf)) + { + gpio_isr_service_register_v3(item, __interrupt_upcall, 1000); + ret = 1; + } + else + { + ret = -1; + } } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } @@ -211,14 +217,16 @@ static int __init(l_ezlopi_item_t *item) static int __get_value_cjson(l_ezlopi_item_t *item, void *arg) { int ret = 0; - cJSON *cjson_propertise = (cJSON *)arg; - if (cjson_propertise) + if (item && arg) { - cJSON_AddBoolToObject(cjson_propertise, ezlopi_value_str, item->interface.gpio.gpio_out.value); - cJSON_AddStringToObject(cjson_propertise, ezlopi_valueFormatted_str, ezlopi_valueformatter_bool(item->interface.gpio.gpio_out.value ? true : false)); - ret = 1; + cJSON *cjson_propertise = (cJSON *)arg; + if (cjson_propertise) + { + cJSON_AddBoolToObject(cjson_propertise, ezlopi_value_str, item->interface.gpio.gpio_out.value); + cJSON_AddStringToObject(cjson_propertise, ezlopi_valueFormatted_str, ezlopi_valueformatter_bool(item->interface.gpio.gpio_out.value ? true : false)); + ret = 1; + } } - return ret; } @@ -231,72 +239,74 @@ static void __set_gpio_value(l_ezlopi_item_t *item, int value) static int __set_value(l_ezlopi_item_t *item, void *arg) { int ret = 0; - cJSON *cjson_params = (cJSON *)arg; - - if (NULL != cjson_params) + if (item && arg) { - CJSON_TRACE("cjson_params", cjson_params); + cJSON *cjson_params = (cJSON *)arg; - int value = 0; - cJSON *cj_value = cJSON_GetObjectItem(cjson_params, ezlopi_value_str); - if (cj_value) + if (NULL != cjson_params) { - switch (cj_value->type) + CJSON_TRACE("cjson_params", cjson_params); + + int value = 0; + cJSON *cj_value = cJSON_GetObjectItem(cjson_params, ezlopi_value_str); + if (cj_value) { - case cJSON_False: - value = 0; - break; - case cJSON_True: - value = 1; - break; - case cJSON_Number: - value = cj_value->valueint; - break; - - default: - break; + switch (cj_value->type) + { + case cJSON_False: + value = 0; + break; + case cJSON_True: + value = 1; + break; + case cJSON_Number: + value = cj_value->valueint; + break; + + default: + break; + } } - } - TRACE_S("item_name: %s", item->cloud_properties.item_name); - TRACE_S("gpio_num: %d", item->interface.gpio.gpio_out.gpio_num); - TRACE_S("item_id: 0x%08x", item->cloud_properties.item_id); - TRACE_S("prev value: %d", item->interface.gpio.gpio_out.value); - TRACE_S("cur value: %d", value); + TRACE_S("item_name: %s", item->cloud_properties.item_name); + TRACE_S("gpio_num: %d", item->interface.gpio.gpio_out.gpio_num); + TRACE_S("item_id: 0x%08x", item->cloud_properties.item_id); + TRACE_S("prev value: %d", item->interface.gpio.gpio_out.value); + TRACE_S("cur value: %d", value); - if (255 != item->interface.gpio.gpio_out.gpio_num) - { - if (GPIO_IS_VALID_OUTPUT_GPIO(item->interface.gpio.gpio_out.gpio_num)) + if (255 != item->interface.gpio.gpio_out.gpio_num) { - __set_gpio_value(item, value); - ezlopi_device_value_updated_from_device_v3(item); + if (GPIO_IS_VALID_OUTPUT_GPIO(item->interface.gpio.gpio_out.gpio_num)) + { + __set_gpio_value(item, value); + ezlopi_device_value_updated_from_device_v3(item); + } } - } - else - { - l_ezlopi_device_t *curr_device = ezlopi_device_get_head(); - while (curr_device) + else { - l_ezlopi_item_t *curr_item = curr_device->items; - while (curr_item) + l_ezlopi_device_t *curr_device = ezlopi_device_get_head(); + while (curr_device) { - if ((EZLOPI_DEVICE_INTERFACE_DIGITAL_OUTPUT == curr_item->interface_type) && (255 != curr_item->interface.gpio.gpio_out.gpio_num)) + l_ezlopi_item_t *curr_item = curr_device->items; + while (curr_item) { - TRACE_D("GPIO-pin: %d", curr_item->interface.gpio.gpio_out.gpio_num); - TRACE_D("value: %d", value); - __set_gpio_value(curr_item, value); - ezlopi_device_value_updated_from_device_v3(curr_item); + if ((EZLOPI_DEVICE_INTERFACE_DIGITAL_OUTPUT == curr_item->interface_type) && (255 != curr_item->interface.gpio.gpio_out.gpio_num)) + { + TRACE_D("GPIO-pin: %d", curr_item->interface.gpio.gpio_out.gpio_num); + TRACE_D("value: %d", value); + __set_gpio_value(curr_item, value); + ezlopi_device_value_updated_from_device_v3(curr_item); + } + curr_item = curr_item->next; } - curr_item = curr_item->next; + curr_device = curr_device->next; } - curr_device = curr_device->next; - } - item->interface.gpio.gpio_out.value = value; - ezlopi_device_value_updated_from_device_v3(item); + item->interface.gpio.gpio_out.value = value; + ezlopi_device_value_updated_from_device_v3(item); + } } } - return ret; } diff --git a/ezlopi-sensors-devices/device-0004-digitalIn-generic/device_0004_digitalIn_generic.c b/ezlopi-sensors-devices/device-0004-digitalIn-generic/device_0004_digitalIn_generic.c index 7f5b2ad45..2dfdb1c03 100644 --- a/ezlopi-sensors-devices/device-0004-digitalIn-generic/device_0004_digitalIn_generic.c +++ b/ezlopi-sensors-devices/device-0004-digitalIn-generic/device_0004_digitalIn_generic.c @@ -94,9 +94,9 @@ static void __setup_item_properties(l_ezlopi_item_t *item, cJSON *cjson_device) static int __prepare(void *arg) { int ret = 0; - s_ezlopi_prep_arg_t *prep_arg = (s_ezlopi_prep_arg_t *)arg; if (arg) { + s_ezlopi_prep_arg_t *prep_arg = (s_ezlopi_prep_arg_t *)arg; cJSON *cjson_device = prep_arg->cjson_device; if (cjson_device) { @@ -148,19 +148,20 @@ static int __init(l_ezlopi_item_t *item) : GPIO_INTR_NEGEDGE, }; - gpio_config(&io_conf); - gpio_isr_service_register_v3(item, __interrupt_upcall, 1000); - - ret = 1; + if (0 == gpio_config(&io_conf)) + { + gpio_isr_service_register_v3(item, __interrupt_upcall, 1000); + ret = 1; + } + else + { + ret = -1; + } } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } @@ -170,12 +171,15 @@ static int __init(l_ezlopi_item_t *item) static int __get_value_cjson(l_ezlopi_item_t *item, void *arg) { int ret = 0; - cJSON *cjson_propertise = (cJSON *)arg; - if (cjson_propertise) + if (item && arg) { - cJSON_AddBoolToObject(cjson_propertise, ezlopi_value_str, item->interface.gpio.gpio_in.value); - cJSON_AddStringToObject(cjson_propertise, ezlopi_valueFormatted_str, ezlopi_valueformatter_bool(item->interface.gpio.gpio_in.value ? true : false)); - ret = 1; + cJSON *cjson_propertise = (cJSON *)arg; + if (cjson_propertise) + { + cJSON_AddBoolToObject(cjson_propertise, ezlopi_value_str, item->interface.gpio.gpio_in.value); + cJSON_AddStringToObject(cjson_propertise, ezlopi_valueFormatted_str, ezlopi_valueformatter_bool(item->interface.gpio.gpio_in.value ? true : false)); + ret = 1; + } } return ret; diff --git a/ezlopi-sensors-devices/device-0009-other-RMT-SK6812/CMakeLists.txt b/ezlopi-sensors-devices/device-0009-other-RMT-SK6812/CMakeLists.txt index 6a1375f20..82fa3f79c 100644 --- a/ezlopi-sensors-devices/device-0009-other-RMT-SK6812/CMakeLists.txt +++ b/ezlopi-sensors-devices/device-0009-other-RMT-SK6812/CMakeLists.txt @@ -2,10 +2,12 @@ idf_component_register(SRCS "device_0009_other_RMT_SK6812.c" INCLUDE_DIRS "." - REQUIRES ezlopi-util-trace + REQUIRES driver led_strip + ezlopi-util-trace + ezlopi-core-timer ezlopi-core-cloud ezlopi-core-actions diff --git a/ezlopi-sensors-devices/device-0009-other-RMT-SK6812/device_0009_other_RMT_SK6812.c b/ezlopi-sensors-devices/device-0009-other-RMT-SK6812/device_0009_other_RMT_SK6812.c index 222a780ef..c2f806a78 100644 --- a/ezlopi-sensors-devices/device-0009-other-RMT-SK6812/device_0009_other_RMT_SK6812.c +++ b/ezlopi-sensors-devices/device-0009-other-RMT-SK6812/device_0009_other_RMT_SK6812.c @@ -76,49 +76,51 @@ int device_0009_other_RMT_SK6812(e_ezlopi_actions_t action, l_ezlopi_item_t *ite static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) { int ret = 0; - - led_strip_t *sk6812_strip = (led_strip_t *)item->user_arg; - cJSON *cjson_properties = (cJSON *)arg; - if ((NULL != cjson_properties) && (NULL != sk6812_strip)) + if (item && arg) { - if (ezlopi_item_name_rgbcolor == item->cloud_properties.item_name) + led_strip_t *sk6812_strip = (led_strip_t *)item->user_arg; + cJSON *cjson_properties = (cJSON *)arg; + if ((NULL != cjson_properties) && (NULL != sk6812_strip)) { - cJSON *color_json = cJSON_AddObjectToObject(cjson_properties, ezlopi_value_str); - if (color_json) + if (ezlopi_item_name_rgbcolor == item->cloud_properties.item_name) + { + cJSON *color_json = cJSON_AddObjectToObject(cjson_properties, ezlopi_value_str); + if (color_json) + { + int green = sk6812_strip->buf[0]; + int red = sk6812_strip->buf[1]; + int blue = sk6812_strip->buf[2]; + cJSON_AddNumberToObject(color_json, "red", red); + cJSON_AddNumberToObject(color_json, "green", green); + cJSON_AddNumberToObject(color_json, "blue", blue); + cJSON_AddNumberToObject(color_json, "cwhite", ((red << 16) | (green << 8) | (blue))); + char *formatted_val = ezlopi_valueformatter_rgb(red, green, blue); + if (formatted_val) + { + cJSON_AddStringToObject(cjson_properties, ezlopi_valueFormatted_str, formatted_val); + free(formatted_val); + } + } + } + else if (ezlopi_item_name_dimmer == item->cloud_properties.item_name) { - int green = sk6812_strip->buf[0]; - int red = sk6812_strip->buf[1]; - int blue = sk6812_strip->buf[2]; - cJSON_AddNumberToObject(color_json, "red", red); - cJSON_AddNumberToObject(color_json, "green", green); - cJSON_AddNumberToObject(color_json, "blue", blue); - cJSON_AddNumberToObject(color_json, "cwhite", ((red << 16) | (green << 8) | (blue))); - char *formatted_val = ezlopi_valueformatter_rgb(red, green, blue); + item->interface.pwm.duty_cycle = (int)ceil(((sk6812_strip->brightness * 100.0) / 255.0)); + cJSON_AddNumberToObject(cjson_properties, ezlopi_value_str, item->interface.pwm.duty_cycle); + char *formatted_val = ezlopi_valueformatter_int32(item->interface.pwm.duty_cycle); if (formatted_val) { cJSON_AddStringToObject(cjson_properties, ezlopi_valueFormatted_str, formatted_val); free(formatted_val); } } - } - else if (ezlopi_item_name_dimmer == item->cloud_properties.item_name) - { - item->interface.pwm.duty_cycle = (int)ceil(((sk6812_strip->brightness * 100.0) / 255.0)); - cJSON_AddNumberToObject(cjson_properties, ezlopi_value_str, item->interface.pwm.duty_cycle); - char *formatted_val = ezlopi_valueformatter_int32(item->interface.pwm.duty_cycle); - if (formatted_val) + else if (ezlopi_item_name_switch == item->cloud_properties.item_name) { + item->interface.gpio.gpio_in.value = (0 == sk6812_strip->brightness) ? 0 : 1; + cJSON_AddBoolToObject(cjson_properties, ezlopi_value_str, item->interface.gpio.gpio_in.value); + const char *formatted_val = ezlopi_valueformatter_bool(item->interface.gpio.gpio_in.value ? true : false); cJSON_AddStringToObject(cjson_properties, ezlopi_valueFormatted_str, formatted_val); - free(formatted_val); } } - else if (ezlopi_item_name_switch == item->cloud_properties.item_name) - { - item->interface.gpio.gpio_in.value = (0 == sk6812_strip->brightness) ? 0 : 1; - cJSON_AddBoolToObject(cjson_properties, ezlopi_value_str, item->interface.gpio.gpio_in.value); - const char *formatted_val = ezlopi_valueformatter_bool(item->interface.gpio.gpio_in.value ? true : false); - cJSON_AddStringToObject(cjson_properties, ezlopi_valueFormatted_str, formatted_val); - } } return ret; } @@ -127,7 +129,7 @@ static int __set_cjson_value(l_ezlopi_item_t *item, void *arg) { int ret = 0; - if (arg && item) + if (item && arg) { cJSON *cjson_params = (cJSON *)arg; s_dimmer_args_t *dimmer_args = (s_dimmer_args_t *)item->user_arg; @@ -176,7 +178,7 @@ static int __set_cjson_value(l_ezlopi_item_t *item, void *arg) } else { - TRACE_I("item->cloud_properties.item_name => %s", item->cloud_properties.item_name); + TRACE_D("item->cloud_properties.item_name => %s", item->cloud_properties.item_name); } } } @@ -189,52 +191,65 @@ static int __init(l_ezlopi_item_t *item) int ret = 0; if (item) { - s_dimmer_args_t *dimmer_args = (s_dimmer_args_t *)item->user_arg; - - if (0 == dimmer_args->sk6812_led_strip_initialized) + if (GPIO_IS_VALID_GPIO(item->interface.pwm.gpio_num)) { - dimmer_args->sk6812_strip.type = LED_STRIP_SK6812; - dimmer_args->sk6812_strip.length = 1; - dimmer_args->sk6812_strip.gpio = item->interface.pwm.gpio_num; - dimmer_args->sk6812_strip.buf = NULL; - dimmer_args->sk6812_strip.brightness = 255; - dimmer_args->sk6812_strip.channel = RMT_CHANNEL_0; - - led_strip_install(); - esp_err_t err = led_strip_init(&dimmer_args->sk6812_strip); - if (ESP_OK == err) + s_dimmer_args_t *dimmer_args = (s_dimmer_args_t *)item->user_arg; + if (dimmer_args) { - rgb_t color = { - .red = 255, - .green = 255, - .blue = 255, - }; - - err |= led_strip_fill(&dimmer_args->sk6812_strip, 0, dimmer_args->sk6812_strip.length, color); - if (ESP_OK == (err = led_strip_set_brightness(&dimmer_args->sk6812_strip, 255))) + if (0 == dimmer_args->sk6812_led_strip_initialized) { - if (ESP_OK == (err = led_strip_flush(&dimmer_args->sk6812_strip))) + dimmer_args->sk6812_strip.type = LED_STRIP_SK6812; + dimmer_args->sk6812_strip.length = 1; + dimmer_args->sk6812_strip.gpio = item->interface.pwm.gpio_num; + dimmer_args->sk6812_strip.buf = NULL; + dimmer_args->sk6812_strip.brightness = 255; + dimmer_args->sk6812_strip.channel = RMT_CHANNEL_0; + + led_strip_install(); + esp_err_t err = led_strip_init(&dimmer_args->sk6812_strip); + if (ESP_OK == err) { - ret = 1; - dimmer_args->sk6812_led_strip_initialized = true; + rgb_t color = { + .red = 255, + .green = 255, + .blue = 255, + }; + + err |= led_strip_fill(&dimmer_args->sk6812_strip, 0, dimmer_args->sk6812_strip.length, color); + if (ESP_OK == (err = led_strip_set_brightness(&dimmer_args->sk6812_strip, 255))) + { + if (ESP_OK == (err = led_strip_flush(&dimmer_args->sk6812_strip))) + { + ret = 1; + dimmer_args->sk6812_led_strip_initialized = true; + } + } } + + if (ESP_OK != err) + { + TRACE_E("Couldn't initiate device!, error: %d", err); + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items + item->user_arg = NULL; + } + } + else + { + TRACE_E("Here"); + ret = -1; } } - - if (ESP_OK != err) + else { - TRACE_E("Couldn't initiate device!, error: %d", err); + ret = -1; + ezlopi_device_free_device_by_item(item); } } - if (0 == ret) + else { - TRACE_E("Here"); ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } diff --git a/ezlopi-sensors-devices/device-0022-PWM-dimmable-lamp/device_0022_PWM_dimmable_lamp.c b/ezlopi-sensors-devices/device-0022-PWM-dimmable-lamp/device_0022_PWM_dimmable_lamp.c index c114528ab..344fd05b6 100644 --- a/ezlopi-sensors-devices/device-0022-PWM-dimmable-lamp/device_0022_PWM_dimmable_lamp.c +++ b/ezlopi-sensors-devices/device-0022-PWM-dimmable-lamp/device_0022_PWM_dimmable_lamp.c @@ -119,11 +119,11 @@ static int __list_cjson_value(l_ezlopi_item_t *item, void *arg) if (ezlopi_item_name_dimmer == item->cloud_properties.item_name) { int dimmable_value_percentage = (int)floor(((dimmable_bulb_arg->current_brightness_value * 100.0) / 4095.0)); - cJSON_AddNumberToObject(param, "value", dimmable_value_percentage); + cJSON_AddNumberToObject(param, ezlopi_value_str, dimmable_value_percentage); char *formatted_val = ezlopi_valueformatter_int(dimmable_value_percentage); if (formatted_val) { - cJSON_AddStringToObject(param, "valueFormatted", formatted_val); + cJSON_AddStringToObject(param, ezlopi_valueFormatted_str, formatted_val); free(formatted_val); } cJSON_AddNumberToObject(param, "minValue", 0); @@ -131,39 +131,39 @@ static int __list_cjson_value(l_ezlopi_item_t *item, void *arg) } else if (ezlopi_item_name_dimmer_up == item->cloud_properties.item_name) { - cJSON_AddNumberToObject(param, "value", 0); + cJSON_AddNumberToObject(param, ezlopi_value_str, 0); char *formatted_val = ezlopi_valueformatter_int(0); if (formatted_val) { - cJSON_AddStringToObject(param, "valueFormatted", formatted_val); + cJSON_AddStringToObject(param, ezlopi_valueFormatted_str, formatted_val); free(formatted_val); } } else if (ezlopi_item_name_dimmer_down == item->cloud_properties.item_name) { - cJSON_AddNumberToObject(param, "value", 0); + cJSON_AddNumberToObject(param, ezlopi_value_str, 0); char *formatted_val = ezlopi_valueformatter_int(0); if (formatted_val) { - cJSON_AddStringToObject(param, "valueFormatted", formatted_val); + cJSON_AddStringToObject(param, ezlopi_valueFormatted_str, formatted_val); free(formatted_val); } } else if (ezlopi_item_name_dimmer_stop == item->cloud_properties.item_name) { - cJSON_AddNumberToObject(param, "value", 0); + cJSON_AddNumberToObject(param, ezlopi_value_str, 0); char *formatted_val = ezlopi_valueformatter_int(0); if (formatted_val) { - cJSON_AddStringToObject(param, "valueFormatted", formatted_val); + cJSON_AddStringToObject(param, ezlopi_valueFormatted_str, formatted_val); free(formatted_val); } } else if (ezlopi_item_name_switch == item->cloud_properties.item_name) { bool switch_state = (0 == dimmable_bulb_arg->current_brightness_value) ? false : true; - cJSON_AddBoolToObject(param, "value", switch_state); - cJSON_AddStringToObject(param, "valueFormatted", ezlopi_valueformatter_bool(switch_state)); + cJSON_AddBoolToObject(param, ezlopi_value_str, switch_state); + cJSON_AddStringToObject(param, ezlopi_valueFormatted_str, ezlopi_valueformatter_bool(switch_state)); } } @@ -188,31 +188,31 @@ static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) } else if (ezlopi_item_name_dimmer_up == item->cloud_properties.item_name) { - cJSON_AddNumberToObject(param, "value", 0); + cJSON_AddNumberToObject(param, ezlopi_value_str, 0); char *formatted_val = ezlopi_valueformatter_int(0); if (formatted_val) { - cJSON_AddStringToObject(param, "valueFormatted", formatted_val); + cJSON_AddStringToObject(param, ezlopi_valueFormatted_str, formatted_val); free(formatted_val); } } else if (ezlopi_item_name_dimmer_down == item->cloud_properties.item_name) { - cJSON_AddNumberToObject(param, "value", 0); + cJSON_AddNumberToObject(param, ezlopi_value_str, 0); char *formatted_val = ezlopi_valueformatter_int(0); if (formatted_val) { - cJSON_AddStringToObject(param, "valueFormatted", formatted_val); + cJSON_AddStringToObject(param, ezlopi_valueFormatted_str, formatted_val); free(formatted_val); } } else if (ezlopi_item_name_dimmer_stop == item->cloud_properties.item_name) { - cJSON_AddNumberToObject(param, "value", 0); + cJSON_AddNumberToObject(param, ezlopi_value_str, 0); char *formatted_val = ezlopi_valueformatter_int(0); if (formatted_val) { - cJSON_AddStringToObject(param, "valueFormatted", formatted_val); + cJSON_AddStringToObject(param, ezlopi_valueFormatted_str, formatted_val); free(formatted_val); } } @@ -232,27 +232,46 @@ static int __init(l_ezlopi_item_t *item) int ret = 0; if (item) { - s_dimmable_bulb_properties_t *dimmable_bulb_arg = (s_dimmable_bulb_properties_t *)item->user_arg; - if ((NULL != dimmable_bulb_arg) && (0 == dimmable_bulb_arg->dimmable_bulb_initialized)) + if (GPIO_IS_VALID_GPIO(item->interface.pwm.gpio_num)) { - s_ezlopi_channel_speed_t *ezlopi_dimmable_channel_speed = ezlopi_pwm_init(item->interface.pwm.gpio_num, item->interface.pwm.pwm_resln, item->interface.pwm.freq_hz, item->interface.pwm.duty_cycle); - item->interface.pwm.channel = ezlopi_dimmable_channel_speed->channel; - TRACE_I("Channel is %d", item->interface.pwm.channel); - item->interface.pwm.speed_mode = ezlopi_dimmable_channel_speed->speed_mode; - dimmable_bulb_arg->current_brightness_value = item->interface.pwm.duty_cycle; - dimmable_bulb_arg->previous_brightness_value = item->interface.pwm.duty_cycle; - dimmable_bulb_arg->dimmable_bulb_initialized = true; - ezlopi_pwm_change_duty(item->interface.pwm.channel, item->interface.pwm.speed_mode, item->interface.pwm.duty_cycle); - ret = 1; + s_dimmable_bulb_properties_t *dimmable_bulb_arg = (s_dimmable_bulb_properties_t *)item->user_arg; + if (dimmable_bulb_arg) + { + if (0 == dimmable_bulb_arg->dimmable_bulb_initialized) + { + s_ezlopi_channel_speed_t *ezlopi_dimmable_channel_speed = ezlopi_pwm_init(item->interface.pwm.gpio_num, item->interface.pwm.pwm_resln, + item->interface.pwm.freq_hz, item->interface.pwm.duty_cycle); + if (ezlopi_dimmable_channel_speed) + { + item->interface.pwm.channel = ezlopi_dimmable_channel_speed->channel; + TRACE_I("Channel is %d", item->interface.pwm.channel); + item->interface.pwm.speed_mode = ezlopi_dimmable_channel_speed->speed_mode; + dimmable_bulb_arg->current_brightness_value = item->interface.pwm.duty_cycle; + dimmable_bulb_arg->previous_brightness_value = item->interface.pwm.duty_cycle; + dimmable_bulb_arg->dimmable_bulb_initialized = true; + ezlopi_pwm_change_duty(item->interface.pwm.channel, item->interface.pwm.speed_mode, item->interface.pwm.duty_cycle); + ret = 1; + } + else + { + ret = -1; + } + } + else + { + ret = -1; + } + } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); + } } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } return ret; diff --git a/ezlopi-sensors-devices/device-0036-PWM-servo-MG996R/device_0036_PWM_servo_MG996R.c b/ezlopi-sensors-devices/device-0036-PWM-servo-MG996R/device_0036_PWM_servo_MG996R.c index cebfcae67..da0fcb961 100644 --- a/ezlopi-sensors-devices/device-0036-PWM-servo-MG996R/device_0036_PWM_servo_MG996R.c +++ b/ezlopi-sensors-devices/device-0036-PWM-servo-MG996R/device_0036_PWM_servo_MG996R.c @@ -121,23 +121,26 @@ static int __init(l_ezlopi_item_t *item) int ret = 0; if (item) { - static s_ezlopi_channel_speed_t *servo_item = NULL; if (GPIO_IS_VALID_GPIO(item->interface.pwm.gpio_num)) { + static s_ezlopi_channel_speed_t *servo_item = NULL; servo_item = ezlopi_pwm_init(item->interface.pwm.gpio_num, item->interface.pwm.pwm_resln, item->interface.pwm.freq_hz, item->interface.pwm.duty_cycle); - item->interface.pwm.channel = servo_item->channel; - item->interface.pwm.speed_mode = servo_item->speed_mode; - ret = 1; + if (servo_item) + { + item->interface.pwm.channel = servo_item->channel; + item->interface.pwm.speed_mode = servo_item->speed_mode; + ret = 1; + } + else + { + ret = -1; + } } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } return ret; @@ -146,21 +149,24 @@ static int __init(l_ezlopi_item_t *item) static int __set_cjson_value(l_ezlopi_item_t *item, void *arg) { int ret = 0; - cJSON *cj_result = (cJSON *)arg; - if (cj_result && item) + if (item && arg) { - int value = 0; - CJSON_GET_VALUE_INT(cj_result, "value", value); + cJSON *cj_result = (cJSON *)arg; + if (cj_result && item) + { + int value = 0; + CJSON_GET_VALUE_INT(cj_result, "value", value); - TRACE_S("gpio_num: %d", item->interface.pwm.gpio_num); - TRACE_S("item_id: %d", item->cloud_properties.item_id); - TRACE_S("cur value: %d", value); + TRACE_I("gpio_num: %d", item->interface.pwm.gpio_num); + TRACE_I("item_id: %d", item->cloud_properties.item_id); + TRACE_I("cur value: %d", value); - if (GPIO_IS_VALID_OUTPUT_GPIO(item->interface.pwm.gpio_num)) - { - int target_value = (int)(((value * 17) / 100) + 13); - TRACE_S("target value: %d", target_value); - ezlopi_pwm_change_duty(item->interface.pwm.channel, item->interface.pwm.speed_mode, target_value); + if (GPIO_IS_VALID_OUTPUT_GPIO(item->interface.pwm.gpio_num)) + { + int target_value = (int)(((value * 17) / 100) + 13); + TRACE_I("target value: %d", target_value); + ezlopi_pwm_change_duty(item->interface.pwm.channel, item->interface.pwm.speed_mode, target_value); + } } } return ret; @@ -169,31 +175,37 @@ static int __set_cjson_value(l_ezlopi_item_t *item, void *arg) static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) { int ret = 0; - - cJSON *cj_result = (cJSON *)arg; - if (cj_result) + if (item && arg) { - uint32_t duty = ezlopi_pwm_get_duty(item->interface.pwm.channel, item->interface.pwm.speed_mode); - TRACE_S("raw duty value: %d", duty); - - if (duty < 13) + cJSON *cj_result = (cJSON *)arg; + if (cj_result) { - duty = 13; - TRACE_W("new _ raw duty value: %d", duty); - } - int target_duty = (int)(((duty - 13) * 100) / 17); - TRACE_S("target duty value: %d", target_duty); + uint32_t duty = ezlopi_pwm_get_duty(item->interface.pwm.channel, item->interface.pwm.speed_mode); + TRACE_I("raw duty value: %d", duty); - if (target_duty > 100) - { - target_duty = 100; - TRACE_W("new _ target duty value: %d", duty); - } + if (duty < 13) + { + duty = 13; + TRACE_W("new _ raw duty value: %d", duty); + } + int target_duty = (int)(((duty - 13) * 100) / 17); + TRACE_I("target duty value: %d", target_duty); - char *formatted_val = ezlopi_valueformatter_int(target_duty); - cJSON_AddStringToObject(cj_result, "valueFormatted", formatted_val); - cJSON_AddNumberToObject(cj_result, "value", target_duty); - ret = 1; + if (target_duty > 100) + { + target_duty = 100; + TRACE_W("new _ target duty value: %d", duty); + } + + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, target_duty); + char *formatted_val = ezlopi_valueformatter_int(target_duty); + if (formatted_val) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, formatted_val); + free(formatted_val); + } + ret = 1; + } } return ret; @@ -349,10 +361,10 @@ static int ezlopi_servo_motor_MG_996R_set_value(s_ezlopi_device_properties_t *pr int value = 0; CJSON_GET_VALUE_INT(cjson_params, ezlopi_value_str, value); - TRACE_S("item_name: %s", properties->ezlopi_cloud.item_name); - TRACE_S("gpio_num: %d", properties->interface.pwm.gpio_num); - TRACE_S("item_id: %d", properties->ezlopi_cloud.item_id); - TRACE_S("cur value: %d", value); + TRACE_I("item_name: %s", properties->ezlopi_cloud.item_name); + TRACE_I("gpio_num: %d", properties->interface.pwm.gpio_num); + TRACE_I("item_id: %d", properties->ezlopi_cloud.item_id); + TRACE_I("cur value: %d", value); if (GPIO_IS_VALID_OUTPUT_GPIO(properties->interface.pwm.gpio_num)) { diff --git a/ezlopi-sensors-devices/device-0038-other-RGB/device_0038_other_RGB.c b/ezlopi-sensors-devices/device-0038-other-RGB/device_0038_other_RGB.c index 1ea5608be..7cfcf6d63 100644 --- a/ezlopi-sensors-devices/device-0038-other-RGB/device_0038_other_RGB.c +++ b/ezlopi-sensors-devices/device-0038-other-RGB/device_0038_other_RGB.c @@ -16,9 +16,9 @@ typedef struct s_rgb_args { bool RGB_LED_initialized; - l_ezlopi_item_t *RGB_LED_item; - l_ezlopi_item_t *RGB_LED_dimmer_item; - l_ezlopi_item_t *RGB_LED_onoff_switch_item; + l_ezlopi_item_t* RGB_LED_item; + l_ezlopi_item_t* RGB_LED_dimmer_item; + l_ezlopi_item_t* RGB_LED_onoff_switch_item; float brightness; s_ezlopi_pwm_t red_struct; @@ -27,12 +27,12 @@ typedef struct s_rgb_args float previous_dim_factor; } s_rgb_args_t; -static int __prepare(void *arg); -static int __init(l_ezlopi_item_t *item); -static int __set_cjson_value(l_ezlopi_item_t *item, void *arg); -static int __get_cjson_value(l_ezlopi_item_t *item, void *arg); +static int __prepare(void* arg); +static int __init(l_ezlopi_item_t* item); +static int __set_cjson_value(l_ezlopi_item_t* item, void* arg); +static int __get_cjson_value(l_ezlopi_item_t* item, void* arg); -int device_0038_other_RGB(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void *arg, void *user_arg) +int device_0038_other_RGB(e_ezlopi_actions_t action, l_ezlopi_item_t* item, void* arg, void* user_arg) { int ret = 0; @@ -68,155 +68,185 @@ int device_0038_other_RGB(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void return ret; } -static int RGB_LED_change_color_value(s_rgb_args_t *rgb_args) +static int RGB_LED_change_color_value(s_rgb_args_t* rgb_args) { int ret = 0; - - TRACE_I("Brightness value is %d, %d, %d", (uint8_t)(rgb_args->red_struct.value * rgb_args->brightness), (uint8_t)(rgb_args->green_struct.value * rgb_args->brightness), + if (rgb_args) + { + TRACE_D("Brightness value is %d, %d, %d", (uint8_t)(rgb_args->red_struct.value * rgb_args->brightness), (uint8_t)(rgb_args->green_struct.value * rgb_args->brightness), (uint8_t)(rgb_args->blue_struct.value * rgb_args->brightness)); - ezlopi_pwm_change_duty(rgb_args->red_struct.channel, rgb_args->red_struct.speed_mode, (uint8_t)(rgb_args->red_struct.value * rgb_args->brightness)); - ezlopi_pwm_change_duty(rgb_args->green_struct.channel, rgb_args->green_struct.speed_mode, (uint8_t)(rgb_args->green_struct.value * rgb_args->brightness)); - ezlopi_pwm_change_duty(rgb_args->blue_struct.channel, rgb_args->blue_struct.speed_mode, (uint8_t)(rgb_args->blue_struct.value * rgb_args->brightness)); - + ezlopi_pwm_change_duty(rgb_args->red_struct.channel, rgb_args->red_struct.speed_mode, (uint8_t)(rgb_args->red_struct.value * rgb_args->brightness)); + ezlopi_pwm_change_duty(rgb_args->green_struct.channel, rgb_args->green_struct.speed_mode, (uint8_t)(rgb_args->green_struct.value * rgb_args->brightness)); + ezlopi_pwm_change_duty(rgb_args->blue_struct.channel, rgb_args->blue_struct.speed_mode, (uint8_t)(rgb_args->blue_struct.value * rgb_args->brightness)); + } return ret; } -static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) +static int __get_cjson_value(l_ezlopi_item_t* item, void* arg) { int ret = 0; - - cJSON *cjson_params = (cJSON *)arg; - s_rgb_args_t *rgb_args = (s_rgb_args_t *)item->user_arg; - - if ((NULL != cjson_params) && (NULL != rgb_args)) + if (item && arg) { - if (ezlopi_item_name_rgbcolor == item->cloud_properties.item_name) + cJSON* cjson_params = (cJSON*)arg; + s_rgb_args_t* rgb_args = (s_rgb_args_t*)item->user_arg; + + if ((NULL != cjson_params) && (NULL != rgb_args)) { - cJSON *color_values = cJSON_AddObjectToObject(cjson_params, ezlopi_value_str); - if (color_values) + if (ezlopi_item_name_rgbcolor == item->cloud_properties.item_name) { - cJSON_AddNumberToObject(color_values, "red", rgb_args->red_struct.value); - cJSON_AddNumberToObject(color_values, "green", rgb_args->green_struct.value); - cJSON_AddNumberToObject(color_values, "blue", rgb_args->blue_struct.value); - char *formatted_val = ezlopi_valueformatter_rgb(rgb_args->red_struct.value, rgb_args->green_struct.value, rgb_args->blue_struct.value); - cJSON_AddStringToObject(cjson_params, ezlopi_valueFormatted_str, formatted_val); - free(formatted_val); + cJSON* color_values = cJSON_AddObjectToObject(cjson_params, ezlopi_value_str); + if (color_values) + { + cJSON_AddNumberToObject(color_values, "red", rgb_args->red_struct.value); + cJSON_AddNumberToObject(color_values, "green", rgb_args->green_struct.value); + cJSON_AddNumberToObject(color_values, "blue", rgb_args->blue_struct.value); + char* formatted_val = ezlopi_valueformatter_rgb(rgb_args->red_struct.value, rgb_args->green_struct.value, rgb_args->blue_struct.value); + if (formatted_val) + { + cJSON_AddStringToObject(cjson_params, ezlopi_valueFormatted_str, formatted_val); + free(formatted_val); + } + } + } + if (ezlopi_item_name_switch == item->cloud_properties.item_name) + { + int state = ((0 == rgb_args->brightness) ? 0 : 1); + cJSON_AddBoolToObject(cjson_params, ezlopi_value_str, state); + cJSON_AddStringToObject(cjson_params, ezlopi_valueFormatted_str, ezlopi_valueformatter_bool(state ? true : false)); + } + if (ezlopi_item_name_dimmer == item->cloud_properties.item_name) + { + int dim_percentage = (int)(rgb_args->brightness * 100); + cJSON_AddNumberToObject(cjson_params, ezlopi_value_str, dim_percentage); + char* formatted_val = ezlopi_valueformatter_int(dim_percentage); + if (formatted_val) + { + cJSON_AddStringToObject(cjson_params, ezlopi_valueFormatted_str, formatted_val); + free(formatted_val); + } } - } - if (ezlopi_item_name_switch == item->cloud_properties.item_name) - { - int state = ((0 == rgb_args->brightness) ? 0 : 1); - cJSON_AddBoolToObject(cjson_params, ezlopi_value_str, state); - cJSON_AddStringToObject(cjson_params, ezlopi_valueFormatted_str, ezlopi_valueformatter_bool(state ? true : false)); - } - if (ezlopi_item_name_dimmer == item->cloud_properties.item_name) - { - int dim_percentage = (int)(rgb_args->brightness * 100); - cJSON_AddNumberToObject(cjson_params, ezlopi_value_str, dim_percentage); - char *formatted_val = ezlopi_valueformatter_int(dim_percentage); - cJSON_AddStringToObject(cjson_params, ezlopi_valueFormatted_str, formatted_val); - free(formatted_val); } } return ret; } -static int __set_cjson_value(l_ezlopi_item_t *item, void *arg) +static int __set_cjson_value(l_ezlopi_item_t* item, void* arg) { int ret = 0; - cJSON *cjson_params = (cJSON *)arg; - s_rgb_args_t *rgb_args = (s_rgb_args_t *)item->user_arg; - - if ((NULL != cjson_params) && (NULL != rgb_args)) + if (item && arg) { - if (ezlopi_item_name_rgbcolor == item->cloud_properties.item_name) + cJSON* cjson_params = (cJSON*)arg; + s_rgb_args_t* rgb_args = (s_rgb_args_t*)item->user_arg; + if ((NULL != cjson_params) && (NULL != rgb_args)) { - cJSON *cjson_params_rgb_values = cJSON_GetObjectItem(cjson_params, ezlopi_value_str); + if (ezlopi_item_name_rgbcolor == item->cloud_properties.item_name) + { + cJSON* cjson_params_rgb_values = cJSON_GetObjectItem(cjson_params, ezlopi_value_str); - CJSON_TRACE("cjson_params_rgb_values", cjson_params_rgb_values); + CJSON_TRACE("cjson_params_rgb_values", cjson_params_rgb_values); - CJSON_GET_VALUE_INT(cjson_params_rgb_values, "red", rgb_args->red_struct.value); - CJSON_GET_VALUE_INT(cjson_params_rgb_values, "green", rgb_args->green_struct.value); - CJSON_GET_VALUE_INT(cjson_params_rgb_values, "blue", rgb_args->blue_struct.value); + CJSON_GET_VALUE_INT(cjson_params_rgb_values, "red", rgb_args->red_struct.value); + CJSON_GET_VALUE_INT(cjson_params_rgb_values, "green", rgb_args->green_struct.value); + CJSON_GET_VALUE_INT(cjson_params_rgb_values, "blue", rgb_args->blue_struct.value); - RGB_LED_change_color_value(rgb_args); - } - if (ezlopi_item_name_switch == item->cloud_properties.item_name) - { - int led_state = 0; - CJSON_GET_VALUE_INT(cjson_params, ezlopi_value_str, led_state); - rgb_args->previous_dim_factor = ((0 == led_state) ? rgb_args->brightness : rgb_args->previous_dim_factor); - rgb_args->brightness = ((0 == led_state) ? 0.0 : ((0 == rgb_args->previous_dim_factor) ? 1.0 : rgb_args->previous_dim_factor)); - TRACE_I("Brightness value is %d, %d, %d", (uint8_t)(rgb_args->red_struct.value * rgb_args->brightness), (uint8_t)(rgb_args->green_struct.value * rgb_args->brightness), + RGB_LED_change_color_value(rgb_args); + } + if (ezlopi_item_name_switch == item->cloud_properties.item_name) + { + int led_state = 0; + CJSON_GET_VALUE_INT(cjson_params, ezlopi_value_str, led_state); + rgb_args->previous_dim_factor = ((0 == led_state) ? rgb_args->brightness : rgb_args->previous_dim_factor); + rgb_args->brightness = ((0 == led_state) ? 0.0 : ((0 == rgb_args->previous_dim_factor) ? 1.0 : rgb_args->previous_dim_factor)); + TRACE_D("Brightness value is %d, %d, %d", (uint8_t)(rgb_args->red_struct.value * rgb_args->brightness), (uint8_t)(rgb_args->green_struct.value * rgb_args->brightness), (uint8_t)(rgb_args->blue_struct.value * rgb_args->brightness)); - RGB_LED_change_color_value(rgb_args); - ezlopi_device_value_updated_from_device_v3(rgb_args->RGB_LED_dimmer_item); - } - if (ezlopi_item_name_dimmer == item->cloud_properties.item_name) - { - int dim_percent = 0; - CJSON_GET_VALUE_INT(cjson_params, ezlopi_value_str, dim_percent); - float dim_brightness_factor = dim_percent / 100.0; - TRACE_I("dim_percent %d, dim_brightness_factor is %f", dim_percent, dim_brightness_factor); - rgb_args->brightness = dim_brightness_factor; - RGB_LED_change_color_value(rgb_args); - ezlopi_device_value_updated_from_device_v3(rgb_args->RGB_LED_onoff_switch_item); + RGB_LED_change_color_value(rgb_args); + ezlopi_device_value_updated_from_device_v3(rgb_args->RGB_LED_dimmer_item); + } + if (ezlopi_item_name_dimmer == item->cloud_properties.item_name) + { + int dim_percent = 0; + CJSON_GET_VALUE_INT(cjson_params, ezlopi_value_str, dim_percent); + float dim_brightness_factor = dim_percent / 100.0; + TRACE_D("dim_percent %d, dim_brightness_factor is %f", dim_percent, dim_brightness_factor); + rgb_args->brightness = dim_brightness_factor; + RGB_LED_change_color_value(rgb_args); + ezlopi_device_value_updated_from_device_v3(rgb_args->RGB_LED_onoff_switch_item); + } } } return ret; } -static int __init(l_ezlopi_item_t *item) +static int __init(l_ezlopi_item_t* item) { int ret = 0; if (item) { - s_rgb_args_t *rgb_args = (s_rgb_args_t *)item->user_arg; - - if ((NULL != rgb_args) && (!rgb_args->RGB_LED_initialized)) + s_rgb_args_t* rgb_args = (s_rgb_args_t*)item->user_arg; + if (rgb_args) { - s_ezlopi_channel_speed_t *RGB_LED_red_channel_speed = ezlopi_pwm_init(rgb_args->red_struct.gpio_num, rgb_args->red_struct.pwm_resln, rgb_args->red_struct.freq_hz, rgb_args->red_struct.duty_cycle); - s_ezlopi_channel_speed_t *RGB_LED_green_channel_speed = ezlopi_pwm_init(rgb_args->green_struct.gpio_num, rgb_args->green_struct.pwm_resln, rgb_args->green_struct.freq_hz, rgb_args->green_struct.duty_cycle); - s_ezlopi_channel_speed_t *RGB_LED_blue_channel_speed = ezlopi_pwm_init(rgb_args->blue_struct.gpio_num, rgb_args->blue_struct.pwm_resln, rgb_args->blue_struct.freq_hz, rgb_args->blue_struct.duty_cycle); - - rgb_args->red_struct.channel = RGB_LED_red_channel_speed->channel; - rgb_args->red_struct.speed_mode = RGB_LED_red_channel_speed->speed_mode; - TRACE_I("red channel is %d", rgb_args->red_struct.channel); - - rgb_args->green_struct.channel = RGB_LED_green_channel_speed->channel; - rgb_args->green_struct.speed_mode = RGB_LED_green_channel_speed->speed_mode; - TRACE_I("green channel is %d", rgb_args->green_struct.channel); - - rgb_args->blue_struct.channel = RGB_LED_blue_channel_speed->channel; - rgb_args->blue_struct.speed_mode = RGB_LED_blue_channel_speed->speed_mode; - TRACE_I("blue channel is %d", rgb_args->blue_struct.channel); - - free(RGB_LED_red_channel_speed); - free(RGB_LED_green_channel_speed); - free(RGB_LED_blue_channel_speed); - - RGB_LED_change_color_value(rgb_args); - - rgb_args->RGB_LED_initialized = true; - ret = 1; + if (GPIO_IS_VALID_GPIO(rgb_args->red_struct.gpio_num) && + GPIO_IS_VALID_GPIO(rgb_args->green_struct.gpio_num) && + GPIO_IS_VALID_GPIO(rgb_args->blue_struct.gpio_num)) + { + if (false == rgb_args->RGB_LED_initialized) + { + s_ezlopi_channel_speed_t* RGB_LED_red_channel_speed = ezlopi_pwm_init(rgb_args->red_struct.gpio_num, rgb_args->red_struct.pwm_resln, rgb_args->red_struct.freq_hz, rgb_args->red_struct.duty_cycle); + if (RGB_LED_red_channel_speed) + { + rgb_args->red_struct.channel = RGB_LED_red_channel_speed->channel; + rgb_args->red_struct.speed_mode = RGB_LED_red_channel_speed->speed_mode; + TRACE_D("red channel is %d", rgb_args->red_struct.channel); + free(RGB_LED_red_channel_speed); + } + + s_ezlopi_channel_speed_t* RGB_LED_green_channel_speed = ezlopi_pwm_init(rgb_args->green_struct.gpio_num, rgb_args->green_struct.pwm_resln, rgb_args->green_struct.freq_hz, rgb_args->green_struct.duty_cycle); + if (RGB_LED_green_channel_speed) + { + rgb_args->green_struct.channel = RGB_LED_green_channel_speed->channel; + rgb_args->green_struct.speed_mode = RGB_LED_green_channel_speed->speed_mode; + TRACE_D("green channel is %d", rgb_args->green_struct.channel); + free(RGB_LED_green_channel_speed); + } + + s_ezlopi_channel_speed_t* RGB_LED_blue_channel_speed = ezlopi_pwm_init(rgb_args->blue_struct.gpio_num, rgb_args->blue_struct.pwm_resln, rgb_args->blue_struct.freq_hz, rgb_args->blue_struct.duty_cycle); + if (RGB_LED_blue_channel_speed) + { + rgb_args->blue_struct.channel = RGB_LED_blue_channel_speed->channel; + rgb_args->blue_struct.speed_mode = RGB_LED_blue_channel_speed->speed_mode; + TRACE_D("blue channel is %d", rgb_args->blue_struct.channel); + free(RGB_LED_blue_channel_speed); + } + + RGB_LED_change_color_value(rgb_args); + + rgb_args->RGB_LED_initialized = true; + ret = 1; + } + else + { + ret = -1; + } + } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); + } } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } return ret; } -static void __prepare_device_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device) +static void __prepare_device_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device) { // char *device_name = NULL; // CJSON_GET_VALUE_STRING(cj_device, ezlopi_dev_name_str, device_name); @@ -230,7 +260,7 @@ static void __prepare_device_cloud_properties(l_ezlopi_device_t *device, cJSON * device->cloud_properties.device_type_id = NULL; } -static void __prepare_RGB_LED_user_args(s_rgb_args_t *rgb_args, cJSON *cj_device) +static void __prepare_RGB_LED_user_args(s_rgb_args_t* rgb_args, cJSON* cj_device) { CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio1_str, rgb_args->red_struct.gpio_num); CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio2_str, rgb_args->green_struct.gpio_num); @@ -254,13 +284,13 @@ static void __prepare_RGB_LED_user_args(s_rgb_args_t *rgb_args, cJSON *cj_device rgb_args->brightness = 0.0; } -static void __prepare_RGB_LED_item(l_ezlopi_item_t *item, cJSON *cj_device, void *user_arg) +static void __prepare_RGB_LED_item(l_ezlopi_item_t* item, cJSON* cj_device, void* user_arg) { item->cloud_properties.has_getter = true; item->cloud_properties.has_setter = true; item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); item->cloud_properties.item_name = ezlopi_item_name_rgbcolor, - item->cloud_properties.show = true; + item->cloud_properties.show = true; item->cloud_properties.scale = NULL; item->cloud_properties.value_type = value_type_rgb; item->interface_type = EZLOPI_DEVICE_INTERFACE_PWM; @@ -273,13 +303,13 @@ static void __prepare_RGB_LED_item(l_ezlopi_item_t *item, cJSON *cj_device, void item->user_arg = user_arg; } -static void __prepare_RGB_LED_onoff_switch_item(l_ezlopi_item_t *item, cJSON *cj_device, void *user_arg) +static void __prepare_RGB_LED_onoff_switch_item(l_ezlopi_item_t* item, cJSON* cj_device, void* user_arg) { item->cloud_properties.has_getter = true; item->cloud_properties.has_setter = true; item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); item->cloud_properties.item_name = ezlopi_item_name_switch, - item->cloud_properties.show = true; + item->cloud_properties.show = true; item->cloud_properties.scale = NULL; item->cloud_properties.value_type = value_type_bool; item->interface_type = EZLOPI_DEVICE_INTERFACE_DIGITAL_OUTPUT; @@ -294,13 +324,13 @@ static void __prepare_RGB_LED_onoff_switch_item(l_ezlopi_item_t *item, cJSON *cj item->user_arg = user_arg; } -static void __prepare_RGB_LED_dimmer_item(l_ezlopi_item_t *item, cJSON *cj_device, void *user_arg) +static void __prepare_RGB_LED_dimmer_item(l_ezlopi_item_t* item, cJSON* cj_device, void* user_arg) { item->cloud_properties.has_getter = true; item->cloud_properties.has_setter = true; item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); item->cloud_properties.item_name = ezlopi_item_name_dimmer, - item->cloud_properties.show = true; + item->cloud_properties.show = true; item->cloud_properties.scale = NULL; item->cloud_properties.value_type = value_type_int; item->interface_type = EZLOPI_DEVICE_INTERFACE_PWM; @@ -313,17 +343,17 @@ static void __prepare_RGB_LED_dimmer_item(l_ezlopi_item_t *item, cJSON *cj_devic item->user_arg = user_arg; } -static int __prepare(void *arg) +static int __prepare(void* arg) { int ret = 0; - s_ezlopi_prep_arg_t *prep_arg = (s_ezlopi_prep_arg_t *)arg; + s_ezlopi_prep_arg_t* prep_arg = (s_ezlopi_prep_arg_t*)arg; if (prep_arg && prep_arg->cjson_device) { - l_ezlopi_device_t *RGB_device = ezlopi_device_add_device(prep_arg->cjson_device); + l_ezlopi_device_t* RGB_device = ezlopi_device_add_device(prep_arg->cjson_device); if (RGB_device) { - s_rgb_args_t *rgb_args = malloc(sizeof(s_rgb_args_t)); + s_rgb_args_t* rgb_args = malloc(sizeof(s_rgb_args_t)); if (rgb_args) { memset(rgb_args, 0, sizeof(s_rgb_args_t)); diff --git a/ezlopi-sensors-devices/sensor-0005-I2C-MPU6050/mpu6050.c b/ezlopi-sensors-devices/sensor-0005-I2C-MPU6050/mpu6050.c index 00ece77d4..944b1641f 100644 --- a/ezlopi-sensors-devices/sensor-0005-I2C-MPU6050/mpu6050.c +++ b/ezlopi-sensors-devices/sensor-0005-I2C-MPU6050/mpu6050.c @@ -171,49 +171,52 @@ void __mpu6050_get_data(l_ezlopi_item_t *item) uint8_t address_val = 0; s_mpu6050_data_t *user_data = (s_mpu6050_data_t *)item->user_arg; - if ((err = mpu6050_check_data_ready_INTR(item, &Check_Register)) == MPU6050_ERR_OK) + if (user_data) { - if (Check_Register & DATA_RDY_INT_FLAG) + if ((err = mpu6050_check_data_ready_INTR(item, &Check_Register)) == MPU6050_ERR_OK) { - address_val = (ACCEL_X_H); - ezlopi_i2c_master_write_to_device(&item->interface.i2c_master, &address_val, 1); - ezlopi_i2c_master_read_from_device(&item->interface.i2c_master, (tmp_buf), MPU6050_REG_COUNT_LEN); //(tmp_buf+i), 1); + if (Check_Register & DATA_RDY_INT_FLAG) + { + address_val = (ACCEL_X_H); + ezlopi_i2c_master_write_to_device(&item->interface.i2c_master, &address_val, 1); + ezlopi_i2c_master_read_from_device(&item->interface.i2c_master, (tmp_buf), MPU6050_REG_COUNT_LEN); //(tmp_buf+i), 1); + } + // user_data->extract_counts++; + // TRACE_I("Total Extracted : [%d]", user_data->extract_counts); } - // user_data->extract_counts++; - // TRACE_S("Total Extracted : [%d]", user_data->extract_counts); - } - else - { - TRACE_E("Data not ready ... Error type:- %d ", err); - for (uint8_t try = 10; ((try > 0) && !(Check_Register & DATA_RDY_INT_FLAG)); try--) + else { - if (MPU6050_ERR_OK == mpu6050_check_data_ready_INTR(item, &Check_Register)) + TRACE_E("Data not ready ... Error type:- %d ", err); + for (uint8_t try = 10; ((try > 0) && !(Check_Register & DATA_RDY_INT_FLAG)); try--) { - TRACE_E(" Check Register ... 0x3AH : {%#x}", Check_Register); - if (Check_Register & DATA_RDY_INT_FLAG) + if (MPU6050_ERR_OK == mpu6050_check_data_ready_INTR(item, &Check_Register)) { - break; + TRACE_E(" Check Register ... 0x3AH : {%#x}", Check_Register); + if (Check_Register & DATA_RDY_INT_FLAG) + { + break; + } } } } - } - // Configure data structure // total 14 bytes - RAW_DATA.raw_ax = (int16_t)(tmp_buf[0] << 8 | tmp_buf[1]); // acc_x = 59(0x3B) [msb] & 60(0x3C) [lsb] - RAW_DATA.raw_ay = (int16_t)(tmp_buf[2] << 8 | tmp_buf[3]); // acc_y = 61 & 62 - RAW_DATA.raw_az = (int16_t)(tmp_buf[4] << 8 | tmp_buf[5]); // acc_z = 63 & 64 - RAW_DATA.raw_t = (int16_t)(tmp_buf[6] << 8 | tmp_buf[7]); // tp = 65 & 66 - RAW_DATA.raw_gx = (int16_t)(tmp_buf[8] << 8 | tmp_buf[9]); // gx = 67 & 68 - RAW_DATA.raw_gy = (int16_t)(tmp_buf[10] << 8 | tmp_buf[11]); // gy = 69 & 70 - RAW_DATA.raw_gz = (int16_t)(tmp_buf[12] << 8 | tmp_buf[13]); // gz = 71 & 72 + // Configure data structure // total 14 bytes + RAW_DATA.raw_ax = (int16_t)(tmp_buf[0] << 8 | tmp_buf[1]); // acc_x = 59(0x3B) [msb] & 60(0x3C) [lsb] + RAW_DATA.raw_ay = (int16_t)(tmp_buf[2] << 8 | tmp_buf[3]); // acc_y = 61 & 62 + RAW_DATA.raw_az = (int16_t)(tmp_buf[4] << 8 | tmp_buf[5]); // acc_z = 63 & 64 + RAW_DATA.raw_t = (int16_t)(tmp_buf[6] << 8 | tmp_buf[7]); // tp = 65 & 66 + RAW_DATA.raw_gx = (int16_t)(tmp_buf[8] << 8 | tmp_buf[9]); // gx = 67 & 68 + RAW_DATA.raw_gy = (int16_t)(tmp_buf[10] << 8 | tmp_buf[11]); // gy = 69 & 70 + RAW_DATA.raw_gz = (int16_t)(tmp_buf[12] << 8 | tmp_buf[13]); // gz = 71 & 72 - user_data->ax = (RAW_DATA.raw_ax / acc_mpu6050_calib_val) * MPU6050_STANDARD_G_TO_ACCEL_CONVERSION_VALUE; // in m/s^2 - user_data->ay = (RAW_DATA.raw_ay / acc_mpu6050_calib_val) * MPU6050_STANDARD_G_TO_ACCEL_CONVERSION_VALUE; // in m/s^2 - user_data->az = (RAW_DATA.raw_az / acc_mpu6050_calib_val) * MPU6050_STANDARD_G_TO_ACCEL_CONVERSION_VALUE; // in m/s^2 - user_data->gx = ((RAW_DATA.raw_gx - user_data->gyro_x_offset) / gyro_mpu6050_calib_val) / 6.0f; // -> revolutions per minute = degrees per second ÷ 6 - user_data->gy = ((RAW_DATA.raw_gy - user_data->gyro_y_offset) / gyro_mpu6050_calib_val) / 6.0f; // -> revolutions per minute = degrees per second ÷ 6 - user_data->gz = ((RAW_DATA.raw_gz - user_data->gyro_z_offset) / gyro_mpu6050_calib_val) / 6.0f; // -> revolutions per minute = degrees per second ÷ 6 - user_data->tmp = ((RAW_DATA.raw_t / 340) + 36.530f); + user_data->ax = (RAW_DATA.raw_ax / acc_mpu6050_calib_val) * MPU6050_STANDARD_G_TO_ACCEL_CONVERSION_VALUE; // in m/s^2 + user_data->ay = (RAW_DATA.raw_ay / acc_mpu6050_calib_val) * MPU6050_STANDARD_G_TO_ACCEL_CONVERSION_VALUE; // in m/s^2 + user_data->az = (RAW_DATA.raw_az / acc_mpu6050_calib_val) * MPU6050_STANDARD_G_TO_ACCEL_CONVERSION_VALUE; // in m/s^2 + user_data->gx = ((RAW_DATA.raw_gx - user_data->gyro_x_offset) / gyro_mpu6050_calib_val) / 6.0f; // -> revolutions per minute = degrees per second ÷ 6 + user_data->gy = ((RAW_DATA.raw_gy - user_data->gyro_y_offset) / gyro_mpu6050_calib_val) / 6.0f; // -> revolutions per minute = degrees per second ÷ 6 + user_data->gz = ((RAW_DATA.raw_gz - user_data->gyro_z_offset) / gyro_mpu6050_calib_val) / 6.0f; // -> revolutions per minute = degrees per second ÷ 6 + user_data->tmp = ((RAW_DATA.raw_t / 340) + 36.530f); + } } } diff --git a/ezlopi-sensors-devices/sensor-0005-I2C-MPU6050/sensor_0005_I2C_MPU6050.c b/ezlopi-sensors-devices/sensor-0005-I2C-MPU6050/sensor_0005_I2C_MPU6050.c index 6174ae6fb..87aab1b1e 100644 --- a/ezlopi-sensors-devices/sensor-0005-I2C-MPU6050/sensor_0005_I2C_MPU6050.c +++ b/ezlopi-sensors-devices/sensor-0005-I2C-MPU6050/sensor_0005_I2C_MPU6050.c @@ -210,24 +210,31 @@ static int __init(l_ezlopi_item_t *item) int ret = 0; if (item) { - if (true == item->interface.i2c_master.enable) + s_mpu6050_data_t *user_data = (s_mpu6050_data_t *)item->user_arg; + if (user_data) { - ezlopi_i2c_master_init(&item->interface.i2c_master); - if (MPU6050_ERR_OK == __mpu6050_config_device(item)) + if (item->interface.i2c_master.enable) { - TRACE_S("Configuration Complete.... "); - xTaskCreate(__mpu6050_calibration_task, "MPU6050_Calibration_Task", 2048, item, 1, NULL); + ezlopi_i2c_master_init(&item->interface.i2c_master); + if (MPU6050_ERR_OK == __mpu6050_config_device(item)) + { + TRACE_I("Configuration Complete.... "); + xTaskCreate(__mpu6050_calibration_task, "MPU6050_Calibration_Task", 2048, item, 1, NULL); + ret = 1; + } + else + { + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); + } } - ret = 1; } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } return ret; @@ -236,67 +243,94 @@ static int __init(l_ezlopi_item_t *item) static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) { int ret = 0; - cJSON *cj_result = (cJSON *)arg; - if (cj_result && item) + if (item && arg) { - s_mpu6050_data_t *user_data = (s_mpu6050_data_t *)item->user_arg; - if (ezlopi_item_name_acceleration_x_axis == item->cloud_properties.item_name) + cJSON *cj_result = (cJSON *)arg; + if (cj_result) { - TRACE_S("Accel-x : %.2fm/s^2", user_data->ax); - cJSON_AddNumberToObject(cj_result, "value", user_data->ax); - char *valueFormatted = ezlopi_valueformatter_float(user_data->ax); - cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); - free(valueFormatted); - } - if (ezlopi_item_name_acceleration_y_axis == item->cloud_properties.item_name) - { - TRACE_S("Accel-y : %.2fm/s^2", user_data->ay); - cJSON_AddNumberToObject(cj_result, "value", user_data->ay); - char *valueFormatted = ezlopi_valueformatter_float(user_data->ay); - cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); - free(valueFormatted); - } - if (ezlopi_item_name_acceleration_z_axis == item->cloud_properties.item_name) - { - TRACE_S("Accel-z : %.2fm/s^2", user_data->az); - cJSON_AddNumberToObject(cj_result, "value", user_data->az); - char *valueFormatted = ezlopi_valueformatter_float(user_data->az); - cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); - free(valueFormatted); - } - if (ezlopi_item_name_temp == item->cloud_properties.item_name) - { - TRACE_S("Temp : %.2f*C", user_data->tmp); - cJSON_AddNumberToObject(cj_result, "value", user_data->tmp); - char *valueFormatted = ezlopi_valueformatter_float(user_data->tmp); - cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); - free(valueFormatted); - } - if (ezlopi_item_name_gyroscope_x_axis == item->cloud_properties.item_name) - { - TRACE_S("Gyro-x : %d rpm", (int)user_data->gx); - cJSON_AddNumberToObject(cj_result, "value", ((int)user_data->gx)); - char *valueFormatted = ezlopi_valueformatter_int((int)user_data->gx); - cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); - free(valueFormatted); - } - if (ezlopi_item_name_gyroscope_y_axis == item->cloud_properties.item_name) - { - TRACE_S("Gyro-y : %d rpm", (int)user_data->gy); - cJSON_AddNumberToObject(cj_result, "value", ((int)user_data->gy)); - char *valueFormatted = ezlopi_valueformatter_int((int)user_data->gy); - cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); - free(valueFormatted); - } - if (ezlopi_item_name_gyroscope_z_axis == item->cloud_properties.item_name) - { - TRACE_S("Gyro-z : %d rpm", (int)user_data->gz); - cJSON_AddNumberToObject(cj_result, "value", ((int)user_data->gz)); - char *valueFormatted = ezlopi_valueformatter_int((int)user_data->gz); - cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); - free(valueFormatted); + s_mpu6050_data_t *user_data = (s_mpu6050_data_t *)item->user_arg; + if (user_data) + { + if (ezlopi_item_name_acceleration_x_axis == item->cloud_properties.item_name) + { + TRACE_I("Accel-x : %.2fm/s^2", user_data->ax); + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, user_data->ax); + char *valueFormatted = ezlopi_valueformatter_float(user_data->ax); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } + if (ezlopi_item_name_acceleration_y_axis == item->cloud_properties.item_name) + { + TRACE_I("Accel-y : %.2fm/s^2", user_data->ay); + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, user_data->ay); + char *valueFormatted = ezlopi_valueformatter_float(user_data->ay); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } + if (ezlopi_item_name_acceleration_z_axis == item->cloud_properties.item_name) + { + TRACE_I("Accel-z : %.2fm/s^2", user_data->az); + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, user_data->az); + char *valueFormatted = ezlopi_valueformatter_float(user_data->az); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } + if (ezlopi_item_name_temp == item->cloud_properties.item_name) + { + TRACE_I("Temp : %.2f*C", user_data->tmp); + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, user_data->tmp); + char *valueFormatted = ezlopi_valueformatter_float(user_data->tmp); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } + if (ezlopi_item_name_gyroscope_x_axis == item->cloud_properties.item_name) + { + TRACE_I("Gyro-x : %d rpm", (int)user_data->gx); + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, ((int)user_data->gx)); + char *valueFormatted = ezlopi_valueformatter_int((int)user_data->gx); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } + if (ezlopi_item_name_gyroscope_y_axis == item->cloud_properties.item_name) + { + TRACE_I("Gyro-y : %d rpm", (int)user_data->gy); + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, ((int)user_data->gy)); + char *valueFormatted = ezlopi_valueformatter_int((int)user_data->gy); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } + if (ezlopi_item_name_gyroscope_z_axis == item->cloud_properties.item_name) + { + TRACE_I("Gyro-z : %d rpm", (int)user_data->gz); + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, ((int)user_data->gz)); + char *valueFormatted = ezlopi_valueformatter_int((int)user_data->gz); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } + ret = 1; + } } - ret = 1; } return ret; } @@ -308,7 +342,7 @@ static int __notify(l_ezlopi_item_t *item) if (item) { s_mpu6050_data_t *user_data = (s_mpu6050_data_t *)item->user_arg; - if (user_data->calibration_complete) + if ((user_data) && user_data->calibration_complete) { if (ezlopi_item_name_acceleration_x_axis == item->cloud_properties.item_name) { @@ -335,43 +369,42 @@ static int __notify(l_ezlopi_item_t *item) } // } } - if (ezlopi_item_name_acceleration_y_axis == item->cloud_properties.item_name) + else if (ezlopi_item_name_acceleration_y_axis == item->cloud_properties.item_name) { if (fabs(__prev[1] - user_data->ay) > 0.5) { ezlopi_device_value_updated_from_device_v3(item); } } - if (ezlopi_item_name_acceleration_z_axis == item->cloud_properties.item_name) + else if (ezlopi_item_name_acceleration_z_axis == item->cloud_properties.item_name) { if (fabs(__prev[2] - user_data->az) > 0.5) { ezlopi_device_value_updated_from_device_v3(item); } } - if (ezlopi_item_name_temp == item->cloud_properties.item_name) + else if (ezlopi_item_name_temp == item->cloud_properties.item_name) { if (fabs(__prev[3] - user_data->tmp) > 0.5) { ezlopi_device_value_updated_from_device_v3(item); } } - - if (ezlopi_item_name_gyroscope_x_axis == item->cloud_properties.item_name) + else if (ezlopi_item_name_gyroscope_x_axis == item->cloud_properties.item_name) { if (fabs(__prev[4] - user_data->gx) > 0.5) { ezlopi_device_value_updated_from_device_v3(item); } } - if (ezlopi_item_name_gyroscope_y_axis == item->cloud_properties.item_name) + else if (ezlopi_item_name_gyroscope_y_axis == item->cloud_properties.item_name) { if (fabs(__prev[5] - user_data->gy) > 0.5) { ezlopi_device_value_updated_from_device_v3(item); } } - if (ezlopi_item_name_gyroscope_z_axis == item->cloud_properties.item_name) + else if (ezlopi_item_name_gyroscope_z_axis == item->cloud_properties.item_name) { if (fabs(__prev[6] - user_data->gz) > 0.5) { @@ -391,71 +424,73 @@ static void __mpu6050_calibration_task(void *params) // calibrate task if (item) { s_mpu6050_data_t *user_data = (s_mpu6050_data_t *)item->user_arg; + if (user_data) + { + uint8_t buf[MPU6050_REG_COUNT_LEN] = {0}; // 0 - 13 + uint8_t dummy[MPU6050_REG_COUNT_LEN] = {0}; - uint8_t buf[MPU6050_REG_COUNT_LEN] = {0}; // 0 - 13 - uint8_t dummy[MPU6050_REG_COUNT_LEN] = {0}; - - float calibrationData[3] = {0}; - uint8_t Check_Register = 0; - esp_err_t err = ESP_OK; - TRACE_W(".....................Calculating Paramter"); - - uint8_t write_buffer[] = {REG_INTR_STATUS}; // REG_INTR_STATUS; - uint8_t address_val = (ACCEL_X_H); + float calibrationData[3] = {0}; + uint8_t Check_Register = 0; + esp_err_t err = ESP_OK; + TRACE_W(".....................Calculating Paramter"); - for (uint8_t i = CALIBRATION_SAMPLES + 50; i > 0; i--) - { - err = ezlopi_i2c_master_write_to_device(&item->interface.i2c_master, write_buffer, 1); - err = ezlopi_i2c_master_read_from_device(&item->interface.i2c_master, &Check_Register, 1); + uint8_t write_buffer[] = {REG_INTR_STATUS}; // REG_INTR_STATUS; + uint8_t address_val = (ACCEL_X_H); - if (ESP_OK == err) + for (uint8_t i = CALIBRATION_SAMPLES + 50; i > 0; i--) { - if (Check_Register & DATA_RDY_INT_FLAG) - { - err = ezlopi_i2c_master_write_to_device(&item->interface.i2c_master, &address_val, 1); - err = ezlopi_i2c_master_read_from_device(&item->interface.i2c_master, (buf), MPU6050_REG_COUNT_LEN); - } - if (i <= CALIBRATION_SAMPLES) + err = ezlopi_i2c_master_write_to_device(&item->interface.i2c_master, write_buffer, 1); + err = ezlopi_i2c_master_read_from_device(&item->interface.i2c_master, &Check_Register, 1); + + if (ESP_OK == err) { - if (ESP_OK != err) + if (Check_Register & DATA_RDY_INT_FLAG) { - buf[8] = dummy[8]; - buf[9] = dummy[9]; - buf[10] = dummy[10]; - buf[11] = dummy[11]; - buf[12] = dummy[12]; - buf[13] = dummy[13]; + err = ezlopi_i2c_master_write_to_device(&item->interface.i2c_master, &address_val, 1); + err = ezlopi_i2c_master_read_from_device(&item->interface.i2c_master, (buf), MPU6050_REG_COUNT_LEN); } - else + if (i <= CALIBRATION_SAMPLES) { - dummy[8] = buf[8]; - dummy[9] = buf[9]; - dummy[10] = buf[10]; - dummy[11] = buf[11]; - dummy[12] = buf[12]; - dummy[13] = buf[13]; + if (ESP_OK != err) + { + buf[8] = dummy[8]; + buf[9] = dummy[9]; + buf[10] = dummy[10]; + buf[11] = dummy[11]; + buf[12] = dummy[12]; + buf[13] = dummy[13]; + } + else + { + dummy[8] = buf[8]; + dummy[9] = buf[9]; + dummy[10] = buf[10]; + dummy[11] = buf[11]; + dummy[12] = buf[12]; + dummy[13] = buf[13]; + } + calibrationData[0] += (float)((int16_t)(buf[8] << 8 | buf[9])); // mean_raw_gx = 67 & 68; + calibrationData[1] += (float)((int16_t)(buf[10] << 8 | buf[11])); // mean_raw_gy = 69 & 70; + calibrationData[2] += (float)((int16_t)(buf[12] << 8 | buf[13])); // mean_raw_gz = 71 & 72; } - calibrationData[0] += (float)((int16_t)(buf[8] << 8 | buf[9])); // mean_raw_gx = 67 & 68; - calibrationData[1] += (float)((int16_t)(buf[10] << 8 | buf[11])); // mean_raw_gy = 69 & 70; - calibrationData[2] += (float)((int16_t)(buf[12] << 8 | buf[13])); // mean_raw_gz = 71 & 72; + } + else + { + TRACE_E("Data not ready ... [%d]", i); } } - else - { - TRACE_E("Data not ready ... [%d]", i); - } - } - user_data->gyro_x_offset = calibrationData[0] / (CALIBRATION_SAMPLES); - user_data->gyro_y_offset = calibrationData[1] / (CALIBRATION_SAMPLES); - user_data->gyro_z_offset = calibrationData[2] / (CALIBRATION_SAMPLES); + user_data->gyro_x_offset = calibrationData[0] / (CALIBRATION_SAMPLES); + user_data->gyro_y_offset = calibrationData[1] / (CALIBRATION_SAMPLES); + user_data->gyro_z_offset = calibrationData[2] / (CALIBRATION_SAMPLES); - TRACE_S("Scale :--- new_gy_offset_X=%.2f | new_gy_offset_Y=%.2f | new_gy_offset_Z=%.2f ", - user_data->gyro_x_offset, - user_data->gyro_y_offset, - user_data->gyro_z_offset); - TRACE_W("......................CALIBRATION COMPLETE"); - user_data->calibration_complete = true; + TRACE_S("Scale :--- new_gy_offset_X=%.2f | new_gy_offset_Y=%.2f | new_gy_offset_Z=%.2f ", + user_data->gyro_x_offset, + user_data->gyro_y_offset, + user_data->gyro_z_offset); + TRACE_W("......................CALIBRATION COMPLETE"); + user_data->calibration_complete = true; + } } vTaskDelete(NULL); } diff --git a/ezlopi-sensors-devices/sensor-0006-I2C-ADXL345/sensor_0006_I2C_ADXL345.c b/ezlopi-sensors-devices/sensor-0006-I2C-ADXL345/sensor_0006_I2C_ADXL345.c index 914e468df..56f4f1142 100644 --- a/ezlopi-sensors-devices/sensor-0006-I2C-ADXL345/sensor_0006_I2C_ADXL345.c +++ b/ezlopi-sensors-devices/sensor-0006-I2C-ADXL345/sensor_0006_I2C_ADXL345.c @@ -166,23 +166,30 @@ static int __init(l_ezlopi_item_t *item) int ret = 0; if (item) { - if (item->interface.i2c_master.enable) + s_adxl345_data_t *user_data = (s_adxl345_data_t *)item->user_arg; + if (user_data) { - ezlopi_i2c_master_init(&item->interface.i2c_master); - if (0 == __adxl345_configure_device(item)) + if (item->interface.i2c_master.enable) { - TRACE_S("Configuration Complete..."); + ezlopi_i2c_master_init(&item->interface.i2c_master); + if (0 == __adxl345_configure_device(item)) // ESP_OK + { + TRACE_S("Configuration Complete..."); + ret = 1; + } + else + { + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); + } } - ret = 1; } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } @@ -192,36 +199,51 @@ static int __init(l_ezlopi_item_t *item) static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) { int ret = 0; - cJSON *cj_result = (cJSON *)arg; - if (cj_result && item) + if (item && arg) { - float acceleration_value; - s_adxl345_data_t *user_data = (s_adxl345_data_t *)item->user_arg; - if (ezlopi_item_name_acceleration_x_axis == item->cloud_properties.item_name) + cJSON *cj_result = (cJSON *)arg; + if (cj_result) { - acceleration_value = (user_data->acc_x * ADXL345_CONVERTER_FACTOR_MG_TO_G * ADXL345_STANDARD_G_TO_ACCEL_CONVERSION_VALUE); - cJSON_AddNumberToObject(cj_result, "value", acceleration_value); - char *valueFormatted = ezlopi_valueformatter_float(acceleration_value); - cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); - free(valueFormatted); - } - if (ezlopi_item_name_acceleration_y_axis == item->cloud_properties.item_name) - { - acceleration_value = (user_data->acc_y * ADXL345_CONVERTER_FACTOR_MG_TO_G * ADXL345_STANDARD_G_TO_ACCEL_CONVERSION_VALUE); - cJSON_AddNumberToObject(cj_result, "value", acceleration_value); - char *valueFormatted = ezlopi_valueformatter_float(acceleration_value); - cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); - free(valueFormatted); - } - if (ezlopi_item_name_acceleration_z_axis == item->cloud_properties.item_name) - { - acceleration_value = (user_data->acc_z * ADXL345_CONVERTER_FACTOR_MG_TO_G * ADXL345_STANDARD_G_TO_ACCEL_CONVERSION_VALUE); - cJSON_AddNumberToObject(cj_result, "value", acceleration_value); - char *valueFormatted = ezlopi_valueformatter_float(acceleration_value); - cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); - free(valueFormatted); + float acceleration_value = 0; + s_adxl345_data_t *user_data = (s_adxl345_data_t *)item->user_arg; + if (user_data) + { + if (ezlopi_item_name_acceleration_x_axis == item->cloud_properties.item_name) + { + acceleration_value = (user_data->acc_x * ADXL345_CONVERTER_FACTOR_MG_TO_G * ADXL345_STANDARD_G_TO_ACCEL_CONVERSION_VALUE); + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, acceleration_value); + char *valueFormatted = ezlopi_valueformatter_float(acceleration_value); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueformatted_str, valueFormatted); + free(valueFormatted); + } + } + if (ezlopi_item_name_acceleration_y_axis == item->cloud_properties.item_name) + { + acceleration_value = (user_data->acc_y * ADXL345_CONVERTER_FACTOR_MG_TO_G * ADXL345_STANDARD_G_TO_ACCEL_CONVERSION_VALUE); + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, acceleration_value); + char *valueFormatted = ezlopi_valueformatter_float(acceleration_value); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueformatted_str, valueFormatted); + free(valueFormatted); + } + } + if (ezlopi_item_name_acceleration_z_axis == item->cloud_properties.item_name) + { + acceleration_value = (user_data->acc_z * ADXL345_CONVERTER_FACTOR_MG_TO_G * ADXL345_STANDARD_G_TO_ACCEL_CONVERSION_VALUE); + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, acceleration_value); + char *valueFormatted = ezlopi_valueformatter_float(acceleration_value); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueformatted_str, valueFormatted); + free(valueFormatted); + } + } + ret = 1; + } } - ret = 1; } return ret; } @@ -233,29 +255,32 @@ static int __notify(l_ezlopi_item_t *item) if (item) { s_adxl345_data_t *user_data = (s_adxl345_data_t *)item->user_arg; - if (ezlopi_item_name_acceleration_x_axis == item->cloud_properties.item_name) + if (user_data) { - __prev[0] = user_data->acc_x; - __adxl345_get_axis_value(item); - if (fabs((__prev[0] - user_data->acc_x) > 0.5)) + if (ezlopi_item_name_acceleration_x_axis == item->cloud_properties.item_name) { - ezlopi_device_value_updated_from_device_v3(item); + __prev[0] = user_data->acc_x; + __adxl345_get_axis_value(item); + if (fabs((__prev[0] - user_data->acc_x) > 0.5)) + { + ezlopi_device_value_updated_from_device_v3(item); + } } - } - if (ezlopi_item_name_acceleration_y_axis == item->cloud_properties.item_name) - { - __prev[1] = user_data->acc_y; - if (fabs((__prev[1] - user_data->acc_x) > 0.5)) + if (ezlopi_item_name_acceleration_y_axis == item->cloud_properties.item_name) { - ezlopi_device_value_updated_from_device_v3(item); + __prev[1] = user_data->acc_y; + if (fabs((__prev[1] - user_data->acc_x) > 0.5)) + { + ezlopi_device_value_updated_from_device_v3(item); + } } - } - if (ezlopi_item_name_acceleration_z_axis == item->cloud_properties.item_name) - { - __prev[2] = user_data->acc_z; - if (fabs((__prev[2] - user_data->acc_x) > 0.5)) + if (ezlopi_item_name_acceleration_z_axis == item->cloud_properties.item_name) { - ezlopi_device_value_updated_from_device_v3(item); + __prev[2] = user_data->acc_z; + if (fabs((__prev[2] - user_data->acc_x) > 0.5)) + { + ezlopi_device_value_updated_from_device_v3(item); + } } } ret = 1; diff --git a/ezlopi-sensors-devices/sensor-0007-I2C-GY271/sensor_0007_I2C_GY271.c b/ezlopi-sensors-devices/sensor-0007-I2C-GY271/sensor_0007_I2C_GY271.c index 7a311073b..d3ca2892e 100644 --- a/ezlopi-sensors-devices/sensor-0007-I2C-GY271/sensor_0007_I2C_GY271.c +++ b/ezlopi-sensors-devices/sensor-0007-I2C-GY271/sensor_0007_I2C_GY271.c @@ -15,16 +15,16 @@ #include "sensor_0007_I2C_GY271.h" //------------------------------------------------------------------------------------------------------------------------------------------------------------ -static int __prepare(void* arg); -static int __init(l_ezlopi_item_t* item); -static int __get_cjson_value(l_ezlopi_item_t* item, void* arg); -static int __notify(l_ezlopi_item_t* item); +static int __prepare(void *arg); +static int __init(l_ezlopi_item_t *item); +static int __get_cjson_value(l_ezlopi_item_t *item, void *arg); +static int __notify(l_ezlopi_item_t *item); // static void __prepare_device_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device); -static void __prepare_item_cloud_properties(l_ezlopi_item_t* item, void* user_data); -static void __prepare_item_interface_properties(l_ezlopi_item_t* item, cJSON* cj_device); -static void __gy271_calibration_task(void* params); +static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, void *user_data); +static void __prepare_item_interface_properties(l_ezlopi_item_t *item, cJSON *cj_device); +static void __gy271_calibration_task(void *params); //------------------------------------------------------------------------------------------------------------------------------------------------------------ -int sensor_0007_I2C_GY271(e_ezlopi_actions_t action, l_ezlopi_item_t* item, void* arg, void* user_arg) +int sensor_0007_I2C_GY271(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void *arg, void *user_arg) { int ret = 0; switch (action) @@ -58,9 +58,9 @@ int sensor_0007_I2C_GY271(e_ezlopi_actions_t action, l_ezlopi_item_t* item, void return ret; } //------------------------------------------------------------------------------------------------------------------------------------------------------------ -static void __prepare_device_cloud_properties_parent_x(l_ezlopi_device_t* device, cJSON* cj_device) +static void __prepare_device_cloud_properties_parent_x(l_ezlopi_device_t *device, cJSON *cj_device) { - char* device_name = NULL; + char *device_name = NULL; CJSON_GET_VALUE_STRING(cj_device, "dev_name", device_name); char device_full_name[50]; snprintf(device_full_name, 50, "%s_%s", device_name, "Mag_strength_x"); @@ -73,9 +73,9 @@ static void __prepare_device_cloud_properties_parent_x(l_ezlopi_device_t* device device->cloud_properties.device_type_id = NULL; } -static void __prepare_device_cloud_properties_child_y(l_ezlopi_device_t* device, cJSON* cj_device) +static void __prepare_device_cloud_properties_child_y(l_ezlopi_device_t *device, cJSON *cj_device) { - char* device_name = NULL; + char *device_name = NULL; CJSON_GET_VALUE_STRING(cj_device, "dev_name", device_name); char device_full_name[50]; snprintf(device_full_name, 50, "%s_%s", device_name, "Mag_strength_y"); @@ -88,9 +88,9 @@ static void __prepare_device_cloud_properties_child_y(l_ezlopi_device_t* device, device->cloud_properties.device_type_id = NULL; } -static void __prepare_device_cloud_properties_child_z(l_ezlopi_device_t* device, cJSON* cj_device) +static void __prepare_device_cloud_properties_child_z(l_ezlopi_device_t *device, cJSON *cj_device) { - char* device_name = NULL; + char *device_name = NULL; CJSON_GET_VALUE_STRING(cj_device, "dev_name", device_name); char device_full_name[50]; snprintf(device_full_name, 50, "%s_%s", device_name, "Mag_strength_z"); @@ -103,9 +103,9 @@ static void __prepare_device_cloud_properties_child_z(l_ezlopi_device_t* device, device->cloud_properties.device_type_id = NULL; } -static void __prepare_device_cloud_properties_child_azi(l_ezlopi_device_t* device, cJSON* cj_device) +static void __prepare_device_cloud_properties_child_azi(l_ezlopi_device_t *device, cJSON *cj_device) { - char* device_name = NULL; + char *device_name = NULL; CJSON_GET_VALUE_STRING(cj_device, "dev_name", device_name); char device_full_name[50]; snprintf(device_full_name, 50, "%s_%s", device_name, "Azimuth Angle"); @@ -118,9 +118,9 @@ static void __prepare_device_cloud_properties_child_azi(l_ezlopi_device_t* devic device->cloud_properties.device_type_id = NULL; } -static void __prepare_device_cloud_properties_child_temp(l_ezlopi_device_t* device, cJSON* cj_device) +static void __prepare_device_cloud_properties_child_temp(l_ezlopi_device_t *device, cJSON *cj_device) { - char* device_name = NULL; + char *device_name = NULL; CJSON_GET_VALUE_STRING(cj_device, "dev_name", device_name); char device_full_name[50]; snprintf(device_full_name, 50, "%s_%s", device_name, "Temperature"); @@ -133,7 +133,7 @@ static void __prepare_device_cloud_properties_child_temp(l_ezlopi_device_t* devi device->cloud_properties.device_type_id = NULL; } -static void __prepare_item_cloud_properties(l_ezlopi_item_t* item, void* user_data) +static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, void *user_data) { if (item) { @@ -144,7 +144,7 @@ static void __prepare_item_cloud_properties(l_ezlopi_item_t* item, void* user_da item->user_arg = user_data; } } -static void __prepare_item_interface_properties(l_ezlopi_item_t* item, cJSON* cj_device) +static void __prepare_item_interface_properties(l_ezlopi_item_t *item, cJSON *cj_device) { if (item && cj_device) { @@ -169,22 +169,22 @@ static void __prepare_item_interface_properties(l_ezlopi_item_t* item, cJSON* cj } } -static int __prepare(void* arg) +static int __prepare(void *arg) { int ret = 0; - s_ezlopi_prep_arg_t* prep_arg = (s_ezlopi_prep_arg_t*)arg; + s_ezlopi_prep_arg_t *prep_arg = (s_ezlopi_prep_arg_t *)arg; if (prep_arg && prep_arg->cjson_device) { - cJSON* cj_device = prep_arg->cjson_device; - s_gy271_data_t* user_data = (s_gy271_data_t*)malloc(sizeof(s_gy271_data_t)); - if (NULL != user_data) + cJSON *cj_device = prep_arg->cjson_device; + s_gy271_data_t *user_data = (s_gy271_data_t *)malloc(sizeof(s_gy271_data_t)); + if (user_data) { memset(user_data, 0, sizeof(s_gy271_data_t)); - l_ezlopi_device_t* gy271_device_parent_x_device = ezlopi_device_add_device(cj_device); + l_ezlopi_device_t *gy271_device_parent_x_device = ezlopi_device_add_device(cj_device); if (gy271_device_parent_x_device) { __prepare_device_cloud_properties_parent_x(gy271_device_parent_x_device, cj_device); - l_ezlopi_item_t* gyro_x_item = ezlopi_device_add_item_to_device(gy271_device_parent_x_device, sensor_0007_I2C_GY271); + l_ezlopi_item_t *gyro_x_item = ezlopi_device_add_item_to_device(gy271_device_parent_x_device, sensor_0007_I2C_GY271); if (gyro_x_item) { __prepare_item_cloud_properties(gyro_x_item, user_data); @@ -194,12 +194,12 @@ static int __prepare(void* arg) gyro_x_item->cloud_properties.scale = scales_guass; __prepare_item_interface_properties(gyro_x_item, cj_device); } - l_ezlopi_device_t* gy271_device_child_y_device = ezlopi_device_add_device(cj_device); + l_ezlopi_device_t *gy271_device_child_y_device = ezlopi_device_add_device(cj_device); if (gy271_device_child_y_device) { __prepare_device_cloud_properties_child_y(gy271_device_child_y_device, cj_device); gy271_device_child_y_device->cloud_properties.parent_device_id = gy271_device_parent_x_device->cloud_properties.device_id; // assigning parent_device_id to child_device - l_ezlopi_item_t* gyro_y_item = ezlopi_device_add_item_to_device(gy271_device_child_y_device, sensor_0007_I2C_GY271); + l_ezlopi_item_t *gyro_y_item = ezlopi_device_add_item_to_device(gy271_device_child_y_device, sensor_0007_I2C_GY271); if (gyro_y_item) { __prepare_item_cloud_properties(gyro_y_item, user_data); @@ -211,12 +211,12 @@ static int __prepare(void* arg) } } - l_ezlopi_device_t* gy271_device_child_z_device = ezlopi_device_add_device(cj_device); + l_ezlopi_device_t *gy271_device_child_z_device = ezlopi_device_add_device(cj_device); if (gy271_device_child_z_device) { __prepare_device_cloud_properties_child_z(gy271_device_child_z_device, cj_device); gy271_device_child_z_device->cloud_properties.parent_device_id = gy271_device_parent_x_device->cloud_properties.device_id; // assigning parent_device_id to child_device - l_ezlopi_item_t* gyro_z_item = ezlopi_device_add_item_to_device(gy271_device_child_z_device, sensor_0007_I2C_GY271); + l_ezlopi_item_t *gyro_z_item = ezlopi_device_add_item_to_device(gy271_device_child_z_device, sensor_0007_I2C_GY271); if (gyro_z_item) { __prepare_item_cloud_properties(gyro_z_item, user_data); @@ -227,12 +227,12 @@ static int __prepare(void* arg) __prepare_item_interface_properties(gyro_z_item, cj_device); } } - l_ezlopi_device_t* gy271_device_child_azi_device = ezlopi_device_add_device(cj_device); + l_ezlopi_device_t *gy271_device_child_azi_device = ezlopi_device_add_device(cj_device); if (gy271_device_child_azi_device) { __prepare_device_cloud_properties_child_azi(gy271_device_child_azi_device, cj_device); gy271_device_child_azi_device->cloud_properties.parent_device_id = gy271_device_parent_x_device->cloud_properties.device_id; // assigning parent_device_id to child_device - l_ezlopi_item_t* gyro_azi_item = ezlopi_device_add_item_to_device(gy271_device_child_azi_device, sensor_0007_I2C_GY271); + l_ezlopi_item_t *gyro_azi_item = ezlopi_device_add_item_to_device(gy271_device_child_azi_device, sensor_0007_I2C_GY271); if (gyro_azi_item) { __prepare_item_cloud_properties(gyro_azi_item, user_data); @@ -243,12 +243,12 @@ static int __prepare(void* arg) __prepare_item_interface_properties(gyro_azi_item, cj_device); } } - l_ezlopi_device_t* gy271_device_child_temp_device = ezlopi_device_add_device(cj_device); + l_ezlopi_device_t *gy271_device_child_temp_device = ezlopi_device_add_device(cj_device); if (gy271_device_child_temp_device) { __prepare_device_cloud_properties_child_temp(gy271_device_child_temp_device, cj_device); gy271_device_child_temp_device->cloud_properties.parent_device_id = gy271_device_parent_x_device->cloud_properties.device_id; // assigning parent_device_id to child_device - l_ezlopi_item_t* gyro_temp_item = ezlopi_device_add_item_to_device(gy271_device_child_temp_device, sensor_0007_I2C_GY271); + l_ezlopi_item_t *gyro_temp_item = ezlopi_device_add_item_to_device(gy271_device_child_temp_device, sensor_0007_I2C_GY271); if (gyro_temp_item) { __prepare_item_cloud_properties(gyro_temp_item, user_data); @@ -272,108 +272,119 @@ static int __prepare(void* arg) return ret; } -static int __init(l_ezlopi_item_t* item) +static int __init(l_ezlopi_item_t *item) { int ret = 0; - if (item) { - if (item->interface.i2c_master.enable) + s_gy271_data_t *user_data = (s_gy271_data_t *)item->user_arg; + if (user_data) { - ezlopi_i2c_master_init(&item->interface.i2c_master); - TRACE_I("I2C initialized to channel %d", item->interface.i2c_master.channel); - if (0 == __gy271_configure(item)) + if (item->interface.i2c_master.enable) { - TRACE_S(" CONFIGURATION Compplete _____ Calibration Started _____"); - xTaskCreate(__gy271_calibration_task, "GY271_Calibration_Task", 2 * 2048, item, 1, NULL); + ezlopi_i2c_master_init(&item->interface.i2c_master); + TRACE_I("I2C initialized to channel %d", item->interface.i2c_master.channel); + if (0 == __gy271_configure(item)) // ESP_OK + { + // TRACE_D(" CONFIGURATION Compplete _____ Calibration Started _____"); + xTaskCreate(__gy271_calibration_task, "GY271_Calibration_Task", 2 * 2048, item, 1, NULL); + ret = 1; + } + else + { + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); + } } - ret = 1; } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } return ret; } -static int __get_cjson_value(l_ezlopi_item_t* item, void* arg) +static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) { int ret = 0; - cJSON* cj_result = (cJSON*)arg; - if (cj_result && item) + if (item && arg) { - s_gy271_data_t* user_data = (s_gy271_data_t*)item->user_arg; - - if (ezlopi_item_name_magnetic_strength_x_axis == item->cloud_properties.item_name) + cJSON *cj_result = (cJSON *)arg; + if (cj_result) { - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, user_data->X); - char* valueFormatted = ezlopi_valueformatter_float(user_data->X); - if (valueFormatted) + s_gy271_data_t *user_data = (s_gy271_data_t *)item->user_arg; + if (user_data) { - cJSON_AddStringToObject(cj_result, ezlopi_valueformatted_str, valueFormatted); - free(valueFormatted); - } - } - if (ezlopi_item_name_magnetic_strength_y_axis == item->cloud_properties.item_name) - { - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, user_data->Y); - char* valueFormatted = ezlopi_valueformatter_float(user_data->Y); - if (valueFormatted) - { - cJSON_AddStringToObject(cj_result, ezlopi_valueformatted_str, valueFormatted); - free(valueFormatted); - } - } - if (ezlopi_item_name_magnetic_strength_z_axis == item->cloud_properties.item_name) - { - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, user_data->Z); - char* valueFormatted = ezlopi_valueformatter_float(user_data->Z); - if (valueFormatted) - { - cJSON_AddStringToObject(cj_result, ezlopi_valueformatted_str, valueFormatted); - free(valueFormatted); - } - } - if (ezlopi_item_name_angle_position == item->cloud_properties.item_name) - { + if (ezlopi_item_name_magnetic_strength_x_axis == item->cloud_properties.item_name) + { + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, user_data->X); + char *valueFormatted = ezlopi_valueformatter_float(user_data->X); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueformatted_str, valueFormatted); + free(valueFormatted); + } + } + if (ezlopi_item_name_magnetic_strength_y_axis == item->cloud_properties.item_name) + { + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, user_data->Y); + char *valueFormatted = ezlopi_valueformatter_float(user_data->Y); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueformatted_str, valueFormatted); + free(valueFormatted); + } + } + if (ezlopi_item_name_magnetic_strength_z_axis == item->cloud_properties.item_name) + { + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, user_data->Z); + char *valueFormatted = ezlopi_valueformatter_float(user_data->Z); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueformatted_str, valueFormatted); + free(valueFormatted); + } + } + if (ezlopi_item_name_angle_position == item->cloud_properties.item_name) + { - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, (user_data->azimuth)); - char* valueFormatted = ezlopi_valueformatter_int(user_data->azimuth); - if (valueFormatted) - { - cJSON_AddStringToObject(cj_result, ezlopi_valueformatted_str, valueFormatted); - free(valueFormatted); - } - } + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, (user_data->azimuth)); + char *valueFormatted = ezlopi_valueformatter_int(user_data->azimuth); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueformatted_str, valueFormatted); + free(valueFormatted); + } + } - if (ezlopi_item_name_temp == item->cloud_properties.item_name) - { - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, user_data->T); - char* valueFormatted = ezlopi_valueformatter_float(user_data->T); - if (valueFormatted) - { - cJSON_AddStringToObject(cj_result, ezlopi_valueformatted_str, valueFormatted); - free(valueFormatted); + if (ezlopi_item_name_temp == item->cloud_properties.item_name) + { + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, user_data->T); + char *valueFormatted = ezlopi_valueformatter_float(user_data->T); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueformatted_str, valueFormatted); + free(valueFormatted); + } + } } + ret = 1; } - ret = 1; } return ret; } -static int __notify(l_ezlopi_item_t* item) +static int __notify(l_ezlopi_item_t *item) { - static float __prev[5] = { 0 }; + static float __prev[5] = {0}; int ret = 0; if (item) { - s_gy271_data_t* user_data = (s_gy271_data_t*)item->user_arg; + s_gy271_data_t *user_data = (s_gy271_data_t *)item->user_arg; if (user_data->calibration_complete) { if (ezlopi_item_name_magnetic_strength_x_axis == item->cloud_properties.item_name) @@ -426,63 +437,65 @@ static int __notify(l_ezlopi_item_t* item) return ret; } -static void __gy271_calibration_task(void* params) // calibrate task +static void __gy271_calibration_task(void *params) // calibrate task { vTaskDelay(4000 / portTICK_PERIOD_MS); - l_ezlopi_item_t* item = (l_ezlopi_item_t*)params; + l_ezlopi_item_t *item = (l_ezlopi_item_t *)params; if (item) { - int calibrationData[3][2] = { {0, 0}, // xmin,xmax + int calibrationData[3][2] = {{0, 0}, // xmin,xmax {0, 0}, // ymin,ymax - {0, 0} }; // zmin,zmax// Initialization added! - s_gy271_data_t* user_data = (s_gy271_data_t*)item->user_arg; - - for (uint16_t i = 0; i <= 50; i++) + {0, 0}}; // zmin,zmax// Initialization added! + s_gy271_data_t *user_data = (s_gy271_data_t *)item->user_arg; + if (user_data) { - __gy271_get_raw_max_min_values(item, calibrationData); - vTaskDelay(200 / portTICK_PERIOD_MS); - } + for (uint16_t i = 0; i <= 50; i++) + { + __gy271_get_raw_max_min_values(item, calibrationData); + vTaskDelay(200 / portTICK_PERIOD_MS); + } - TRACE_W(".....................Calculating Paramter......................."); - // Calculate the : 1.bias_axis , 2.delta_axis , 3.delta_avg , 4.scale_axis - // 1. bias_axis{x,y,z} - user_data->calib_factor.bias_axis[0] = ((long)(calibrationData[0][1] + calibrationData[0][0]) / 2); // x-axis - user_data->calib_factor.bias_axis[1] = ((long)(calibrationData[1][1] + calibrationData[1][0]) / 2); // y-axis - user_data->calib_factor.bias_axis[2] = ((long)(calibrationData[2][1] + calibrationData[2][0]) / 2); // z-axis + TRACE_W(".....................Calculating Paramter......................."); + // Calculate the : 1.bias_axis , 2.delta_axis , 3.delta_avg , 4.scale_axis + // 1. bias_axis{x,y,z} + user_data->calib_factor.bias_axis[0] = ((long)(calibrationData[0][1] + calibrationData[0][0]) / 2); // x-axis + user_data->calib_factor.bias_axis[1] = ((long)(calibrationData[1][1] + calibrationData[1][0]) / 2); // y-axis + user_data->calib_factor.bias_axis[2] = ((long)(calibrationData[2][1] + calibrationData[2][0]) / 2); // z-axis - // 2. delta_axis{x,y,z} - user_data->calib_factor.delta_axis[0] = (long)(calibrationData[0][1] - calibrationData[0][0]); // x-axis - user_data->calib_factor.delta_axis[1] = (long)(calibrationData[1][1] - calibrationData[1][0]); // y-axis - user_data->calib_factor.delta_axis[2] = (long)(calibrationData[2][1] - calibrationData[2][0]); // z-axis + // 2. delta_axis{x,y,z} + user_data->calib_factor.delta_axis[0] = (long)(calibrationData[0][1] - calibrationData[0][0]); // x-axis + user_data->calib_factor.delta_axis[1] = (long)(calibrationData[1][1] - calibrationData[1][0]); // y-axis + user_data->calib_factor.delta_axis[2] = (long)(calibrationData[2][1] - calibrationData[2][0]); // z-axis - // 3. delta_avg - user_data->calib_factor.delta_avg = ((float)((user_data->calib_factor.delta_axis[0]) + - (user_data->calib_factor.delta_axis[1]) + - (user_data->calib_factor.delta_axis[2])) / - 3.0f); + // 3. delta_avg + user_data->calib_factor.delta_avg = ((float)((user_data->calib_factor.delta_axis[0]) + + (user_data->calib_factor.delta_axis[1]) + + (user_data->calib_factor.delta_axis[2])) / + 3.0f); - // 4. Scale_axis{x,y,z} - user_data->calib_factor.scale_axis[0] = user_data->calib_factor.delta_avg / user_data->calib_factor.delta_axis[0]; // x-axis - user_data->calib_factor.scale_axis[1] = user_data->calib_factor.delta_avg / user_data->calib_factor.delta_axis[1]; // y-axis - user_data->calib_factor.scale_axis[2] = user_data->calib_factor.delta_avg / user_data->calib_factor.delta_axis[2]; // z-axis + // 4. Scale_axis{x,y,z} + user_data->calib_factor.scale_axis[0] = user_data->calib_factor.delta_avg / user_data->calib_factor.delta_axis[0]; // x-axis + user_data->calib_factor.scale_axis[1] = user_data->calib_factor.delta_avg / user_data->calib_factor.delta_axis[1]; // y-axis + user_data->calib_factor.scale_axis[2] = user_data->calib_factor.delta_avg / user_data->calib_factor.delta_axis[2]; // z-axis - TRACE_I("Bias :--- _Xaxis=%6ld | _Yaxis=%6ld | _Zaxis=%6ld ", - user_data->calib_factor.bias_axis[0], - user_data->calib_factor.bias_axis[1], - user_data->calib_factor.bias_axis[2]); + TRACE_I("Bias :--- _Xaxis=%6ld | _Yaxis=%6ld | _Zaxis=%6ld ", + user_data->calib_factor.bias_axis[0], + user_data->calib_factor.bias_axis[1], + user_data->calib_factor.bias_axis[2]); - TRACE_I("Delta :--- _Xaxis=%6ld | _Yaxis=%6ld | _Zaxis=%6ld ", - user_data->calib_factor.delta_axis[0], - user_data->calib_factor.delta_axis[1], - user_data->calib_factor.delta_axis[2]); - TRACE_I("Delta_AVG :--- %6f", user_data->calib_factor.delta_avg); + TRACE_I("Delta :--- _Xaxis=%6ld | _Yaxis=%6ld | _Zaxis=%6ld ", + user_data->calib_factor.delta_axis[0], + user_data->calib_factor.delta_axis[1], + user_data->calib_factor.delta_axis[2]); + TRACE_I("Delta_AVG :--- %6f", user_data->calib_factor.delta_avg); - TRACE_I("Scale :--- _Xaxis=%6f | _Yaxis=%6f | _Zaxis=%6f ", - user_data->calib_factor.scale_axis[0], - user_data->calib_factor.scale_axis[1], - user_data->calib_factor.scale_axis[0]); - TRACE_W("......................CALIBRATION COMPLETE....................."); - user_data->calibration_complete = true; + TRACE_I("Scale :--- _Xaxis=%6f | _Yaxis=%6f | _Zaxis=%6f ", + user_data->calib_factor.scale_axis[0], + user_data->calib_factor.scale_axis[1], + user_data->calib_factor.scale_axis[0]); + TRACE_W("......................CALIBRATION COMPLETE....................."); + user_data->calibration_complete = true; + } } vTaskDelete(NULL); } diff --git a/ezlopi-sensors-devices/sensor-0008-I2C-LTR303ALS/sensor_0008_I2C_LTR303ALS.c b/ezlopi-sensors-devices/sensor-0008-I2C-LTR303ALS/sensor_0008_I2C_LTR303ALS.c index 13e404ad8..adde0c854 100644 --- a/ezlopi-sensors-devices/sensor-0008-I2C-LTR303ALS/sensor_0008_I2C_LTR303ALS.c +++ b/ezlopi-sensors-devices/sensor-0008-I2C-LTR303ALS/sensor_0008_I2C_LTR303ALS.c @@ -60,34 +60,40 @@ int sensor_0008_I2C_LTR303ALS(e_ezlopi_actions_t action, l_ezlopi_item_t *item, static int __get_value_cjson(l_ezlopi_item_t *item, void *arg) { int ret = 0; - - cJSON *cj_param = (cJSON *)arg; - ltr303_data_t *als_ltr303_data = (ltr303_data_t *)item->user_arg; - if (cj_param && als_ltr303_data) + if (item) { - cJSON_AddNumberToObject(cj_param, ezlopi_value_str, als_ltr303_data->lux); - char *valueFormatted = ezlopi_valueformatter_double(als_ltr303_data->lux); - cJSON_AddStringToObject(cj_param, ezlopi_valueFormatted_str, valueFormatted); - free(valueFormatted); + cJSON *cj_param = (cJSON *)arg; + ltr303_data_t *als_ltr303_data = (ltr303_data_t *)item->user_arg; + if (cj_param && als_ltr303_data) + { + cJSON_AddNumberToObject(cj_param, ezlopi_value_str, als_ltr303_data->lux); + char *valueFormatted = ezlopi_valueformatter_double(als_ltr303_data->lux); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_param, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } } - return ret; } static int __notify(l_ezlopi_item_t *item) { int ret = 0; - - ltr303_data_t *als_ltr303_data = (ltr303_data_t *)item->user_arg; - if (als_ltr303_data) + if (item) { - ltr303_data_t temp_data; - if (ESP_OK == ltr303_get_val(&temp_data)) + ltr303_data_t *als_ltr303_data = (ltr303_data_t *)item->user_arg; + if (als_ltr303_data) { - if (fabs(als_ltr303_data->lux - temp_data.lux) > 0.2) + ltr303_data_t temp_data; + if (ESP_OK == ltr303_get_val(&temp_data)) { - als_ltr303_data->lux = temp_data.lux; - ezlopi_device_value_updated_from_device_v3(item); + if (fabs(als_ltr303_data->lux - temp_data.lux) > 0.2) + { + als_ltr303_data->lux = temp_data.lux; + ezlopi_device_value_updated_from_device_v3(item); + } } } } @@ -98,24 +104,31 @@ static int __notify(l_ezlopi_item_t *item) static int __init(l_ezlopi_item_t *item) { int ret = 0; - - ltr303_data_t *als_ltr303_data = (ltr303_data_t *)item->user_arg; if (item) { - if ((item->interface.i2c_master.enable) && (NULL != als_ltr303_data)) + ltr303_data_t *als_ltr303_data = (ltr303_data_t *)item->user_arg; + if (als_ltr303_data) { - ltr303_setup(item->interface.i2c_master.sda, item->interface.i2c_master.scl, true); - ltr303_get_val(als_ltr303_data); - ret = 1; + if (item->interface.i2c_master.enable) + { + if (ESP_OK == ltr303_setup(item->interface.i2c_master.sda, item->interface.i2c_master.scl, true)) + { + ltr303_get_val(als_ltr303_data); + ret = 1; + } + else + { + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); + } + } } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } diff --git a/ezlopi-sensors-devices/sensor-0010-I2C-BME680/sensor_0010_I2C_BME680.c b/ezlopi-sensors-devices/sensor-0010-I2C-BME680/sensor_0010_I2C_BME680.c index b3a288615..b591be093 100644 --- a/ezlopi-sensors-devices/sensor-0010-I2C-BME680/sensor_0010_I2C_BME680.c +++ b/ezlopi-sensors-devices/sensor-0010-I2C-BME680/sensor_0010_I2C_BME680.c @@ -232,20 +232,20 @@ static int __init(l_ezlopi_item_t *item) int ret = 0; if (item) { - if (true == item->interface.i2c_master.enable) + bme680_data_t *user_data = (bme680_data_t *)item->user_arg; + if (user_data) { - ezlopi_i2c_master_init(&item->interface.i2c_master); - bme680_setup(item->interface.i2c_master.sda, item->interface.i2c_master.scl, true); + if (item->interface.i2c_master.enable) + { + ezlopi_i2c_master_init(&item->interface.i2c_master); + bme680_setup(item->interface.i2c_master.sda, item->interface.i2c_master.scl, true); + ret = 1; + } } - ret = 1; - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } return ret; @@ -254,54 +254,77 @@ static int __init(l_ezlopi_item_t *item) static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) { int ret = 0; - cJSON *cj_device = (cJSON *)arg; - if (cj_device && item) + if (item && arg) { - bme680_data_t *user_data = (bme680_data_t *)item->user_arg; - if (ezlopi_item_name_temp == item->cloud_properties.item_name) - { - char *valueFormatted = ezlopi_valueformatter_float(user_data->temperature); - cJSON_AddStringToObject(cj_device, "valueFormatted", valueFormatted); - free(valueFormatted); - cJSON_AddNumberToObject(cj_device, "value", user_data->temperature); - } - if (ezlopi_item_name_humidity == item->cloud_properties.item_name) - { - char *valueFormatted = ezlopi_valueformatter_float(user_data->humidity); - cJSON_AddStringToObject(cj_device, "valueFormatted", valueFormatted); - free(valueFormatted); - cJSON_AddNumberToObject(cj_device, "value", user_data->humidity); - } - if (ezlopi_item_name_atmospheric_pressure == item->cloud_properties.item_name) - { - char *valueFormatted = ezlopi_valueformatter_float(user_data->pressure / 1000.0); - cJSON_AddStringToObject(cj_device, "valueFormatted", valueFormatted); - free(valueFormatted); - cJSON_AddNumberToObject(cj_device, "value", (user_data->pressure / 1000.0)); - } - if (ezlopi_item_name_volatile_organic_compound_level == item->cloud_properties.item_name) - { - char *valueFormatted = ezlopi_valueformatter_float(user_data->iaq); - cJSON_AddStringToObject(cj_device, "valueFormatted", valueFormatted); - free(valueFormatted); - cJSON_AddNumberToObject(cj_device, "value", (user_data->iaq)); - } - if (ezlopi_item_name_distance == item->cloud_properties.item_name) + cJSON *cj_device = (cJSON *)arg; + if (cj_device) { - char *valueFormatted = ezlopi_valueformatter_float(user_data->altitude); - cJSON_AddStringToObject(cj_device, "valueFormatted", valueFormatted); - free(valueFormatted); - cJSON_AddNumberToObject(cj_device, "value", (user_data->altitude)); - } - if (ezlopi_item_name_co2_level == item->cloud_properties.item_name) - { - char *valueFormatted = ezlopi_valueformatter_float(user_data->co2_equivalent); - cJSON_AddStringToObject(cj_device, "valueFormatted", valueFormatted); - free(valueFormatted); - cJSON_AddNumberToObject(cj_device, "value", (user_data->co2_equivalent)); + bme680_data_t *user_data = (bme680_data_t *)item->user_arg; + if (user_data) + { + if (ezlopi_item_name_temp == item->cloud_properties.item_name) + { + cJSON_AddNumberToObject(cj_device, ezlopi_value_str, user_data->temperature); + char *valueFormatted = ezlopi_valueformatter_float(user_data->temperature); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_device, ezlopi_valueformatted_str, valueFormatted); + free(valueFormatted); + } + } + else if (ezlopi_item_name_humidity == item->cloud_properties.item_name) + { + cJSON_AddNumberToObject(cj_device, ezlopi_value_str, user_data->humidity); + char *valueFormatted = ezlopi_valueformatter_float(user_data->humidity); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_device, ezlopi_valueformatted_str, valueFormatted); + free(valueFormatted); + } + } + else if (ezlopi_item_name_atmospheric_pressure == item->cloud_properties.item_name) + { + cJSON_AddNumberToObject(cj_device, ezlopi_value_str, (user_data->pressure / 1000.0)); + char *valueFormatted = ezlopi_valueformatter_float(user_data->pressure / 1000.0); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_device, ezlopi_valueformatted_str, valueFormatted); + free(valueFormatted); + } + } + else if (ezlopi_item_name_volatile_organic_compound_level == item->cloud_properties.item_name) + { + cJSON_AddNumberToObject(cj_device, ezlopi_value_str, (user_data->iaq)); + char *valueFormatted = ezlopi_valueformatter_float(user_data->iaq); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_device, ezlopi_valueformatted_str, valueFormatted); + free(valueFormatted); + } + } + else if (ezlopi_item_name_distance == item->cloud_properties.item_name) + { + cJSON_AddNumberToObject(cj_device, ezlopi_value_str, (user_data->altitude)); + char *valueFormatted = ezlopi_valueformatter_float(user_data->altitude); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_device, ezlopi_valueformatted_str, valueFormatted); + free(valueFormatted); + } + } + else if (ezlopi_item_name_co2_level == item->cloud_properties.item_name) + { + cJSON_AddNumberToObject(cj_device, ezlopi_value_str, (user_data->co2_equivalent)); + char *valueFormatted = ezlopi_valueformatter_float(user_data->co2_equivalent); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_device, ezlopi_valueformatted_str, valueFormatted); + free(valueFormatted); + } + } + } } } - return ret; } @@ -311,61 +334,64 @@ static int __notify(l_ezlopi_item_t *item) if (item) { bme680_data_t *user_data = (bme680_data_t *)item->user_arg; - float temperature = user_data->temperature; - float humidity = user_data->humidity; - float pressure = user_data->pressure; - float iaq = user_data->iaq; - float altitude = user_data->altitude; - float co2_eqv = user_data->co2_equivalent; + if (user_data) + { + float temperature = user_data->temperature; + float humidity = user_data->humidity; + float pressure = user_data->pressure; + float iaq = user_data->iaq; + float altitude = user_data->altitude; + float co2_eqv = user_data->co2_equivalent; - bme680_get_data(user_data); + bme680_get_data(user_data); - if (ezlopi_item_name_temp == item->cloud_properties.item_name) - { - if (fabs(user_data->temperature - temperature) > 0.05) + if (ezlopi_item_name_temp == item->cloud_properties.item_name) { - user_data->temperature = temperature; - ezlopi_device_value_updated_from_device_v3(item); + if (fabs(user_data->temperature - temperature) > 0.05) + { + user_data->temperature = temperature; + ezlopi_device_value_updated_from_device_v3(item); + } } - } - if (ezlopi_item_name_humidity == item->cloud_properties.item_name) - { - if (fabs(user_data->humidity - humidity) > 0.05) + if (ezlopi_item_name_humidity == item->cloud_properties.item_name) { - user_data->humidity = humidity; - ezlopi_device_value_updated_from_device_v3(item); + if (fabs(user_data->humidity - humidity) > 0.05) + { + user_data->humidity = humidity; + ezlopi_device_value_updated_from_device_v3(item); + } } - } - if (ezlopi_item_name_atmospheric_pressure == item->cloud_properties.item_name) - { - if (fabs((user_data->pressure / 1000.0f) - (pressure / 1000.0f)) > 0.05) + if (ezlopi_item_name_atmospheric_pressure == item->cloud_properties.item_name) { - user_data->pressure = pressure; - ezlopi_device_value_updated_from_device_v3(item); + if (fabs((user_data->pressure / 1000.0f) - (pressure / 1000.0f)) > 0.05) + { + user_data->pressure = pressure; + ezlopi_device_value_updated_from_device_v3(item); + } } - } - if (ezlopi_item_name_volatile_organic_compound_level == item->cloud_properties.item_name) - { - if (fabs(user_data->iaq - iaq) > 0.05) + if (ezlopi_item_name_volatile_organic_compound_level == item->cloud_properties.item_name) { - user_data->iaq = iaq; - ezlopi_device_value_updated_from_device_v3(item); + if (fabs(user_data->iaq - iaq) > 0.05) + { + user_data->iaq = iaq; + ezlopi_device_value_updated_from_device_v3(item); + } } - } - if (ezlopi_item_name_distance == item->cloud_properties.item_name) - { - if (fabs(user_data->altitude - altitude) > 0.05) + if (ezlopi_item_name_distance == item->cloud_properties.item_name) { - user_data->altitude = altitude; - ezlopi_device_value_updated_from_device_v3(item); + if (fabs(user_data->altitude - altitude) > 0.05) + { + user_data->altitude = altitude; + ezlopi_device_value_updated_from_device_v3(item); + } } - } - if (ezlopi_item_name_co2_level == item->cloud_properties.item_name) - { - if (fabs(user_data->co2_equivalent - co2_eqv) > 0.05) + if (ezlopi_item_name_co2_level == item->cloud_properties.item_name) { - user_data->co2_equivalent = co2_eqv; - ezlopi_device_value_updated_from_device_v3(item); + if (fabs(user_data->co2_equivalent - co2_eqv) > 0.05) + { + user_data->co2_equivalent = co2_eqv; + ezlopi_device_value_updated_from_device_v3(item); + } } } } diff --git a/ezlopi-sensors-devices/sensor-0012-I2C-BME280/sensor_0012_I2C_BME280.c b/ezlopi-sensors-devices/sensor-0012-I2C-BME280/sensor_0012_I2C_BME280.c index f8c650f68..c42606b40 100644 --- a/ezlopi-sensors-devices/sensor-0012-I2C-BME280/sensor_0012_I2C_BME280.c +++ b/ezlopi-sensors-devices/sensor-0012-I2C-BME280/sensor_0012_I2C_BME280.c @@ -93,32 +93,37 @@ static bool check_double_val_equal(double first, double second) static int __notify(l_ezlopi_item_t *item) { int ret = 0; - - s_ezlopi_bmp280_t *sensor_params = (s_ezlopi_bmp280_t *)item->user_arg; - float temperature, pressure, humidity; - bool update_cloud = false; - bmp280_read_float(&item->interface.i2c_master, &sensor_params->bmp280_dev, &temperature, &pressure, &humidity); - // TRACE_I("Temp: %f, Humidity: %f, pressure: %f", temperature, humidity, pressure); - - if (ezlopi_item_name_temp == item->cloud_properties.item_name) - { - update_cloud = (!check_double_val_equal(sensor_params->temperature, temperature) ? true : false); - } - if (ezlopi_item_name_humidity == item->cloud_properties.item_name) - { - update_cloud = (!check_double_val_equal(sensor_params->humidity, humidity) ? true : false); - } - if (ezlopi_item_name_atmospheric_pressure == item->cloud_properties.item_name) - { - update_cloud = (!check_double_val_equal(sensor_params->pressure, pressure) ? true : false); - } - if (update_cloud) + if (item) { - sensor_params->temperature = temperature; - sensor_params->humidity = humidity; - sensor_params->pressure = pressure; - ezlopi_device_value_updated_from_device_v3(item); - update_cloud = false; + s_ezlopi_bmp280_t *sensor_params = (s_ezlopi_bmp280_t *)item->user_arg; + if (sensor_params) + { + float temperature, pressure, humidity; + bool update_cloud = false; + bmp280_read_float(&item->interface.i2c_master, &sensor_params->bmp280_dev, &temperature, &pressure, &humidity); + // TRACE_I("Temp: %f, Humidity: %f, pressure: %f", temperature, humidity, pressure); + + if (ezlopi_item_name_temp == item->cloud_properties.item_name) + { + update_cloud = (!check_double_val_equal(sensor_params->temperature, temperature) ? true : false); + } + if (ezlopi_item_name_humidity == item->cloud_properties.item_name) + { + update_cloud = (!check_double_val_equal(sensor_params->humidity, humidity) ? true : false); + } + if (ezlopi_item_name_atmospheric_pressure == item->cloud_properties.item_name) + { + update_cloud = (!check_double_val_equal(sensor_params->pressure, pressure) ? true : false); + } + if (update_cloud) + { + sensor_params->temperature = temperature; + sensor_params->humidity = humidity; + sensor_params->pressure = pressure; + ezlopi_device_value_updated_from_device_v3(item); + update_cloud = false; + } + } } return ret; @@ -127,37 +132,49 @@ static int __notify(l_ezlopi_item_t *item) static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) { int ret = 0; - - char valueFormatted[20]; - cJSON *cj_device = (cJSON *)arg; - s_ezlopi_bmp280_t *bmp280_sensor_params = (s_ezlopi_bmp280_t *)item->user_arg; - if (cj_device && bmp280_sensor_params) + if (item && arg) { - if (ezlopi_item_name_temp == item->cloud_properties.item_name) + cJSON *cj_device = (cJSON *)arg; + s_ezlopi_bmp280_t *bmp280_sensor_params = (s_ezlopi_bmp280_t *)item->user_arg; + if (cj_device && bmp280_sensor_params) { - snprintf(valueFormatted, 20, "%0.3f", bmp280_sensor_params->temperature); - cJSON_AddStringToObject(cj_device, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddNumberToObject(cj_device, ezlopi_value_str, bmp280_sensor_params->temperature); - cJSON_AddStringToObject(cj_device, ezlopi_scale_str, scales_celsius); - } + if (ezlopi_item_name_temp == item->cloud_properties.item_name) + { + char *valueFormatted = ezlopi_valueformatter_float(bmp280_sensor_params->temperature); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_device, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + cJSON_AddNumberToObject(cj_device, ezlopi_value_str, bmp280_sensor_params->temperature); + cJSON_AddStringToObject(cj_device, ezlopi_scale_str, scales_celsius); + } - if (ezlopi_item_name_humidity == item->cloud_properties.item_name) - { - snprintf(valueFormatted, 20, "%0.3f", bmp280_sensor_params->humidity); - cJSON_AddStringToObject(cj_device, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddNumberToObject(cj_device, ezlopi_value_str, bmp280_sensor_params->humidity); - cJSON_AddStringToObject(cj_device, ezlopi_scale_str, scales_percent); - } + if (ezlopi_item_name_humidity == item->cloud_properties.item_name) + { + char *valueFormatted = ezlopi_valueformatter_float(bmp280_sensor_params->humidity); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_device, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + cJSON_AddNumberToObject(cj_device, ezlopi_value_str, bmp280_sensor_params->humidity); + cJSON_AddStringToObject(cj_device, ezlopi_scale_str, scales_percent); + } - if (ezlopi_item_name_atmospheric_pressure == item->cloud_properties.item_name) - { - snprintf(valueFormatted, 20, "%0.3f", (bmp280_sensor_params->pressure / 1000.0)); - cJSON_AddStringToObject(cj_device, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddNumberToObject(cj_device, ezlopi_value_str, (bmp280_sensor_params->pressure / 1000.0)); - cJSON_AddStringToObject(cj_device, ezlopi_scale_str, scales_kilo_pascal); + if (ezlopi_item_name_atmospheric_pressure == item->cloud_properties.item_name) + { + char *valueFormatted = ezlopi_valueformatter_float((bmp280_sensor_params->pressure / 1000.0)); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_device, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + cJSON_AddNumberToObject(cj_device, ezlopi_value_str, (bmp280_sensor_params->pressure / 1000.0)); + cJSON_AddStringToObject(cj_device, ezlopi_scale_str, scales_kilo_pascal); + } } } - return ret; } @@ -166,10 +183,10 @@ static int __init(l_ezlopi_item_t *item) int ret = 0; if (item) { - if (item->interface.i2c_master.enable) + s_ezlopi_bmp280_t *bmp280_sensor_params = (s_ezlopi_bmp280_t *)item->user_arg; + if (bmp280_sensor_params) { - s_ezlopi_bmp280_t *bmp280_sensor_params = (s_ezlopi_bmp280_t *)item->user_arg; - if (bmp280_sensor_params) + if (item->interface.i2c_master.enable) { ezlopi_i2c_master_init(&item->interface.i2c_master); bmp280_init_default_params(&bmp280_sensor_params->bmp280_params); @@ -178,14 +195,10 @@ static int __init(l_ezlopi_item_t *item) ret = 1; } } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } diff --git a/ezlopi-sensors-devices/sensor-0015-oneWire-DHT11/sensor_0015_oneWire_DHT11.c b/ezlopi-sensors-devices/sensor-0015-oneWire-DHT11/sensor_0015_oneWire_DHT11.c index cdba97e14..24a28eccf 100644 --- a/ezlopi-sensors-devices/sensor-0015-oneWire-DHT11/sensor_0015_oneWire_DHT11.c +++ b/ezlopi-sensors-devices/sensor-0015-oneWire-DHT11/sensor_0015_oneWire_DHT11.c @@ -1,5 +1,5 @@ #include - + #include "ezlopi_util_trace.h" #include "ezlopi_core_timer.h" @@ -209,20 +209,27 @@ static int __0015_init(l_ezlopi_item_t *item) int ret = 0; if (item) { - if (GPIO_IS_VALID_GPIO((gpio_num_t)item->interface.onewire_master.onewire_pin)) - { - setDHT11gpio(item->interface.onewire_master.onewire_pin); - ret = 1; - } - if (0 == ret) + s_ezlopi_dht11_data_t *dht11_data = (s_ezlopi_dht11_data_t *)item->user_arg; + if (dht11_data) { - ret = -1; - if (item->user_arg) + if (GPIO_IS_VALID_GPIO((gpio_num_t)item->interface.onewire_master.onewire_pin)) + { + setDHT11gpio(item->interface.onewire_master.onewire_pin); + ret = 1; + } + else { - free(item->user_arg); + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); } } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); + } } return ret; } @@ -236,19 +243,25 @@ static int __0015_get_value(l_ezlopi_item_t *item, void *args) s_ezlopi_dht11_data_t *dht11_data = (s_ezlopi_dht11_data_t *)item->user_arg; if (ezlopi_item_name_temp == item->cloud_properties.item_name) { - cJSON_AddNumberToObject(cj_properties, "value", dht11_data->temperature); + cJSON_AddNumberToObject(cj_properties, ezlopi_value_str, dht11_data->temperature); char *valueFormatted = ezlopi_valueformatter_float(dht11_data->temperature); - cJSON_AddStringToObject(cj_properties, "valueFormatted", valueFormatted); - free(valueFormatted); - cJSON_AddStringToObject(cj_properties, "scale", item->cloud_properties.scale); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_properties, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + cJSON_AddStringToObject(cj_properties, ezlopi_scale_str, item->cloud_properties.scale); } if (ezlopi_item_name_humidity == item->cloud_properties.item_name) { - cJSON_AddNumberToObject(cj_properties, "value", dht11_data->humidity); + cJSON_AddNumberToObject(cj_properties, ezlopi_value_str, dht11_data->humidity); char *valueFormatted = ezlopi_valueformatter_float(dht11_data->humidity); - cJSON_AddStringToObject(cj_properties, "valueFormatted", valueFormatted); - free(valueFormatted); - cJSON_AddStringToObject(cj_properties, "scale", item->cloud_properties.scale); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_properties, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + cJSON_AddStringToObject(cj_properties, ezlopi_scale_str, item->cloud_properties.scale); } } return ret; diff --git a/ezlopi-sensors-devices/sensor-0016-oneWire-DHT22/sensor_0016_oneWire_DHT22.c b/ezlopi-sensors-devices/sensor-0016-oneWire-DHT22/sensor_0016_oneWire_DHT22.c index bef4598b6..12b2579ca 100644 --- a/ezlopi-sensors-devices/sensor-0016-oneWire-DHT22/sensor_0016_oneWire_DHT22.c +++ b/ezlopi-sensors-devices/sensor-0016-oneWire-DHT22/sensor_0016_oneWire_DHT22.c @@ -70,20 +70,28 @@ static int dht22_sensor_init_v3(l_ezlopi_item_t *item) int ret = 0; if (item) { - if (GPIO_IS_VALID_GPIO((gpio_num_t)item->interface.onewire_master.onewire_pin)) - { - setDHT22gpio(item->interface.onewire_master.onewire_pin); - ret = 1; - } - if (0 == ret) + s_ezlopi_dht22_data_t *dht22_data = (s_ezlopi_dht22_data_t *)item->user_arg; + if (dht22_data) { - ret = -1; - if (item->user_arg) + if (GPIO_IS_VALID_GPIO((gpio_num_t)item->interface.onewire_master.onewire_pin)) + { + setDHT22gpio(item->interface.onewire_master.onewire_pin); + ret = 1; + } + else { - free(item->user_arg); + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items item->user_arg = NULL; + + ezlopi_device_free_device_by_item(item); } } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); + } } return ret; } @@ -137,8 +145,11 @@ static int dht22_sensor_get_sensor_value_v3(l_ezlopi_item_t *item, void *args) cJSON_AddNumberToObject(cj_properties, ezlopi_value_str, dht22_data->temperature); char *valueFormatted = ezlopi_valueformatter_float(dht22_data->temperature); - cJSON_AddStringToObject(cj_properties, ezlopi_valueFormatted_str, valueFormatted); - free(valueFormatted); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_properties, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } cJSON_AddStringToObject(cj_properties, ezlopi_scale_str, item->cloud_properties.scale); } @@ -146,8 +157,11 @@ static int dht22_sensor_get_sensor_value_v3(l_ezlopi_item_t *item, void *args) { cJSON_AddNumberToObject(cj_properties, ezlopi_value_str, dht22_data->humidity); char *valueFormatted = ezlopi_valueformatter_float(dht22_data->humidity); - cJSON_AddStringToObject(cj_properties, ezlopi_valueFormatted_str, valueFormatted); - free(valueFormatted); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_properties, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } cJSON_AddStringToObject(cj_properties, ezlopi_scale_str, item->cloud_properties.scale); } } @@ -179,6 +193,7 @@ static int dht22_sensor_prepare_v3(void *arg) } else { + ezlopi_device_free_device(device_temperature); free(dht22_sensor_data_temp); ret = -1; } @@ -202,6 +217,7 @@ static int dht22_sensor_prepare_v3(void *arg) } else { + ezlopi_device_free_device(device_humidity); free(dht22_sensor_data_hum); ret = -1; } diff --git a/ezlopi-sensors-devices/sensor-0017-ADC-potentiometer/sensor_0017_ADC_potentiometer.c b/ezlopi-sensors-devices/sensor-0017-ADC-potentiometer/sensor_0017_ADC_potentiometer.c index d550b7e9f..830fd7be7 100644 --- a/ezlopi-sensors-devices/sensor-0017-ADC-potentiometer/sensor_0017_ADC_potentiometer.c +++ b/ezlopi-sensors-devices/sensor-0017-ADC-potentiometer/sensor_0017_ADC_potentiometer.c @@ -128,20 +128,36 @@ static int __0017_init(l_ezlopi_item_t *item) int ret = 0; if (item) { - if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) - { - ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit); - ret = 1; - } - if (0 == ret) + s_potentiometer_t *user_data = (s_potentiometer_t *)item->user_arg; + if (user_data) { - ret = -1; - if (item->user_arg) + if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + { + if (0 == ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit)) + { + ret = 1; + } + else + { + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); + } + } + else { - free(item->user_arg); + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); } } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); + } } return ret; } @@ -155,11 +171,17 @@ static int __0017_get_cjson_value(l_ezlopi_item_t *item, void *arg) if (cj_result) { s_potentiometer_t *user_data = (s_potentiometer_t *)item->user_arg; - char *valueFormatted = ezlopi_valueformatter_float(user_data->pot_val); - cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); - cJSON_AddNumberToObject(cj_result, "value", (user_data->pot_val)); - free(valueFormatted); - ret = 1; + if (user_data) + { + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, (user_data->pot_val)); + char *valueFormatted = ezlopi_valueformatter_float(user_data->pot_val); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + ret = 1; + } } } return ret; @@ -171,16 +193,19 @@ static int __0017_notify(l_ezlopi_item_t *item) if (item) { s_potentiometer_t *user_data = (s_potentiometer_t *)item->user_arg; - s_ezlopi_analog_data_t adc_data = {.value = 0, .voltage = 0}; - ezlopi_adc_get_adc_data(item->interface.adc.gpio_num, &adc_data); - float new_pot = (((float)(4095.0f - (adc_data.value)) / 4095.0f) * 100); - - if (fabs((user_data->pot_val) - new_pot) > 0.05) + if (user_data) { - user_data->pot_val = new_pot; - ezlopi_device_value_updated_from_device_v3(item); + s_ezlopi_analog_data_t adc_data = {.value = 0, .voltage = 0}; + ezlopi_adc_get_adc_data(item->interface.adc.gpio_num, &adc_data); + float new_pot = (((float)(4095.0f - (adc_data.value)) / 4095.0f) * 100); + + if (fabs((user_data->pot_val) - new_pot) > 0.05) + { + user_data->pot_val = new_pot; + ezlopi_device_value_updated_from_device_v3(item); + } + ret = 1; } - ret = 1; } return ret; } diff --git a/ezlopi-sensors-devices/sensor-0018-other-internal-hall-effect/sensor_0018_other_internal_hall_effect.c b/ezlopi-sensors-devices/sensor-0018-other-internal-hall-effect/sensor_0018_other_internal_hall_effect.c index 38210cfeb..7b5b4f26c 100644 --- a/ezlopi-sensors-devices/sensor-0018-other-internal-hall-effect/sensor_0018_other_internal_hall_effect.c +++ b/ezlopi-sensors-devices/sensor-0018-other-internal-hall-effect/sensor_0018_other_internal_hall_effect.c @@ -19,7 +19,7 @@ #include "sensor_0018_other_internal_hall_effect.h" -const char* hall_door_window_states[] = { +const char *hall_door_window_states[] = { "dw_is_opened", "dw_is_closed", "unknown", @@ -27,20 +27,20 @@ const char* hall_door_window_states[] = { typedef struct s_hall_data { bool calibration_complete; - char* hall_state; + char *hall_state; int Custom_stable_val; } s_hall_data_t; -static int __prepare(void* arg); -static int __init(l_ezlopi_item_t* item); -static int __get_item_cjson(l_ezlopi_item_t* item, void* arg); -static int __get_value_cjson(l_ezlopi_item_t* item, void* arg); -static int __notify(l_ezlopi_item_t* item); -static void __setup_device_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device); -static void __setup_item_properties(l_ezlopi_item_t* item, cJSON* cj_device, void* user_data); -static void __hall_calibration_task(void* params); +static int __prepare(void *arg); +static int __init(l_ezlopi_item_t *item); +static int __get_item_cjson(l_ezlopi_item_t *item, void *arg); +static int __get_value_cjson(l_ezlopi_item_t *item, void *arg); +static int __notify(l_ezlopi_item_t *item); +static void __setup_device_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device); +static void __setup_item_properties(l_ezlopi_item_t *item, cJSON *cj_device, void *user_data); +static void __hall_calibration_task(void *params); -int sensor_0018_other_internal_hall_effect(e_ezlopi_actions_t action, l_ezlopi_item_t* item, void* arg, void* user_arg) +int sensor_0018_other_internal_hall_effect(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void *arg, void *user_arg) { int ret = 0; @@ -81,11 +81,11 @@ int sensor_0018_other_internal_hall_effect(e_ezlopi_actions_t action, l_ezlopi_i return ret; } -static void __setup_device_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device) +static void __setup_device_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device) { - char* device_name = NULL; + char *device_name = NULL; CJSON_GET_VALUE_STRING(cj_device, "dev_name", device_name) - ASSIGN_DEVICE_NAME_V2(device, device_name); + ASSIGN_DEVICE_NAME_V2(device, device_name); device->cloud_properties.device_id = ezlopi_cloud_generate_device_id(); device->cloud_properties.category = category_security_sensor; device->cloud_properties.subcategory = subcategory_door; @@ -94,7 +94,7 @@ static void __setup_device_cloud_properties(l_ezlopi_device_t* device, cJSON* cj device->cloud_properties.device_type_id = NULL; } -static void __setup_item_properties(l_ezlopi_item_t* item, cJSON* cj_device, void* user_data) +static void __setup_item_properties(l_ezlopi_item_t *item, cJSON *cj_device, void *user_data) { item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); item->cloud_properties.has_getter = true; @@ -110,22 +110,22 @@ static void __setup_item_properties(l_ezlopi_item_t* item, cJSON* cj_device, voi item->user_arg = user_data; } -static int __prepare(void* arg) +static int __prepare(void *arg) { int ret = 0; - s_ezlopi_prep_arg_t* prep_arg = (s_ezlopi_prep_arg_t*)arg; + s_ezlopi_prep_arg_t *prep_arg = (s_ezlopi_prep_arg_t *)arg; if (arg && prep_arg->cjson_device) { - cJSON* cj_device = prep_arg->cjson_device; - s_hall_data_t* user_data = (s_hall_data_t*)malloc(sizeof(s_hall_data_t)); + cJSON *cj_device = prep_arg->cjson_device; + s_hall_data_t *user_data = (s_hall_data_t *)malloc(sizeof(s_hall_data_t)); if (user_data) { memset(user_data, 0, sizeof(s_hall_data_t)); - l_ezlopi_device_t* hall_device = ezlopi_device_add_device(cj_device); + l_ezlopi_device_t *hall_device = ezlopi_device_add_device(cj_device); if (hall_device) { __setup_device_cloud_properties(hall_device, cj_device); - l_ezlopi_item_t* hall_item = ezlopi_device_add_item_to_device(hall_device, sensor_0018_other_internal_hall_effect); + l_ezlopi_item_t *hall_item = ezlopi_device_add_item_to_device(hall_device, sensor_0018_other_internal_hall_effect); if (hall_item) { __setup_item_properties(hall_item, cj_device, user_data); @@ -149,7 +149,7 @@ static int __prepare(void* arg) return ret; } -static int __init(l_ezlopi_item_t* item) +static int __init(l_ezlopi_item_t *item) { int ret = 0; if (item) @@ -159,127 +159,141 @@ static int __init(l_ezlopi_item_t* item) #else esp_err_t error = ESP_ERR_NOT_FOUND; #endif - if (error) + s_hall_data_t *user_data = (s_hall_data_t *)item->user_arg; + if (user_data) { - TRACE_E("Error 'sensor_door_init'. error: %s)", esp_err_to_name(error)); + if (ESP_OK == error) + { + TRACE_I("Width configuration was successfully done!"); + TRACE_W("Calibrating....."); + user_data->hall_state = "dw_is_closed"; + xTaskCreate(__hall_calibration_task, "Hall_Calibration_Task", 2048, item, 1, NULL); + ret = 1; + } + else + { + TRACE_E("Error 'sensor_door_init'. error: %s)", esp_err_to_name(error)); + ret = -1; + free(user_data); + user_data = NULL; + ezlopi_device_free_device_by_item(item); + } } else - { - TRACE_I("Width configuration was successfully done!"); - TRACE_W("Calibrating....."); - s_hall_data_t* user_data = (s_hall_data_t*)item->user_arg; - user_data->hall_state = "dw_is_closed"; - xTaskCreate(__hall_calibration_task, "Hall_Calibration_Task", 2048, item, 1, NULL); - ret = 1; - } - if (0 == ret) { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } return ret; } -static int __get_item_cjson(l_ezlopi_item_t* item, void* arg) +static int __get_item_cjson(l_ezlopi_item_t *item, void *arg) { int ret = 0; if (item && arg) { - s_hall_data_t* user_data = (s_hall_data_t*)item->user_arg; - - cJSON* cj_result = (cJSON*)arg; - if (cj_result) + s_hall_data_t *user_data = (s_hall_data_t *)item->user_arg; + if (user_data) { - //------------------- POSSIBLE JSON ENUM LPGNTENTS ---------------------------------- - cJSON* json_array_enum = cJSON_CreateArray(); - if (NULL != json_array_enum) + cJSON *cj_result = (cJSON *)arg; + if (cj_result) { - for (uint8_t i = 0; i < HALL_DOOR_WINDOW_MAX; i++) + //------------------- POSSIBLE JSON ENUM LPGNTENTS ---------------------------------- + cJSON *json_array_enum = cJSON_CreateArray(); + if (NULL != json_array_enum) { - cJSON* json_value = cJSON_CreateString(hall_door_window_states[i]); - if (NULL != json_value) + for (uint8_t i = 0; i < HALL_DOOR_WINDOW_MAX; i++) { - cJSON_AddItemToArray(json_array_enum, json_value); + cJSON *json_value = cJSON_CreateString(hall_door_window_states[i]); + if (NULL != json_value) + { + cJSON_AddItemToArray(json_array_enum, json_value); + } } + cJSON_AddItemToObject(cj_result, ezlopi_enum_str, json_array_enum); } - cJSON_AddItemToObject(cj_result, "enum", json_array_enum); + //-------------------------------------------------------------------------------------- + cJSON_AddStringToObject(cj_result, ezlopi_value_str, user_data->hall_state); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, user_data->hall_state); } - //-------------------------------------------------------------------------------------- - cJSON_AddStringToObject(cj_result, "valueFormatted", user_data->hall_state); - cJSON_AddStringToObject(cj_result, "value", user_data->hall_state); + ret = 1; } - ret = 1; } return ret; } -static int __get_value_cjson(l_ezlopi_item_t* item, void* arg) +static int __get_value_cjson(l_ezlopi_item_t *item, void *arg) { int ret = 0; if (item && arg) { - s_hall_data_t* user_data = (s_hall_data_t*)item->user_arg; - cJSON* cj_result = (cJSON*)arg; - if (cj_result) + s_hall_data_t *user_data = (s_hall_data_t *)item->user_arg; + if (user_data) { - cJSON_AddStringToObject(cj_result, "valueFormatted", user_data->hall_state); - cJSON_AddStringToObject(cj_result, "value", user_data->hall_state); + cJSON *cj_result = (cJSON *)arg; + if (cj_result) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, user_data->hall_state); + cJSON_AddStringToObject(cj_result, ezlopi_value_str, user_data->hall_state); + } + ret = 1; } - ret = 1; } return ret; } -static int __notify(l_ezlopi_item_t* item) +static int __notify(l_ezlopi_item_t *item) { int ret = 0; if (item) { - s_hall_data_t* user_data = (s_hall_data_t*)item->user_arg; - if (user_data->calibration_complete) + s_hall_data_t *user_data = (s_hall_data_t *)item->user_arg; + if (user_data) { - char* curret_value = NULL; + if (user_data->calibration_complete) + { + char *curret_value = NULL; #ifdef CONFIG_IDF_TARGET_ESP32 - int sensor_data = hall_sensor_read(); + int sensor_data = hall_sensor_read(); #else - int sensor_data = 0; + int sensor_data = 0; #endif - TRACE_D(" Hall door value ; %d", sensor_data); + TRACE_D(" Hall door value ; %d", sensor_data); - curret_value = ((fabs(user_data->Custom_stable_val - sensor_data) > 35) ? "dw_is_closed" : "dw_is_opened"); + curret_value = ((fabs(user_data->Custom_stable_val - sensor_data) > 35) ? "dw_is_closed" : "dw_is_opened"); - if (curret_value != user_data->hall_state) // calls update only if there is change in state - { - user_data->hall_state = curret_value; - ezlopi_device_value_updated_from_device_v3(item); + if (curret_value != user_data->hall_state) // calls update only if there is change in state + { + user_data->hall_state = curret_value; + ezlopi_device_value_updated_from_device_v3(item); + } + ret = 1; } - ret = 1; } } return ret; } -static void __hall_calibration_task(void* params) // calibrate task +static void __hall_calibration_task(void *params) // calibrate task { - l_ezlopi_item_t* item = (l_ezlopi_item_t*)params; + l_ezlopi_item_t *item = (l_ezlopi_item_t *)params; if (item) { - s_hall_data_t* user_data = (s_hall_data_t*)item->user_arg; - - float sensor_data = (float)hall_sensor_read(); - for (uint8_t i = 0; i < 10; i++) + s_hall_data_t *user_data = (s_hall_data_t *)item->user_arg; + if (user_data) { - sensor_data = (sensor_data * .8f) + (.2f * (float)hall_sensor_read()); - vTaskDelay(500); + + float sensor_data = (float)hall_sensor_read(); + for (uint8_t i = 0; i < 10; i++) + { + sensor_data = (sensor_data * .8f) + (.2f * (float)hall_sensor_read()); + vTaskDelay(500); + } + user_data->Custom_stable_val = (int)sensor_data; + TRACE_W("Calibration Complete...... Stable_hall is : [%d]", user_data->Custom_stable_val); + user_data->calibration_complete = true; } - user_data->Custom_stable_val = (int)sensor_data; - TRACE_W("Calibration Complete...... Stable_hall is : [%d]", user_data->Custom_stable_val); - user_data->calibration_complete = true; } vTaskDelete(NULL); } diff --git a/ezlopi-sensors-devices/sensor-0019-digitalIn-PIR/sensor_0019_digitalIn_PIR.c b/ezlopi-sensors-devices/sensor-0019-digitalIn-PIR/sensor_0019_digitalIn_PIR.c index 8be843951..4ccc1685e 100644 --- a/ezlopi-sensors-devices/sensor-0019-digitalIn-PIR/sensor_0019_digitalIn_PIR.c +++ b/ezlopi-sensors-devices/sensor-0019-digitalIn-PIR/sensor_0019_digitalIn_PIR.c @@ -92,27 +92,23 @@ static int sensor_pir_init_v3(l_ezlopi_item_t *item) .intr_type = item->interface.gpio.gpio_in.interrupt, }; - ret = gpio_config(&io_conf); - if (ESP_OK == ret) + if (ESP_OK == gpio_config(&io_conf)) { - TRACE_S("PIR sensor initialize successfully."); + TRACE_I("PIR sensor initialize successfully."); item->interface.gpio.gpio_in.value = gpio_get_level(item->interface.gpio.gpio_in.gpio_num); gpio_isr_service_register_v3(item, sensor_pir_value_updated_from_device_v3, 200); + ret = 1; } else { TRACE_E("Error initializing PIR sensor, error: %s", esp_err_to_name(ret)); + ret = -1; } - ret = 1; } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } return ret; diff --git a/ezlopi-sensors-devices/sensor-0020-other-2axis-joystick/sensor_0020_other_2axis_joystick.c b/ezlopi-sensors-devices/sensor-0020-other-2axis-joystick/sensor_0020_other_2axis_joystick.c index 17645366b..53ed88c74 100644 --- a/ezlopi-sensors-devices/sensor-0020-other-2axis-joystick/sensor_0020_other_2axis_joystick.c +++ b/ezlopi-sensors-devices/sensor-0020-other-2axis-joystick/sensor_0020_other_2axis_joystick.c @@ -25,13 +25,13 @@ typedef struct s_joystick_data uint32_t adc_y; } s_joystick_data_t; -static int __prepare(void *arg); -static int __init(l_ezlopi_item_t *item); -static int __get_value_cjson(l_ezlopi_item_t *item, void *arg); -static int __notify(l_ezlopi_item_t *item); -static void __joystick_intr_callback(void *arg); +static int __prepare(void* arg); +static int __init(l_ezlopi_item_t* item); +static int __get_value_cjson(l_ezlopi_item_t* item, void* arg); +static int __notify(l_ezlopi_item_t* item); +static void __joystick_intr_callback(void* arg); -int sensor_0020_other_2axis_joystick(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void *arg, void *user_arg) +int sensor_0020_other_2axis_joystick(e_ezlopi_actions_t action, l_ezlopi_item_t* item, void* arg, void* user_arg) { int ret = 0; @@ -69,9 +69,9 @@ int sensor_0020_other_2axis_joystick(e_ezlopi_actions_t action, l_ezlopi_item_t return ret; } -static void __setup_device_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device) +static void __setup_device_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device) { - char *device_name = NULL; + char* device_name = NULL; CJSON_GET_VALUE_STRING(cj_device, "dev_name", device_name); ASSIGN_DEVICE_NAME_V2(device, device_name); @@ -81,14 +81,14 @@ static void __setup_device_cloud_properties(l_ezlopi_device_t *device, cJSON *cj device->cloud_properties.device_type = dev_type_device; } -static void __setup_item_cloud_properties(l_ezlopi_item_t *item, s_joystick_data_t *user_data) +static void __setup_item_cloud_properties(l_ezlopi_item_t* item, s_joystick_data_t* user_data) { if (item) { item->cloud_properties.has_getter = true; item->cloud_properties.has_setter = true; item->cloud_properties.show = true; - item->user_arg = (void *)user_data; + item->user_arg = (void*)user_data; if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_X] == item->cloud_properties.item_id) { @@ -96,13 +96,13 @@ static void __setup_item_cloud_properties(l_ezlopi_item_t *item, s_joystick_data item->cloud_properties.value_type = value_type_electric_potential; item->cloud_properties.scale = scales_milli_volt; } - if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_Y] == item->cloud_properties.item_id) + else if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_Y] == item->cloud_properties.item_id) { item->cloud_properties.item_name = ezlopi_item_name_voltage; item->cloud_properties.value_type = value_type_electric_potential; item->cloud_properties.scale = scales_milli_volt; } - if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_SWITCH] == item->cloud_properties.item_id) + else if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_SWITCH] == item->cloud_properties.item_id) { item->cloud_properties.item_name = ezlopi_item_name_switch; item->cloud_properties.value_type = value_type_bool; @@ -111,24 +111,24 @@ static void __setup_item_cloud_properties(l_ezlopi_item_t *item, s_joystick_data } } -static void __setup_item_interface_properties(l_ezlopi_item_t *item, cJSON *cj_device) +static void __setup_item_interface_properties(l_ezlopi_item_t* item, cJSON* cj_device) { if (item) { - s_joystick_data_t *user_data = (s_joystick_data_t *)item->user_arg; + s_joystick_data_t* user_data = (s_joystick_data_t*)item->user_arg; if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_X] == item->cloud_properties.item_id) { item->interface_type = EZLOPI_DEVICE_INTERFACE_ANALOG_INPUT; CJSON_GET_VALUE_INT(cj_device, "gpio1", item->interface.adc.gpio_num); item->interface.adc.resln_bit = 3; } - if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_Y] == item->cloud_properties.item_id) + else if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_Y] == item->cloud_properties.item_id) { item->interface_type = EZLOPI_DEVICE_INTERFACE_ANALOG_INPUT; CJSON_GET_VALUE_INT(cj_device, "gpio2", item->interface.adc.gpio_num); item->interface.adc.resln_bit = 3; } - if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_SWITCH] == item->cloud_properties.item_id) + else if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_SWITCH] == item->cloud_properties.item_id) { item->interface_type = EZLOPI_DEVICE_INTERFACE_DIGITAL_INPUT; CJSON_GET_VALUE_INT(cj_device, "gpio3", item->interface.gpio.gpio_in.gpio_num); @@ -139,16 +139,16 @@ static void __setup_item_interface_properties(l_ezlopi_item_t *item, cJSON *cj_d } } -static int __prepare(void *arg) +static int __prepare(void* arg) { int ret = 0; - s_ezlopi_prep_arg_t *dev_prep_arg = (s_ezlopi_prep_arg_t *)arg; + s_ezlopi_prep_arg_t* dev_prep_arg = (s_ezlopi_prep_arg_t*)arg; if (dev_prep_arg && (dev_prep_arg->cjson_device)) { - cJSON *cj_device = dev_prep_arg->cjson_device; + cJSON* cj_device = dev_prep_arg->cjson_device; if (cj_device) { - s_joystick_data_t *user_data = (s_joystick_data_t *)malloc(sizeof(s_joystick_data_t)); + s_joystick_data_t* user_data = (s_joystick_data_t*)malloc(sizeof(s_joystick_data_t)); if (user_data) { memset(user_data, 0, sizeof(s_joystick_data_t)); @@ -157,14 +157,14 @@ static int __prepare(void *arg) user_data->sensor_0020_joystick_item_ids[i] = ezlopi_cloud_generate_item_id(); } - l_ezlopi_device_t *joystick_x_device = ezlopi_device_add_device(cj_device); + l_ezlopi_device_t* joystick_x_device = ezlopi_device_add_device(cj_device); if (joystick_x_device) { joystick_x_device->cloud_properties.category = category_level_sensor; joystick_x_device->cloud_properties.subcategory = subcategory_electricity; __setup_device_cloud_properties(joystick_x_device, cj_device); - l_ezlopi_item_t *joystick_x_item = ezlopi_device_add_item_to_device(joystick_x_device, sensor_0020_other_2axis_joystick); + l_ezlopi_item_t* joystick_x_item = ezlopi_device_add_item_to_device(joystick_x_device, sensor_0020_other_2axis_joystick); if (joystick_x_item) { joystick_x_item->cloud_properties.item_id = user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_X]; @@ -178,14 +178,14 @@ static int __prepare(void *arg) ret = -1; } } - l_ezlopi_device_t *joystick_y_device = ezlopi_device_add_device(cj_device); + l_ezlopi_device_t* joystick_y_device = ezlopi_device_add_device(cj_device); if (joystick_y_device) { joystick_y_device->cloud_properties.category = category_level_sensor; joystick_y_device->cloud_properties.subcategory = subcategory_electricity; __setup_device_cloud_properties(joystick_y_device, cj_device); - l_ezlopi_item_t *joystick_y_item = ezlopi_device_add_item_to_device(joystick_y_device, sensor_0020_other_2axis_joystick); + l_ezlopi_item_t* joystick_y_item = ezlopi_device_add_item_to_device(joystick_y_device, sensor_0020_other_2axis_joystick); if (joystick_y_item) { joystick_y_item->cloud_properties.item_id = user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_Y]; @@ -199,14 +199,14 @@ static int __prepare(void *arg) ret = -1; } } - l_ezlopi_device_t *joystick_sw_device = ezlopi_device_add_device(cj_device); + l_ezlopi_device_t* joystick_sw_device = ezlopi_device_add_device(cj_device); if (joystick_sw_device) { joystick_sw_device->cloud_properties.category = category_switch; joystick_sw_device->cloud_properties.subcategory = subcategory_in_wall; __setup_device_cloud_properties(joystick_sw_device, cj_device); - l_ezlopi_item_t *joystick_sw_item = ezlopi_device_add_item_to_device(joystick_sw_device, sensor_0020_other_2axis_joystick); + l_ezlopi_item_t* joystick_sw_item = ezlopi_device_add_item_to_device(joystick_sw_device, sensor_0020_other_2axis_joystick); if (joystick_sw_item) { joystick_sw_item->cloud_properties.item_id = user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_SWITCH]; @@ -220,6 +220,10 @@ static int __prepare(void *arg) ret = -1; } } + if (NULL == joystick_x_device && NULL == joystick_y_device && NULL == joystick_sw_device) + { + free(user_data); + } } } } @@ -227,97 +231,121 @@ static int __prepare(void *arg) return ret; } -static int __init(l_ezlopi_item_t *item) +static int __init(l_ezlopi_item_t* item) { int ret = 0; if (item) { - s_joystick_data_t *user_data = (s_joystick_data_t *)item->user_arg; - if ((item->cloud_properties.item_id == user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_X]) || (item->cloud_properties.item_id == user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_Y])) + s_joystick_data_t* user_data = (s_joystick_data_t*)item->user_arg; + if (user_data) { - if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + if ((item->cloud_properties.item_id == user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_X]) || + (item->cloud_properties.item_id == user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_Y])) { - TRACE_E("adc GPIO_NUM is %d", item->interface.adc.gpio_num); - ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit); - ret = 1; + if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + { + TRACE_E("adc GPIO_NUM is %d", item->interface.adc.gpio_num); + if (0 == ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit)) + { + ret = 1; + } + } + else + { + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); + } } - } - if (item->cloud_properties.item_id == user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_SWITCH]) - { - if (item->interface.gpio.gpio_in.enable) + else if (item->cloud_properties.item_id == user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_SWITCH] && + (item->interface.gpio.gpio_in.enable)) { - TRACE_I("SW_GPIO_NUM is %d", item->interface.gpio.gpio_in.gpio_num); - - const gpio_config_t io_conf = { - .pin_bit_mask = (1ULL << item->interface.gpio.gpio_in.gpio_num), - .mode = GPIO_MODE_INPUT, - .pull_up_en = ((item->interface.gpio.gpio_in.pull == GPIO_PULLUP_ONLY) || - (item->interface.gpio.gpio_in.pull == GPIO_PULLUP_PULLDOWN)) - ? GPIO_PULLUP_ENABLE - : GPIO_PULLUP_DISABLE, - .pull_down_en = GPIO_PULLDOWN_DISABLE, - .intr_type = item->interface.gpio.gpio_in.interrupt, - }; - - ret = gpio_config(&io_conf); - if (ret) + if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) { - ret = 0; - TRACE_E("Error initializing joystick switch"); + TRACE_I("SW_GPIO_NUM is %d", item->interface.gpio.gpio_in.gpio_num); + + const gpio_config_t io_conf = { + .pin_bit_mask = (1ULL << item->interface.gpio.gpio_in.gpio_num), + .mode = GPIO_MODE_INPUT, + .pull_up_en = ((item->interface.gpio.gpio_in.pull == GPIO_PULLUP_ONLY) || + (item->interface.gpio.gpio_in.pull == GPIO_PULLUP_PULLDOWN)) + ? GPIO_PULLUP_ENABLE + : GPIO_PULLUP_DISABLE, + .pull_down_en = GPIO_PULLDOWN_DISABLE, + .intr_type = item->interface.gpio.gpio_in.interrupt, + }; + + if (ESP_OK == gpio_config(&io_conf)) + { + TRACE_I("Joystick switch initialize successfully."); + item->interface.gpio.gpio_in.value = gpio_get_level(item->interface.gpio.gpio_in.gpio_num); + // TRACE_D("Value is %d", (int)item->interface.gpio.gpio_in.value); + gpio_isr_service_register_v3(item, __joystick_intr_callback, 200); + ret = 1; + } + else + { + ret = -1; + TRACE_E("Error initializing joystick switch"); + free(item->user_arg); // this will free ; memory address linked to all items + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); + } } else { - TRACE_S("Joystick switch initialize successfully."); - item->interface.gpio.gpio_in.value = gpio_get_level(item->interface.gpio.gpio_in.gpio_num); - TRACE_I("Value is %d", item->interface.gpio.gpio_in.value); - gpio_isr_service_register_v3(item, __joystick_intr_callback, 200); - ret = 1; + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); } } } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } } } return ret; } -static int __get_value_cjson(l_ezlopi_item_t *item, void *arg) +static int __get_value_cjson(l_ezlopi_item_t* item, void* arg) { int ret = 0; - cJSON *cj_result = (cJSON *)arg; + cJSON* cj_result = (cJSON*)arg; if (cj_result && item) { - s_joystick_data_t *user_data = (s_joystick_data_t *)item->user_arg; + s_joystick_data_t* user_data = (s_joystick_data_t*)item->user_arg; if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_X] == item->cloud_properties.item_id) { - char *valueFormatted = ezlopi_valueformatter_uint32(user_data->adc_x); - cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); cJSON_AddNumberToObject(cj_result, "value", user_data->adc_x); cJSON_AddStringToObject(cj_result, "scale", "milli_volt"); - free(valueFormatted); + char* valueFormatted = ezlopi_valueformatter_uint32(user_data->adc_x); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } } - if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_Y] == item->cloud_properties.item_id) + else if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_Y] == item->cloud_properties.item_id) { - char *valueFormatted = ezlopi_valueformatter_uint32(user_data->adc_y); - cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); cJSON_AddNumberToObject(cj_result, "value", user_data->adc_y); cJSON_AddStringToObject(cj_result, "scale", "milli_volt"); - free(valueFormatted); + char* valueFormatted = ezlopi_valueformatter_uint32(user_data->adc_y); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } } - if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_SWITCH] == item->cloud_properties.item_id) + else if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_SWITCH] == item->cloud_properties.item_id) { cJSON_AddBoolToObject(cj_result, "value", ((0 == item->interface.gpio.gpio_in.value) ? true : false)); - const char *valueFormatted = ezlopi_valueformatter_bool((0 == item->interface.gpio.gpio_in.value) ? true : false); + const char* valueFormatted = ezlopi_valueformatter_bool((0 == item->interface.gpio.gpio_in.value) ? true : false); cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); } ret = 1; @@ -325,34 +353,37 @@ static int __get_value_cjson(l_ezlopi_item_t *item, void *arg) return ret; } -static int __notify(l_ezlopi_item_t *item) +static int __notify(l_ezlopi_item_t* item) { int ret = 0; if (item) { if (ezlopi_item_name_switch != item->cloud_properties.item_name) { - s_joystick_data_t *user_data = (s_joystick_data_t *)item->user_arg; - s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; - - if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_X] == item->cloud_properties.item_id) + s_joystick_data_t* user_data = (s_joystick_data_t*)item->user_arg; + if (user_data) { - ezlopi_adc_get_adc_data(item->interface.adc.gpio_num, &ezlopi_analog_data); - if (fabs(user_data->adc_x - ezlopi_analog_data.voltage) > 100) + s_ezlopi_analog_data_t ezlopi_analog_data = { .value = 0, .voltage = 0 }; + + if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_X] == item->cloud_properties.item_id) { - user_data->adc_x = ezlopi_analog_data.voltage; - // TRACE_S("X-axis value is %d and voltage is %d", ezlopi_analog_data.value, ezlopi_analog_data.voltage); - ezlopi_device_value_updated_from_device_item_id_v3(user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_X]); + ezlopi_adc_get_adc_data(item->interface.adc.gpio_num, &ezlopi_analog_data); + if (fabs(user_data->adc_x - ezlopi_analog_data.voltage) > 100) + { + user_data->adc_x = ezlopi_analog_data.voltage; + // TRACE_S("X-axis value is %d and voltage is %d", ezlopi_analog_data.value, ezlopi_analog_data.voltage); + ezlopi_device_value_updated_from_device_item_id_v3(user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_X]); + } } - } - if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_Y] == item->cloud_properties.item_id) - { - ezlopi_adc_get_adc_data(item->interface.adc.gpio_num, &ezlopi_analog_data); - if (fabs(user_data->adc_y - ezlopi_analog_data.voltage) > 100) + else if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_Y] == item->cloud_properties.item_id) { - user_data->adc_y = ezlopi_analog_data.voltage; - // TRACE_S("Y-axis value is %d and voltage is %d", ezlopi_analog_data.value, ezlopi_analog_data.voltage); - ezlopi_device_value_updated_from_device_item_id_v3(user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_Y]); + ezlopi_adc_get_adc_data(item->interface.adc.gpio_num, &ezlopi_analog_data); + if (fabs(user_data->adc_y - ezlopi_analog_data.voltage) > 100) + { + user_data->adc_y = ezlopi_analog_data.voltage; + // TRACE_S("Y-axis value is %d and voltage is %d", ezlopi_analog_data.value, ezlopi_analog_data.voltage); + ezlopi_device_value_updated_from_device_item_id_v3(user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_Y]); + } } } } @@ -361,14 +392,17 @@ static int __notify(l_ezlopi_item_t *item) return ret; } -static void __joystick_intr_callback(void *arg) +static void __joystick_intr_callback(void* arg) { - l_ezlopi_item_t *item = (l_ezlopi_item_t *)arg; + l_ezlopi_item_t* item = (l_ezlopi_item_t*)arg; if (item) { - s_joystick_data_t *user_data = (s_joystick_data_t *)item->user_arg; - item->interface.gpio.gpio_in.value = gpio_get_level(item->interface.gpio.gpio_in.gpio_num); - item->interface.gpio.gpio_in.value = (false == item->interface.gpio.gpio_in.invert) ? (item->interface.gpio.gpio_in.value) : (!item->interface.gpio.gpio_in.value); - ezlopi_device_value_updated_from_device_item_id_v3(user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_SWITCH]); + s_joystick_data_t* user_data = (s_joystick_data_t*)item->user_arg; + if (user_data) + { + item->interface.gpio.gpio_in.value = gpio_get_level(item->interface.gpio.gpio_in.gpio_num); + item->interface.gpio.gpio_in.value = (false == item->interface.gpio.gpio_in.invert) ? (item->interface.gpio.gpio_in.value) : (!item->interface.gpio.gpio_in.value); + ezlopi_device_value_updated_from_device_item_id_v3(user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_SWITCH]); + } } } diff --git a/ezlopi-sensors-devices/sensor-0021-UART-MB1013/sensor_0021_UART_MB1013.c b/ezlopi-sensors-devices/sensor-0021-UART-MB1013/sensor_0021_UART_MB1013.c index 637f9da69..11f252b88 100644 --- a/ezlopi-sensors-devices/sensor-0021-UART-MB1013/sensor_0021_UART_MB1013.c +++ b/ezlopi-sensors-devices/sensor-0021-UART-MB1013/sensor_0021_UART_MB1013.c @@ -65,30 +65,35 @@ int sensor_0021_UART_MB1013(e_ezlopi_actions_t action, l_ezlopi_item_t *item, vo static int __get_value_cjson(l_ezlopi_item_t *item, void *arg) { int ret = 0; - char valueFormatted[20]; - if (item && arg && item->user_arg) + if (item && arg) { s_mb1013_args_t *mb1013_args = item->user_arg; - - cJSON *cj_result = (cJSON *)arg; - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, mb1013_args->current_value); - snprintf(valueFormatted, 20, "%.2f", mb1013_args->current_value); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - ret = 1; + if (mb1013_args) + { + cJSON *cj_result = (cJSON *)arg; + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, mb1013_args->current_value); + char *valueFormatted = ezlopi_valueformatter_float(mb1013_args->current_value); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + ret = 1; + } } return ret; } static void __uart_data_upcall(uint8_t *buffer, uint32_t output_len, s_ezlopi_uart_object_handle_t uart_object_handle) { - if (buffer && output_len) + if (buffer && output_len && uart_object_handle) { - if (uart_object_handle) + l_ezlopi_item_t *item = (l_ezlopi_item_t *)uart_object_handle->arg; + if (item) { - l_ezlopi_item_t *item = (l_ezlopi_item_t *)uart_object_handle->arg; - if (item && item->user_arg) + s_mb1013_args_t *s_mb1013_args = (s_mb1013_args_t *)item->user_arg; + if (s_mb1013_args) { - s_mb1013_args_t *s_mb1013_args = (s_mb1013_args_t *)item->user_arg; int idx = 0; TRACE_D("BUFFER-DATA-LEN: %d", output_len); while (idx < output_len) @@ -97,7 +102,7 @@ static void __uart_data_upcall(uint8_t *buffer, uint32_t output_len, s_ezlopi_ua if ('R' == buffer[idx] && '\r' == buffer[idx + 5]) { s_mb1013_args->current_value = atoi((const char *)&buffer[idx + 1]) / 10.0; - TRACE_I("range: %f", s_mb1013_args->current_value); + TRACE_D("range: %f", s_mb1013_args->current_value); break; } idx++; @@ -112,21 +117,28 @@ static int __init(l_ezlopi_item_t *item) int ret = 0; if (item) { - if (GPIO_IS_VALID_GPIO(item->interface.uart.tx) && GPIO_IS_VALID_GPIO(item->interface.uart.rx)) - { - s_ezlopi_uart_object_handle_t ezlopi_uart_object_handle = ezlopi_uart_init(item->interface.uart.baudrate, item->interface.uart.tx, item->interface.uart.rx, __uart_data_upcall, item); - item->interface.uart.channel = ezlopi_uart_get_channel(ezlopi_uart_object_handle); - ret = 1; - } - if (0 == ret) + s_mb1013_args_t *mb1013_args = (s_mb1013_args_t *)item->user_arg; + if (mb1013_args) { - ret = -1; - if (item->user_arg) + if (GPIO_IS_VALID_GPIO(item->interface.uart.tx) && GPIO_IS_VALID_GPIO(item->interface.uart.rx)) { - free(item->user_arg); + s_ezlopi_uart_object_handle_t ezlopi_uart_object_handle = ezlopi_uart_init(item->interface.uart.baudrate, item->interface.uart.tx, item->interface.uart.rx, __uart_data_upcall, item); + item->interface.uart.channel = ezlopi_uart_get_channel(ezlopi_uart_object_handle); + ret = 1; + } + else + { + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); } } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); + } } return ret; @@ -212,10 +224,13 @@ static int __notify(l_ezlopi_item_t *item) if (item && item->user_arg) { s_mb1013_args_t *mb1013_args = (s_mb1013_args_t *)item->user_arg; - if (abs(mb1013_args->current_value - mb1013_args->previous_value) > 0.2) // accuracy of 0.5cm (i.e. 5mm) + if (mb1013_args) { - ezlopi_device_value_updated_from_device_v3(item); - mb1013_args->previous_value = mb1013_args->current_value; + if (abs(mb1013_args->current_value - mb1013_args->previous_value) > 0.2) // accuracy of 0.5cm (i.e. 5mm) + { + ezlopi_device_value_updated_from_device_v3(item); + mb1013_args->previous_value = mb1013_args->current_value; + } } } diff --git a/ezlopi-sensors-devices/sensor-0023-digitalIn-touch-switch-TTP223B/sensor_0023_digitalIn_touch_switch_TTP223B.c b/ezlopi-sensors-devices/sensor-0023-digitalIn-touch-switch-TTP223B/sensor_0023_digitalIn_touch_switch_TTP223B.c index 09ff06f3c..14e3a5873 100644 --- a/ezlopi-sensors-devices/sensor-0023-digitalIn-touch-switch-TTP223B/sensor_0023_digitalIn_touch_switch_TTP223B.c +++ b/ezlopi-sensors-devices/sensor-0023-digitalIn-touch-switch-TTP223B/sensor_0023_digitalIn_touch_switch_TTP223B.c @@ -59,13 +59,15 @@ int sensor_0023_digitalIn_touch_switch_TTP223B(e_ezlopi_actions_t action, l_ezlo static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) { int ret = 0; - - cJSON *param = (cJSON *)arg; - if (param) + if (item) { - cJSON_AddBoolToObject(param, ezlopi_value_str, item->interface.gpio.gpio_in.value); - const char *valueFormatted = ezlopi_valueformatter_bool(item->interface.gpio.gpio_in.value ? true : false); - cJSON_AddStringToObject(param, ezlopi_valueFormatted_str, valueFormatted); + cJSON *param = (cJSON *)arg; + if (param) + { + cJSON_AddBoolToObject(param, ezlopi_value_str, item->interface.gpio.gpio_in.value); + const char *valueFormatted = ezlopi_valueformatter_bool(item->interface.gpio.gpio_in.value ? true : false); + cJSON_AddStringToObject(param, ezlopi_valueFormatted_str, valueFormatted); + } } return ret; @@ -76,6 +78,7 @@ static int __init(l_ezlopi_item_t *item) int ret = 0; if (item) { + if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) { const gpio_config_t touch_switch_config = { @@ -86,18 +89,21 @@ static int __init(l_ezlopi_item_t *item) .intr_type = GPIO_INTR_POSEDGE, }; - ESP_ERROR_CHECK(gpio_config(&touch_switch_config)); - gpio_isr_service_register_v3(item, touch_switch_callback, 200); - ret = 1; + if (0 == gpio_config(&touch_switch_config)) // ESP_OK + { + gpio_isr_service_register_v3(item, touch_switch_callback, 200); + ret = 1; + } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); + } } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } diff --git a/ezlopi-sensors-devices/sensor-0024-other-HCSR04/sensor_0024_other_HCSR04.c b/ezlopi-sensors-devices/sensor-0024-other-HCSR04/sensor_0024_other_HCSR04.c index 93c65d6f1..a1b64523b 100644 --- a/ezlopi-sensors-devices/sensor-0024-other-HCSR04/sensor_0024_other_HCSR04.c +++ b/ezlopi-sensors-devices/sensor-0024-other-HCSR04/sensor_0024_other_HCSR04.c @@ -77,17 +77,21 @@ int sensor_0024_other_HCSR04_v3(e_ezlopi_actions_t action, l_ezlopi_item_t *item static int __get_value_cjson(l_ezlopi_item_t *item, void *arg) { int ret = 0; - - s_ultrasonic_sensor_t *ultrasonic_sensor = (s_ultrasonic_sensor_t *)item->user_arg; - cJSON *cj_param = (cJSON *)arg; - char valueFormatted[20]; - if (cj_param && ultrasonic_sensor) + if (item) { - snprintf(valueFormatted, 20, "%d cm", ultrasonic_sensor->distance); - cJSON_AddStringToObject(cj_param, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddNumberToObject(cj_param, ezlopi_value_str, ultrasonic_sensor->distance); + cJSON *cj_param = (cJSON *)arg; + s_ultrasonic_sensor_t *ultrasonic_sensor = (s_ultrasonic_sensor_t *)item->user_arg; + if (cj_param && ultrasonic_sensor) + { + cJSON_AddNumberToObject(cj_param, ezlopi_value_str, ultrasonic_sensor->distance); + char *valueFormatted = ezlopi_valueformatter_float(ultrasonic_sensor->distance); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_param, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } } - return ret; } @@ -109,56 +113,59 @@ static int __init(l_ezlopi_item_t *item) int ret = 0; if (item) { - if (GPIO_IS_VALID_OUTPUT_GPIO(item->interface.gpio.gpio_out.gpio_num)) + s_ultrasonic_sensor_t *ultrasonic_HCSR04_sensor = (s_ultrasonic_sensor_t *)item->user_arg; + if (ultrasonic_HCSR04_sensor) { - const gpio_config_t io_conf = { - .pin_bit_mask = (1ULL << item->interface.gpio.gpio_out.gpio_num), - .mode = GPIO_MODE_OUTPUT, - .pull_up_en = ((item->interface.gpio.gpio_out.pull == GPIO_PULLUP_ONLY) || - (item->interface.gpio.gpio_out.pull == GPIO_PULLUP_PULLDOWN)) - ? GPIO_PULLUP_ENABLE - : GPIO_PULLUP_DISABLE, - .pull_down_en = ((item->interface.gpio.gpio_out.pull == GPIO_PULLDOWN_ONLY) || - (item->interface.gpio.gpio_out.pull == GPIO_PULLUP_PULLDOWN)) - ? GPIO_PULLDOWN_ENABLE - : GPIO_PULLDOWN_DISABLE, - .intr_type = GPIO_INTR_DISABLE, - }; - - gpio_config(&io_conf); - ret = 1; - } - - if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) - { - const gpio_config_t io_conf = { - .pin_bit_mask = (1ULL << item->interface.gpio.gpio_in.gpio_num), - .mode = GPIO_MODE_INPUT, - .pull_up_en = ((item->interface.gpio.gpio_in.pull == GPIO_PULLUP_ONLY) || - (item->interface.gpio.gpio_in.pull == GPIO_PULLUP_PULLDOWN)) - ? GPIO_PULLUP_ENABLE - : GPIO_PULLUP_DISABLE, - .pull_down_en = ((item->interface.gpio.gpio_in.pull == GPIO_PULLDOWN_ONLY) || - (item->interface.gpio.gpio_in.pull == GPIO_PULLUP_PULLDOWN)) - ? GPIO_PULLDOWN_ENABLE - : GPIO_PULLDOWN_DISABLE, - .intr_type = (GPIO_PULLUP_ONLY == item->interface.gpio.gpio_in.pull) - ? GPIO_INTR_POSEDGE - : GPIO_INTR_NEGEDGE, - }; - - gpio_config(&io_conf); - ret = 1; - } - if (0 == ret) - { - ret = -1; - if (item->user_arg) + if (GPIO_IS_VALID_OUTPUT_GPIO(item->interface.gpio.gpio_out.gpio_num)) + { + const gpio_config_t io_conf = { + .pin_bit_mask = (1ULL << item->interface.gpio.gpio_out.gpio_num), + .mode = GPIO_MODE_OUTPUT, + .pull_up_en = ((item->interface.gpio.gpio_out.pull == GPIO_PULLUP_ONLY) || + (item->interface.gpio.gpio_out.pull == GPIO_PULLUP_PULLDOWN)) + ? GPIO_PULLUP_ENABLE + : GPIO_PULLUP_DISABLE, + .pull_down_en = ((item->interface.gpio.gpio_out.pull == GPIO_PULLDOWN_ONLY) || + (item->interface.gpio.gpio_out.pull == GPIO_PULLUP_PULLDOWN)) + ? GPIO_PULLDOWN_ENABLE + : GPIO_PULLDOWN_DISABLE, + .intr_type = GPIO_INTR_DISABLE, + }; + + ret = (0 == gpio_config(&io_conf)) ? 1 : -1; + } + else if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) + { + const gpio_config_t io_conf = { + .pin_bit_mask = (1ULL << item->interface.gpio.gpio_in.gpio_num), + .mode = GPIO_MODE_INPUT, + .pull_up_en = ((item->interface.gpio.gpio_in.pull == GPIO_PULLUP_ONLY) || + (item->interface.gpio.gpio_in.pull == GPIO_PULLUP_PULLDOWN)) + ? GPIO_PULLUP_ENABLE + : GPIO_PULLUP_DISABLE, + .pull_down_en = ((item->interface.gpio.gpio_in.pull == GPIO_PULLDOWN_ONLY) || + (item->interface.gpio.gpio_in.pull == GPIO_PULLUP_PULLDOWN)) + ? GPIO_PULLDOWN_ENABLE + : GPIO_PULLDOWN_DISABLE, + .intr_type = (GPIO_PULLUP_ONLY == item->interface.gpio.gpio_in.pull) + ? GPIO_INTR_POSEDGE + : GPIO_INTR_NEGEDGE, + }; + + ret = (0 == gpio_config(&io_conf)) ? 1 : -1; + } + if (1 != ret) { - free(item->user_arg); + free(item->user_arg); // this will free ; memory address linked to all items item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); } } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); + } } return ret; diff --git a/ezlopi-sensors-devices/sensor-0025-digitalIn-LDR/sensor_0025_digitalIn_LDR.c b/ezlopi-sensors-devices/sensor-0025-digitalIn-LDR/sensor_0025_digitalIn_LDR.c index 771e5b2e7..d041a8011 100644 --- a/ezlopi-sensors-devices/sensor-0025-digitalIn-LDR/sensor_0025_digitalIn_LDR.c +++ b/ezlopi-sensors-devices/sensor-0025-digitalIn-LDR/sensor_0025_digitalIn_LDR.c @@ -85,19 +85,19 @@ static int __init(l_ezlopi_item_t *item) if (ESP_OK == gpio_config(&io_conf)) { item->interface.gpio.gpio_in.value = gpio_get_level(item->interface.gpio.gpio_in.gpio_num); + gpio_isr_service_register_v3(item, __value_updated_from_interrupt, 200); + ret = 1; + } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); } - - gpio_isr_service_register_v3(item, __value_updated_from_interrupt, 200); - ret = 1; } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } return ret; diff --git a/ezlopi-sensors-devices/sensor-0026-ADC-LDR/sensor_0026_ADC_LDR.c b/ezlopi-sensors-devices/sensor-0026-ADC-LDR/sensor_0026_ADC_LDR.c index 67a690cde..78ae78508 100644 --- a/ezlopi-sensors-devices/sensor-0026-ADC-LDR/sensor_0026_ADC_LDR.c +++ b/ezlopi-sensors-devices/sensor-0026-ADC-LDR/sensor_0026_ADC_LDR.c @@ -137,17 +137,15 @@ static int __init(l_ezlopi_item_t *item) { if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) { - ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit); - ret = 1; + if (0 == ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit)) + { + ret = 1; + } } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } return ret; @@ -172,8 +170,8 @@ static int _get_item_list(l_ezlopi_item_t *item, void *arg) } cJSON_AddItemToObject(cj_result, ezlopi_enum_str, json_array_enum); } - cJSON_AddStringToObject(cj_result, ezlopi_value_str, ((char *)item->user_arg) ? item->user_arg : light_alarm_states[0]); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, ((char *)item->user_arg) ? item->user_arg : light_alarm_states[0]); + cJSON_AddStringToObject(cj_result, ezlopi_value_str, ((char *)item->user_arg) ? item->user_arg : "no_light"); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, ((char *)item->user_arg) ? item->user_arg : "no_light"); ret = 1; } @@ -186,8 +184,8 @@ static int __get_value_cjson(l_ezlopi_item_t *item, void *arg) cJSON *cj_result = (cJSON *)arg; if (cj_result && item) { - cJSON_AddStringToObject(cj_result, ezlopi_value_str, ((char *)item->user_arg) ? item->user_arg : light_alarm_states[0]); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, ((char *)item->user_arg) ? item->user_arg : light_alarm_states[0]); + cJSON_AddStringToObject(cj_result, ezlopi_value_str, ((char *)item->user_arg) ? item->user_arg : "no_light"); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, ((char *)item->user_arg) ? item->user_arg : "no_light"); ret = 1; } return ret; @@ -204,11 +202,11 @@ static int __notify(l_ezlopi_item_t *item) char *curr_ldr_state = NULL; if (((float)(4096 - ezlopi_analog_data.value) / 4096.0f) > 0.5f) // pot_val : [100% - 30%] { - curr_ldr_state = (char *)light_alarm_states[0]; // no light + curr_ldr_state = "no_light"; // no light } else { - curr_ldr_state = (char *)light_alarm_states[1]; // light detected + curr_ldr_state = "light_detected"; // light detected } if (curr_ldr_state != (char *)item->user_arg) { diff --git a/ezlopi-sensors-devices/sensor-0027-ADC-waterLeak/sensor_0027_ADC_waterLeak.c b/ezlopi-sensors-devices/sensor-0027-ADC-waterLeak/sensor_0027_ADC_waterLeak.c index f68385030..e9035448b 100644 --- a/ezlopi-sensors-devices/sensor-0027-ADC-waterLeak/sensor_0027_ADC_waterLeak.c +++ b/ezlopi-sensors-devices/sensor-0027-ADC-waterLeak/sensor_0027_ADC_waterLeak.c @@ -13,7 +13,6 @@ #include "sensor_0027_ADC_waterLeak.h" - const char *water_leak_alarm_states[] = { "no_water_leak", "water_leak_detected", @@ -214,17 +213,15 @@ static int __init(l_ezlopi_item_t *item) { if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) { - ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit); - ret = 1; + if (0 == ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit)) + { + ret = 1; + } } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } diff --git a/ezlopi-sensors-devices/sensor-0028-other-GY61/sensor_0028_other_GY61.c b/ezlopi-sensors-devices/sensor-0028-other-GY61/sensor_0028_other_GY61.c index 8ec9438b7..3cb8bc06e 100644 --- a/ezlopi-sensors-devices/sensor-0028-other-GY61/sensor_0028_other_GY61.c +++ b/ezlopi-sensors-devices/sensor-0028-other-GY61/sensor_0028_other_GY61.c @@ -1,6 +1,5 @@ #include #include "ezlopi_util_trace.h" - #include "ezlopi_core_timer.h" #include "ezlopi_core_cloud.h" @@ -179,22 +178,38 @@ static int __0028_prepare(void *arg) static int __0028_init(l_ezlopi_item_t *item) { int ret = 0; - if (NULL != item) + if (item) { - if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) - { - ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit); - ret = 1; - } - if (0 == ret) + s_gy61_data_t *user_data = (s_gy61_data_t *)item->user_arg; + if (user_data) { - ret = -1; - if (item->user_arg) + if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + { + if (0 == ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit)) + { + ret = 1; + } + else + { + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); + } + } + else { - free(item->user_arg); + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); } } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); + } } return ret; } @@ -210,27 +225,36 @@ static int __0028_get_cjson_value(l_ezlopi_item_t *item, void *arg) s_gy61_data_t *user_data = ((s_gy61_data_t *)item->user_arg); if (ezlopi_item_name_acceleration_x_axis == item->cloud_properties.item_name) { - char *valueFormatted = ezlopi_valueformatter_float(user_data->x_data); - cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); cJSON_AddNumberToObject(cj_result, "value", (user_data->x_data)); - // TRACE_S("x-axis-G : %.2f", user_data->x_data); - free(valueFormatted); + // TRACE_I("x-axis-G : %.2f", user_data->x_data); + char *valueFormatted = ezlopi_valueformatter_float(user_data->x_data); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } } if (ezlopi_item_name_acceleration_y_axis == item->cloud_properties.item_name) { - char *valueFormatted = ezlopi_valueformatter_float(user_data->y_data); - cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); cJSON_AddNumberToObject(cj_result, "value", (user_data->y_data)); - // TRACE_S("y-axis-G : %.2f", user_data->y_data); - free(valueFormatted); + // TRACE_I("y-axis-G : %.2f", user_data->y_data); + char *valueFormatted = ezlopi_valueformatter_float(user_data->y_data); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } } if (ezlopi_item_name_acceleration_z_axis == item->cloud_properties.item_name) { - char *valueFormatted = ezlopi_valueformatter_float(user_data->z_data); - cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); cJSON_AddNumberToObject(cj_result, "value", (user_data->z_data)); - // TRACE_S("z-axis-G : %.2f", user_data->z_data); - free(valueFormatted); + // TRACE_I("z-axis-G : %.2f", user_data->z_data); + char *valueFormatted = ezlopi_valueformatter_float(user_data->z_data); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } } ret = 1; } @@ -244,36 +268,39 @@ static int __0028_notify(l_ezlopi_item_t *item) if (item) { s_gy61_data_t *user_data = (s_gy61_data_t *)item->user_arg; - float new_value = 0; - if (ezlopi_item_name_acceleration_x_axis == item->cloud_properties.item_name) + if (user_data) { - new_value = __update_gy61_axis_value(item); - - if (fabs((user_data->x_data) - new_value) > 0.5) + float new_value = 0; + if (ezlopi_item_name_acceleration_x_axis == item->cloud_properties.item_name) { - user_data->x_data = new_value; - ezlopi_device_value_updated_from_device_v3(item); + new_value = __update_gy61_axis_value(item); + + if (fabs((user_data->x_data) - new_value) > 0.5) + { + user_data->x_data = new_value; + ezlopi_device_value_updated_from_device_v3(item); + } } - } - if (ezlopi_item_name_acceleration_y_axis == item->cloud_properties.item_name) - { - new_value = __update_gy61_axis_value(item); - if (fabs((user_data->y_data) - new_value) > 0.5) + if (ezlopi_item_name_acceleration_y_axis == item->cloud_properties.item_name) { - user_data->y_data = new_value; - ezlopi_device_value_updated_from_device_v3(item); + new_value = __update_gy61_axis_value(item); + if (fabs((user_data->y_data) - new_value) > 0.5) + { + user_data->y_data = new_value; + ezlopi_device_value_updated_from_device_v3(item); + } } - } - if (ezlopi_item_name_acceleration_z_axis == item->cloud_properties.item_name) - { - new_value = __update_gy61_axis_value(item); - if (fabs((user_data->z_data) - new_value) > 0.5) + if (ezlopi_item_name_acceleration_z_axis == item->cloud_properties.item_name) { - user_data->z_data = new_value; - ezlopi_device_value_updated_from_device_v3(item); + new_value = __update_gy61_axis_value(item); + if (fabs((user_data->z_data) - new_value) > 0.5) + { + user_data->z_data = new_value; + ezlopi_device_value_updated_from_device_v3(item); + } } + ret = 1; } - ret = 1; } return ret; } diff --git a/ezlopi-sensors-devices/sensor-0029-I2C-GXHTC3/sensor_0029_I2C_GXHTC3.c b/ezlopi-sensors-devices/sensor-0029-I2C-GXHTC3/sensor_0029_I2C_GXHTC3.c index 803e9dec5..172b668a6 100644 --- a/ezlopi-sensors-devices/sensor-0029-I2C-GXHTC3/sensor_0029_I2C_GXHTC3.c +++ b/ezlopi-sensors-devices/sensor-0029-I2C-GXHTC3/sensor_0029_I2C_GXHTC3.c @@ -39,40 +39,28 @@ static int gxhtc3_sensor_init(l_ezlopi_item_t *item) gxhtce_val->gxhtc3 = GXHTC3_init(item->interface.i2c_master.channel, item->interface.i2c_master.address); if (gxhtce_val->gxhtc3) { + ret = 1; if (gxhtce_val->gxhtc3->id.status) { TRACE_E("GXHTC3 Chip ID: 0x%x", gxhtce_val->gxhtc3->id.id); } else { - ret = -1; TRACE_E("GXHTC3 Chip ID not ready!"); + ret = -1; + free(item->user_arg); + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); } } } } - else - { - ret = 1; - } } else { - ret = 1; + ret = -1; + ezlopi_device_free_device_by_item(item); } - // if (-1 == ret) - // { - // ret = -1; - // if (item->user_arg) - // { - // free(item->user_arg); - // item->user_arg = NULL; - // } - // } - } - else - { - ret = 1; } return ret; @@ -293,7 +281,7 @@ static int __prepare(void *arg) if (value_ptr) { memset(value_ptr, 0, sizeof(s_gxhtc3_value_t)); - + l_ezlopi_device_t *device_temp = ezlopi_device_add_device(prep_arg->cjson_device); if (device_temp) { @@ -309,7 +297,7 @@ static int __prepare(void *arg) else { ezlopi_device_free_device(device_temp); - free(value_ptr); + free(value_ptr); // set to NULL? ret = -1; } } @@ -323,7 +311,7 @@ static int __prepare(void *arg) item_humdity->cloud_properties.device_id = device_hum->cloud_properties.device_id; __prepare_humidity_item_properties(item_humdity, prep_arg->cjson_device); value_ptr->humidity = 65536.0f; - item_humdity->user_arg = (void *)value_ptr; + item_humdity->user_arg = (void *)value_ptr; // affected if 'value_pts' is already freed? } else { diff --git a/ezlopi-sensors-devices/sensor-0030-oneWire-DS18B20/sensor_0030_oneWire_DS18B20.c b/ezlopi-sensors-devices/sensor-0030-oneWire-DS18B20/sensor_0030_oneWire_DS18B20.c index f179228d0..98c857d4c 100644 --- a/ezlopi-sensors-devices/sensor-0030-oneWire-DS18B20/sensor_0030_oneWire_DS18B20.c +++ b/ezlopi-sensors-devices/sensor-0030-oneWire-DS18B20/sensor_0030_oneWire_DS18B20.c @@ -13,20 +13,20 @@ #include "ds18b20_onewire.h" #include "sensor_0030_oneWire_DS18B20.h" -static int __prepare(void* arg); -static int __init(l_ezlopi_item_t* item); -static int __notify(l_ezlopi_item_t* item); -static int __get_cjson_value(l_ezlopi_item_t* item, void* arg); +static int __prepare(void *arg); +static int __init(l_ezlopi_item_t *item); +static int __notify(l_ezlopi_item_t *item); +static int __get_cjson_value(l_ezlopi_item_t *item, void *arg); -static esp_err_t ds18b20_write_data(uint8_t* data, uint32_t gpio_pin); -static esp_err_t ds18b20_read_data(uint8_t* data, uint32_t gpio_pin); +static esp_err_t ds18b20_write_data(uint8_t *data, uint32_t gpio_pin); +static esp_err_t ds18b20_read_data(uint8_t *data, uint32_t gpio_pin); static bool ds18b20_reset_line(uint32_t gpio_pin); static esp_err_t ds18b20_write_to_scratchpad(uint8_t th_val, uint8_t tl_val, uint8_t resolution, uint8_t gpio_pin); static bool ds18b20_recognize_device(uint32_t gpio_pin); -static esp_err_t ds18b20_get_temperature_data(double* temperature_data, uint32_t gpio_pin); -static uint8_t ds18b20_calculate_crc(const uint8_t* data, uint8_t len); +static esp_err_t ds18b20_get_temperature_data(double *temperature_data, uint32_t gpio_pin); +static uint8_t ds18b20_calculate_crc(const uint8_t *data, uint8_t len); -int sensor_0030_oneWire_DS18B20(e_ezlopi_actions_t action, l_ezlopi_item_t* item, void* arg, void* user_arg) +int sensor_0030_oneWire_DS18B20(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void *arg, void *user_arg) { int ret = 0; switch (action) @@ -60,10 +60,10 @@ int sensor_0030_oneWire_DS18B20(e_ezlopi_actions_t action, l_ezlopi_item_t* item return ret; } -static int __notify(l_ezlopi_item_t* item) +static int __notify(l_ezlopi_item_t *item) { int ret = 0; - double* temperature_prev_value = (double*)item->user_arg; + double *temperature_prev_value = (double *)item->user_arg; double temperature_current_value = 0.00; esp_err_t error = ds18b20_get_temperature_data(&temperature_current_value, item->interface.onewire_master.onewire_pin); if (ESP_OK == error) @@ -79,16 +79,16 @@ static int __notify(l_ezlopi_item_t* item) return ret; } -static int __get_cjson_value(l_ezlopi_item_t* item, void* arg) +static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) { int ret = 0; if (item && arg) { - cJSON* cj_result = (cJSON*)arg; - double* temperatue_value = (double*)item->user_arg; + cJSON *cj_result = (cJSON *)arg; + double *temperatue_value = (double *)item->user_arg; cJSON_AddNumberToObject(cj_result, ezlopi_value_str, *temperatue_value); - char* valueFormatted = ezlopi_valueformatter_double(*temperatue_value); + char *valueFormatted = ezlopi_valueformatter_double(*temperatue_value); cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); free(valueFormatted); cJSON_AddStringToObject(cj_result, ezlopi_scale_str, scales_celsius); @@ -96,47 +96,42 @@ static int __get_cjson_value(l_ezlopi_item_t* item, void* arg) return ret; } -static int __init(l_ezlopi_item_t* item) +static int __init(l_ezlopi_item_t *item) { int ret = -1; - if (item) + if ((item) && (item->interface.onewire_master.enable)) { - if (item->interface.onewire_master.enable) + if (GPIO_IS_VALID_GPIO(item->interface.onewire_master.onewire_pin) && + ds18b20_reset_line(item->interface.onewire_master.onewire_pin)) { - if (ds18b20_reset_line(item->interface.onewire_master.onewire_pin)) + if (ds18b20_recognize_device(item->interface.onewire_master.onewire_pin)) { - if (ds18b20_recognize_device(item->interface.onewire_master.onewire_pin)) - { - double* temperature_prev_value = (double*)item->user_arg; - TRACE_S("Providing initial settings to DS18B20"); - ds18b20_write_to_scratchpad(DS18B20_TH_HIGHER_THRESHOLD, DS18B20_TL_LOWER_THRESHOLD, 12, item->interface.onewire_master.onewire_pin); - ds18b20_get_temperature_data(temperature_prev_value, item->interface.onewire_master.onewire_pin); - ret = 1; - } - else - { - ret = -1; - } + double *temperature_prev_value = (double *)item->user_arg; + TRACE_D("Providing initial settings to DS18B20"); + ds18b20_write_to_scratchpad(DS18B20_TH_HIGHER_THRESHOLD, DS18B20_TL_LOWER_THRESHOLD, 12, item->interface.onewire_master.onewire_pin); + ds18b20_get_temperature_data(temperature_prev_value, item->interface.onewire_master.onewire_pin); + ret = 1; } else { ret = -1; - } - - if (-1 == ret) - { if (item->user_arg) { - free(item->user_arg); + free(item->user_arg); // this will free ; memory address linked to all items item->user_arg = NULL; } } } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); + } } return ret; } -static void __prepare_device_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device) +static void __prepare_device_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device) { // char *device_name = NULL; // CJSON_GET_VALUE_STRING(cj_device, ezlopi_dev_name_str, device_name); @@ -150,7 +145,7 @@ static void __prepare_device_cloud_properties(l_ezlopi_device_t* device, cJSON* device->cloud_properties.device_type_id = NULL; } -static void __prepare_item_properties(l_ezlopi_item_t* item, cJSON* cj_device) +static void __prepare_item_properties(l_ezlopi_item_t *item, cJSON *cj_device) { CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); item->cloud_properties.show = true; @@ -166,29 +161,29 @@ static void __prepare_item_properties(l_ezlopi_item_t* item, cJSON* cj_device) CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.onewire_master.onewire_pin); } -static int __prepare(void* arg) +static int __prepare(void *arg) { int ret = 0; - s_ezlopi_prep_arg_t* prep_arg = (s_ezlopi_prep_arg_t*)arg; + s_ezlopi_prep_arg_t *prep_arg = (s_ezlopi_prep_arg_t *)arg; if (prep_arg && prep_arg->cjson_device) { - l_ezlopi_device_t* device = ezlopi_device_add_device(prep_arg->cjson_device); + l_ezlopi_device_t *device = ezlopi_device_add_device(prep_arg->cjson_device); if (device) { __prepare_device_cloud_properties(device, prep_arg->cjson_device); - l_ezlopi_item_t* item_temperature = ezlopi_device_add_item_to_device(device, sensor_0030_oneWire_DS18B20); + l_ezlopi_item_t *item_temperature = ezlopi_device_add_item_to_device(device, sensor_0030_oneWire_DS18B20); if (item_temperature) { item_temperature->cloud_properties.device_id = device->cloud_properties.device_id; __prepare_item_properties(item_temperature, prep_arg->cjson_device); - double* temperature_value = (double*)malloc(sizeof(double)); + double *temperature_value = (double *)malloc(sizeof(double)); if (temperature_value) { memset(temperature_value, 0, sizeof(double)); *temperature_value = 65536.0f; - item_temperature->user_arg = (void*)temperature_value; + item_temperature->user_arg = (void *)temperature_value; } ret = 1; } @@ -203,14 +198,14 @@ static int __prepare(void* arg) return ret; } -static esp_err_t ds18b20_write_data(uint8_t* data, uint32_t gpio_pin) +static esp_err_t ds18b20_write_data(uint8_t *data, uint32_t gpio_pin) { esp_err_t error = ESP_OK; error = one_wire_write_byte_to_line(data, gpio_pin); return error; } -static esp_err_t ds18b20_read_data(uint8_t* data, uint32_t gpio_pin) +static esp_err_t ds18b20_read_data(uint8_t *data, uint32_t gpio_pin) { esp_err_t error = ESP_OK; error = one_wire_read_byte_from_line(data, gpio_pin); @@ -283,7 +278,7 @@ static bool ds18b20_recognize_device(uint32_t gpio_pin) return (data_from_ds18b20 == DS18B20_FAMILY_CODE) ? true : false; } -static esp_err_t ds18b20_get_temperature_data(double* temperature_data, uint32_t gpio_pin) +static esp_err_t ds18b20_get_temperature_data(double *temperature_data, uint32_t gpio_pin) { esp_err_t error = ESP_OK; uint8_t ds18b20_skip_rom = DS18B20_ROM_COMMAND_SKIP_ROM; @@ -351,7 +346,7 @@ static esp_err_t ds18b20_get_temperature_data(double* temperature_data, uint32_t return error; } -static uint8_t ds18b20_calculate_crc(const uint8_t* data, uint8_t len) +static uint8_t ds18b20_calculate_crc(const uint8_t *data, uint8_t len) { uint8_t crc = 0; uint8_t length = len; diff --git a/ezlopi-sensors-devices/sensor-0031-other-JSNSR04T/sensor_0031_other_JSNSR04T.c b/ezlopi-sensors-devices/sensor-0031-other-JSNSR04T/sensor_0031_other_JSNSR04T.c index bd2586bf1..979262e1d 100644 --- a/ezlopi-sensors-devices/sensor-0031-other-JSNSR04T/sensor_0031_other_JSNSR04T.c +++ b/ezlopi-sensors-devices/sensor-0031-other-JSNSR04T/sensor_0031_other_JSNSR04T.c @@ -59,7 +59,6 @@ static int __notify(l_ezlopi_item_t *item) static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) { int ret = 0; - if (item && arg) { cJSON *cj_result = (cJSON *)arg; @@ -76,8 +75,11 @@ static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) cJSON_AddNumberToObject(cj_result, ezlopi_value_str, distance); char *valueFormatted = ezlopi_valueformatter_float(distance); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - free(valueFormatted); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } cJSON_AddStringToObject(cj_result, ezlopi_scale_str, scales_meter); ret = 1; } @@ -94,7 +96,6 @@ static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) static int __init(l_ezlopi_item_t *item) { int ret = 0; - if (item) { jsn_sr04t_config_t *jsn_sr04t_config = malloc(sizeof(jsn_sr04t_config_t)); @@ -118,9 +119,15 @@ static int __init(l_ezlopi_item_t *item) ret = -1; item->user_arg = NULL; free(jsn_sr04t_config); + ezlopi_device_free_device_by_item(item); TRACE_E("JSN_SR04T not initializeed"); } } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); + } } return ret; diff --git a/ezlopi-sensors-devices/sensor-0032-ADC-soilMoisture/sensor_0032_ADC_soilMoisture.c b/ezlopi-sensors-devices/sensor-0032-ADC-soilMoisture/sensor_0032_ADC_soilMoisture.c index a0228b42b..502c1dfa3 100644 --- a/ezlopi-sensors-devices/sensor-0032-ADC-soilMoisture/sensor_0032_ADC_soilMoisture.c +++ b/ezlopi-sensors-devices/sensor-0032-ADC-soilMoisture/sensor_0032_ADC_soilMoisture.c @@ -80,12 +80,18 @@ static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) { cJSON *cj_result = (cJSON *)arg; s_ezlopi_analog_data_t *soil_moisture_data = (s_ezlopi_analog_data_t *)item->user_arg; - double percent_data = ((4095 - soil_moisture_data->value) / 4095.0) * 100; - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, percent_data); - char *valueFormatted = ezlopi_valueformatter_double(percent_data); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - free(valueFormatted); - ret = 1; + if (soil_moisture_data) + { + double percent_data = ((4095 - soil_moisture_data->value) / 4095.0) * 100; + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, percent_data); + char *valueFormatted = ezlopi_valueformatter_double(percent_data); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + ret = 1; + } } return ret; } @@ -97,17 +103,15 @@ static int __init(l_ezlopi_item_t *item) { if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) { - ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit); - ret = 1; + if (0 == ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit)) + { + ret = 1; + } } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } return ret; diff --git a/ezlopi-sensors-devices/sensor-0033-ADC-turbidity/sensor_0033_ADC_turbidity.c b/ezlopi-sensors-devices/sensor-0033-ADC-turbidity/sensor_0033_ADC_turbidity.c index 99621243c..d176cfe41 100644 --- a/ezlopi-sensors-devices/sensor-0033-ADC-turbidity/sensor_0033_ADC_turbidity.c +++ b/ezlopi-sensors-devices/sensor-0033-ADC-turbidity/sensor_0033_ADC_turbidity.c @@ -13,19 +13,19 @@ #include "sensor_0033_ADC_turbidity.h" -static int __prepare(void* arg); -static int __init(l_ezlopi_item_t* item); -static int __notify(l_ezlopi_item_t* item); -static int __get_cjson_value(l_ezlopi_item_t* item, void* arg); -static int __get_item_list(l_ezlopi_item_t* item, void* arg); +static int __prepare(void *arg); +static int __init(l_ezlopi_item_t *item); +static int __notify(l_ezlopi_item_t *item); +static int __get_cjson_value(l_ezlopi_item_t *item, void *arg); +static int __get_item_list(l_ezlopi_item_t *item, void *arg); -static const char* water_filter_replacement_alarm_states[] = { +static const char *water_filter_replacement_alarm_states[] = { "water_filter_ok", "replace_water_filter", "unknown", }; -int sensor_0033_ADC_turbidity(e_ezlopi_actions_t action, l_ezlopi_item_t* item, void* arg, void* user_arg) +int sensor_0033_ADC_turbidity(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void *arg, void *user_arg) { int ret = 0; switch (action) @@ -63,18 +63,18 @@ int sensor_0033_ADC_turbidity(e_ezlopi_actions_t action, l_ezlopi_item_t* item, return ret; } -static int __get_item_list(l_ezlopi_item_t* item, void* arg) +static int __get_item_list(l_ezlopi_item_t *item, void *arg) { int ret = 0; - cJSON* cjson_propertise = (cJSON*)arg; + cJSON *cjson_propertise = (cJSON *)arg; if (cjson_propertise) { - cJSON* json_array_enum = cJSON_CreateArray(); + cJSON *json_array_enum = cJSON_CreateArray(); if (NULL != json_array_enum) { for (uint8_t i = 0; i < TURBIDITY__MAX; i++) { - cJSON* json_value = cJSON_CreateString(water_filter_replacement_alarm_states[i]); + cJSON *json_value = cJSON_CreateString(water_filter_replacement_alarm_states[i]); if (NULL != json_value) { cJSON_AddItemToArray(json_array_enum, json_value); @@ -83,11 +83,11 @@ static int __get_item_list(l_ezlopi_item_t* item, void* arg) cJSON_AddItemToObject(cjson_propertise, ezlopi_enum_str, json_array_enum); } - s_ezlopi_analog_data_t ezlopi_analog_data = { .value = 0, .voltage = 0 }; + s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; ezlopi_adc_get_adc_data(item->interface.adc.gpio_num, &ezlopi_analog_data); TRACE_I("Value is: %d, voltage is: %d", ezlopi_analog_data.value, ezlopi_analog_data.voltage); - const char* ezlopi_water_present_turbidity_state = NULL; + const char *ezlopi_water_present_turbidity_state = NULL; if (1000 > ezlopi_analog_data.voltage) { ezlopi_water_present_turbidity_state = "replace_water_filter"; @@ -112,15 +112,15 @@ static int __get_item_list(l_ezlopi_item_t* item, void* arg) return ret; } -static int __notify(l_ezlopi_item_t* item) +static int __notify(l_ezlopi_item_t *item) { int ret = 0; - const char* tmp_sensor_state = NULL; - char* turbidity_sensor_state = (char*)item->user_arg; + const char *tmp_sensor_state = NULL; + char *turbidity_sensor_state = (char *)item->user_arg; if (turbidity_sensor_state) { - s_ezlopi_analog_data_t tmp_analog_data = { .value = 0, .voltage = 0 }; + s_ezlopi_analog_data_t tmp_analog_data = {.value = 0, .voltage = 0}; ezlopi_adc_get_adc_data(item->interface.adc.gpio_num, &tmp_analog_data); if (1000 > tmp_analog_data.voltage) { @@ -140,13 +140,13 @@ static int __notify(l_ezlopi_item_t* item) return ret; } -static int __get_cjson_value(l_ezlopi_item_t* item, void* arg) +static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) { int ret = 0; if (item && arg) { - cJSON* cj_result = (cJSON*)arg; - char* turbidity_sensor_state = (char*)item->user_arg; + cJSON *cj_result = (cJSON *)arg; + char *turbidity_sensor_state = (char *)item->user_arg; if (turbidity_sensor_state) { cJSON_AddStringToObject(cj_result, ezlopi_value_str, turbidity_sensor_state); @@ -157,30 +157,28 @@ static int __get_cjson_value(l_ezlopi_item_t* item, void* arg) return ret; } -static int __init(l_ezlopi_item_t* item) +static int __init(l_ezlopi_item_t *item) { int ret = 0; if (item) { if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) { - ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit); - ret = 1; + if (0 == ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit)) + { + ret = 1; + } } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } return ret; } -static void __prepare_device_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device) +static void __prepare_device_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device) { // char *device_name = NULL; // CJSON_GET_VALUE_STRING(cj_device, ezlopi_dev_name_str, device_name); @@ -194,7 +192,7 @@ static void __prepare_device_cloud_properties(l_ezlopi_device_t* device, cJSON* device->cloud_properties.device_type_id = NULL; } -static void __prepare_item_properties(l_ezlopi_item_t* item, cJSON* cj_device, void* user_arg) +static void __prepare_item_properties(l_ezlopi_item_t *item, cJSON *cj_device, void *user_arg) { item->cloud_properties.has_getter = true; item->cloud_properties.has_setter = false; @@ -210,27 +208,27 @@ static void __prepare_item_properties(l_ezlopi_item_t* item, cJSON* cj_device, v item->user_arg = user_arg; } -static int __prepare(void* arg) +static int __prepare(void *arg) { int ret = 0; - s_ezlopi_prep_arg_t* prep_arg = (s_ezlopi_prep_arg_t*)arg; + s_ezlopi_prep_arg_t *prep_arg = (s_ezlopi_prep_arg_t *)arg; if (prep_arg && prep_arg->cjson_device) { - l_ezlopi_device_t* device = ezlopi_device_add_device(prep_arg->cjson_device); + l_ezlopi_device_t *device = ezlopi_device_add_device(prep_arg->cjson_device); if (device) { __prepare_device_cloud_properties(device, prep_arg->cjson_device); - l_ezlopi_item_t* item_turbidity = ezlopi_device_add_item_to_device(device, sensor_0033_ADC_turbidity); + l_ezlopi_item_t *item_turbidity = ezlopi_device_add_item_to_device(device, sensor_0033_ADC_turbidity); if (item_turbidity) { item_turbidity->cloud_properties.device_id = device->cloud_properties.device_id; - char* turbidity_sensor_states = (char*)malloc(40 * sizeof(char)); + char *turbidity_sensor_states = (char *)malloc(40 * sizeof(char)); if (turbidity_sensor_states) { memset(turbidity_sensor_states, 0, sizeof(s_ezlopi_analog_data_t)); - __prepare_item_properties(item_turbidity, prep_arg->cjson_device, (void*)turbidity_sensor_states); + __prepare_item_properties(item_turbidity, prep_arg->cjson_device, (void *)turbidity_sensor_states); ret = 1; } } diff --git a/ezlopi-sensors-devices/sensor-0034-digitalIn-proximity/sensor_0034_digitalIn_proximity.c b/ezlopi-sensors-devices/sensor-0034-digitalIn-proximity/sensor_0034_digitalIn_proximity.c index fa8f69fc4..730bc57da 100644 --- a/ezlopi-sensors-devices/sensor-0034-digitalIn-proximity/sensor_0034_digitalIn_proximity.c +++ b/ezlopi-sensors-devices/sensor-0034-digitalIn-proximity/sensor_0034_digitalIn_proximity.c @@ -13,12 +13,12 @@ #include "sensor_0034_digitalIn_proximity.h" -static int proximity_sensor_prepare(void* args); -static int proximity_sensor_init(l_ezlopi_item_t* item); -static void proximity_sensor_value_updated_from_device(void* arg); -static int proximity_sensor_get_value_cjson(l_ezlopi_item_t* item, void* args); +static int proximity_sensor_prepare(void *args); +static int proximity_sensor_init(l_ezlopi_item_t *item); +static void proximity_sensor_value_updated_from_device(void *arg); +static int proximity_sensor_get_value_cjson(l_ezlopi_item_t *item, void *args); -int sensor_0034_digitalIn_proximity(e_ezlopi_actions_t action, l_ezlopi_item_t* item, void* args, void* user_arg) +int sensor_0034_digitalIn_proximity(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void *args, void *user_arg) { int ret = 0; @@ -50,7 +50,7 @@ int sensor_0034_digitalIn_proximity(e_ezlopi_actions_t action, l_ezlopi_item_t* return ret; } -static void proximity_sensor_setup_device_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device) +static void proximity_sensor_setup_device_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device) { if (device && cj_device) { @@ -67,7 +67,7 @@ static void proximity_sensor_setup_device_cloud_properties(l_ezlopi_device_t* de } } -static void proximity_sensor_setup_item_properties(l_ezlopi_item_t* item, cJSON* cj_device) +static void proximity_sensor_setup_item_properties(l_ezlopi_item_t *item, cJSON *cj_device) { if (item && cj_device) { @@ -91,18 +91,18 @@ static void proximity_sensor_setup_item_properties(l_ezlopi_item_t* item, cJSON* } } -static int proximity_sensor_prepare(void* args) +static int proximity_sensor_prepare(void *args) { int ret = 0; - s_ezlopi_prep_arg_t* device_prep_arg = (s_ezlopi_prep_arg_t*)args; + s_ezlopi_prep_arg_t *device_prep_arg = (s_ezlopi_prep_arg_t *)args; if ((NULL != device_prep_arg) && (NULL != device_prep_arg->cjson_device)) { - l_ezlopi_device_t* device = ezlopi_device_add_device(device_prep_arg->cjson_device); + l_ezlopi_device_t *device = ezlopi_device_add_device(device_prep_arg->cjson_device); if (device) { proximity_sensor_setup_device_cloud_properties(device, device_prep_arg->cjson_device); - l_ezlopi_item_t* item = ezlopi_device_add_item_to_device(device, sensor_0034_digitalIn_proximity); + l_ezlopi_item_t *item = ezlopi_device_add_item_to_device(device, sensor_0034_digitalIn_proximity); if (item) { item->cloud_properties.device_id = device->cloud_properties.device_id; @@ -120,7 +120,7 @@ static int proximity_sensor_prepare(void* args) return ret; } -static int proximity_sensor_init(l_ezlopi_item_t* item) +static int proximity_sensor_init(l_ezlopi_item_t *item) { int ret = 0; if (item) @@ -135,8 +135,7 @@ static int proximity_sensor_init(l_ezlopi_item_t* item) .intr_type = item->interface.gpio.gpio_in.interrupt, }; - ret = gpio_config(&io_conf); - if (ESP_OK == ret) + if (ESP_OK == gpio_config(&io_conf)) { gpio_isr_service_register_v3(item, proximity_sensor_value_updated_from_device, 200); item->interface.gpio.gpio_in.value = gpio_get_level(item->interface.gpio.gpio_in.gpio_num); @@ -145,36 +144,35 @@ static int proximity_sensor_init(l_ezlopi_item_t* item) } else { + ret = -1; + ezlopi_device_free_device_by_item(item); TRACE_E("Error initializing Proximity sensor"); } } - if (0 == ret) + else { + ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } return ret; } -static void proximity_sensor_value_updated_from_device(void* arg) +static void proximity_sensor_value_updated_from_device(void *arg) { - l_ezlopi_item_t* item = (l_ezlopi_item_t*)arg; + l_ezlopi_item_t *item = (l_ezlopi_item_t *)arg; if (item) { ezlopi_device_value_updated_from_device_v3(item); } } -static int proximity_sensor_get_value_cjson(l_ezlopi_item_t* item, void* args) +static int proximity_sensor_get_value_cjson(l_ezlopi_item_t *item, void *args) { int ret = 0; - cJSON* cj_result = (cJSON*)args; + cJSON *cj_result = (cJSON *)args; if (cj_result) { item->interface.gpio.gpio_in.value = gpio_get_level(item->interface.gpio.gpio_in.gpio_num); @@ -183,7 +181,7 @@ static int proximity_sensor_get_value_cjson(l_ezlopi_item_t* item, void* args) item->interface.gpio.gpio_in.value = item->interface.gpio.gpio_in.value ? false : true; } cJSON_AddBoolToObject(cj_result, ezlopi_value_str, item->interface.gpio.gpio_in.value); - const char* valueFormatted = ezlopi_valueformatter_bool(item->interface.gpio.gpio_in.value ? false : true); + const char *valueFormatted = ezlopi_valueformatter_bool(item->interface.gpio.gpio_in.value ? false : true); cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); ret = 1; // TRACE_D("value: %d", item->interface.gpio.gpio_in.value); diff --git a/ezlopi-sensors-devices/sensor-0035-digitalIn-touch-sensor-TPP223B/sensor_0035_digitalIn_touch_sensor_TPP223B.c b/ezlopi-sensors-devices/sensor-0035-digitalIn-touch-sensor-TPP223B/sensor_0035_digitalIn_touch_sensor_TPP223B.c index de1c4de36..266ae02b6 100644 --- a/ezlopi-sensors-devices/sensor-0035-digitalIn-touch-sensor-TPP223B/sensor_0035_digitalIn_touch_sensor_TPP223B.c +++ b/ezlopi-sensors-devices/sensor-0035-digitalIn-touch-sensor-TPP223B/sensor_0035_digitalIn_touch_sensor_TPP223B.c @@ -81,21 +81,23 @@ static int __init(l_ezlopi_item_t *item) .intr_type = item->interface.gpio.gpio_in.interrupt, }; - ESP_ERROR_CHECK(gpio_config(&touch_switch_config)); - - int gpio_level = gpio_get_level(item->interface.gpio.gpio_in.gpio_num); - item->interface.gpio.gpio_in.value = (false == item->interface.gpio.gpio_in.invert) ? gpio_level : !gpio_level; - gpio_isr_service_register_v3(item, __touch_switch_callback, 200); - ret = 1; + if (0 == gpio_config(&touch_switch_config)) + { + int gpio_level = gpio_get_level(item->interface.gpio.gpio_in.gpio_num); + item->interface.gpio.gpio_in.value = (false == item->interface.gpio.gpio_in.invert) ? gpio_level : !gpio_level; + gpio_isr_service_register_v3(item, __touch_switch_callback, 200); + ret = 1; + } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); + } } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } diff --git a/ezlopi-sensors-devices/sensor-0037-pms5003-sensor/CMakeLists.txt b/ezlopi-sensors-devices/sensor-0037-pms5003-sensor/CMakeLists.txt index 01331166f..5602dad19 100644 --- a/ezlopi-sensors-devices/sensor-0037-pms5003-sensor/CMakeLists.txt +++ b/ezlopi-sensors-devices/sensor-0037-pms5003-sensor/CMakeLists.txt @@ -7,6 +7,7 @@ set(EZLOPI_CORE_COMPONENTS ezlopi-core-actions ezlopi-core-devices ezlopi-core-timer + ezlopi-core-valueformatter ) set(EZLOPI_CLOUD_COMPONENTS ezlopi-cloud-constants diff --git a/ezlopi-sensors-devices/sensor-0037-pms5003-sensor/sensor_0037_pms5003_sensor.c b/ezlopi-sensors-devices/sensor-0037-pms5003-sensor/sensor_0037_pms5003_sensor.c index 7ca67a45d..9885477ac 100644 --- a/ezlopi-sensors-devices/sensor-0037-pms5003-sensor/sensor_0037_pms5003_sensor.c +++ b/ezlopi-sensors-devices/sensor-0037-pms5003-sensor/sensor_0037_pms5003_sensor.c @@ -4,14 +4,14 @@ #include "cJSON.h" #include "ezlopi_util_trace.h" -#include "ezlopi_core_timer.h" +#include "ezlopi_core_timer.h" #include "ezlopi_core_devices_list.h" #include "ezlopi_core_device_value_updated.h" -#include "ezlopi_cloud_constants.h" - #include "ezlopi_core_cloud.h" +#include "ezlopi_core_valueformatter.h" +#include "ezlopi_cloud_constants.h" #include "pms5003.h" #include "sensor_0037_pms5003_sensor.h" @@ -91,63 +91,98 @@ static int __cjson_get_value(l_ezlopi_item_t *item, void *arg) cJSON *cj_param = (cJSON *)arg; s_pms5003_sensor_object *pms_object = (s_pms5003_sensor_object *)item->user_arg; - char valueFormatted[20]; if (cj_param && pms_object) { if (ezlopi_item_name_particulate_matter_1 == item->cloud_properties.item_name) { - snprintf(valueFormatted, 20, "%d", pms_object->pms_data.pm10_standard); - TRACE_S("Dust particle 1 : %s", valueFormatted); - cJSON_AddStringToObject(cj_param, "valueFormatted", valueFormatted); - cJSON_AddNumberToObject(cj_param, "value", pms_object->pms_data.pm10_standard); + cJSON_AddNumberToObject(cj_param, ezlopi_value_str, pms_object->pms_data.pm10_standard); + char *valueFormatted = ezlopi_valueformatter_uint32(pms_object->pms_data.pm10_standard); + if (valueFormatted) + { + TRACE_I("Dust particle 1 : %s", valueFormatted); + cJSON_AddStringToObject(cj_param, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } } if (ezlopi_item_name_particulate_matter_2_dot_5 == item->cloud_properties.item_name) { - snprintf(valueFormatted, 20, "%d", pms_object->pms_data.pm25_standard); - cJSON_AddStringToObject(cj_param, "valueFormatted", valueFormatted); - cJSON_AddNumberToObject(cj_param, "value", pms_object->pms_data.pm25_standard); + cJSON_AddNumberToObject(cj_param, ezlopi_value_str, pms_object->pms_data.pm25_standard); + char *valueFormatted = ezlopi_valueformatter_uint32(pms_object->pms_data.pm25_standard); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_param, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } } if (ezlopi_item_name_particulate_matter_10 == item->cloud_properties.item_name) { - snprintf(valueFormatted, 20, "%d", pms_object->pms_data.pm100_standard); - cJSON_AddStringToObject(cj_param, "valueFormatted", valueFormatted); - cJSON_AddNumberToObject(cj_param, "value", pms_object->pms_data.pm100_standard); + cJSON_AddNumberToObject(cj_param, ezlopi_value_str, pms_object->pms_data.pm100_standard); + char *valueFormatted = ezlopi_valueformatter_uint32(pms_object->pms_data.pm100_standard); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_param, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } } if (ezlopi_item_name_particles_0_dot_3_um == item->cloud_properties.item_name) { - snprintf(valueFormatted, 20, "%d", pms_object->pms_data.particles_03um); - cJSON_AddStringToObject(cj_param, "valueFormatted", valueFormatted); - cJSON_AddNumberToObject(cj_param, "value", pms_object->pms_data.particles_03um); + cJSON_AddNumberToObject(cj_param, ezlopi_value_str, pms_object->pms_data.particles_03um); + char *valueFormatted = ezlopi_valueformatter_uint32(pms_object->pms_data.particles_03um); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_param, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } } if (ezlopi_item_name_particles_0_dot_5_um == item->cloud_properties.item_name) { - snprintf(valueFormatted, 20, "%d", pms_object->pms_data.particles_05um); - cJSON_AddStringToObject(cj_param, "valueFormatted", valueFormatted); - cJSON_AddNumberToObject(cj_param, "value", pms_object->pms_data.particles_05um); + cJSON_AddNumberToObject(cj_param, ezlopi_value_str, pms_object->pms_data.particles_05um); + char *valueFormatted = ezlopi_valueformatter_uint32(pms_object->pms_data.particles_05um); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_param, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } } if (ezlopi_item_name_particles_1_um == item->cloud_properties.item_name) { - snprintf(valueFormatted, 20, "%d", pms_object->pms_data.particles_10um); - cJSON_AddStringToObject(cj_param, "valueFormatted", valueFormatted); - cJSON_AddNumberToObject(cj_param, "value", pms_object->pms_data.particles_10um); + cJSON_AddNumberToObject(cj_param, ezlopi_value_str, pms_object->pms_data.particles_10um); + char *valueFormatted = ezlopi_valueformatter_uint32(pms_object->pms_data.particles_10um); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_param, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } } if (ezlopi_item_name_particles_2_dot_5_um == item->cloud_properties.item_name) { - snprintf(valueFormatted, 20, "%d", pms_object->pms_data.particles_25um); - cJSON_AddStringToObject(cj_param, "valueFormatted", valueFormatted); - cJSON_AddNumberToObject(cj_param, "value", pms_object->pms_data.particles_25um); + cJSON_AddNumberToObject(cj_param, ezlopi_value_str, pms_object->pms_data.particles_25um); + char *valueFormatted = ezlopi_valueformatter_uint32(pms_object->pms_data.particles_25um); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_param, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } } if (ezlopi_item_name_particles_5_um == item->cloud_properties.item_name) { - snprintf(valueFormatted, 20, "%d", pms_object->pms_data.particles_50um); - cJSON_AddStringToObject(cj_param, "valueFormatted", valueFormatted); - cJSON_AddNumberToObject(cj_param, "value", pms_object->pms_data.particles_50um); + cJSON_AddNumberToObject(cj_param, ezlopi_value_str, pms_object->pms_data.particles_50um); + char *valueFormatted = ezlopi_valueformatter_uint32(pms_object->pms_data.particles_50um); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_param, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } } if (ezlopi_item_name_particles_10_um == item->cloud_properties.item_name) { - snprintf(valueFormatted, 20, "%d", pms_object->pms_data.particles_100um); - cJSON_AddStringToObject(cj_param, "valueFormatted", valueFormatted); - cJSON_AddNumberToObject(cj_param, "value", pms_object->pms_data.particles_100um); + cJSON_AddNumberToObject(cj_param, ezlopi_value_str, pms_object->pms_data.particles_100um); + char *valueFormatted = ezlopi_valueformatter_uint32(pms_object->pms_data.particles_100um); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_param, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } } } @@ -160,20 +195,18 @@ static int __init(l_ezlopi_item_t *item) if (item) { s_pms5003_sensor_object *pms_object = (s_pms5003_sensor_object *)item->user_arg; - - if (item->interface.uart.enable && pms_object) + if (pms_object) { - pms_init(pms_object); + if (item->interface.uart.enable) + { + pms_init(pms_object); + } ret = 1; } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } return ret; diff --git a/ezlopi-sensors-devices/sensor-0040-other-TCS230/sensor_0040_other_TCS230.c b/ezlopi-sensors-devices/sensor-0040-other-TCS230/sensor_0040_other_TCS230.c index 32e4e584b..44bbdc42d 100644 --- a/ezlopi-sensors-devices/sensor-0040-other-TCS230/sensor_0040_other_TCS230.c +++ b/ezlopi-sensors-devices/sensor-0040-other-TCS230/sensor_0040_other_TCS230.c @@ -171,37 +171,43 @@ static int __0040_init(l_ezlopi_item_t *item) if (item) { s_TCS230_data_t *user_data = (s_TCS230_data_t *)item->user_arg; - if (GPIO_IS_VALID_GPIO(user_data->TCS230_pin.gpio_s0) && - GPIO_IS_VALID_GPIO(user_data->TCS230_pin.gpio_s1) && - GPIO_IS_VALID_GPIO(user_data->TCS230_pin.gpio_s2) && - GPIO_IS_VALID_GPIO(user_data->TCS230_pin.gpio_s3) && - GPIO_IS_VALID_GPIO(user_data->TCS230_pin.gpio_output_en) && - GPIO_IS_VALID_GPIO(user_data->TCS230_pin.gpio_pulse_output)) + if (user_data) { - __tcs230_setup_gpio(user_data->TCS230_pin.gpio_s0, - user_data->TCS230_pin.gpio_s1, - user_data->TCS230_pin.gpio_s2, - user_data->TCS230_pin.gpio_s3, - user_data->TCS230_pin.gpio_output_en, - user_data->TCS230_pin.gpio_pulse_output); - TRACE_W("Entering Calibration Phase for 30 seconds....."); + if (GPIO_IS_VALID_GPIO(user_data->TCS230_pin.gpio_s0) && + GPIO_IS_VALID_GPIO(user_data->TCS230_pin.gpio_s1) && + GPIO_IS_VALID_GPIO(user_data->TCS230_pin.gpio_s2) && + GPIO_IS_VALID_GPIO(user_data->TCS230_pin.gpio_s3) && + GPIO_IS_VALID_GPIO(user_data->TCS230_pin.gpio_output_en) && + GPIO_IS_VALID_GPIO(user_data->TCS230_pin.gpio_pulse_output)) + { + __tcs230_setup_gpio(user_data->TCS230_pin.gpio_s0, + user_data->TCS230_pin.gpio_s1, + user_data->TCS230_pin.gpio_s2, + user_data->TCS230_pin.gpio_s3, + user_data->TCS230_pin.gpio_output_en, + user_data->TCS230_pin.gpio_pulse_output); + TRACE_W("Entering Calibration Phase for 30 seconds....."); - // configure Freq_scale at 20% - tcs230_set_frequency_scaling(item, COLOR_SENSOR_FREQ_SCALING_20_PERCENT); + // configure Freq_scale at 20% + tcs230_set_frequency_scaling(item, COLOR_SENSOR_FREQ_SCALING_20_PERCENT); - // activate a task to calibrate data - xTaskCreate(__tcs230_calibration_task, "TCS230_Calibration_Task", 2 * 2048, item, 1, NULL); - ret = 1; - } - if (0 == ret) - { - ret = -1; - if (item->user_arg) + // activate a task to calibrate data + xTaskCreate(__tcs230_calibration_task, "TCS230_Calibration_Task", 2 * 2048, item, 1, NULL); + ret = 1; + } + else { - free(item->user_arg); + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); } } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); + } } return ret; } @@ -213,17 +219,23 @@ static int __0040_get_cjson_value(l_ezlopi_item_t *item, void *args) if (cj_result && item) { s_TCS230_data_t *user_data = (s_TCS230_data_t *)item->user_arg; - if (ezlopi_item_name_rgbcolor == item->cloud_properties.item_name) + if (user_data) { - cJSON *color_values = cJSON_AddObjectToObject(cj_result, "value"); - cJSON_AddNumberToObject(color_values, "red", user_data->red_mapped); - cJSON_AddNumberToObject(color_values, "green", user_data->green_mapped); - cJSON_AddNumberToObject(color_values, "blue", user_data->blue_mapped); - char *formatted_val = ezlopi_valueformatter_rgb(user_data->red_mapped, user_data->green_mapped, user_data->blue_mapped); - cJSON_AddStringToObject(cj_result, "valueFormatted", formatted_val); - free(formatted_val); + if (ezlopi_item_name_rgbcolor == item->cloud_properties.item_name) + { + cJSON *color_values = cJSON_AddObjectToObject(cj_result, ezlopi_value_str); + cJSON_AddNumberToObject(color_values, "red", user_data->red_mapped); + cJSON_AddNumberToObject(color_values, "green", user_data->green_mapped); + cJSON_AddNumberToObject(color_values, "blue", user_data->blue_mapped); + char *valueFormatted = ezlopi_valueformatter_rgb(user_data->red_mapped, user_data->green_mapped, user_data->blue_mapped); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } + ret = 1; } - ret = 1; } return ret; } @@ -234,22 +246,25 @@ static int __0040_notify(l_ezlopi_item_t *item) if (item) { s_TCS230_data_t *user_data = (s_TCS230_data_t *)item->user_arg; - uint32_t red = user_data->red_mapped; - uint32_t green = user_data->green_mapped; - uint32_t blue = user_data->blue_mapped; - bool valid_status = get_tcs230_sensor_value(item); // Informs and updates if valid data - if (valid_status) + if (user_data) { - if (fabs(red - user_data->red_mapped) > 10 || - fabs(green - user_data->green_mapped) > 10 || - fabs(blue - user_data->blue_mapped) > 10) + uint32_t red = user_data->red_mapped; + uint32_t green = user_data->green_mapped; + uint32_t blue = user_data->blue_mapped; + bool valid_status = get_tcs230_sensor_value(item); // Informs and updates if valid data + if (valid_status) { - TRACE_S("---------------------------------------"); - TRACE_S("Red : %d", user_data->red_mapped); - TRACE_S("Green :%d", user_data->green_mapped); - TRACE_S("Blue : %d", user_data->blue_mapped); - TRACE_S("---------------------------------------"); - ezlopi_device_value_updated_from_device_v3(item); + if (fabs(red - user_data->red_mapped) > 10 || + fabs(green - user_data->green_mapped) > 10 || + fabs(blue - user_data->blue_mapped) > 10) + { + TRACE_S("---------------------------------------"); + TRACE_S("Red : %d", user_data->red_mapped); + TRACE_S("Green :%d", user_data->green_mapped); + TRACE_S("Blue : %d", user_data->blue_mapped); + TRACE_S("---------------------------------------"); + ezlopi_device_value_updated_from_device_v3(item); + } } } } @@ -264,6 +279,8 @@ static void __tcs230_calibration_task(void *params) // calibration task if (item) { // extracting the 'user_args' from "item" s_TCS230_data_t *user_data = (s_TCS230_data_t *)item->user_arg; + if (user_data) + { #if 0 //-------------------------------------------------- // calculate red min-max periods for each colour @@ -314,19 +331,20 @@ static void __tcs230_calibration_task(void *params) // calibration task // show (LOW,HIGH) -> (max,min) #endif - user_data->calib_data.least_red_timeP = 120; /*Defaults*/ - user_data->calib_data.most_red_timeP = 48; - user_data->calib_data.least_green_timeP = 109; - user_data->calib_data.most_green_timeP = 86; - user_data->calib_data.least_blue_timeP = 120; - user_data->calib_data.most_blue_timeP = 78; + user_data->calib_data.least_red_timeP = 120; /*Defaults*/ + user_data->calib_data.most_red_timeP = 48; + user_data->calib_data.least_green_timeP = 109; + user_data->calib_data.most_green_timeP = 86; + user_data->calib_data.least_blue_timeP = 120; + user_data->calib_data.most_blue_timeP = 78; - TRACE_I("red(Least,Most) => red(%d,%d)", user_data->calib_data.least_red_timeP, user_data->calib_data.most_red_timeP); - TRACE_I("green(Least,Most) => green(%d,%d)", user_data->calib_data.least_green_timeP, user_data->calib_data.most_green_timeP); - TRACE_I("blue(Least,Most) => blue(%d,%d)", user_data->calib_data.least_blue_timeP, user_data->calib_data.most_blue_timeP); - //-------------------------------------------------- - // set the calib flag - user_data->calibration_complete = true; + TRACE_I("red(Least,Most) => red(%d,%d)", user_data->calib_data.least_red_timeP, user_data->calib_data.most_red_timeP); + TRACE_I("green(Least,Most) => green(%d,%d)", user_data->calib_data.least_green_timeP, user_data->calib_data.most_green_timeP); + TRACE_I("blue(Least,Most) => blue(%d,%d)", user_data->calib_data.least_blue_timeP, user_data->calib_data.most_blue_timeP); + //-------------------------------------------------- + // set the calib flag + user_data->calibration_complete = true; + } } vTaskDelete(NULL); } diff --git a/ezlopi-sensors-devices/sensor-0041-ADC-FC28-soilMoisture/sensor_0041_ADC_FC28_soilMoisture.c b/ezlopi-sensors-devices/sensor-0041-ADC-FC28-soilMoisture/sensor_0041_ADC_FC28_soilMoisture.c index eae0df460..4f1aa59f3 100644 --- a/ezlopi-sensors-devices/sensor-0041-ADC-FC28-soilMoisture/sensor_0041_ADC_FC28_soilMoisture.c +++ b/ezlopi-sensors-devices/sensor-0041-ADC-FC28-soilMoisture/sensor_0041_ADC_FC28_soilMoisture.c @@ -141,19 +141,33 @@ static int __0041_init(l_ezlopi_item_t *item) int ret = 0; if (NULL != item) { - if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + s_fc28_data_t *user_data = (s_fc28_data_t *)item->user_arg; + if (user_data) { - ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit); - ret = 1; + if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + { + if (0 == ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit)) + { + ret = 1; + } + else + { + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); + } + } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); + } } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } return ret; @@ -168,12 +182,18 @@ static int __0041_get_cjson_value(l_ezlopi_item_t *item, void *arg) if (cj_result) { s_fc28_data_t *user_data = (s_fc28_data_t *)item->user_arg; - char *valueFormatted = ezlopi_valueformatter_uint32(user_data->hum_val); - cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); - cJSON_AddNumberToObject(cj_result, "value", (user_data->hum_val)); - // TRACE_S("soil moisture : %d", user_data->hum_val); - free(valueFormatted); - ret = 1; + if (user_data) + { + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, (user_data->hum_val)); + char *valueFormatted = ezlopi_valueformatter_uint32(user_data->hum_val); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + // TRACE_S("soil moisture : %d", user_data->hum_val); + free(valueFormatted); + } + ret = 1; + } } } return ret; @@ -185,17 +205,20 @@ static int __0041_notify(l_ezlopi_item_t *item) if (item) { s_fc28_data_t *user_data = (s_fc28_data_t *)item->user_arg; - s_ezlopi_analog_data_t ezlopi_adc_data = {.value = 0, .voltage = 0}; - ezlopi_adc_get_adc_data(item->interface.adc.gpio_num, &ezlopi_adc_data); - uint32_t new_hum = ((4095.0f - (ezlopi_adc_data.value)) / 4095.0f) * 100; - TRACE_S("[%dmv] soil moisture : %d", ezlopi_adc_data.voltage, new_hum); - - if (fabs((user_data->hum_val) - new_hum) > 0.5) // percent + if (user_data) { - user_data->hum_val = new_hum; - ezlopi_device_value_updated_from_device_v3(item); + s_ezlopi_analog_data_t ezlopi_adc_data = {.value = 0, .voltage = 0}; + ezlopi_adc_get_adc_data(item->interface.adc.gpio_num, &ezlopi_adc_data); + uint32_t new_hum = ((4095.0f - (ezlopi_adc_data.value)) / 4095.0f) * 100; + TRACE_S("[%dmv] soil moisture : %d", ezlopi_adc_data.voltage, new_hum); + + if (fabs((user_data->hum_val) - new_hum) > 0.5) // percent + { + user_data->hum_val = new_hum; + ezlopi_device_value_updated_from_device_v3(item); + } + ret = 1; } - ret = 1; } return ret; } diff --git a/ezlopi-sensors-devices/sensor-0042-ADC-shunt-voltmeter/sensor_0042_ADC_shunt_voltmeter.c b/ezlopi-sensors-devices/sensor-0042-ADC-shunt-voltmeter/sensor_0042_ADC_shunt_voltmeter.c index f5a345b2d..99794aa63 100644 --- a/ezlopi-sensors-devices/sensor-0042-ADC-shunt-voltmeter/sensor_0042_ADC_shunt_voltmeter.c +++ b/ezlopi-sensors-devices/sensor-0042-ADC-shunt-voltmeter/sensor_0042_ADC_shunt_voltmeter.c @@ -134,21 +134,37 @@ static int __0042_init(l_ezlopi_item_t *item) int ret = 0; if (item) { - if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) - { - // initialize analog_pin - ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit); - ret = 1; - } - if (0 == ret) + s_voltmeter_t *user_data = (s_voltmeter_t *)item->user_arg; + if (user_data) { - ret = -1; - if (item->user_arg) + if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) + { + // initialize analog_pin + if (0 == ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit)) + { + ret = 1; + } + else + { + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); + } + } + else { - free(item->user_arg); + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); } } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); + } } return ret; } @@ -162,16 +178,22 @@ static int __0042_get_cjson_value(l_ezlopi_item_t *item, void *arg) if (cj_result) { s_voltmeter_t *user_data = (s_voltmeter_t *)item->user_arg; + if (user_data) + { #if VOLTAGE_DIVIDER_EN - char *valueFormatted = ezlopi_valueformatter_float((user_data->volt) * 9.52f); - cJSON_AddNumberToObject(cj_result, "value", (user_data->volt) * 9.52f); + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, (user_data->volt) * 9.52f); + char *valueFormatted = ezlopi_valueformatter_float((user_data->volt) * 9.52f); #else - char *valueFormatted = ezlopi_valueformatter_float((user_data->volt) * 4.2f); - cJSON_AddNumberToObject(cj_result, "value", (user_data->volt) * 4.2f); + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, (user_data->volt) * 4.2f); + char *valueFormatted = ezlopi_valueformatter_float((user_data->volt) * 4.2f); #endif - cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); - free(valueFormatted); - ret = 1; + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + ret = 1; + } } } return ret; @@ -183,16 +205,19 @@ static int __0042_notify(l_ezlopi_item_t *item) if (item) { s_voltmeter_t *user_data = (s_voltmeter_t *)item->user_arg; - s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; - ezlopi_adc_get_adc_data(item->interface.adc.gpio_num, &ezlopi_analog_data); - float Vout = (ezlopi_analog_data.voltage) / 1000.0f; // millivolt -> voltage - - if (fabs(Vout - (user_data->volt)) > 0.5) + if (user_data) { - user_data->volt = Vout; - ezlopi_device_value_updated_from_device_v3(item); + s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; + ezlopi_adc_get_adc_data(item->interface.adc.gpio_num, &ezlopi_analog_data); + float Vout = (ezlopi_analog_data.voltage) / 1000.0f; // millivolt -> voltage + + if (fabs(Vout - (user_data->volt)) > 0.5) + { + user_data->volt = Vout; + ezlopi_device_value_updated_from_device_v3(item); + } + ret = 1; } - ret = 1; } return ret; } \ No newline at end of file diff --git a/ezlopi-sensors-devices/sensor-0043-ADC-GYML8511-UV-intensity/sensor_0043_ADC_GYML8511_UV_intensity.c b/ezlopi-sensors-devices/sensor-0043-ADC-GYML8511-UV-intensity/sensor_0043_ADC_GYML8511_UV_intensity.c index 8911a1f06..a73fefa4e 100644 --- a/ezlopi-sensors-devices/sensor-0043-ADC-GYML8511-UV-intensity/sensor_0043_ADC_GYML8511_UV_intensity.c +++ b/ezlopi-sensors-devices/sensor-0043-ADC-GYML8511-UV-intensity/sensor_0043_ADC_GYML8511_UV_intensity.c @@ -142,20 +142,36 @@ static int __0043_init(l_ezlopi_item_t *item) int ret = 0; if (NULL != item) { - if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) - { - ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit); - ret = 1; - } - if (0 == ret) + s_gyml8511_data_t *user_data = (s_gyml8511_data_t *)item->user_arg; + if (user_data) { - ret = -1; - if (item->user_arg) + if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + { + if (0 == ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit)) + { + ret = 1; + } + else + { + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); + } + } + else { - free(item->user_arg); + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); } } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); + } } return ret; } @@ -169,14 +185,16 @@ static int __0043_get_cjson_value(l_ezlopi_item_t *item, void *arg) if (cj_result) { s_gyml8511_data_t *user_data = (s_gyml8511_data_t *)item->user_arg; + if (user_data) + { + char *valueFormatted = ezlopi_valueformatter_float((user_data->uv_data) / 10); // [mW/cm^2] -> [W/m^2] + cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); + cJSON_AddNumberToObject(cj_result, "value", (user_data->uv_data) / 10); // [mW/cm^2] -> [W/m^2] + // TRACE_I("UV_intensity : %.2f", user_data->uv_data); + free(valueFormatted); - char *valueFormatted = ezlopi_valueformatter_float((user_data->uv_data) / 10); // [mW/cm^2] -> [W/m^2] - cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); - cJSON_AddNumberToObject(cj_result, "value", (user_data->uv_data) / 10); // [mW/cm^2] -> [W/m^2] - // TRACE_S("UV_intensity : %.2f", user_data->uv_data); - free(valueFormatted); - - ret = 1; + ret = 1; + } } } return ret; @@ -188,16 +206,19 @@ static int __0043_notify(l_ezlopi_item_t *item) if (item) { s_gyml8511_data_t *user_data = (s_gyml8511_data_t *)item->user_arg; - s_ezlopi_analog_data_t adc_data = {.value = 0, .voltage = 0}; - ezlopi_adc_get_adc_data(item->interface.adc.gpio_num, &adc_data); - float new_uvIntensity = mapfloat(((float)(adc_data.voltage) / 1000), 0.97, 2.7, 0.0, 15.0); - TRACE_S("%dmv -> intensity: %.2f", adc_data.voltage, new_uvIntensity); - if (fabs((user_data->uv_data) - new_uvIntensity) > 0.01) + if (user_data) { - user_data->uv_data = new_uvIntensity; - ezlopi_device_value_updated_from_device_v3(item); + s_ezlopi_analog_data_t adc_data = {.value = 0, .voltage = 0}; + ezlopi_adc_get_adc_data(item->interface.adc.gpio_num, &adc_data); + float new_uvIntensity = mapfloat(((float)(adc_data.voltage) / 1000), 0.97, 2.7, 0.0, 15.0); + TRACE_S("%dmv -> intensity: %.2f", adc_data.voltage, new_uvIntensity); + if (fabs((user_data->uv_data) - new_uvIntensity) > 0.01) + { + user_data->uv_data = new_uvIntensity; + ezlopi_device_value_updated_from_device_v3(item); + } + ret = 1; } - ret = 1; } return ret; } diff --git a/ezlopi-sensors-devices/sensor-0044-I2C-TSL256-luminosity/sensor_0044_I2C_TSL256_luminosity.c b/ezlopi-sensors-devices/sensor-0044-I2C-TSL256-luminosity/sensor_0044_I2C_TSL256_luminosity.c index dccc79530..6eaabdbaa 100644 --- a/ezlopi-sensors-devices/sensor-0044-I2C-TSL256-luminosity/sensor_0044_I2C_TSL256_luminosity.c +++ b/ezlopi-sensors-devices/sensor-0044-I2C-TSL256-luminosity/sensor_0044_I2C_TSL256_luminosity.c @@ -63,11 +63,8 @@ static int __notify(l_ezlopi_item_t *item) // Allow only significant changes in values to be posted double new_value = (double)tsl2561_get_intensity_value(&item->interface.i2c_master); TSL256_lum_t *TSL2561_lux_data = (TSL256_lum_t *)item->user_arg; - if (fabs((double)(TSL2561_lux_data->lux_val) - new_value) > 0.0001) + if (TSL2561_lux_data) { - // Allow only significant changes in values to be posted - double new_value = (double)tsl2561_get_intensity_value(&item->interface.i2c_master); - TSL256_lum_t *TSL2561_lux_data = (TSL256_lum_t *)item->user_arg; if (fabs((double)(TSL2561_lux_data->lux_val) - new_value) > 0.0001) { ezlopi_device_value_updated_from_device_v3(item); @@ -85,15 +82,18 @@ static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) if (cjson_properties) { TSL256_lum_t *illuminance_value = ((TSL256_lum_t *)item->user_arg); - char *valueFormatted = ezlopi_valueformatter_int((int)(illuminance_value->lux_val)); - if (valueFormatted) + if (illuminance_value) { - cJSON_AddStringToObject(cjson_properties, ezlopi_valueFormatted_str, valueFormatted); - free(valueFormatted); + char *valueFormatted = ezlopi_valueformatter_int((int)(illuminance_value->lux_val)); + if (valueFormatted) + { + cJSON_AddStringToObject(cjson_properties, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + cJSON_AddNumberToObject(cjson_properties, ezlopi_value_str, (int)illuminance_value->lux_val); + cJSON_AddStringToObject(cjson_properties, ezlopi_scale_str, item->cloud_properties.scale); + ret = 1; } - cJSON_AddNumberToObject(cjson_properties, "values", (int)illuminance_value->lux_val); - cJSON_AddStringToObject(cjson_properties, "scales", item->cloud_properties.scale); - ret = 1; } return ret; } @@ -102,25 +102,35 @@ static int __init(l_ezlopi_item_t *item) { int ret = 0; - if (item->interface.i2c_master.enable) + if (item) { - ezlopi_i2c_master_init(&item->interface.i2c_master); - TRACE_I("I2C channel is %d", item->interface.i2c_master.channel); - if (Check_PARTID(&item->interface.i2c_master)) + TSL256_lum_t *TSL2561_lux_data = (TSL256_lum_t *)item->user_arg; + if (TSL2561_lux_data) { - TRACE_I("TSL561 initialization finished........."); - sensor_0044_tsl2561_configure_device(&item->interface.i2c_master); - ret = 1; + if (item->interface.i2c_master.enable) + { + ezlopi_i2c_master_init(&item->interface.i2c_master); + TRACE_I("I2C channel is %d", item->interface.i2c_master.channel); + if (Check_PARTID(&item->interface.i2c_master)) + { + TRACE_I("TSL561 initialization finished........."); + sensor_0044_tsl2561_configure_device(&item->interface.i2c_master); + ret = 1; + } + else + { + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); + TRACE_E("TSL561 not found!....... Please Restart!! or Check your I2C connection..."); + } + } } else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } - TRACE_E("TSL561 not found!....... Please Restart!! or Check your I2C connection..."); + ezlopi_device_free_device_by_item(item); } } return ret; @@ -173,7 +183,7 @@ static int __prepare(void *arg) if (prep_arg && prep_arg->cjson_device) { TSL256_lum_t *TSL2561_lux_data = (TSL256_lum_t *)malloc(sizeof(TSL256_lum_t)); - if (NULL != TSL2561_lux_data) + if (TSL2561_lux_data) { memset(TSL2561_lux_data, 0, sizeof(TSL256_lum_t)); l_ezlopi_device_t *tsl256_device = ezlopi_device_add_device(prep_arg->cjson_device); diff --git a/ezlopi-sensors-devices/sensor-0046-ADC-ACS712-05B-currentmeter/sensor_0046_ADC_ACS712_05B_currentmeter.c b/ezlopi-sensors-devices/sensor-0046-ADC-ACS712-05B-currentmeter/sensor_0046_ADC_ACS712_05B_currentmeter.c index 7cb6d682a..bbdb5690d 100644 --- a/ezlopi-sensors-devices/sensor-0046-ADC-ACS712-05B-currentmeter/sensor_0046_ADC_ACS712_05B_currentmeter.c +++ b/ezlopi-sensors-devices/sensor-0046-ADC-ACS712-05B-currentmeter/sensor_0046_ADC_ACS712_05B_currentmeter.c @@ -100,7 +100,7 @@ static int __0046_prepare(void *arg) if (device_prep_arg && (NULL != device_prep_arg->cjson_device)) { s_currentmeter_t *user_data = (s_currentmeter_t *)malloc(sizeof(s_currentmeter_t)); - if (NULL != user_data) + if (user_data) { memset(user_data, 0, sizeof(s_currentmeter_t)); l_ezlopi_device_t *currentmeter_device = ezlopi_device_add_device(device_prep_arg->cjson_device); @@ -135,20 +135,36 @@ static int __0046_init(l_ezlopi_item_t *item) int ret = 0; if (item) { - if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) - { - ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit); - ret = 1; - } - if (0 == ret) + s_currentmeter_t *user_data = (s_currentmeter_t *)item->user_arg; + if (user_data) { - ret = -1; - if (item->user_arg) + if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) + { + if (0 == ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit)) + { + ret = 1; + } + else + { + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); + } + } + else { + ret = -1; free(item->user_arg); item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); } } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); + } } return ret; } @@ -156,15 +172,24 @@ static int __0046_init(l_ezlopi_item_t *item) static int __0046_get_cjson_value(l_ezlopi_item_t *item, void *arg) { int ret = 0; - cJSON *cjson_properties = (cJSON *)arg; - if (cjson_properties && item) + if (item) { - s_currentmeter_t *user_data = (s_currentmeter_t *)item->user_arg; - char *valueFormatted = ezlopi_valueformatter_float(user_data->amp_value); - cJSON_AddStringToObject(cjson_properties, "valueFormatted", valueFormatted); - cJSON_AddNumberToObject(cjson_properties, "value", user_data->amp_value); // Irms [A] - free(valueFormatted); - ret = 1; + cJSON *cjson_properties = (cJSON *)arg; + if (cjson_properties && item) + { + s_currentmeter_t *user_data = (s_currentmeter_t *)item->user_arg; + if (user_data) + { + cJSON_AddNumberToObject(cjson_properties, ezlopi_value_str, user_data->amp_value); // Irms [A] + char *valueFormatted = ezlopi_valueformatter_float(user_data->amp_value); + if (valueFormatted) + { + cJSON_AddStringToObject(cjson_properties, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + ret = 1; + } + } } return ret; } @@ -176,11 +201,14 @@ static int __0046_notify(l_ezlopi_item_t *item) if (item) { s_currentmeter_t *user_data = (s_currentmeter_t *)item->user_arg; - float prev_amp = user_data->amp_value; - __calculate_current_value(item); // update amp - if (fabs(user_data->amp_value - prev_amp) > 0.5) + if (user_data) { - ezlopi_device_value_updated_from_device_v3(item); + float prev_amp = user_data->amp_value; + __calculate_current_value(item); // update amp + if (fabs(user_data->amp_value - prev_amp) > 0.5) + { + ezlopi_device_value_updated_from_device_v3(item); + } } } return ret; @@ -191,47 +219,50 @@ static void __calculate_current_value(l_ezlopi_item_t *item) if (NULL != item) { s_currentmeter_t *user_data = (s_currentmeter_t *)item->user_arg; - s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; - - uint32_t period_dur = (1000000 / DEFAULT_AC_FREQUENCY); // 20000uS - int Vnow = 0; - uint32_t Vsum = 0; - uint32_t measurements_count = 0; - - // starting 't' instant - uint32_t t_start = (uint32_t)esp_timer_get_time(); - uint32_t Volt = 0; - int diff = 0; - PORT_ENTER_CRITICAL(); - while (((uint32_t)esp_timer_get_time() - t_start) < period_dur) // loops within 1-complete cycle + if (user_data) { - ezlopi_adc_get_adc_data(item->interface.adc.gpio_num, &ezlopi_analog_data); - Volt = 2 * (ezlopi_analog_data.voltage); // since the input is half the original value after voltage division - diff = ((ASC712TELC_05B_zero_point_mV - Volt) > 0 ? (ASC712TELC_05B_zero_point_mV - Volt) : (Volt - ASC712TELC_05B_zero_point_mV)); - // getting the voltage value at this instant - if (diff > 150 && diff < 1500) // the reading voltage less than 00mV is noise + s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; + + uint32_t period_dur = (1000000 / DEFAULT_AC_FREQUENCY); // 20000uS + int Vnow = 0; + uint32_t Vsum = 0; + uint32_t measurements_count = 0; + + // starting 't' instant + uint32_t t_start = (uint32_t)esp_timer_get_time(); + uint32_t Volt = 0; + int diff = 0; + PORT_ENTER_CRITICAL(); + while (((uint32_t)esp_timer_get_time() - t_start) < period_dur) // loops within 1-complete cycle { - Vnow = Volt - ASC712TELC_05B_zero_point_mV; // ()at zero offset => full-scale/2 + ezlopi_adc_get_adc_data(item->interface.adc.gpio_num, &ezlopi_analog_data); + Volt = 2 * (ezlopi_analog_data.voltage); // since the input is half the original value after voltage division + diff = ((ASC712TELC_05B_zero_point_mV - Volt) > 0 ? (ASC712TELC_05B_zero_point_mV - Volt) : (Volt - ASC712TELC_05B_zero_point_mV)); + // getting the voltage value at this instant + if (diff > 150 && diff < 1500) // the reading voltage less than 00mV is noise + { + Vnow = Volt - ASC712TELC_05B_zero_point_mV; // ()at zero offset => full-scale/2 + } + else + { + Vnow = 0; + } + Vsum += (Vnow * Vnow); // sumof(I^2 + I^2 + .....) + measurements_count++; } - else + PORT_EXIT_CRITICAL(); + + // If applied for DC; 'AC_Irms' calculation give same value as 'DC-value' + if (0 == measurements_count) { - Vnow = 0; + measurements_count = 1; // <-- avoid dividing by zero } - Vsum += (Vnow * Vnow); // sumof(I^2 + I^2 + .....) - measurements_count++; - } - PORT_EXIT_CRITICAL(); - // If applied for DC; 'AC_Irms' calculation give same value as 'DC-value' - if (0 == measurements_count) - { - measurements_count = 1; // <-- avoid dividing by zero - } - - user_data->amp_value = ((float)sqrt(Vsum / measurements_count)) / 185.0f; // -> I[rms] Ampere - if ((user_data->amp_value) < 0.4) - { - user_data->amp_value = 0; + user_data->amp_value = ((float)sqrt(Vsum / measurements_count)) / 185.0f; // -> I[rms] Ampere + if ((user_data->amp_value) < 0.4) + { + user_data->amp_value = 0; + } } } } \ No newline at end of file diff --git a/ezlopi-sensors-devices/sensor-0047-other-HX711-loadcell/sensor_0047_other_HX711_loadcell.c b/ezlopi-sensors-devices/sensor-0047-other-HX711-loadcell/sensor_0047_other_HX711_loadcell.c index 89acff5cc..a36be35b2 100644 --- a/ezlopi-sensors-devices/sensor-0047-other-HX711-loadcell/sensor_0047_other_HX711_loadcell.c +++ b/ezlopi-sensors-devices/sensor-0047-other-HX711-loadcell/sensor_0047_other_HX711_loadcell.c @@ -69,14 +69,9 @@ int sensor_0047_other_HX711_loadcell(e_ezlopi_actions_t action, l_ezlopi_item_t } case EZLOPI_ACTION_NOTIFY_1000_MS: { - if (item) - { - s_hx711_data_t *user_data = (s_hx711_data_t *)item->user_arg; - if (true == user_data->HX711_initialized) - { - __0047_notify(item); - } - } + + __0047_notify(item); + break; } default: @@ -112,9 +107,9 @@ static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_dev CJSON_GET_VALUE_INT(cj_device, "dev_type", item->interface_type); // _max = 10 CJSON_GET_VALUE_INT(cj_device, "gpio1", user_data->HX711_SCK_pin); - TRACE_S("hx711_SCL_PIN: %d ", user_data->HX711_SCK_pin); + TRACE_I("hx711_SCL_PIN: %d ", user_data->HX711_SCK_pin); CJSON_GET_VALUE_INT(cj_device, "gpio2", user_data->HX711_DT_pin); - TRACE_S("hx711_DT_PIN: %d ", user_data->HX711_DT_pin); + TRACE_I("hx711_DT_PIN: %d ", user_data->HX711_DT_pin); } static int __0047_prepare(void *arg) @@ -161,43 +156,57 @@ static int __0047_init(l_ezlopi_item_t *item) if (item) { s_hx711_data_t *user_data = (s_hx711_data_t *)item->user_arg; - if (user_data && GPIO_IS_VALID_GPIO(user_data->HX711_SCK_pin) && (GPIO_IS_VALID_GPIO(user_data->HX711_DT_pin))) + if (user_data) { - // Configure 'CLOCK_PIN' -> GPIO output pins for HX711. - gpio_config_t output_conf; - output_conf.pin_bit_mask = (1ULL << (user_data->HX711_SCK_pin)); - output_conf.intr_type = GPIO_INTR_DISABLE; - output_conf.mode = GPIO_MODE_OUTPUT; - output_conf.pull_down_en = GPIO_PULLDOWN_ENABLE; - output_conf.pull_up_en = GPIO_PULLUP_DISABLE; - ret |= gpio_config(&output_conf); - - // Configure 'DATA_PIN' -> GPIO input pins for HX711. - gpio_config_t input_conf; - input_conf.pin_bit_mask = (1ULL << (user_data->HX711_DT_pin)); - input_conf.intr_type = GPIO_INTR_DISABLE; - input_conf.mode = GPIO_MODE_INPUT; - input_conf.pull_down_en = GPIO_PULLDOWN_ENABLE; - input_conf.pull_up_en = GPIO_PULLUP_DISABLE; - ret |= gpio_config(&input_conf); - - // then initiate calibration task - if (false == (user_data->HX711_initialized)) + if (GPIO_IS_VALID_GPIO(user_data->HX711_SCK_pin) && (GPIO_IS_VALID_GPIO(user_data->HX711_DT_pin))) { - __hx711_power_reset(item); - xTaskCreate(__Calculate_hx711_tare_wt, "Calculate the Tare weight", 2 * 2048, item, 1, NULL); + // Configure 'CLOCK_PIN' -> GPIO output pins for HX711. + gpio_config_t output_conf; + output_conf.pin_bit_mask = (1ULL << (user_data->HX711_SCK_pin)); + output_conf.intr_type = GPIO_INTR_DISABLE; + output_conf.mode = GPIO_MODE_OUTPUT; + output_conf.pull_down_en = GPIO_PULLDOWN_ENABLE; + output_conf.pull_up_en = GPIO_PULLUP_DISABLE; + + ret = (0 == gpio_config(&output_conf)) ? 1 : -1; + + // Configure 'DATA_PIN' -> GPIO input pins for HX711. + gpio_config_t input_conf; + input_conf.pin_bit_mask = (1ULL << (user_data->HX711_DT_pin)); + input_conf.intr_type = GPIO_INTR_DISABLE; + input_conf.mode = GPIO_MODE_INPUT; + input_conf.pull_down_en = GPIO_PULLDOWN_ENABLE; + input_conf.pull_up_en = GPIO_PULLUP_DISABLE; + ret = (0 == gpio_config(&input_conf)) ? 1 : -1; + + // then initiate calibration task + if ((1 == ret) && (false == (user_data->HX711_initialized))) + { + __hx711_power_reset(item); + xTaskCreate(__Calculate_hx711_tare_wt, "Calculate the Tare weight", 2 * 2048, item, 1, NULL); + ret = 1; + } + + if (-1 == ret) + { + free(item->user_arg); // this will free ; memory address linked to all items + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); + } } - ret = 1; - } - if (0 == ret) - { - ret = -1; - if (item->user_arg) + else { - free(item->user_arg); + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); } } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); + } } return ret; } @@ -212,10 +221,13 @@ static int __0047_get_cjson_value(l_ezlopi_item_t *item, void *arg) if (cj_result) { s_hx711_data_t *user_data = (s_hx711_data_t *)item->user_arg; - char *valueFormatted = ezlopi_valueformatter_float(user_data->weight); - cJSON_AddStringToObject(cj_result, "ValueFormatted", valueFormatted); - cJSON_AddNumberToObject(cj_result, "value", user_data->weight); - free(valueFormatted); + if (user_data) + { + char *valueFormatted = ezlopi_valueformatter_float(user_data->weight); + cJSON_AddStringToObject(cj_result, "ValueFormatted", valueFormatted); + cJSON_AddNumberToObject(cj_result, "value", user_data->weight); + free(valueFormatted); + } } ret = 1; } @@ -228,20 +240,23 @@ static int __0047_notify(l_ezlopi_item_t *item) if (item) { s_hx711_data_t *user_data = (s_hx711_data_t *)item->user_arg; - float Mass = __hx711_avg_reading(item, 10); /// 1000.0f; // to avoid spikes - float weight_in_kg = ((Mass - (user_data->HX711_tare_wt)) / 100.0f) / 1000.0f; - - if (fabs(weight_in_kg - (user_data->weight)) > 0.05) + if ((user_data) && (true == user_data->HX711_initialized)) { - if (weight_in_kg < 0) + float Mass = __hx711_avg_reading(item, 10); /// 1000.0f; // to avoid spikes + float weight_in_kg = ((Mass - (user_data->HX711_tare_wt)) / 100.0f) / 1000.0f; + + if (fabs(weight_in_kg - (user_data->weight)) > 0.05) { - weight_in_kg = 0; + if (weight_in_kg < 0) + { + weight_in_kg = 0; + } + user_data->weight = weight_in_kg; + // TRACE_I("Mass : %0.2f unit , _Offset : %0.2f unit , Actual_Mass : %0.2f kg ,", Mass, (user_data->HX711_tare_wt), weight_in_kg); + ezlopi_device_value_updated_from_device_v3(item); } - user_data->weight = weight_in_kg; - // TRACE_S("Mass : %0.2f unit , _Offset : %0.2f unit , Actual_Mass : %0.2f kg ,", Mass, (user_data->HX711_tare_wt), weight_in_kg); - ezlopi_device_value_updated_from_device_v3(item); + ret = 1; } - ret = 1; } return ret; } @@ -253,28 +268,30 @@ static void __Calculate_hx711_tare_wt(void *params) if (item) { s_hx711_data_t *user_data = (s_hx711_data_t *)item->user_arg; - // For Output settling time ; [10SPS] is 400ms - // So, wait for 400ms after reset [as per datasheet] - vTaskDelay(400 / portTICK_PERIOD_MS); + if (user_data) + { // For Output settling time ; [10SPS] is 400ms + // So, wait for 400ms after reset [as per datasheet] + vTaskDelay(400 / portTICK_PERIOD_MS); - // ignore first few weight readings [150th ~ 180th] - for (uint8_t i = 180; i > 0; i--) - { - RAW_tare = __hx711_rawdata(item, HX711_GAIN_64); // 100ms each read - if (i > 150) + // ignore first few weight readings [150th ~ 180th] + for (uint8_t i = 180; i > 0; i--) { - (user_data->HX711_tare_wt) = (RAW_tare); + RAW_tare = __hx711_rawdata(item, HX711_GAIN_64); // 100ms each read + if (i > 150) + { + (user_data->HX711_tare_wt) = (RAW_tare); + } + else + { + (user_data->HX711_tare_wt) = 0.2f * (user_data->HX711_tare_wt) + 0.8f * (RAW_tare); + } + TRACE_I("Calibration_No : %d , Raw_data : %.2f", i, RAW_tare); } - else + TRACE_I("Calibration Stage ----------> Tare_Offset : %0.2f ", (user_data->HX711_tare_wt)); + if ((user_data->HX711_tare_wt) > 3000) { - (user_data->HX711_tare_wt) = 0.2f * (user_data->HX711_tare_wt) + 0.8f * (RAW_tare); + user_data->HX711_initialized = true; } - TRACE_S("Calibration_No : %d , Raw_data : %.2f", i, RAW_tare); - } - TRACE_S("Calibration Stage ----------> Tare_Offset : %0.2f ", (user_data->HX711_tare_wt)); - if ((user_data->HX711_tare_wt) > 3000) - { - user_data->HX711_initialized = true; } } vTaskDelete(NULL); @@ -287,57 +304,61 @@ static float __hx711_rawdata(l_ezlopi_item_t *item, hx711_gain_t _gain) if (item) { s_hx711_data_t *user_data = (s_hx711_data_t *)item->user_arg; - vTaskDelay(8); // 80ms - // first check if the data is ready [i.e. 'data_pin' = 1 ; when 'clk_pin' = 0] - if (gpio_get_level(user_data->HX711_DT_pin)) + if (user_data) { - // TRACE_E("Data_pin not ready.................."); - do + vTaskDelay(8); // 80ms + // first check if the data is ready [i.e. 'data_pin' = 1 ; when 'clk_pin' = 0] + + if (gpio_get_level(user_data->HX711_DT_pin)) { - vTaskDelay(2); // 20ms - } while (gpio_get_level(user_data->HX711_DT_pin)); - } + // TRACE_E("Data_pin not ready.................."); + do + { + vTaskDelay(2); // 20ms + } while (gpio_get_level(user_data->HX711_DT_pin)); + } - PORT_ENTER_CRITICAL(); - /* STEP 1*/ - // perform 24bits read - for (uint8_t i = 0; i < 24; i++) - { - gpio_set_level(user_data->HX711_SCK_pin, 1); - esp_rom_delay_us(1); // >= 0.2 us - gpio_set_level(user_data->HX711_SCK_pin, 0); - data = (data << 1); // shift the 'result' by 1 bit - if (gpio_get_level(user_data->HX711_DT_pin)) // if data_pin is high + PORT_ENTER_CRITICAL(); + /* STEP 1*/ + // perform 24bits read + for (uint8_t i = 0; i < 24; i++) { - data |= (1 << 0); //[ 23~0 ]step + gpio_set_level(user_data->HX711_SCK_pin, 1); + esp_rom_delay_us(1); // >= 0.2 us + gpio_set_level(user_data->HX711_SCK_pin, 0); + data = (data << 1); // shift the 'result' by 1 bit + if (gpio_get_level(user_data->HX711_DT_pin)) // if data_pin is high + { + data |= (1 << 0); //[ 23~0 ]step + } + esp_rom_delay_us(1); // keep duty cycle ~50% } - esp_rom_delay_us(1); // keep duty cycle ~50% - } - /* STEP 2*/ - // Apply the gain pulses to complete serial communication - for (uint8_t n = ((uint8_t)_gain); n > 0; n--) - { - gpio_set_level(user_data->HX711_SCK_pin, 1); // 'n' steps - esp_rom_delay_us(1); - gpio_set_level(user_data->HX711_SCK_pin, 0); - esp_rom_delay_us(1); - } - PORT_EXIT_CRITICAL(); + /* STEP 2*/ + // Apply the gain pulses to complete serial communication + for (uint8_t n = ((uint8_t)_gain); n > 0; n--) + { + gpio_set_level(user_data->HX711_SCK_pin, 1); // 'n' steps + esp_rom_delay_us(1); + gpio_set_level(user_data->HX711_SCK_pin, 0); + esp_rom_delay_us(1); + } + PORT_EXIT_CRITICAL(); - //----ending the conversion--- - // Note : 'Data_pin' is pulled high starting during step: [24~27] - if (!gpio_get_level(user_data->HX711_DT_pin)) - { - TRACE_E("DATA_PIN is low........................... SYSTEM BUSY"); - } + //----ending the conversion--- + // Note : 'Data_pin' is pulled high starting during step: [24~27] + if (!gpio_get_level(user_data->HX711_DT_pin)) + { + TRACE_E("DATA_PIN is low........................... SYSTEM BUSY"); + } - // SIGN extend - // 24th bit is the sign bit // - data ^= 0x800000; + // SIGN extend + // 24th bit is the sign bit // + data ^= 0x800000; - raw_data = (float)data; + raw_data = (float)data; + } } // TRACE_E("Raw_data -> %.2f ", raw_data); return raw_data; @@ -368,17 +389,20 @@ static void __hx711_power_reset(l_ezlopi_item_t *item) if (item) { s_hx711_data_t *user_data = (s_hx711_data_t *)item->user_arg; - PORT_ENTER_CRITICAL(); - // Pull the clock pin low to make sure this reset condition occurs - gpio_set_level(user_data->HX711_SCK_pin, 0); - - // Pull the clock pin high - gpio_set_level(user_data->HX711_SCK_pin, 1); - esp_rom_delay_us(70); - - // Pull the clock pin low for NORMAL operation - gpio_set_level(user_data->HX711_SCK_pin, 0); - esp_rom_delay_us(10); - PORT_EXIT_CRITICAL(); + if (user_data) + { + PORT_ENTER_CRITICAL(); + // Pull the clock pin low to make sure this reset condition occurs + gpio_set_level(user_data->HX711_SCK_pin, 0); + + // Pull the clock pin high + gpio_set_level(user_data->HX711_SCK_pin, 1); + esp_rom_delay_us(70); + + // Pull the clock pin low for NORMAL operation + gpio_set_level(user_data->HX711_SCK_pin, 0); + esp_rom_delay_us(10); + PORT_EXIT_CRITICAL(); + } } } diff --git a/ezlopi-sensors-devices/sensor-0048-other-MQ4-CH4-detector/sensor_0048_other_MQ4_CH4_detector.c b/ezlopi-sensors-devices/sensor-0048-other-MQ4-CH4-detector/sensor_0048_other_MQ4_CH4_detector.c index 1975a94b7..1a54ccec1 100644 --- a/ezlopi-sensors-devices/sensor-0048-other-MQ4-CH4-detector/sensor_0048_other_MQ4_CH4_detector.c +++ b/ezlopi-sensors-devices/sensor-0048-other-MQ4-CH4-detector/sensor_0048_other_MQ4_CH4_detector.c @@ -73,14 +73,7 @@ int sensor_0048_other_MQ4_CH4_detector(e_ezlopi_actions_t action, l_ezlopi_item_ } case EZLOPI_ACTION_NOTIFY_1000_MS: { - if (item) - { - s_mq4_value_t *MQ4_value = (s_mq4_value_t *)item->user_arg; - if (true == MQ4_value->Calibration_complete_CH4) - { - __0048_notify(item); - } - } + __0048_notify(item); break; } default: @@ -156,37 +149,63 @@ static int __0048_init(l_ezlopi_item_t *item) int ret = 0; if (NULL != item) { - if ((ezlopi_item_name_gas_alarm == item->cloud_properties.item_name) && GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) + if ((ezlopi_item_name_gas_alarm == item->cloud_properties.item_name)) { - // intialize digital_pin - gpio_config_t input_conf = {}; - input_conf.pin_bit_mask = (1ULL << (item->interface.gpio.gpio_in.gpio_num)); - input_conf.intr_type = GPIO_INTR_DISABLE; - input_conf.mode = GPIO_MODE_INPUT; - input_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; - input_conf.pull_up_en = GPIO_PULLUP_ENABLE; - gpio_config(&input_conf); - ret = 1; + if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) + { // intialize digital_pin + gpio_config_t input_conf = {}; + input_conf.pin_bit_mask = (1ULL << (item->interface.gpio.gpio_in.gpio_num)); + input_conf.intr_type = GPIO_INTR_DISABLE; + input_conf.mode = GPIO_MODE_INPUT; + input_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; + input_conf.pull_up_en = GPIO_PULLUP_ENABLE; + ret = (0 == gpio_config(&input_conf)) ? 1 : -1; + } + else + { + ret = -1; + TRACE_E("Deleting Item!!"); + ezlopi_device_free_device_by_item(item); // remove the item itself + } } - if ((ezlopi_item_name_smoke_density == item->cloud_properties.item_name) && GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + else if ((ezlopi_item_name_smoke_density == item->cloud_properties.item_name)) { - // initialize analog_pin - ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit); - // calibrate if not done s_mq4_value_t *MQ4_value = (s_mq4_value_t *)item->user_arg; - if (false == MQ4_value->Calibration_complete_CH4) + if (MQ4_value) { - xTaskCreate(__calibrate_MQ4_R0_resistance, "Task_to_calculate_R0_air", 2048, item, 1, NULL); + if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + { // initialize analog_pin + if (0 == ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit)) + { // calibrate if not done + if (false == MQ4_value->Calibration_complete_CH4) + { + xTaskCreate(__calibrate_MQ4_R0_resistance, "Task_to_calculate_R0_air", 2048, item, 1, NULL); + } + ret = 1; + } + else + { + ret = -1; + TRACE_E("Deleting Item!!"); + free(item->user_arg); + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); // remove the item itself + } + } + else + { + ret = -1; + TRACE_E("Deleting Item!!"); + free(item->user_arg); + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); // remove the item itself + } } - ret = 1; - } - if (0 == ret) - { - ret = -1; - if (item->user_arg) + else { - free(item->user_arg); - item->user_arg = NULL; + ret = -1; + TRACE_E("Deleting Item!!"); + ezlopi_device_free_device_by_item(item); // remove the item itself; } } } @@ -286,10 +305,16 @@ static int __0048_get_item(l_ezlopi_item_t *item, void *arg) if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { s_mq4_value_t *MQ4_value = ((s_mq4_value_t *)item->user_arg); - char *valueFormatted = ezlopi_valueformatter_float(MQ4_value->_CH4_ppm); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ4_value->_CH4_ppm); - free(valueFormatted); + if (MQ4_value) + { + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ4_value->_CH4_ppm); + char *valueFormatted = ezlopi_valueformatter_float(MQ4_value->_CH4_ppm); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } } ret = 1; } @@ -313,10 +338,16 @@ static int __0048_get_cjson_value(l_ezlopi_item_t *item, void *arg) if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { s_mq4_value_t *MQ4_value = ((s_mq4_value_t *)item->user_arg); - char *valueFormatted = ezlopi_valueformatter_float(MQ4_value->_CH4_ppm); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, (MQ4_value->_CH4_ppm)); - free(valueFormatted); + if (MQ4_value) + { + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, (MQ4_value->_CH4_ppm)); + char *valueFormatted = ezlopi_valueformatter_float(MQ4_value->_CH4_ppm); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } } ret = 1; } @@ -346,15 +377,18 @@ static int __0048_notify(l_ezlopi_item_t *item) ezlopi_device_value_updated_from_device_v3(item); } } - if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) + else if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { - // extract the sensor_output_values - double new_value = (double)__extract_MQ4_sensor_ppm(item); s_mq4_value_t *MQ4_value = (s_mq4_value_t *)item->user_arg; - if (fabs((double)(MQ4_value->_CH4_ppm) - new_value) > 0.0001) + if ((MQ4_value) && (true == MQ4_value->Calibration_complete_CH4)) { - ezlopi_device_value_updated_from_device_v3(item); - MQ4_value->_CH4_ppm = (float)new_value; + // extract the sensor_output_values + double new_value = (double)__extract_MQ4_sensor_ppm(item); + if (fabs((double)(MQ4_value->_CH4_ppm) - new_value) > 0.0001) + { + MQ4_value->_CH4_ppm = (float)new_value; + ezlopi_device_value_updated_from_device_v3(item); + } } } ret = 1; @@ -364,49 +398,52 @@ static int __0048_notify(l_ezlopi_item_t *item) //------------------------------------------------------------------------------------------------------ static float __extract_MQ4_sensor_ppm(l_ezlopi_item_t *item) { - uint32_t mq4_adc_pin = item->interface.adc.gpio_num; s_mq4_value_t *MQ4_value = (s_mq4_value_t *)item->user_arg; - // calculation process - //------------------------------------------------- - s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; - // extract the mean_sensor_analog_output_voltage - float analog_sensor_volt = 0; - for (uint8_t x = 10; x > 0; x--) - { - ezlopi_adc_get_adc_data(mq4_adc_pin, &ezlopi_analog_data); + if (MQ4_value) + { // calculation process + uint32_t mq4_adc_pin = item->interface.adc.gpio_num; + //------------------------------------------------- + s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; + // extract the mean_sensor_analog_output_voltage + float analog_sensor_volt = 0; + for (uint8_t x = 10; x > 0; x--) + { + ezlopi_adc_get_adc_data(mq4_adc_pin, &ezlopi_analog_data); #ifdef VOLTAGE_DIVIDER_ADDED - analog_sensor_volt += ((float)(ezlopi_analog_data.voltage) * 2.0f); + analog_sensor_volt += ((float)(ezlopi_analog_data.voltage) * 2.0f); #else - analog_sensor_volt += (float)(ezlopi_analog_data.voltage); + analog_sensor_volt += (float)(ezlopi_analog_data.voltage); #endif - vTaskDelay(1); - } - analog_sensor_volt = analog_sensor_volt / 10.0f; + vTaskDelay(1); + } + analog_sensor_volt = analog_sensor_volt / 10.0f; - //----------------------------------------------------------------------------------- - // Stage_2 : [from 'sensor_0048_ADC_MQ4_methane_gas_detector.h'] + //----------------------------------------------------------------------------------- + // Stage_2 : [from 'sensor_0048_ADC_MQ4_methane_gas_detector.h'] - // 1. Calculate 'Rs_gas' for the gas detected - float Rs_gas = (((MQ4_VOLT_RESOLUTION_Vc * mq4_eqv_RL) / (analog_sensor_volt / 1000.0f)) - mq4_eqv_RL); + // 1. Calculate 'Rs_gas' for the gas detected + float Rs_gas = (((MQ4_VOLT_RESOLUTION_Vc * mq4_eqv_RL) / (analog_sensor_volt / 1000.0f)) - mq4_eqv_RL); - // 1.1 Calculate @ 'ratio' during CH4 presence - double _ratio = (Rs_gas / (((MQ4_value->MQ4_R0_constant) <= 0) ? (1.0f) : (MQ4_value->MQ4_R0_constant))); // avoid dividing by zero?? - if (_ratio <= 0) - { - _ratio = 0; - } - //------------------------------------------------- + // 1.1 Calculate @ 'ratio' during CH4 presence + double _ratio = (Rs_gas / (((MQ4_value->MQ4_R0_constant) <= 0) ? (1.0f) : (MQ4_value->MQ4_R0_constant))); // avoid dividing by zero?? + if (_ratio <= 0) + { + _ratio = 0; + } + //------------------------------------------------- - // 1.2 Calculate _CH4_ppm - float _CH4_ppm = (float)pow(10, (((float)log10(_ratio)) - b_coeff_mq4) / m_slope_mq4); // ---> _CH4_ppm = 10 ^ [ ( log(ratio) - b ) / m ] - if (_CH4_ppm < 0) - { - _CH4_ppm = 0; // No negative values accepted or upper datasheet recomendation. - } - TRACE_E("_CH4_ppm [CH4] : %.2f -> ratio[RS/R0] : %.2f -> Volts : %0.2fmv", _CH4_ppm, (float)_ratio, analog_sensor_volt); + // 1.2 Calculate _CH4_ppm + float _CH4_ppm = (float)pow(10, (((float)log10(_ratio)) - b_coeff_mq4) / m_slope_mq4); // ---> _CH4_ppm = 10 ^ [ ( log(ratio) - b ) / m ] + if (_CH4_ppm < 0) + { + _CH4_ppm = 0; // No negative values accepted or upper datasheet recomendation. + } + TRACE_E("_CH4_ppm [CH4] : %.2f -> ratio[RS/R0] : %.2f -> Volts : %0.2fmv", _CH4_ppm, (float)_ratio, analog_sensor_volt); + return _CH4_ppm; - //------------------------------------------------- - return _CH4_ppm; + //------------------------------------------------- + } + return 0; } static void __calibrate_MQ4_R0_resistance(void *params) @@ -415,55 +452,57 @@ static void __calibrate_MQ4_R0_resistance(void *params) if (NULL != item) { s_mq4_value_t *MQ4_value = (s_mq4_value_t *)item->user_arg; - - uint32_t mq4_adc_pin = item->interface.adc.gpio_num; - //------------------------------------------------- - // let the sensor to heat for 20seconds - for (uint8_t j = 20; j > 0; j--) + if (MQ4_value) { - TRACE_E("Heating sensor.........time left: %d sec", j); - vTaskDelay(100); // vTaskDelay(1000 / portTICK_PERIOD_MS); // 1sec delay before calibration - } - //------------------------------------------------- - // extract the mean_sensor_analog_output_voltage - float _sensor_volt = 0; - s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; - for (uint8_t i = 100; i > 0; i--) - { - if (i % 20 == 0) + uint32_t mq4_adc_pin = item->interface.adc.gpio_num; + //------------------------------------------------- + // let the sensor to heat for 20seconds + for (uint8_t j = 20; j > 0; j--) { - TRACE_W("Please Wait..Collecting Ambient Air data ........... [Avoid Smokes/gases]"); + TRACE_E("Heating sensor.........time left: %d sec", j); + vTaskDelay(100); // vTaskDelay(1000 / portTICK_PERIOD_MS); // 1sec delay before calibration } - // extract ADC values - ezlopi_adc_get_adc_data(mq4_adc_pin, &ezlopi_analog_data); + //------------------------------------------------- + // extract the mean_sensor_analog_output_voltage + float _sensor_volt = 0; + s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; + for (uint8_t i = 100; i > 0; i--) + { + if (i % 20 == 0) + { + TRACE_W("Please Wait..Collecting Ambient Air data ........... [Avoid Smokes/gases]"); + } + // extract ADC values + ezlopi_adc_get_adc_data(mq4_adc_pin, &ezlopi_analog_data); #ifdef VOLTAGE_DIVIDER_ADDED - _sensor_volt += (float)((ezlopi_analog_data.voltage) * 2.0f); // [0-2.4V] X2 + _sensor_volt += (float)((ezlopi_analog_data.voltage) * 2.0f); // [0-2.4V] X2 #else - _sensor_volt += (float)(ezlopi_analog_data->voltage); + _sensor_volt += (float)(ezlopi_analog_data->voltage); #endif - vTaskDelay(1); // 10ms - } - _sensor_volt = _sensor_volt / 100.0f; + vTaskDelay(1); // 10ms + } + _sensor_volt = _sensor_volt / 100.0f; - //------------------------------------------------- - // Calculate the 'Rs' of heater during clean air [calibration phase] - // Range -> [2Kohm - 20Kohm] - float RS_calib = 0; // Define variable for sensor resistance - RS_calib = ((MQ4_VOLT_RESOLUTION_Vc * mq4_eqv_RL) / (_sensor_volt / 1000.0f)) - mq4_eqv_RL; // Calculate RS in fresh air - TRACE_E("CALIB_TASK -> 'RS_calib' = %.2f", RS_calib); - if (RS_calib < 0) - { - RS_calib = 0; // No negative values accepted. - } - // Calculate the R0_air which is constant through-out - MQ4_value->MQ4_R0_constant = (RS_calib / RatioMQ4CleanAir); // Calculate MQ4_R0_constant - TRACE_E("CALIB_TASK -> 'MQ4_R0_constant' = %.2f", (MQ4_value->MQ4_R0_constant)); - if ((MQ4_value->MQ4_R0_constant) < 0) - { - (MQ4_value->MQ4_R0_constant) = 0; // No negative values accepted. + //------------------------------------------------- + // Calculate the 'Rs' of heater during clean air [calibration phase] + // Range -> [2Kohm - 20Kohm] + float RS_calib = 0; // Define variable for sensor resistance + RS_calib = ((MQ4_VOLT_RESOLUTION_Vc * mq4_eqv_RL) / (_sensor_volt / 1000.0f)) - mq4_eqv_RL; // Calculate RS in fresh air + TRACE_E("CALIB_TASK -> 'RS_calib' = %.2f", RS_calib); + if (RS_calib < 0) + { + RS_calib = 0; // No negative values accepted. + } + // Calculate the R0_air which is constant through-out + MQ4_value->MQ4_R0_constant = (RS_calib / RatioMQ4CleanAir); // Calculate MQ4_R0_constant + TRACE_E("CALIB_TASK -> 'MQ4_R0_constant' = %.2f", (MQ4_value->MQ4_R0_constant)); + if ((MQ4_value->MQ4_R0_constant) < 0) + { + (MQ4_value->MQ4_R0_constant) = 0; // No negative values accepted. + } + // Set calibration_complete_CH4 flag + MQ4_value->Calibration_complete_CH4 = true; } - // Set calibration_complete_CH4 flag - MQ4_value->Calibration_complete_CH4 = true; } vTaskDelete(NULL); } \ No newline at end of file diff --git a/ezlopi-sensors-devices/sensor-0049-other-MQ2-LPG-detector/sensor_0049_other_MQ2_LPG_detector.c b/ezlopi-sensors-devices/sensor-0049-other-MQ2-LPG-detector/sensor_0049_other_MQ2_LPG_detector.c index f8e8f4701..eb4573f58 100644 --- a/ezlopi-sensors-devices/sensor-0049-other-MQ2-LPG-detector/sensor_0049_other_MQ2_LPG_detector.c +++ b/ezlopi-sensors-devices/sensor-0049-other-MQ2-LPG-detector/sensor_0049_other_MQ2_LPG_detector.c @@ -24,28 +24,28 @@ typedef struct s_mq2_value bool Calibration_complete_LPG; } s_mq2_value_t; -const char* mq2_sensor_gas_alarm_token[] = { +const char *mq2_sensor_gas_alarm_token[] = { "no_gas", "combustible_gas_detected", "toxic_gas_detected", "unknown", }; //-------------------------------------------------------------------------------------------------------- -static int __0049_prepare(void* arg); -static int __0049_init(l_ezlopi_item_t* item); -static int __0049_get_item(l_ezlopi_item_t* item, void* arg); -static int __0049_get_cjson_value(l_ezlopi_item_t* item, void* arg); -static int __0049_notify(l_ezlopi_item_t* item); - -static void __calibrate_MQ2_R0_resistance(void* params); -static float __extract_MQ2_sensor_ppm(l_ezlopi_item_t* item); -static void __prepare_item_digi_cloud_properties(l_ezlopi_item_t* item, cJSON* cj_device); -static void __prepare_device_adc_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device); -static void __prepare_device_digi_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device); -static void __prepare_item_adc_cloud_properties(l_ezlopi_item_t* item, cJSON* cj_device, void* user_data); +static int __0049_prepare(void *arg); +static int __0049_init(l_ezlopi_item_t *item); +static int __0049_get_item(l_ezlopi_item_t *item, void *arg); +static int __0049_get_cjson_value(l_ezlopi_item_t *item, void *arg); +static int __0049_notify(l_ezlopi_item_t *item); + +static void __calibrate_MQ2_R0_resistance(void *params); +static float __extract_MQ2_sensor_ppm(l_ezlopi_item_t *item); +static void __prepare_item_digi_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_device); +static void __prepare_device_adc_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device); +static void __prepare_device_digi_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device); +static void __prepare_item_adc_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_device, void *user_data); //-------------------------------------------------------------------------------------------------------- -int sensor_0049_other_MQ2_LPG_detector(e_ezlopi_actions_t action, l_ezlopi_item_t* item, void* arg, void* user_arg) +int sensor_0049_other_MQ2_LPG_detector(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void *arg, void *user_arg) { int ret = 0; switch (action) @@ -74,16 +74,10 @@ int sensor_0049_other_MQ2_LPG_detector(e_ezlopi_actions_t action, l_ezlopi_item_ { if (item) { - s_mq2_value_t* MQ2_value = (s_mq2_value_t*)item->user_arg; - if (MQ2_value) - { - if (true == MQ2_value->Calibration_complete_LPG) - { - __0049_notify(item); - } - break; - } + __0049_notify(item); + + break; } } default: @@ -95,18 +89,18 @@ int sensor_0049_other_MQ2_LPG_detector(e_ezlopi_actions_t action, l_ezlopi_item_ } //---------------------------------------------------- -static int __0049_prepare(void* arg) +static int __0049_prepare(void *arg) { int ret = 0; - s_ezlopi_prep_arg_t* device_prep_arg = (s_ezlopi_prep_arg_t*)arg; + s_ezlopi_prep_arg_t *device_prep_arg = (s_ezlopi_prep_arg_t *)arg; if (device_prep_arg && (NULL != device_prep_arg->cjson_device)) { //--------------------------- DIGI - DEVICE 1 -------------------------------------------- - l_ezlopi_device_t* MQ2_device_digi = ezlopi_device_add_device(device_prep_arg->cjson_device); + l_ezlopi_device_t *MQ2_device_digi = ezlopi_device_add_device(device_prep_arg->cjson_device); if (MQ2_device_digi) { __prepare_device_digi_cloud_properties(MQ2_device_digi, device_prep_arg->cjson_device); - l_ezlopi_item_t* MQ2_item_digi = ezlopi_device_add_item_to_device(MQ2_device_digi, sensor_0049_other_MQ2_LPG_detector); + l_ezlopi_item_t *MQ2_item_digi = ezlopi_device_add_item_to_device(MQ2_device_digi, sensor_0049_other_MQ2_LPG_detector); if (MQ2_item_digi) { MQ2_item_digi->cloud_properties.device_id = MQ2_device_digi->cloud_properties.device_id; @@ -121,15 +115,15 @@ static int __0049_prepare(void* arg) } //---------------------------- ADC - DEVICE 2 ------------------------------------------- - s_mq2_value_t* MQ2_value = (s_mq2_value_t*)malloc(sizeof(s_mq2_value_t)); + s_mq2_value_t *MQ2_value = (s_mq2_value_t *)malloc(sizeof(s_mq2_value_t)); if (NULL != MQ2_value) { memset(MQ2_value, 0, sizeof(s_mq2_value_t)); - l_ezlopi_device_t* MQ2_device_adc = ezlopi_device_add_device(device_prep_arg->cjson_device); + l_ezlopi_device_t *MQ2_device_adc = ezlopi_device_add_device(device_prep_arg->cjson_device); if (MQ2_device_adc) { __prepare_device_adc_cloud_properties(MQ2_device_adc, device_prep_arg->cjson_device); - l_ezlopi_item_t* MQ2_item_adc = ezlopi_device_add_item_to_device(MQ2_device_adc, sensor_0049_other_MQ2_LPG_detector); + l_ezlopi_item_t *MQ2_item_adc = ezlopi_device_add_item_to_device(MQ2_device_adc, sensor_0049_other_MQ2_LPG_detector); if (MQ2_item_adc) { MQ2_item_adc->cloud_properties.device_id = MQ2_device_adc->cloud_properties.device_id; @@ -153,45 +147,76 @@ static int __0049_prepare(void* arg) return ret; } -static int __0049_init(l_ezlopi_item_t* item) +static int __0049_init(l_ezlopi_item_t *item) { int ret = 0; if (NULL != item) { - if ((ezlopi_item_name_gas_alarm == item->cloud_properties.item_name) && GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) + if (ezlopi_item_name_gas_alarm == item->cloud_properties.item_name) { - // intialize digital_pin - gpio_config_t input_conf = {}; - input_conf.pin_bit_mask = (1ULL << (item->interface.gpio.gpio_in.gpio_num)); - input_conf.intr_type = GPIO_INTR_DISABLE; - input_conf.mode = GPIO_MODE_INPUT; - input_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; - input_conf.pull_up_en = GPIO_PULLUP_ENABLE; - gpio_config(&input_conf); - ret = 1; + if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) + { // intialize digital_pin + gpio_config_t input_conf = {}; + input_conf.pin_bit_mask = (1ULL << (item->interface.gpio.gpio_in.gpio_num)); + input_conf.intr_type = GPIO_INTR_DISABLE; + input_conf.mode = GPIO_MODE_INPUT; + input_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; + input_conf.pull_up_en = GPIO_PULLUP_ENABLE; + ret = (0 == gpio_config(&input_conf)) ? 1 : -1; + } + else + { + ret = -1; + TRACE_E("Deleting Item!!"); + ezlopi_device_free_device_by_item(item); // remove the item itself + } } - if ((ezlopi_item_name_smoke_density == item->cloud_properties.item_name) && GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + else if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { - // initialize analog_pin - ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit); - // calibrate if not done - s_mq2_value_t* MQ2_value = (s_mq2_value_t*)item->user_arg; + s_mq2_value_t *MQ2_value = (s_mq2_value_t *)item->user_arg; if (MQ2_value) { - if (false == MQ2_value->Calibration_complete_LPG) + if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + { // initialize analog_pin + if (0 == ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit)) + { // calibrate if not done + if (false == MQ2_value->Calibration_complete_LPG) + { + xTaskCreate(__calibrate_MQ2_R0_resistance, "Task_to_calculate_R0_air", 2048, item, 1, NULL); + } + ret = 1; + } + else + { + ret = -1; + TRACE_E("Deleting Item!!"); + free(item->user_arg); + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); // remove the item itself + } + } + else { - xTaskCreate(__calibrate_MQ2_R0_resistance, "Task_to_calculate_R0_air", 2048, item, 1, NULL); + ret = -1; + TRACE_E("Deleting Item!!"); + free(item->user_arg); + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); // remove the item itself } } - - ret = 1; + else + { + ret = -1; + TRACE_E("Deleting Item!!"); + ezlopi_device_free_device_by_item(item); // remove the item itself; + } } } return ret; } //------------------------------------------------------------------------------------------------------ -static void __prepare_device_digi_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device) +static void __prepare_device_digi_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device) { // char *device_name = NULL; // CJSON_GET_VALUE_STRING(cj_device, ezlopi_dev_name_str, device_name); @@ -204,7 +229,7 @@ static void __prepare_device_digi_cloud_properties(l_ezlopi_device_t* device, cJ device->cloud_properties.info = NULL; device->cloud_properties.device_type_id = NULL; } -static void __prepare_item_digi_cloud_properties(l_ezlopi_item_t* item, cJSON* cj_device) +static void __prepare_item_digi_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_device) { item->cloud_properties.has_getter = true; item->cloud_properties.has_setter = false; @@ -219,7 +244,7 @@ static void __prepare_item_digi_cloud_properties(l_ezlopi_item_t* item, cJSON* c TRACE_S("MQ2-> DIGITAL_PIN: %d ", item->interface.gpio.gpio_in.gpio_num); } //------------------------------------------------------------------------------------------------------ -static void __prepare_device_adc_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device) +static void __prepare_device_adc_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device) { // char *device_name = NULL; // CJSON_GET_VALUE_STRING(cj_device, ezlopi_dev_name_str, device_name); @@ -232,7 +257,7 @@ static void __prepare_device_adc_cloud_properties(l_ezlopi_device_t* device, cJS device->cloud_properties.info = NULL; device->cloud_properties.device_type_id = NULL; } -static void __prepare_item_adc_cloud_properties(l_ezlopi_item_t* item, cJSON* cj_device, void* user_data) +static void __prepare_item_adc_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_device, void *user_data) { item->cloud_properties.has_getter = true; item->cloud_properties.has_setter = false; @@ -252,23 +277,23 @@ static void __prepare_item_adc_cloud_properties(l_ezlopi_item_t* item, cJSON* cj } //------------------------------------------------------------------------------------------------------ -static int __0049_get_item(l_ezlopi_item_t* item, void* arg) +static int __0049_get_item(l_ezlopi_item_t *item, void *arg) { int ret = 0; if (item && arg) { - cJSON* cj_result = (cJSON*)arg; + cJSON *cj_result = (cJSON *)arg; if (cj_result) { if (ezlopi_item_name_gas_alarm == item->cloud_properties.item_name) { //------------------- POSSIBLE JSON ENUM CONTENTS ---------------------------------- - cJSON* json_array_enum = cJSON_CreateArray(); + cJSON *json_array_enum = cJSON_CreateArray(); if (NULL != json_array_enum) { for (uint8_t i = 0; i < MQ2_GAS_ALARM_MAX; i++) { - cJSON* json_value = cJSON_CreateString(mq2_sensor_gas_alarm_token[i]); + cJSON *json_value = cJSON_CreateString(mq2_sensor_gas_alarm_token[i]); if (NULL != json_value) { cJSON_AddItemToArray(json_array_enum, json_value); @@ -277,15 +302,15 @@ static int __0049_get_item(l_ezlopi_item_t* item, void* arg) cJSON_AddItemToObject(cj_result, ezlopi_enum_str, json_array_enum); } //-------------------------------------------------------------------------------------- - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, (char*)item->user_arg ? item->user_arg : "no_gas"); - cJSON_AddStringToObject(cj_result, ezlopi_value_str, (char*)item->user_arg ? item->user_arg : "no_gas"); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, (char *)item->user_arg ? item->user_arg : "no_gas"); + cJSON_AddStringToObject(cj_result, ezlopi_value_str, (char *)item->user_arg ? item->user_arg : "no_gas"); } - if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) + else if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { - s_mq2_value_t* MQ2_value = ((s_mq2_value_t*)item->user_arg); + s_mq2_value_t *MQ2_value = ((s_mq2_value_t *)item->user_arg); if (MQ2_value) { - char* valueFormatted = ezlopi_valueformatter_float(MQ2_value->_LPG_ppm); + char *valueFormatted = ezlopi_valueformatter_float(MQ2_value->_LPG_ppm); if (valueFormatted) { cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); @@ -293,7 +318,6 @@ static int __0049_get_item(l_ezlopi_item_t* item, void* arg) free(valueFormatted); } } - } ret = 1; } @@ -301,30 +325,29 @@ static int __0049_get_item(l_ezlopi_item_t* item, void* arg) return ret; } -static int __0049_get_cjson_value(l_ezlopi_item_t* item, void* arg) +static int __0049_get_cjson_value(l_ezlopi_item_t *item, void *arg) { int ret = 0; if (item && arg) { - cJSON* cj_result = (cJSON*)arg; + cJSON *cj_result = (cJSON *)arg; if (cj_result) { if (ezlopi_item_name_gas_alarm == item->cloud_properties.item_name) { - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, (char*)item->user_arg ? item->user_arg : "no_gas"); - cJSON_AddStringToObject(cj_result, ezlopi_value_str, (char*)item->user_arg ? item->user_arg : "no_gas"); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, (char *)item->user_arg ? item->user_arg : "no_gas"); + cJSON_AddStringToObject(cj_result, ezlopi_value_str, (char *)item->user_arg ? item->user_arg : "no_gas"); } - if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) + else if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { - s_mq2_value_t* MQ2_value = ((s_mq2_value_t*)item->user_arg); + s_mq2_value_t *MQ2_value = ((s_mq2_value_t *)item->user_arg); if (MQ2_value) { - char* valueFormatted = ezlopi_valueformatter_float(MQ2_value->_LPG_ppm); + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ2_value->_LPG_ppm); + char *valueFormatted = ezlopi_valueformatter_float(MQ2_value->_LPG_ppm); if (valueFormatted) { - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ2_value->_LPG_ppm); free(valueFormatted); } } @@ -335,61 +358,55 @@ static int __0049_get_cjson_value(l_ezlopi_item_t* item, void* arg) return ret; } -static int __0049_notify(l_ezlopi_item_t* item) +static int __0049_notify(l_ezlopi_item_t *item) { int ret = 0; if (item) { - if (item->user_arg) + if (ezlopi_item_name_gas_alarm == item->cloud_properties.item_name) { - if (ezlopi_item_name_gas_alarm == item->cloud_properties.item_name) + const char *curret_value = NULL; + if (0 == gpio_get_level(item->interface.gpio.gpio_in.gpio_num)) // when D0 -> 0V, { - const char* curret_value = NULL; - if (0 == gpio_get_level(item->interface.gpio.gpio_in.gpio_num)) // when D0 -> 0V, - { - curret_value = "combustible_gas_detected"; - } - else - { - curret_value = "no_gas"; - } - - if (curret_value != (char*)item->user_arg) // calls update only if there is change in state - { - item->user_arg = (void*)curret_value; - ezlopi_device_value_updated_from_device_v3(item); - } + curret_value = "combustible_gas_detected"; + } + else + { + curret_value = "no_gas"; } - if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) + if (curret_value != (char *)item->user_arg) // calls update only if there is change in state + { + item->user_arg = (void *)curret_value; + ezlopi_device_value_updated_from_device_v3(item); + } + } + else if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) + { + // extract the sensor_output_values + s_mq2_value_t *MQ2_value = (s_mq2_value_t *)item->user_arg; + if ((MQ2_value) && (true == MQ2_value->Calibration_complete_LPG)) { - // extract the sensor_output_values double new_value = (double)__extract_MQ2_sensor_ppm(item); - s_mq2_value_t* MQ2_value = (s_mq2_value_t*)item->user_arg; - if (MQ2_value) + if (fabs((double)(MQ2_value->_LPG_ppm) - new_value) > 0.0001) { - if (fabs((double)(MQ2_value->_LPG_ppm) - new_value) > 0.0001) - { - MQ2_value->_LPG_ppm = (float)new_value; - ezlopi_device_value_updated_from_device_v3(item); - } + MQ2_value->_LPG_ppm = (float)new_value; + ezlopi_device_value_updated_from_device_v3(item); } } - ret = 1; } + ret = 1; } return ret; } //------------------------------------------------------------------------------------------------------ -static float __extract_MQ2_sensor_ppm(l_ezlopi_item_t* item) +static float __extract_MQ2_sensor_ppm(l_ezlopi_item_t *item) { - uint32_t mq2_adc_pin = item->interface.adc.gpio_num; - s_mq2_value_t* MQ2_value = (s_mq2_value_t*)item->user_arg; - float ret = 0.0; + s_mq2_value_t *MQ2_value = (s_mq2_value_t *)item->user_arg; if (MQ2_value) - { - // calculation process - //------------------------------------------------- - s_ezlopi_analog_data_t ezlopi_analog_data = { .value = 0, .voltage = 0 }; + { // calculation process + //------------------------------------------------- + uint32_t mq2_adc_pin = item->interface.adc.gpio_num; + s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; // extract the mean_sensor_analog_output_voltage float analog_sensor_volt = 0; for (uint8_t x = 10; x > 0; x--) @@ -425,20 +442,18 @@ static float __extract_MQ2_sensor_ppm(l_ezlopi_item_t* item) _LPG_ppm = 0; // No negative values accepted or upper datasheet recomendation. } TRACE_E("_LPG_ppm [LPG] : %.2f -> ratio[RS/R0] : %.2f -> Volts : %0.2fmv", _LPG_ppm, (float)_ratio, analog_sensor_volt); - + return _LPG_ppm; //------------------------------------------------- - ret = _LPG_ppm; } - return ret; + return 0; } -void __calibrate_MQ2_R0_resistance(void* params) +void __calibrate_MQ2_R0_resistance(void *params) { - l_ezlopi_item_t* item = (l_ezlopi_item_t*)params; + l_ezlopi_item_t *item = (l_ezlopi_item_t *)params; if (NULL != item) { - s_mq2_value_t* MQ2_value = (s_mq2_value_t*)item->user_arg; - + s_mq2_value_t *MQ2_value = (s_mq2_value_t *)item->user_arg; if (MQ2_value) { uint32_t mq2_adc_pin = item->interface.adc.gpio_num; @@ -452,7 +467,7 @@ void __calibrate_MQ2_R0_resistance(void* params) //------------------------------------------------- // extract the mean_sensor_analog_output_voltage float _sensor_volt = 0; - s_ezlopi_analog_data_t ezlopi_analog_data = { .value = 0, .voltage = 0 }; + s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; for (uint8_t i = 100; i > 0; i--) { if (i % 20 == 0) @@ -490,6 +505,6 @@ void __calibrate_MQ2_R0_resistance(void* params) // Set calibration_complete_LPG flag MQ2_value->Calibration_complete_LPG = true; } - vTaskDelete(NULL); } + vTaskDelete(NULL); } \ No newline at end of file diff --git a/ezlopi-sensors-devices/sensor-0050-other-MQ3-alcohol-detector/sensor_0050_other_MQ3_alcohol_detector.c b/ezlopi-sensors-devices/sensor-0050-other-MQ3-alcohol-detector/sensor_0050_other_MQ3_alcohol_detector.c index 8fc19b1f0..021fb45ea 100644 --- a/ezlopi-sensors-devices/sensor-0050-other-MQ3-alcohol-detector/sensor_0050_other_MQ3_alcohol_detector.c +++ b/ezlopi-sensors-devices/sensor-0050-other-MQ3-alcohol-detector/sensor_0050_other_MQ3_alcohol_detector.c @@ -24,28 +24,28 @@ typedef struct s_mq3_value bool Calibration_complete_alcohol; } s_mq3_value_t; -const char *mq3_sensor_gas_alarm_token[] = { +const char* mq3_sensor_gas_alarm_token[] = { "no_gas", "combustible_gas_detected", "toxic_gas_detected", "unknown", }; //-------------------------------------------------------------------------------------------------------- -static int __0050_prepare(void *arg); -static int __0050_init(l_ezlopi_item_t *item); -static int __0050_get_item(l_ezlopi_item_t *item, void *arg); -static int __0050_get_cjson_value(l_ezlopi_item_t *item, void *arg); -static int __0050_notify(l_ezlopi_item_t *item); +static int __0050_prepare(void* arg); +static int __0050_init(l_ezlopi_item_t* item); +static int __0050_get_item(l_ezlopi_item_t* item, void* arg); +static int __0050_get_cjson_value(l_ezlopi_item_t* item, void* arg); +static int __0050_notify(l_ezlopi_item_t* item); -static void __calibrate_MQ3_R0_resistance(void *params); -static float __extract_MQ3_sensor_ppm(l_ezlopi_item_t *item); -static void __prepare_item_digi_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_device); -static void __prepare_device_adc_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device); -static void __prepare_device_digi_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device); -static void __prepare_item_adc_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_device, void *user_data); +static void __calibrate_MQ3_R0_resistance(void* params); +static float __extract_MQ3_sensor_ppm(l_ezlopi_item_t* item); +static void __prepare_item_digi_cloud_properties(l_ezlopi_item_t* item, cJSON* cj_device); +static void __prepare_device_adc_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device); +static void __prepare_device_digi_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device); +static void __prepare_item_adc_cloud_properties(l_ezlopi_item_t* item, cJSON* cj_device, void* user_data); //-------------------------------------------------------------------------------------------------------- -int sensor_0050_other_MQ3_alcohol_detector(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void *arg, void *user_arg) +int sensor_0050_other_MQ3_alcohol_detector(e_ezlopi_actions_t action, l_ezlopi_item_t* item, void* arg, void* user_arg) { int ret = 0; switch (action) @@ -72,14 +72,7 @@ int sensor_0050_other_MQ3_alcohol_detector(e_ezlopi_actions_t action, l_ezlopi_i } case EZLOPI_ACTION_NOTIFY_1000_MS: { - if (item) - { - s_mq3_value_t *MQ3_value = (s_mq3_value_t *)item->user_arg; - if (true == MQ3_value->Calibration_complete_alcohol) - { - __0050_notify(item); - } - } + __0050_notify(item); break; } default: @@ -91,18 +84,18 @@ int sensor_0050_other_MQ3_alcohol_detector(e_ezlopi_actions_t action, l_ezlopi_i } //---------------------------------------------------- -static int __0050_prepare(void *arg) +static int __0050_prepare(void* arg) { int ret = 0; - s_ezlopi_prep_arg_t *device_prep_arg = (s_ezlopi_prep_arg_t *)arg; + s_ezlopi_prep_arg_t* device_prep_arg = (s_ezlopi_prep_arg_t*)arg; if (device_prep_arg && (NULL != device_prep_arg->cjson_device)) { //--------------------------- DIGI - DEVICE 1 -------------------------------------------- - l_ezlopi_device_t *MQ3_device_digi = ezlopi_device_add_device(device_prep_arg->cjson_device); + l_ezlopi_device_t* MQ3_device_digi = ezlopi_device_add_device(device_prep_arg->cjson_device); if (MQ3_device_digi) { __prepare_device_digi_cloud_properties(MQ3_device_digi, device_prep_arg->cjson_device); - l_ezlopi_item_t *MQ3_item_digi = ezlopi_device_add_item_to_device(MQ3_device_digi, sensor_0050_other_MQ3_alcohol_detector); + l_ezlopi_item_t* MQ3_item_digi = ezlopi_device_add_item_to_device(MQ3_device_digi, sensor_0050_other_MQ3_alcohol_detector); if (MQ3_item_digi) { MQ3_item_digi->cloud_properties.device_id = MQ3_device_digi->cloud_properties.device_id; @@ -117,15 +110,15 @@ static int __0050_prepare(void *arg) } //---------------------------- ADC - DEVICE 2 ------------------------------------------- - s_mq3_value_t *MQ3_value = (s_mq3_value_t *)malloc(sizeof(s_mq3_value_t)); + s_mq3_value_t* MQ3_value = (s_mq3_value_t*)malloc(sizeof(s_mq3_value_t)); if (NULL != MQ3_value) { memset(MQ3_value, 0, sizeof(s_mq3_value_t)); - l_ezlopi_device_t *MQ3_device_adc = ezlopi_device_add_device(device_prep_arg->cjson_device); + l_ezlopi_device_t* MQ3_device_adc = ezlopi_device_add_device(device_prep_arg->cjson_device); if (MQ3_device_adc) { __prepare_device_adc_cloud_properties(MQ3_device_adc, device_prep_arg->cjson_device); - l_ezlopi_item_t *MQ3_item_adc = ezlopi_device_add_item_to_device(MQ3_device_adc, sensor_0050_other_MQ3_alcohol_detector); + l_ezlopi_item_t* MQ3_item_adc = ezlopi_device_add_item_to_device(MQ3_device_adc, sensor_0050_other_MQ3_alcohol_detector); if (MQ3_item_adc) { MQ3_item_adc->cloud_properties.device_id = MQ3_device_adc->cloud_properties.device_id; @@ -149,43 +142,70 @@ static int __0050_prepare(void *arg) return ret; } -static int __0050_init(l_ezlopi_item_t *item) +static int __0050_init(l_ezlopi_item_t* item) { int ret = 0; - if (NULL != item) + if (item) { - if ((ezlopi_item_name_gas_alarm == item->cloud_properties.item_name) && GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) - { - // intialize digital_pin - gpio_config_t input_conf = {}; - input_conf.pin_bit_mask = (1ULL << (item->interface.gpio.gpio_in.gpio_num)); - input_conf.intr_type = GPIO_INTR_DISABLE; - input_conf.mode = GPIO_MODE_INPUT; - input_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; - input_conf.pull_up_en = GPIO_PULLUP_ENABLE; - gpio_config(&input_conf); - ret = 1; - } - if ((ezlopi_item_name_smoke_density == item->cloud_properties.item_name) && GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + if (ezlopi_item_name_gas_alarm == item->cloud_properties.item_name) { - // initialize analog_pin - ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit); - // calibrate if not done - s_mq3_value_t *MQ3_value = (s_mq3_value_t *)item->user_arg; - if (false == MQ3_value->Calibration_complete_alcohol) + if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) + { // intialize digital_pin + gpio_config_t input_conf = {}; + input_conf.pin_bit_mask = (1ULL << (item->interface.gpio.gpio_in.gpio_num)); + input_conf.intr_type = GPIO_INTR_DISABLE; + input_conf.mode = GPIO_MODE_INPUT; + input_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; + input_conf.pull_up_en = GPIO_PULLUP_ENABLE; + gpio_config(&input_conf); + ret = 1; + } + else { - xTaskCreate(__calibrate_MQ3_R0_resistance, "Task_to_calculate_R0_air", 2048, item, 1, NULL); + ret = -1; + TRACE_E("Deleting Item!!"); + ezlopi_device_free_device_by_item(item); // remove the item itself } } - ret = 1; - } - if (0 == ret) - { - ret = -1; - if (item->user_arg) + else if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { - free(item->user_arg); - item->user_arg = NULL; + s_mq3_value_t* MQ3_value = ((s_mq3_value_t*)item->user_arg); + if (MQ3_value) + { + if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + { // initialize analog_pin + if (0 == ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit)) + { // calibrate if not done + if (false == MQ3_value->Calibration_complete_alcohol) + { + xTaskCreate(__calibrate_MQ3_R0_resistance, "Task_to_calculate_R0_air", 2048, item, 1, NULL); + } + ret = 1; + } + else + { + ret = -1; + TRACE_E("Deleting Item!!"); + free(item->user_arg); + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); // remove the item itself + } + } + else + { + ret = -1; + TRACE_E("Deleting Item!!"); + free(item->user_arg); + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); // remove the item itself + } + } + else + { + ret = -1; + TRACE_E("Deleting Item!!"); + ezlopi_device_free_device_by_item(item); // remove the item itself; + } } } @@ -193,7 +213,7 @@ static int __0050_init(l_ezlopi_item_t *item) } //------------------------------------------------------------------------------------------------------ -static void __prepare_device_digi_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device) +static void __prepare_device_digi_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device) { // char *device_name = NULL; // CJSON_GET_VALUE_STRING(cj_device, ezlopi_dev_name_str, device_name); @@ -206,7 +226,7 @@ static void __prepare_device_digi_cloud_properties(l_ezlopi_device_t *device, cJ device->cloud_properties.info = NULL; device->cloud_properties.device_type_id = NULL; } -static void __prepare_item_digi_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_device) +static void __prepare_item_digi_cloud_properties(l_ezlopi_item_t* item, cJSON* cj_device) { item->cloud_properties.has_getter = true; item->cloud_properties.has_setter = false; @@ -221,7 +241,7 @@ static void __prepare_item_digi_cloud_properties(l_ezlopi_item_t *item, cJSON *c TRACE_S("MQ3-> DIGITAL_PIN: %d ", item->interface.gpio.gpio_in.gpio_num); } //------------------------------------------------------------------------------------------------------ -static void __prepare_device_adc_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device) +static void __prepare_device_adc_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device) { // char *device_name = NULL; // CJSON_GET_VALUE_STRING(cj_device, ezlopi_dev_name_str, device_name); @@ -234,7 +254,7 @@ static void __prepare_device_adc_cloud_properties(l_ezlopi_device_t *device, cJS device->cloud_properties.info = NULL; device->cloud_properties.device_type_id = NULL; } -static void __prepare_item_adc_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_device, void *user_data) +static void __prepare_item_adc_cloud_properties(l_ezlopi_item_t* item, cJSON* cj_device, void* user_data) { item->cloud_properties.has_getter = true; item->cloud_properties.has_setter = false; @@ -254,23 +274,23 @@ static void __prepare_item_adc_cloud_properties(l_ezlopi_item_t *item, cJSON *cj } //------------------------------------------------------------------------------------------------------ -static int __0050_get_item(l_ezlopi_item_t *item, void *arg) +static int __0050_get_item(l_ezlopi_item_t* item, void* arg) { int ret = 0; if (item && arg) { - cJSON *cj_result = (cJSON *)arg; + cJSON* cj_result = (cJSON*)arg; if (cj_result) { if (ezlopi_item_name_gas_alarm == item->cloud_properties.item_name) { //------------------- POSSIBLE JSON ENUM CONTENTS ---------------------------------- - cJSON *json_array_enum = cJSON_CreateArray(); + cJSON* json_array_enum = cJSON_CreateArray(); if (NULL != json_array_enum) { for (uint8_t i = 0; i < MQ3_GAS_ALARM_MAX; i++) { - cJSON *json_value = cJSON_CreateString(mq3_sensor_gas_alarm_token[i]); + cJSON* json_value = cJSON_CreateString(mq3_sensor_gas_alarm_token[i]); if (NULL != json_value) { cJSON_AddItemToArray(json_array_enum, json_value); @@ -279,16 +299,22 @@ static int __0050_get_item(l_ezlopi_item_t *item, void *arg) cJSON_AddItemToObject(cj_result, ezlopi_enum_str, json_array_enum); } //-------------------------------------------------------------------------------------- - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, (char *)item->user_arg ? item->user_arg : "no_gas"); - cJSON_AddStringToObject(cj_result, ezlopi_value_str, (char *)item->user_arg ? item->user_arg : "no_gas"); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, (char*)item->user_arg ? item->user_arg : "no_gas"); + cJSON_AddStringToObject(cj_result, ezlopi_value_str, (char*)item->user_arg ? item->user_arg : "no_gas"); } - if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) + else if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { - s_mq3_value_t *MQ3_value = ((s_mq3_value_t *)item->user_arg); - char *valueFormatted = ezlopi_valueformatter_float(MQ3_value->_alcohol_ppm); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ3_value->_alcohol_ppm); - free(valueFormatted); + s_mq3_value_t* MQ3_value = ((s_mq3_value_t*)item->user_arg); + if (MQ3_value) + { + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ3_value->_alcohol_ppm); + char* valueFormatted = ezlopi_valueformatter_float(MQ3_value->_alcohol_ppm); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } } ret = 1; } @@ -296,26 +322,32 @@ static int __0050_get_item(l_ezlopi_item_t *item, void *arg) return ret; } -static int __0050_get_cjson_value(l_ezlopi_item_t *item, void *arg) +static int __0050_get_cjson_value(l_ezlopi_item_t* item, void* arg) { int ret = 0; if (item && arg) { - cJSON *cj_result = (cJSON *)arg; + cJSON* cj_result = (cJSON*)arg; if (cj_result) { if (ezlopi_item_name_gas_alarm == item->cloud_properties.item_name) { - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, (char *)item->user_arg ? item->user_arg : "no_gas"); - cJSON_AddStringToObject(cj_result, ezlopi_value_str, (char *)item->user_arg ? item->user_arg : "no_gas"); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, (char*)item->user_arg ? item->user_arg : "no_gas"); + cJSON_AddStringToObject(cj_result, ezlopi_value_str, (char*)item->user_arg ? item->user_arg : "no_gas"); } - if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) + else if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { - s_mq3_value_t *MQ3_value = ((s_mq3_value_t *)item->user_arg); - char *valueFormatted = ezlopi_valueformatter_float(MQ3_value->_alcohol_ppm); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ3_value->_alcohol_ppm); - free(valueFormatted); + s_mq3_value_t* MQ3_value = ((s_mq3_value_t*)item->user_arg); + if (MQ3_value) + { + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ3_value->_alcohol_ppm); + char* valueFormatted = ezlopi_valueformatter_float(MQ3_value->_alcohol_ppm); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } } ret = 1; } @@ -323,14 +355,14 @@ static int __0050_get_cjson_value(l_ezlopi_item_t *item, void *arg) return ret; } -static int __0050_notify(l_ezlopi_item_t *item) +static int __0050_notify(l_ezlopi_item_t* item) { int ret = 0; if (item) { if (ezlopi_item_name_gas_alarm == item->cloud_properties.item_name) { - const char *curret_value = NULL; + const char* curret_value = NULL; if (0 == gpio_get_level(item->interface.gpio.gpio_in.gpio_num)) // when D0 -> 0V, { curret_value = "combustible_gas_detected"; @@ -339,21 +371,24 @@ static int __0050_notify(l_ezlopi_item_t *item) { curret_value = "no_gas"; } - if (curret_value != (char *)item->user_arg) // calls update only if there is change in state + if (curret_value != (char*)item->user_arg) // calls update only if there is change in state { - item->user_arg = (void *)curret_value; + item->user_arg = (void*)curret_value; ezlopi_device_value_updated_from_device_v3(item); } } - if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) + else if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { // extract the sensor_output_values - double new_value = (double)__extract_MQ3_sensor_ppm(item); - s_mq3_value_t *MQ3_value = (s_mq3_value_t *)item->user_arg; - if (fabs((double)(MQ3_value->_alcohol_ppm) - new_value) > 0.0001) + s_mq3_value_t* MQ3_value = (s_mq3_value_t*)item->user_arg; + if ((MQ3_value) && (true == MQ3_value->Calibration_complete_alcohol)) { - MQ3_value->_alcohol_ppm = (float)new_value; - ezlopi_device_value_updated_from_device_v3(item); + double new_value = (double)__extract_MQ3_sensor_ppm(item); + if (fabs((double)(MQ3_value->_alcohol_ppm) - new_value) > 0.0001) + { + MQ3_value->_alcohol_ppm = (float)new_value; + ezlopi_device_value_updated_from_device_v3(item); + } } } ret = 1; @@ -361,108 +396,113 @@ static int __0050_notify(l_ezlopi_item_t *item) return ret; } //------------------------------------------------------------------------------------------------------ -static float __extract_MQ3_sensor_ppm(l_ezlopi_item_t *item) +static float __extract_MQ3_sensor_ppm(l_ezlopi_item_t* item) { - uint32_t mq3_adc_pin = item->interface.adc.gpio_num; - s_mq3_value_t *MQ3_value = (s_mq3_value_t *)item->user_arg; - // calculation process - //------------------------------------------------- - s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; - // extract the mean_sensor_analog_output_voltage - float analog_sensor_volt = 0; - for (uint8_t x = 10; x > 0; x--) - { - ezlopi_adc_get_adc_data(mq3_adc_pin, &ezlopi_analog_data); + s_mq3_value_t* MQ3_value = (s_mq3_value_t*)item->user_arg; + if (MQ3_value) + { // calculation process + uint32_t mq3_adc_pin = item->interface.adc.gpio_num; + //------------------------------------------------- + s_ezlopi_analog_data_t ezlopi_analog_data = { .value = 0, .voltage = 0 }; + // extract the mean_sensor_analog_output_voltage + float analog_sensor_volt = 0; + for (uint8_t x = 10; x > 0; x--) + { + ezlopi_adc_get_adc_data(mq3_adc_pin, &ezlopi_analog_data); #ifdef VOLTAGE_DIVIDER_ADDED - analog_sensor_volt += ((float)(ezlopi_analog_data.voltage) * 2.0f); + analog_sensor_volt += ((float)(ezlopi_analog_data.voltage) * 2.0f); #else - analog_sensor_volt += (float)(ezlopi_analog_data.voltage); + analog_sensor_volt += (float)(ezlopi_analog_data.voltage); #endif - vTaskDelay(1); - } - analog_sensor_volt = analog_sensor_volt / 10.0f; + vTaskDelay(1); + } + analog_sensor_volt = analog_sensor_volt / 10.0f; - //----------------------------------------------------------------------------------- - // Stage_2 : [from 'sensor_0050_ADC_MQ3_methane_gas_detector.h'] + //----------------------------------------------------------------------------------- + // Stage_2 : [from 'sensor_0050_ADC_MQ3_methane_gas_detector.h'] - // 1. Calculate 'Rs_gas' for the gas detected - float Rs_gas = (((MQ3_VOLT_RESOLUTION_Vc * mq3_eqv_RL) / (analog_sensor_volt / 1000.0f)) - mq3_eqv_RL); + // 1. Calculate 'Rs_gas' for the gas detected + float Rs_gas = (((MQ3_VOLT_RESOLUTION_Vc * mq3_eqv_RL) / (analog_sensor_volt / 1000.0f)) - mq3_eqv_RL); - // 1.1 Calculate @ 'ratio' during alcohol presence - double _ratio = (Rs_gas / ((MQ3_value->MQ3_R0_constant <= 0) ? (1.0f) : (MQ3_value->MQ3_R0_constant))); // avoid dividing by zero?? - if (_ratio <= 0) - { - _ratio = 0; - } - //------------------------------------------------- + // 1.1 Calculate @ 'ratio' during alcohol presence + double _ratio = (Rs_gas / ((MQ3_value->MQ3_R0_constant <= 0) ? (1.0f) : (MQ3_value->MQ3_R0_constant))); // avoid dividing by zero?? + if (_ratio <= 0) + { + _ratio = 0; + } + //------------------------------------------------- - // 1.2 Calculate _alcohol_ppm - float _alcohol_ppm = (float)pow(10, (((float)log10(_ratio)) - b_coeff_mq3) / m_slope_mq3); // ---> _alcohol_ppm = 10 ^ [ ( log(ratio) - b ) / m ] - if (_alcohol_ppm < 0) - { - _alcohol_ppm = 0; // No negative values accepted or upper datasheet recomendation. - } - TRACE_E("_alcohol_ppm [alcohol] : %.2f -> ratio[RS/R0] : %.2f -> Volts : %0.2fmv", _alcohol_ppm, (float)_ratio, analog_sensor_volt); + // 1.2 Calculate _alcohol_ppm + float _alcohol_ppm = (float)pow(10, (((float)log10(_ratio)) - b_coeff_mq3) / m_slope_mq3); // ---> _alcohol_ppm = 10 ^ [ ( log(ratio) - b ) / m ] + if (_alcohol_ppm < 0) + { + _alcohol_ppm = 0; // No negative values accepted or upper datasheet recomendation. + } + TRACE_E("_alcohol_ppm [alcohol] : %.2f -> ratio[RS/R0] : %.2f -> Volts : %0.2fmv", _alcohol_ppm, (float)_ratio, analog_sensor_volt); - //------------------------------------------------- - return _alcohol_ppm; + //------------------------------------------------- + return _alcohol_ppm; + } + return 0; } -static void __calibrate_MQ3_R0_resistance(void *params) +static void __calibrate_MQ3_R0_resistance(void* params) { - l_ezlopi_item_t *item = (l_ezlopi_item_t *)params; + l_ezlopi_item_t* item = (l_ezlopi_item_t*)params; if (NULL != item) { - s_mq3_value_t *MQ3_value = (s_mq3_value_t *)item->user_arg; - - uint32_t mq3_adc_pin = item->interface.adc.gpio_num; - //------------------------------------------------- - // let the sensor to heat for 20seconds - for (uint8_t j = 20; j > 0; j--) + s_mq3_value_t* MQ3_value = (s_mq3_value_t*)item->user_arg; + if (MQ3_value) { - TRACE_E("Heating sensor.........time left: %d sec", j); - vTaskDelay(100); // vTaskDelay(1000 / portTICK_PERIOD_MS); // 1sec delay before calibration - } - //------------------------------------------------- - // extract the mean_sensor_analog_output_voltage - float _sensor_volt = 0; - s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; - for (uint8_t i = 100; i > 0; i--) - { - if (i % 20 == 0) + uint32_t mq3_adc_pin = item->interface.adc.gpio_num; + //------------------------------------------------- + // let the sensor to heat for 20seconds + for (uint8_t j = 20; j > 0; j--) { - TRACE_W("Please Wait..Collecting Ambient Air data ........... [Avoid Smokes/gases]"); + TRACE_E("Heating sensor.........time left: %d sec", j); + vTaskDelay(100); // vTaskDelay(1000 / portTICK_PERIOD_MS); // 1sec delay before calibration } - // extract ADC values - ezlopi_adc_get_adc_data(mq3_adc_pin, &ezlopi_analog_data); + //------------------------------------------------- + // extract the mean_sensor_analog_output_voltage + float _sensor_volt = 0; + s_ezlopi_analog_data_t ezlopi_analog_data = { .value = 0, .voltage = 0 }; + for (uint8_t i = 100; i > 0; i--) + { + if (i % 20 == 0) + { + TRACE_W("Please Wait..Collecting Ambient Air data ........... [Avoid Smokes/gases]"); + } + // extract ADC values + ezlopi_adc_get_adc_data(mq3_adc_pin, &ezlopi_analog_data); #ifdef VOLTAGE_DIVIDER_ADDED - _sensor_volt += (float)((ezlopi_analog_data.voltage) * 2.0f); // [0-2.4V] X2 + _sensor_volt += (float)((ezlopi_analog_data.voltage) * 2.0f); // [0-2.4V] X2 #else - _sensor_volt += (float)(ezlopi_analog_data->voltage); + _sensor_volt += (float)(ezlopi_analog_data->voltage); #endif - vTaskDelay(1); // 10ms - } - _sensor_volt = _sensor_volt / 100.0f; + vTaskDelay(1); // 10ms + } + _sensor_volt = _sensor_volt / 100.0f; - //------------------------------------------------- - // Calculate the 'Rs' of heater during clean air [calibration phase] - // Range -> [2Kohm - 20Kohm] - float RS_calib = 0; // Define variable for sensor resistance - RS_calib = ((MQ3_VOLT_RESOLUTION_Vc * mq3_eqv_RL) / (_sensor_volt / 1000.0f)) - mq3_eqv_RL; // Calculate RS in fresh air - TRACE_E("CALIB_TASK -> 'RS_calib' = %.2f", RS_calib); - if (RS_calib < 0) - { - RS_calib = 0; // No negative values accepted. - } - // Calculate the R0_air which is constant through-out - MQ3_value->MQ3_R0_constant = (RS_calib / RatioMQ3CleanAir); // Calculate MQ3_R0_constant - TRACE_E("CALIB_TASK -> 'MQ3_R0_constant' = %.2f", MQ3_value->MQ3_R0_constant); - if (MQ3_value->MQ3_R0_constant < 0) - { - MQ3_value->MQ3_R0_constant = 0; // No negative values accepted. + //------------------------------------------------- + // Calculate the 'Rs' of heater during clean air [calibration phase] + // Range -> [2Kohm - 20Kohm] + float RS_calib = 0; // Define variable for sensor resistance + RS_calib = ((MQ3_VOLT_RESOLUTION_Vc * mq3_eqv_RL) / (_sensor_volt / 1000.0f)) - mq3_eqv_RL; // Calculate RS in fresh air + TRACE_E("CALIB_TASK -> 'RS_calib' = %.2f", RS_calib); + if (RS_calib < 0) + { + RS_calib = 0; // No negative values accepted. + } + // Calculate the R0_air which is constant through-out + MQ3_value->MQ3_R0_constant = (RS_calib / RatioMQ3CleanAir); // Calculate MQ3_R0_constant + TRACE_E("CALIB_TASK -> 'MQ3_R0_constant' = %.2f", MQ3_value->MQ3_R0_constant); + if (MQ3_value->MQ3_R0_constant < 0) + { + MQ3_value->MQ3_R0_constant = 0; // No negative values accepted. + } + // Set calibration_complete_alcohol flag + MQ3_value->Calibration_complete_alcohol = true; } - // Set calibration_complete_alcohol flag - MQ3_value->Calibration_complete_alcohol = true; } vTaskDelete(NULL); } \ No newline at end of file diff --git a/ezlopi-sensors-devices/sensor-0051-other-MQ8-H2-detector/sensor_0051_other_MQ8_H2_detector.c b/ezlopi-sensors-devices/sensor-0051-other-MQ8-H2-detector/sensor_0051_other_MQ8_H2_detector.c index 5244c4032..c7c606d1a 100644 --- a/ezlopi-sensors-devices/sensor-0051-other-MQ8-H2-detector/sensor_0051_other_MQ8_H2_detector.c +++ b/ezlopi-sensors-devices/sensor-0051-other-MQ8-H2-detector/sensor_0051_other_MQ8_H2_detector.c @@ -71,14 +71,8 @@ int sensor_0051_other_MQ8_H2_detector(e_ezlopi_actions_t action, l_ezlopi_item_t } case EZLOPI_ACTION_NOTIFY_1000_MS: { - if (item) - { - s_mq8_value_t *MQ8_value = (s_mq8_value_t *)item->user_arg; - if (true == MQ8_value->Calibration_complete_H2) - { - __0051_notify(item); - } - } + __0051_notify(item); + break; } default: @@ -153,37 +147,64 @@ static int __0051_init(l_ezlopi_item_t *item) int ret = 0; if (NULL != item) { - if ((ezlopi_item_name_gas_alarm == item->cloud_properties.item_name) && GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) + if (ezlopi_item_name_gas_alarm == item->cloud_properties.item_name) { - // intialize digital_pin - gpio_config_t input_conf = {}; - input_conf.pin_bit_mask = (1ULL << (item->interface.gpio.gpio_in.gpio_num)); - input_conf.intr_type = GPIO_INTR_DISABLE; - input_conf.mode = GPIO_MODE_INPUT; - input_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; - input_conf.pull_up_en = GPIO_PULLUP_ENABLE; - gpio_config(&input_conf); - ret = 1; + if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) + { // intialize digital_pin + gpio_config_t input_conf = {}; + input_conf.pin_bit_mask = (1ULL << (item->interface.gpio.gpio_in.gpio_num)); + input_conf.intr_type = GPIO_INTR_DISABLE; + input_conf.mode = GPIO_MODE_INPUT; + input_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; + input_conf.pull_up_en = GPIO_PULLUP_ENABLE; + ret = (0 == gpio_config(&input_conf)) ? 1 : -1; + } + else + { + ret = -1; + TRACE_E("Deleting Item!!"); + ezlopi_device_free_device_by_item(item); // remove the item itself + } } - if ((ezlopi_item_name_smoke_density == item->cloud_properties.item_name) && GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + else if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { - // initialize analog_pin - ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit); - // calibrate if not done + s_mq8_value_t *MQ8_value = (s_mq8_value_t *)item->user_arg; - if (false == MQ8_value->Calibration_complete_H2) + if (MQ8_value) { - xTaskCreate(__calibrate_MQ8_R0_resistance, "Task_to_calculate_R0_air", 2048, item, 1, NULL); + if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + { // initialize analog_pin + if (0 == ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit)) + { // calibrate if not done + if (false == MQ8_value->Calibration_complete_H2) + { + xTaskCreate(__calibrate_MQ8_R0_resistance, "Task_to_calculate_R0_air", 2048, item, 1, NULL); + } + ret = 1; + } + else + { + ret = -1; + TRACE_E("Deleting Item!!"); + free(item->user_arg); + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); // remove the item itself + } + } + else + { + ret = -1; + TRACE_E("Deleting Item!!"); + free(item->user_arg); + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); // remove the item itself + } } - ret = 1; - } - if (0 == ret) - { - ret = -1; - if (item->user_arg) + else { - free(item->user_arg); - item->user_arg = NULL; + ret = -1; + TRACE_E("Deleting Item!!"); + ezlopi_device_free_device_by_item(item); // remove the item itself } } } @@ -280,13 +301,19 @@ static int __0051_get_item(l_ezlopi_item_t *item, void *arg) cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, (char *)item->user_arg ? item->user_arg : "no_gas"); cJSON_AddStringToObject(cj_result, ezlopi_value_str, (char *)item->user_arg ? item->user_arg : "no_gas"); } - if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) + else if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { s_mq8_value_t *MQ8_value = ((s_mq8_value_t *)item->user_arg); - char *valueFormatted = ezlopi_valueformatter_float(MQ8_value->_H2_ppm); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ8_value->_H2_ppm); - free(valueFormatted); + if (MQ8_value) + { + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ8_value->_H2_ppm); + char *valueFormatted = ezlopi_valueformatter_float(MQ8_value->_H2_ppm); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } } ret = 1; } @@ -307,13 +334,19 @@ static int __0051_get_cjson_value(l_ezlopi_item_t *item, void *arg) cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, (char *)item->user_arg ? item->user_arg : "no_gas"); cJSON_AddStringToObject(cj_result, ezlopi_value_str, (char *)item->user_arg ? item->user_arg : "no_gas"); } - if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) + else if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { s_mq8_value_t *MQ8_value = ((s_mq8_value_t *)item->user_arg); - char *valueFormatted = ezlopi_valueformatter_float(MQ8_value->_H2_ppm); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ8_value->_H2_ppm); - free(valueFormatted); + if (MQ8_value) + { + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ8_value->_H2_ppm); + char *valueFormatted = ezlopi_valueformatter_float(MQ8_value->_H2_ppm); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } } ret = 1; } @@ -343,15 +376,19 @@ static int __0051_notify(l_ezlopi_item_t *item) ezlopi_device_value_updated_from_device_v3(item); } } - if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) + else if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { // extract the sensor_output_values - double new_value = (double)__extract_MQ8_sensor_ppm(item); s_mq8_value_t *MQ8_value = (s_mq8_value_t *)item->user_arg; - if (fabs((double)(MQ8_value->_H2_ppm) - new_value) > 0.0001) + if ((MQ8_value) && (true == MQ8_value->Calibration_complete_H2)) { - MQ8_value->_H2_ppm = (float)new_value; - ezlopi_device_value_updated_from_device_v3(item); + double new_value = (double)__extract_MQ8_sensor_ppm(item); + + if (fabs((double)(MQ8_value->_H2_ppm) - new_value) > 0.0001) + { + MQ8_value->_H2_ppm = (float)new_value; + ezlopi_device_value_updated_from_device_v3(item); + } } } ret = 1; @@ -361,49 +398,53 @@ static int __0051_notify(l_ezlopi_item_t *item) //------------------------------------------------------------------------------------------------------ static float __extract_MQ8_sensor_ppm(l_ezlopi_item_t *item) { - uint32_t mq8_adc_pin = item->interface.adc.gpio_num; s_mq8_value_t *MQ8_value = (s_mq8_value_t *)item->user_arg; - // calculation process - //------------------------------------------------- - s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; - // extract the mean_sensor_analog_output_voltage - float analog_sensor_volt = 0; - for (uint8_t x = 10; x > 0; x--) + if (MQ8_value) { - ezlopi_adc_get_adc_data(mq8_adc_pin, &ezlopi_analog_data); + // calculation process + //------------------------------------------------- + uint32_t mq8_adc_pin = item->interface.adc.gpio_num; + s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; + // extract the mean_sensor_analog_output_voltage + float analog_sensor_volt = 0; + for (uint8_t x = 10; x > 0; x--) + { + ezlopi_adc_get_adc_data(mq8_adc_pin, &ezlopi_analog_data); #ifdef VOLTAGE_DIVIDER_ADDED - analog_sensor_volt += ((float)(ezlopi_analog_data.voltage) * 2.0f); + analog_sensor_volt += ((float)(ezlopi_analog_data.voltage) * 2.0f); #else - analog_sensor_volt += (float)(ezlopi_analog_data.voltage); + analog_sensor_volt += (float)(ezlopi_analog_data.voltage); #endif - vTaskDelay(1); - } - analog_sensor_volt = analog_sensor_volt / 10.0f; + vTaskDelay(1); + } + analog_sensor_volt = analog_sensor_volt / 10.0f; - //----------------------------------------------------------------------------------- - // Stage_2 : [from 'sensor_0051_ADC_MQ8_methane_gas_detector.h'] + //----------------------------------------------------------------------------------- + // Stage_2 : [from 'sensor_0051_ADC_MQ8_methane_gas_detector.h'] - // 1. Calculate 'Rs_gas' for the gas detected - float Rs_gas = (((MQ8_VOLT_RESOLUTION_Vc * mq8_eqv_RL) / (analog_sensor_volt / 1000.0f)) - mq8_eqv_RL); + // 1. Calculate 'Rs_gas' for the gas detected + float Rs_gas = (((MQ8_VOLT_RESOLUTION_Vc * mq8_eqv_RL) / (analog_sensor_volt / 1000.0f)) - mq8_eqv_RL); - // 1.1 Calculate @ 'ratio' during H2 presence - double _ratio = (Rs_gas / ((MQ8_value->MQ8_R0_constant <= 0) ? (1.0f) : (MQ8_value->MQ8_R0_constant))); // avoid dividing by zero?? - if (_ratio <= 0) - { - _ratio = 0; - } - //------------------------------------------------- + // 1.1 Calculate @ 'ratio' during H2 presence + double _ratio = (Rs_gas / ((MQ8_value->MQ8_R0_constant <= 0) ? (1.0f) : (MQ8_value->MQ8_R0_constant))); // avoid dividing by zero?? + if (_ratio <= 0) + { + _ratio = 0; + } + //------------------------------------------------- - // 1.2 Calculate _H2_ppm - float _H2_ppm = (float)pow(10, (((float)log10(_ratio)) - b_coeff_mq8) / m_slope_mq8); // ---> _H2_ppm = 10 ^ [ ( log(ratio) - b ) / m ] - if (_H2_ppm < 0) - { - _H2_ppm = 0; // No negative values accepted or upper datasheet recomendation. - } - TRACE_E("_H2_ppm [H2] : %.2f -> ratio[RS/R0] : %.2f -> Volts : %0.2fmv", _H2_ppm, (float)_ratio, analog_sensor_volt); + // 1.2 Calculate _H2_ppm + float _H2_ppm = (float)pow(10, (((float)log10(_ratio)) - b_coeff_mq8) / m_slope_mq8); // ---> _H2_ppm = 10 ^ [ ( log(ratio) - b ) / m ] + if (_H2_ppm < 0) + { + _H2_ppm = 0; // No negative values accepted or upper datasheet recomendation. + } + TRACE_E("_H2_ppm [H2] : %.2f -> ratio[RS/R0] : %.2f -> Volts : %0.2fmv", _H2_ppm, (float)_ratio, analog_sensor_volt); - //------------------------------------------------- - return _H2_ppm; + //------------------------------------------------- + return _H2_ppm; + } + return 0; } static void __calibrate_MQ8_R0_resistance(void *params) @@ -412,55 +453,57 @@ static void __calibrate_MQ8_R0_resistance(void *params) if (NULL != item) { s_mq8_value_t *MQ8_value = (s_mq8_value_t *)item->user_arg; - - uint32_t mq8_adc_pin = item->interface.adc.gpio_num; - //------------------------------------------------- - // let the sensor to heat for 20seconds - for (uint8_t j = 20; j > 0; j--) - { - TRACE_E("Heating sensor.........time left: %d sec", j); - vTaskDelay(100); // vTaskDelay(1000 / portTICK_PERIOD_MS); // 1sec delay before calibration - } - //------------------------------------------------- - // extract the mean_sensor_analog_output_voltage - float _sensor_volt = 0; - s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; - for (uint8_t i = 100; i > 0; i--) + if (MQ8_value) { - if (i % 20 == 0) + uint32_t mq8_adc_pin = item->interface.adc.gpio_num; + //------------------------------------------------- + // let the sensor to heat for 20seconds + for (uint8_t j = 20; j > 0; j--) { - TRACE_W("Please Wait..Collecting Ambient Air data ........... [Avoid Smokes/gases]"); + TRACE_E("Heating sensor.........time left: %d sec", j); + vTaskDelay(100); // vTaskDelay(1000 / portTICK_PERIOD_MS); // 1sec delay before calibration } - // extract ADC values - ezlopi_adc_get_adc_data(mq8_adc_pin, &ezlopi_analog_data); + //------------------------------------------------- + // extract the mean_sensor_analog_output_voltage + float _sensor_volt = 0; + s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; + for (uint8_t i = 100; i > 0; i--) + { + if (i % 20 == 0) + { + TRACE_W("Please Wait..Collecting Ambient Air data ........... [Avoid Smokes/gases]"); + } + // extract ADC values + ezlopi_adc_get_adc_data(mq8_adc_pin, &ezlopi_analog_data); #ifdef VOLTAGE_DIVIDER_ADDED - _sensor_volt += (float)((ezlopi_analog_data.voltage) * 2.0f); // [0-2.4V] X2 + _sensor_volt += (float)((ezlopi_analog_data.voltage) * 2.0f); // [0-2.4V] X2 #else - _sensor_volt += (float)(ezlopi_analog_data->voltage); + _sensor_volt += (float)(ezlopi_analog_data->voltage); #endif - vTaskDelay(1); // 10ms - } - _sensor_volt = _sensor_volt / 100.0f; + vTaskDelay(1); // 10ms + } + _sensor_volt = _sensor_volt / 100.0f; - //------------------------------------------------- - // Calculate the 'Rs' of heater during clean air [calibration phase] - // Range -> [2Kohm - 20Kohm] - float RS_calib = 0; // Define variable for sensor resistance - RS_calib = ((MQ8_VOLT_RESOLUTION_Vc * mq8_eqv_RL) / (_sensor_volt / 1000.0f)) - mq8_eqv_RL; // Calculate RS in fresh air - TRACE_E("CALIB_TASK -> 'RS_calib' = %.2f", RS_calib); - if (RS_calib < 0) - { - RS_calib = 0; // No negative values accepted. - } - // Calculate the R0_air which is constant through-out - MQ8_value->MQ8_R0_constant = (RS_calib / RatioMQ8CleanAir); // Calculate MQ8_R0_constant - TRACE_E("CALIB_TASK -> 'MQ8_R0_constant' = %.2f", MQ8_value->MQ8_R0_constant); - if (MQ8_value->MQ8_R0_constant < 0) - { - MQ8_value->MQ8_R0_constant = 0; // No negative values accepted. + //------------------------------------------------- + // Calculate the 'Rs' of heater during clean air [calibration phase] + // Range -> [2Kohm - 20Kohm] + float RS_calib = 0; // Define variable for sensor resistance + RS_calib = ((MQ8_VOLT_RESOLUTION_Vc * mq8_eqv_RL) / (_sensor_volt / 1000.0f)) - mq8_eqv_RL; // Calculate RS in fresh air + TRACE_E("CALIB_TASK -> 'RS_calib' = %.2f", RS_calib); + if (RS_calib < 0) + { + RS_calib = 0; // No negative values accepted. + } + // Calculate the R0_air which is constant through-out + MQ8_value->MQ8_R0_constant = (RS_calib / RatioMQ8CleanAir); // Calculate MQ8_R0_constant + TRACE_E("CALIB_TASK -> 'MQ8_R0_constant' = %.2f", MQ8_value->MQ8_R0_constant); + if (MQ8_value->MQ8_R0_constant < 0) + { + MQ8_value->MQ8_R0_constant = 0; // No negative values accepted. + } + // Set calibration_complete_H2 flag + MQ8_value->Calibration_complete_H2 = true; } - // Set calibration_complete_H2 flag - MQ8_value->Calibration_complete_H2 = true; } vTaskDelete(NULL); } \ No newline at end of file diff --git a/ezlopi-sensors-devices/sensor-0052-other-MQ135-NH3-detector/sensor_0052_other_MQ135_NH3_detector.c b/ezlopi-sensors-devices/sensor-0052-other-MQ135-NH3-detector/sensor_0052_other_MQ135_NH3_detector.c index e6e2b8a36..7c2b8b5c6 100644 --- a/ezlopi-sensors-devices/sensor-0052-other-MQ135-NH3-detector/sensor_0052_other_MQ135_NH3_detector.c +++ b/ezlopi-sensors-devices/sensor-0052-other-MQ135-NH3-detector/sensor_0052_other_MQ135_NH3_detector.c @@ -71,14 +71,9 @@ int sensor_0052_other_MQ135_NH3_detector(e_ezlopi_actions_t action, l_ezlopi_ite } case EZLOPI_ACTION_NOTIFY_1000_MS: { - if (item) - { - s_mq135_value_t *MQ135_value = (s_mq135_value_t *)item->user_arg; - if (true == MQ135_value->Calibration_complete_NH3) - { - __0052_notify(item); - } - } + + __0052_notify(item); + break; } default: @@ -106,9 +101,11 @@ static int __0052_prepare(void *arg) { MQ135_item_digi->cloud_properties.device_id = MQ135_device_digi->cloud_properties.device_id; __prepare_item_digi_cloud_properties(MQ135_item_digi, device_prep_arg->cjson_device); + ret = 1; } else { + ret = -1; ezlopi_device_free_device(MQ135_device_digi); } } @@ -127,18 +124,20 @@ static int __0052_prepare(void *arg) { MQ135_item_adc->cloud_properties.device_id = MQ135_item_adc->cloud_properties.device_id; __prepare_item_adc_cloud_properties(MQ135_item_adc, device_prep_arg->cjson_device, MQ135_value); + ret = 1; } else { + ret = -1; ezlopi_device_free_device(MQ135_device_adc); free(MQ135_value); } } else { + ret = -1; free(MQ135_value); } - ret = 1; } } return ret; @@ -149,37 +148,63 @@ static int __0052_init(l_ezlopi_item_t *item) int ret = 0; if (NULL != item) { - if ((ezlopi_item_name_gas_alarm == item->cloud_properties.item_name) && GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) - { - // intialize digital_pin - gpio_config_t input_conf = {}; - input_conf.pin_bit_mask = (1ULL << (item->interface.gpio.gpio_in.gpio_num)); - input_conf.intr_type = GPIO_INTR_DISABLE; - input_conf.mode = GPIO_MODE_INPUT; - input_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; - input_conf.pull_up_en = GPIO_PULLUP_ENABLE; - gpio_config(&input_conf); - ret = 1; - } - if ((ezlopi_item_name_smoke_density == item->cloud_properties.item_name) && GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + if (ezlopi_item_name_gas_alarm == item->cloud_properties.item_name) { - // initialize analog_pin - ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit); - // calibrate if not done - s_mq135_value_t *MQ135_value = (s_mq135_value_t *)item->user_arg; - if (false == MQ135_value->Calibration_complete_NH3) + if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) + { // intialize digital_pin + gpio_config_t input_conf = {}; + input_conf.pin_bit_mask = (1ULL << (item->interface.gpio.gpio_in.gpio_num)); + input_conf.intr_type = GPIO_INTR_DISABLE; + input_conf.mode = GPIO_MODE_INPUT; + input_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; + input_conf.pull_up_en = GPIO_PULLUP_ENABLE; + ret = (0 == gpio_config(&input_conf)) ? 1 : -1; + } + else { - xTaskCreate(__calibrate_MQ135_R0_resistance, "Task_to_calculate_R0_air", 2048, item, 1, NULL); + ret = -1; + TRACE_E("Deleting Item!!"); + ezlopi_device_free_device_by_item(item); // remove the item itself } - ret = 1; } - if (0 == ret) + else if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { - ret = -1; - if (item->user_arg) + s_mq135_value_t *MQ135_value = ((s_mq135_value_t *)item->user_arg); + if (MQ135_value) + { + if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + { // initialize analog_pin + if (0 == ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit)) + { // calibrate if not done + if (false == MQ135_value->Calibration_complete_NH3) + { + xTaskCreate(__calibrate_MQ135_R0_resistance, "Task_to_calculate_R0_air", 2048, item, 1, NULL); + } + ret = 1; + } + else + { + ret = -1; + TRACE_E("Deleting Item!!"); + free(item->user_arg); + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); // remove the item itself + } + } + else + { + ret = -1; + TRACE_E("Deleting Item!!"); + free(item->user_arg); + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); // remove the item itself + } + } + else { - free(item->user_arg); - item->user_arg = NULL; + ret = -1; + TRACE_E("Deleting Item!!"); + ezlopi_device_free_device_by_item(item); // remove the item itself; } } } @@ -276,16 +301,19 @@ static int __0052_get_item(l_ezlopi_item_t *item, void *arg) cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, (char *)item->user_arg ? item->user_arg : "no_gas"); cJSON_AddStringToObject(cj_result, ezlopi_value_str, (char *)item->user_arg ? item->user_arg : "no_gas"); } - if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) + else if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { s_mq135_value_t *MQ135_value = ((s_mq135_value_t *)item->user_arg); - char *valueFormatted = ezlopi_valueformatter_float(MQ135_value->_NH3_ppm); - if (valueFormatted) + if (MQ135_value) { - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - free(valueFormatted); + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ135_value->_NH3_ppm); + char *valueFormatted = ezlopi_valueformatter_float(MQ135_value->_NH3_ppm); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } } - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ135_value->_NH3_ppm); } ret = 1; } @@ -306,16 +334,19 @@ static int __0052_get_cjson_value(l_ezlopi_item_t *item, void *arg) cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, (char *)item->user_arg ? item->user_arg : "no_gas"); cJSON_AddStringToObject(cj_result, ezlopi_value_str, (char *)item->user_arg ? item->user_arg : "no_gas"); } - if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) + else if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { s_mq135_value_t *MQ135_value = ((s_mq135_value_t *)item->user_arg); - char *valueFormatted = ezlopi_valueformatter_float(MQ135_value->_NH3_ppm); - if (valueFormatted) + if (MQ135_value) { - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - free(valueFormatted); + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ135_value->_NH3_ppm); + char *valueFormatted = ezlopi_valueformatter_float(MQ135_value->_NH3_ppm); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } } - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ135_value->_NH3_ppm); } ret = 1; } @@ -345,15 +376,18 @@ static int __0052_notify(l_ezlopi_item_t *item) ezlopi_device_value_updated_from_device_v3(item); } } - if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) + else if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { // extract the sensor_output_values - double new_value = (double)__extract_MQ135_sensor_ppm(item); s_mq135_value_t *MQ135_value = (s_mq135_value_t *)item->user_arg; - if (fabs((double)(MQ135_value->_NH3_ppm) - new_value) > 0.0001) + if ((MQ135_value) && (true == MQ135_value->Calibration_complete_NH3)) { - MQ135_value->_NH3_ppm = (float)new_value; - ezlopi_device_value_updated_from_device_v3(item); + double new_value = (double)__extract_MQ135_sensor_ppm(item); + if (fabs((double)(MQ135_value->_NH3_ppm) - new_value) > 0.0001) + { + MQ135_value->_NH3_ppm = (float)new_value; + ezlopi_device_value_updated_from_device_v3(item); + } } } ret = 1; @@ -363,49 +397,52 @@ static int __0052_notify(l_ezlopi_item_t *item) //------------------------------------------------------------------------------------------------------ static float __extract_MQ135_sensor_ppm(l_ezlopi_item_t *item) { - uint32_t mq135_adc_pin = item->interface.adc.gpio_num; s_mq135_value_t *MQ135_value = (s_mq135_value_t *)item->user_arg; - // calculation process - //------------------------------------------------- - s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; - // extract the mean_sensor_analog_output_voltage - float analog_sensor_volt = 0; - for (uint8_t x = 10; x > 0; x--) - { - ezlopi_adc_get_adc_data(mq135_adc_pin, &ezlopi_analog_data); + if (MQ135_value) + { // calculation process + //------------------------------------------------- + uint32_t mq135_adc_pin = item->interface.adc.gpio_num; + s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; + // extract the mean_sensor_analog_output_voltage + float analog_sensor_volt = 0; + for (uint8_t x = 10; x > 0; x--) + { + ezlopi_adc_get_adc_data(mq135_adc_pin, &ezlopi_analog_data); #ifdef VOLTAGE_DIVIDER_ADDED - analog_sensor_volt += ((float)(ezlopi_analog_data.voltage) * 2.0f); + analog_sensor_volt += ((float)(ezlopi_analog_data.voltage) * 2.0f); #else - analog_sensor_volt += (float)(ezlopi_analog_data.voltage); + analog_sensor_volt += (float)(ezlopi_analog_data.voltage); #endif - vTaskDelay(1); - } - analog_sensor_volt = analog_sensor_volt / 10.0f; + vTaskDelay(1); + } + analog_sensor_volt = analog_sensor_volt / 10.0f; - //----------------------------------------------------------------------------------- - // Stage_2 : [from 'sensor_0052_ADC_MQ135_methane_gas_detector.h'] + //----------------------------------------------------------------------------------- + // Stage_2 : [from 'sensor_0052_ADC_MQ135_methane_gas_detector.h'] - // 1. Calculate 'Rs_gas' for the gas detected - float Rs_gas = (((MQ135_VOLT_RESOLUTION_Vc * mq135_eqv_RL) / (analog_sensor_volt / 1000.0f)) - mq135_eqv_RL); + // 1. Calculate 'Rs_gas' for the gas detected + float Rs_gas = (((MQ135_VOLT_RESOLUTION_Vc * mq135_eqv_RL) / (analog_sensor_volt / 1000.0f)) - mq135_eqv_RL); - // 1.1 Calculate @ 'ratio' during NH3 presence - double _ratio = (Rs_gas / ((MQ135_value->MQ135_R0_constant <= 0) ? (1.0f) : (MQ135_value->MQ135_R0_constant))); // avoid dividing by zero?? - if (_ratio <= 0) - { - _ratio = 0; - } - //------------------------------------------------- + // 1.1 Calculate @ 'ratio' during NH3 presence + double _ratio = (Rs_gas / ((MQ135_value->MQ135_R0_constant <= 0) ? (1.0f) : (MQ135_value->MQ135_R0_constant))); // avoid dividing by zero?? + if (_ratio <= 0) + { + _ratio = 0; + } + //------------------------------------------------- - // 1.2 Calculate _NH3_ppm - float _NH3_ppm = (float)pow(10, (((float)log10(_ratio)) - b_coeff_mq135) / m_slope_mq135); // ---> _NH3_ppm = 10 ^ [ ( log(ratio) - b ) / m ] - if (_NH3_ppm < 0) - { - _NH3_ppm = 0; // No negative values accepted or upper datasheet recomendation. - } - TRACE_E("_NH3_ppm [NH3] : %.2f -> ratio[RS/R0] : %.2f -> Volts : %0.2fmv", _NH3_ppm, (float)_ratio, analog_sensor_volt); + // 1.2 Calculate _NH3_ppm + float _NH3_ppm = (float)pow(10, (((float)log10(_ratio)) - b_coeff_mq135) / m_slope_mq135); // ---> _NH3_ppm = 10 ^ [ ( log(ratio) - b ) / m ] + if (_NH3_ppm < 0) + { + _NH3_ppm = 0; // No negative values accepted or upper datasheet recomendation. + } + TRACE_E("_NH3_ppm [NH3] : %.2f -> ratio[RS/R0] : %.2f -> Volts : %0.2fmv", _NH3_ppm, (float)_ratio, analog_sensor_volt); - //------------------------------------------------- - return _NH3_ppm; + //------------------------------------------------- + return _NH3_ppm; + } + return 0; } static void __calibrate_MQ135_R0_resistance(void *params) @@ -414,55 +451,57 @@ static void __calibrate_MQ135_R0_resistance(void *params) if (NULL != item) { s_mq135_value_t *MQ135_value = (s_mq135_value_t *)item->user_arg; - - uint32_t mq135_adc_pin = item->interface.adc.gpio_num; - //------------------------------------------------- - // let the sensor to heat for 20seconds - for (uint8_t j = 20; j > 0; j--) + if (MQ135_value) { - TRACE_E("Heating sensor.........time left: %d sec", j); - vTaskDelay(100); // vTaskDelay(1000 / portTICK_PERIOD_MS); // 1sec delay before calibration - } - //------------------------------------------------- - // extract the mean_sensor_analog_output_voltage - float _sensor_volt = 0; - s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; - for (uint8_t i = 100; i > 0; i--) - { - if (i % 20 == 0) + uint32_t mq135_adc_pin = item->interface.adc.gpio_num; + //------------------------------------------------- + // let the sensor to heat for 20seconds + for (uint8_t j = 20; j > 0; j--) { - TRACE_W("Please Wait..Collecting Ambient Air data ........... [Avoid Smokes/gases]"); + TRACE_E("Heating sensor.........time left: %d sec", j); + vTaskDelay(100); // vTaskDelay(1000 / portTICK_PERIOD_MS); // 1sec delay before calibration } - // extract ADC values - ezlopi_adc_get_adc_data(mq135_adc_pin, &ezlopi_analog_data); + //------------------------------------------------- + // extract the mean_sensor_analog_output_voltage + float _sensor_volt = 0; + s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; + for (uint8_t i = 100; i > 0; i--) + { + if (i % 20 == 0) + { + TRACE_W("Please Wait..Collecting Ambient Air data ........... [Avoid Smokes/gases]"); + } + // extract ADC values + ezlopi_adc_get_adc_data(mq135_adc_pin, &ezlopi_analog_data); #ifdef VOLTAGE_DIVIDER_ADDED - _sensor_volt += (float)((ezlopi_analog_data.voltage) * 2.0f); // [0-2.4V] X2 + _sensor_volt += (float)((ezlopi_analog_data.voltage) * 2.0f); // [0-2.4V] X2 #else - _sensor_volt += (float)(ezlopi_analog_data->voltage); + _sensor_volt += (float)(ezlopi_analog_data->voltage); #endif - vTaskDelay(1); // 10ms - } - _sensor_volt = _sensor_volt / 100.0f; + vTaskDelay(1); // 10ms + } + _sensor_volt = _sensor_volt / 100.0f; - //------------------------------------------------- - // Calculate the 'Rs' of heater during clean air [calibration phase] - // Range -> [2Kohm - 20Kohm] - float RS_calib = 0; // Define variable for sensor resistance - RS_calib = ((MQ135_VOLT_RESOLUTION_Vc * mq135_eqv_RL) / (_sensor_volt / 1000.0f)) - mq135_eqv_RL; // Calculate RS in fresh air - TRACE_E("CALIB_TASK -> 'RS_calib' = %.2f", RS_calib); - if (RS_calib < 0) - { - RS_calib = 0; // No negative values accepted. - } - // Calculate the R0_air which is constant through-out - MQ135_value->MQ135_R0_constant = (RS_calib / RatioMQ135CleanAir); // Calculate MQ135_R0_constant - TRACE_E("CALIB_TASK -> 'MQ135_R0_constant' = %.2f", MQ135_value->MQ135_R0_constant); - if (MQ135_value->MQ135_R0_constant < 0) - { - MQ135_value->MQ135_R0_constant = 0; // No negative values accepted. + //------------------------------------------------- + // Calculate the 'Rs' of heater during clean air [calibration phase] + // Range -> [2Kohm - 20Kohm] + float RS_calib = 0; // Define variable for sensor resistance + RS_calib = ((MQ135_VOLT_RESOLUTION_Vc * mq135_eqv_RL) / (_sensor_volt / 1000.0f)) - mq135_eqv_RL; // Calculate RS in fresh air + TRACE_E("CALIB_TASK -> 'RS_calib' = %.2f", RS_calib); + if (RS_calib < 0) + { + RS_calib = 0; // No negative values accepted. + } + // Calculate the R0_air which is constant through-out + MQ135_value->MQ135_R0_constant = (RS_calib / RatioMQ135CleanAir); // Calculate MQ135_R0_constant + TRACE_E("CALIB_TASK -> 'MQ135_R0_constant' = %.2f", MQ135_value->MQ135_R0_constant); + if (MQ135_value->MQ135_R0_constant < 0) + { + MQ135_value->MQ135_R0_constant = 0; // No negative values accepted. + } + // Set calibration_complete_NH3 flag + MQ135_value->Calibration_complete_NH3 = true; } - // Set calibration_complete_NH3 flag - MQ135_value->Calibration_complete_NH3 = true; } vTaskDelete(NULL); } \ No newline at end of file diff --git a/ezlopi-sensors-devices/sensor-0053-UART-GYGPS6MV2/sensor_0053_UART_GYGPS6MV2.c b/ezlopi-sensors-devices/sensor-0053-UART-GYGPS6MV2/sensor_0053_UART_GYGPS6MV2.c index d54f8c659..f7f60e255 100644 --- a/ezlopi-sensors-devices/sensor-0053-UART-GYGPS6MV2/sensor_0053_UART_GYGPS6MV2.c +++ b/ezlopi-sensors-devices/sensor-0053-UART-GYGPS6MV2/sensor_0053_UART_GYGPS6MV2.c @@ -152,14 +152,16 @@ static void __prepare_item_interface_properties(l_ezlopi_item_t *item, cJSON *cj /*Here we decide, when uart is allowed to initialize*/ GPS6MV2_t *sensor_0053_UART_gps6mv2_data = (GPS6MV2_t *)item->user_arg; - - if ((sensor_0053_UART_gps6mv2_data->Latitude_item_id) == item->cloud_properties.item_id) - { - item->interface.uart.enable = true; - } - else + if (sensor_0053_UART_gps6mv2_data) { - item->interface.uart.enable = false; + if ((sensor_0053_UART_gps6mv2_data->Latitude_item_id) == item->cloud_properties.item_id) + { + item->interface.uart.enable = true; + } + else + { + item->interface.uart.enable = false; + } } } //--------------------------------------------------------------------------------------------------------- @@ -241,22 +243,32 @@ static int __0053_init(l_ezlopi_item_t *item) int ret = 0; if (item) { - if ((true == item->interface.uart.enable) && GPIO_IS_VALID_GPIO(item->interface.uart.tx) && GPIO_IS_VALID_GPIO(item->interface.uart.rx)) - { - s_ezlopi_uart_object_handle_t ezlopi_uart_object_handle = ezlopi_uart_init(item->interface.uart.baudrate, item->interface.uart.tx, item->interface.uart.rx, __uart_gps6mv2_upcall, item); - item->interface.uart.channel = ezlopi_uart_get_channel(ezlopi_uart_object_handle); - // TRACE_W(" Initailization complete......"); - ret = 1; - } - if (0 == ret) + GPS6MV2_t *sensor_0053_UART_gps6mv2_data = (GPS6MV2_t *)item->user_arg; + if (sensor_0053_UART_gps6mv2_data) { - ret = -1; - if (item->user_arg) + if (GPIO_IS_VALID_GPIO(item->interface.uart.tx) && GPIO_IS_VALID_GPIO(item->interface.uart.rx)) { - free(item->user_arg); + if (true == item->interface.uart.enable) + { + s_ezlopi_uart_object_handle_t ezlopi_uart_object_handle = ezlopi_uart_init(item->interface.uart.baudrate, item->interface.uart.tx, item->interface.uart.rx, __uart_gps6mv2_upcall, item); + item->interface.uart.channel = ezlopi_uart_get_channel(ezlopi_uart_object_handle); + // TRACE_W(" Initailization complete......"); + ret = 1; + } + } + else + { + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); } } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); + } } return ret; } @@ -270,45 +282,58 @@ static int __0053_get_value_cjson(l_ezlopi_item_t *item, void *arg) if (cj_result) { GPS6MV2_t *sensor_0053_UART_gps6mv2_data = (GPS6MV2_t *)item->user_arg; - - if ((sensor_0053_UART_gps6mv2_data->Latitude_item_id) == item->cloud_properties.item_id) - { - char *valueFormatted = ezlopi_valueformatter_float(sensor_0053_UART_gps6mv2_data->prev_lat_angle_val); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, sensor_0053_UART_gps6mv2_data->prev_lat_angle_val); - free(valueFormatted); - } - if ((sensor_0053_UART_gps6mv2_data->Longitude_item_id) == item->cloud_properties.item_id) + if (sensor_0053_UART_gps6mv2_data) { - char *valueFormatted = ezlopi_valueformatter_float(sensor_0053_UART_gps6mv2_data->prev_long_angle_val); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, sensor_0053_UART_gps6mv2_data->prev_long_angle_val); - free(valueFormatted); - } + if ((sensor_0053_UART_gps6mv2_data->Latitude_item_id) == item->cloud_properties.item_id) + { + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, sensor_0053_UART_gps6mv2_data->prev_lat_angle_val); + char *valueFormatted = ezlopi_valueformatter_float(sensor_0053_UART_gps6mv2_data->prev_lat_angle_val); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } + else if ((sensor_0053_UART_gps6mv2_data->Longitude_item_id) == item->cloud_properties.item_id) + { + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, sensor_0053_UART_gps6mv2_data->prev_long_angle_val); + char *valueFormatted = ezlopi_valueformatter_float(sensor_0053_UART_gps6mv2_data->prev_long_angle_val); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } - if ((sensor_0053_UART_gps6mv2_data->Fix_item_id) == item->cloud_properties.item_id) - { - const char *valueFormatted = ezlopi_valueformatter_bool(sensor_0053_UART_gps6mv2_data->prev_GPS_FIX); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddBoolToObject(cj_result, ezlopi_value_str, sensor_0053_UART_gps6mv2_data->prev_GPS_FIX); - } + else if ((sensor_0053_UART_gps6mv2_data->Fix_item_id) == item->cloud_properties.item_id) + { + cJSON_AddBoolToObject(cj_result, ezlopi_value_str, sensor_0053_UART_gps6mv2_data->prev_GPS_FIX); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, ezlopi_valueformatter_bool(sensor_0053_UART_gps6mv2_data->prev_GPS_FIX)); + } - if ((sensor_0053_UART_gps6mv2_data->Sea_level_item_id) == item->cloud_properties.item_id) - { - char *valueFormatted = ezlopi_valueformatter_float(sensor_0053_UART_gps6mv2_data->prev_antenna_alti); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, sensor_0053_UART_gps6mv2_data->prev_antenna_alti); - free(valueFormatted); - } + else if ((sensor_0053_UART_gps6mv2_data->Sea_level_item_id) == item->cloud_properties.item_id) + { + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, sensor_0053_UART_gps6mv2_data->prev_antenna_alti); + char *valueFormatted = ezlopi_valueformatter_float(sensor_0053_UART_gps6mv2_data->prev_antenna_alti); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } - if ((sensor_0053_UART_gps6mv2_data->Geoid_item_id) == item->cloud_properties.item_id) - { - char *valueFormatted = ezlopi_valueformatter_float(sensor_0053_UART_gps6mv2_data->prev_geoid); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, sensor_0053_UART_gps6mv2_data->prev_geoid); - free(valueFormatted); + else if ((sensor_0053_UART_gps6mv2_data->Geoid_item_id) == item->cloud_properties.item_id) + { + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, sensor_0053_UART_gps6mv2_data->prev_geoid); + char *valueFormatted = ezlopi_valueformatter_float(sensor_0053_UART_gps6mv2_data->prev_geoid); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } + ret = 1; } - ret = 1; } } return ret; @@ -319,68 +344,71 @@ static int __0053_notify(l_ezlopi_item_t *item) if (item) { GPS6MV2_t *sensor_0053_UART_gps6mv2_data = (GPS6MV2_t *)item->user_arg; - if ((sensor_0053_UART_gps6mv2_data->Latitude_item_id) == item->cloud_properties.item_id) + if (sensor_0053_UART_gps6mv2_data) { - // Invoking data Update only, in this item_id - (sensor_0053_UART_gps6mv2_data->gps_message_guard) = true; - __sensor_uart_gps6mv2_update_values(item); - - // checking for new values - float lat_angle_val = (float)atoi(sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.Latitude.lat_degree) + ((float)atoi(sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.Latitude.lat_min)) / 60.0f; - if ((sensor_0053_UART_gps6mv2_data->prev_lat_angle_val) != lat_angle_val) + if ((sensor_0053_UART_gps6mv2_data->Latitude_item_id) == item->cloud_properties.item_id) { - (sensor_0053_UART_gps6mv2_data->prev_lat_angle_val) = lat_angle_val; - (sensor_0053_UART_gps6mv2_data->gps_message_guard) = false; - ezlopi_device_value_updated_from_device_v3(item); + // Invoking data Update only, in this item_id + (sensor_0053_UART_gps6mv2_data->gps_message_guard) = true; + __sensor_uart_gps6mv2_update_values(item); + + // checking for new values + float lat_angle_val = (float)atoi(sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.Latitude.lat_degree) + ((float)atoi(sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.Latitude.lat_min)) / 60.0f; + if ((sensor_0053_UART_gps6mv2_data->prev_lat_angle_val) != lat_angle_val) + { + (sensor_0053_UART_gps6mv2_data->prev_lat_angle_val) = lat_angle_val; + (sensor_0053_UART_gps6mv2_data->gps_message_guard) = false; + ezlopi_device_value_updated_from_device_v3(item); + } } - } - if ((sensor_0053_UART_gps6mv2_data->Longitude_item_id) == item->cloud_properties.item_id) - { - // checking for new values - float long_angle_val = (float)atoi(sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.Longitude.long_degree) + ((float)atoi(sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.Longitude.long_min)) / 60.0f; - if ((sensor_0053_UART_gps6mv2_data->prev_long_angle_val) != long_angle_val) + else if ((sensor_0053_UART_gps6mv2_data->Longitude_item_id) == item->cloud_properties.item_id) { - (sensor_0053_UART_gps6mv2_data->prev_long_angle_val) = long_angle_val; - (sensor_0053_UART_gps6mv2_data->gps_message_guard) = false; - ezlopi_device_value_updated_from_device_v3(item); + // checking for new values + float long_angle_val = (float)atoi(sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.Longitude.long_degree) + ((float)atoi(sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.Longitude.long_min)) / 60.0f; + if ((sensor_0053_UART_gps6mv2_data->prev_long_angle_val) != long_angle_val) + { + (sensor_0053_UART_gps6mv2_data->prev_long_angle_val) = long_angle_val; + (sensor_0053_UART_gps6mv2_data->gps_message_guard) = false; + ezlopi_device_value_updated_from_device_v3(item); + } } - } - if ((sensor_0053_UART_gps6mv2_data->Fix_item_id) == item->cloud_properties.item_id) - { - // checking for new values - int total_sat = (float)atoi(sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.Satellites_used); - int gps_quality = ((int)(sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.Positon_fix_quality) - 48); // converting character into 'integer' - gps_quality = (gps_quality < 0) ? 0 : ((gps_quality > 9) ? 9 : gps_quality); - - bool GPS_FIX = ((total_sat > 2) && (gps_quality != 0)) ? true : false; - if ((sensor_0053_UART_gps6mv2_data->prev_GPS_FIX) != GPS_FIX) + else if ((sensor_0053_UART_gps6mv2_data->Fix_item_id) == item->cloud_properties.item_id) { - (sensor_0053_UART_gps6mv2_data->prev_GPS_FIX) = GPS_FIX; - (sensor_0053_UART_gps6mv2_data->gps_message_guard) = false; - ezlopi_device_value_updated_from_device_v3(item); + // checking for new values + int total_sat = (float)atoi(sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.Satellites_used); + int gps_quality = ((int)(sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.Positon_fix_quality) - 48); // converting character into 'integer' + gps_quality = (gps_quality < 0) ? 0 : ((gps_quality > 9) ? 9 : gps_quality); + + bool GPS_FIX = ((total_sat > 2) && (gps_quality != 0)) ? true : false; + if ((sensor_0053_UART_gps6mv2_data->prev_GPS_FIX) != GPS_FIX) + { + (sensor_0053_UART_gps6mv2_data->prev_GPS_FIX) = GPS_FIX; + (sensor_0053_UART_gps6mv2_data->gps_message_guard) = false; + ezlopi_device_value_updated_from_device_v3(item); + } } - } - if ((sensor_0053_UART_gps6mv2_data->Sea_level_item_id) == item->cloud_properties.item_id) - { - // checking for new values - float antenna_alti = (float)atoi(sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.Mean_sea_level); - if ((sensor_0053_UART_gps6mv2_data->prev_antenna_alti) != antenna_alti) + else if ((sensor_0053_UART_gps6mv2_data->Sea_level_item_id) == item->cloud_properties.item_id) { - (sensor_0053_UART_gps6mv2_data->prev_antenna_alti) = antenna_alti; - (sensor_0053_UART_gps6mv2_data->gps_message_guard) = false; - ezlopi_device_value_updated_from_device_v3(item); + // checking for new values + float antenna_alti = (float)atoi(sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.Mean_sea_level); + if ((sensor_0053_UART_gps6mv2_data->prev_antenna_alti) != antenna_alti) + { + (sensor_0053_UART_gps6mv2_data->prev_antenna_alti) = antenna_alti; + (sensor_0053_UART_gps6mv2_data->gps_message_guard) = false; + ezlopi_device_value_updated_from_device_v3(item); + } } - } - if ((sensor_0053_UART_gps6mv2_data->Geoid_item_id) == item->cloud_properties.item_id) - { - // checking for new values - float geoid = (float)atoi(sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.Geoid_Separation); - if ((sensor_0053_UART_gps6mv2_data->prev_geoid) != geoid) + else if ((sensor_0053_UART_gps6mv2_data->Geoid_item_id) == item->cloud_properties.item_id) { - (sensor_0053_UART_gps6mv2_data->prev_geoid) = geoid; - (sensor_0053_UART_gps6mv2_data->gps_message_guard) = false; - ezlopi_device_value_updated_from_device_v3(item); + // checking for new values + float geoid = (float)atoi(sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.Geoid_Separation); + if ((sensor_0053_UART_gps6mv2_data->prev_geoid) != geoid) + { + (sensor_0053_UART_gps6mv2_data->prev_geoid) = geoid; + (sensor_0053_UART_gps6mv2_data->gps_message_guard) = false; + ezlopi_device_value_updated_from_device_v3(item); + } } } } @@ -391,29 +419,31 @@ static int __sensor_uart_gps6mv2_update_values(l_ezlopi_item_t *item) { int ret = 0, len = 0; // 'void_type' addrress -> 'GPS6MV2_t' address - GPS6MV2_t *sensor_0053_UART_gps6mv2_data = (GPS6MV2_t *)item->user_arg; - if (NULL != item) { - // replace the gps_sentence of GPGGA structure - if ((sensor_0053_UART_gps6mv2_data->gps_sentence) != NULL) + GPS6MV2_t *sensor_0053_UART_gps6mv2_data = (GPS6MV2_t *)item->user_arg; + if (sensor_0053_UART_gps6mv2_data) { - // reset the GPGGA_sentence array - len = sizeof(sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.GPGGA_sentence); - memset(sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.GPGGA_sentence, 0, sizeof(len)); - sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.GPGGA_sentence[len - 1] = '\0'; - strncpy(sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.GPGGA_sentence, (sensor_0053_UART_gps6mv2_data->gps_sentence), (len - 1)); - } + // replace the gps_sentence of GPGGA structure + if ((sensor_0053_UART_gps6mv2_data->gps_sentence) != NULL) + { + // reset the GPGGA_sentence array + len = sizeof(sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.GPGGA_sentence); + memset(sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.GPGGA_sentence, 0, sizeof(len)); + sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.GPGGA_sentence[len - 1] = '\0'; + strncpy(sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.GPGGA_sentence, (sensor_0053_UART_gps6mv2_data->gps_sentence), (len - 1)); + } - // Check availability of Checksum in the message - if (strchr((sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.GPGGA_sentence), '*') != NULL) - { - //------------------------------------------------------------------------- - // GPGGA MESSAGE PARSING FUNCTION - //------------------------------------------------------------------------- - parse_and_assign_GPGGA_message(sensor_0053_UART_gps6mv2_data); + // Check availability of Checksum in the message + if (strchr((sensor_0053_UART_gps6mv2_data->GPGGA_data_structure.GPGGA_sentence), '*') != NULL) + { + //------------------------------------------------------------------------- + // GPGGA MESSAGE PARSING FUNCTION + //------------------------------------------------------------------------- + parse_and_assign_GPGGA_message(sensor_0053_UART_gps6mv2_data); + } + (sensor_0053_UART_gps6mv2_data->gps_message_guard) = false; } - (sensor_0053_UART_gps6mv2_data->gps_message_guard) = false; } return ret; } @@ -422,25 +452,27 @@ static int __sensor_uart_gps6mv2_update_values(l_ezlopi_item_t *item) static void __uart_gps6mv2_upcall(uint8_t *buffer, uint32_t output_len, s_ezlopi_uart_object_handle_t uart_object_handle) { // TRACE_E("UART_Buffer => \n%s\n", buffer); - char *another_buffer = (char *)malloc(256); - if (another_buffer && (uart_object_handle->arg)) + char *tmp_buffer = (char *)malloc(256); + if (tmp_buffer && (uart_object_handle->arg)) { - memcpy(another_buffer, buffer, 256); + memcpy(tmp_buffer, buffer, 256); l_ezlopi_item_t *item = (l_ezlopi_item_t *)uart_object_handle->arg; GPS6MV2_t *sensor_0053_UART_gps6mv2_data = (GPS6MV2_t *)item->user_arg; - - if (strlen(sensor_0053_UART_gps6mv2_data->gps_cir_buf) < (CIR_BUFSIZE)-255) - { - strncpy(((sensor_0053_UART_gps6mv2_data->gps_cir_buf) + strlen(sensor_0053_UART_gps6mv2_data->gps_cir_buf)), another_buffer, strlen(another_buffer)); - } - else + if (sensor_0053_UART_gps6mv2_data) { - // TRACE_E("----------- 2. CIR_BUFF - FULL -------------"); - // TRACE_S("CIRCULAR_BUFFER => [%d] \n%s", strlen(gps_cir_buf), gps_cir_buf); - __retrieve_GPGGA_sentence(item); // CALL a function that extracts the 'GPGGA_sentence' from gps_cir_buf[] - memset((sensor_0053_UART_gps6mv2_data->gps_cir_buf), 0, sizeof(sensor_0053_UART_gps6mv2_data->gps_cir_buf)); // reset gps_cir_buf[] + if (strlen(sensor_0053_UART_gps6mv2_data->gps_cir_buf) < (CIR_BUFSIZE)-255) + { + strncpy(((sensor_0053_UART_gps6mv2_data->gps_cir_buf) + strlen(sensor_0053_UART_gps6mv2_data->gps_cir_buf)), tmp_buffer, strlen(tmp_buffer)); + } + else + { + // TRACE_E("----------- 2. CIR_BUFF - FULL -------------"); + // TRACE_I("CIRCULAR_BUFFER => [%d] \n%s", strlen(gps_cir_buf), gps_cir_buf); + __retrieve_GPGGA_sentence(item); // CALL a function that extracts the 'GPGGA_sentence' from gps_cir_buf[] + memset((sensor_0053_UART_gps6mv2_data->gps_cir_buf), 0, sizeof(sensor_0053_UART_gps6mv2_data->gps_cir_buf)); // reset gps_cir_buf[] + } } - free(another_buffer); + free(tmp_buffer); } } @@ -449,55 +481,58 @@ static void __retrieve_GPGGA_sentence(l_ezlopi_item_t *item) if (NULL != item) { GPS6MV2_t *sensor_0053_UART_gps6mv2_data = (GPS6MV2_t *)item->user_arg; - if (NULL == strstr((sensor_0053_UART_gps6mv2_data->gps_cir_buf), "$GPTXT")) + if (sensor_0053_UART_gps6mv2_data) { - // TRACE_E("................Extracting GPGGA gps_sentence ..........."); - // find the position of '$GSGGA' in the circular buffer - /** 2000 - * circular_buffer = 'dkfhkhdf .... $GPGGA,061731.00,2740.52772,....,-41.3,M,,*40.....' - * ^ - * ptr1 => $GPGGA,061731.00,2740.52772,....,-41.3,M,,*40..... - * - */ - char *ptr1 = strstr((sensor_0053_UART_gps6mv2_data->gps_cir_buf), "$GPGGA"); // returns a pointer points to the first character of the found 'another_buffer' in "$GPGGA" - // otherwise a null pointer if "$GPGGA" is not present in 'another_buffer'. - // If "[$GPGGA]" destination string, points to an empty string, 'another_buffer' is returned - - // Continue only if the 'GSGGA-message' exists - if (NULL != ptr1) + if (NULL == strstr((sensor_0053_UART_gps6mv2_data->gps_cir_buf), "$GPTXT")) { - - /** 2053 - * ptr1 => '$GPGGA,061731.00,2740.52772,....,-41.3,M,,*40 - * ^ - * *40_ <- ptr2..... + // TRACE_E("................Extracting GPGGA gps_sentence ..........."); + // find the position of '$GSGGA' in the circular buffer + /** 2000 + * circular_buffer = 'dkfhkhdf .... $GPGGA,061731.00,2740.52772,....,-41.3,M,,*40.....' + * ^ + * ptr1 => $GPGGA,061731.00,2740.52772,....,-41.3,M,,*40..... * */ + char *ptr1 = strstr((sensor_0053_UART_gps6mv2_data->gps_cir_buf), "$GPGGA"); // returns a pointer points to the first character of the found 'tmp_buffer' in "$GPGGA" + // otherwise a null pointer if "$GPGGA" is not present in 'tmp_buffer'. + // If "[$GPGGA]" destination string, points to an empty string, 'tmp_buffer' is returned - char *ptr2 = strchr(ptr1, '*'); // * <- ptr2 - // check if ptr2 exists - if (NULL != ptr2) - { // NOW , separate the GSGGA-message and copy to global variable 'gps_sentence' - ptr2 += 3; // +3 because the checksum consists three character more [*XX] - // TRACE_E("GPGGA message size = %d (< %d)", (ptr2 - ptr1), MAX_GPGGA_SENTENCE_SIZE); - if ((ptr2 - ptr1) > 0 && (ptr2 - ptr1) < MAX_GPGGA_SENTENCE_SIZE) - { - if (false == (sensor_0053_UART_gps6mv2_data->gps_message_guard)) - { - memset(&(sensor_0053_UART_gps6mv2_data->gps_sentence), 0, sizeof(sensor_0053_UART_gps6mv2_data->gps_sentence)); - memcpy((sensor_0053_UART_gps6mv2_data->gps_sentence), ptr1, (ptr2 - ptr1)); // (dest_addr , from_addr , length) - // TRACE_W("gps_sentence (NEW) => %s", gps_sentence); - } - else + // Continue only if the 'GSGGA-message' exists + if (NULL != ptr1) + { + + /** 2053 + * ptr1 => '$GPGGA,061731.00,2740.52772,....,-41.3,M,,*40 + * ^ + * *40_ <- ptr2..... + * + */ + + char *ptr2 = strchr(ptr1, '*'); // * <- ptr2 + // check if ptr2 exists + if (NULL != ptr2) + { // NOW , separate the GSGGA-message and copy to global variable 'gps_sentence' + ptr2 += 3; // +3 because the checksum consists three character more [*XX] + // TRACE_E("GPGGA message size = %d (< %d)", (ptr2 - ptr1), MAX_GPGGA_SENTENCE_SIZE); + if ((ptr2 - ptr1) > 0 && (ptr2 - ptr1) < MAX_GPGGA_SENTENCE_SIZE) { - TRACE_E(" gps_Message_Guard => ON ; Cannot copy NEW message.... in 'gps_sentence'"); + if (false == (sensor_0053_UART_gps6mv2_data->gps_message_guard)) + { + memset(&(sensor_0053_UART_gps6mv2_data->gps_sentence), 0, sizeof(sensor_0053_UART_gps6mv2_data->gps_sentence)); + memcpy((sensor_0053_UART_gps6mv2_data->gps_sentence), ptr1, (ptr2 - ptr1)); // (dest_addr , from_addr , length) + // TRACE_W("gps_sentence (NEW) => %s", gps_sentence); + } + else + { + TRACE_E(" gps_Message_Guard => ON ; Cannot copy NEW message.... in 'gps_sentence'"); + } } } } - } - else - { - TRACE_E("NO GPGGA message found in current circular buffer stack...."); + else + { + TRACE_E("NO GPGGA message found in current circular buffer stack...."); + } } } } diff --git a/ezlopi-sensors-devices/sensor-0054-PWM-YFS201-flowmeter/sensor_0054_PWM_YFS201_flowmeter.c b/ezlopi-sensors-devices/sensor-0054-PWM-YFS201-flowmeter/sensor_0054_PWM_YFS201_flowmeter.c index 67511932c..bd3cf6185 100644 --- a/ezlopi-sensors-devices/sensor-0054-PWM-YFS201-flowmeter/sensor_0054_PWM_YFS201_flowmeter.c +++ b/ezlopi-sensors-devices/sensor-0054-PWM-YFS201-flowmeter/sensor_0054_PWM_YFS201_flowmeter.c @@ -162,28 +162,35 @@ static int __0054_init(l_ezlopi_item_t *item) { int ret = 0; if (NULL != item) - { // intialize digital_pin - if (GPIO_IS_VALID_GPIO((gpio_num_t)item->interface.pwm.gpio_num)) - { - gpio_config_t input_conf = { - .pin_bit_mask = (1ULL << item->interface.pwm.gpio_num), - .intr_type = GPIO_INTR_POSEDGE, - .mode = GPIO_MODE_INPUT, - .pull_down_en = GPIO_PULLDOWN_DISABLE, - .pull_up_en = GPIO_PULLUP_DISABLE, - }; - gpio_config(&input_conf); - ret = 1; - } - if (0 == ret) + { + yfs201_t *yfs201_data = (yfs201_t *)item->user_arg; + if (yfs201_data) { - ret = -1; - if (item->user_arg) + // intialize digital_pin + if (GPIO_IS_VALID_GPIO((gpio_num_t)item->interface.pwm.gpio_num)) + { + gpio_config_t input_conf = { + .pin_bit_mask = (1ULL << item->interface.pwm.gpio_num), + .intr_type = GPIO_INTR_POSEDGE, + .mode = GPIO_MODE_INPUT, + .pull_down_en = GPIO_PULLDOWN_DISABLE, + .pull_up_en = GPIO_PULLUP_DISABLE, + }; + ret = (0 == gpio_config(&input_conf)) ? 1 : -1; + } + else { - free(item->user_arg); + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); } } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); + } } return ret; } @@ -197,24 +204,27 @@ static int __0054_get_cjson_value(l_ezlopi_item_t *item, void *arg) if (cj_result) { yfs201_t *yfs201_data = (yfs201_t *)item->user_arg; - float freq = 0, Lt_per_hr = 0; - // converting pulse_counta into frequency (uSec -> Hz) - freq = yfs201_data->yfs201_dominant_pulse_count * YFS201_QUEUE_SIZE; // [counts_200ms -> counts_1sec] + if (yfs201_data) + { + float freq = 0, Lt_per_hr = 0; + // converting pulse_counta into frequency (uSec -> Hz) + freq = yfs201_data->yfs201_dominant_pulse_count * YFS201_QUEUE_SIZE; // [counts_200ms -> counts_1sec] - // liter per hr - Lt_per_hr = freq * 7.3f; - Lt_per_hr = (Lt_per_hr < 1) ? 0 : Lt_per_hr; - Lt_per_hr = (Lt_per_hr > 720) ? 720 : Lt_per_hr; - // TRACE_E(" Frequency : %.2f Hz --> FlowRate : %.2f [Lt_per_hr]", freq, Lt_per_hr); + // liter per hr + Lt_per_hr = freq * 7.3f; + Lt_per_hr = (Lt_per_hr < 1) ? 0 : Lt_per_hr; + Lt_per_hr = (Lt_per_hr > 720) ? 720 : Lt_per_hr; + // TRACE_E(" Frequency : %.2f Hz --> FlowRate : %.2f [Lt_per_hr]", freq, Lt_per_hr); - char *valueFormatted = ezlopi_valueformatter_float(Lt_per_hr); - if (valueFormatted) - { - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - free(valueFormatted); + char *valueFormatted = ezlopi_valueformatter_float(Lt_per_hr); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, Lt_per_hr); + ret = 1; } - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, Lt_per_hr); - ret = 1; } } return ret; @@ -248,94 +258,97 @@ static void __extract_YFS201_Pulse_Count_func(l_ezlopi_item_t *item) if (NULL != item) { yfs201_t *yfs201_data = (yfs201_t *)item->user_arg; - gpio_num_t pulse_pin = item->interface.pwm.gpio_num; - // creating queue here - yfs201_queue = xQueueCreate(YFS201_QUEUE_SIZE, sizeof(int32_t)); // takes max -> 1mSec - if (yfs201_queue) + if (yfs201_data) { - int32_t start_time = 0; - // extract data for untill all queue is filled - // TRACE_E("--------- Queue Empty --------"); - - while ((yfs201_data->yfs201_QueueFlag) < YFS201_QUEUE_FULL) + gpio_num_t pulse_pin = item->interface.pwm.gpio_num; + // creating queue here + yfs201_queue = xQueueCreate(YFS201_QUEUE_SIZE, sizeof(int32_t)); // takes max -> 1mSec + if (yfs201_queue) { - (yfs201_data->_pulses_yfs201) = 0; // reset variable to store fresh counts within [200ms] - gpio_isr_handler_add(pulse_pin, gpio_isr_handler, &(yfs201_data->_pulses_yfs201)); // add -> gpio_isr_handle(pin_num) - start_time = (int32_t)esp_timer_get_time(); - while (((int32_t)esp_timer_get_time() - start_time) < (1000000 / YFS201_QUEUE_SIZE)) // 200ms -> 200000uS - { - // polls for '(1000000 / YFS201_QUEUE_SIZE)' -> eg. 200ms - } - // check queue_full => 1 + int32_t start_time = 0; + // extract data for untill all queue is filled + // TRACE_E("--------- Queue Empty --------"); - if (xQueueSend(yfs201_queue, &(yfs201_data->_pulses_yfs201), 0)) - { - (yfs201_data->yfs201_QueueFlag) = YFS201_QUEUE_AVAILABLE; - // TRACE_E("Pulse_count : %d", (yfs201_data->_pulses_yfs201)); - } - else + while ((yfs201_data->yfs201_QueueFlag) < YFS201_QUEUE_FULL) { - // TRACE_E("--------- Queue Full --------"); - (yfs201_data->yfs201_QueueFlag) = YFS201_QUEUE_FULL; + (yfs201_data->_pulses_yfs201) = 0; // reset variable to store fresh counts within [200ms] + gpio_isr_handler_add(pulse_pin, gpio_isr_handler, &(yfs201_data->_pulses_yfs201)); // add -> gpio_isr_handle(pin_num) + start_time = (int32_t)esp_timer_get_time(); + while (((int32_t)esp_timer_get_time() - start_time) < (1000000 / YFS201_QUEUE_SIZE)) // 200ms -> 200000uS + { + // polls for '(1000000 / YFS201_QUEUE_SIZE)' -> eg. 200ms + } + // check queue_full => 1 + + if (xQueueSend(yfs201_queue, &(yfs201_data->_pulses_yfs201), 0)) + { + (yfs201_data->yfs201_QueueFlag) = YFS201_QUEUE_AVAILABLE; + // TRACE_E("Pulse_count : %d", (yfs201_data->_pulses_yfs201)); + } + else + { + // TRACE_E("--------- Queue Full --------"); + (yfs201_data->yfs201_QueueFlag) = YFS201_QUEUE_FULL; + } + // disable -> gpio_isr_handle_remove(pin_num) + gpio_isr_handler_remove(pulse_pin); } - // disable -> gpio_isr_handle_remove(pin_num) - gpio_isr_handler_remove(pulse_pin); } - } - if ((yfs201_data->yfs201_QueueFlag) == YFS201_QUEUE_FULL) - { - // loop through all the queue[0-5] values -> pulse counts - int32_t P_count[YFS201_QUEUE_SIZE] = {0}; - int val = 0; - for (uint8_t i = 0; i < YFS201_QUEUE_SIZE; i++) + if ((yfs201_data->yfs201_QueueFlag) == YFS201_QUEUE_FULL) { - if (xQueueReceive(yfs201_queue, &val, portMAX_DELAY)) + // loop through all the queue[0-5] values -> pulse counts + int32_t P_count[YFS201_QUEUE_SIZE] = {0}; + int val = 0; + for (uint8_t i = 0; i < YFS201_QUEUE_SIZE; i++) { - if (val) + if (xQueueReceive(yfs201_queue, &val, portMAX_DELAY)) { - P_count[i] = val; // [0 - YFS201_QUEUE_SIZE] + if (val) + { + P_count[i] = val; // [0 - YFS201_QUEUE_SIZE] + } } } - } - // generate frequency of occurance table from "P_count[]" array values - uint8_t freq[YFS201_QUEUE_SIZE] = {0}; - float error = 0; - for (uint8_t x = 0; x < YFS201_QUEUE_SIZE; x++) - { - for (uint8_t i = 0; i < YFS201_QUEUE_SIZE; i++) + // generate frequency of occurance table from "P_count[]" array values + uint8_t freq[YFS201_QUEUE_SIZE] = {0}; + float error = 0; + for (uint8_t x = 0; x < YFS201_QUEUE_SIZE; x++) { - error = P_count[x] - P_count[i]; - error = ((error >= 0) ? error : error * -1); // finding difference between two readings - if (error < P_count[x] * 0.1) // [error less than +-10%] + for (uint8_t i = 0; i < YFS201_QUEUE_SIZE; i++) { - freq[x] += 1; // increment dominace count + error = P_count[x] - P_count[i]; + error = ((error >= 0) ? error : error * -1); // finding difference between two readings + if (error < P_count[x] * 0.1) // [error less than +-10%] + { + freq[x] += 1; // increment dominace count + } } } - } - // find the dominant period - uint8_t max_freq_index = 0; - int32_t dominant_val = 0; - for (uint8_t i = 0; i < YFS201_QUEUE_SIZE; i++) - { - if (freq[i] > dominant_val) + // find the dominant period + uint8_t max_freq_index = 0; + int32_t dominant_val = 0; + for (uint8_t i = 0; i < YFS201_QUEUE_SIZE; i++) { - dominant_val = freq[i]; - max_freq_index = i; + if (freq[i] > dominant_val) + { + dominant_val = freq[i]; + max_freq_index = i; + } } - } - // TRACE_S("......................Dominant count ......{%d} ", P_count[max_freq_index]); + // TRACE_S("......................Dominant count ......{%d} ", P_count[max_freq_index]); - // reset Queue_flag - (yfs201_data->yfs201_QueueFlag) = YFS201_QUEUE_AVAILABLE; + // reset Queue_flag + (yfs201_data->yfs201_QueueFlag) = YFS201_QUEUE_AVAILABLE; - // write the dominant pulse count - yfs201_data->yfs201_dominant_pulse_count = P_count[max_freq_index]; - } + // write the dominant pulse count + yfs201_data->yfs201_dominant_pulse_count = P_count[max_freq_index]; + } - // Deleting queue after no use to avoid conflicts - vQueueDelete(yfs201_queue); + // Deleting queue after no use to avoid conflicts + vQueueDelete(yfs201_queue); + } } } diff --git a/ezlopi-sensors-devices/sensor-0055-ADC-FlexResistor/sensor_0055_ADC_FlexResistor.c b/ezlopi-sensors-devices/sensor-0055-ADC-FlexResistor/sensor_0055_ADC_FlexResistor.c index a081aa090..221ac451a 100644 --- a/ezlopi-sensors-devices/sensor-0055-ADC-FlexResistor/sensor_0055_ADC_FlexResistor.c +++ b/ezlopi-sensors-devices/sensor-0055-ADC-FlexResistor/sensor_0055_ADC_FlexResistor.c @@ -96,11 +96,10 @@ static int __0055_prepare(void *arg) s_ezlopi_prep_arg_t *device_prep_arg = (s_ezlopi_prep_arg_t *)arg; if (device_prep_arg && (NULL != device_prep_arg->cjson_device)) { - flex_t *FLEX_value = (flex_t *)malloc(sizeof(flex_t)); - if (NULL != FLEX_value) + flex_t *flex_res_value = (flex_t *)malloc(sizeof(flex_t)); + if (flex_res_value) { - memset(FLEX_value, 0, sizeof(flex_t)); - + memset(flex_res_value, 0, sizeof(flex_t)); l_ezlopi_device_t *device_adc = ezlopi_device_add_device(device_prep_arg->cjson_device); if (device_adc) { @@ -109,20 +108,20 @@ static int __0055_prepare(void *arg) if (item_adc) { item_adc->cloud_properties.device_id = device_adc->cloud_properties.device_id; - __prepare_item_adc_cloud_properties(item_adc, device_prep_arg->cjson_device, FLEX_value); + __prepare_item_adc_cloud_properties(item_adc, device_prep_arg->cjson_device, flex_res_value); ret = 1; } else { ret = -1; ezlopi_device_free_device(device_adc); - free(FLEX_value); + free(flex_res_value); } } else { ret = -1; - free(FLEX_value); + free(flex_res_value); } } } @@ -134,21 +133,36 @@ static int __0055_init(l_ezlopi_item_t *item) int ret = 0; if (NULL != item) { - if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) - { - // initialize analog_pin - ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit); - ret = 1; - } - if (0 == ret) + flex_t *flex_res_value = (flex_t *)malloc(sizeof(flex_t)); + if (flex_res_value) { - ret = -1; - if (item->user_arg) + if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + { + if (0 == ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit)) + { + ret = 1; + } + else + { + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); + } + } + else { - free(item->user_arg); + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); } } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); + } } return ret; } @@ -160,12 +174,18 @@ static int __0055_get_cjson_value(l_ezlopi_item_t *item, void *arg) cJSON *cj_result = (cJSON *)arg; if (cj_result) { - flex_t *FLEX_value = (flex_t *)item->user_arg; - char *valueFormatted = ezlopi_valueformatter_int(FLEX_value->RS_0055); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, FLEX_value->RS_0055); - free(valueFormatted); - ret = 1; + flex_t *flex_res_value = (flex_t *)item->user_arg; + if (flex_res_value) + { + char *valueFormatted = ezlopi_valueformatter_int(flex_res_value->rs_0055); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, flex_res_value->rs_0055); + free(valueFormatted); + } + ret = 1; + } } } return ret; @@ -175,8 +195,8 @@ static int __0055_notify(l_ezlopi_item_t *item) int ret = 0; if (item) { - flex_t *FLEX_value = (flex_t *)item->user_arg; - if (FLEX_value) + flex_t *flex_res_value = (flex_t *)item->user_arg; + if (flex_res_value) { s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; @@ -184,12 +204,12 @@ static int __0055_notify(l_ezlopi_item_t *item) ezlopi_adc_get_adc_data(item->interface.adc.gpio_num, &ezlopi_analog_data); float Vout = (ezlopi_analog_data.voltage) / 1000.0f; // millivolt -> voltage - // calculate the 'RS_0055' resistance value using [voltage divider rule] - int new_RS_0055 = (int)(((flex_Vin / Vout) - 1) * flex_Rout); - if (new_RS_0055 != FLEX_value->RS_0055) + // calculate the 'rs_0055' resistance value using [voltage divider rule] + int new_rs_0055 = (int)(((flex_Vin / Vout) - 1) * flex_Rout); + if (new_rs_0055 != flex_res_value->rs_0055) { ezlopi_device_value_updated_from_device_v3(item); - FLEX_value->RS_0055 = new_RS_0055; + flex_res_value->rs_0055 = new_rs_0055; } ret = 1; } diff --git a/ezlopi-sensors-devices/sensor-0055-ADC-FlexResistor/sensor_0055_ADC_FlexResistor.h b/ezlopi-sensors-devices/sensor-0055-ADC-FlexResistor/sensor_0055_ADC_FlexResistor.h index bc95b4bc7..852bb2984 100644 --- a/ezlopi-sensors-devices/sensor-0055-ADC-FlexResistor/sensor_0055_ADC_FlexResistor.h +++ b/ezlopi-sensors-devices/sensor-0055-ADC-FlexResistor/sensor_0055_ADC_FlexResistor.h @@ -49,7 +49,7 @@ typedef struct flex_t { - int RS_0055; + int rs_0055; } flex_t; //----------------------------------------------------------------------------------------------------------------------------- int sensor_0055_ADC_FlexResistor(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void *arg, void *user_arg); diff --git a/ezlopi-sensors-devices/sensor-0056-ADC-Force-Sensitive-Resistor/sensor_0056_ADC_Force_Sensitive_Resistor.c b/ezlopi-sensors-devices/sensor-0056-ADC-Force-Sensitive-Resistor/sensor_0056_ADC_Force_Sensitive_Resistor.c index f3e385bfb..2c27df59e 100644 --- a/ezlopi-sensors-devices/sensor-0056-ADC-Force-Sensitive-Resistor/sensor_0056_ADC_Force_Sensitive_Resistor.c +++ b/ezlopi-sensors-devices/sensor-0056-ADC-Force-Sensitive-Resistor/sensor_0056_ADC_Force_Sensitive_Resistor.c @@ -95,10 +95,10 @@ static int __0056_prepare(void *arg) s_ezlopi_prep_arg_t *device_prep_arg = (s_ezlopi_prep_arg_t *)arg; if (device_prep_arg && (NULL != device_prep_arg->cjson_device)) { - fsr_t *FSR_struct = (fsr_t *)malloc(sizeof(fsr_t)); - if (NULL != FSR_struct) + fsr_t *fsr_struct = (fsr_t *)malloc(sizeof(fsr_t)); + if (NULL != fsr_struct) { - memset(FSR_struct, 0, sizeof(fsr_t)); + memset(fsr_struct, 0, sizeof(fsr_t)); l_ezlopi_device_t *FSR_device = ezlopi_device_add_device(device_prep_arg->cjson_device); if (FSR_device) @@ -108,20 +108,20 @@ static int __0056_prepare(void *arg) if (FSR_item) { FSR_item->cloud_properties.device_id = FSR_device->cloud_properties.device_id; - __prepare_item_cloud_properties(FSR_item, device_prep_arg->cjson_device, FSR_struct); + __prepare_item_cloud_properties(FSR_item, device_prep_arg->cjson_device, fsr_struct); ret = 1; } else { ret = -1; ezlopi_device_free_device(FSR_device); - free(FSR_struct); + free(fsr_struct); } } else { ret = -1; - free(FSR_struct); + free(fsr_struct); } } } @@ -133,21 +133,36 @@ static int __0056_init(l_ezlopi_item_t *item) int ret = 0; if (item) { - if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) + fsr_t *fsr_struct = (fsr_t *)item->user_arg; + if (fsr_struct) { - // initialize analog_pin - ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit); - ret = 1; - } - if (0 == ret) - { - ret = -1; - if (item->user_arg) + if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) { - free(item->user_arg); + if (0 == ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit)) + { + ret = 1; + } + else + { + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); + } + } + else + { + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); } } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); + } } return ret; } @@ -160,11 +175,17 @@ static int __0056_get_cjson_value(l_ezlopi_item_t *item, void *arg) cJSON *cj_result = (cJSON *)arg; if (cj_result) { - fsr_t *FSR_struct = (fsr_t *)item->user_arg; - char *valueFormatted = ezlopi_valueformatter_float(FSR_struct->FSR_value); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, FSR_struct->FSR_value); - free(valueFormatted); + fsr_t *fsr_struct = (fsr_t *)item->user_arg; + if (fsr_struct) + { + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, fsr_struct->fsr_value); + char *valueFormatted = ezlopi_valueformatter_float(fsr_struct->fsr_value); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } ret = 1; } } @@ -176,20 +197,23 @@ static int __0056_notify(l_ezlopi_item_t *item) int ret = 0; if (item) { - fsr_t *FSR_struct = (fsr_t *)item->user_arg; - s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; - ezlopi_adc_get_adc_data(item->interface.adc.gpio_num, &ezlopi_analog_data); - float Vout = (ezlopi_analog_data.voltage) / 1000.0f; // millivolt -> voltage - - // New Force[N] is : - float new_force = 0.0098f * Calculate_GramForce(Vout); - // TRACE_E(" Force[N]: %.4f", FSR_struct->FSR_value); - if (new_force != FSR_struct->FSR_value) + fsr_t *fsr_struct = (fsr_t *)item->user_arg; + if (fsr_struct) { - FSR_struct->FSR_value = new_force; - ezlopi_device_value_updated_from_device_v3(item); + s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; + ezlopi_adc_get_adc_data(item->interface.adc.gpio_num, &ezlopi_analog_data); + float Vout = (ezlopi_analog_data.voltage) / 1000.0f; // millivolt -> voltage + + // New Force[N] is : + float new_force = 0.0098f * Calculate_GramForce(Vout); + // TRACE_E(" Force[N]: %.4f", fsr_struct->fsr_value); + if (new_force != fsr_struct->fsr_value) + { + fsr_struct->fsr_value = new_force; + ezlopi_device_value_updated_from_device_v3(item); + } + ret = 1; } - ret = 1; } return ret; } diff --git a/ezlopi-sensors-devices/sensor-0056-ADC-Force-Sensitive-Resistor/sensor_0056_ADC_Force_Sensitive_Resistor.h b/ezlopi-sensors-devices/sensor-0056-ADC-Force-Sensitive-Resistor/sensor_0056_ADC_Force_Sensitive_Resistor.h index 8b9c09130..2df421d41 100644 --- a/ezlopi-sensors-devices/sensor-0056-ADC-Force-Sensitive-Resistor/sensor_0056_ADC_Force_Sensitive_Resistor.h +++ b/ezlopi-sensors-devices/sensor-0056-ADC-Force-Sensitive-Resistor/sensor_0056_ADC_Force_Sensitive_Resistor.h @@ -93,7 +93,7 @@ typedef struct fsr_t { - float FSR_value; + float fsr_value; } fsr_t; //----------------------------------------------------------------------------------------------------------------------------- int sensor_0056_ADC_Force_Sensitive_Resistor(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void *arg, void *user_arg); diff --git a/ezlopi-sensors-devices/sensor-0057-other-KY026-FlameDetector/sensor_0057_other_KY026_FlameDetector.c b/ezlopi-sensors-devices/sensor-0057-other-KY026-FlameDetector/sensor_0057_other_KY026_FlameDetector.c index e1124b585..8e9fec666 100644 --- a/ezlopi-sensors-devices/sensor-0057-other-KY026-FlameDetector/sensor_0057_other_KY026_FlameDetector.c +++ b/ezlopi-sensors-devices/sensor-0057-other-KY026-FlameDetector/sensor_0057_other_KY026_FlameDetector.c @@ -99,10 +99,10 @@ static int __0057_prepare(void *arg) } //---------------------------- ADC - DEVICE 2 ------------------------------------------- - flame_t *FLAME_struct = (flame_t *)malloc(sizeof(flame_t)); - if (NULL != FLAME_struct) + flame_t *flame_struct = (flame_t *)malloc(sizeof(flame_t)); + if (NULL != flame_struct) { - memset(FLAME_struct, 0, sizeof(flame_t)); + memset(flame_struct, 0, sizeof(flame_t)); l_ezlopi_device_t *flame_device_adc = ezlopi_device_add_device(device_prep_arg->cjson_device); if (flame_device_adc) { @@ -111,20 +111,20 @@ static int __0057_prepare(void *arg) if (flame_item_adc) { flame_item_adc->cloud_properties.device_id = flame_device_adc->cloud_properties.device_id; - __prepare_item_adc_cloud_properties(flame_item_adc, device_prep_arg->cjson_device, FLAME_struct); + __prepare_item_adc_cloud_properties(flame_item_adc, device_prep_arg->cjson_device, flame_struct); ret = 1; } else { ret = -1; ezlopi_device_free_device(flame_device_adc); - free(FLAME_struct); + free(flame_struct); } } else { ret = -1; - free(FLAME_struct); + free(flame_struct); } } } @@ -136,31 +136,55 @@ static int __0057_init(l_ezlopi_item_t *item) int ret = 0; if (NULL != item) { - if ((ezlopi_item_name_heat_alarm == item->cloud_properties.item_name) && GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) - { - // intialize digital_pin - gpio_config_t input_conf = {}; - input_conf.pin_bit_mask = (1ULL << (item->interface.gpio.gpio_in.gpio_num)); - input_conf.intr_type = GPIO_INTR_DISABLE; - input_conf.mode = GPIO_MODE_INPUT; - input_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; - input_conf.pull_up_en = GPIO_PULLUP_ENABLE; - gpio_config(&input_conf); - ret = 1; - } - if ((ezlopi_item_name_temperature_changes == item->cloud_properties.item_name) && GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + if (ezlopi_item_name_heat_alarm == item->cloud_properties.item_name) { - // initialize analog_pin - ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit); - ret = 1; + if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) + { // intialize digital_pin + gpio_config_t input_conf = {}; + input_conf.pin_bit_mask = (1ULL << (item->interface.gpio.gpio_in.gpio_num)); + input_conf.intr_type = GPIO_INTR_DISABLE; + input_conf.mode = GPIO_MODE_INPUT; + input_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; + input_conf.pull_up_en = GPIO_PULLUP_ENABLE; + ret = (0 == gpio_config(&input_conf)) ? 1 : -1; + } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); + } } - if (0 == ret) + else if (ezlopi_item_name_temperature_changes == item->cloud_properties.item_name) { - ret = -1; - if (item->user_arg) + flame_t *flame_struct = (flame_t *)item->user_arg; + if (flame_struct) { - free(item->user_arg); - item->user_arg = NULL; + if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + { // initialize analog_pin + if (0 == ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit)) + { + ret = 1; + } + else + { + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); + } + } + else + { + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); + } + } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); } } } @@ -255,16 +279,21 @@ static int __0057_get_item(l_ezlopi_item_t *item, void *arg) cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, (char *)item->user_arg ? item->user_arg : "heat_ok"); cJSON_AddStringToObject(cj_result, ezlopi_value_str, (char *)item->user_arg ? item->user_arg : "heat_ok"); } - if (ezlopi_item_name_temperature_changes == item->cloud_properties.item_name) + else if (ezlopi_item_name_temperature_changes == item->cloud_properties.item_name) { - flame_t *FLAME_struct = (flame_t *)item->user_arg; - - char *valueFormatted = ezlopi_valueformatter_float(FLAME_struct->_absorbed_percent); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, FLAME_struct->_absorbed_percent); - free(valueFormatted); + flame_t *flame_struct = (flame_t *)item->user_arg; + if (flame_struct) + { + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, flame_struct->absorbed_percent); + char *valueFormatted = ezlopi_valueformatter_float(flame_struct->absorbed_percent); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } + ret = 1; } - ret = 1; } } return ret; @@ -283,13 +312,19 @@ static int __0057_get_cjson_value(l_ezlopi_item_t *item, void *arg) cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, (char *)item->user_arg ? item->user_arg : "heat_ok"); cJSON_AddStringToObject(cj_result, ezlopi_value_str, (char *)item->user_arg ? item->user_arg : "heat_ok"); } - if (ezlopi_item_name_temperature_changes == item->cloud_properties.item_name) + else if (ezlopi_item_name_temperature_changes == item->cloud_properties.item_name) { - flame_t *FLAME_struct = (flame_t *)item->user_arg; - char *valueFormatted = ezlopi_valueformatter_float(FLAME_struct->_absorbed_percent); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, FLAME_struct->_absorbed_percent); - free(valueFormatted); + flame_t *flame_struct = (flame_t *)item->user_arg; + if (flame_struct) + { + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, flame_struct->absorbed_percent); + char *valueFormatted = ezlopi_valueformatter_float(flame_struct->absorbed_percent); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } } ret = 1; } @@ -319,18 +354,21 @@ static int __0057_notify(l_ezlopi_item_t *item) ezlopi_device_value_updated_from_device_v3(item); } } - if (ezlopi_item_name_temperature_changes == item->cloud_properties.item_name) + else if (ezlopi_item_name_temperature_changes == item->cloud_properties.item_name) { - flame_t *FLAME_struct = (flame_t *)item->user_arg; - float analog_sensor_volt = 0, max_volt_reading = 0; - // extract the sensor_output_values - __extract_KY026_sensor_value(item->interface.adc.gpio_num, &analog_sensor_volt, &max_volt_reading); - float new_percent = ((1 - (analog_sensor_volt / max_volt_reading)) * 100.0f); - // TRACE_E("Heat-detected: %.2f percent", _absorbed_percent); - if (new_percent != FLAME_struct->_absorbed_percent) + flame_t *flame_struct = (flame_t *)item->user_arg; + if (flame_struct) { - ezlopi_device_value_updated_from_device_v3(item); - FLAME_struct->_absorbed_percent = new_percent; + float analog_sensor_volt = 0, max_volt_reading = 0; + // extract the sensor_output_values + __extract_KY026_sensor_value(item->interface.adc.gpio_num, &analog_sensor_volt, &max_volt_reading); + float new_percent = ((1 - (analog_sensor_volt / max_volt_reading)) * 100.0f); + // TRACE_E("Heat-detected: %.2f percent", absorbed_percent); + if (new_percent != flame_struct->absorbed_percent) + { + ezlopi_device_value_updated_from_device_v3(item); + flame_struct->absorbed_percent = new_percent; + } } } ret = 1; diff --git a/ezlopi-sensors-devices/sensor-0057-other-KY026-FlameDetector/sensor_0057_other_KY026_FlameDetector.h b/ezlopi-sensors-devices/sensor-0057-other-KY026-FlameDetector/sensor_0057_other_KY026_FlameDetector.h index 0cfdb2ed3..5e4aa359e 100644 --- a/ezlopi-sensors-devices/sensor-0057-other-KY026-FlameDetector/sensor_0057_other_KY026_FlameDetector.h +++ b/ezlopi-sensors-devices/sensor-0057-other-KY026-FlameDetector/sensor_0057_other_KY026_FlameDetector.h @@ -48,7 +48,7 @@ typedef enum typedef struct flame_t { - float _absorbed_percent; + float absorbed_percent; } flame_t; //---------------------------------------------------- int sensor_0057_other_KY026_FlameDetector(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void *arg, void *user_arg); diff --git a/ezlopi-sensors-devices/sensor-0059-other-MQ6-LPG-detector/sensor_0059_other_MQ6_LPG_detector.c b/ezlopi-sensors-devices/sensor-0059-other-MQ6-LPG-detector/sensor_0059_other_MQ6_LPG_detector.c index 36875c461..8e5c2eff0 100644 --- a/ezlopi-sensors-devices/sensor-0059-other-MQ6-LPG-detector/sensor_0059_other_MQ6_LPG_detector.c +++ b/ezlopi-sensors-devices/sensor-0059-other-MQ6-LPG-detector/sensor_0059_other_MQ6_LPG_detector.c @@ -72,14 +72,7 @@ int sensor_0059_other_MQ6_LPG_detector(e_ezlopi_actions_t action, l_ezlopi_item_ } case EZLOPI_ACTION_NOTIFY_1000_MS: { - if (item) - { - s_mq6_value_t *MQ6_value = (s_mq6_value_t *)item->user_arg; - if (true == MQ6_value->Calibration_complete_LPG) - { - __0059_notify(item); - } - } + __0059_notify(item); break; } default: @@ -154,37 +147,66 @@ static int __0059_init(l_ezlopi_item_t *item) int ret = 0; if (NULL != item) { - if ((ezlopi_item_name_gas_alarm == item->cloud_properties.item_name) && GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) + if (ezlopi_item_name_gas_alarm == item->cloud_properties.item_name) { - // intialize digital_pin - gpio_config_t input_conf = {}; - input_conf.pin_bit_mask = (1ULL << (item->interface.gpio.gpio_in.gpio_num)); - input_conf.intr_type = GPIO_INTR_DISABLE; - input_conf.mode = GPIO_MODE_INPUT; - input_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; - input_conf.pull_up_en = GPIO_PULLUP_ENABLE; - gpio_config(&input_conf); - ret = 1; + if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) + { // intialize digital_pin + gpio_config_t input_conf = {}; + input_conf.pin_bit_mask = (1ULL << (item->interface.gpio.gpio_in.gpio_num)); + input_conf.intr_type = GPIO_INTR_DISABLE; + input_conf.mode = GPIO_MODE_INPUT; + input_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; + input_conf.pull_up_en = GPIO_PULLUP_ENABLE; + ret = (0 == gpio_config(&input_conf)) ? 1 : -1; + } + else + { + ret = -1; + TRACE_E("Deleting Item!!"); + ezlopi_device_free_device_by_item(item); // remove the item itself; + } } - if ((ezlopi_item_name_smoke_density == item->cloud_properties.item_name) && GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + else if ((ezlopi_item_name_smoke_density == item->cloud_properties.item_name)) { - // initialize analog_pin - ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit); - // calibrate if not done s_mq6_value_t *MQ6_value = (s_mq6_value_t *)item->user_arg; - if (false == MQ6_value->Calibration_complete_LPG) + if (MQ6_value) { - xTaskCreate(__calibrate_MQ6_R0_resistance, "Task_to_calculate_R0_air", 2048, item, 1, NULL); + if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + { + // initialize analog_pin + if (0 == ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit)) + { + // calibrate if not done + if (false == MQ6_value->Calibration_complete_LPG) + { + xTaskCreate(__calibrate_MQ6_R0_resistance, "Task_to_calculate_R0_air", 2048, item, 1, NULL); + } + + ret = 1; + } + else + { + ret = -1; + TRACE_E("Deleting Item!!"); + free(item->user_arg); + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); // remove the item itself + } + } + else + { + ret = -1; + TRACE_E("Deleting Item!!"); + free(item->user_arg); + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); // remove the item itself + } } - ret = 1; - } - if (0 == ret) - { - ret = -1; - if (item->user_arg) + else { - free(item->user_arg); - item->user_arg = NULL; + ret = -1; + TRACE_E("Deleting Item!!"); + ezlopi_device_free_device_by_item(item); // remove the item itself; } } } @@ -281,13 +303,19 @@ static int __0059_get_item(l_ezlopi_item_t *item, void *arg) cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, (char *)item->user_arg ? item->user_arg : "no_gas"); cJSON_AddStringToObject(cj_result, ezlopi_value_str, (char *)item->user_arg ? item->user_arg : "no_gas"); } - if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) + else if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { s_mq6_value_t *MQ6_value = ((s_mq6_value_t *)item->user_arg); - char *valueFormatted = ezlopi_valueformatter_float(MQ6_value->_LPG_ppm); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ6_value->_LPG_ppm); - free(valueFormatted); + if (MQ6_value) + { + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ6_value->_LPG_ppm); + char *valueFormatted = ezlopi_valueformatter_float(MQ6_value->_LPG_ppm); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } } ret = 1; } @@ -308,13 +336,19 @@ static int __0059_get_cjson_value(l_ezlopi_item_t *item, void *arg) cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, (char *)item->user_arg ? item->user_arg : "no_gas"); cJSON_AddStringToObject(cj_result, ezlopi_value_str, (char *)item->user_arg ? item->user_arg : "no_gas"); } - if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) + else if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { s_mq6_value_t *MQ6_value = ((s_mq6_value_t *)item->user_arg); - char *valueFormatted = ezlopi_valueformatter_float(MQ6_value->_LPG_ppm); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ6_value->_LPG_ppm); - free(valueFormatted); + if (MQ6_value) + { + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ6_value->_LPG_ppm); + char *valueFormatted = ezlopi_valueformatter_float(MQ6_value->_LPG_ppm); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } } ret = 1; } @@ -344,15 +378,18 @@ static int __0059_notify(l_ezlopi_item_t *item) ezlopi_device_value_updated_from_device_v3(item); } } - if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) + else if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { // extract the sensor_output_values - double new_value = (double)__extract_MQ6_sensor_ppm(item); s_mq6_value_t *MQ6_value = (s_mq6_value_t *)item->user_arg; - if (fabs((double)(MQ6_value->_LPG_ppm) - new_value) > 0.0001) + if ((MQ6_value) && (true == MQ6_value->Calibration_complete_LPG)) { - MQ6_value->_LPG_ppm = (float)new_value; - ezlopi_device_value_updated_from_device_v3(item); + double new_value = (double)__extract_MQ6_sensor_ppm(item); + if (fabs((double)(MQ6_value->_LPG_ppm) - new_value) > 0.0001) + { + MQ6_value->_LPG_ppm = (float)new_value; + ezlopi_device_value_updated_from_device_v3(item); + } } } ret = 1; @@ -362,49 +399,52 @@ static int __0059_notify(l_ezlopi_item_t *item) //------------------------------------------------------------------------------------------------------ static float __extract_MQ6_sensor_ppm(l_ezlopi_item_t *item) { - uint32_t mq6_adc_pin = item->interface.adc.gpio_num; s_mq6_value_t *MQ6_value = (s_mq6_value_t *)item->user_arg; - // calculation process - //------------------------------------------------- - s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; - // extract the mean_sensor_analog_output_voltage - float analog_sensor_volt = 0; - for (uint8_t x = 10; x > 0; x--) - { - ezlopi_adc_get_adc_data(mq6_adc_pin, &ezlopi_analog_data); + if (MQ6_value) + { // calculation process + //------------------------------------------------- + uint32_t mq6_adc_pin = item->interface.adc.gpio_num; + s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; + // extract the mean_sensor_analog_output_voltage + float analog_sensor_volt = 0; + for (uint8_t x = 10; x > 0; x--) + { + ezlopi_adc_get_adc_data(mq6_adc_pin, &ezlopi_analog_data); #ifdef VOLTAGE_DIVIDER_ADDED - analog_sensor_volt += ((float)(ezlopi_analog_data.voltage) * 2.0f); + analog_sensor_volt += ((float)(ezlopi_analog_data.voltage) * 2.0f); #else - analog_sensor_volt += (float)(ezlopi_analog_data.voltage); + analog_sensor_volt += (float)(ezlopi_analog_data.voltage); #endif - vTaskDelay(1); - } - analog_sensor_volt = analog_sensor_volt / 10.0f; + vTaskDelay(1); + } + analog_sensor_volt = analog_sensor_volt / 10.0f; - //----------------------------------------------------------------------------------- - // Stage_2 : [from 'sensor_0059_ADC_MQ6_methane_gas_detector.h'] + //----------------------------------------------------------------------------------- + // Stage_2 : [from 'sensor_0059_ADC_MQ6_methane_gas_detector.h'] - // 1. Calculate 'Rs_gas' for the gas detected - float Rs_gas = (((MQ6_VOLT_RESOLUTION_Vc * mq6_eqv_RL) / (analog_sensor_volt / 1000.0f)) - mq6_eqv_RL); + // 1. Calculate 'Rs_gas' for the gas detected + float Rs_gas = (((MQ6_VOLT_RESOLUTION_Vc * mq6_eqv_RL) / (analog_sensor_volt / 1000.0f)) - mq6_eqv_RL); - // 1.1 Calculate @ 'ratio' during LPG presence - double _ratio = (Rs_gas / ((MQ6_value->MQ6_R0_constant <= 0) ? (1.0f) : (MQ6_value->MQ6_R0_constant))); // avoid dividing by zero?? - if (_ratio <= 0) - { - _ratio = 0; - } - //------------------------------------------------- + // 1.1 Calculate @ 'ratio' during LPG presence + double _ratio = (Rs_gas / ((MQ6_value->MQ6_R0_constant <= 0) ? (1.0f) : (MQ6_value->MQ6_R0_constant))); // avoid dividing by zero?? + if (_ratio <= 0) + { + _ratio = 0; + } + //------------------------------------------------- - // 1.2 Calculate _LPG_ppm - float _LPG_ppm = (float)pow(10, (((float)log10(_ratio)) - b_coeff_mq6) / m_slope_mq6); // ---> _LPG_ppm = 10 ^ [ ( log(ratio) - b ) / m ] - if (_LPG_ppm < 0) - { - _LPG_ppm = 0; // No negative values accepted or upper datasheet recomendation. - } - TRACE_E("_LPG_ppm [LPG] : %.2f -> ratio[RS/R0] : %.2f -> Volts : %0.2fmv", _LPG_ppm, (float)_ratio, analog_sensor_volt); + // 1.2 Calculate _LPG_ppm + float _LPG_ppm = (float)pow(10, (((float)log10(_ratio)) - b_coeff_mq6) / m_slope_mq6); // ---> _LPG_ppm = 10 ^ [ ( log(ratio) - b ) / m ] + if (_LPG_ppm < 0) + { + _LPG_ppm = 0; // No negative values accepted or upper datasheet recomendation. + } + TRACE_E("_LPG_ppm [LPG] : %.2f -> ratio[RS/R0] : %.2f -> Volts : %0.2fmv", _LPG_ppm, (float)_ratio, analog_sensor_volt); - //------------------------------------------------- - return _LPG_ppm; + //------------------------------------------------- + return _LPG_ppm; + } + return 0; } static void __calibrate_MQ6_R0_resistance(void *params) @@ -413,54 +453,56 @@ static void __calibrate_MQ6_R0_resistance(void *params) if (NULL != item) { s_mq6_value_t *MQ6_value = (s_mq6_value_t *)item->user_arg; - - uint32_t mq6_adc_pin = item->interface.adc.gpio_num; - //------------------------------------------------- - // let the sensor to heat for 20seconds - for (uint8_t j = 20; j > 0; j--) - { - TRACE_E("Heating sensor.........time left: %d sec", j); - vTaskDelay(100); // vTaskDelay(1000 / portTICK_PERIOD_MS); // 1sec delay before calibration - } - //------------------------------------------------- - // extract the mean_sensor_analog_output_voltage - float _sensor_volt = 0; - s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; - for (uint8_t i = 100; i > 0; i--) + if (MQ6_value) { - if (i % 20 == 0) + uint32_t mq6_adc_pin = item->interface.adc.gpio_num; + //------------------------------------------------- + // let the sensor to heat for 20seconds + for (uint8_t j = 20; j > 0; j--) { - TRACE_W("Please Wait..Collecting Ambient Air data ........... [Avoid Smokes/gases]"); + TRACE_E("Heating sensor.........time left: %d sec", j); + vTaskDelay(100); // vTaskDelay(1000 / portTICK_PERIOD_MS); // 1sec delay before calibration } - // extract ADC values - ezlopi_adc_get_adc_data(mq6_adc_pin, &ezlopi_analog_data); + //------------------------------------------------- + // extract the mean_sensor_analog_output_voltage + float _sensor_volt = 0; + s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; + for (uint8_t i = 100; i > 0; i--) + { + if (i % 20 == 0) + { + TRACE_W("Please Wait..Collecting Ambient Air data ........... [Avoid Smokes/gases]"); + } + // extract ADC values + ezlopi_adc_get_adc_data(mq6_adc_pin, &ezlopi_analog_data); #ifdef VOLTAGE_DIVIDER_ADDED - _sensor_volt += (float)((ezlopi_analog_data.voltage) * 2.0f); // [0-2.4V] X2 + _sensor_volt += (float)((ezlopi_analog_data.voltage) * 2.0f); // [0-2.4V] X2 #else - _sensor_volt += (float)(ezlopi_analog_data->voltage); + _sensor_volt += (float)(ezlopi_analog_data->voltage); #endif - vTaskDelay(1); // 10ms - } - _sensor_volt = _sensor_volt / 100.0f; + vTaskDelay(1); // 10ms + } + _sensor_volt = _sensor_volt / 100.0f; - //------------------------------------------------- - // Calculate the 'Rs' of heater during clean air [calibration phase] - // Range -> [2Kohm - 20Kohm] - float RS_calib = ((MQ6_VOLT_RESOLUTION_Vc * mq6_eqv_RL) / (_sensor_volt / 1000.0f)) - mq6_eqv_RL; // Calculate RS in fresh air - TRACE_E("CALIB_TASK -> 'RS_calib' = %.2f", RS_calib); - if (RS_calib < 0) - { - RS_calib = 0; // No negative values accepted. - } - // Calculate the R0_air which is constant through-out - MQ6_value->MQ6_R0_constant = (RS_calib / RatioMQ6CleanAir); // Calculate MQ6_R0_constant - TRACE_E("CALIB_TASK -> 'MQ6_R0_constant' = %.2f", MQ6_value->MQ6_R0_constant); - if (MQ6_value->MQ6_R0_constant < 0) - { - MQ6_value->MQ6_R0_constant = 0; // No negative values accepted. + //------------------------------------------------- + // Calculate the 'Rs' of heater during clean air [calibration phase] + // Range -> [2Kohm - 20Kohm] + float RS_calib = ((MQ6_VOLT_RESOLUTION_Vc * mq6_eqv_RL) / (_sensor_volt / 1000.0f)) - mq6_eqv_RL; // Calculate RS in fresh air + TRACE_E("CALIB_TASK -> 'RS_calib' = %.2f", RS_calib); + if (RS_calib < 0) + { + RS_calib = 0; // No negative values accepted. + } + // Calculate the R0_air which is constant through-out + MQ6_value->MQ6_R0_constant = (RS_calib / RatioMQ6CleanAir); // Calculate MQ6_R0_constant + TRACE_E("CALIB_TASK -> 'MQ6_R0_constant' = %.2f", MQ6_value->MQ6_R0_constant); + if (MQ6_value->MQ6_R0_constant < 0) + { + MQ6_value->MQ6_R0_constant = 0; // No negative values accepted. + } + // Set calibration_complete_LPG flag + MQ6_value->Calibration_complete_LPG = true; } - // Set calibration_complete_LPG flag - MQ6_value->Calibration_complete_LPG = true; } vTaskDelete(NULL); } \ No newline at end of file diff --git a/ezlopi-sensors-devices/sensor-0060-digitalIn-vibration-detector/sensor_0060_digitalIn_vibration_detector.c b/ezlopi-sensors-devices/sensor-0060-digitalIn-vibration-detector/sensor_0060_digitalIn_vibration_detector.c index f229cd793..33873e87f 100644 --- a/ezlopi-sensors-devices/sensor-0060-digitalIn-vibration-detector/sensor_0060_digitalIn_vibration_detector.c +++ b/ezlopi-sensors-devices/sensor-0060-digitalIn-vibration-detector/sensor_0060_digitalIn_vibration_detector.c @@ -157,15 +157,16 @@ static int __0060_init(l_ezlopi_item_t *item) item->interface.gpio.gpio_in.value = gpio_get_level(item->interface.gpio.gpio_in.gpio_num); ret = 1; } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); + } } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } return ret; diff --git a/ezlopi-sensors-devices/sensor-0061-digitalIn-reed-switch/sensor_0061_digitalIn_reed_switch.c b/ezlopi-sensors-devices/sensor-0061-digitalIn-reed-switch/sensor_0061_digitalIn_reed_switch.c index 686d7f564..f55a9d036 100644 --- a/ezlopi-sensors-devices/sensor-0061-digitalIn-reed-switch/sensor_0061_digitalIn_reed_switch.c +++ b/ezlopi-sensors-devices/sensor-0061-digitalIn-reed-switch/sensor_0061_digitalIn_reed_switch.c @@ -149,27 +149,24 @@ static int __0061_init(l_ezlopi_item_t *item) : GPIO_PULLUP_DISABLE, .intr_type = item->interface.gpio.gpio_in.interrupt, }; - ret = gpio_config(&input_conf); - if (ret) - { - TRACE_E("Error initializing Reed switch"); - } - else + if (ESP_OK == gpio_config(&input_conf)) { item->interface.gpio.gpio_in.value = gpio_get_level(item->interface.gpio.gpio_in.gpio_num); gpio_isr_service_register_v3(item, _0061_update_from_device, 200); ret = 1; } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); + TRACE_E("Error initializing Reed switch"); } } + else + { + ret = -1; + ezlopi_device_free_device_by_item(item); + } } return ret; } diff --git a/ezlopi-sensors-devices/sensor-0062-other-MQ7-CO-detector/sensor_0062_other_MQ7_CO_detector.c b/ezlopi-sensors-devices/sensor-0062-other-MQ7-CO-detector/sensor_0062_other_MQ7_CO_detector.c index dbd05ba80..9bec05a04 100644 --- a/ezlopi-sensors-devices/sensor-0062-other-MQ7-CO-detector/sensor_0062_other_MQ7_CO_detector.c +++ b/ezlopi-sensors-devices/sensor-0062-other-MQ7-CO-detector/sensor_0062_other_MQ7_CO_detector.c @@ -26,7 +26,7 @@ typedef struct s_mq7_value bool Calibration_complete_CO; } s_mq7_value_t; -const char *mq7_sensor_gas_alarm_token[] = { +const char* mq7_sensor_gas_alarm_token[] = { "no_gas", "combustible_gas_detected", "toxic_gas_detected", @@ -34,21 +34,21 @@ const char *mq7_sensor_gas_alarm_token[] = { }; //------------------------------------------------------------------------- -static int __0062_prepare(void *arg); -static int __0062_init(l_ezlopi_item_t *item); -static int __0062_get_item(l_ezlopi_item_t *item, void *arg); -static int __0062_get_cjson_value(l_ezlopi_item_t *item, void *arg); -static int __0062_notify(l_ezlopi_item_t *item); +static int __0062_prepare(void* arg); +static int __0062_init(l_ezlopi_item_t* item); +static int __0062_get_item(l_ezlopi_item_t* item, void* arg); +static int __0062_get_cjson_value(l_ezlopi_item_t* item, void* arg); +static int __0062_notify(l_ezlopi_item_t* item); -static void __calibrate_MQ7_R0_resistance(void *params); -static float __extract_MQ7_sensor_ppm(l_ezlopi_item_t *item); -static void __prepare_device_digi_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device); -static void __prepare_item_digi_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_device); -static void __prepare_device_adc_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device); -static void __prepare_item_adc_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_device, void *user_data); +static void __calibrate_MQ7_R0_resistance(void* params); +static float __extract_MQ7_sensor_ppm(l_ezlopi_item_t* item); +static void __prepare_device_digi_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device); +static void __prepare_item_digi_cloud_properties(l_ezlopi_item_t* item, cJSON* cj_device); +static void __prepare_device_adc_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device); +static void __prepare_item_adc_cloud_properties(l_ezlopi_item_t* item, cJSON* cj_device, void* user_data); //-------------------------------------------------------------------------------------------------------- -int sensor_0062_other_MQ7_CO_detector(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void *arg, void *user_arg) +int sensor_0062_other_MQ7_CO_detector(e_ezlopi_actions_t action, l_ezlopi_item_t* item, void* arg, void* user_arg) { int ret = 0; switch (action) @@ -75,14 +75,7 @@ int sensor_0062_other_MQ7_CO_detector(e_ezlopi_actions_t action, l_ezlopi_item_t } case EZLOPI_ACTION_NOTIFY_1000_MS: { - if (item) - { - s_mq7_value_t *MQ7_value = (s_mq7_value_t *)item->user_arg; - if (true == MQ7_value->Calibration_complete_CO) - { - __0062_notify(item); - } - } + __0062_notify(item); break; } default: @@ -93,18 +86,18 @@ int sensor_0062_other_MQ7_CO_detector(e_ezlopi_actions_t action, l_ezlopi_item_t return ret; } //---------------------------------------------------- -static int __0062_prepare(void *arg) +static int __0062_prepare(void* arg) { int ret = 0; - s_ezlopi_prep_arg_t *device_prep_arg = (s_ezlopi_prep_arg_t *)arg; + s_ezlopi_prep_arg_t* device_prep_arg = (s_ezlopi_prep_arg_t*)arg; if (device_prep_arg && (NULL != device_prep_arg->cjson_device)) { //--------------------------- DIGI - DEVICE 1 -------------------------------------------- - l_ezlopi_device_t *MQ7_device_digi = ezlopi_device_add_device(device_prep_arg->cjson_device); + l_ezlopi_device_t* MQ7_device_digi = ezlopi_device_add_device(device_prep_arg->cjson_device); if (MQ7_device_digi) { __prepare_device_digi_cloud_properties(MQ7_device_digi, device_prep_arg->cjson_device); - l_ezlopi_item_t *MQ7_item_digi = ezlopi_device_add_item_to_device(MQ7_device_digi, sensor_0062_other_MQ7_CO_detector); + l_ezlopi_item_t* MQ7_item_digi = ezlopi_device_add_item_to_device(MQ7_device_digi, sensor_0062_other_MQ7_CO_detector); if (MQ7_item_digi) { MQ7_item_digi->cloud_properties.device_id = MQ7_device_digi->cloud_properties.device_id; @@ -119,15 +112,15 @@ static int __0062_prepare(void *arg) } //---------------------------- ADC - DEVICE 2 ------------------------------------------- - s_mq7_value_t *MQ7_value = (s_mq7_value_t *)malloc(sizeof(s_mq7_value_t)); + s_mq7_value_t* MQ7_value = (s_mq7_value_t*)malloc(sizeof(s_mq7_value_t)); if (NULL != MQ7_value) { memset(MQ7_value, 0, sizeof(s_mq7_value_t)); - l_ezlopi_device_t *MQ7_device_adc = ezlopi_device_add_device(device_prep_arg->cjson_device); + l_ezlopi_device_t* MQ7_device_adc = ezlopi_device_add_device(device_prep_arg->cjson_device); if (MQ7_device_adc) { __prepare_device_adc_cloud_properties(MQ7_device_adc, device_prep_arg->cjson_device); - l_ezlopi_item_t *MQ7_item_adc = ezlopi_device_add_item_to_device(MQ7_device_adc, sensor_0062_other_MQ7_CO_detector); + l_ezlopi_item_t* MQ7_item_adc = ezlopi_device_add_item_to_device(MQ7_device_adc, sensor_0062_other_MQ7_CO_detector); if (MQ7_item_adc) { MQ7_item_adc->cloud_properties.device_id = MQ7_device_adc->cloud_properties.device_id; @@ -151,42 +144,68 @@ static int __0062_prepare(void *arg) return ret; } -static int __0062_init(l_ezlopi_item_t *item) +static int __0062_init(l_ezlopi_item_t* item) { int ret = 0; if (NULL != item) { - if ((ezlopi_item_name_gas_alarm == item->cloud_properties.item_name) && GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) - { - // intialize digital_pin - gpio_config_t input_conf = {}; - input_conf.pin_bit_mask = (1ULL << (item->interface.gpio.gpio_in.gpio_num)); - input_conf.intr_type = GPIO_INTR_DISABLE; - input_conf.mode = GPIO_MODE_INPUT; - input_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; - input_conf.pull_up_en = GPIO_PULLUP_ENABLE; - gpio_config(&input_conf); - ret = 1; - } - if ((ezlopi_item_name_smoke_density == item->cloud_properties.item_name) && GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + if (ezlopi_item_name_gas_alarm == item->cloud_properties.item_name) { - // initialize analog_pin - ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit); - // calibrate if not done - s_mq7_value_t *MQ7_value = (s_mq7_value_t *)item->user_arg; - if (false == MQ7_value->Calibration_complete_CO) + if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) + { // intialize digital_pin + gpio_config_t input_conf = {}; + input_conf.pin_bit_mask = (1ULL << (item->interface.gpio.gpio_in.gpio_num)); + input_conf.intr_type = GPIO_INTR_DISABLE; + input_conf.mode = GPIO_MODE_INPUT; + input_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; + input_conf.pull_up_en = GPIO_PULLUP_ENABLE; + ret = (0 == gpio_config(&input_conf)) ? 1 : -1; + } + else { - xTaskCreate(__calibrate_MQ7_R0_resistance, "Task_to_calculate_R0_air", 2048, item, 1, NULL); + ret = -1; + TRACE_E("Deleting Item!!"); + ezlopi_device_free_device_by_item(item); // remove the item itself } - ret = 1; } - if (0 == ret) + else if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { - ret = -1; - if (item->user_arg) + s_mq7_value_t* MQ7_value = (s_mq7_value_t*)item->user_arg; + if (MQ7_value) + { + if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + { // initialize analog_pin + if (0 == ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit)) + { // calibrate if not done + if (false == MQ7_value->Calibration_complete_CO) + { + xTaskCreate(__calibrate_MQ7_R0_resistance, "Task_to_calculate_R0_air", 2048, item, 1, NULL); + } + ret = 1; + } + else + { + ret = -1; + TRACE_E("Deleting Item!!"); + free(item->user_arg); + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); // remove the item itself + } + } + else + { + ret = -1; + TRACE_E("Deleting Item!!"); + free(item->user_arg); + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); // remove the item itself + } + } + else { - free(item->user_arg); - item->user_arg = NULL; + ret = -1; + TRACE_E("Deleting Item!!"); + ezlopi_device_free_device_by_item(item); // remove the item itself; } } } @@ -194,7 +213,7 @@ static int __0062_init(l_ezlopi_item_t *item) } //------------------------------------------------------------------------------------------------------ -static void __prepare_device_digi_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device) +static void __prepare_device_digi_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device) { // char *device_name = NULL; // CJSON_GET_VALUE_STRING(cj_device, ezlopi_dev_name_str, device_name); @@ -207,7 +226,7 @@ static void __prepare_device_digi_cloud_properties(l_ezlopi_device_t *device, cJ device->cloud_properties.info = NULL; device->cloud_properties.device_type_id = NULL; } -static void __prepare_item_digi_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_device) +static void __prepare_item_digi_cloud_properties(l_ezlopi_item_t* item, cJSON* cj_device) { item->cloud_properties.has_getter = true; item->cloud_properties.has_setter = false; @@ -222,7 +241,7 @@ static void __prepare_item_digi_cloud_properties(l_ezlopi_item_t *item, cJSON *c TRACE_S("MQ7-> DIGITAL_PIN: %d ", item->interface.gpio.gpio_in.gpio_num); } //------------------------------------------------------------------------------------------------------ -static void __prepare_device_adc_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device) +static void __prepare_device_adc_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device) { // char *device_name = NULL; // CJSON_GET_VALUE_STRING(cj_device, ezlopi_dev_name_str, device_name); @@ -235,7 +254,7 @@ static void __prepare_device_adc_cloud_properties(l_ezlopi_device_t *device, cJS device->cloud_properties.info = NULL; device->cloud_properties.device_type_id = NULL; } -static void __prepare_item_adc_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_device, void *user_data) +static void __prepare_item_adc_cloud_properties(l_ezlopi_item_t* item, cJSON* cj_device, void* user_data) { item->cloud_properties.has_getter = true; item->cloud_properties.has_setter = false; @@ -255,23 +274,23 @@ static void __prepare_item_adc_cloud_properties(l_ezlopi_item_t *item, cJSON *cj } //------------------------------------------------------------------------------------------------------ -static int __0062_get_item(l_ezlopi_item_t *item, void *arg) +static int __0062_get_item(l_ezlopi_item_t* item, void* arg) { int ret = 0; if (item && arg) { - cJSON *cj_result = (cJSON *)arg; + cJSON* cj_result = (cJSON*)arg; if (cj_result) { if (ezlopi_item_name_gas_alarm == item->cloud_properties.item_name) { //------------------- POSSIBLE JSON ENUM CONTENTS ---------------------------------- - cJSON *json_array_enum = cJSON_CreateArray(); + cJSON* json_array_enum = cJSON_CreateArray(); if (NULL != json_array_enum) { for (uint8_t i = 0; i < MQ7_GAS_ALARM_MAX; i++) { - cJSON *json_value = cJSON_CreateString(mq7_sensor_gas_alarm_token[i]); + cJSON* json_value = cJSON_CreateString(mq7_sensor_gas_alarm_token[i]); if (NULL != json_value) { cJSON_AddItemToArray(json_array_enum, json_value); @@ -280,16 +299,22 @@ static int __0062_get_item(l_ezlopi_item_t *item, void *arg) cJSON_AddItemToObject(cj_result, ezlopi_enum_str, json_array_enum); } //-------------------------------------------------------------------------------------- - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, (char *)item->user_arg ? item->user_arg : "no_gas"); - cJSON_AddStringToObject(cj_result, ezlopi_value_str, (char *)item->user_arg ? item->user_arg : "no_gas"); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, (char*)item->user_arg ? item->user_arg : "no_gas"); + cJSON_AddStringToObject(cj_result, ezlopi_value_str, (char*)item->user_arg ? item->user_arg : "no_gas"); } if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { - s_mq7_value_t *MQ7_value = ((s_mq7_value_t *)item->user_arg); - char *valueFormatted = ezlopi_valueformatter_float(MQ7_value->_CO_ppm); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ7_value->_CO_ppm); - free(valueFormatted); + s_mq7_value_t* MQ7_value = ((s_mq7_value_t*)item->user_arg); + if (MQ7_value) + { + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ7_value->_CO_ppm); + char* valueFormatted = ezlopi_valueformatter_float(MQ7_value->_CO_ppm); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } } ret = 1; } @@ -297,26 +322,32 @@ static int __0062_get_item(l_ezlopi_item_t *item, void *arg) return ret; } -static int __0062_get_cjson_value(l_ezlopi_item_t *item, void *arg) +static int __0062_get_cjson_value(l_ezlopi_item_t* item, void* arg) { int ret = 0; if (item && arg) { - cJSON *cj_result = (cJSON *)arg; + cJSON* cj_result = (cJSON*)arg; if (cj_result) { if (ezlopi_item_name_gas_alarm == item->cloud_properties.item_name) { - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, (char *)item->user_arg ? item->user_arg : "no_gas"); - cJSON_AddStringToObject(cj_result, ezlopi_value_str, (char *)item->user_arg ? item->user_arg : "no_gas"); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, (char*)item->user_arg ? item->user_arg : "no_gas"); + cJSON_AddStringToObject(cj_result, ezlopi_value_str, (char*)item->user_arg ? item->user_arg : "no_gas"); } if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { - s_mq7_value_t *MQ7_value = ((s_mq7_value_t *)item->user_arg); - char *valueFormatted = ezlopi_valueformatter_float(MQ7_value->_CO_ppm); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ7_value->_CO_ppm); - free(valueFormatted); + s_mq7_value_t* MQ7_value = ((s_mq7_value_t*)item->user_arg); + if (MQ7_value) + { + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ7_value->_CO_ppm); + char* valueFormatted = ezlopi_valueformatter_float(MQ7_value->_CO_ppm); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } } ret = 1; } @@ -324,14 +355,14 @@ static int __0062_get_cjson_value(l_ezlopi_item_t *item, void *arg) return ret; } -static int __0062_notify(l_ezlopi_item_t *item) +static int __0062_notify(l_ezlopi_item_t* item) { int ret = 0; if (item) { if (ezlopi_item_name_gas_alarm == item->cloud_properties.item_name) { - const char *curret_value = NULL; + const char* curret_value = NULL; if (0 == gpio_get_level(item->interface.gpio.gpio_in.gpio_num)) // when D0 -> 0V, { curret_value = "combustible_gas_detected"; @@ -340,21 +371,24 @@ static int __0062_notify(l_ezlopi_item_t *item) { curret_value = "no_gas"; } - if (curret_value != (char *)item->user_arg) // calls update only if there is change in state + if (curret_value != (char*)item->user_arg) // calls update only if there is change in state { - item->user_arg = (void *)curret_value; + item->user_arg = (void*)curret_value; ezlopi_device_value_updated_from_device_v3(item); } } if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { // extract the sensor_output_values - double new_value = (double)__extract_MQ7_sensor_ppm(item); - s_mq7_value_t *MQ7_value = (s_mq7_value_t *)item->user_arg; - if (fabs((double)(MQ7_value->_CO_ppm) - new_value) > 0.0001) + s_mq7_value_t* MQ7_value = (s_mq7_value_t*)item->user_arg; + if ((MQ7_value) && (true == MQ7_value->Calibration_complete_CO)) { - MQ7_value->_CO_ppm = (float)new_value; - ezlopi_device_value_updated_from_device_v3(item); + double new_value = (double)__extract_MQ7_sensor_ppm(item); + if (fabs((double)(MQ7_value->_CO_ppm) - new_value) > 0.0001) + { + MQ7_value->_CO_ppm = (float)new_value; + ezlopi_device_value_updated_from_device_v3(item); + } } } ret = 1; @@ -362,108 +396,114 @@ static int __0062_notify(l_ezlopi_item_t *item) return ret; } //------------------------------------------------------------------------------------------------------ -static float __extract_MQ7_sensor_ppm(l_ezlopi_item_t *item) +static float __extract_MQ7_sensor_ppm(l_ezlopi_item_t* item) { uint32_t mq7_adc_pin = item->interface.adc.gpio_num; - s_mq7_value_t *MQ7_value = (s_mq7_value_t *)item->user_arg; - // calculation process - //------------------------------------------------- - s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; - // extract the mean_sensor_analog_output_voltage - float analog_sensor_volt = 0; - for (uint8_t x = 10; x > 0; x--) - { - ezlopi_adc_get_adc_data(mq7_adc_pin, &ezlopi_analog_data); + s_mq7_value_t* MQ7_value = (s_mq7_value_t*)item->user_arg; + if (MQ7_value) + { // calculation process + //------------------------------------------------- + s_ezlopi_analog_data_t ezlopi_analog_data = { .value = 0, .voltage = 0 }; + // extract the mean_sensor_analog_output_voltage + float analog_sensor_volt = 0; + for (uint8_t x = 10; x > 0; x--) + { + ezlopi_adc_get_adc_data(mq7_adc_pin, &ezlopi_analog_data); #ifdef VOLTAGE_DIVIDER_ADDED - analog_sensor_volt += ((float)(ezlopi_analog_data.voltage) * 2.0f); + analog_sensor_volt += ((float)(ezlopi_analog_data.voltage) * 2.0f); #else - analog_sensor_volt += (float)(ezlopi_analog_data.voltage); + analog_sensor_volt += (float)(ezlopi_analog_data.voltage); #endif - vTaskDelay(1); - } - analog_sensor_volt = analog_sensor_volt / 10.0f; + vTaskDelay(1); + } + analog_sensor_volt = analog_sensor_volt / 10.0f; - //----------------------------------------------------------------------------------- - // Stage_2 : [from 'sensor_0062_ADC_MQ7_methane_gas_detector.h'] + //----------------------------------------------------------------------------------- + // Stage_2 : [from 'sensor_0062_ADC_MQ7_methane_gas_detector.h'] - // 1. Calculate 'Rs_gas' for the gas detected - float Rs_gas = (((MQ7_VOLT_RESOLUTION_Vc * mq7_eqv_RL) / (analog_sensor_volt / 1000.0f)) - mq7_eqv_RL); + // 1. Calculate 'Rs_gas' for the gas detected + float Rs_gas = (((MQ7_VOLT_RESOLUTION_Vc * mq7_eqv_RL) / (analog_sensor_volt / 1000.0f)) - mq7_eqv_RL); - // 1.1 Calculate @ 'ratio' during CO presence - double _ratio = (Rs_gas / ((MQ7_value->MQ7_R0_constant <= 0) ? (1.0f) : (MQ7_value->MQ7_R0_constant))); // avoid dividing by zero?? - if (_ratio <= 0) - { - _ratio = 0; - } - //------------------------------------------------- + // 1.1 Calculate @ 'ratio' during CO presence + double _ratio = (Rs_gas / ((MQ7_value->MQ7_R0_constant <= 0) ? (1.0f) : (MQ7_value->MQ7_R0_constant))); // avoid dividing by zero?? + if (_ratio <= 0) + { + _ratio = 0; + } + //------------------------------------------------- - // 1.2 Calculate _CO_ppm - float _CO_ppm = (float)pow(10, (((float)log10(_ratio)) - b_coeff_mq7) / m_slope_mq7); // ---> _CO_ppm = 10 ^ [ ( log(ratio) - b ) / m ] - if (_CO_ppm < 0) - { - _CO_ppm = 0; // No negative values accepted or upper datasheet recomendation. - } - TRACE_E("_CO_ppm [CO] : %.2f -> ratio[RS/R0] : %.2f -> Volts : %0.2fmv", _CO_ppm, (float)_ratio, analog_sensor_volt); + // 1.2 Calculate _CO_ppm + float _CO_ppm = (float)pow(10, (((float)log10(_ratio)) - b_coeff_mq7) / m_slope_mq7); // ---> _CO_ppm = 10 ^ [ ( log(ratio) - b ) / m ] + if (_CO_ppm < 0) + { + _CO_ppm = 0; // No negative values accepted or upper datasheet recomendation. + } + TRACE_E("_CO_ppm [CO] : %.2f -> ratio[RS/R0] : %.2f -> Volts : %0.2fmv", _CO_ppm, (float)_ratio, analog_sensor_volt); - //------------------------------------------------- - return _CO_ppm; + //------------------------------------------------- + return _CO_ppm; + } + return 0; } -static void __calibrate_MQ7_R0_resistance(void *params) +static void __calibrate_MQ7_R0_resistance(void* params) { - l_ezlopi_item_t *item = (l_ezlopi_item_t *)params; + l_ezlopi_item_t* item = (l_ezlopi_item_t*)params; if (NULL != item) { - s_mq7_value_t *MQ7_value = (s_mq7_value_t *)item->user_arg; - - uint32_t mq7_adc_pin = item->interface.adc.gpio_num; - //------------------------------------------------- - // let the sensor to heat for 20seconds - for (uint8_t j = 20; j > 0; j--) + s_mq7_value_t* MQ7_value = (s_mq7_value_t*)item->user_arg; + if (MQ7_value) { - TRACE_E("Heating sensor.........time left: %d sec", j); - vTaskDelay(100); // vTaskDelay(1000 / portTICK_PERIOD_MS); // 1sec delay before calibration - } - //------------------------------------------------- - // extract the mean_sensor_analog_output_voltage - float _sensor_volt = 0; - s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; - for (uint8_t i = 100; i > 0; i--) - { - if (i % 20 == 0) + uint32_t mq7_adc_pin = item->interface.adc.gpio_num; + //------------------------------------------------- + // let the sensor to heat for 20seconds + for (uint8_t j = 20; j > 0; j--) { - TRACE_W("Please Wait..Collecting Ambient Air data ........... [Avoid Smokes/gases]"); + TRACE_E("Heating sensor.........time left: %d sec", j); + vTaskDelay(100); // vTaskDelay(1000 / portTICK_PERIOD_MS); // 1sec delay before calibration } - // extract ADC values - ezlopi_adc_get_adc_data(mq7_adc_pin, &ezlopi_analog_data); + //------------------------------------------------- + // extract the mean_sensor_analog_output_voltage + float _sensor_volt = 0; + s_ezlopi_analog_data_t ezlopi_analog_data = { .value = 0, .voltage = 0 }; + for (uint8_t i = 100; i > 0; i--) + { + if (i % 20 == 0) + { + TRACE_W("Please Wait..Collecting Ambient Air data ........... [Avoid Smokes/gases]"); + } + // extract ADC values + ezlopi_adc_get_adc_data(mq7_adc_pin, &ezlopi_analog_data); #ifdef VOLTAGE_DIVIDER_ADDED - _sensor_volt += (float)((ezlopi_analog_data.voltage) * 2.0f); // [0-2.4V] X2 + _sensor_volt += (float)((ezlopi_analog_data.voltage) * 2.0f); // [0-2.4V] X2 #else - _sensor_volt += (float)(ezlopi_analog_data->voltage); + _sensor_volt += (float)(ezlopi_analog_data->voltage); #endif - vTaskDelay(1); // 10ms - } - _sensor_volt = _sensor_volt / 100.0f; + vTaskDelay(1); // 10ms + } + _sensor_volt = _sensor_volt / 100.0f; - //------------------------------------------------- - // Calculate the 'Rs' of heater during clean air [calibration phase] - // Range -> [2Kohm - 20Kohm] - float RS_calib = 0; // Define variable for sensor resistance - RS_calib = ((MQ7_VOLT_RESOLUTION_Vc * mq7_eqv_RL) / (_sensor_volt / 1000.0f)) - mq7_eqv_RL; // Calculate RS in fresh air - TRACE_E("CALIB_TASK -> 'RS_calib' = %.2f", RS_calib); - if (RS_calib < 0) - { - RS_calib = 0; // No negative values accepted. - } - // Calculate the R0_air which is constant through-out - MQ7_value->MQ7_R0_constant = (RS_calib / RatioMQ7CleanAir); // Calculate MQ7_R0_constant - TRACE_E("CALIB_TASK -> 'MQ7_R0_constant' = %.2f", MQ7_value->MQ7_R0_constant); - if (MQ7_value->MQ7_R0_constant < 0) - { - MQ7_value->MQ7_R0_constant = 0; // No negative values accepted. + //------------------------------------------------- + // Calculate the 'Rs' of heater during clean air [calibration phase] + // Range -> [2Kohm - 20Kohm] + float RS_calib = 0; // Define variable for sensor resistance + RS_calib = ((MQ7_VOLT_RESOLUTION_Vc * mq7_eqv_RL) / (_sensor_volt / 1000.0f)) - mq7_eqv_RL; // Calculate RS in fresh air + TRACE_E("CALIB_TASK -> 'RS_calib' = %.2f", RS_calib); + if (RS_calib < 0) + { + RS_calib = 0; // No negative values accepted. + } + // Calculate the R0_air which is constant through-out + MQ7_value->MQ7_R0_constant = (RS_calib / RatioMQ7CleanAir); // Calculate MQ7_R0_constant + TRACE_E("CALIB_TASK -> 'MQ7_R0_constant' = %.2f", MQ7_value->MQ7_R0_constant); + if (MQ7_value->MQ7_R0_constant < 0) + { + MQ7_value->MQ7_R0_constant = 0; // No negative values accepted. + } + // Set calibration_complete_CO flag + MQ7_value->Calibration_complete_CO = true; } - // Set calibration_complete_CO flag - MQ7_value->Calibration_complete_CO = true; } + vTaskDelete(NULL); } \ No newline at end of file diff --git a/ezlopi-sensors-devices/sensor-0063-other-MQ9-LPG-flameable-detector/sensor_0063_other_MQ9_LPG_flameable_detector.c b/ezlopi-sensors-devices/sensor-0063-other-MQ9-LPG-flameable-detector/sensor_0063_other_MQ9_LPG_flameable_detector.c index 9e9ed6a79..27744c03c 100644 --- a/ezlopi-sensors-devices/sensor-0063-other-MQ9-LPG-flameable-detector/sensor_0063_other_MQ9_LPG_flameable_detector.c +++ b/ezlopi-sensors-devices/sensor-0063-other-MQ9-LPG-flameable-detector/sensor_0063_other_MQ9_LPG_flameable_detector.c @@ -73,11 +73,7 @@ int sensor_0063_other_MQ9_LPG_flameable_detector(e_ezlopi_actions_t action, l_ez } case EZLOPI_ACTION_NOTIFY_1000_MS: { - s_mq9_value_t *MQ9_value = (s_mq9_value_t *)item->user_arg; - if (true == MQ9_value->Calibration_complete_LPG_flameable) - { - __0063_notify(item); - } + __0063_notify(item); break; } default: @@ -152,37 +148,65 @@ static int __0063_init(l_ezlopi_item_t *item) int ret = 0; if (NULL != item) { - if ((ezlopi_item_name_gas_alarm == item->cloud_properties.item_name) && GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) + if (ezlopi_item_name_gas_alarm == item->cloud_properties.item_name) { - // intialize digital_pin - gpio_config_t input_conf = {}; - input_conf.pin_bit_mask = (1ULL << (item->interface.gpio.gpio_in.gpio_num)); - input_conf.intr_type = GPIO_INTR_DISABLE; - input_conf.mode = GPIO_MODE_INPUT; - input_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; - input_conf.pull_up_en = GPIO_PULLUP_ENABLE; - gpio_config(&input_conf); - ret = 1; + if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num)) + { + // intialize digital_pin + gpio_config_t input_conf = {}; + input_conf.pin_bit_mask = (1ULL << (item->interface.gpio.gpio_in.gpio_num)); + input_conf.intr_type = GPIO_INTR_DISABLE; + input_conf.mode = GPIO_MODE_INPUT; + input_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; + input_conf.pull_up_en = GPIO_PULLUP_ENABLE; + ret = (0 == gpio_config(&input_conf)) ? 1 : -1; + } + else + { + ret = -1; + TRACE_E("Deleting Item!!"); + ezlopi_device_free_device_by_item(item); // remove the item itself + } } - if ((ezlopi_item_name_smoke_density == item->cloud_properties.item_name) && GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + else if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { - // initialize analog_pin - ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit); - // calibrate if not done s_mq9_value_t *MQ9_value = (s_mq9_value_t *)item->user_arg; - if (false == MQ9_value->Calibration_complete_LPG_flameable) + if (MQ9_value) { - xTaskCreate(__calibrate_MQ9_R0_resistance, "Task_to_calculate_R0_air", 2048, item, 1, NULL); + if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) + { // initialize analog_pin + if (0 == ezlopi_adc_init(item->interface.adc.gpio_num, item->interface.adc.resln_bit)) + { + // calibrate if not done + if (false == MQ9_value->Calibration_complete_LPG_flameable) + { + xTaskCreate(__calibrate_MQ9_R0_resistance, "Task_to_calculate_R0_air", 2048, item, 1, NULL); + } + ret = 1; + } + else + { + ret = -1; + TRACE_E("Deleting Item!!"); + free(item->user_arg); + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); // remove the item itself + } + } + else + { + ret = -1; + TRACE_E("Deleting Item!!"); + free(item->user_arg); + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); // remove the item itself + } } - ret = 1; - } - if (0 == ret) - { - ret = -1; - if (item->user_arg) + else { - free(item->user_arg); - item->user_arg = NULL; + ret = -1; + TRACE_E("Deleting Item!!"); + ezlopi_device_free_device_by_item(item); // remove the item itself; } } } @@ -285,13 +309,19 @@ static int __0063_get_item(l_ezlopi_item_t *item, void *arg) cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, (char *)item->user_arg ? item->user_arg : "no_gas"); cJSON_AddStringToObject(cj_result, ezlopi_value_str, (char *)item->user_arg ? item->user_arg : "no_gas"); } - if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) + else if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { s_mq9_value_t *MQ9_value = ((s_mq9_value_t *)item->user_arg); - char *valueFormatted = ezlopi_valueformatter_float(MQ9_value->_LPG_flameable_ppm); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ9_value->_LPG_flameable_ppm); - free(valueFormatted); + if (MQ9_value) + { + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ9_value->_LPG_flameable_ppm); + char *valueFormatted = ezlopi_valueformatter_float(MQ9_value->_LPG_flameable_ppm); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } } ret = 1; } @@ -312,13 +342,19 @@ static int __0063_get_cjson_value(l_ezlopi_item_t *item, void *arg) cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, (char *)item->user_arg ? item->user_arg : "no_gas"); cJSON_AddStringToObject(cj_result, ezlopi_value_str, (char *)item->user_arg ? item->user_arg : "no_gas"); } - if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) + else if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { s_mq9_value_t *MQ9_value = ((s_mq9_value_t *)item->user_arg); - char *valueFormatted = ezlopi_valueformatter_float(MQ9_value->_LPG_flameable_ppm); - cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); - cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ9_value->_LPG_flameable_ppm); - free(valueFormatted); + if (MQ9_value) + { + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, MQ9_value->_LPG_flameable_ppm); + char *valueFormatted = ezlopi_valueformatter_float(MQ9_value->_LPG_flameable_ppm); + if (valueFormatted) + { + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + free(valueFormatted); + } + } } ret = 1; } @@ -349,15 +385,18 @@ static int __0063_notify(l_ezlopi_item_t *item) ezlopi_device_value_updated_from_device_v3(item); } } - if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) + else if (ezlopi_item_name_smoke_density == item->cloud_properties.item_name) { // extract the sensor_output_values - double new_value = (double)__extract_MQ9_sensor_ppm(item); s_mq9_value_t *MQ9_value = (s_mq9_value_t *)item->user_arg; - if (fabs((double)(MQ9_value->_LPG_flameable_ppm) - new_value) > 0.0001) + if ((MQ9_value) && (true == MQ9_value->Calibration_complete_LPG_flameable)) { - MQ9_value->_LPG_flameable_ppm = (float)new_value; - ezlopi_device_value_updated_from_device_v3(item); + double new_value = (double)__extract_MQ9_sensor_ppm(item); + if (fabs((double)(MQ9_value->_LPG_flameable_ppm) - new_value) > 0.0001) + { + MQ9_value->_LPG_flameable_ppm = (float)new_value; + ezlopi_device_value_updated_from_device_v3(item); + } } } ret = 1; @@ -367,49 +406,52 @@ static int __0063_notify(l_ezlopi_item_t *item) //------------------------------------------------------------------------------------------------------ static float __extract_MQ9_sensor_ppm(l_ezlopi_item_t *item) { - uint32_t mq9_adc_pin = item->interface.adc.gpio_num; s_mq9_value_t *MQ9_value = (s_mq9_value_t *)item->user_arg; - // calculation process - //------------------------------------------------- - s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; - // extract the mean_sensor_analog_output_voltage - float analog_sensor_volt = 0; - for (uint8_t x = 10; x > 0; x--) - { - ezlopi_adc_get_adc_data(mq9_adc_pin, &ezlopi_analog_data); + if (MQ9_value) + { // calculation process + //------------------------------------------------- + uint32_t mq9_adc_pin = item->interface.adc.gpio_num; + s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; + // extract the mean_sensor_analog_output_voltage + float analog_sensor_volt = 0; + for (uint8_t x = 10; x > 0; x--) + { + ezlopi_adc_get_adc_data(mq9_adc_pin, &ezlopi_analog_data); #ifdef VOLTAGE_DIVIDER_ADDED - analog_sensor_volt += ((float)(ezlopi_analog_data.voltage) * 2.0f); + analog_sensor_volt += ((float)(ezlopi_analog_data.voltage) * 2.0f); #else - analog_sensor_volt += (float)(ezlopi_analog_data.voltage); + analog_sensor_volt += (float)(ezlopi_analog_data.voltage); #endif - vTaskDelay(1); - } - analog_sensor_volt = analog_sensor_volt / 10.0f; + vTaskDelay(1); + } + analog_sensor_volt = analog_sensor_volt / 10.0f; - //----------------------------------------------------------------------------------- - // Stage_2 : [from 'sensor_0063_ADC_MQ9_methane_gas_detector.h'] + //----------------------------------------------------------------------------------- + // Stage_2 : [from 'sensor_0063_ADC_MQ9_methane_gas_detector.h'] - // 1. Calculate 'Rs_gas' for the gas detected - float Rs_gas = (((MQ9_VOLT_RESOLUTION_Vc * mq9_eqv_RL) / (analog_sensor_volt / 1000.0f)) - mq9_eqv_RL); + // 1. Calculate 'Rs_gas' for the gas detected + float Rs_gas = (((MQ9_VOLT_RESOLUTION_Vc * mq9_eqv_RL) / (analog_sensor_volt / 1000.0f)) - mq9_eqv_RL); - // 1.1 Calculate @ 'ratio' during LPG_flameable presence - double _ratio = (Rs_gas / ((MQ9_value->MQ9_R0_constant <= 0) ? (1.0f) : (MQ9_value->MQ9_R0_constant))); // avoid dividing by zero?? - if (_ratio <= 0) - { - _ratio = 0; - } - //------------------------------------------------- + // 1.1 Calculate @ 'ratio' during LPG_flameable presence + double _ratio = (Rs_gas / ((MQ9_value->MQ9_R0_constant <= 0) ? (1.0f) : (MQ9_value->MQ9_R0_constant))); // avoid dividing by zero?? + if (_ratio <= 0) + { + _ratio = 0; + } + //------------------------------------------------- - // 1.2 Calculate _LPG_flameable_ppm - float _LPG_flameable_ppm = (float)pow(10, (((float)log10(_ratio)) - b_coeff_mq9) / m_slope_mq9); // ---> _LPG_flameable_ppm = 10 ^ [ ( log(ratio) - b ) / m ] - if (_LPG_flameable_ppm < 0) - { - _LPG_flameable_ppm = 0; // No negative values accepted or upper datasheet recomendation. - } - TRACE_E("_LPG_flameable_ppm [LPG_flameable] : %.2f -> ratio[RS/R0] : %.2f -> Volts : %0.2fmv", _LPG_flameable_ppm, (float)_ratio, analog_sensor_volt); + // 1.2 Calculate _LPG_flameable_ppm + float _LPG_flameable_ppm = (float)pow(10, (((float)log10(_ratio)) - b_coeff_mq9) / m_slope_mq9); // ---> _LPG_flameable_ppm = 10 ^ [ ( log(ratio) - b ) / m ] + if (_LPG_flameable_ppm < 0) + { + _LPG_flameable_ppm = 0; // No negative values accepted or upper datasheet recomendation. + } + TRACE_E("_LPG_flameable_ppm [LPG_flameable] : %.2f -> ratio[RS/R0] : %.2f -> Volts : %0.2fmv", _LPG_flameable_ppm, (float)_ratio, analog_sensor_volt); - //------------------------------------------------- - return _LPG_flameable_ppm; + //------------------------------------------------- + return _LPG_flameable_ppm; + } + return 0; } static void __calibrate_MQ9_R0_resistance(void *params) @@ -418,55 +460,57 @@ static void __calibrate_MQ9_R0_resistance(void *params) if (NULL != item) { s_mq9_value_t *MQ9_value = (s_mq9_value_t *)item->user_arg; - - uint32_t mq9_adc_pin = item->interface.adc.gpio_num; - //------------------------------------------------- - // let the sensor to heat for 20seconds - for (uint8_t j = 20; j > 0; j--) + if (MQ9_value) { - TRACE_E("Heating sensor.........time left: %d sec", j); - vTaskDelay(100); // vTaskDelay(1000 / portTICK_PERIOD_MS); // 1sec delay before calibration - } - //------------------------------------------------- - // extract the mean_sensor_analog_output_voltage - float _sensor_volt = 0; - s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; - for (uint8_t i = 100; i > 0; i--) - { - if (i % 20 == 0) + uint32_t mq9_adc_pin = item->interface.adc.gpio_num; + //------------------------------------------------- + // let the sensor to heat for 20seconds + for (uint8_t j = 20; j > 0; j--) { - TRACE_W("Please Wait..Collecting Ambient Air data ........... [Avoid Smokes/gases]"); + TRACE_E("Heating sensor.........time left: %d sec", j); + vTaskDelay(100); // vTaskDelay(1000 / portTICK_PERIOD_MS); // 1sec delay before calibration } - // extract ADC values - ezlopi_adc_get_adc_data(mq9_adc_pin, &ezlopi_analog_data); + //------------------------------------------------- + // extract the mean_sensor_analog_output_voltage + float _sensor_volt = 0; + s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; + for (uint8_t i = 100; i > 0; i--) + { + if (i % 20 == 0) + { + TRACE_W("Please Wait..Collecting Ambient Air data ........... [Avoid Smokes/gases]"); + } + // extract ADC values + ezlopi_adc_get_adc_data(mq9_adc_pin, &ezlopi_analog_data); #ifdef VOLTAGE_DIVIDER_ADDED - _sensor_volt += (float)((ezlopi_analog_data.voltage) * 2.0f); // [0-2.4V] X2 + _sensor_volt += (float)((ezlopi_analog_data.voltage) * 2.0f); // [0-2.4V] X2 #else - _sensor_volt += (float)(ezlopi_analog_data->voltage); + _sensor_volt += (float)(ezlopi_analog_data->voltage); #endif - vTaskDelay(1); // 10ms - } - _sensor_volt = _sensor_volt / 100.0f; + vTaskDelay(1); // 10ms + } + _sensor_volt = _sensor_volt / 100.0f; - //------------------------------------------------- - // Calculate the 'Rs' of heater during clean air [calibration phase] - // Range -> [2Kohm - 20Kohm] - float RS_calib = 0; // Define variable for sensor resistance - RS_calib = ((MQ9_VOLT_RESOLUTION_Vc * mq9_eqv_RL) / (_sensor_volt / 1000.0f)) - mq9_eqv_RL; // Calculate RS in fresh air - TRACE_E("CALIB_TASK -> 'RS_calib' = %.2f", RS_calib); - if (RS_calib < 0) - { - RS_calib = 0; // No negative values accepted. - } - // Calculate the R0_air which is constant through-out - MQ9_value->MQ9_R0_constant = (RS_calib / RatioMQ9CleanAir); // Calculate MQ9_R0_constant - TRACE_E("CALIB_TASK -> 'MQ9_R0_constant' = %.2f", MQ9_value->MQ9_R0_constant); - if (MQ9_value->MQ9_R0_constant < 0) - { - MQ9_value->MQ9_R0_constant = 0; // No negative values accepted. + //------------------------------------------------- + // Calculate the 'Rs' of heater during clean air [calibration phase] + // Range -> [2Kohm - 20Kohm] + float RS_calib = 0; // Define variable for sensor resistance + RS_calib = ((MQ9_VOLT_RESOLUTION_Vc * mq9_eqv_RL) / (_sensor_volt / 1000.0f)) - mq9_eqv_RL; // Calculate RS in fresh air + TRACE_E("CALIB_TASK -> 'RS_calib' = %.2f", RS_calib); + if (RS_calib < 0) + { + RS_calib = 0; // No negative values accepted. + } + // Calculate the R0_air which is constant through-out + MQ9_value->MQ9_R0_constant = (RS_calib / RatioMQ9CleanAir); // Calculate MQ9_R0_constant + TRACE_E("CALIB_TASK -> 'MQ9_R0_constant' = %.2f", MQ9_value->MQ9_R0_constant); + if (MQ9_value->MQ9_R0_constant < 0) + { + MQ9_value->MQ9_R0_constant = 0; // No negative values accepted. + } + // Set calibration_complete_LPG_flameable flag + MQ9_value->Calibration_complete_LPG_flameable = true; } - // Set calibration_complete_LPG_flameable flag - MQ9_value->Calibration_complete_LPG_flameable = true; } vTaskDelete(NULL); } \ No newline at end of file diff --git a/ezlopi-sensors-devices/sensor-0065-digitalIn-float-switch/sensor_0065_digitalIn_float_switch.c b/ezlopi-sensors-devices/sensor-0065-digitalIn-float-switch/sensor_0065_digitalIn_float_switch.c index 0f36241c0..25cec22ad 100644 --- a/ezlopi-sensors-devices/sensor-0065-digitalIn-float-switch/sensor_0065_digitalIn_float_switch.c +++ b/ezlopi-sensors-devices/sensor-0065-digitalIn-float-switch/sensor_0065_digitalIn_float_switch.c @@ -161,17 +161,14 @@ static int __0065_init(l_ezlopi_item_t *item) else { ret = -1; + ezlopi_device_free_device_by_item(item); TRACE_E("Error initializing float switch"); } } - if (0 == ret) + else { ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } return ret; diff --git a/ezlopi-sensors-devices/sensor-0066-other-R307-FingerPrint/sensor_0066_other_R307_FingerPrint.c b/ezlopi-sensors-devices/sensor-0066-other-R307-FingerPrint/sensor_0066_other_R307_FingerPrint.c index 41f34b114..2a21d92e4 100644 --- a/ezlopi-sensors-devices/sensor-0066-other-R307-FingerPrint/sensor_0066_other_R307_FingerPrint.c +++ b/ezlopi-sensors-devices/sensor-0066-other-R307-FingerPrint/sensor_0066_other_R307_FingerPrint.c @@ -52,25 +52,28 @@ static void __timer_callback(void *param) if (item) { server_packet_t *user_data = (server_packet_t *)item->user_arg; - time_t now = 0; - time(&now); - if ((now - (user_data->timeout_start_time)) <= (time_t)30) // 30 sec + if (user_data) { - TRACE_W("...timer ON..."); - if (user_data->opmode != FINGERPRINT_ENROLLMENT_MODE) + time_t now = 0; + time(&now); + if ((now - (user_data->timeout_start_time)) <= (time_t)30) // 30 sec { - TRACE_E("...timer OFF..."); + TRACE_W("...timer ON..."); + if (user_data->opmode != FINGERPRINT_ENROLLMENT_MODE) + { + TRACE_E("...timer OFF..."); + user_data->opmode = FINGERPRINT_MATCH_MODE; + esp_timer_stop(user_data->timerHandler); + } + } + else + { + TRACE_S("...timer OFF..."); user_data->opmode = FINGERPRINT_MATCH_MODE; + ezlopi_device_value_updated_from_device_item_id_v3(user_data->sensor_fp_item_ids[SENSOR_FP_ITEM_ID_ENROLL]); esp_timer_stop(user_data->timerHandler); } } - else - { - TRACE_S("...timer OFF..."); - user_data->opmode = FINGERPRINT_MATCH_MODE; - ezlopi_device_value_updated_from_device_item_id_v3(user_data->sensor_fp_item_ids[SENSOR_FP_ITEM_ID_ENROLL]); - esp_timer_stop(user_data->timerHandler); - } } } @@ -101,7 +104,7 @@ int sensor_0066_other_R307_FingerPrint(e_ezlopi_actions_t action, l_ezlopi_item_ if (item) { server_packet_t *user_data = (server_packet_t *)item->user_arg; - if (false == user_data->notify_flag) + if ((user_data) && (false == user_data->notify_flag)) { user_data->notify_flag = true; ret = __0066_get_value_cjson(item, arg); @@ -114,7 +117,9 @@ int sensor_0066_other_R307_FingerPrint(e_ezlopi_actions_t action, l_ezlopi_item_ if (item) { server_packet_t *user_data = (server_packet_t *)item->user_arg; - if (((false == user_data->notify_flag)) && (user_data->sensor_fp_item_ids[SENSOR_FP_ITEM_ID_ENROLL] == item->cloud_properties.item_id)) // enroll + if ((user_data) && + (false == user_data->notify_flag) && + (user_data->sensor_fp_item_ids[SENSOR_FP_ITEM_ID_ENROLL] == item->cloud_properties.item_id)) // enroll { user_data->notify_flag = true; } @@ -263,78 +268,83 @@ static int __0066_prepare(void *arg) static int __0066_init(l_ezlopi_item_t *item) { int ret = 0; - if (NULL != item) + if ((NULL != item)) { server_packet_t *user_data = (server_packet_t *)item->user_arg; - if ((true == (item->interface.uart.enable)) && GPIO_IS_VALID_GPIO((gpio_num_t)user_data->intr_pin) && GPIO_IS_VALID_GPIO((gpio_num_t)item->interface.uart.tx) && GPIO_IS_VALID_GPIO((gpio_num_t)item->interface.uart.rx)) + if (user_data) { - gpio_num_t intr_pin = user_data->intr_pin; - // #warning "Riken needs to fix this warning, compile and check about the warning details !" - s_ezlopi_uart_object_handle_t ezlopi_uart_object_handle = ezlopi_uart_init(item->interface.uart.baudrate, item->interface.uart.tx, item->interface.uart.rx, __uart_0066_fingerprint_upcall, item); - item->interface.uart.channel = ezlopi_uart_get_channel(ezlopi_uart_object_handle); - - const gpio_config_t FingerPrint_intr_gpio_config = { - .pin_bit_mask = (1ULL << (intr_pin)), - .intr_type = GPIO_INTR_NEGEDGE, - .mode = GPIO_MODE_INPUT, - .pull_up_en = GPIO_PULLUP_DISABLE, - .pull_down_en = GPIO_PULLDOWN_DISABLE, - }; - - if (0 == gpio_config(&FingerPrint_intr_gpio_config)) + if (GPIO_IS_VALID_GPIO((gpio_num_t)user_data->intr_pin) && GPIO_IS_VALID_GPIO((gpio_num_t)item->interface.uart.tx) && GPIO_IS_VALID_GPIO((gpio_num_t)item->interface.uart.rx)) { - if (FINGERPRINT_OK == r307_as606_fingerprint_config(item)) + if (true == item->interface.uart.enable) { - if (0 == gpio_isr_handler_add(intr_pin, gpio_notify_isr, item)) + gpio_num_t intr_pin = user_data->intr_pin; + // #warning "Riken needs to fix this warning, compile and check about the warning details !" + s_ezlopi_uart_object_handle_t ezlopi_uart_object_handle = ezlopi_uart_init(item->interface.uart.baudrate, item->interface.uart.tx, item->interface.uart.rx, __uart_0066_fingerprint_upcall, item); + item->interface.uart.channel = ezlopi_uart_get_channel(ezlopi_uart_object_handle); + + const gpio_config_t FingerPrint_intr_gpio_config = { + .pin_bit_mask = (1ULL << (intr_pin)), + .intr_type = GPIO_INTR_NEGEDGE, + .mode = GPIO_MODE_INPUT, + .pull_up_en = GPIO_PULLUP_DISABLE, + .pull_down_en = GPIO_PULLDOWN_DISABLE, + }; + ret = 1; + if (0 == gpio_config(&FingerPrint_intr_gpio_config)) { - if (NULL == (user_data->notifyHandler)) + if (FINGERPRINT_OK == r307_as606_fingerprint_config(item)) { - TRACE_S(" ---->>> Creating Fingerprint_activation Task <<<----"); - xTaskCreate(__fingerprint_operation_task, "Fingerprint_activation", 2048 * 2, item, 1, &(user_data->notifyHandler)); - } + if (0 == gpio_isr_handler_add(intr_pin, gpio_notify_isr, item)) + { + if (NULL == (user_data->notifyHandler)) + { + TRACE_I(" ---->>> Creating Fingerprint_activation Task <<<----"); + xTaskCreate(__fingerprint_operation_task, "Fingerprint_activation", 2048 * 2, item, 1, &(user_data->notifyHandler)); + } - const esp_timer_create_args_t esp_timer_create_args = { - .callback = __timer_callback, - .arg = (void *)item, - .name = "Enrollment timer"}; - if (0 == esp_timer_create(&esp_timer_create_args, &(user_data->timerHandler))) + const esp_timer_create_args_t esp_timer_create_args = { + .callback = __timer_callback, + .arg = (void *)item, + .name = "Enrollment timer"}; + if (0 == esp_timer_create(&esp_timer_create_args, &(user_data->timerHandler))) + { + TRACE_I(" ---->>> Creating Enrollment Timer <<<----"); + } + } + else + { + ret = -1; + gpio_isr_handler_remove(intr_pin); + TRACE_E("Error!! : Failed to add GPIO ISR handler."); + } + } + else { - TRACE_S(" ---->>> Creating Enrollment Timer <<<----"); + ret = -1; + TRACE_E("Need to Reconfigure : Fingerprint sensor ..... Please, Reset ESP32."); } - ret = 1; } else { ret = -1; - TRACE_E("Error!! : Failed to add GPIO ISR handler."); - gpio_isr_handler_remove(intr_pin); + free(item->user_arg); // this will free ; memory address linked to all items + item->user_arg = NULL; + TRACE_E("Error!! : Problem is 'GPIO_intr_pin' Config......"); } } - else - { - ret = -1; - TRACE_E("Need to Reconfigure : Fingerprint sensor ..... Please, Reset ESP32."); - } } else { ret = -1; - TRACE_E("Error!! : Problem is 'GPIO_intr_pin' Config......"); + free(item->user_arg); // this will free ; memory address linked to all items + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); } } else { ret = -1; - } - - if (0 == ret) - { - ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } return ret; @@ -347,34 +357,34 @@ static int __0066_get_value_cjson(l_ezlopi_item_t *item, void *arg) if (cj_result && item) { server_packet_t *user_data = (server_packet_t *)item->user_arg; - if (user_data->notify_flag) + if ((user_data) && (user_data->notify_flag)) { if (user_data->sensor_fp_item_ids[SENSOR_FP_ITEM_ID_ACTION] == item->cloud_properties.item_id) // match { cJSON *cj_value = cJSON_CreateObject(); cJSON_AddNumberToObject(cj_value, "id", user_data->matched_id); cJSON_AddNumberToObject(cj_value, "confidence_level", user_data->matched_confidence_level); - cJSON_AddItemToObject(cj_result, "value", cj_value); - cJSON_AddStringToObject(cj_result, "valueFormatted", ""); + cJSON_AddItemToObject(cj_result, ezlopi_value_str, cj_value); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, ""); } if (user_data->sensor_fp_item_ids[SENSOR_FP_ITEM_ID_ENROLL] == item->cloud_properties.item_id) // enroll { TRACE_E("(get_cjson) op_mode : %d", user_data->opmode); if (user_data->opmode != FINGERPRINT_ENROLLMENT_MODE) { - cJSON_AddFalseToObject(cj_result, "value"); - cJSON_AddStringToObject(cj_result, "valueFormatted", "false"); + cJSON_AddFalseToObject(cj_result, ezlopi_value_str); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, "false"); } else { - cJSON_AddTrueToObject(cj_result, "value"); - cJSON_AddStringToObject(cj_result, "valueFormatted", "true"); + cJSON_AddTrueToObject(cj_result, ezlopi_value_str); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, "true"); } } if (user_data->sensor_fp_item_ids[SENSOR_FP_ITEM_ID_FP_IDS] == item->cloud_properties.item_id) // erase or list { cJSON_AddStringToObject(cj_result, "elementType", "int"); - cJSON *cj_value_array = cJSON_AddArrayToObject(cj_result, "value"); + cJSON *cj_value_array = cJSON_AddArrayToObject(cj_result, ezlopi_value_str); for (int idx = 1; idx <= FINGERPRINT_MAX_CAPACITY_LIMIT; idx++) { @@ -383,7 +393,7 @@ static int __0066_get_value_cjson(l_ezlopi_item_t *item, void *arg) cJSON_AddItemToArray(cj_value_array, cJSON_CreateNumber(idx)); } } - cJSON_AddStringToObject(cj_result, "valueFormatted", ""); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, ""); } user_data->notify_flag = false; } @@ -399,68 +409,71 @@ static int __0066_set_value(l_ezlopi_item_t *item, void *arg) if ((NULL != cjson_params) && (NULL != item)) { server_packet_t *user_data = (server_packet_t *)item->user_arg; - if (user_data->sensor_fp_item_ids[SENSOR_FP_ITEM_ID_ENROLL] == item->cloud_properties.item_id) // Set conditon trigger enroll mode + if (user_data) { - cJSON *cj_value_cmd = cJSON_GetObjectItem(cjson_params, "value"); - if (cj_value_cmd) + if (user_data->sensor_fp_item_ids[SENSOR_FP_ITEM_ID_ENROLL] == item->cloud_properties.item_id) // Set conditon trigger enroll mode { - TRACE_E("HERE!! enroll"); - if (cJSON_IsTrue(cj_value_cmd)) // true conditon + cJSON *cj_value_cmd = cJSON_GetObjectItem(cjson_params, ezlopi_value_str); + if (cj_value_cmd) { - time(&user_data->timeout_start_time); // !< reset the internal timer_start_time - user_data->opmode = FINGERPRINT_ENROLLMENT_MODE; - - /* Start the timers */ - esp_err_t _tm_state = esp_timer_start_periodic(user_data->timerHandler, 1000000); - if (0 != _tm_state) // ESP_ERR_INVALID_STATE + TRACE_E("HERE!! enroll"); + if (cJSON_IsTrue(cj_value_cmd)) // true conditon { - TRACE_W("Restarting timer..."); - esp_timer_stop(user_data->timerHandler); - esp_timer_start_periodic(user_data->timerHandler, 1000000); + time(&user_data->timeout_start_time); // !< reset the internal timer_start_time + user_data->opmode = FINGERPRINT_ENROLLMENT_MODE; + + /* Start the timers */ + esp_err_t _tm_state = esp_timer_start_periodic(user_data->timerHandler, 1000000); + if (0 != _tm_state) // ESP_ERR_INVALID_STATE + { + TRACE_W("Restarting timer..."); + esp_timer_stop(user_data->timerHandler); + esp_timer_start_periodic(user_data->timerHandler, 1000000); + } + else + { + TRACE_W("Starting timer..."); + } } else { - TRACE_W("Starting timer..."); + user_data->opmode = FINGERPRINT_MATCH_MODE; } } - else - { - user_data->opmode = FINGERPRINT_MATCH_MODE; - } } - } - else if (user_data->sensor_fp_item_ids[SENSOR_FP_ITEM_ID_FP_IDS] == item->cloud_properties.item_id) // Set condition erase IDs - { - cJSON *cj_value_ids = cJSON_GetObjectItem(cjson_params, "value"); - if ((cj_value_ids != NULL) && cJSON_IsArray(cj_value_ids)) + else if (user_data->sensor_fp_item_ids[SENSOR_FP_ITEM_ID_FP_IDS] == item->cloud_properties.item_id) // Set condition erase IDs { - time(&user_data->timeout_start_time); // !< reset the internal timer_start_time - uint16_t value_array_size = cJSON_GetArraySize(cj_value_ids); - if (value_array_size > 0) + cJSON *cj_value_ids = cJSON_GetObjectItem(cjson_params, ezlopi_value_str); + if ((cj_value_ids != NULL) && cJSON_IsArray(cj_value_ids)) { - TRACE_W("HERE!! erase specific"); - for (uint16_t i = 0; i < value_array_size; i++) // eg. first protect => [2,4,5] + time(&user_data->timeout_start_time); // !< reset the internal timer_start_time + uint16_t value_array_size = cJSON_GetArraySize(cj_value_ids); + if (value_array_size > 0) { - cJSON *fp_id = cJSON_GetArrayItem(cj_value_ids, i); - TRACE_S("Protected ID:[#%d]", (fp_id->valueint)); - user_data->protect[fp_id->valueint] = true; // eg. protect this ID -> 2/4/5 - } + TRACE_W("HERE!! erase specific"); + for (uint16_t i = 0; i < value_array_size; i++) // eg. first protect => [2,4,5] + { + cJSON *fp_id = cJSON_GetArrayItem(cj_value_ids, i); + TRACE_S("Protected ID:[#%d]", (fp_id->valueint)); + user_data->protect[fp_id->valueint] = true; // eg. protect this ID -> 2/4/5 + } - user_data->opmode = FINGERPRINT_ERASE_WITH_IDS_MODE; - if (false == (user_data->__busy_guard)) - { - user_data->__busy_guard = true; - xTaskNotifyGive(user_data->notifyHandler); // activate the task + user_data->opmode = FINGERPRINT_ERASE_WITH_IDS_MODE; + if (false == (user_data->__busy_guard)) + { + user_data->__busy_guard = true; + xTaskNotifyGive(user_data->notifyHandler); // activate the task + } } - } - else - { - TRACE_W("HERE!! erase all"); - user_data->opmode = FINGERPRINT_ERASE_ALL_MODE; - if (false == (user_data->__busy_guard)) + else { - user_data->__busy_guard = true; - xTaskNotifyGive(user_data->notifyHandler); // activate the task + TRACE_W("HERE!! erase all"); + user_data->opmode = FINGERPRINT_ERASE_ALL_MODE; + if (false == (user_data->__busy_guard)) + { + user_data->__busy_guard = true; + xTaskNotifyGive(user_data->notifyHandler); // activate the task + } } } } @@ -476,7 +489,6 @@ static void __uart_0066_fingerprint_upcall(uint8_t *buffer, uint32_t output_len, if (NULL != temp_buf) { memset(temp_buf, 0, 256); - if ((NULL != buffer) && (output_len) && (uart_object_handle->arg)) { memcpy(temp_buf, buffer, 256); @@ -484,85 +496,87 @@ static void __uart_0066_fingerprint_upcall(uint8_t *buffer, uint32_t output_len, l_ezlopi_item_t *item = (l_ezlopi_item_t *)uart_object_handle->arg; server_packet_t *user_data = (server_packet_t *)item->user_arg; - - uint16_t package_len = 0; - uint8_t another_buffer[MAX_PACKET_LENGTH_VAL] = {0}; - memcpy(another_buffer, temp_buf, MAX_PACKET_LENGTH_VAL); - // Programmed only for ACK_operation [0x07h] with 256byte results. - if (another_buffer[6] == FINGERPRINT_PID_ACKPACKET) + if (user_data) { - // Check the Header+Addr bytes and Then copy PID,package_len,confirmation_code and checksum to -> recieved_packet buffer - uint8_t idx = 0; - bool __err_message = false; - - while ((!__err_message) && (idx < 9)) + uint16_t package_len = 0; + uint8_t another_buffer[MAX_PACKET_LENGTH_VAL] = {0}; + memcpy(another_buffer, temp_buf, MAX_PACKET_LENGTH_VAL); + // Programmed only for ACK_operation [0x07h] with 256byte results. + if (another_buffer[6] == FINGERPRINT_PID_ACKPACKET) { - switch (idx) - { - case 0: // header -> ACK = 0xEFh + // Check the Header+Addr bytes and Then copy PID,package_len,confirmation_code and checksum to -> recieved_packet buffer + uint8_t idx = 0; + bool __err_message = false; + + while ((!__err_message) && (idx < 9)) { - if (FINGERPRINT_HEADER_MSB != (another_buffer[idx])) + switch (idx) { - TRACE_E("Header code mismatch...."); - __err_message = true; - } + case 0: // header -> ACK = 0xEFh + { + if (FINGERPRINT_HEADER_MSB != (another_buffer[idx])) + { + TRACE_E("Header code mismatch...."); + __err_message = true; + } - break; - } - case 1: // header -> ACK = 0x01h - { - if (FINGERPRINT_HEADER_LSB != (another_buffer[idx])) + break; + } + case 1: // header -> ACK = 0x01h { - TRACE_E("Header code mismatch...."); - __err_message = true; + if (FINGERPRINT_HEADER_LSB != (another_buffer[idx])) + { + TRACE_E("Header code mismatch...."); + __err_message = true; + } + break; } - break; - } - case 2: - case 3: - case 4: - case 5: // Address -> ACK = 0xFFh - { - if (FINGERPRINT_DEVICE_ADDR_BIT != (another_buffer[idx])) + case 2: + case 3: + case 4: + case 5: // Address -> ACK = 0xFFh { - TRACE_E("DEV_ADDR code mismatch...."); - __err_message = true; + if (FINGERPRINT_DEVICE_ADDR_BIT != (another_buffer[idx])) + { + TRACE_E("DEV_ADDR code mismatch...."); + __err_message = true; + } + break; } - break; - } - case 6: // PID -> ACK = 0x07h - { - if (FINGERPRINT_PID_ACKPACKET != (another_buffer[idx])) + case 6: // PID -> ACK = 0x07h + { + if (FINGERPRINT_PID_ACKPACKET != (another_buffer[idx])) + { + TRACE_E("ACK code mismatch...."); + __err_message = true; + } + break; + } + case 7: // P_len -> ACK = 0x__h [MSB] + { + package_len = (uint16_t)(another_buffer[idx]); + break; + } + case 8: // P_len -> ACK = 0x__h [LSB] { - TRACE_E("ACK code mismatch...."); - __err_message = true; + package_len = (package_len << 8) + (uint16_t)(another_buffer[idx] & 0xFF); + break; + } + default: + break; } - break; + idx++; } - case 7: // P_len -> ACK = 0x__h [MSB] + + if (!__err_message) { - package_len = (uint16_t)(another_buffer[idx]); - break; + size_t _copy_size = (3 + (int)package_len); + memcpy((user_data->recieved_buffer), (another_buffer + 6), (_copy_size < MAX_PACKET_LENGTH_VAL) ? (_copy_size) : (MAX_PACKET_LENGTH_VAL)); // pid + p_len + confirmation + checksum } - case 8: // P_len -> ACK = 0x__h [LSB] + else { - package_len = (package_len << 8) + (uint16_t)(another_buffer[idx] & 0xFF); - break; - } - default: - break; + memset((user_data->recieved_buffer), 0, sizeof(user_data->recieved_buffer)); } - idx++; - } - - if (!__err_message) - { - size_t _copy_size = (3 + (int)package_len); - memcpy((user_data->recieved_buffer), (another_buffer + 6), (_copy_size < MAX_PACKET_LENGTH_VAL) ? (_copy_size) : (MAX_PACKET_LENGTH_VAL)); // pid + p_len + confirmation + checksum - } - else - { - memset((user_data->recieved_buffer), 0, sizeof(user_data->recieved_buffer)); } } } @@ -576,150 +590,153 @@ static void __fingerprint_operation_task(void *params) if (NULL != item) { server_packet_t *user_data = (server_packet_t *)item->user_arg; - time(&user_data->timeout_start_time); // !< reset the internal timer_start_time - r307_as606_update_id_status_list(item); // !< The best place to update ID_status_list - for (;;) + if (user_data) { - ulTaskNotifyTake(pdTRUE, portMAX_DELAY); - user_data->__busy_guard = true; - gpio_isr_handler_remove(user_data->intr_pin); - - switch (user_data->opmode) - { - case FINGERPRINT_MATCH_MODE: + time(&user_data->timeout_start_time); // !< reset the internal timer_start_time + r307_as606_update_id_status_list(item); // !< The best place to update ID_status_list + for (;;) { - uint16_t tempelate_count; - uint16_t temp_id = user_data->user_id; - if (ReadTempNum(item->interface.uart.channel, &tempelate_count, (user_data->recieved_buffer), 500)) + ulTaskNotifyTake(pdTRUE, portMAX_DELAY); + user_data->__busy_guard = true; + gpio_isr_handler_remove(user_data->intr_pin); + + switch (user_data->opmode) { - if (tempelate_count > 0) + case FINGERPRINT_MATCH_MODE: + { + uint16_t tempelate_count; + uint16_t temp_id = user_data->user_id; + if (ReadTempNum(item->interface.uart.channel, &tempelate_count, (user_data->recieved_buffer), 500)) { - for (uint16_t j = 1; j <= FINGERPRINT_MAX_CAPACITY_LIMIT; j++) + if (tempelate_count > 0) { - if (true == user_data->validity[j]) // if user_id is occupied then only perform 'match_action' + for (uint16_t j = 1; j <= FINGERPRINT_MAX_CAPACITY_LIMIT; j++) { - user_data->user_id = j; - if (r307_as606_match_id(item)) + if (true == user_data->validity[j]) // if user_id is occupied then only perform 'match_action' { - user_data->matched_id = user_data->user_id; - user_data->matched_confidence_level = (((user_data->confidence_level) > (uint16_t)100) ? 100 : (user_data->confidence_level)); - TRACE_I(" ----> Matched ID: [%d] ; Confidence : [%d]", (user_data->matched_id), (user_data->matched_confidence_level)); - break; - } - else - { - user_data->matched_id = user_data->user_id; - user_data->matched_confidence_level = 0; + user_data->user_id = j; + if (r307_as606_match_id(item)) + { + user_data->matched_id = user_data->user_id; + user_data->matched_confidence_level = (((user_data->confidence_level) > (uint16_t)100) ? 100 : (user_data->confidence_level)); + TRACE_I(" ----> Matched ID: [%d] ; Confidence : [%d]", (user_data->matched_id), (user_data->matched_confidence_level)); + break; + } + else + { + user_data->matched_id = user_data->user_id; + user_data->matched_confidence_level = 0; + } } } } } - } - else - { - TRACE_E("No USER_ID found ; internal library is empty.... Please trigger [ENROLLMENT] mode to add fingerprint"); - } - TRACE_W("____ MATCH_IDS: SENDING _____"); - user_data->notify_flag = true; - ezlopi_device_value_updated_from_device_item_id_v3(user_data->sensor_fp_item_ids[SENSOR_FP_ITEM_ID_ACTION]); - - user_data->user_id = temp_id; - break; - } - case FINGERPRINT_ENROLLMENT_MODE: - { - uint16_t current_id = r307_as606_find_immediate_vaccant_id(item); - if ((current_id) > 0) - { - current_id = r307_as606_enroll_fingerprint(item); - if (0 != current_id) + else { - if ((user_data->user_id) == current_id) - { - TRACE_I("RESULT:...Enrollment of user_id[%d].... process => Success", current_id); - - user_data->opmode = FINGERPRINT_MATCH_MODE; - TRACE_W("____ ENROLL_IDS: SENDING _____"); - user_data->notify_flag = true; - ezlopi_device_value_updated_from_device_item_id_v3(user_data->sensor_fp_item_ids[SENSOR_FP_ITEM_ID_FP_IDS]); - user_data->notify_flag = true; - ezlopi_device_value_updated_from_device_item_id_v3(user_data->sensor_fp_item_ids[SENSOR_FP_ITEM_ID_ENROLL]); - } - else - { - TRACE_I("RESULT:...Duplicate in user_id[%d].... process => Blocked", current_id); - } + TRACE_E("No USER_ID found ; internal library is empty.... Please trigger [ENROLLMENT] mode to add fingerprint"); } - } - else - { - TRACE_E("ALL user_id => occupied ; ... Delete IDs to enroll again."); - } - break; - } - - case FINGERPRINT_ERASE_WITH_IDS_MODE: - { - uint16_t temp_id = user_data->user_id; + TRACE_W("____ MATCH_IDS: SENDING _____"); + user_data->notify_flag = true; + ezlopi_device_value_updated_from_device_item_id_v3(user_data->sensor_fp_item_ids[SENSOR_FP_ITEM_ID_ACTION]); - for (uint16_t i = 1; i <= FINGERPRINT_MAX_CAPACITY_LIMIT; i++) + user_data->user_id = temp_id; + break; + } + case FINGERPRINT_ENROLLMENT_MODE: { - if (false == user_data->protect[i]) // first check if this ID is unprotected + uint16_t current_id = r307_as606_find_immediate_vaccant_id(item); + if ((current_id) > 0) { - if (true == user_data->validity[i]) // second check if the id is occupied + current_id = r307_as606_enroll_fingerprint(item); + if (0 != current_id) { - TRACE_W("DELETING ID[#%d]", i); - user_data->user_id = i; - if (r307_as606_erase_specified_id(item)) // then delete and update 'validity[]' status + if ((user_data->user_id) == current_id) { - TRACE_S(" Success... DELETED ID[#%d]", i); - user_data->validity[i] = false; + TRACE_I("RESULT:...Enrollment of user_id[%d].... process => Success", current_id); + + user_data->opmode = FINGERPRINT_MATCH_MODE; + TRACE_W("____ ENROLL_IDS: SENDING _____"); + user_data->notify_flag = true; + ezlopi_device_value_updated_from_device_item_id_v3(user_data->sensor_fp_item_ids[SENSOR_FP_ITEM_ID_FP_IDS]); + user_data->notify_flag = true; + ezlopi_device_value_updated_from_device_item_id_v3(user_data->sensor_fp_item_ids[SENSOR_FP_ITEM_ID_ENROLL]); } else { - TRACE_S(" Fail... NOT DELETED ID[#%d]", i); + TRACE_I("RESULT:...Duplicate in user_id[%d].... process => Blocked", current_id); } } } - } - for (uint16_t i = 1; i <= FINGERPRINT_MAX_CAPACITY_LIMIT; i++) - { - user_data->protect[i] = false; + else + { + TRACE_E("ALL user_id => occupied ; ... Delete IDs to enroll again."); + } + break; } - user_data->user_id = temp_id; - TRACE_W("____ ERASE_SPECIFIC_IDS: SENDING _____"); - user_data->notify_flag = true; - ezlopi_device_value_updated_from_device_item_id_v3(user_data->sensor_fp_item_ids[SENSOR_FP_ITEM_ID_FP_IDS]); - user_data->opmode = FINGERPRINT_MATCH_MODE; - break; - } - case FINGERPRINT_ERASE_ALL_MODE: - { - if (r307_as606_erase_all_id(item)) + case FINGERPRINT_ERASE_WITH_IDS_MODE: { + uint16_t temp_id = user_data->user_id; + + for (uint16_t i = 1; i <= FINGERPRINT_MAX_CAPACITY_LIMIT; i++) + { + if (false == user_data->protect[i]) // first check if this ID is unprotected + { + if (true == user_data->validity[i]) // second check if the id is occupied + { + TRACE_W("DELETING ID[#%d]", i); + user_data->user_id = i; + if (r307_as606_erase_specified_id(item)) // then delete and update 'validity[]' status + { + TRACE_S(" Success... DELETED ID[#%d]", i); + user_data->validity[i] = false; + } + else + { + TRACE_S(" Fail... NOT DELETED ID[#%d]", i); + } + } + } + } for (uint16_t i = 1; i <= FINGERPRINT_MAX_CAPACITY_LIMIT; i++) { - user_data->validity[i] = false; + user_data->protect[i] = false; } - TRACE_W("____ ERASE_ALL: SENDING _____"); + + user_data->user_id = temp_id; + TRACE_W("____ ERASE_SPECIFIC_IDS: SENDING _____"); user_data->notify_flag = true; ezlopi_device_value_updated_from_device_item_id_v3(user_data->sensor_fp_item_ids[SENSOR_FP_ITEM_ID_FP_IDS]); + user_data->opmode = FINGERPRINT_MATCH_MODE; + break; + } + case FINGERPRINT_ERASE_ALL_MODE: + { + if (r307_as606_erase_all_id(item)) + { + for (uint16_t i = 1; i <= FINGERPRINT_MAX_CAPACITY_LIMIT; i++) + { + user_data->validity[i] = false; + } + TRACE_W("____ ERASE_ALL: SENDING _____"); + user_data->notify_flag = true; + ezlopi_device_value_updated_from_device_item_id_v3(user_data->sensor_fp_item_ids[SENSOR_FP_ITEM_ID_FP_IDS]); + } + user_data->opmode = FINGERPRINT_MATCH_MODE; + break; } - user_data->opmode = FINGERPRINT_MATCH_MODE; - break; - } - default: - { - TRACE_E("Invalid OPMODE is set..... {%d}. Reverting Back to default: 'MATCH_MODE-[0]'", user_data->opmode); - user_data->opmode = FINGERPRINT_MATCH_MODE; - break; - } + default: + { + TRACE_E("Invalid OPMODE is set..... {%d}. Reverting Back to default: 'MATCH_MODE-[0]'", user_data->opmode); + user_data->opmode = FINGERPRINT_MATCH_MODE; + break; + } + } + TRACE_S(" --->> Remove Finger; To activate next Task_notify <<----"); + gpio_isr_handler_add(user_data->intr_pin, gpio_notify_isr, item); + user_data->__busy_guard = false; } - TRACE_S(" --->> Remove Finger; To activate next Task_notify <<----"); - gpio_isr_handler_add(user_data->intr_pin, gpio_notify_isr, item); - user_data->__busy_guard = false; } } vTaskDelete(NULL); diff --git a/ezlopi-sensors-devices/sensor-0067-UART-hilink-presence-sensor/sensor_0067_hilink_presence_sensor.c b/ezlopi-sensors-devices/sensor-0067-UART-hilink-presence-sensor/sensor_0067_hilink_presence_sensor.c index f5523347f..764b01648 100644 --- a/ezlopi-sensors-devices/sensor-0067-UART-hilink-presence-sensor/sensor_0067_hilink_presence_sensor.c +++ b/ezlopi-sensors-devices/sensor-0067-UART-hilink-presence-sensor/sensor_0067_hilink_presence_sensor.c @@ -163,8 +163,8 @@ static int __add_value_to_cjson(l_ezlopi_item_t *item, cJSON *cj_params, bool is { motion = true; } - cJSON_AddBoolToObject(cj_params, "valueFormatted", motion); - cJSON_AddBoolToObject(cj_params, "value", motion); + cJSON_AddBoolToObject(cj_params, ezlopi_valueFormatted_str, motion); + cJSON_AddBoolToObject(cj_params, ezlopi_value_str, motion); } if (ezlopi_item_name_motion_direction == item->cloud_properties.item_name) { @@ -172,13 +172,13 @@ static int __add_value_to_cjson(l_ezlopi_item_t *item, cJSON *cj_params, bool is { ESP_ERROR_CHECK(__add_array_to_object(cj_params, hilink_presence_sensor_motion_direction_enum, 4)); } - cJSON_AddStringToObject(cj_params, "valueFormatted", hilink_presence_sensor_motion_direction_enum[hilink_data->direction + 1]); - cJSON_AddStringToObject(cj_params, "value", hilink_presence_sensor_motion_direction_enum[hilink_data->direction + 1]); + cJSON_AddStringToObject(cj_params, ezlopi_valueFormatted_str, hilink_presence_sensor_motion_direction_enum[hilink_data->direction + 1]); + cJSON_AddStringToObject(cj_params, ezlopi_value_str, hilink_presence_sensor_motion_direction_enum[hilink_data->direction + 1]); } if (ezlopi_item_name_distance == item->cloud_properties.item_name) { - cJSON_AddNumberToObject(cj_params, "valueFormatted", hilink_data->moving_target_distance); - cJSON_AddNumberToObject(cj_params, "value", hilink_data->moving_target_distance); + cJSON_AddNumberToObject(cj_params, ezlopi_valueFormatted_str, hilink_data->moving_target_distance); + cJSON_AddNumberToObject(cj_params, ezlopi_value_str, hilink_data->moving_target_distance); } } @@ -223,40 +223,37 @@ static int __get_cjson_value(l_ezlopi_item_t *item, void *args) static int __init(l_ezlopi_item_t *item) { int ret = 0; - if (item) + if ((item)) { ld2410_outputs_t *hilink_data = (ld2410_outputs_t *)item->user_arg; - if (item->interface.uart.enable && hilink_data) + if (hilink_data) { - s_ezlopi_uart_t uart_settings = { - .baudrate = LD2410_BAUDRATE, - .tx = item->interface.uart.tx, - .rx = item->interface.uart.rx, - }; - if (ESP_OK == ld2410_setup(uart_settings)) + if (item->interface.uart.enable) { - ESP_ERROR_CHECK(hilink_presence_sensor_apply_settings()); - ESP_ERROR_CHECK(ld2410_get_data(hilink_data)); - ret = 1; - } - else - { - ret = -1; + s_ezlopi_uart_t uart_settings = { + .baudrate = LD2410_BAUDRATE, + .tx = item->interface.uart.tx, + .rx = item->interface.uart.rx, + }; + if (ESP_OK == ld2410_setup(uart_settings)) + { + ESP_ERROR_CHECK(hilink_presence_sensor_apply_settings()); + ESP_ERROR_CHECK(ld2410_get_data(hilink_data)); + ret = 1; + } + else + { + ret = -1; + free(item->user_arg); // this will free ; memory address linked to all items + item->user_arg = NULL; + ezlopi_device_free_device_by_item(item); + } } } else { ret = -1; - } - - if (0 == ret) - { - ret = -1; - if (item->user_arg) - { - free(item->user_arg); - item->user_arg = NULL; - } + ezlopi_device_free_device_by_item(item); } } return ret; diff --git a/ezlopi-util/ezlopi-util-trace/ezlopi_util_trace.h b/ezlopi-util/ezlopi-util-trace/ezlopi_util_trace.h index 8073ba120..adfe52db2 100644 --- a/ezlopi-util/ezlopi-util-trace/ezlopi_util_trace.h +++ b/ezlopi-util/ezlopi-util-trace/ezlopi_util_trace.h @@ -64,14 +64,14 @@ extern "C" // printf("\x1B[34m %s[%d]:" X "\x1B[0m\r\n", __FILE__, __LINE__, ##__VA_ARGS__); // } -#define trace_bg(bg, txt, X, reg...) \ +#define TRACE_Dg(bg, txt, X, reg...) \ { \ printf("\x1B[%s;%sm %s[%d]:" X "\x1B[0m\r\n", txt, bg, __FILE__, __LINE__, ##reg); \ } -#define trace_bw(X, reg...) trace_bg(COLOR_BG_BLACK, COLOR_FONT_WHITE, X, ##reg) -#define trace_yw(X, reg...) trace_bg(COLOR_BG_YELLOW, COLOR_FONT_WHITE, X, ##reg) -#define trace_wb(X, reg...) trace_bg(COLOR_BG_WHITE, COLOR_FONT_BLACK, X, ##reg) +#define TRACE_Dw(X, reg...) TRACE_Dg(COLOR_BG_BLACK, COLOR_FONT_WHITE, X, ##reg) +#define trace_yw(X, reg...) TRACE_Dg(COLOR_BG_YELLOW, COLOR_FONT_WHITE, X, ##reg) +#define trace_wb(X, reg...) TRACE_Dg(COLOR_BG_WHITE, COLOR_FONT_BLACK, X, ##reg) #define F(X) (flash_attr) X diff --git a/sdkconfig b/sdkconfig index 82d20c095..4c9824471 100644 --- a/sdkconfig +++ b/sdkconfig @@ -294,6 +294,7 @@ CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE=0 # CONFIG_BT_GATTS_APPEARANCE_WRITABLE is not set CONFIG_BT_GATTC_ENABLE=y CONFIG_BT_GATTC_MAX_CACHE_CHAR=40 +CONFIG_BT_GATTC_NOTIF_REG_MAX=5 # CONFIG_BT_GATTC_CACHE_NVS_FLASH is not set CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=3 CONFIG_BT_BLE_SMP_ENABLE=y @@ -728,6 +729,7 @@ CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y # CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND is not set +CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y # end of Sleep Config # @@ -1066,6 +1068,7 @@ CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y # CONFIG_LWIP_LOCAL_HOSTNAME="espressif" # CONFIG_LWIP_NETIF_API is not set +CONFIG_LWIP_TCPIP_TASK_PRIO=18 # CONFIG_LWIP_TCPIP_CORE_LOCKING is not set # CONFIG_LWIP_CHECK_THREAD_SAFETY is not set CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y From 6637c2d27e548e23d42640baa3a300c0b7851cd3 Mon Sep 17 00:00:00 2001 From: NDJ-Ezlo Date: Wed, 21 Feb 2024 16:19:56 +0545 Subject: [PATCH 08/27] Added scene run and scene else run --- .../ezlopi_core_scenes_then_methods.c | 96 ++++++++++++++----- .../ezlopi_core_scenes_value_types.h | 1 + .../ezlopi_service_meshbot.c | 68 +++++++++---- .../ezlopi_service_meshbot.h | 7 +- sdkconfig | 3 + 5 files changed, 129 insertions(+), 46 deletions(-) diff --git a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_then_methods.c b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_then_methods.c index 3a9b3c573..cd2124199 100755 --- a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_then_methods.c +++ b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_then_methods.c @@ -5,18 +5,20 @@ #include "ezlopi_cloud_constants.h" -int ezlopi_scene_then_set_item_value(l_scenes_list_v2_t *curr_scene, void *arg) +#include "ezlopi_service_meshbot.h" + +int ezlopi_scene_then_set_item_value(l_scenes_list_v2_t* curr_scene, void* arg) { int ret = 0; uint32_t item_id = 0; - cJSON *cj_params = cJSON_CreateObject(); + cJSON* cj_params = cJSON_CreateObject(); if (cj_params) { - l_action_block_v2_t *curr_then = (l_action_block_v2_t *)arg; + l_action_block_v2_t* curr_then = (l_action_block_v2_t*)arg; if (curr_then) { - l_fields_v2_t *curr_field = curr_then->fields; + l_fields_v2_t* curr_field = curr_then->fields; while (curr_field) { if (0 == strncmp(curr_field->name, "item", 4)) @@ -47,11 +49,11 @@ int ezlopi_scene_then_set_item_value(l_scenes_list_v2_t *curr_scene, void *arg) curr_field = curr_field->next; } - l_ezlopi_device_t *curr_device = ezlopi_device_get_head(); + l_ezlopi_device_t* curr_device = ezlopi_device_get_head(); uint32_t found_item = 0; while (curr_device) { - l_ezlopi_item_t *curr_item = curr_device->items; + l_ezlopi_item_t* curr_item = curr_device->items; while (curr_item) { if (item_id == curr_item->cloud_properties.item_id) @@ -76,82 +78,128 @@ int ezlopi_scene_then_set_item_value(l_scenes_list_v2_t *curr_scene, void *arg) return ret; } -int ezlopi_scene_then_set_device_armed(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_set_device_armed(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_send_cloud_abstract_command(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_send_cloud_abstract_command(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_switch_house_mode(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_switch_house_mode(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_send_http_request(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_send_http_request(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_run_custom_script(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_run_custom_script(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_run_plugin_script(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_run_plugin_script(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_run_scene(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_run_scene(l_scenes_list_v2_t* curr_scene, void* arg) { - TRACE_W("Warning: then-method not implemented!"); - return 0; + int ret = 0; + uint32_t sceneID = 0; + bool execute_else_condition = false; + l_action_block_v2_t* curr_then = (l_action_block_v2_t*)arg; + if (curr_then) + { + l_fields_v2_t* curr_field = curr_then->fields; + while (curr_field) + { + if ((0 == strncmp(curr_field->name, "sceneID", 7)) && (curr_field->value_type == EZLOPI_VALUE_TYPE_SCENEID)) + { + sceneID = strtoul(curr_field->value.value_string, NULL, 16); + } + else if ((0 == strncmp(curr_field->name, "block", 5)) && (curr_field->value_type == EZLOPI_VALUE_TYPE_STRING)) + { + if (0 == strncmp(curr_field->value.value_string, "else", 4)) + { + execute_else_condition = true; + } + else if (0 == strncmp(curr_field->value.value_string, "thenGroups", 10)) + { + TRACE_D("Running scene group, yet to be implemented."); + } + else + { + ret = 1; + } + } + else if ((0 == strncmp(curr_field->name, "group", 5)) && (curr_field->value_type == EZLOPI_VALUE_TYPE_STRING)) + { + TRACE_D("Running scene group, yet to be implemented."); + } + curr_field = curr_field->next; + } + if (execute_else_condition) + { + ezlopi_meshbot_execute_scene_else_action_group(sceneID); + } + else + { + ezlopi_scenes_service_run_by_id(sceneID); + } + } + else + { + ret = 1; + } + return ret; } -int ezlopi_scene_then_set_scene_state(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_set_scene_state(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_reset_latch(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_reset_latch(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_reset_scene_latches(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_reset_scene_latches(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_reboot_hub(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_reboot_hub(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_reset_hub(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_reset_hub(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_cloud_api(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_cloud_api(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_set_expression(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_set_expression(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_set_variable(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_set_variable(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_toggle_value(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_toggle_value(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; diff --git a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_value_types.h b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_value_types.h index fc121dc1a..a26bfbb20 100755 --- a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_value_types.h +++ b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_value_types.h @@ -69,5 +69,6 @@ EZLOPI_VALUE_TYPE(HMS_INTERVAL, "hms_interval") EZLOPI_VALUE_TYPE(BLOCKS, "blocks") EZLOPI_VALUE_TYPE(HOUSE_MODE_ID_ARRAY, "houseModeId_array") EZLOPI_VALUE_TYPE(HOUSE_MODE_ID, "houseModeId") +EZLOPI_VALUE_TYPE(SCENEID, "sceneID") // EZLOPI_VALUE_TYPE(MAX, NULL) \ No newline at end of file diff --git a/ezlopi-services/ezlopi-service-meshbot/ezlopi_service_meshbot.c b/ezlopi-services/ezlopi-service-meshbot/ezlopi_service_meshbot.c index 6fcdef678..3539f191c 100644 --- a/ezlopi-services/ezlopi-service-meshbot/ezlopi_service_meshbot.c +++ b/ezlopi-services/ezlopi-service-meshbot/ezlopi_service_meshbot.c @@ -4,19 +4,20 @@ #include "ezlopi_util_trace.h" #include "ezlopi_core_scenes_status_changed.h" +#include "ezlopi_core_scenes_v2.h" #include "ezlopi_cloud_constants.h" #include "ezlopi_service_meshbot.h" -static void __scenes_process(void *arg); -static int __execute_then_condition(l_scenes_list_v2_t *scene_node); -static int __execute_else_condition(l_scenes_list_v2_t *scene_node); +static void __scenes_process(void* arg); +static int __execute_then_condition(l_scenes_list_v2_t* scene_node); +static int __execute_else_condition(l_scenes_list_v2_t* scene_node); uint32_t ezlopi_meshbot_service_stop_for_scene_id(uint32_t _id) { uint32_t ret = 0; - l_scenes_list_v2_t *scene_node = ezlopi_scenes_get_by_id_v2(_id); + l_scenes_list_v2_t* scene_node = ezlopi_scenes_get_by_id_v2(_id); if (scene_node) { if (EZLOPI_SCENE_STATUS_RUNNING == scene_node->status) @@ -37,7 +38,7 @@ uint32_t ezlopi_meshbot_service_stop_for_scene_id(uint32_t _id) return ret; } -uint32_t ezlopi_meshobot_service_stop_scene(l_scenes_list_v2_t *scene_node) +uint32_t ezlopi_meshobot_service_stop_scene(l_scenes_list_v2_t* scene_node) { int ret = 0; if (scene_node) @@ -59,7 +60,7 @@ uint32_t ezlopi_meshobot_service_stop_scene(l_scenes_list_v2_t *scene_node) return ret; } -uint32_t ezlopi_meshbot_service_start_scene(l_scenes_list_v2_t *scene_node) +uint32_t ezlopi_meshbot_service_start_scene(l_scenes_list_v2_t* scene_node) { int ret = 0; if (scene_node) @@ -95,7 +96,7 @@ uint32_t ezlopi_scenes_service_run_by_id(uint32_t _id) { uint32_t ret = 0; TRACE_D("Scene-id: %d", _id); - l_scenes_list_v2_t *scene_node = ezlopi_scenes_get_by_id_v2(_id); + l_scenes_list_v2_t* scene_node = ezlopi_scenes_get_by_id_v2(_id); if (scene_node) { @@ -133,7 +134,7 @@ uint32_t ezlopi_scenes_service_run_by_id(uint32_t _id) void ezlopi_scenes_meshbot_init(void) { - l_scenes_list_v2_t *scene_node = ezlopi_scenes_get_scenes_head_v2(); + l_scenes_list_v2_t* scene_node = ezlopi_scenes_get_scenes_head_v2(); while (scene_node) { if (scene_node->enabled && scene_node->when_block && (scene_node->else_block || scene_node->then_block)) @@ -149,9 +150,36 @@ void ezlopi_scenes_meshbot_init(void) } } -static void __scenes_process(void *arg) +uint32_t ezlopi_meshbot_execute_scene_else_action_group(uint32_t scene_id) { - l_scenes_list_v2_t *scene_node = (l_scenes_list_v2_t *)arg; + int ret = 0; + l_scenes_list_v2_t* scene_node = ezlopi_scenes_get_by_id_v2(scene_id); + if (scene_node) + { + if (scene_node->else_block) + { + if (1 == __execute_else_condition(scene_node)) + { + ezlopi_scenes_status_change_broadcast(scene_node, scene_status_finished_str); + } + else + { + ezlopi_scenes_status_change_broadcast(scene_node, scene_status_failed_str); + ret = 1; + } + } + } + else + { + ezlopi_scenes_status_change_broadcast(scene_node, scene_status_failed_str); + ret = 1; + } + return ret; +} + +static void __scenes_process(void* arg) +{ + l_scenes_list_v2_t* scene_node = (l_scenes_list_v2_t*)arg; scene_node->status = EZLOPI_SCENE_STATUS_RUN; TRACE_I("task - '%s': Running", scene_node->name); uint32_t stopped_condition_count = 0; @@ -164,14 +192,14 @@ static void __scenes_process(void *arg) scene_node->status = EZLOPI_SCENE_STATUS_RUNNING; uint32_t when_condition_returned = 0; - l_when_block_v2_t *when_condition_node = scene_node->when_block; + l_when_block_v2_t* when_condition_node = scene_node->when_block; if (when_condition_node) { f_scene_method_v2_t when_method = ezlopi_scene_get_method_v2(when_condition_node->block_options.method.type); if (when_method) { - when_condition_returned = when_method(scene_node, (void *)when_condition_node); + when_condition_returned = when_method(scene_node, (void*)when_condition_node); if (when_condition_returned) { if (started_condition_fired_count < 2) @@ -247,10 +275,10 @@ static void __scenes_process(void *arg) vTaskDelete(NULL); } -static int __execute_then_condition(l_scenes_list_v2_t *scene_node) +static int __execute_then_condition(l_scenes_list_v2_t* scene_node) { int ret = 0; - l_action_block_v2_t *then_node = scene_node->then_block; + l_action_block_v2_t* then_node = scene_node->then_block; while (then_node) { uint32_t delay_ms = (then_node->delay.days * (24 * 60 * 60) + then_node->delay.hours * (60 * 60) + then_node->delay.minutes * 60 + then_node->delay.seconds) * 1000; @@ -260,7 +288,7 @@ static int __execute_then_condition(l_scenes_list_v2_t *scene_node) vTaskDelay(delay_ms / portTICK_RATE_MS); } - const char *method_name = ezlopi_scene_get_scene_method_name(then_node->block_options.method.type); + const char* method_name = ezlopi_scene_get_scene_method_name(then_node->block_options.method.type); if (method_name) { TRACE_D("Calling: %s", method_name); @@ -275,7 +303,7 @@ static int __execute_then_condition(l_scenes_list_v2_t *scene_node) if (then_method) { ret = 1; - then_method(scene_node, (void *)then_node); + then_method(scene_node, (void*)then_node); } if (then_node->next) @@ -289,10 +317,10 @@ static int __execute_then_condition(l_scenes_list_v2_t *scene_node) return ret; } -static int __execute_else_condition(l_scenes_list_v2_t *scene_node) +static int __execute_else_condition(l_scenes_list_v2_t* scene_node) { int ret = 0; - l_action_block_v2_t *else_node = scene_node->else_block; + l_action_block_v2_t* else_node = scene_node->else_block; while (else_node) { uint32_t delay_ms = (else_node->delay.days * (24 * 60 * 60) + else_node->delay.hours * (60 * 60) + else_node->delay.minutes * 60 + else_node->delay.seconds) * 1000; @@ -302,7 +330,7 @@ static int __execute_else_condition(l_scenes_list_v2_t *scene_node) vTaskDelay(delay_ms / portTICK_RATE_MS); } - const char *method_name = ezlopi_scene_get_scene_method_name(else_node->block_options.method.type); + const char* method_name = ezlopi_scene_get_scene_method_name(else_node->block_options.method.type); if (method_name) { TRACE_D("Calling: %s", method_name); @@ -317,7 +345,7 @@ static int __execute_else_condition(l_scenes_list_v2_t *scene_node) if (else_method) { ret = 1; - else_method(scene_node, (void *)else_node); + else_method(scene_node, (void*)else_node); } else_node = else_node->next; diff --git a/ezlopi-services/ezlopi-service-meshbot/ezlopi_service_meshbot.h b/ezlopi-services/ezlopi-service-meshbot/ezlopi_service_meshbot.h index bfc511a96..3a4cd89e6 100644 --- a/ezlopi-services/ezlopi-service-meshbot/ezlopi_service_meshbot.h +++ b/ezlopi-services/ezlopi-service-meshbot/ezlopi_service_meshbot.h @@ -7,9 +7,12 @@ void ezlopi_scenes_meshbot_init(void); uint32_t ezlopi_scenes_service_run_by_id(uint32_t _id); -uint32_t ezlopi_meshbot_service_start_scene(l_scenes_list_v2_t *scene_node); +uint32_t ezlopi_meshbot_service_start_scene(l_scenes_list_v2_t* scene_node); uint32_t ezlopi_meshbot_service_stop_for_scene_id(uint32_t _id); -uint32_t ezlopi_meshobot_service_stop_scene(l_scenes_list_v2_t *scene_node); +uint32_t ezlopi_meshobot_service_stop_scene(l_scenes_list_v2_t* scene_node); + + +uint32_t ezlopi_meshbot_execute_scene_else_action_group(uint32_t scene_id); #endif // _EZLOPI_SERVICE_MESHBOT_H_ diff --git a/sdkconfig b/sdkconfig index 82d20c095..4c9824471 100644 --- a/sdkconfig +++ b/sdkconfig @@ -294,6 +294,7 @@ CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE=0 # CONFIG_BT_GATTS_APPEARANCE_WRITABLE is not set CONFIG_BT_GATTC_ENABLE=y CONFIG_BT_GATTC_MAX_CACHE_CHAR=40 +CONFIG_BT_GATTC_NOTIF_REG_MAX=5 # CONFIG_BT_GATTC_CACHE_NVS_FLASH is not set CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=3 CONFIG_BT_BLE_SMP_ENABLE=y @@ -728,6 +729,7 @@ CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y # CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND is not set +CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y # end of Sleep Config # @@ -1066,6 +1068,7 @@ CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y # CONFIG_LWIP_LOCAL_HOSTNAME="espressif" # CONFIG_LWIP_NETIF_API is not set +CONFIG_LWIP_TCPIP_TASK_PRIO=18 # CONFIG_LWIP_TCPIP_CORE_LOCKING is not set # CONFIG_LWIP_CHECK_THREAD_SAFETY is not set CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y From 33a3808c33ad28c36d99d33acf75493702b2ce5d Mon Sep 17 00:00:00 2001 From: Krishna Kumar Sah Date: Wed, 21 Feb 2024 22:15:19 +0545 Subject: [PATCH 09/27] fixed field-value issue --- .../ezlopi-cloud-scenes/CMakeLists.txt | 2 +- .../ezlopi_cloud_scenes_block_list.c | 78 +++++---- ezlopi-core/ezlopi-core-scenes/CMakeLists.txt | 2 +- .../ezlopi_core_scenes_cjson.c | 147 ++++++++-------- .../ezlopi_core_scenes_delete.c | 53 +++--- .../ezlopi_core_scenes_operators.c | 160 +++++++++--------- .../ezlopi_core_scenes_populate.c | 47 ++--- .../ezlopi_core_scenes_print.c | 36 ++-- .../ezlopi_core_scenes_then_methods.c | 66 ++++---- .../ezlopi_core_scenes_v2.c | 53 +++--- .../ezlopi_core_scenes_v2.h | 92 +++++----- .../ezlopi_core_scenes_when_methods.c | 26 +-- sdkconfig | 12 ++ 13 files changed, 413 insertions(+), 361 deletions(-) diff --git a/ezlopi-cloud/ezlopi-cloud-scenes/CMakeLists.txt b/ezlopi-cloud/ezlopi-cloud-scenes/CMakeLists.txt index 8074f68b1..6aab9f05d 100644 --- a/ezlopi-cloud/ezlopi-cloud-scenes/CMakeLists.txt +++ b/ezlopi-cloud/ezlopi-cloud-scenes/CMakeLists.txt @@ -1,5 +1,5 @@ file(GLOB_RECURSE src_files "*.c*") -idf_component_register(SRCS "ezlopi_cloud_scenes_block_data_list.c" "${src_files}" +idf_component_register(SRCS "ezlopi_cloud_scenes_block_list.c" "ezlopi_cloud_scenes_block_data_list.c" "${src_files}" INCLUDE_DIRS "." REQUIRES ezlopi-core-factory-info ezlopi-util-trace json ezlopi-cloud-constants ezlopi-core-scenes) diff --git a/ezlopi-cloud/ezlopi-cloud-scenes/ezlopi_cloud_scenes_block_list.c b/ezlopi-cloud/ezlopi-cloud-scenes/ezlopi_cloud_scenes_block_list.c index 8bb4c3f26..41ec5ebf1 100644 --- a/ezlopi-cloud/ezlopi-cloud-scenes/ezlopi_cloud_scenes_block_list.c +++ b/ezlopi-cloud/ezlopi-cloud-scenes/ezlopi_cloud_scenes_block_list.c @@ -13,36 +13,36 @@ #include "ezlopi_cloud_constants.h" #include "ezlopi_core_scenes_operators.h" -static cJSON *__create_when_block_cjson(l_when_block_v2_t *when_block); +static cJSON* __create_when_block_cjson(l_when_block_v2_t* when_block); -static bool __found_item_in_field(l_fields_v2_t *field_node, uint32_t item_id); -static cJSON *__add_scenes_blocks_by_device_ids(e_scenes_block_type_v2_t block_type, cJSON *cj_devices_array); -static cJSON *__add_scenes_blocks_by_item_ids(e_scenes_block_type_v2_t block_type, l_ezlopi_item_t *item_list); -static e_scenes_block_type_v2_t __get_block_type_and_create_block_array(cJSON *cj_result, char const **block_type_name, cJSON *cj_block_type); +static bool __found_item_in_field(l_fields_v2_t* field_node, uint32_t item_id); +static cJSON* __add_scenes_blocks_by_device_ids(e_scenes_block_type_v2_t block_type, cJSON* cj_devices_array); +static cJSON* __add_scenes_blocks_by_item_ids(e_scenes_block_type_v2_t block_type, l_ezlopi_item_t* item_list); +static e_scenes_block_type_v2_t __get_block_type_and_create_block_array(cJSON* cj_result, char const** block_type_name, cJSON* cj_block_type); -void scenes_blocks_list(cJSON *cj_request, cJSON *cj_response) +void scenes_blocks_list(cJSON* cj_request, cJSON* cj_response) { cJSON_AddItemReferenceToObject(cj_response, ezlopi__id_str, cJSON_GetObjectItem(cj_request, ezlopi_id_str)); cJSON_AddItemReferenceToObject(cj_response, ezlopi_method_str, cJSON_GetObjectItem(cj_request, ezlopi_method_str)); - cJSON *cj_result = cJSON_AddObjectToObject(cj_response, ezlopi_result_str); + cJSON* cj_result = cJSON_AddObjectToObject(cj_response, ezlopi_result_str); if (cj_result) { - cJSON *cj_paramas = cJSON_GetObjectItem(cj_request, ezlopi_params_str); + cJSON* cj_paramas = cJSON_GetObjectItem(cj_request, ezlopi_params_str); if (cj_paramas) { - cJSON *cj_block_type = cJSON_GetObjectItem(cj_paramas, ezlopi_blockType_str); + cJSON* cj_block_type = cJSON_GetObjectItem(cj_paramas, ezlopi_blockType_str); if (cj_block_type && cj_block_type->valuestring) { - char *block_type_name = NULL; - e_scenes_block_type_v2_t block_type = __get_block_type_and_create_block_array(cj_result, (const char **)&block_type_name, cj_block_type); + char* block_type_name = NULL; + e_scenes_block_type_v2_t block_type = __get_block_type_and_create_block_array(cj_result, (const char**)&block_type_name, cj_block_type); if (block_type) { - cJSON *cj_devices_array = cJSON_GetObjectItem(cj_paramas, "devices"); + cJSON* cj_devices_array = cJSON_GetObjectItem(cj_paramas, "devices"); if (cj_devices_array && (cJSON_Array == cj_devices_array->type)) { - cJSON *cj_block_array = __add_scenes_blocks_by_device_ids(block_type, cj_devices_array); + cJSON* cj_block_array = __add_scenes_blocks_by_device_ids(block_type, cj_devices_array); if (cj_block_array) { if (!cJSON_AddItemToObject(cj_result, block_type_name, cj_block_array)) @@ -57,24 +57,24 @@ void scenes_blocks_list(cJSON *cj_request, cJSON *cj_response) } } -static void __add_block_options_and_fields_cjson(cJSON *cj_block, s_block_options_v2_t *block_options, l_fields_v2_t *fields_node) +static void __add_block_options_and_fields_cjson(cJSON* cj_block, s_block_options_v2_t* block_options, l_fields_v2_t* fields_node) { - cJSON *cj_block_opt = cJSON_AddObjectToObject(cj_block, ezlopi_blockOptions_str); - cJSON *cj_fields = cJSON_AddArrayToObject(cj_block, ezlopi_fields_str); + cJSON* cj_block_opt = cJSON_AddObjectToObject(cj_block, ezlopi_blockOptions_str); + cJSON* cj_fields = cJSON_AddArrayToObject(cj_block, ezlopi_fields_str); if (cj_block_opt && cj_fields) { - cJSON *cj_method = cJSON_AddObjectToObject(cj_block_opt, ezlopi_method_str); + cJSON* cj_method = cJSON_AddObjectToObject(cj_block_opt, ezlopi_method_str); if (cj_method) { cJSON_AddStringToObject(cj_method, ezlopi_name_str, block_options->method.name); - cJSON *cj_args = cJSON_AddObjectToObject(cj_method, ezlopi_args_str); + cJSON* cj_args = cJSON_AddObjectToObject(cj_method, ezlopi_args_str); if (cj_args) { while (fields_node) { cJSON_AddStringToObject(cj_args, fields_node->name, fields_node->name); - cJSON *cj_field_obj = ezlopi_scene_cjson_get_field(fields_node); + cJSON* cj_field_obj = ezlopi_scene_cjson_get_field(fields_node); if (!cJSON_AddItemToArray(cj_fields, cj_field_obj)) { cJSON_Delete(cj_field_obj); @@ -87,9 +87,9 @@ static void __add_block_options_and_fields_cjson(cJSON *cj_block, s_block_option } } -static cJSON *__create_when_block_cjson(l_when_block_v2_t *when_block) +static cJSON* __create_when_block_cjson(l_when_block_v2_t* when_block) { - cJSON *cj_when_block = NULL; + cJSON* cj_when_block = NULL; if (when_block) { @@ -104,9 +104,9 @@ static cJSON *__create_when_block_cjson(l_when_block_v2_t *when_block) return cj_when_block; } -static cJSON *__create_then_block_cjson(l_action_block_v2_t *then_block) +static cJSON* __create_then_block_cjson(l_action_block_v2_t* then_block) { - cJSON *cj_then_block = NULL; + cJSON* cj_then_block = NULL; if (then_block) { @@ -121,9 +121,9 @@ static cJSON *__create_then_block_cjson(l_action_block_v2_t *then_block) return cj_then_block; } -static cJSON *__create_else_block_cjson(l_action_block_v2_t *else_block) +static cJSON* __create_else_block_cjson(l_action_block_v2_t* else_block) { - cJSON *cj_else_block = NULL; + cJSON* cj_else_block = NULL; if (else_block) { @@ -138,15 +138,19 @@ static cJSON *__create_else_block_cjson(l_action_block_v2_t *else_block) return cj_else_block; } -static bool __found_item_in_field(l_fields_v2_t *field_node, uint32_t item_id) +static bool __found_item_in_field(l_fields_v2_t* field_node, uint32_t item_id) { bool ret = false; while (field_node) { if (EZLOPI_VALUE_TYPE_ITEM == field_node->value_type) { - uint32_t item_id_check = strtoul(field_node->value.value_string, NULL, 16); - TRACE_D("item-id: %s | %08x", field_node->value.value_string, item_id); + uint32_t item_id_check = strtoul(field_node->field_value.u_value.value_string, NULL, 16); + TRACE_D("item-id: %s | %08x", field_node->field_value.u_value.value_string, item_id); + + // uint32_t item_id_check = strtoul(field_node->value.value_string, NULL, 16); + // TRACE_D("item-id: %s | %08x", field_node->value.value_string, item_id); + if (item_id_check == item_id) { ret = 1; @@ -160,12 +164,12 @@ static bool __found_item_in_field(l_fields_v2_t *field_node, uint32_t item_id) return ret; } -static cJSON *__add_scenes_blocks_by_item_ids(e_scenes_block_type_v2_t block_type, l_ezlopi_item_t *item_list) +static cJSON* __add_scenes_blocks_by_item_ids(e_scenes_block_type_v2_t block_type, l_ezlopi_item_t* item_list) { - cJSON *cj_block = NULL; + cJSON* cj_block = NULL; while (item_list) { - l_scenes_list_v2_t *scene_node = ezlopi_scenes_get_scenes_head_v2(); + l_scenes_list_v2_t* scene_node = ezlopi_scenes_get_scenes_head_v2(); while (scene_node) { TRACE_D("Here"); @@ -227,11 +231,11 @@ static cJSON *__add_scenes_blocks_by_item_ids(e_scenes_block_type_v2_t block_typ return cj_block; } -static cJSON *__add_scenes_blocks_by_device_ids(e_scenes_block_type_v2_t block_type, cJSON *cj_devices_array) +static cJSON* __add_scenes_blocks_by_device_ids(e_scenes_block_type_v2_t block_type, cJSON* cj_devices_array) { int device_id_idx = 0; - cJSON *cj_device_id = NULL; - cJSON *cj_block_array = NULL; + cJSON* cj_device_id = NULL; + cJSON* cj_block_array = NULL; CJSON_TRACE("device array", cj_devices_array); @@ -241,11 +245,11 @@ static cJSON *__add_scenes_blocks_by_device_ids(e_scenes_block_type_v2_t block_t if (cj_device_id->valuestring) { uint32_t device_id = strtoul(cj_device_id->valuestring, NULL, 16); - l_ezlopi_device_t *device_node = ezlopi_device_get_by_id(device_id); + l_ezlopi_device_t* device_node = ezlopi_device_get_by_id(device_id); if (device_node) { TRACE_D("Here"); - cJSON *cj_block = __add_scenes_blocks_by_item_ids(block_type, device_node->items); + cJSON* cj_block = __add_scenes_blocks_by_item_ids(block_type, device_node->items); if (cj_block) { if (NULL == cj_block_array) @@ -272,7 +276,7 @@ static cJSON *__add_scenes_blocks_by_device_ids(e_scenes_block_type_v2_t block_t return cj_block_array; } -static e_scenes_block_type_v2_t __get_block_type_and_create_block_array(cJSON *cj_result, char const **block_type_name, cJSON *cj_block_type) +static e_scenes_block_type_v2_t __get_block_type_and_create_block_array(cJSON* cj_result, char const** block_type_name, cJSON* cj_block_type) { e_scenes_block_type_v2_t block_type = SCENE_BLOCK_TYPE_NONE; diff --git a/ezlopi-core/ezlopi-core-scenes/CMakeLists.txt b/ezlopi-core/ezlopi-core-scenes/CMakeLists.txt index 3934077e8..11c300e07 100644 --- a/ezlopi-core/ezlopi-core-scenes/CMakeLists.txt +++ b/ezlopi-core/ezlopi-core-scenes/CMakeLists.txt @@ -2,7 +2,7 @@ file(GLOB_RECURSE config_src "*.c") -idf_component_register(SRCS "ezlopi_core_scenes_when_methods.c" "ezlopi_core_scenes_cjson.c" "ezlopi_core_scenes_print.c" "ezlopi_core_scenes_value.c" "${config_src}" +idf_component_register(SRCS "ezlopi_core_scenes_operators.c" "ezlopi_core_scenes_then_methods.c" "ezlopi_core_scenes_populate.c" "ezlopi_core_scenes_delete.c" "ezlopi_core_scenes_v2.c" "ezlopi_core_scenes_when_methods.c" "ezlopi_core_scenes_cjson.c" "ezlopi_core_scenes_print.c" "ezlopi_core_scenes_value.c" "${config_src}" INCLUDE_DIRS "." REQUIRES core ) \ No newline at end of file diff --git a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_cjson.c b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_cjson.c index a0680467f..1e7ff4361 100755 --- a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_cjson.c +++ b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_cjson.c @@ -8,19 +8,19 @@ #include "ezlopi_cloud_constants.h" -static void __cjson_add_fields(cJSON *cj_block, l_fields_v2_t *fields); -static void __cjson_add_string(cJSON *root, const char *key, const char *value); -static void __cjson_add_action_delay(cJSON *cj_then_block, s_action_delay_v2_t *action_delay); -static void __cjson_add_action_block_options(cJSON *cj_block_array, l_action_block_v2_t *then_block); +static void __cjson_add_fields(cJSON* cj_block, l_fields_v2_t* fields); +static void __cjson_add_string(cJSON* root, const char* key, const char* value); +static void __cjson_add_action_delay(cJSON* cj_then_block, s_action_delay_v2_t* action_delay); +static void __cjson_add_action_block_options(cJSON* cj_block_array, l_action_block_v2_t* then_block); -cJSON *ezlopi_scene_cjson_get_field(l_fields_v2_t *field_node) +cJSON* ezlopi_scene_cjson_get_field(l_fields_v2_t* field_node) { - cJSON *cj_field = NULL; + cJSON* cj_field = NULL; if (field_node) { cj_field = cJSON_CreateObject(); { - const char *value_type_str = ezlopi_scene_get_scene_value_type_name(field_node->value_type); + const char* value_type_str = ezlopi_scene_get_scene_value_type_name(field_node->value_type); if (value_type_str) { cJSON_AddStringToObject(cj_field, ezlopi_type_str, value_type_str); @@ -37,12 +37,14 @@ cJSON *ezlopi_scene_cjson_get_field(l_fields_v2_t *field_node) case EZLOPI_VALUE_TYPE_INT: case EZLOPI_VALUE_TYPE_FLOAT: { - cJSON_AddNumberToObject(cj_field, ezlopi_value_str, field_node->value.value_double); + cJSON_AddNumberToObject(cj_field, ezlopi_value_str, field_node->field_value.u_value.value_double); + // cJSON_AddNumberToObject(cj_field, ezlopi_value_str, field_node->value.value_double); break; } case EZLOPI_VALUE_TYPE_BOOL: { - if (0 == field_node->value.value_double) + if (0 == field_node->field_value.u_value.value_double) + // if (0 == field_node->value.value_double) { cJSON_AddFalseToObject(cj_field, ezlopi_value_str); } @@ -56,18 +58,20 @@ cJSON *ezlopi_scene_cjson_get_field(l_fields_v2_t *field_node) case EZLOPI_VALUE_TYPE_STRING: case EZLOPI_VALUE_TYPE_INTERVAL: { - __cjson_add_string(cj_field, ezlopi_value_str, field_node->value.value_string); + __cjson_add_string(cj_field, ezlopi_value_str, field_node->field_value.u_value.value_string); + // __cjson_add_string(cj_field, ezlopi_value_str, field_node->value.value_string); break; } case EZLOPI_VALUE_TYPE_BLOCKS: { - cJSON *vlaue_block_array = cJSON_AddArrayToObject(cj_field, ezlopi_value_str); + cJSON* vlaue_block_array = cJSON_AddArrayToObject(cj_field, ezlopi_value_str); if (vlaue_block_array) { - l_when_block_v2_t *curr_when_block = field_node->value.when_block; + l_when_block_v2_t* curr_when_block = field_node->field_value.u_value.when_block; + // l_when_block_v2_t* curr_when_block = field_node->value.when_block; while (curr_when_block) { - cJSON *cj_when_block = ezlopi_scenes_cjson_create_when_block(curr_when_block); + cJSON* cj_when_block = ezlopi_scenes_cjson_create_when_block(curr_when_block); if (cj_when_block) { if (!cJSON_AddItemToArray(vlaue_block_array, cj_when_block)) @@ -150,7 +154,7 @@ cJSON *ezlopi_scene_cjson_get_field(l_fields_v2_t *field_node) } default: { - const char *value_type_name = ezlopi_scene_get_scene_value_type_name(field_node->value_type); + const char* value_type_name = ezlopi_scene_get_scene_value_type_name(field_node->value_type); TRACE_E("Value type not matched!, curr-type[%d]: %s ", field_node->value_type, value_type_name ? value_type_name : ezlopi_null_str); break; } @@ -161,16 +165,16 @@ cJSON *ezlopi_scene_cjson_get_field(l_fields_v2_t *field_node) return cj_field; } -static void ezlopi_scenes_cjson_add_user_notifications(cJSON *root, l_user_notification_v2_t *user_notifications) +static void ezlopi_scenes_cjson_add_user_notifications(cJSON* root, l_user_notification_v2_t* user_notifications) { if (root) { - cJSON *cj_user_notifications_array = cJSON_AddArrayToObject(root, ezlopi_user_notifications_str); + cJSON* cj_user_notifications_array = cJSON_AddArrayToObject(root, ezlopi_user_notifications_str); if (cj_user_notifications_array) { while (user_notifications) { - cJSON *array_item = cJSON_CreateString(user_notifications->user_id); + cJSON* array_item = cJSON_CreateString(user_notifications->user_id); if (array_item) { if (!cJSON_AddItemToArray(cj_user_notifications_array, array_item)) @@ -184,16 +188,16 @@ static void ezlopi_scenes_cjson_add_user_notifications(cJSON *root, l_user_notif } } -static void ezlopi_scenes_cjson_add_house_modes(cJSON *root, l_house_modes_v2_t *house_modes) +static void ezlopi_scenes_cjson_add_house_modes(cJSON* root, l_house_modes_v2_t* house_modes) { if (root) { - cJSON *cj_user_notifications_array = cJSON_AddArrayToObject(root, ezlopi_house_modes_str); + cJSON* cj_user_notifications_array = cJSON_AddArrayToObject(root, ezlopi_house_modes_str); if (cj_user_notifications_array) { while (house_modes) { - cJSON *array_item = cJSON_CreateString(house_modes->house_mode); + cJSON* array_item = cJSON_CreateString(house_modes->house_mode); if (array_item) { if (!cJSON_AddItemToArray(cj_user_notifications_array, array_item)) @@ -207,20 +211,20 @@ static void ezlopi_scenes_cjson_add_house_modes(cJSON *root, l_house_modes_v2_t } } -static void ezlopi_scenes_cjson_add_when_block_options(cJSON *cj_block_array, l_when_block_v2_t *when_block) +static void ezlopi_scenes_cjson_add_when_block_options(cJSON* cj_block_array, l_when_block_v2_t* when_block) { if (cj_block_array && when_block) { - cJSON *cj_block_options = cJSON_AddObjectToObject(cj_block_array, ezlopi_blockOptions_str); + cJSON* cj_block_options = cJSON_AddObjectToObject(cj_block_array, ezlopi_blockOptions_str); if (cj_block_options) { - cJSON *cj_method = cJSON_AddObjectToObject(cj_block_options, ezlopi_method_str); + cJSON* cj_method = cJSON_AddObjectToObject(cj_block_options, ezlopi_method_str); if (cj_method) { if ((when_block->block_options.method.type > EZLOPI_SCENE_METHOD_TYPE_NONE) && (when_block->block_options.method.type < EZLOPI_SCENE_METHOD_TYPE_MAX)) { - const char *method_type_name = ezlopi_scene_get_scene_method_name(when_block->block_options.method.type); + const char* method_type_name = ezlopi_scene_get_scene_method_name(when_block->block_options.method.type); __cjson_add_string(cj_method, ezlopi_name_str, method_type_name ? method_type_name : ezlopi__str); } else @@ -228,10 +232,10 @@ static void ezlopi_scenes_cjson_add_when_block_options(cJSON *cj_block_array, l_ TRACE_E("Method type error"); } - cJSON *cj_args = cJSON_AddObjectToObject(cj_method, ezlopi_args_str); + cJSON* cj_args = cJSON_AddObjectToObject(cj_method, ezlopi_args_str); if (cj_args) { - l_fields_v2_t *curr_field = when_block->fields; + l_fields_v2_t* curr_field = when_block->fields; while (curr_field) { cJSON_AddStringToObject(cj_args, curr_field->name, curr_field->name); @@ -243,22 +247,22 @@ static void ezlopi_scenes_cjson_add_when_block_options(cJSON *cj_block_array, l_ } } -static void __cjson_add_action_block_options(cJSON *cj_block_array, l_action_block_v2_t *action_block) +static void __cjson_add_action_block_options(cJSON* cj_block_array, l_action_block_v2_t* action_block) { if (cj_block_array && action_block) { - cJSON *cj_block_options = cJSON_AddObjectToObject(cj_block_array, ezlopi_blockOptions_str); + cJSON* cj_block_options = cJSON_AddObjectToObject(cj_block_array, ezlopi_blockOptions_str); if (cj_block_options) { - cJSON *cj_method = cJSON_AddObjectToObject(cj_block_options, ezlopi_method_str); + cJSON* cj_method = cJSON_AddObjectToObject(cj_block_options, ezlopi_method_str); if (cj_method) { if ((action_block->block_options.method.type > EZLOPI_SCENE_METHOD_TYPE_NONE) && (action_block->block_options.method.type < EZLOPI_SCENE_METHOD_TYPE_MAX)) { - const char *method_type_name = ezlopi_scene_get_scene_method_name(action_block->block_options.method.type); + const char* method_type_name = ezlopi_scene_get_scene_method_name(action_block->block_options.method.type); __cjson_add_string(cj_method, ezlopi_name_str, method_type_name ? method_type_name : ezlopi__str); } else @@ -266,10 +270,10 @@ static void __cjson_add_action_block_options(cJSON *cj_block_array, l_action_blo TRACE_E("Method type error"); } - cJSON *cj_args = cJSON_AddObjectToObject(cj_method, ezlopi_args_str); + cJSON* cj_args = cJSON_AddObjectToObject(cj_method, ezlopi_args_str); if (cj_args) { - l_fields_v2_t *curr_field = action_block->fields; + l_fields_v2_t* curr_field = action_block->fields; while (curr_field) { cJSON_AddStringToObject(cj_args, curr_field->name, curr_field->name); @@ -281,13 +285,13 @@ static void __cjson_add_action_block_options(cJSON *cj_block_array, l_action_blo } } -static void __cjson_add_action_delay(cJSON *cj_action_block, s_action_delay_v2_t *action_delay) +static void __cjson_add_action_delay(cJSON* cj_action_block, s_action_delay_v2_t* action_delay) { if (cj_action_block && action_delay) { if (action_delay->days || action_delay->hours || action_delay->minutes || action_delay->seconds) { - cJSON *cj_action_delay = cJSON_AddObjectToObject(cj_action_block, ezlopi_delay_str); + cJSON* cj_action_delay = cJSON_AddObjectToObject(cj_action_block, ezlopi_delay_str); if (cj_action_delay) { cJSON_AddNumberToObject(cj_action_delay, "days", action_delay->days); @@ -299,21 +303,21 @@ static void __cjson_add_action_delay(cJSON *cj_action_block, s_action_delay_v2_t } } -static void __cjson_add_fields(cJSON *cj_block, l_fields_v2_t *fields) +static void __cjson_add_fields(cJSON* cj_block, l_fields_v2_t* fields) { if (cj_block) { - cJSON *cj_fields_array = cJSON_AddArrayToObject(cj_block, ezlopi_fields_str); + cJSON* cj_fields_array = cJSON_AddArrayToObject(cj_block, ezlopi_fields_str); if (cj_fields_array) { - l_fields_v2_t *curr_field = fields; + l_fields_v2_t* curr_field = fields; while (curr_field) { - cJSON *cj_field = cJSON_CreateObject(); + cJSON* cj_field = cJSON_CreateObject(); if (cj_field) { __cjson_add_string(cj_field, ezlopi_name_str, curr_field->name); - const char *value_type_name = ezlopi_scene_get_scene_value_type_name(curr_field->value_type); + const char* value_type_name = ezlopi_scene_get_scene_value_type_name(curr_field->value_type); __cjson_add_string(cj_field, ezlopi_type_str, value_type_name ? value_type_name : ezlopi__str); switch (curr_field->value_type) @@ -324,12 +328,13 @@ static void __cjson_add_fields(cJSON *cj_block, l_fields_v2_t *fields) } case EZLOPI_VALUE_TYPE_INT: { - cJSON_AddNumberToObject(cj_field, ezlopi_value_str, curr_field->value.value_double); + cJSON_AddNumberToObject(cj_field, ezlopi_value_str, curr_field->field_value.u_value.value_double); + // cJSON_AddNumberToObject(cj_field, ezlopi_value_str, curr_field->field_value.u_value.value_double); break; } case EZLOPI_VALUE_TYPE_BOOL: { - if (0 == curr_field->value.value_double) + if (0 == curr_field->field_value.u_value.value_double) { cJSON_AddFalseToObject(cj_field, ezlopi_value_str); } @@ -341,33 +346,33 @@ static void __cjson_add_fields(cJSON *cj_block, l_fields_v2_t *fields) } case EZLOPI_VALUE_TYPE_FLOAT: { - cJSON_AddNumberToObject(cj_field, ezlopi_value_str, curr_field->value.value_double); + cJSON_AddNumberToObject(cj_field, ezlopi_value_str, curr_field->field_value.u_value.value_double); break; } case EZLOPI_VALUE_TYPE_STRING: { - __cjson_add_string(cj_field, ezlopi_value_str, curr_field->value.value_string); + __cjson_add_string(cj_field, ezlopi_value_str, curr_field->field_value.u_value.value_string); break; } case EZLOPI_VALUE_TYPE_ITEM: { - __cjson_add_string(cj_field, ezlopi_value_str, curr_field->value.value_string); + __cjson_add_string(cj_field, ezlopi_value_str, curr_field->field_value.u_value.value_string); break; } case EZLOPI_VALUE_TYPE_INTERVAL: { - __cjson_add_string(cj_field, ezlopi_value_str, curr_field->value.value_string); + __cjson_add_string(cj_field, ezlopi_value_str, curr_field->field_value.u_value.value_string); break; } case EZLOPI_VALUE_TYPE_BLOCKS: { - cJSON *vlaue_block_array = cJSON_AddArrayToObject(cj_field, ezlopi_value_str); + cJSON* vlaue_block_array = cJSON_AddArrayToObject(cj_field, ezlopi_value_str); if (vlaue_block_array) { - l_when_block_v2_t *curr_when_block = curr_field->value.when_block; + l_when_block_v2_t* curr_when_block = curr_field->field_value.u_value.when_block; while (curr_when_block) { - cJSON *cj_when_block = NULL; + cJSON* cj_when_block = NULL; // ezlopi_scenes_cjson_create_when_block(curr_when_block); if (cj_when_block) { @@ -386,12 +391,12 @@ static void __cjson_add_fields(cJSON *cj_block, l_fields_v2_t *fields) case EZLOPI_VALUE_TYPE_HOUSE_MODE_ID: { char id_str[32]; - snprintf(id_str, sizeof(id_str), "%u", (uint32_t)curr_field->value.value_double); + snprintf(id_str, sizeof(id_str), "%u", (uint32_t)curr_field->field_value.u_value.value_double); break; } case EZLOPI_VALUE_TYPE_HOUSE_MODE_ID_ARRAY: { - cJSON_AddItemReferenceToObject(cj_field, ezlopi_value_str, curr_field->value.cj_value); + cJSON_AddItemReferenceToObject(cj_field, ezlopi_value_str, curr_field->field_value.u_value.cj_value); break; } case EZLOPI_VALUE_TYPE_DICTIONARY: @@ -460,7 +465,7 @@ static void __cjson_add_fields(cJSON *cj_block, l_fields_v2_t *fields) } default: { - const char *value_type_name = ezlopi_scene_get_scene_value_type_name(curr_field->value_type); + const char* value_type_name = ezlopi_scene_get_scene_value_type_name(curr_field->value_type); TRACE_E("Value type not matched!, curr-type[%d]: %s ", curr_field->value_type, value_type_name ? value_type_name : ezlopi_null_str); break; } @@ -478,9 +483,9 @@ static void __cjson_add_fields(cJSON *cj_block, l_fields_v2_t *fields) } } -cJSON *ezlopi_scenes_cjson_create_action_block(l_action_block_v2_t *action_block, char *block_type_str) +cJSON* ezlopi_scenes_cjson_create_action_block(l_action_block_v2_t* action_block, char* block_type_str) { - cJSON *cj_action_block = NULL; + cJSON* cj_action_block = NULL; if (action_block) { cj_action_block = cJSON_CreateObject(); @@ -496,17 +501,17 @@ cJSON *ezlopi_scenes_cjson_create_action_block(l_action_block_v2_t *action_block return cj_action_block; } -void ezlopi_scenes_cjson_add_action_blocks(cJSON *root, l_action_block_v2_t *action_blocks, const char *block_type_str) +void ezlopi_scenes_cjson_add_action_blocks(cJSON* root, l_action_block_v2_t* action_blocks, const char* block_type_str) { if (root && action_blocks) { - cJSON *cj_then_block_array = cJSON_AddArrayToObject(root, block_type_str); + cJSON* cj_then_block_array = cJSON_AddArrayToObject(root, block_type_str); if (cj_then_block_array) { while (action_blocks) { - cJSON *cj_then_block = ezlopi_scenes_cjson_create_action_block(action_blocks, (char *)block_type_str); + cJSON* cj_then_block = ezlopi_scenes_cjson_create_action_block(action_blocks, (char*)block_type_str); if (cj_then_block) { if (!cJSON_AddItemToArray(cj_then_block_array, cj_then_block)) @@ -521,9 +526,9 @@ void ezlopi_scenes_cjson_add_action_blocks(cJSON *root, l_action_block_v2_t *act } } -cJSON *ezlopi_scenes_cjson_create_when_block(l_when_block_v2_t *when_block) +cJSON* ezlopi_scenes_cjson_create_when_block(l_when_block_v2_t* when_block) { - cJSON *cj_when_block = NULL; + cJSON* cj_when_block = NULL; if (when_block) { cj_when_block = cJSON_CreateObject(); @@ -538,16 +543,16 @@ cJSON *ezlopi_scenes_cjson_create_when_block(l_when_block_v2_t *when_block) return cj_when_block; } -void ezlopi_scenes_cjson_add_when_blocks(cJSON *root, l_when_block_v2_t *when_block_node) +void ezlopi_scenes_cjson_add_when_blocks(cJSON* root, l_when_block_v2_t* when_block_node) { if (root) { - cJSON *cj_when_block_array = cJSON_AddArrayToObject(root, ezlopi_when_str); + cJSON* cj_when_block_array = cJSON_AddArrayToObject(root, ezlopi_when_str); if (cj_when_block_array) { while (when_block_node) { - cJSON *cj_when_block = ezlopi_scenes_cjson_create_when_block(when_block_node); + cJSON* cj_when_block = ezlopi_scenes_cjson_create_when_block(when_block_node); if (cj_when_block) { if (!cJSON_AddItemToArray(cj_when_block_array, cj_when_block)) @@ -562,15 +567,15 @@ void ezlopi_scenes_cjson_add_when_blocks(cJSON *root, l_when_block_v2_t *when_bl } } -cJSON *ezlopi_scenes_create_cjson_scene(l_scenes_list_v2_t *scene) +cJSON* ezlopi_scenes_create_cjson_scene(l_scenes_list_v2_t* scene) { - cJSON *cj_scene = NULL; + cJSON* cj_scene = NULL; if (scene) { cj_scene = cJSON_CreateObject(); if (cj_scene) { - char tmp_str[16] = {0}; + char tmp_str[16] = { 0 }; snprintf(tmp_str, sizeof(tmp_str), "%08x", scene->_id); cJSON_AddStringToObject(cj_scene, ezlopi__id_str, tmp_str); cJSON_AddBoolToObject(cj_scene, ezlopi_enabled_str, scene->enabled); @@ -591,14 +596,14 @@ cJSON *ezlopi_scenes_create_cjson_scene(l_scenes_list_v2_t *scene) return cj_scene; } -cJSON *ezlopi_scenes_create_cjson_scene_list(l_scenes_list_v2_t *scenes_list) +cJSON* ezlopi_scenes_create_cjson_scene_list(l_scenes_list_v2_t* scenes_list) { - cJSON *cj_scenes_array = cJSON_CreateArray(); + cJSON* cj_scenes_array = cJSON_CreateArray(); if (cj_scenes_array) { while (scenes_list) { - cJSON *cj_scene = ezlopi_scenes_create_cjson_scene(scenes_list); + cJSON* cj_scene = ezlopi_scenes_create_cjson_scene(scenes_list); if (cj_scene) { if (!cJSON_AddItemToArray(cj_scenes_array, cj_scene)) @@ -613,11 +618,11 @@ cJSON *ezlopi_scenes_create_cjson_scene_list(l_scenes_list_v2_t *scenes_list) return cj_scenes_array; } -char *ezlopi_scenes_create_json_string(l_scenes_list_v2_t *scenes_list) +char* ezlopi_scenes_create_json_string(l_scenes_list_v2_t* scenes_list) { - char *scenes_list_str = NULL; + char* scenes_list_str = NULL; - cJSON *cj_scenes_array = ezlopi_scenes_create_cjson_scene_list(scenes_list); + cJSON* cj_scenes_array = ezlopi_scenes_create_cjson_scene_list(scenes_list); if (cj_scenes_array) { scenes_list_str = cJSON_Print(cj_scenes_array); @@ -631,7 +636,7 @@ char *ezlopi_scenes_create_json_string(l_scenes_list_v2_t *scenes_list) return scenes_list_str; } -static void __cjson_add_string(cJSON *root, const char *key, const char *value) +static void __cjson_add_string(cJSON* root, const char* key, const char* value) { if (root && key && value) { diff --git a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_delete.c b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_delete.c index 927763985..d3243a043 100755 --- a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_delete.c +++ b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_delete.c @@ -2,7 +2,7 @@ #include "ezlopi_core_scenes_v2.h" -void ezlopi_scenes_delete_user_notifications(l_user_notification_v2_t *user_notifications) +void ezlopi_scenes_delete_user_notifications(l_user_notification_v2_t* user_notifications) { if (user_notifications) { @@ -12,7 +12,7 @@ void ezlopi_scenes_delete_user_notifications(l_user_notification_v2_t *user_noti } } -void ezlopi_scenes_delete_house_modes(l_house_modes_v2_t *house_modes) +void ezlopi_scenes_delete_house_modes(l_house_modes_v2_t* house_modes) { if (house_modes) { @@ -22,7 +22,7 @@ void ezlopi_scenes_delete_house_modes(l_house_modes_v2_t *house_modes) } } -void ezlopi_scenes_delete_fields(l_fields_v2_t *fields) +void ezlopi_scenes_delete_fields(l_fields_v2_t* fields) { if (fields) { @@ -34,7 +34,7 @@ void ezlopi_scenes_delete_fields(l_fields_v2_t *fields) } } -void ezlopi_scenes_delete_action_blocks(l_action_block_v2_t *action_blocks) +void ezlopi_scenes_delete_action_blocks(l_action_block_v2_t* action_blocks) { if (action_blocks) { @@ -45,7 +45,7 @@ void ezlopi_scenes_delete_action_blocks(l_action_block_v2_t *action_blocks) } } -void ezlopi_scenes_delete_when_blocks(l_when_block_v2_t *when_blocks) +void ezlopi_scenes_delete_when_blocks(l_when_block_v2_t* when_blocks) { if (when_blocks) { @@ -56,7 +56,7 @@ void ezlopi_scenes_delete_when_blocks(l_when_block_v2_t *when_blocks) } } -void ezlopi_scenes_delete(l_scenes_list_v2_t *scenes_list) +void ezlopi_scenes_delete(l_scenes_list_v2_t* scenes_list) { if (scenes_list) { @@ -77,44 +77,59 @@ void ezlopi_scenes_delete(l_scenes_list_v2_t *scenes_list) // ezlopi_scenes_delete(ezlopi_scenes_pop_by_id_v2(_id)); // } -void ezlopi_scenes_delete_field_value(l_fields_v2_t *field) +void ezlopi_scenes_delete_field_value(l_fields_v2_t* field) { - switch (field->value.type) + switch (field->field_value.e_type) + // switch (field->value.type) { case VALUE_TYPE_NUMBER: { - field->value.value_double = 0; + field->field_value.u_value.value_double = 0; + // field->value.value_double = 0; break; } case VALUE_TYPE_STRING: { - if (field->value.value_string) + if (field->field_value.u_value.value_string) + // if (field->value.value_string) { - free(field->value.value_string); - field->value.value_string = NULL; + free(field->field_value.u_value.value_string); + field->field_value.u_value.value_string = NULL; + + // free(field->value.value_string); + // field->value.value_string = NULL; } break; } case VALUE_TYPE_BOOL: { - field->value.value_bool = false; + field->field_value.u_value.value_bool = false; + // field->value.value_bool = false; break; } case VALUE_TYPE_CJSON: { - if (field->value.cj_value) + if (field->field_value.u_value.cj_value) + // if (field->value.cj_value) { - cJSON_Delete(field->value.cj_value); - field->value.cj_value = NULL; + cJSON_Delete(field->field_value.u_value.cj_value); + field->field_value.u_value.cj_value = NULL; + + // cJSON_Delete(field->value.cj_value); + // field->value.cj_value = NULL; } break; } case VALUE_TYPE_BLOCK: { - if (field->value.when_block) + if (field->field_value.u_value.when_block) + // if (field->value.when_block) { - ezlopi_scenes_delete_when_blocks(field->value.when_block); - field->value.when_block = NULL; + ezlopi_scenes_delete_when_blocks(field->field_value.u_value.when_block); + field->field_value.u_value.when_block = NULL; + + // ezlopi_scenes_delete_when_blocks(field->value.when_block); + // field->value.when_block = NULL; } break; } diff --git a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_operators.c b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_operators.c index 814ab7cbe..29923e684 100755 --- a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_operators.c +++ b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_operators.c @@ -10,25 +10,25 @@ #include "ezlopi_cloud_constants.h" /************* Numeric ************/ -static const char *const ezlopi_scenes_num_cmp_operators_op[] = { +static const char* const ezlopi_scenes_num_cmp_operators_op[] = { #define SCENES_NUM_COMP_OPERATORS(OPERATOR, op, name, method) op, #include "__operators_macros/__numeric_comparision_operators_macros.h" #undef SCENES_NUM_COMP_OPERATORS }; -static const char *const ezlopi_scenes_num_cmp_operators_name[] = { +static const char* const ezlopi_scenes_num_cmp_operators_name[] = { #define SCENES_NUM_COMP_OPERATORS(OPERATOR, op, name, method) name, #include "__operators_macros/__numeric_comparision_operators_macros.h" #undef SCENES_NUM_COMP_OPERATORS }; -static const char *const ezlopi_scenes_num_cmp_operators_method[] = { +static const char* const ezlopi_scenes_num_cmp_operators_method[] = { #define SCENES_NUM_COMP_OPERATORS(OPERATOR, op, name, method) method, #include "__operators_macros/__numeric_comparision_operators_macros.h" #undef SCENES_NUM_COMP_OPERATORS }; -e_scene_num_cmp_operators_t ezlopi_scenes_numeric_comparator_operators_get_enum(char *operator_str) +e_scene_num_cmp_operators_t ezlopi_scenes_numeric_comparator_operators_get_enum(char* operator_str) { e_scene_num_cmp_operators_t ret = SCENES_NUM_COMP_OPERATORS_NONE + 1; if (operator_str) @@ -45,9 +45,9 @@ e_scene_num_cmp_operators_t ezlopi_scenes_numeric_comparator_operators_get_enum( return ret; } -const char *ezlopi_scenes_numeric_comparator_operators_get_op(e_scene_num_cmp_operators_t operator) +const char* ezlopi_scenes_numeric_comparator_operators_get_op(e_scene_num_cmp_operators_t operator) { - const char *ret = NULL; + const char* ret = NULL; if ((operator> SCENES_NUM_COMP_OPERATORS_NONE) && (operator SCENES_NUM_COMP_OPERATORS_NONE) && (operator SCENES_NUM_COMP_OPERATORS_NONE) && (operatoritems; + l_ezlopi_item_t* item = device->items; while (item) { if (item->cloud_properties.item_id == item_id) { if (cj_item_value) { - item->func(EZLOPI_ACTION_GET_EZLOPI_VALUE, item, (void *)cj_item_value, NULL); - cJSON *cj_value = cJSON_GetObjectItem(cj_item_value, ezlopi_value_str); + item->func(EZLOPI_ACTION_GET_EZLOPI_VALUE, item, (void*)cj_item_value, NULL); + cJSON* cj_value = cJSON_GetObjectItem(cj_item_value, ezlopi_value_str); if (cj_value) { item_value = cj_value->valuedouble; @@ -109,36 +109,36 @@ int ezlopi_scenes_operators_value_number_operations(uint32_t item_id, l_fields_v device = device->next; } - switch (ezlopi_scenes_numeric_comparator_operators_get_enum(comparator_field->value.value_string)) + switch (ezlopi_scenes_numeric_comparator_operators_get_enum(comparator_field->field_value.u_value.value_string)) { case SCENES_NUM_COMP_OPERATORS_LESS: { - ret = (item_value < value_field->value.value_double); + ret = (item_value < value_field->field_value.u_value.value_double); break; } case SCENES_NUM_COMP_OPERATORS_LESS_EQUAL: { - ret = (item_value <= value_field->value.value_double); + ret = (item_value <= value_field->field_value.u_value.value_double); break; } case SCENES_NUM_COMP_OPERATORS_GREATER: { - ret = (item_value > value_field->value.value_double); + ret = (item_value > value_field->field_value.u_value.value_double); break; } case SCENES_NUM_COMP_OPERATORS_GREATER_EQUAL: { - ret = (item_value >= value_field->value.value_double); + ret = (item_value >= value_field->field_value.u_value.value_double); break; } case SCENES_NUM_COMP_OPERATORS_EQUAL: { - ret = (item_value == value_field->value.value_double); + ret = (item_value == value_field->field_value.u_value.value_double); break; } case SCENES_NUM_COMP_OPERATORS_NOT_EQUAL: { - ret = (item_value != value_field->value.value_double); + ret = (item_value != value_field->field_value.u_value.value_double); break; } case SCENES_NUM_COMP_OPERATORS_BETWEEN: @@ -179,25 +179,25 @@ int ezlopi_scenes_operators_value_number_operations(uint32_t item_id, l_fields_v } /************* Strings ************/ -static const char *const ezlopi_scenes_str_cmp_operators_op[] = { +static const char* const ezlopi_scenes_str_cmp_operators_op[] = { #define SCENES_STRINGS_OPERATORS(OPERATOR, op, name, method) op, #include "__operators_macros/__strings_comparision_operators_macros.h" #undef SCENES_STRINGS_OPERATORS }; -static const char *const ezlopi_scenes_str_cmp_operators_name[] = { +static const char* const ezlopi_scenes_str_cmp_operators_name[] = { #define SCENES_STRINGS_OPERATORS(OPERATOR, op, name, method) name, #include "__operators_macros/__strings_comparision_operators_macros.h" #undef SCENES_STRINGS_OPERATORS }; -static const char *const ezlopi_scenes_str_cmp_operators_method[] = { +static const char* const ezlopi_scenes_str_cmp_operators_method[] = { #define SCENES_STRINGS_OPERATORS(OPERATOR, op, name, method) method, #include "__operators_macros/__strings_comparision_operators_macros.h" #undef SCENES_STRINGS_OPERATORS }; -e_scene_str_cmp_operators_t ezlopi_scenes_strings_comparator_operators_get_enum(char *operator_str) +e_scene_str_cmp_operators_t ezlopi_scenes_strings_comparator_operators_get_enum(char* operator_str) { e_scene_str_cmp_operators_t ret = SCENES_STRINGS_OPERATORS_NONE + 1; if (operator_str) @@ -216,9 +216,9 @@ e_scene_str_cmp_operators_t ezlopi_scenes_strings_comparator_operators_get_enum( return ret; } -const char *ezlopi_scenes_strings_comparator_operators_get_op(e_scene_str_cmp_operators_t operator) +const char* ezlopi_scenes_strings_comparator_operators_get_op(e_scene_str_cmp_operators_t operator) { - const char *ret = NULL; + const char* ret = NULL; if ((operator>= SCENES_STRINGS_OPERATORS_NONE) && (operator SCENES_STRINGS_OPERATORS_NONE) && (operator SCENES_STRINGS_OPERATORS_NONE) && (operatoritems; + l_ezlopi_item_t* item = device->items; while (item) { if (item->cloud_properties.item_id == item_id) { if (cj_item_value) { - item->func(EZLOPI_ACTION_GET_EZLOPI_VALUE, item, (void *)cj_item_value, NULL); - cJSON *cj_value = cJSON_GetObjectItem(cj_item_value, ezlopi_value_str); + item->func(EZLOPI_ACTION_GET_EZLOPI_VALUE, item, (void*)cj_item_value, NULL); + cJSON* cj_value = cJSON_GetObjectItem(cj_item_value, ezlopi_value_str); if (cj_value) { -#warning "Krishna needs to complete this" - item_value = cj_value->valuedouble; + #warning "Krishna needs to complete this" + item_value = cj_value->valuedouble; } } @@ -279,7 +279,7 @@ int ezlopi_scenes_operators_value_strings_operations(uint32_t item_id, l_fields_ device = device->next; } - e_scene_str_cmp_operators_t string_operator = ezlopi_scenes_strings_comparator_operators_get_enum(comparator_field->value.value_string); + e_scene_str_cmp_operators_t string_operator = ezlopi_scenes_strings_comparator_operators_get_enum(comparator_field->field_value.u_value.value_string); switch (string_operator) { @@ -370,25 +370,25 @@ int ezlopi_scenes_operators_value_strings_operations(uint32_t item_id, l_fields_ } /************* Values with Less ************/ -static const char *const ezlopi_scenes_value_with_less_cmp_operators_op[] = { +static const char* const ezlopi_scenes_value_with_less_cmp_operators_op[] = { #define SCENES_VALUES_WITH_LESS_OPERATORS(OPERATOR, op, name, method) op, #include "__operators_macros/__value_with_less_comparision_operators_macros.h" #undef SCENES_VALUES_WITH_LESS_OPERATORS }; -static const char *const ezlopi_scenes_value_with_less_cmp_operators_name[] = { +static const char* const ezlopi_scenes_value_with_less_cmp_operators_name[] = { #define SCENES_VALUES_WITH_LESS_OPERATORS(OPERATOR, op, name, method) name, #include "__operators_macros/__value_with_less_comparision_operators_macros.h" #undef SCENES_VALUES_WITH_LESS_OPERATORS }; -static const char *const ezlopi_scenes_value_with_less_cmp_operators_method[] = { +static const char* const ezlopi_scenes_value_with_less_cmp_operators_method[] = { #define SCENES_VALUES_WITH_LESS_OPERATORS(OPERATOR, op, name, method) method, #include "__operators_macros/__value_with_less_comparision_operators_macros.h" #undef SCENES_VALUES_WITH_LESS_OPERATORS }; -e_scene_value_with_less_cmp_operators_t ezlopi_scenes_value_with_less_comparator_operators_get_enum(char *operator_str) +e_scene_value_with_less_cmp_operators_t ezlopi_scenes_value_with_less_comparator_operators_get_enum(char* operator_str) { e_scene_value_with_less_cmp_operators_t ret = SCENES_VALUES_WITH_LESS_OPERATORS_NONE + 1; if (operator_str) @@ -407,9 +407,9 @@ e_scene_value_with_less_cmp_operators_t ezlopi_scenes_value_with_less_comparator return ret; } -const char *ezlopi_scenes_value_with_less_comparator_operators_get_op(e_scene_value_with_less_cmp_operators_t operator) +const char* ezlopi_scenes_value_with_less_comparator_operators_get_op(e_scene_value_with_less_cmp_operators_t operator) { - const char *ret = NULL; + const char* ret = NULL; if ((operator>= SCENES_VALUES_WITH_LESS_OPERATORS_NONE) && (operator SCENES_VALUES_WITH_LESS_OPERATORS_NONE) && (operator SCENES_VALUES_WITH_LESS_OPERATORS_NONE) && (operatoritems; + l_ezlopi_item_t* item = device->items; while (item) { if (item->cloud_properties.item_id == item_id) { if (cj_item_value) { - item->func(EZLOPI_ACTION_GET_EZLOPI_VALUE, item, (void *)cj_item_value, NULL); - cJSON *cj_value = cJSON_GetObjectItem(cj_item_value, ezlopi_value_str); + item->func(EZLOPI_ACTION_GET_EZLOPI_VALUE, item, (void*)cj_item_value, NULL); + cJSON* cj_value = cJSON_GetObjectItem(cj_item_value, ezlopi_value_str); if (cj_value) { -#warning "Krishna needs to complete this" - item_value = cj_value->valuedouble; + #warning "Krishna needs to complete this" + item_value = cj_value->valuedouble; } } @@ -470,7 +470,7 @@ int ezlopi_scenes_operators_value_with_less_operations(uint32_t item_id, l_field device = device->next; } - e_scene_value_with_less_cmp_operators_t value_with_less_operator = ezlopi_scenes_value_with_less_comparator_operators_get_enum(comparator_field->value.value_string); + e_scene_value_with_less_cmp_operators_t value_with_less_operator = ezlopi_scenes_value_with_less_comparator_operators_get_enum(comparator_field->field_value.u_value.value_string); switch (value_with_less_operator) { @@ -521,25 +521,25 @@ int ezlopi_scenes_operators_value_with_less_operations(uint32_t item_id, l_field } /************* Values without less ************/ -static const char *const ezlopi_scenes_value_without_less_cmp_operators_op[] = { +static const char* const ezlopi_scenes_value_without_less_cmp_operators_op[] = { #define SCENES_VALUES_WITHOUT_LESS_OPERATORS(OPERATOR, op, name, method) op, #include "__operators_macros/__value_without_less_comparision_operators_macros.h" #undef SCENES_VALUES_WITHOUT_LESS_OPERATORS }; -static const char *const ezlopi_scenes_value_without_less_cmp_operators_name[] = { +static const char* const ezlopi_scenes_value_without_less_cmp_operators_name[] = { #define SCENES_VALUES_WITHOUT_LESS_OPERATORS(OPERATOR, op, name, method) name, #include "__operators_macros/__value_without_less_comparision_operators_macros.h" #undef SCENES_VALUES_WITHOUT_LESS_OPERATORS }; -static const char *const ezlopi_scenes_value_without_less_cmp_operators_method[] = { +static const char* const ezlopi_scenes_value_without_less_cmp_operators_method[] = { #define SCENES_VALUES_WITHOUT_LESS_OPERATORS(OPERATOR, op, name, method) method, #include "__operators_macros/__value_without_less_comparision_operators_macros.h" #undef SCENES_VALUES_WITHOUT_LESS_OPERATORS }; -e_scene_value_without_less_cmp_operators_t ezlopi_scenes_value_without_less_comparator_operators_get_enum(char *operator_str) +e_scene_value_without_less_cmp_operators_t ezlopi_scenes_value_without_less_comparator_operators_get_enum(char* operator_str) { e_scene_value_without_less_cmp_operators_t ret = SCENES_VALUES_WITHOUT_LESS_OPERATORS_NONE + 1; // 1st element of enum after *_NONE if (operator_str) @@ -558,9 +558,9 @@ e_scene_value_without_less_cmp_operators_t ezlopi_scenes_value_without_less_comp return ret; } -const char *ezlopi_scenes_value_without_less_comparator_operators_get_op(e_scene_value_without_less_cmp_operators_t operator) +const char* ezlopi_scenes_value_without_less_comparator_operators_get_op(e_scene_value_without_less_cmp_operators_t operator) { - const char *ret = NULL; + const char* ret = NULL; if ((operator>= SCENES_VALUES_WITHOUT_LESS_OPERATORS_NONE) && (operator SCENES_VALUES_WITHOUT_LESS_OPERATORS_NONE) && (operator SCENES_VALUES_WITHOUT_LESS_OPERATORS_NONE) && (operatoritems; + l_ezlopi_item_t* item = device->items; while (item) { if (item->cloud_properties.item_id == item_id) { if (cj_item_value) { - item->func(EZLOPI_ACTION_GET_EZLOPI_VALUE, item, (void *)cj_item_value, NULL); - cJSON *cj_value = cJSON_GetObjectItem(cj_item_value, ezlopi_value_str); + item->func(EZLOPI_ACTION_GET_EZLOPI_VALUE, item, (void*)cj_item_value, NULL); + cJSON* cj_value = cJSON_GetObjectItem(cj_item_value, ezlopi_value_str); if (cj_value) { -#warning "Krishna needs to complete this" - item_value = cj_value->valuedouble; + #warning "Krishna needs to complete this" + item_value = cj_value->valuedouble; } } @@ -623,7 +623,7 @@ int ezlopi_scenes_operators_value_without_less_operations(uint32_t item_id, l_fi device = device->next; } - e_scene_value_without_less_cmp_operators_t value_without_less_operator = ezlopi_scenes_value_without_less_comparator_operators_get_enum(comparator_field->value.value_string); + e_scene_value_without_less_cmp_operators_t value_without_less_operator = ezlopi_scenes_value_without_less_comparator_operators_get_enum(comparator_field->field_value.u_value.value_string); switch (value_without_less_operator) { diff --git a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_populate.c b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_populate.c index 4bcf5c7a3..807faa13a 100644 --- a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_populate.c +++ b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_populate.c @@ -352,20 +352,21 @@ void ezlopi_scenes_populate_fields_get_value(l_fields_v2_t* field, cJSON* cj_val { case cJSON_Number: { - field->value.type = VALUE_TYPE_NUMBER; - field->value.value_double = cj_value->valuedouble; - TRACE_I("value: %f", field->value.value_double); + field->field_value.e_type = VALUE_TYPE_NUMBER; + field->field_value.u_value.value_double = cj_value->valuedouble; + + TRACE_I("value: %f", field->field_value.u_value.value_double); break; } case cJSON_String: { - field->value.type = VALUE_TYPE_STRING; + field->field_value.e_type = VALUE_TYPE_STRING; uint32_t value_len = strlen(cj_value->valuestring) + 1; - field->value.value_string = malloc(value_len); - if (field->value.value_string) + field->field_value.u_value.value_string = malloc(value_len); + if (field->field_value.u_value.value_string) { - snprintf(field->value.value_string, value_len, "%s", cj_value->valuestring); - TRACE_I("value: %s", field->value.value_string); + snprintf(field->field_value.u_value.value_string, value_len, "%s", cj_value->valuestring); + TRACE_I("value: %s", field->field_value.u_value.value_string); } else { @@ -375,36 +376,36 @@ void ezlopi_scenes_populate_fields_get_value(l_fields_v2_t* field, cJSON* cj_val } case cJSON_True: { - field->value.type = VALUE_TYPE_BOOL; - field->value.value_bool = true; + field->field_value.e_type = VALUE_TYPE_BOOL; + field->field_value.u_value.value_bool = true; TRACE_I("value: true"); break; } case cJSON_False: { - field->value.type = VALUE_TYPE_BOOL; - field->value.value_bool = false; + field->field_value.e_type = VALUE_TYPE_BOOL; + field->field_value.u_value.value_bool = false; TRACE_I("value: false"); break; } case cJSON_Object: { - field->value.type = VALUE_TYPE_CJSON; - field->value.cj_value = cJSON_Duplicate(cj_value, cJSON_True); - CJSON_TRACE("value", field->value.cj_value); + field->field_value.e_type = VALUE_TYPE_CJSON; + field->field_value.u_value.cj_value = cJSON_Duplicate(cj_value, cJSON_True); + CJSON_TRACE("value", field->field_value.u_value.cj_value); break; } case cJSON_Array: { int block_idx = 0; cJSON* cj_block = NULL; - field->value.type = VALUE_TYPE_BLOCK; + field->field_value.e_type = VALUE_TYPE_BLOCK; CJSON_TRACE("value", cj_value); l_when_block_v2_t* curr_when_block = NULL; while (NULL != (cj_block = cJSON_GetArrayItem(cj_value, block_idx++))) { - if (field->value.when_block) + if (field->field_value.u_value.when_block) { curr_when_block->next = (l_when_block_v2_t*)malloc(sizeof(l_when_block_v2_t)); if (curr_when_block->next) @@ -416,12 +417,12 @@ void ezlopi_scenes_populate_fields_get_value(l_fields_v2_t* field, cJSON* cj_val } else { - field->value.when_block = (l_when_block_v2_t*)malloc(sizeof(l_when_block_v2_t)); - if (field->value.when_block) + field->field_value.u_value.when_block = (l_when_block_v2_t*)malloc(sizeof(l_when_block_v2_t)); + if (field->field_value.u_value.when_block) { - memset(field->value.when_block, 0, sizeof(l_when_block_v2_t)); - ezlopi_scenes_populate_assign_when_block(field->value.when_block, cj_block); - curr_when_block = field->value.when_block; + memset(field->field_value.u_value.when_block, 0, sizeof(l_when_block_v2_t)); + ezlopi_scenes_populate_assign_when_block(field->field_value.u_value.when_block, cj_block); + curr_when_block = field->field_value.u_value.when_block; } } } @@ -429,7 +430,7 @@ void ezlopi_scenes_populate_fields_get_value(l_fields_v2_t* field, cJSON* cj_val } default: { - field->value.type = VALUE_TYPE_UNDEFINED; + field->field_value.e_type = VALUE_TYPE_UNDEFINED; TRACE_E("cj_value type: %d", cj_value->type); break; } diff --git a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_print.c b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_print.c index da5f18d04..2c8cd40ed 100755 --- a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_print.c +++ b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_print.c @@ -6,9 +6,9 @@ #include "ezlopi_cloud_constants.h" -void ezlopi_print_when_blocks(l_when_block_v2_t *when_blocks); +void ezlopi_print_when_blocks(l_when_block_v2_t* when_blocks); -void ezlopi_print_block_options(s_block_options_v2_t *block_options, l_fields_v2_t *fields) +void ezlopi_print_block_options(s_block_options_v2_t* block_options, l_fields_v2_t* fields) { TRACE_D("\t\t|-- blockOptions:"); TRACE_D("\t\t\t|-- method"); @@ -22,7 +22,7 @@ void ezlopi_print_block_options(s_block_options_v2_t *block_options, l_fields_v2 } } -void ezlopi_print_fields(l_fields_v2_t *fields) +void ezlopi_print_fields(l_fields_v2_t* fields) { TRACE_D("\t\t|-- fields: "); int field_count = 0; @@ -31,7 +31,7 @@ void ezlopi_print_fields(l_fields_v2_t *fields) TRACE_D("\t\t\t|---------- field_count: %d ----------", ++field_count); TRACE_D("\t\t\t|-- name: %s", fields->name); - const char *value_type_name = ezlopi_scene_get_scene_value_type_name(fields->value_type); + const char* value_type_name = ezlopi_scene_get_scene_value_type_name(fields->value_type); TRACE_D("\t\t\t|-- type: %s", value_type_name ? value_type_name : ezlopi__str); switch (fields->value_type) @@ -39,42 +39,44 @@ void ezlopi_print_fields(l_fields_v2_t *fields) case EZLOPI_VALUE_TYPE_INT: case EZLOPI_VALUE_TYPE_HOUSE_MODE_ID: { - TRACE_D("\t\t\t|-- value: %f", fields->value.value_double); + TRACE_D("\t\t\t|-- value: %f", fields->field_value.u_value.value_double); + // TRACE_D("\t\t\t|-- value: %f", fields->value.value_double); break; } case EZLOPI_VALUE_TYPE_BOOL: { - TRACE_D("\t\t\t|-- value: [%d]%s", fields->value.value_bool, fields->value.value_bool ? ezlopi_true_str : ezlopi_false_str); + TRACE_D("\t\t\t|-- value: [%d]%s", fields->field_value.u_value.value_bool, fields->field_value.u_value.value_bool ? ezlopi_true_str : ezlopi_false_str); + // TRACE_D("\t\t\t|-- value: [%d]%s", fields->value.value_bool, fields->value.value_bool ? ezlopi_true_str : ezlopi_false_str); break; } case EZLOPI_VALUE_TYPE_FLOAT: { - TRACE_D("\t\t\t|-- value: %f", fields->value.value_double); + TRACE_D("\t\t\t|-- value: %f", fields->field_value.u_value.value_double); break; } case EZLOPI_VALUE_TYPE_STRING: { - TRACE_D("\t\t\t|-- value: %s", fields->value.value_string); + TRACE_D("\t\t\t|-- value: %s", fields->field_value.u_value.value_string); break; } case EZLOPI_VALUE_TYPE_ITEM: { - TRACE_D("\t\t\t|-- value: %s", fields->value.value_string); + TRACE_D("\t\t\t|-- value: %s", fields->field_value.u_value.value_string); break; } case EZLOPI_VALUE_TYPE_INTERVAL: { - TRACE_D("\t\t\t|-- value: %s", fields->value.value_string); + TRACE_D("\t\t\t|-- value: %s", fields->field_value.u_value.value_string); break; } case EZLOPI_VALUE_TYPE_BLOCKS: { - ezlopi_print_when_blocks((l_when_block_v2_t *)fields->value.when_block); + ezlopi_print_when_blocks((l_when_block_v2_t*)fields->field_value.u_value.when_block); break; } case EZLOPI_VALUE_TYPE_HOUSE_MODE_ID_ARRAY: { - CJSON_TRACE("\t\t\t|-- value", fields->value.cj_value); + CJSON_TRACE("\t\t\t|-- value", fields->field_value.u_value.cj_value); break; } case EZLOPI_VALUE_TYPE_DICTIONARY: @@ -154,7 +156,7 @@ void ezlopi_print_fields(l_fields_v2_t *fields) TRACE_D("\t\t\t|------------------------------------"); } -void ezlopi_print_house_modes(l_house_modes_v2_t *house_modes) +void ezlopi_print_house_modes(l_house_modes_v2_t* house_modes) { TRACE_D("\t|-- house_modes: "); while (house_modes) @@ -164,7 +166,7 @@ void ezlopi_print_house_modes(l_house_modes_v2_t *house_modes) } } -void ezlopi_print_user_notifications(l_user_notification_v2_t *user_notification) +void ezlopi_print_user_notifications(l_user_notification_v2_t* user_notification) { TRACE_D("\t|-- user_notifications: "); while (user_notification) @@ -174,7 +176,7 @@ void ezlopi_print_user_notifications(l_user_notification_v2_t *user_notification } } -void ezlopi_print_when_blocks(l_when_block_v2_t *when_blocks) +void ezlopi_print_when_blocks(l_when_block_v2_t* when_blocks) { TRACE_D("\t|-- when: "); while (when_blocks) @@ -186,7 +188,7 @@ void ezlopi_print_when_blocks(l_when_block_v2_t *when_blocks) } } -void ezlopi_print_action_blocks(l_action_block_v2_t *action_block) +void ezlopi_print_action_blocks(l_action_block_v2_t* action_block) { while (action_block) { @@ -207,7 +209,7 @@ void ezlopi_print_action_blocks(l_action_block_v2_t *action_block) } } -void ezlopi_scenes_print(l_scenes_list_v2_t *scene_link_list) +void ezlopi_scenes_print(l_scenes_list_v2_t* scene_link_list) { int scene_count = 0; while (scene_link_list) diff --git a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_then_methods.c b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_then_methods.c index 3a9b3c573..0439752fe 100755 --- a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_then_methods.c +++ b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_then_methods.c @@ -5,53 +5,57 @@ #include "ezlopi_cloud_constants.h" -int ezlopi_scene_then_set_item_value(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_set_item_value(l_scenes_list_v2_t* curr_scene, void* arg) { int ret = 0; uint32_t item_id = 0; - cJSON *cj_params = cJSON_CreateObject(); + cJSON* cj_params = cJSON_CreateObject(); if (cj_params) { - l_action_block_v2_t *curr_then = (l_action_block_v2_t *)arg; + l_action_block_v2_t* curr_then = (l_action_block_v2_t*)arg; if (curr_then) { - l_fields_v2_t *curr_field = curr_then->fields; + l_fields_v2_t* curr_field = curr_then->fields; while (curr_field) { if (0 == strncmp(curr_field->name, "item", 4)) { - cJSON_AddStringToObject(cj_params, ezlopi__id_str, curr_field->value.value_string); - item_id = strtoul(curr_field->value.value_string, NULL, 16); - TRACE_D("item_id: %s", curr_field->value.value_string); + cJSON_AddStringToObject(cj_params, ezlopi__id_str, curr_field->field_value.u_value.value_string); + item_id = strtoul(curr_field->field_value.u_value.value_string, NULL, 16); + TRACE_D("item_id: %s", curr_field->field_value.u_value.value_string); + + // cJSON_AddStringToObject(cj_params, ezlopi__id_str, curr_field->field_value.u_value.value_string); + // item_id = strtoul(curr_field->field_value.u_value.value_string, NULL, 16); + // TRACE_D("item_id: %s", curr_field->field_value.u_value.value_string); } else if (0 == strncmp(curr_field->name, ezlopi_value_str, 5)) { if (EZLOPI_VALUE_TYPE_INT == curr_field->value_type) { - cJSON_AddNumberToObject(cj_params, ezlopi_value_str, curr_field->value.value_double); - TRACE_D("value: %f", curr_field->value.value_double); + cJSON_AddNumberToObject(cj_params, ezlopi_value_str, curr_field->field_value.u_value.value_double); + TRACE_D("value: %f", curr_field->field_value.u_value.value_double); } else if (EZLOPI_VALUE_TYPE_BOOL == curr_field->value_type) { - cJSON_AddBoolToObject(cj_params, ezlopi_value_str, curr_field->value.value_bool); - TRACE_D("value: %s", curr_field->value.value_bool ? ezlopi_true_str : ezlopi_false_str); + cJSON_AddBoolToObject(cj_params, ezlopi_value_str, curr_field->field_value.u_value.value_bool); + TRACE_D("value: %s", curr_field->field_value.u_value.value_bool ? ezlopi_true_str : ezlopi_false_str); } else if (EZLOPI_VALUE_TYPE_STRING == curr_field->value_type) { - cJSON_AddStringToObject(cj_params, ezlopi_value_str, curr_field->value.value_string); - TRACE_D("value: %s", curr_field->value.value_string); + cJSON_AddStringToObject(cj_params, ezlopi_value_str, curr_field->field_value.u_value.value_string); + TRACE_D("value: %s", curr_field->field_value.u_value.value_string); } } curr_field = curr_field->next; } - l_ezlopi_device_t *curr_device = ezlopi_device_get_head(); + l_ezlopi_device_t* curr_device = ezlopi_device_get_head(); uint32_t found_item = 0; while (curr_device) { - l_ezlopi_item_t *curr_item = curr_device->items; + l_ezlopi_item_t* curr_item = curr_device->items; while (curr_item) { if (item_id == curr_item->cloud_properties.item_id) @@ -76,82 +80,82 @@ int ezlopi_scene_then_set_item_value(l_scenes_list_v2_t *curr_scene, void *arg) return ret; } -int ezlopi_scene_then_set_device_armed(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_set_device_armed(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_send_cloud_abstract_command(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_send_cloud_abstract_command(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_switch_house_mode(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_switch_house_mode(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_send_http_request(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_send_http_request(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_run_custom_script(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_run_custom_script(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_run_plugin_script(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_run_plugin_script(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_run_scene(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_run_scene(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_set_scene_state(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_set_scene_state(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_reset_latch(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_reset_latch(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_reset_scene_latches(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_reset_scene_latches(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_reboot_hub(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_reboot_hub(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_reset_hub(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_reset_hub(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_cloud_api(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_cloud_api(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_set_expression(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_set_expression(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_set_variable(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_set_variable(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; } -int ezlopi_scene_then_toggle_value(l_scenes_list_v2_t *curr_scene, void *arg) +int ezlopi_scene_then_toggle_value(l_scenes_list_v2_t* curr_scene, void* arg) { TRACE_W("Warning: then-method not implemented!"); return 0; diff --git a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_v2.c b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_v2.c index 77a6caac2..95fcd8b14 100644 --- a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_v2.c +++ b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_v2.c @@ -745,32 +745,33 @@ static void _______fields_get_value(l_fields_v2_t* field, cJSON* cj_value) { if (field && cj_value) { + CJSON_TRACE("cj_value", cj_value); TRACE_I("type: %s", ezlopi_scene_get_scene_value_type_name(field->value_type)); switch (cj_value->type) { case cJSON_Number: { - field->value.type = VALUE_TYPE_NUMBER; - field->value.value_double = cj_value->valuedouble; - TRACE_I("value: %f", field->value.value_double); + field->field_value.e_type = VALUE_TYPE_NUMBER; + field->field_value.u_value.value_double = cj_value->valuedouble; + TRACE_I("value: %f", field->field_value.u_value.value_double); break; } case cJSON_String: { if (EZLOPI_VALUE_TYPE_HOUSE_MODE_ID == field->value_type) { - field->value.type = VALUE_TYPE_NUMBER; - field->value.value_double = strtoul(cj_value->valuestring, NULL, 16); + field->field_value.e_type = VALUE_TYPE_NUMBER; + field->field_value.u_value.value_double = strtoul(cj_value->valuestring, NULL, 16); } else { - field->value.type = VALUE_TYPE_STRING; + field->field_value.e_type = VALUE_TYPE_STRING; uint32_t value_len = strlen(cj_value->valuestring) + 1; - field->value.value_string = malloc(value_len); - if (field->value.value_string) + field->field_value.u_value.value_string = malloc(value_len); + if (field->field_value.u_value.value_string) { - snprintf(field->value.value_string, value_len, "%s", cj_value->valuestring); - TRACE_I("value: %s", field->value.value_string); + snprintf(field->field_value.u_value.value_string, value_len, "%s", cj_value->valuestring); + TRACE_I("value: %s", field->field_value.u_value.value_string); } else { @@ -781,23 +782,23 @@ static void _______fields_get_value(l_fields_v2_t* field, cJSON* cj_value) } case cJSON_True: { - field->value.type = VALUE_TYPE_BOOL; - field->value.value_bool = true; + field->field_value.e_type = VALUE_TYPE_BOOL; + field->field_value.u_value.value_bool = true; TRACE_I("value: true"); break; } case cJSON_False: { - field->value.type = VALUE_TYPE_BOOL; - field->value.value_bool = false; + field->field_value.e_type = VALUE_TYPE_BOOL; + field->field_value.u_value.value_bool = false; TRACE_I("value: false"); break; } case cJSON_Object: { - field->value.type = VALUE_TYPE_CJSON; - field->value.cj_value = cJSON_Duplicate(cj_value, cJSON_True); - CJSON_TRACE("value", field->value.cj_value); + field->field_value.e_type = VALUE_TYPE_CJSON; + field->field_value.u_value.cj_value = cJSON_Duplicate(cj_value, cJSON_True); + CJSON_TRACE("value", field->field_value.u_value.cj_value); break; } case cJSON_Array: @@ -810,20 +811,20 @@ static void _______fields_get_value(l_fields_v2_t* field, cJSON* cj_value) { case EZLOPI_VALUE_TYPE_HOUSE_MODE_ID_ARRAY: { - field->value.type = VALUE_TYPE_CJSON; - field->value.cj_value = cJSON_Duplicate(cj_value, cJSON_True); + field->field_value.e_type = VALUE_TYPE_CJSON; + field->field_value.u_value.cj_value = cJSON_Duplicate(cj_value, cJSON_True); break; } case EZLOPI_VALUE_TYPE_BLOCKS: { - field->value.type = VALUE_TYPE_BLOCK; + field->field_value.e_type = VALUE_TYPE_BLOCK; while (NULL != (cj_block = cJSON_GetArrayItem(cj_value, block_idx++))) { CJSON_TRACE("cj_block", cj_block); - if (field->value.when_block) + if (field->field_value.u_value.when_block) { - l_when_block_v2_t* curr_when_block = field->value.when_block; + l_when_block_v2_t* curr_when_block = field->field_value.u_value.when_block; while (curr_when_block->next) { curr_when_block = curr_when_block->next; @@ -832,7 +833,7 @@ static void _______fields_get_value(l_fields_v2_t* field, cJSON* cj_value) } else { - field->value.when_block = ____new_when_block_populate(cj_block); + field->field_value.u_value.when_block = ____new_when_block_populate(cj_block); } } break; @@ -846,7 +847,7 @@ static void _______fields_get_value(l_fields_v2_t* field, cJSON* cj_value) } default: { - field->value.type = VALUE_TYPE_UNDEFINED; + field->field_value.e_type = VALUE_TYPE_UNDEFINED; TRACE_E("cj_value type: %d", cj_value->type); break; } @@ -863,8 +864,10 @@ static l_fields_v2_t* ______new_field_populate(cJSON* cj_field) if (field) { memset(field, 0, sizeof(l_fields_v2_t)); - CJSON_GET_VALUE_STRING_BY_COPY(cj_field, ezlopi_name_str, field->name); + // field->field_value.u_value.when_block + + CJSON_GET_VALUE_STRING_BY_COPY(cj_field, ezlopi_name_str, field->name); field->value_type = ezlopi_core_scenes_value_get_type(cj_field, ezlopi_type_str); _______fields_get_value(field, cJSON_GetObjectItem(cj_field, ezlopi_value_str)); } diff --git a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_v2.h b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_v2.h index 8081aecc4..a4fa6de69 100644 --- a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_v2.h +++ b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_v2.h @@ -1,10 +1,12 @@ #ifndef _EZLOPI_CORE_SCENES_V2_H_ #define _EZLOPI_CORE_SCENES_V2_H_ -#include "ctype.h" -#include "cJSON.h" -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" +#include +#include +#include +#include +#include +#include #include "ezlopi_core_scenes_methods.h" @@ -67,24 +69,28 @@ typedef enum e_value_type typedef union u_field_value_v2 { - e_value_type_t type; - char *value_string; + char* value_string; double value_double; bool value_bool; - cJSON *cj_value; - struct l_when_block_v2 *when_block; - struct l_house_modes_v2_t *house_modes; + cJSON* cj_value; + struct l_when_block_v2* when_block; + struct l_house_modes_v2_t* house_modes; } u_field_value_v2_t; +typedef struct s_field_value { + e_value_type_t e_type; + u_field_value_v2_t u_value; +} s_field_value_t; + typedef struct l_fields_v2 { char name[32]; - e_scene_value_type_v2_t value_type; // 0: double, 1: string - u_field_value_v2_t value; - char *scale; - void *user_arg; // user by when-methods - struct l_fields_v2 *next; + s_field_value_t field_value; + char* scale; + void* user_arg; // user by when-methods + struct l_fields_v2* next; + } l_fields_v2_t; typedef struct l_action_block_v2 @@ -93,16 +99,16 @@ typedef struct l_action_block_v2 e_scenes_block_type_v2_t block_type; s_block_options_v2_t block_options; s_action_delay_v2_t delay; - l_fields_v2_t *fields; - struct l_action_block_v2 *next; + l_fields_v2_t* fields; + struct l_action_block_v2* next; } l_action_block_v2_t; typedef struct l_when_block_v2 { e_scenes_block_type_v2_t block_type; s_block_options_v2_t block_options; - l_fields_v2_t *fields; - struct l_when_block_v2 *next; + l_fields_v2_t* fields; + struct l_when_block_v2* next; } l_when_block_v2_t; // typedef struct l_else_block_v2 @@ -118,13 +124,13 @@ typedef struct l_when_block_v2 typedef struct l_user_notification_v2 { char user_id[32]; - struct l_user_notification_v2 *next; + struct l_user_notification_v2* next; } l_user_notification_v2_t; typedef struct l_house_modes_v2 { char house_mode[8]; - struct l_house_modes_v2 *next; + struct l_house_modes_v2* next; } l_house_modes_v2_t; typedef struct l_scenes_list_v2 @@ -141,45 +147,45 @@ typedef struct l_scenes_list_v2 char name[32]; char parent_id[32]; - l_user_notification_v2_t *user_notifications; - l_house_modes_v2_t *house_modes; - l_action_block_v2_t *then_block; - l_when_block_v2_t *when_block; - l_action_block_v2_t *else_block; + l_user_notification_v2_t* user_notifications; + l_house_modes_v2_t* house_modes; + l_action_block_v2_t* then_block; + l_when_block_v2_t* when_block; + l_action_block_v2_t* else_block; - struct l_scenes_list_v2 *next; + struct l_scenes_list_v2* next; } l_scenes_list_v2_t; -typedef int (*f_scene_method_v2_t)(l_scenes_list_v2_t *curr_scene, void *arg); +typedef int (*f_scene_method_v2_t)(l_scenes_list_v2_t* curr_scene, void* arg); void ezlopi_scenes_init_v2(void); -uint32_t ezlopi_store_new_scene_v2(cJSON *cj_new_scene); -uint32_t ezlopi_scenes_get_list_v2(cJSON *cj_scenes_array); -int ezlopi_scene_edit_by_id(uint32_t scene_id, cJSON *cj_scene); +uint32_t ezlopi_store_new_scene_v2(cJSON* cj_new_scene); +uint32_t ezlopi_scenes_get_list_v2(cJSON* cj_scenes_array); +int ezlopi_scene_edit_by_id(uint32_t scene_id, cJSON* cj_scene); -l_scenes_list_v2_t *ezlopi_scenes_get_scenes_head_v2(void); +l_scenes_list_v2_t* ezlopi_scenes_get_scenes_head_v2(void); f_scene_method_v2_t ezlopi_scene_get_method_v2(e_scene_method_type_t scene_method_type); -l_scenes_list_v2_t *ezlopi_scenes_get_by_id_v2(uint32_t _id); -l_scenes_list_v2_t *ezlopi_scenes_new_scene_populate(cJSON *cj_new_scene, uint32_t scene_id); +l_scenes_list_v2_t* ezlopi_scenes_get_by_id_v2(uint32_t _id); +l_scenes_list_v2_t* ezlopi_scenes_new_scene_populate(cJSON* cj_new_scene, uint32_t scene_id); // e_scene_value_type_v2_t ezlopi_scenes_get_value_type(cJSON *cj_field); // e_scene_value_type_v2_t ezlopi_scenes_get_expressions_value_type(cJSON *cj_value_type); -void ezlopi_scene_add_users_in_notifications(l_scenes_list_v2_t *scene_node, cJSON *cj_user); +void ezlopi_scene_add_users_in_notifications(l_scenes_list_v2_t* scene_node, cJSON* cj_user); -void ezlopi_scenes_delete(l_scenes_list_v2_t *scenes_list); -void ezlopi_scenes_delete_field_value(l_fields_v2_t *field); -void ezlopi_scenes_delete_when_blocks(l_when_block_v2_t *when_blocks); -void ezlopi_scenes_delete_house_modes(l_house_modes_v2_t *house_modes); -void ezlopi_scenes_delete_action_blocks(l_action_block_v2_t *action_blocks); -void ezlopi_scenes_delete_user_notifications(l_user_notification_v2_t *user_notifications); +void ezlopi_scenes_delete(l_scenes_list_v2_t* scenes_list); +void ezlopi_scenes_delete_field_value(l_fields_v2_t* field); +void ezlopi_scenes_delete_when_blocks(l_when_block_v2_t* when_blocks); +void ezlopi_scenes_delete_house_modes(l_house_modes_v2_t* house_modes); +void ezlopi_scenes_delete_action_blocks(l_action_block_v2_t* action_blocks); +void ezlopi_scenes_delete_user_notifications(l_user_notification_v2_t* user_notifications); void ezlopi_scenes_depopulate_by_id_v2(uint32_t _id); void ezlopi_scenes_remove_id_from_list_v2(uint32_t _id); -l_scenes_list_v2_t *ezlopi_scenes_pop_by_id_v2(uint32_t _id); +l_scenes_list_v2_t* ezlopi_scenes_pop_by_id_v2(uint32_t _id); -void ezlopi_scenes_print(l_scenes_list_v2_t *scene_link_list); -void ezlopi_scenes_notifications_add(cJSON *cj_notifications); +void ezlopi_scenes_print(l_scenes_list_v2_t* scene_link_list); +void ezlopi_scenes_notifications_add(cJSON* cj_notifications); #endif // _EZLOPI_CORE_SCENES_V2_H_ diff --git a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_when_methods.c b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_when_methods.c index dd4c11418..0df8671a6 100755 --- a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_when_methods.c +++ b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_when_methods.c @@ -22,7 +22,7 @@ int ezlopi_scene_when_is_item_state(l_scenes_list_v2_t* scene_node, void* arg) { if (0 == strncmp(curr_field->name, "item", 4)) { - item_id = strtoul(curr_field->value.value_string, NULL, 16); + item_id = strtoul(curr_field->field_value.u_value.value_string, NULL, 16); } else if (0 == strncmp(curr_field->name, ezlopi_value_str, 4)) { @@ -52,7 +52,7 @@ int ezlopi_scene_when_is_item_state(l_scenes_list_v2_t* scene_node, void* arg) { case cJSON_True: { - if (true == value_field->value.value_bool) + if (true == value_field->field_value.u_value.value_bool) { ret = 1; } @@ -60,7 +60,7 @@ int ezlopi_scene_when_is_item_state(l_scenes_list_v2_t* scene_node, void* arg) } case cJSON_False: { - if (false == value_field->value.value_bool) + if (false == value_field->field_value.u_value.value_bool) { ret = 1; } @@ -68,7 +68,7 @@ int ezlopi_scene_when_is_item_state(l_scenes_list_v2_t* scene_node, void* arg) } case cJSON_Number: { - if (cj_value->valuedouble == value_field->value.value_double) + if (cj_value->valuedouble == value_field->field_value.u_value.value_double) { ret = 1; } @@ -76,8 +76,8 @@ int ezlopi_scene_when_is_item_state(l_scenes_list_v2_t* scene_node, void* arg) } case cJSON_String: { - uint32_t cmp_size = (strlen(cj_value->valuestring) > strlen(value_field->value.value_string)) ? strlen(cj_value->valuestring) : strlen(value_field->value.value_string); - if (0 == strncmp(cj_value->valuestring, value_field->value.value_string, cmp_size)) + uint32_t cmp_size = (strlen(cj_value->valuestring) > strlen(value_field->field_value.u_value.value_string)) ? strlen(cj_value->valuestring) : strlen(value_field->field_value.u_value.value_string); + if (0 == strncmp(cj_value->valuestring, value_field->field_value.u_value.value_string, cmp_size)) { ret = 1; } @@ -112,7 +112,7 @@ int ezlopi_scene_when_is_interval(l_scenes_list_v2_t* scene_node, void* arg) if (scene_node) { char* end_prt = NULL; - uint32_t interval = strtoul(scene_node->when_block->fields->value.value_string, &end_prt, 10); + uint32_t interval = strtoul(scene_node->when_block->fields->field_value.u_value.value_string, &end_prt, 10); if (end_prt) { if (0 == strncmp(end_prt, "m", 1)) @@ -215,7 +215,7 @@ int ezlopi_scene_when_is_house_mode_changed_to(l_scenes_list_v2_t* scene_node, v uint32_t idx = 0; cJSON* cj_house_mdoe_id = NULL; - while (NULL == (cj_house_mdoe_id = cJSON_GetArrayItem(house_mode_id_array->value.cj_value, idx++))) + while (NULL == (cj_house_mdoe_id = cJSON_GetArrayItem(house_mode_id_array->field_value.u_value.cj_value, idx++))) { if (cj_house_mdoe_id->valuestring) { @@ -298,7 +298,7 @@ int ezlopi_scene_when_compare_numbers(l_scenes_list_v2_t* scene_node, void* arg) { if (0 == strncmp(curr_field->name, "item", 4)) { - item_id = strtoul(curr_field->value.value_string, NULL, 16); + item_id = strtoul(curr_field->field_value.u_value.value_string, NULL, 16); } else if (0 == strncmp(curr_field->name, ezlopi_value_str, 4)) { @@ -380,7 +380,7 @@ int ezlopi_scene_when_and(l_scenes_list_v2_t* scene_node, void* arg) l_when_block_v2_t* when_block = (l_when_block_v2_t*)arg; if (when_block) { - l_when_block_v2_t* value_when_block = when_block->fields->value.when_block; + l_when_block_v2_t* value_when_block = when_block->fields->field_value.u_value.when_block; while (value_when_block) { f_scene_method_v2_t scene_method = ezlopi_scene_get_method_v2(value_when_block->block_options.method.type); @@ -407,7 +407,7 @@ int ezlopi_scene_when_not(l_scenes_list_v2_t* scene_node, void* arg) if (when_block) { ret = 1; // required for the first case - l_when_block_v2_t* value_when_block = when_block->fields->value.when_block; + l_when_block_v2_t* value_when_block = when_block->fields->field_value.u_value.when_block; while (value_when_block) { f_scene_method_v2_t scene_method = ezlopi_scene_get_method_v2(value_when_block->block_options.method.type); @@ -429,7 +429,7 @@ int ezlopi_scene_when_or(l_scenes_list_v2_t* scene_node, void* arg) l_when_block_v2_t* when_block = (l_when_block_v2_t*)arg; if (when_block) { - l_when_block_v2_t* value_when_block = when_block->fields->value.when_block; + l_when_block_v2_t* value_when_block = when_block->fields->field_value.u_value.when_block; while (value_when_block) { f_scene_method_v2_t scene_method = ezlopi_scene_get_method_v2(value_when_block->block_options.method.type); @@ -455,7 +455,7 @@ int ezlopi_scene_when_xor(l_scenes_list_v2_t* scene_node, void* arg) l_when_block_v2_t* when_block = (l_when_block_v2_t*)arg; if (when_block) { - l_when_block_v2_t* value_when_block = when_block->fields->value.when_block; + l_when_block_v2_t* value_when_block = when_block->fields->field_value.u_value.when_block; while (value_when_block) { f_scene_method_v2_t scene_method = ezlopi_scene_get_method_v2(value_when_block->block_options.method.type); diff --git a/sdkconfig b/sdkconfig index 82d20c095..6099d5962 100644 --- a/sdkconfig +++ b/sdkconfig @@ -265,6 +265,7 @@ CONFIG_BT_CTRL_SLEEP_CLOCK_EFF=0 CONFIG_BT_CTRL_HCI_TL_EFF=1 # CONFIG_BT_CTRL_AGC_RECORRECT_EN is not set # CONFIG_BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX is not set +# CONFIG_BT_BLE_ADV_DATA_LENGTH_ZERO_AUX is not set # end of Bluetooth controller CONFIG_BT_BLUEDROID_ENABLED=y @@ -294,6 +295,7 @@ CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE=0 # CONFIG_BT_GATTS_APPEARANCE_WRITABLE is not set CONFIG_BT_GATTC_ENABLE=y CONFIG_BT_GATTC_MAX_CACHE_CHAR=40 +CONFIG_BT_GATTC_NOTIF_REG_MAX=5 # CONFIG_BT_GATTC_CACHE_NVS_FLASH is not set CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=3 CONFIG_BT_BLE_SMP_ENABLE=y @@ -728,6 +730,7 @@ CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y # CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND is not set +CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y # end of Sleep Config # @@ -842,6 +845,7 @@ CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y # CONFIG_ESP_PANIC_HANDLER_IRAM is not set # CONFIG_ESP_DEBUG_STUBS_ENABLE is not set CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y +CONFIG_ESP_SYSTEM_BBPLL_RECALIB=y # end of ESP System Settings # @@ -867,6 +871,10 @@ CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8 CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=16 +CONFIG_ESP_WIFI_STATIC_RX_MGMT_BUFFER=y +# CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUFFER is not set +CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0 +CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF=5 # CONFIG_ESP32_WIFI_CSI_ENABLED is not set CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y CONFIG_ESP32_WIFI_TX_BA_WIN=6 @@ -1066,6 +1074,7 @@ CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y # CONFIG_LWIP_LOCAL_HOSTNAME="espressif" # CONFIG_LWIP_NETIF_API is not set +CONFIG_LWIP_TCPIP_TASK_PRIO=18 # CONFIG_LWIP_TCPIP_CORE_LOCKING is not set # CONFIG_LWIP_CHECK_THREAD_SAFETY is not set CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y @@ -1079,6 +1088,7 @@ CONFIG_LWIP_SO_REUSE=y CONFIG_LWIP_SO_REUSE_RXTOALL=y # CONFIG_LWIP_SO_RCVBUF is not set # CONFIG_LWIP_NETBUF_RECVINFO is not set +CONFIG_LWIP_IP_DEFAULT_TTL=64 CONFIG_LWIP_IP4_FRAG=y CONFIG_LWIP_IP6_FRAG=y # CONFIG_LWIP_IP4_REASSEMBLY is not set @@ -1131,6 +1141,8 @@ CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744 CONFIG_LWIP_TCP_WND_DEFAULT=5744 CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 CONFIG_LWIP_TCP_QUEUE_OOSEQ=y +CONFIG_LWIP_TCP_OOSEQ_TIMEOUT=6 +CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=4 # CONFIG_LWIP_TCP_SACK_OUT is not set # CONFIG_LWIP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set CONFIG_LWIP_TCP_OVERSIZE_MSS=y From 89c43bba1560b09c28f4e89745947d995dd5621f Mon Sep 17 00:00:00 2001 From: ezlo-rikenm Date: Thu, 22 Feb 2024 11:58:13 +0545 Subject: [PATCH 10/27] added runCustomScript .EZPI-313: https://jira.mios.com/browse/EZPI-313 --- .../ezlopi_core_scenes_then_methods.c | 28 +- sdkconfig | 415 +++++------ sdkconfig.old | 686 ++++-------------- 3 files changed, 374 insertions(+), 755 deletions(-) diff --git a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_then_methods.c b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_then_methods.c index 0439752fe..400ab3383 100755 --- a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_then_methods.c +++ b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_then_methods.c @@ -1,6 +1,7 @@ #include "ezlopi_util_trace.h" #include "ezlopi_core_devices.h" +#include "ezlopi_core_scenes_scripts.h" #include "ezlopi_core_scenes_then_methods.h" #include "ezlopi_cloud_constants.h" @@ -102,8 +103,31 @@ int ezlopi_scene_then_send_http_request(l_scenes_list_v2_t* curr_scene, void* ar } int ezlopi_scene_then_run_custom_script(l_scenes_list_v2_t* curr_scene, void* arg) { - TRACE_W("Warning: then-method not implemented!"); - return 0; + int ret = 0; + + uint32_t script_id = 0; + l_action_block_v2_t* curr_then = (l_action_block_v2_t*)arg; + if (curr_then) + { + l_fields_v2_t* curr_field = curr_then->fields; + while (curr_field) + { + if (0 == strncmp(curr_field->name, "script", 7)) + { + script_id = strtoul(curr_field->field_value.u_value.value_string, NULL, 16); + TRACE_S("script_id: %s", curr_field->field_value.u_value.value_string); + } + curr_field = curr_field->next; + } + } + + if (script_id) + { + ret = 1; + ezlopi_scenes_scripts_run_by_id(script_id); + } + + return ret; } int ezlopi_scene_then_run_plugin_script(l_scenes_list_v2_t* curr_scene, void* arg) { diff --git a/sdkconfig b/sdkconfig index 6099d5962..6d7643350 100644 --- a/sdkconfig +++ b/sdkconfig @@ -4,9 +4,9 @@ # CONFIG_IDF_CMAKE=y CONFIG_IDF_TARGET_ARCH_XTENSA=y -CONFIG_IDF_TARGET="esp32s3" -CONFIG_IDF_TARGET_ESP32S3=y -CONFIG_IDF_FIRMWARE_CHIP_ID=0x0009 +CONFIG_IDF_TARGET="esp32" +CONFIG_IDF_TARGET_ESP32=y +CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000 # # SDK tool configuration @@ -38,7 +38,7 @@ CONFIG_APP_RETRIEVE_LEN_ELF_SHA=16 # # Bootloader config # -CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x0 +CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x1000 CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set @@ -70,37 +70,25 @@ CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y # # Security features # -CONFIG_SECURE_BOOT_SUPPORTS_RSA=y -CONFIG_SECURE_TARGET_HAS_SECURE_ROM_DL_MODE=y # CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set # CONFIG_SECURE_BOOT is not set # CONFIG_SECURE_FLASH_ENC_ENABLED is not set # end of Security features -# -# Boot ROM Behavior -# -CONFIG_BOOT_ROM_LOG_ALWAYS_ON=y -# CONFIG_BOOT_ROM_LOG_ALWAYS_OFF is not set -# CONFIG_BOOT_ROM_LOG_ON_GPIO_HIGH is not set -# CONFIG_BOOT_ROM_LOG_ON_GPIO_LOW is not set -# end of Boot ROM Behavior - # # Serial flasher config # CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200 # CONFIG_ESPTOOLPY_NO_STUB is not set -# CONFIG_ESPTOOLPY_OCT_FLASH is not set # CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set # CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set CONFIG_ESPTOOLPY_FLASHMODE_DIO=y # CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y CONFIG_ESPTOOLPY_FLASHMODE="dio" -# CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set CONFIG_ESPTOOLPY_FLASHFREQ_40M=y +# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set CONFIG_ESPTOOLPY_FLASHFREQ="40m" # CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set @@ -190,82 +178,51 @@ CONFIG_APPTRACE_LOCK_ENABLE=y # Bluetooth # CONFIG_BT_ENABLED=y -CONFIG_BT_SOC_SUPPORT_5_0=y # # Bluetooth controller # -CONFIG_BT_CTRL_MODE_EFF=1 -CONFIG_BT_CTRL_BLE_MAX_ACT=10 -CONFIG_BT_CTRL_BLE_MAX_ACT_EFF=10 -CONFIG_BT_CTRL_BLE_STATIC_ACL_TX_BUF_NB=0 -CONFIG_BT_CTRL_PINNED_TO_CORE_0=y -# CONFIG_BT_CTRL_PINNED_TO_CORE_1 is not set -CONFIG_BT_CTRL_PINNED_TO_CORE=0 -CONFIG_BT_CTRL_HCI_MODE_VHCI=y -# CONFIG_BT_CTRL_HCI_MODE_UART_H4 is not set -CONFIG_BT_CTRL_HCI_TL=1 -CONFIG_BT_CTRL_ADV_DUP_FILT_MAX=30 -CONFIG_BT_BLE_CCA_MODE_NONE=y -# CONFIG_BT_BLE_CCA_MODE_HW is not set -# CONFIG_BT_BLE_CCA_MODE_SW is not set -CONFIG_BT_BLE_CCA_MODE=0 -CONFIG_BT_CTRL_HW_CCA_VAL=20 -CONFIG_BT_CTRL_HW_CCA_EFF=0 -CONFIG_BT_CTRL_CE_LENGTH_TYPE_ORIG=y -# CONFIG_BT_CTRL_CE_LENGTH_TYPE_CE is not set -# CONFIG_BT_CTRL_CE_LENGTH_TYPE_SD is not set -CONFIG_BT_CTRL_CE_LENGTH_TYPE_EFF=0 -CONFIG_BT_CTRL_TX_ANTENNA_INDEX_0=y -# CONFIG_BT_CTRL_TX_ANTENNA_INDEX_1 is not set -CONFIG_BT_CTRL_TX_ANTENNA_INDEX_EFF=0 -CONFIG_BT_CTRL_RX_ANTENNA_INDEX_0=y -# CONFIG_BT_CTRL_RX_ANTENNA_INDEX_1 is not set -CONFIG_BT_CTRL_RX_ANTENNA_INDEX_EFF=0 -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N24 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N21 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N18 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N15 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N12 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N9 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N6 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N3 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N0 is not set -CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3=y -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P6 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P9 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P12 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P15 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P18 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P21 is not set -CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF=9 -CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP=y -CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM=100 -CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 -CONFIG_BT_CTRL_BLE_SCAN_DUPL=y -CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DEVICE=y -# CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DATA is not set -# CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DATA_DEVICE is not set -CONFIG_BT_CTRL_SCAN_DUPL_TYPE=0 -CONFIG_BT_CTRL_SCAN_DUPL_CACHE_SIZE=100 -CONFIG_BT_CTRL_DUPL_SCAN_CACHE_REFRESH_PERIOD=0 -# CONFIG_BT_CTRL_BLE_MESH_SCAN_DUPL_EN is not set -# CONFIG_BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_EN is not set -CONFIG_BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_DIS=y -CONFIG_BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_EFF=0 +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +# CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY is not set +# CONFIG_BTDM_CTRL_MODE_BTDM is not set +CONFIG_BTDM_CTRL_BLE_MAX_CONN=3 +CONFIG_BTDM_CTRL_BR_EDR_SCO_DATA_PATH_EFF=0 +CONFIG_BTDM_CTRL_PCM_ROLE_EFF=0 +CONFIG_BTDM_CTRL_PCM_POLAR_EFF=0 +CONFIG_BTDM_CTRL_BLE_MAX_CONN_EFF=3 +CONFIG_BTDM_CTRL_BR_EDR_MAX_ACL_CONN_EFF=0 +CONFIG_BTDM_CTRL_BR_EDR_MAX_SYNC_CONN_EFF=0 +CONFIG_BTDM_CTRL_PINNED_TO_CORE_0=y +# CONFIG_BTDM_CTRL_PINNED_TO_CORE_1 is not set +CONFIG_BTDM_CTRL_PINNED_TO_CORE=0 +CONFIG_BTDM_CTRL_HCI_MODE_VHCI=y +# CONFIG_BTDM_CTRL_HCI_MODE_UART_H4 is not set # # MODEM SLEEP Options # -# CONFIG_BT_CTRL_MODEM_SLEEP is not set +CONFIG_BTDM_CTRL_MODEM_SLEEP=y +CONFIG_BTDM_CTRL_MODEM_SLEEP_MODE_ORIG=y +# CONFIG_BTDM_CTRL_MODEM_SLEEP_MODE_EVED is not set +CONFIG_BTDM_CTRL_LPCLK_SEL_MAIN_XTAL=y # end of MODEM SLEEP Options -CONFIG_BT_CTRL_SLEEP_MODE_EFF=0 -CONFIG_BT_CTRL_SLEEP_CLOCK_EFF=0 -CONFIG_BT_CTRL_HCI_TL_EFF=1 -# CONFIG_BT_CTRL_AGC_RECORRECT_EN is not set -# CONFIG_BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX is not set -# CONFIG_BT_BLE_ADV_DATA_LENGTH_ZERO_AUX is not set +CONFIG_BTDM_BLE_DEFAULT_SCA_250PPM=y +CONFIG_BTDM_BLE_SLEEP_CLOCK_ACCURACY_INDEX_EFF=1 +CONFIG_BTDM_BLE_SCAN_DUPL=y +CONFIG_BTDM_SCAN_DUPL_TYPE_DEVICE=y +# CONFIG_BTDM_SCAN_DUPL_TYPE_DATA is not set +# CONFIG_BTDM_SCAN_DUPL_TYPE_DATA_DEVICE is not set +CONFIG_BTDM_SCAN_DUPL_TYPE=0 +CONFIG_BTDM_SCAN_DUPL_CACHE_SIZE=100 +CONFIG_BTDM_SCAN_DUPL_CACHE_REFRESH_PERIOD=0 +# CONFIG_BTDM_BLE_MESH_SCAN_DUPL_EN is not set +CONFIG_BTDM_CTRL_FULL_SCAN_SUPPORTED=y +CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP=y +CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM=100 +CONFIG_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 +CONFIG_BTDM_RESERVE_DRAM=0xdb5c +CONFIG_BTDM_CTRL_HLI=y # end of Bluetooth controller CONFIG_BT_BLUEDROID_ENABLED=y @@ -281,6 +238,7 @@ CONFIG_BT_BLUEDROID_PINNED_TO_CORE_0=y CONFIG_BT_BLUEDROID_PINNED_TO_CORE=0 CONFIG_BT_BTU_TASK_STACK_SIZE=4096 # CONFIG_BT_BLUEDROID_MEM_DEBUG is not set +# CONFIG_BT_CLASSIC_ENABLED is not set CONFIG_BT_BLE_ENABLED=y CONFIG_BT_GATTS_ENABLE=y # CONFIG_BT_GATTS_PPCP_CHAR_GAP is not set @@ -478,15 +436,14 @@ CONFIG_BT_LOG_BLUFI_TRACE_LEVEL=2 CONFIG_BT_ACL_CONNECTIONS=4 CONFIG_BT_MULTI_CONNECTION_ENBALE=y # CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST is not set -# CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY is not set +CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY=y # CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK is not set CONFIG_BT_SMP_ENABLE=y # CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN is not set CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT=30 CONFIG_BT_MAX_DEVICE_NAME_LEN=32 +# CONFIG_BT_BLE_RPA_SUPPORTED is not set CONFIG_BT_BLE_RPA_TIMEOUT=900 -CONFIG_BT_BLE_50_FEATURES_SUPPORTED=y -CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y # CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL is not set # end of Bluedroid Options # end of Bluetooth @@ -511,7 +468,6 @@ CONFIG_COAP_LOG_DEFAULT_LEVEL=0 # # CONFIG_ADC_FORCE_XPD_FSM is not set CONFIG_ADC_DISABLE_DAC=y -# CONFIG_ADC_CONTINUOUS_FORCE_USE_ADC2_ON_C3_S3 is not set # end of ADC configuration # @@ -533,6 +489,10 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=y # TWAI configuration # # CONFIG_TWAI_ISR_IN_IRAM is not set +# CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC is not set +# CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST is not set +# CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID is not set +# CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT is not set # CONFIG_TWAI_ERRATA_FIX_LISTEN_ONLY_DOM is not set # end of TWAI configuration @@ -542,6 +502,18 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=y # CONFIG_UART_ISR_IN_IRAM is not set # end of UART configuration +# +# RTCIO configuration +# +# CONFIG_RTCIO_SUPPORT_RTC_GPIO_DESC is not set +# end of RTCIO configuration + +# +# GPIO Configuration +# +# CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL is not set +# end of GPIO Configuration + # # GDMA Configuration # @@ -555,14 +527,17 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=y # # CONFIG_EFUSE_CUSTOM_TABLE is not set # CONFIG_EFUSE_VIRTUAL is not set -CONFIG_EFUSE_MAX_BLK_LEN=256 +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_NONE is not set +CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4=y +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_REPEAT is not set +CONFIG_EFUSE_MAX_BLK_LEN=192 # end of eFuse Bit Manager # # ESP-TLS # CONFIG_ESP_TLS_USING_MBEDTLS=y -CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y +# CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set # CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set # CONFIG_ESP_TLS_SERVER is not set # CONFIG_ESP_TLS_PSK_VERIFICATION is not set @@ -570,80 +545,68 @@ CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y # end of ESP-TLS # -# ESP32S3-Specific +# ESP32-specific # -CONFIG_ESP32S3_REV_MIN_0=y -# CONFIG_ESP32S3_REV_MIN_1 is not set -# CONFIG_ESP32S3_REV_MIN_2 is not set -CONFIG_ESP32S3_REV_MIN_FULL=0 +CONFIG_ESP32_REV_MIN_0=y +# CONFIG_ESP32_REV_MIN_1 is not set +# CONFIG_ESP32_REV_MIN_1_1 is not set +# CONFIG_ESP32_REV_MIN_2 is not set +# CONFIG_ESP32_REV_MIN_3 is not set +# CONFIG_ESP32_REV_MIN_3_1 is not set +CONFIG_ESP32_REV_MIN=0 +CONFIG_ESP32_REV_MIN_FULL=0 CONFIG_ESP_REV_MIN_FULL=0 -CONFIG_ESP32S3_REV_MAX_FULL_STR_OPT=y -CONFIG_ESP32S3_REV_MAX_FULL=99 -CONFIG_ESP_REV_MAX_FULL=99 -# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_80 is not set -# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_160 is not set -CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y -CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=240 - -# -# Cache config -# -CONFIG_ESP32S3_INSTRUCTION_CACHE_16KB=y -# CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB is not set -CONFIG_ESP32S3_INSTRUCTION_CACHE_SIZE=0x4000 -# CONFIG_ESP32S3_INSTRUCTION_CACHE_4WAYS is not set -CONFIG_ESP32S3_INSTRUCTION_CACHE_8WAYS=y -CONFIG_ESP32S3_ICACHE_ASSOCIATED_WAYS=8 -# CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_16B is not set -CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_32B=y -CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_SIZE=32 -# CONFIG_ESP32S3_INSTRUCTION_CACHE_WRAP is not set -# CONFIG_ESP32S3_DATA_CACHE_16KB is not set -CONFIG_ESP32S3_DATA_CACHE_32KB=y -# CONFIG_ESP32S3_DATA_CACHE_64KB is not set -CONFIG_ESP32S3_DATA_CACHE_SIZE=0x8000 -# CONFIG_ESP32S3_DATA_CACHE_4WAYS is not set -CONFIG_ESP32S3_DATA_CACHE_8WAYS=y -CONFIG_ESP32S3_DCACHE_ASSOCIATED_WAYS=8 -# CONFIG_ESP32S3_DATA_CACHE_LINE_16B is not set -CONFIG_ESP32S3_DATA_CACHE_LINE_32B=y -# CONFIG_ESP32S3_DATA_CACHE_LINE_64B is not set -CONFIG_ESP32S3_DATA_CACHE_LINE_SIZE=32 -# CONFIG_ESP32S3_DATA_CACHE_WRAP is not set -# end of Cache config - -# CONFIG_ESP32S3_SPIRAM_SUPPORT is not set -# CONFIG_ESP32S3_TRAX is not set -CONFIG_ESP32S3_TRACEMEM_RESERVE_DRAM=0x0 -# CONFIG_ESP32S3_ULP_COPROC_ENABLED is not set -CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM=0 -CONFIG_ESP32S3_DEBUG_OCDAWARE=y -CONFIG_ESP32S3_BROWNOUT_DET=y -CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_7=y -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_6 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_5 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_4 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_3 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_2 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_1 is not set -CONFIG_ESP32S3_BROWNOUT_DET_LVL=7 -CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC_FRC1=y -# CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC is not set -# CONFIG_ESP32S3_TIME_SYSCALL_USE_FRC1 is not set -# CONFIG_ESP32S3_TIME_SYSCALL_USE_NONE is not set -CONFIG_ESP32S3_RTC_CLK_SRC_INT_RC=y -# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_CRYS is not set -# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_OSC is not set -# CONFIG_ESP32S3_RTC_CLK_SRC_INT_8MD256 is not set -CONFIG_ESP32S3_RTC_CLK_CAL_CYCLES=1024 -CONFIG_ESP32S3_DEEP_SLEEP_WAKEUP_DELAY=2000 -# CONFIG_ESP32S3_RTCDATA_IN_FAST_MEM is not set -# CONFIG_ESP32S3_USE_FIXED_STATIC_RAM_SIZE is not set -# end of ESP32S3-Specific +CONFIG_ESP32_REV_MAX_FULL_STR_OPT=y +CONFIG_ESP32_REV_MAX_FULL=399 +CONFIG_ESP_REV_MAX_FULL=399 +CONFIG_ESP32_DPORT_WORKAROUND=y +# CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set +CONFIG_ESP32_DEFAULT_CPU_FREQ_160=y +# CONFIG_ESP32_DEFAULT_CPU_FREQ_240 is not set +CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=160 +# CONFIG_ESP32_SPIRAM_SUPPORT is not set +# CONFIG_ESP32_TRAX is not set +CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0x0 +# CONFIG_ESP32_ULP_COPROC_ENABLED is not set +CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0 +CONFIG_ESP32_DEBUG_OCDAWARE=y +CONFIG_ESP32_BROWNOUT_DET=y +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_0=y +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_7 is not set +CONFIG_ESP32_BROWNOUT_DET_LVL=0 +CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1=y +# CONFIG_ESP32_TIME_SYSCALL_USE_RTC is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_FRC1 is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_NONE is not set +CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y +# CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_ESP32_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_ESP32_RTC_CLK_SRC_INT_8MD256 is not set +CONFIG_ESP32_RTC_CLK_CAL_CYCLES=1024 +CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000 +CONFIG_ESP32_XTAL_FREQ_40=y +# CONFIG_ESP32_XTAL_FREQ_26 is not set +# CONFIG_ESP32_XTAL_FREQ_AUTO is not set +CONFIG_ESP32_XTAL_FREQ=40 +# CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE is not set +# CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set +# CONFIG_ESP32_COMPATIBLE_PRE_V3_1_BOOTLOADERS is not set +# CONFIG_ESP32_USE_FIXED_STATIC_RAM_SIZE is not set +CONFIG_ESP32_DPORT_DIS_INTERRUPT_LVL=5 +# end of ESP32-specific # # ADC-Calibration # +CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y +CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y +CONFIG_ADC_CAL_LUT_ENABLE=y # end of ADC-Calibration # @@ -656,6 +619,14 @@ CONFIG_ESP_ERR_TO_NAME_LOOKUP=y # Ethernet # CONFIG_ETH_ENABLED=y +CONFIG_ETH_USE_ESP32_EMAC=y +CONFIG_ETH_PHY_INTERFACE_RMII=y +CONFIG_ETH_RMII_CLK_INPUT=y +# CONFIG_ETH_RMII_CLK_OUTPUT is not set +CONFIG_ETH_RMII_CLK_IN_GPIO=0 +CONFIG_ETH_DMA_BUFFER_SIZE=512 +CONFIG_ETH_DMA_RX_BUFFER_NUM=10 +CONFIG_ETH_DMA_TX_BUFFER_NUM=10 CONFIG_ETH_USE_SPI_ETHERNET=y # CONFIG_ETH_SPI_ETHERNET_DM9051 is not set CONFIG_ETH_SPI_ETHERNET_W5500=y @@ -718,9 +689,10 @@ CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y -# CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO is not set -CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_FOUR=y -CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES=4 +# CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_TWO is not set +CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR=y +CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=4 +# CONFIG_ESP_MAC_IGNORE_MAC_CRC_ERROR is not set # end of MAC Config # @@ -736,7 +708,6 @@ CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y # # RTC Clock Config # -CONFIG_RTC_CLOCK_BBPLL_POWER_ON_WITH_USB=y # end of RTC Clock Config # end of Hardware Settings @@ -756,7 +727,6 @@ CONFIG_ESP_IPC_ISR_ENABLE=y # LCD Peripheral Configuration # CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE=32 -# CONFIG_LCD_RGB_ISR_IRAM_SAFE is not set # end of LCD Peripheral Configuration # end of LCD and Touch Panel @@ -777,7 +747,6 @@ CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20 CONFIG_ESP_PHY_MAX_TX_POWER=20 # CONFIG_ESP_PHY_REDUCE_TX_POWER is not set -CONFIG_ESP_PHY_ENABLE_USB=y CONFIG_ESP_PHY_RF_CAL_PARTIAL=y # CONFIG_ESP_PHY_RF_CAL_NONE is not set # CONFIG_ESP_PHY_RF_CAL_FULL is not set @@ -788,8 +757,6 @@ CONFIG_ESP_PHY_CALIBRATION_MODE=0 # Power Management # # CONFIG_PM_ENABLE is not set -CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y -CONFIG_PM_POWER_DOWN_TAGMEM_IN_LIGHT_SLEEP=y # end of Power Management # @@ -807,8 +774,6 @@ CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set # CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set # CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set -CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK=y -CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=y # # Memory protection @@ -824,12 +789,8 @@ CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 CONFIG_ESP_CONSOLE_UART_DEFAULT=y -# CONFIG_ESP_CONSOLE_USB_CDC is not set -# CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG is not set # CONFIG_ESP_CONSOLE_UART_CUSTOM is not set # CONFIG_ESP_CONSOLE_NONE is not set -# CONFIG_ESP_CONSOLE_SECONDARY_NONE is not set -CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y CONFIG_ESP_CONSOLE_UART=y CONFIG_ESP_CONSOLE_MULTIPLE_UART=y CONFIG_ESP_CONSOLE_UART_NUM=0 @@ -844,8 +805,7 @@ CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y # CONFIG_ESP_PANIC_HANDLER_IRAM is not set # CONFIG_ESP_DEBUG_STUBS_ENABLE is not set -CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y -CONFIG_ESP_SYSTEM_BBPLL_RECALIB=y +CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5=y # end of ESP System Settings # @@ -857,7 +817,8 @@ CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER=y CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584 CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1 # CONFIG_ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD is not set -CONFIG_ESP_TIMER_IMPL_SYSTIMER=y +# CONFIG_ESP_TIMER_IMPL_FRC2 is not set +CONFIG_ESP_TIMER_IMPL_TG0_LAC=y # end of High resolution timer (esp_timer) # @@ -866,15 +827,11 @@ CONFIG_ESP_TIMER_IMPL_SYSTIMER=y CONFIG_ESP32_WIFI_ENABLED=y CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE=y CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=4 -CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8 +CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=16 # CONFIG_ESP32_WIFI_STATIC_TX_BUFFER is not set CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=16 -CONFIG_ESP_WIFI_STATIC_RX_MGMT_BUFFER=y -# CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUFFER is not set -CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0 -CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF=5 # CONFIG_ESP32_WIFI_CSI_ENABLED is not set CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y CONFIG_ESP32_WIFI_TX_BA_WIN=6 @@ -884,14 +841,12 @@ CONFIG_ESP32_WIFI_NVS_ENABLED=y CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y # CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 -CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 -CONFIG_ESP32_WIFI_IRAM_OPT=y -CONFIG_ESP32_WIFI_RX_IRAM_OPT=y +CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=16 +# CONFIG_ESP32_WIFI_IRAM_OPT is not set +# CONFIG_ESP32_WIFI_RX_IRAM_OPT is not set CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y # CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set -# CONFIG_ESP_WIFI_FTM_ENABLE is not set # CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set -# CONFIG_ESP_WIFI_GCMP_SUPPORT is not set # CONFIG_ESP_WIFI_GMAC_SUPPORT is not set CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y # CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set @@ -977,10 +932,10 @@ CONFIG_FMB_EVENT_QUEUE_TIMEOUT=20 # # CONFIG_FREERTOS_UNICORE is not set CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF -CONFIG_FREERTOS_TICK_SUPPORT_SYSTIMER=y -CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL1=y -# CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL3 is not set -CONFIG_FREERTOS_SYSTICK_USES_SYSTIMER=y +CONFIG_FREERTOS_TICK_SUPPORT_CORETIMER=y +CONFIG_FREERTOS_CORETIMER_0=y +# CONFIG_FREERTOS_CORETIMER_1 is not set +CONFIG_FREERTOS_SYSTICK_USES_CCOUNT=y CONFIG_FREERTOS_HZ=1000 CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION=y # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set @@ -1009,6 +964,7 @@ CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y # CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set # CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set CONFIG_FREERTOS_DEBUG_OCDAWARE=y +# CONFIG_FREERTOS_FPU_IN_ISR is not set CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y # CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH is not set # end of FreeRTOS @@ -1079,7 +1035,7 @@ CONFIG_LWIP_TCPIP_TASK_PRIO=18 # CONFIG_LWIP_CHECK_THREAD_SAFETY is not set CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y # CONFIG_LWIP_L2_TO_L3_COPY is not set -CONFIG_LWIP_IRAM_OPTIMIZATION=y +# CONFIG_LWIP_IRAM_OPTIMIZATION is not set CONFIG_LWIP_TIMERS_ONDEMAND=y CONFIG_LWIP_MAX_SOCKETS=10 # CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set @@ -1088,7 +1044,6 @@ CONFIG_LWIP_SO_REUSE=y CONFIG_LWIP_SO_REUSE_RXTOALL=y # CONFIG_LWIP_SO_RCVBUF is not set # CONFIG_LWIP_NETBUF_RECVINFO is not set -CONFIG_LWIP_IP_DEFAULT_TTL=64 CONFIG_LWIP_IP4_FRAG=y CONFIG_LWIP_IP6_FRAG=y # CONFIG_LWIP_IP4_REASSEMBLY is not set @@ -1100,7 +1055,7 @@ CONFIG_LWIP_ESP_GRATUITOUS_ARP=y CONFIG_LWIP_GARP_TMR_INTERVAL=60 CONFIG_LWIP_ESP_MLDV6_REPORT=y CONFIG_LWIP_MLDV6_TMR_INTERVAL=40 -CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=16 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=8 CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y # CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y @@ -1141,8 +1096,6 @@ CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744 CONFIG_LWIP_TCP_WND_DEFAULT=5744 CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 CONFIG_LWIP_TCP_QUEUE_OOSEQ=y -CONFIG_LWIP_TCP_OOSEQ_TIMEOUT=6 -CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=4 # CONFIG_LWIP_TCP_SACK_OUT is not set # CONFIG_LWIP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set CONFIG_LWIP_TCP_OVERSIZE_MSS=y @@ -1227,7 +1180,7 @@ CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y # CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC is not set # CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y -CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 +CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=2048 CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=2048 CONFIG_MBEDTLS_DYNAMIC_BUFFER=y CONFIG_MBEDTLS_DYNAMIC_FREE_PEER_CERT=y @@ -1257,7 +1210,6 @@ CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200 # CONFIG_MBEDTLS_ECP_RESTARTABLE is not set # CONFIG_MBEDTLS_CMAC_C is not set CONFIG_MBEDTLS_HARDWARE_AES=y -CONFIG_MBEDTLS_AES_USE_INTERRUPT=y CONFIG_MBEDTLS_HARDWARE_MPI=y CONFIG_MBEDTLS_HARDWARE_SHA=y CONFIG_MBEDTLS_ROM_MD5=y @@ -1437,7 +1389,6 @@ CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" # CONFIG_SPI_FLASH_VERIFY_WRITE is not set # CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y -# CONFIG_SPI_FLASH_ROM_IMPL is not set CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y # CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set # CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set @@ -1461,7 +1412,6 @@ CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP=y CONFIG_SPI_FLASH_SUPPORT_TH_CHIP=y -CONFIG_SPI_FLASH_SUPPORT_MXIC_OPI_CHIP=y # end of Auto-detect flash chips CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y @@ -1515,12 +1465,6 @@ CONFIG_WS_BUFFER_SIZE=1024 # end of Websocket # end of TCP Transport -# -# TinyUSB Stack -# -# CONFIG_TINYUSB is not set -# end of TinyUSB Stack - # # Unity unit testing library # @@ -1533,24 +1477,10 @@ CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y # CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set # end of Unity unit testing library -# -# USB-OTG -# -CONFIG_USB_OTG_SUPPORTED=y -CONFIG_USB_HOST_CONTROL_TRANSFER_MAX_SIZE=256 -CONFIG_USB_HOST_HW_BUFFER_BIAS_BALANCED=y -# CONFIG_USB_HOST_HW_BUFFER_BIAS_IN is not set -# CONFIG_USB_HOST_HW_BUFFER_BIAS_PERIODIC_OUT is not set - # # Root Hub configuration # -CONFIG_USB_HOST_DEBOUNCE_DELAY_MS=250 -CONFIG_USB_HOST_RESET_HOLD_MS=30 -CONFIG_USB_HOST_RESET_RECOVERY_MS=30 -CONFIG_USB_HOST_SET_ADDR_RECOVERY_MS=10 # end of Root Hub configuration -# end of USB-OTG # # Virtual file system @@ -1662,6 +1592,28 @@ CONFIG_STACK_CHECK_NONE=y # CONFIG_ESP32_APPTRACE_DEST_TRAX is not set CONFIG_ESP32_APPTRACE_DEST_NONE=y CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y +CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY=y +# CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY is not set +# CONFIG_BTDM_CONTROLLER_MODE_BTDM is not set +CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN=3 +CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN_EFF=3 +CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN_EFF=0 +CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_EFF=0 +CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE=0 +CONFIG_BTDM_CONTROLLER_HCI_MODE_VHCI=y +# CONFIG_BTDM_CONTROLLER_HCI_MODE_UART_H4 is not set +CONFIG_BTDM_CONTROLLER_MODEM_SLEEP=y +CONFIG_BLE_SCAN_DUPLICATE=y +CONFIG_SCAN_DUPLICATE_BY_DEVICE_ADDR=y +# CONFIG_SCAN_DUPLICATE_BY_ADV_DATA is not set +# CONFIG_SCAN_DUPLICATE_BY_ADV_DATA_AND_DEVICE_ADDR is not set +CONFIG_SCAN_DUPLICATE_TYPE=0 +CONFIG_DUPLICATE_SCAN_CACHE_SIZE=100 +# CONFIG_BLE_MESH_SCAN_DUPLICATE_EN is not set +CONFIG_BTDM_CONTROLLER_FULL_SCAN_SUPPORTED=y +CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_SUPPORTED=y +CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_NUM=100 +CONFIG_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 CONFIG_BLUEDROID_ENABLED=y # CONFIG_NIMBLE_ENABLED is not set CONFIG_BTC_TASK_STACK_SIZE=3072 @@ -1670,6 +1622,7 @@ CONFIG_BLUEDROID_PINNED_TO_CORE_0=y CONFIG_BLUEDROID_PINNED_TO_CORE=0 CONFIG_BTU_TASK_STACK_SIZE=4096 # CONFIG_BLUEDROID_MEM_DEBUG is not set +# CONFIG_CLASSIC_BT_ENABLED is not set CONFIG_GATTS_ENABLE=y # CONFIG_GATTS_SEND_SERVICE_CHANGE_MANUAL is not set CONFIG_GATTS_SEND_SERVICE_CHANGE_AUTO=y @@ -1844,9 +1797,32 @@ CONFIG_SMP_ENABLE=y # CONFIG_BLE_ACTIVE_SCAN_REPORT_ADV_SCAN_RSP_INDIVIDUALLY is not set CONFIG_BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT=30 CONFIG_ADC2_DISABLE_DAC=y +# CONFIG_SPIRAM_SUPPORT is not set +CONFIG_TRACEMEM_RESERVE_DRAM=0x0 +# CONFIG_ULP_COPROC_ENABLED is not set +CONFIG_ULP_COPROC_RESERVE_MEM=0 +CONFIG_BROWNOUT_DET=y +CONFIG_BROWNOUT_DET_LVL_SEL_0=y +# CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_7 is not set +CONFIG_BROWNOUT_DET_LVL=0 +CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y +# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256 is not set +# CONFIG_DISABLE_BASIC_ROM_CONSOLE is not set +# CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set # CONFIG_EVENT_LOOP_PROFILING is not set CONFIG_POST_EVENTS_FROM_ISR=y CONFIG_POST_EVENTS_FROM_IRAM_ISR=y +# CONFIG_TWO_UNIVERSAL_MAC_ADDRESS is not set +CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y +CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4 CONFIG_ESP_SYSTEM_PD_FLASH=y CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND=y CONFIG_IPC_TASK_STACK_SIZE=1536 @@ -1855,12 +1831,10 @@ CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 CONFIG_ESP32_PHY_MAX_TX_POWER=20 # CONFIG_ESP32_REDUCE_PHY_TX_POWER is not set -CONFIG_ESP_SYSTEM_PM_POWER_DOWN_CPU=y # CONFIG_ESP32S2_PANIC_PRINT_HALT is not set CONFIG_ESP32S2_PANIC_PRINT_REBOOT=y # CONFIG_ESP32S2_PANIC_SILENT_REBOOT is not set # CONFIG_ESP32S2_PANIC_GDBSTUB is not set -CONFIG_ESP32S2_ALLOW_RTC_FAST_MEM_AS_HEAP=y CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=3072 CONFIG_MAIN_TASK_STACK_SIZE=3584 @@ -1905,7 +1879,7 @@ CONFIG_TIMER_QUEUE_LENGTH=10 # CONFIG_USE_ONLY_LWIP_SELECT is not set CONFIG_ESP_GRATUITOUS_ARP=y CONFIG_GARP_TMR_INTERVAL=60 -CONFIG_TCPIP_RECVMBOX_SIZE=16 +CONFIG_TCPIP_RECVMBOX_SIZE=8 CONFIG_TCP_MAXRTX=12 CONFIG_TCP_SYNMAXRTX=12 CONFIG_TCP_MSS=1440 @@ -1936,7 +1910,6 @@ CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y # CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set # CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set -# CONFIG_USB_ENABLED is not set CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y CONFIG_SUPPORT_TERMIOS=y CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 diff --git a/sdkconfig.old b/sdkconfig.old index 07d8de75d..6db5c7116 100644 --- a/sdkconfig.old +++ b/sdkconfig.old @@ -4,9 +4,9 @@ # CONFIG_IDF_CMAKE=y CONFIG_IDF_TARGET_ARCH_XTENSA=y -CONFIG_IDF_TARGET="esp32s3" -CONFIG_IDF_TARGET_ESP32S3=y -CONFIG_IDF_FIRMWARE_CHIP_ID=0x0009 +CONFIG_IDF_TARGET="esp32" +CONFIG_IDF_TARGET_ESP32=y +CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000 # # SDK tool configuration @@ -38,7 +38,7 @@ CONFIG_APP_RETRIEVE_LEN_ELF_SHA=16 # # Bootloader config # -CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x0 +CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x1000 CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set @@ -70,48 +70,36 @@ CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y # # Security features # -CONFIG_SECURE_BOOT_SUPPORTS_RSA=y -CONFIG_SECURE_TARGET_HAS_SECURE_ROM_DL_MODE=y # CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set # CONFIG_SECURE_BOOT is not set # CONFIG_SECURE_FLASH_ENC_ENABLED is not set # end of Security features -# -# Boot ROM Behavior -# -CONFIG_BOOT_ROM_LOG_ALWAYS_ON=y -# CONFIG_BOOT_ROM_LOG_ALWAYS_OFF is not set -# CONFIG_BOOT_ROM_LOG_ON_GPIO_HIGH is not set -# CONFIG_BOOT_ROM_LOG_ON_GPIO_LOW is not set -# end of Boot ROM Behavior - # # Serial flasher config # CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200 # CONFIG_ESPTOOLPY_NO_STUB is not set -# CONFIG_ESPTOOLPY_OCT_FLASH is not set # CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set # CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set CONFIG_ESPTOOLPY_FLASHMODE_DIO=y # CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y CONFIG_ESPTOOLPY_FLASHMODE="dio" -# CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set CONFIG_ESPTOOLPY_FLASHFREQ_40M=y +# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set CONFIG_ESPTOOLPY_FLASHFREQ="40m" # CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y -# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y # CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE="4MB" +CONFIG_ESPTOOLPY_FLASHSIZE="8MB" CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y CONFIG_ESPTOOLPY_BEFORE_RESET=y # CONFIG_ESPTOOLPY_BEFORE_NORESET is not set @@ -190,81 +178,51 @@ CONFIG_APPTRACE_LOCK_ENABLE=y # Bluetooth # CONFIG_BT_ENABLED=y -CONFIG_BT_SOC_SUPPORT_5_0=y # # Bluetooth controller # -CONFIG_BT_CTRL_MODE_EFF=1 -CONFIG_BT_CTRL_BLE_MAX_ACT=10 -CONFIG_BT_CTRL_BLE_MAX_ACT_EFF=10 -CONFIG_BT_CTRL_BLE_STATIC_ACL_TX_BUF_NB=0 -CONFIG_BT_CTRL_PINNED_TO_CORE_0=y -# CONFIG_BT_CTRL_PINNED_TO_CORE_1 is not set -CONFIG_BT_CTRL_PINNED_TO_CORE=0 -CONFIG_BT_CTRL_HCI_MODE_VHCI=y -# CONFIG_BT_CTRL_HCI_MODE_UART_H4 is not set -CONFIG_BT_CTRL_HCI_TL=1 -CONFIG_BT_CTRL_ADV_DUP_FILT_MAX=30 -CONFIG_BT_BLE_CCA_MODE_NONE=y -# CONFIG_BT_BLE_CCA_MODE_HW is not set -# CONFIG_BT_BLE_CCA_MODE_SW is not set -CONFIG_BT_BLE_CCA_MODE=0 -CONFIG_BT_CTRL_HW_CCA_VAL=20 -CONFIG_BT_CTRL_HW_CCA_EFF=0 -CONFIG_BT_CTRL_CE_LENGTH_TYPE_ORIG=y -# CONFIG_BT_CTRL_CE_LENGTH_TYPE_CE is not set -# CONFIG_BT_CTRL_CE_LENGTH_TYPE_SD is not set -CONFIG_BT_CTRL_CE_LENGTH_TYPE_EFF=0 -CONFIG_BT_CTRL_TX_ANTENNA_INDEX_0=y -# CONFIG_BT_CTRL_TX_ANTENNA_INDEX_1 is not set -CONFIG_BT_CTRL_TX_ANTENNA_INDEX_EFF=0 -CONFIG_BT_CTRL_RX_ANTENNA_INDEX_0=y -# CONFIG_BT_CTRL_RX_ANTENNA_INDEX_1 is not set -CONFIG_BT_CTRL_RX_ANTENNA_INDEX_EFF=0 -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N24 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N21 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N18 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N15 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N12 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N9 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N6 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N3 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N0 is not set -CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3=y -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P6 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P9 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P12 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P15 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P18 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P21 is not set -CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF=9 -CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP=y -CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM=100 -CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 -CONFIG_BT_CTRL_BLE_SCAN_DUPL=y -CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DEVICE=y -# CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DATA is not set -# CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DATA_DEVICE is not set -CONFIG_BT_CTRL_SCAN_DUPL_TYPE=0 -CONFIG_BT_CTRL_SCAN_DUPL_CACHE_SIZE=100 -CONFIG_BT_CTRL_DUPL_SCAN_CACHE_REFRESH_PERIOD=0 -# CONFIG_BT_CTRL_BLE_MESH_SCAN_DUPL_EN is not set -# CONFIG_BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_EN is not set -CONFIG_BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_DIS=y -CONFIG_BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_EFF=0 +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +# CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY is not set +# CONFIG_BTDM_CTRL_MODE_BTDM is not set +CONFIG_BTDM_CTRL_BLE_MAX_CONN=3 +CONFIG_BTDM_CTRL_BR_EDR_SCO_DATA_PATH_EFF=0 +CONFIG_BTDM_CTRL_PCM_ROLE_EFF=0 +CONFIG_BTDM_CTRL_PCM_POLAR_EFF=0 +CONFIG_BTDM_CTRL_BLE_MAX_CONN_EFF=3 +CONFIG_BTDM_CTRL_BR_EDR_MAX_ACL_CONN_EFF=0 +CONFIG_BTDM_CTRL_BR_EDR_MAX_SYNC_CONN_EFF=0 +CONFIG_BTDM_CTRL_PINNED_TO_CORE_0=y +# CONFIG_BTDM_CTRL_PINNED_TO_CORE_1 is not set +CONFIG_BTDM_CTRL_PINNED_TO_CORE=0 +CONFIG_BTDM_CTRL_HCI_MODE_VHCI=y +# CONFIG_BTDM_CTRL_HCI_MODE_UART_H4 is not set # # MODEM SLEEP Options # -# CONFIG_BT_CTRL_MODEM_SLEEP is not set +CONFIG_BTDM_CTRL_MODEM_SLEEP=y +CONFIG_BTDM_CTRL_MODEM_SLEEP_MODE_ORIG=y +# CONFIG_BTDM_CTRL_MODEM_SLEEP_MODE_EVED is not set +CONFIG_BTDM_CTRL_LPCLK_SEL_MAIN_XTAL=y # end of MODEM SLEEP Options -CONFIG_BT_CTRL_SLEEP_MODE_EFF=0 -CONFIG_BT_CTRL_SLEEP_CLOCK_EFF=0 -CONFIG_BT_CTRL_HCI_TL_EFF=1 -# CONFIG_BT_CTRL_AGC_RECORRECT_EN is not set -# CONFIG_BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX is not set +CONFIG_BTDM_BLE_DEFAULT_SCA_250PPM=y +CONFIG_BTDM_BLE_SLEEP_CLOCK_ACCURACY_INDEX_EFF=1 +CONFIG_BTDM_BLE_SCAN_DUPL=y +CONFIG_BTDM_SCAN_DUPL_TYPE_DEVICE=y +# CONFIG_BTDM_SCAN_DUPL_TYPE_DATA is not set +# CONFIG_BTDM_SCAN_DUPL_TYPE_DATA_DEVICE is not set +CONFIG_BTDM_SCAN_DUPL_TYPE=0 +CONFIG_BTDM_SCAN_DUPL_CACHE_SIZE=100 +CONFIG_BTDM_SCAN_DUPL_CACHE_REFRESH_PERIOD=0 +# CONFIG_BTDM_BLE_MESH_SCAN_DUPL_EN is not set +CONFIG_BTDM_CTRL_FULL_SCAN_SUPPORTED=y +CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP=y +CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM=100 +CONFIG_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 +CONFIG_BTDM_RESERVE_DRAM=0xdb5c +CONFIG_BTDM_CTRL_HLI=y # end of Bluetooth controller CONFIG_BT_BLUEDROID_ENABLED=y @@ -274,12 +232,13 @@ CONFIG_BT_BLUEDROID_ENABLED=y # # Bluedroid Options # -CONFIG_BT_BTC_TASK_STACK_SIZE=4096 +CONFIG_BT_BTC_TASK_STACK_SIZE=3072 CONFIG_BT_BLUEDROID_PINNED_TO_CORE_0=y # CONFIG_BT_BLUEDROID_PINNED_TO_CORE_1 is not set CONFIG_BT_BLUEDROID_PINNED_TO_CORE=0 CONFIG_BT_BTU_TASK_STACK_SIZE=4096 # CONFIG_BT_BLUEDROID_MEM_DEBUG is not set +# CONFIG_BT_CLASSIC_ENABLED is not set CONFIG_BT_BLE_ENABLED=y CONFIG_BT_GATTS_ENABLE=y # CONFIG_BT_GATTS_PPCP_CHAR_GAP is not set @@ -294,6 +253,7 @@ CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE=0 # CONFIG_BT_GATTS_APPEARANCE_WRITABLE is not set CONFIG_BT_GATTC_ENABLE=y CONFIG_BT_GATTC_MAX_CACHE_CHAR=40 +CONFIG_BT_GATTC_NOTIF_REG_MAX=5 # CONFIG_BT_GATTC_CACHE_NVS_FLASH is not set CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=3 CONFIG_BT_BLE_SMP_ENABLE=y @@ -476,15 +436,14 @@ CONFIG_BT_LOG_BLUFI_TRACE_LEVEL=2 CONFIG_BT_ACL_CONNECTIONS=4 CONFIG_BT_MULTI_CONNECTION_ENBALE=y # CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST is not set -# CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY is not set +CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY=y # CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK is not set CONFIG_BT_SMP_ENABLE=y # CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN is not set CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT=30 CONFIG_BT_MAX_DEVICE_NAME_LEN=32 +# CONFIG_BT_BLE_RPA_SUPPORTED is not set CONFIG_BT_BLE_RPA_TIMEOUT=900 -CONFIG_BT_BLE_50_FEATURES_SUPPORTED=y -CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y # CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL is not set # end of Bluedroid Options # end of Bluetooth @@ -509,7 +468,6 @@ CONFIG_COAP_LOG_DEFAULT_LEVEL=0 # # CONFIG_ADC_FORCE_XPD_FSM is not set CONFIG_ADC_DISABLE_DAC=y -# CONFIG_ADC_CONTINUOUS_FORCE_USE_ADC2_ON_C3_S3 is not set # end of ADC configuration # @@ -531,6 +489,10 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=y # TWAI configuration # # CONFIG_TWAI_ISR_IN_IRAM is not set +# CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC is not set +# CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST is not set +# CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID is not set +# CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT is not set # CONFIG_TWAI_ERRATA_FIX_LISTEN_ONLY_DOM is not set # end of TWAI configuration @@ -540,6 +502,18 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=y # CONFIG_UART_ISR_IN_IRAM is not set # end of UART configuration +# +# RTCIO configuration +# +# CONFIG_RTCIO_SUPPORT_RTC_GPIO_DESC is not set +# end of RTCIO configuration + +# +# GPIO Configuration +# +# CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL is not set +# end of GPIO Configuration + # # GDMA Configuration # @@ -553,14 +527,17 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=y # # CONFIG_EFUSE_CUSTOM_TABLE is not set # CONFIG_EFUSE_VIRTUAL is not set -CONFIG_EFUSE_MAX_BLK_LEN=256 +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_NONE is not set +CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4=y +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_REPEAT is not set +CONFIG_EFUSE_MAX_BLK_LEN=192 # end of eFuse Bit Manager # # ESP-TLS # CONFIG_ESP_TLS_USING_MBEDTLS=y -CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y +# CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set # CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set # CONFIG_ESP_TLS_SERVER is not set # CONFIG_ESP_TLS_PSK_VERIFICATION is not set @@ -568,80 +545,68 @@ CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y # end of ESP-TLS # -# ESP32S3-Specific +# ESP32-specific # -CONFIG_ESP32S3_REV_MIN_0=y -# CONFIG_ESP32S3_REV_MIN_1 is not set -# CONFIG_ESP32S3_REV_MIN_2 is not set -CONFIG_ESP32S3_REV_MIN_FULL=0 +CONFIG_ESP32_REV_MIN_0=y +# CONFIG_ESP32_REV_MIN_1 is not set +# CONFIG_ESP32_REV_MIN_1_1 is not set +# CONFIG_ESP32_REV_MIN_2 is not set +# CONFIG_ESP32_REV_MIN_3 is not set +# CONFIG_ESP32_REV_MIN_3_1 is not set +CONFIG_ESP32_REV_MIN=0 +CONFIG_ESP32_REV_MIN_FULL=0 CONFIG_ESP_REV_MIN_FULL=0 -CONFIG_ESP32S3_REV_MAX_FULL_STR_OPT=y -CONFIG_ESP32S3_REV_MAX_FULL=99 -CONFIG_ESP_REV_MAX_FULL=99 -# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_80 is not set -# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_160 is not set -CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y -CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=240 - -# -# Cache config -# -CONFIG_ESP32S3_INSTRUCTION_CACHE_16KB=y -# CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB is not set -CONFIG_ESP32S3_INSTRUCTION_CACHE_SIZE=0x4000 -# CONFIG_ESP32S3_INSTRUCTION_CACHE_4WAYS is not set -CONFIG_ESP32S3_INSTRUCTION_CACHE_8WAYS=y -CONFIG_ESP32S3_ICACHE_ASSOCIATED_WAYS=8 -# CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_16B is not set -CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_32B=y -CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_SIZE=32 -# CONFIG_ESP32S3_INSTRUCTION_CACHE_WRAP is not set -# CONFIG_ESP32S3_DATA_CACHE_16KB is not set -CONFIG_ESP32S3_DATA_CACHE_32KB=y -# CONFIG_ESP32S3_DATA_CACHE_64KB is not set -CONFIG_ESP32S3_DATA_CACHE_SIZE=0x8000 -# CONFIG_ESP32S3_DATA_CACHE_4WAYS is not set -CONFIG_ESP32S3_DATA_CACHE_8WAYS=y -CONFIG_ESP32S3_DCACHE_ASSOCIATED_WAYS=8 -# CONFIG_ESP32S3_DATA_CACHE_LINE_16B is not set -CONFIG_ESP32S3_DATA_CACHE_LINE_32B=y -# CONFIG_ESP32S3_DATA_CACHE_LINE_64B is not set -CONFIG_ESP32S3_DATA_CACHE_LINE_SIZE=32 -# CONFIG_ESP32S3_DATA_CACHE_WRAP is not set -# end of Cache config - -# CONFIG_ESP32S3_SPIRAM_SUPPORT is not set -# CONFIG_ESP32S3_TRAX is not set -CONFIG_ESP32S3_TRACEMEM_RESERVE_DRAM=0x0 -# CONFIG_ESP32S3_ULP_COPROC_ENABLED is not set -CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM=0 -CONFIG_ESP32S3_DEBUG_OCDAWARE=y -CONFIG_ESP32S3_BROWNOUT_DET=y -CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_7=y -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_6 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_5 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_4 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_3 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_2 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_1 is not set -CONFIG_ESP32S3_BROWNOUT_DET_LVL=7 -CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC_FRC1=y -# CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC is not set -# CONFIG_ESP32S3_TIME_SYSCALL_USE_FRC1 is not set -# CONFIG_ESP32S3_TIME_SYSCALL_USE_NONE is not set -CONFIG_ESP32S3_RTC_CLK_SRC_INT_RC=y -# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_CRYS is not set -# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_OSC is not set -# CONFIG_ESP32S3_RTC_CLK_SRC_INT_8MD256 is not set -CONFIG_ESP32S3_RTC_CLK_CAL_CYCLES=1024 -CONFIG_ESP32S3_DEEP_SLEEP_WAKEUP_DELAY=2000 -# CONFIG_ESP32S3_RTCDATA_IN_FAST_MEM is not set -# CONFIG_ESP32S3_USE_FIXED_STATIC_RAM_SIZE is not set -# end of ESP32S3-Specific +CONFIG_ESP32_REV_MAX_FULL_STR_OPT=y +CONFIG_ESP32_REV_MAX_FULL=399 +CONFIG_ESP_REV_MAX_FULL=399 +CONFIG_ESP32_DPORT_WORKAROUND=y +# CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set +CONFIG_ESP32_DEFAULT_CPU_FREQ_160=y +# CONFIG_ESP32_DEFAULT_CPU_FREQ_240 is not set +CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=160 +# CONFIG_ESP32_SPIRAM_SUPPORT is not set +# CONFIG_ESP32_TRAX is not set +CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0x0 +# CONFIG_ESP32_ULP_COPROC_ENABLED is not set +CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0 +CONFIG_ESP32_DEBUG_OCDAWARE=y +CONFIG_ESP32_BROWNOUT_DET=y +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_0=y +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_7 is not set +CONFIG_ESP32_BROWNOUT_DET_LVL=0 +CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1=y +# CONFIG_ESP32_TIME_SYSCALL_USE_RTC is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_FRC1 is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_NONE is not set +CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y +# CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_ESP32_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_ESP32_RTC_CLK_SRC_INT_8MD256 is not set +CONFIG_ESP32_RTC_CLK_CAL_CYCLES=1024 +CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000 +CONFIG_ESP32_XTAL_FREQ_40=y +# CONFIG_ESP32_XTAL_FREQ_26 is not set +# CONFIG_ESP32_XTAL_FREQ_AUTO is not set +CONFIG_ESP32_XTAL_FREQ=40 +# CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE is not set +# CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set +# CONFIG_ESP32_COMPATIBLE_PRE_V3_1_BOOTLOADERS is not set +# CONFIG_ESP32_USE_FIXED_STATIC_RAM_SIZE is not set +CONFIG_ESP32_DPORT_DIS_INTERRUPT_LVL=5 +# end of ESP32-specific # # ADC-Calibration # +CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y +CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y +CONFIG_ADC_CAL_LUT_ENABLE=y # end of ADC-Calibration # @@ -654,6 +619,14 @@ CONFIG_ESP_ERR_TO_NAME_LOOKUP=y # Ethernet # CONFIG_ETH_ENABLED=y +CONFIG_ETH_USE_ESP32_EMAC=y +CONFIG_ETH_PHY_INTERFACE_RMII=y +CONFIG_ETH_RMII_CLK_INPUT=y +# CONFIG_ETH_RMII_CLK_OUTPUT is not set +CONFIG_ETH_RMII_CLK_IN_GPIO=0 +CONFIG_ETH_DMA_BUFFER_SIZE=512 +CONFIG_ETH_DMA_RX_BUFFER_NUM=10 +CONFIG_ETH_DMA_TX_BUFFER_NUM=10 CONFIG_ETH_USE_SPI_ETHERNET=y # CONFIG_ETH_SPI_ETHERNET_DM9051 is not set CONFIG_ETH_SPI_ETHERNET_W5500=y @@ -716,9 +689,10 @@ CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y -# CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO is not set -CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_FOUR=y -CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES=4 +# CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_TWO is not set +CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR=y +CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=4 +# CONFIG_ESP_MAC_IGNORE_MAC_CRC_ERROR is not set # end of MAC Config # @@ -728,12 +702,12 @@ CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y # CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND is not set +CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y # end of Sleep Config # # RTC Clock Config # -CONFIG_RTC_CLOCK_BBPLL_POWER_ON_WITH_USB=y # end of RTC Clock Config # end of Hardware Settings @@ -753,7 +727,6 @@ CONFIG_ESP_IPC_ISR_ENABLE=y # LCD Peripheral Configuration # CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE=32 -# CONFIG_LCD_RGB_ISR_IRAM_SAFE is not set # end of LCD Peripheral Configuration # end of LCD and Touch Panel @@ -774,7 +747,6 @@ CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20 CONFIG_ESP_PHY_MAX_TX_POWER=20 # CONFIG_ESP_PHY_REDUCE_TX_POWER is not set -CONFIG_ESP_PHY_ENABLE_USB=y CONFIG_ESP_PHY_RF_CAL_PARTIAL=y # CONFIG_ESP_PHY_RF_CAL_NONE is not set # CONFIG_ESP_PHY_RF_CAL_FULL is not set @@ -785,8 +757,6 @@ CONFIG_ESP_PHY_CALIBRATION_MODE=0 # Power Management # # CONFIG_PM_ENABLE is not set -CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y -CONFIG_PM_POWER_DOWN_TAGMEM_IN_LIGHT_SLEEP=y # end of Power Management # @@ -804,8 +774,6 @@ CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set # CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set # CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set -CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK=y -CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=y # # Memory protection @@ -821,12 +789,8 @@ CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 CONFIG_ESP_CONSOLE_UART_DEFAULT=y -# CONFIG_ESP_CONSOLE_USB_CDC is not set -# CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG is not set # CONFIG_ESP_CONSOLE_UART_CUSTOM is not set # CONFIG_ESP_CONSOLE_NONE is not set -# CONFIG_ESP_CONSOLE_SECONDARY_NONE is not set -CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y CONFIG_ESP_CONSOLE_UART=y CONFIG_ESP_CONSOLE_MULTIPLE_UART=y CONFIG_ESP_CONSOLE_UART_NUM=0 @@ -841,7 +805,7 @@ CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y # CONFIG_ESP_PANIC_HANDLER_IRAM is not set # CONFIG_ESP_DEBUG_STUBS_ENABLE is not set -CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y +CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5=y # end of ESP System Settings # @@ -853,7 +817,8 @@ CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER=y CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584 CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1 # CONFIG_ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD is not set -CONFIG_ESP_TIMER_IMPL_SYSTIMER=y +# CONFIG_ESP_TIMER_IMPL_FRC2 is not set +CONFIG_ESP_TIMER_IMPL_TG0_LAC=y # end of High resolution timer (esp_timer) # @@ -862,7 +827,7 @@ CONFIG_ESP_TIMER_IMPL_SYSTIMER=y CONFIG_ESP32_WIFI_ENABLED=y CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE=y CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=4 -CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8 +CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=16 # CONFIG_ESP32_WIFI_STATIC_TX_BUFFER is not set CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 @@ -876,14 +841,12 @@ CONFIG_ESP32_WIFI_NVS_ENABLED=y CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y # CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 -CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 -CONFIG_ESP32_WIFI_IRAM_OPT=y -CONFIG_ESP32_WIFI_RX_IRAM_OPT=y +CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=16 +# CONFIG_ESP32_WIFI_IRAM_OPT is not set +# CONFIG_ESP32_WIFI_RX_IRAM_OPT is not set CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y # CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set -# CONFIG_ESP_WIFI_FTM_ENABLE is not set # CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set -# CONFIG_ESP_WIFI_GCMP_SUPPORT is not set # CONFIG_ESP_WIFI_GMAC_SUPPORT is not set CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y # CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set @@ -969,10 +932,10 @@ CONFIG_FMB_EVENT_QUEUE_TIMEOUT=20 # # CONFIG_FREERTOS_UNICORE is not set CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF -CONFIG_FREERTOS_TICK_SUPPORT_SYSTIMER=y -CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL1=y -# CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL3 is not set -CONFIG_FREERTOS_SYSTICK_USES_SYSTIMER=y +CONFIG_FREERTOS_TICK_SUPPORT_CORETIMER=y +CONFIG_FREERTOS_CORETIMER_0=y +# CONFIG_FREERTOS_CORETIMER_1 is not set +CONFIG_FREERTOS_SYSTICK_USES_CCOUNT=y CONFIG_FREERTOS_HZ=1000 CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION=y # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set @@ -1001,6 +964,7 @@ CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y # CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set # CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set CONFIG_FREERTOS_DEBUG_OCDAWARE=y +# CONFIG_FREERTOS_FPU_IN_ISR is not set CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y # CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH is not set # end of FreeRTOS @@ -1066,11 +1030,12 @@ CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y # CONFIG_LWIP_LOCAL_HOSTNAME="espressif" # CONFIG_LWIP_NETIF_API is not set +CONFIG_LWIP_TCPIP_TASK_PRIO=18 # CONFIG_LWIP_TCPIP_CORE_LOCKING is not set # CONFIG_LWIP_CHECK_THREAD_SAFETY is not set CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y # CONFIG_LWIP_L2_TO_L3_COPY is not set -CONFIG_LWIP_IRAM_OPTIMIZATION=y +# CONFIG_LWIP_IRAM_OPTIMIZATION is not set CONFIG_LWIP_TIMERS_ONDEMAND=y CONFIG_LWIP_MAX_SOCKETS=10 # CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set @@ -1090,7 +1055,7 @@ CONFIG_LWIP_ESP_GRATUITOUS_ARP=y CONFIG_LWIP_GARP_TMR_INTERVAL=60 CONFIG_LWIP_ESP_MLDV6_REPORT=y CONFIG_LWIP_MLDV6_TMR_INTERVAL=40 -CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=16 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=8 CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y # CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y @@ -1215,7 +1180,7 @@ CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y # CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC is not set # CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y -CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 +CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=2048 CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=2048 CONFIG_MBEDTLS_DYNAMIC_BUFFER=y CONFIG_MBEDTLS_DYNAMIC_FREE_PEER_CERT=y @@ -1245,7 +1210,6 @@ CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200 # CONFIG_MBEDTLS_ECP_RESTARTABLE is not set # CONFIG_MBEDTLS_CMAC_C is not set CONFIG_MBEDTLS_HARDWARE_AES=y -CONFIG_MBEDTLS_AES_USE_INTERRUPT=y CONFIG_MBEDTLS_HARDWARE_MPI=y CONFIG_MBEDTLS_HARDWARE_SHA=y CONFIG_MBEDTLS_ROM_MD5=y @@ -1425,7 +1389,6 @@ CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" # CONFIG_SPI_FLASH_VERIFY_WRITE is not set # CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y -# CONFIG_SPI_FLASH_ROM_IMPL is not set CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y # CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set # CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set @@ -1449,7 +1412,6 @@ CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP=y CONFIG_SPI_FLASH_SUPPORT_TH_CHIP=y -CONFIG_SPI_FLASH_SUPPORT_MXIC_OPI_CHIP=y # end of Auto-detect flash chips CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y @@ -1503,12 +1465,6 @@ CONFIG_WS_BUFFER_SIZE=1024 # end of Websocket # end of TCP Transport -# -# TinyUSB Stack -# -# CONFIG_TINYUSB is not set -# end of TinyUSB Stack - # # Unity unit testing library # @@ -1521,24 +1477,10 @@ CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y # CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set # end of Unity unit testing library -# -# USB-OTG -# -CONFIG_USB_OTG_SUPPORTED=y -CONFIG_USB_HOST_CONTROL_TRANSFER_MAX_SIZE=256 -CONFIG_USB_HOST_HW_BUFFER_BIAS_BALANCED=y -# CONFIG_USB_HOST_HW_BUFFER_BIAS_IN is not set -# CONFIG_USB_HOST_HW_BUFFER_BIAS_PERIODIC_OUT is not set - # # Root Hub configuration # -CONFIG_USB_HOST_DEBOUNCE_DELAY_MS=250 -CONFIG_USB_HOST_RESET_HOLD_MS=30 -CONFIG_USB_HOST_RESET_RECOVERY_MS=30 -CONFIG_USB_HOST_SET_ADDR_RECOVERY_MS=10 # end of Root Hub configuration -# end of USB-OTG # # Virtual file system @@ -1609,323 +1551,3 @@ CONFIG_LUA_ROOT="/lua" # # CONFIG_LEGACY_INCLUDE_COMMON_HEADERS is not set # end of Compatibility options - -# Deprecated options for backward compatibility -CONFIG_TOOLPREFIX="xtensa-esp32s3-elf-" -CONFIG_LOG_BOOTLOADER_LEVEL_NONE=y -# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_INFO is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set -CONFIG_LOG_BOOTLOADER_LEVEL=0 -# CONFIG_APP_ROLLBACK_ENABLE is not set -# CONFIG_FLASH_ENCRYPTION_ENABLED is not set -# CONFIG_FLASHMODE_QIO is not set -# CONFIG_FLASHMODE_QOUT is not set -CONFIG_FLASHMODE_DIO=y -# CONFIG_FLASHMODE_DOUT is not set -# CONFIG_MONITOR_BAUD_9600B is not set -# CONFIG_MONITOR_BAUD_57600B is not set -CONFIG_MONITOR_BAUD_115200B=y -# CONFIG_MONITOR_BAUD_230400B is not set -# CONFIG_MONITOR_BAUD_921600B is not set -# CONFIG_MONITOR_BAUD_2MB is not set -# CONFIG_MONITOR_BAUD_OTHER is not set -CONFIG_MONITOR_BAUD_OTHER_VAL=115200 -CONFIG_MONITOR_BAUD=115200 -CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG=y -# CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set -CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y -# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set -# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set -CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2 -# CONFIG_CXX_EXCEPTIONS is not set -CONFIG_STACK_CHECK_NONE=y -# CONFIG_STACK_CHECK_NORM is not set -# CONFIG_STACK_CHECK_STRONG is not set -# CONFIG_STACK_CHECK_ALL is not set -# CONFIG_WARN_WRITE_STRINGS is not set -# CONFIG_DISABLE_GCC8_WARNINGS is not set -# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set -CONFIG_ESP32_APPTRACE_DEST_NONE=y -CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y -CONFIG_BLUEDROID_ENABLED=y -# CONFIG_NIMBLE_ENABLED is not set -CONFIG_BTC_TASK_STACK_SIZE=4096 -CONFIG_BLUEDROID_PINNED_TO_CORE_0=y -# CONFIG_BLUEDROID_PINNED_TO_CORE_1 is not set -CONFIG_BLUEDROID_PINNED_TO_CORE=0 -CONFIG_BTU_TASK_STACK_SIZE=4096 -# CONFIG_BLUEDROID_MEM_DEBUG is not set -CONFIG_GATTS_ENABLE=y -# CONFIG_GATTS_SEND_SERVICE_CHANGE_MANUAL is not set -CONFIG_GATTS_SEND_SERVICE_CHANGE_AUTO=y -CONFIG_GATTS_SEND_SERVICE_CHANGE_MODE=0 -CONFIG_GATTC_ENABLE=y -# CONFIG_GATTC_CACHE_NVS_FLASH is not set -CONFIG_BLE_SMP_ENABLE=y -# CONFIG_SMP_SLAVE_CON_PARAMS_UPD_ENABLE is not set -# CONFIG_HCI_TRACE_LEVEL_NONE is not set -# CONFIG_HCI_TRACE_LEVEL_ERROR is not set -CONFIG_HCI_TRACE_LEVEL_WARNING=y -# CONFIG_HCI_TRACE_LEVEL_API is not set -# CONFIG_HCI_TRACE_LEVEL_EVENT is not set -# CONFIG_HCI_TRACE_LEVEL_DEBUG is not set -# CONFIG_HCI_TRACE_LEVEL_VERBOSE is not set -CONFIG_HCI_INITIAL_TRACE_LEVEL=2 -# CONFIG_BTM_TRACE_LEVEL_NONE is not set -# CONFIG_BTM_TRACE_LEVEL_ERROR is not set -CONFIG_BTM_TRACE_LEVEL_WARNING=y -# CONFIG_BTM_TRACE_LEVEL_API is not set -# CONFIG_BTM_TRACE_LEVEL_EVENT is not set -# CONFIG_BTM_TRACE_LEVEL_DEBUG is not set -# CONFIG_BTM_TRACE_LEVEL_VERBOSE is not set -CONFIG_BTM_INITIAL_TRACE_LEVEL=2 -# CONFIG_L2CAP_TRACE_LEVEL_NONE is not set -# CONFIG_L2CAP_TRACE_LEVEL_ERROR is not set -CONFIG_L2CAP_TRACE_LEVEL_WARNING=y -# CONFIG_L2CAP_TRACE_LEVEL_API is not set -# CONFIG_L2CAP_TRACE_LEVEL_EVENT is not set -# CONFIG_L2CAP_TRACE_LEVEL_DEBUG is not set -# CONFIG_L2CAP_TRACE_LEVEL_VERBOSE is not set -CONFIG_L2CAP_INITIAL_TRACE_LEVEL=2 -# CONFIG_RFCOMM_TRACE_LEVEL_NONE is not set -# CONFIG_RFCOMM_TRACE_LEVEL_ERROR is not set -CONFIG_RFCOMM_TRACE_LEVEL_WARNING=y -# CONFIG_RFCOMM_TRACE_LEVEL_API is not set -# CONFIG_RFCOMM_TRACE_LEVEL_EVENT is not set -# CONFIG_RFCOMM_TRACE_LEVEL_DEBUG is not set -# CONFIG_RFCOMM_TRACE_LEVEL_VERBOSE is not set -CONFIG_RFCOMM_INITIAL_TRACE_LEVEL=2 -# CONFIG_SDP_TRACE_LEVEL_NONE is not set -# CONFIG_SDP_TRACE_LEVEL_ERROR is not set -CONFIG_SDP_TRACE_LEVEL_WARNING=y -# CONFIG_SDP_TRACE_LEVEL_API is not set -# CONFIG_SDP_TRACE_LEVEL_EVENT is not set -# CONFIG_SDP_TRACE_LEVEL_DEBUG is not set -# CONFIG_SDP_TRACE_LEVEL_VERBOSE is not set -CONFIG_BTH_LOG_SDP_INITIAL_TRACE_LEVEL=2 -# CONFIG_GAP_TRACE_LEVEL_NONE is not set -# CONFIG_GAP_TRACE_LEVEL_ERROR is not set -CONFIG_GAP_TRACE_LEVEL_WARNING=y -# CONFIG_GAP_TRACE_LEVEL_API is not set -# CONFIG_GAP_TRACE_LEVEL_EVENT is not set -# CONFIG_GAP_TRACE_LEVEL_DEBUG is not set -# CONFIG_GAP_TRACE_LEVEL_VERBOSE is not set -CONFIG_GAP_INITIAL_TRACE_LEVEL=2 -CONFIG_BNEP_INITIAL_TRACE_LEVEL=2 -# CONFIG_PAN_TRACE_LEVEL_NONE is not set -# CONFIG_PAN_TRACE_LEVEL_ERROR is not set -CONFIG_PAN_TRACE_LEVEL_WARNING=y -# CONFIG_PAN_TRACE_LEVEL_API is not set -# CONFIG_PAN_TRACE_LEVEL_EVENT is not set -# CONFIG_PAN_TRACE_LEVEL_DEBUG is not set -# CONFIG_PAN_TRACE_LEVEL_VERBOSE is not set -CONFIG_PAN_INITIAL_TRACE_LEVEL=2 -# CONFIG_A2D_TRACE_LEVEL_NONE is not set -# CONFIG_A2D_TRACE_LEVEL_ERROR is not set -CONFIG_A2D_TRACE_LEVEL_WARNING=y -# CONFIG_A2D_TRACE_LEVEL_API is not set -# CONFIG_A2D_TRACE_LEVEL_EVENT is not set -# CONFIG_A2D_TRACE_LEVEL_DEBUG is not set -# CONFIG_A2D_TRACE_LEVEL_VERBOSE is not set -CONFIG_A2D_INITIAL_TRACE_LEVEL=2 -# CONFIG_AVDT_TRACE_LEVEL_NONE is not set -# CONFIG_AVDT_TRACE_LEVEL_ERROR is not set -CONFIG_AVDT_TRACE_LEVEL_WARNING=y -# CONFIG_AVDT_TRACE_LEVEL_API is not set -# CONFIG_AVDT_TRACE_LEVEL_EVENT is not set -# CONFIG_AVDT_TRACE_LEVEL_DEBUG is not set -# CONFIG_AVDT_TRACE_LEVEL_VERBOSE is not set -CONFIG_AVDT_INITIAL_TRACE_LEVEL=2 -# CONFIG_AVCT_TRACE_LEVEL_NONE is not set -# CONFIG_AVCT_TRACE_LEVEL_ERROR is not set -CONFIG_AVCT_TRACE_LEVEL_WARNING=y -# CONFIG_AVCT_TRACE_LEVEL_API is not set -# CONFIG_AVCT_TRACE_LEVEL_EVENT is not set -# CONFIG_AVCT_TRACE_LEVEL_DEBUG is not set -# CONFIG_AVCT_TRACE_LEVEL_VERBOSE is not set -CONFIG_AVCT_INITIAL_TRACE_LEVEL=2 -# CONFIG_AVRC_TRACE_LEVEL_NONE is not set -# CONFIG_AVRC_TRACE_LEVEL_ERROR is not set -CONFIG_AVRC_TRACE_LEVEL_WARNING=y -# CONFIG_AVRC_TRACE_LEVEL_API is not set -# CONFIG_AVRC_TRACE_LEVEL_EVENT is not set -# CONFIG_AVRC_TRACE_LEVEL_DEBUG is not set -# CONFIG_AVRC_TRACE_LEVEL_VERBOSE is not set -CONFIG_AVRC_INITIAL_TRACE_LEVEL=2 -# CONFIG_MCA_TRACE_LEVEL_NONE is not set -# CONFIG_MCA_TRACE_LEVEL_ERROR is not set -CONFIG_MCA_TRACE_LEVEL_WARNING=y -# CONFIG_MCA_TRACE_LEVEL_API is not set -# CONFIG_MCA_TRACE_LEVEL_EVENT is not set -# CONFIG_MCA_TRACE_LEVEL_DEBUG is not set -# CONFIG_MCA_TRACE_LEVEL_VERBOSE is not set -CONFIG_MCA_INITIAL_TRACE_LEVEL=2 -# CONFIG_HID_TRACE_LEVEL_NONE is not set -# CONFIG_HID_TRACE_LEVEL_ERROR is not set -CONFIG_HID_TRACE_LEVEL_WARNING=y -# CONFIG_HID_TRACE_LEVEL_API is not set -# CONFIG_HID_TRACE_LEVEL_EVENT is not set -# CONFIG_HID_TRACE_LEVEL_DEBUG is not set -# CONFIG_HID_TRACE_LEVEL_VERBOSE is not set -CONFIG_HID_INITIAL_TRACE_LEVEL=2 -# CONFIG_APPL_TRACE_LEVEL_NONE is not set -# CONFIG_APPL_TRACE_LEVEL_ERROR is not set -CONFIG_APPL_TRACE_LEVEL_WARNING=y -# CONFIG_APPL_TRACE_LEVEL_API is not set -# CONFIG_APPL_TRACE_LEVEL_EVENT is not set -# CONFIG_APPL_TRACE_LEVEL_DEBUG is not set -# CONFIG_APPL_TRACE_LEVEL_VERBOSE is not set -CONFIG_APPL_INITIAL_TRACE_LEVEL=2 -# CONFIG_GATT_TRACE_LEVEL_NONE is not set -# CONFIG_GATT_TRACE_LEVEL_ERROR is not set -CONFIG_GATT_TRACE_LEVEL_WARNING=y -# CONFIG_GATT_TRACE_LEVEL_API is not set -# CONFIG_GATT_TRACE_LEVEL_EVENT is not set -# CONFIG_GATT_TRACE_LEVEL_DEBUG is not set -# CONFIG_GATT_TRACE_LEVEL_VERBOSE is not set -CONFIG_GATT_INITIAL_TRACE_LEVEL=2 -# CONFIG_SMP_TRACE_LEVEL_NONE is not set -# CONFIG_SMP_TRACE_LEVEL_ERROR is not set -CONFIG_SMP_TRACE_LEVEL_WARNING=y -# CONFIG_SMP_TRACE_LEVEL_API is not set -# CONFIG_SMP_TRACE_LEVEL_EVENT is not set -# CONFIG_SMP_TRACE_LEVEL_DEBUG is not set -# CONFIG_SMP_TRACE_LEVEL_VERBOSE is not set -CONFIG_SMP_INITIAL_TRACE_LEVEL=2 -# CONFIG_BTIF_TRACE_LEVEL_NONE is not set -# CONFIG_BTIF_TRACE_LEVEL_ERROR is not set -CONFIG_BTIF_TRACE_LEVEL_WARNING=y -# CONFIG_BTIF_TRACE_LEVEL_API is not set -# CONFIG_BTIF_TRACE_LEVEL_EVENT is not set -# CONFIG_BTIF_TRACE_LEVEL_DEBUG is not set -# CONFIG_BTIF_TRACE_LEVEL_VERBOSE is not set -CONFIG_BTIF_INITIAL_TRACE_LEVEL=2 -# CONFIG_BTC_TRACE_LEVEL_NONE is not set -# CONFIG_BTC_TRACE_LEVEL_ERROR is not set -CONFIG_BTC_TRACE_LEVEL_WARNING=y -# CONFIG_BTC_TRACE_LEVEL_API is not set -# CONFIG_BTC_TRACE_LEVEL_EVENT is not set -# CONFIG_BTC_TRACE_LEVEL_DEBUG is not set -# CONFIG_BTC_TRACE_LEVEL_VERBOSE is not set -CONFIG_BTC_INITIAL_TRACE_LEVEL=2 -# CONFIG_OSI_TRACE_LEVEL_NONE is not set -# CONFIG_OSI_TRACE_LEVEL_ERROR is not set -CONFIG_OSI_TRACE_LEVEL_WARNING=y -# CONFIG_OSI_TRACE_LEVEL_API is not set -# CONFIG_OSI_TRACE_LEVEL_EVENT is not set -# CONFIG_OSI_TRACE_LEVEL_DEBUG is not set -# CONFIG_OSI_TRACE_LEVEL_VERBOSE is not set -CONFIG_OSI_INITIAL_TRACE_LEVEL=2 -# CONFIG_BLUFI_TRACE_LEVEL_NONE is not set -# CONFIG_BLUFI_TRACE_LEVEL_ERROR is not set -CONFIG_BLUFI_TRACE_LEVEL_WARNING=y -# CONFIG_BLUFI_TRACE_LEVEL_API is not set -# CONFIG_BLUFI_TRACE_LEVEL_EVENT is not set -# CONFIG_BLUFI_TRACE_LEVEL_DEBUG is not set -# CONFIG_BLUFI_TRACE_LEVEL_VERBOSE is not set -CONFIG_BLUFI_INITIAL_TRACE_LEVEL=2 -# CONFIG_BLE_HOST_QUEUE_CONGESTION_CHECK is not set -CONFIG_SMP_ENABLE=y -# CONFIG_BLE_ACTIVE_SCAN_REPORT_ADV_SCAN_RSP_INDIVIDUALLY is not set -CONFIG_BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT=30 -CONFIG_ADC2_DISABLE_DAC=y -# CONFIG_EVENT_LOOP_PROFILING is not set -CONFIG_POST_EVENTS_FROM_ISR=y -CONFIG_POST_EVENTS_FROM_IRAM_ISR=y -CONFIG_ESP_SYSTEM_PD_FLASH=y -CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND=y -CONFIG_IPC_TASK_STACK_SIZE=1536 -CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y -# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set -CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 -CONFIG_ESP32_PHY_MAX_TX_POWER=20 -# CONFIG_ESP32_REDUCE_PHY_TX_POWER is not set -CONFIG_ESP_SYSTEM_PM_POWER_DOWN_CPU=y -# CONFIG_ESP32S2_PANIC_PRINT_HALT is not set -CONFIG_ESP32S2_PANIC_PRINT_REBOOT=y -# CONFIG_ESP32S2_PANIC_SILENT_REBOOT is not set -# CONFIG_ESP32S2_PANIC_GDBSTUB is not set -CONFIG_ESP32S2_ALLOW_RTC_FAST_MEM_AS_HEAP=y -CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 -CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=3072 -CONFIG_MAIN_TASK_STACK_SIZE=3584 -CONFIG_CONSOLE_UART_DEFAULT=y -# CONFIG_CONSOLE_UART_CUSTOM is not set -# CONFIG_ESP_CONSOLE_UART_NONE is not set -CONFIG_CONSOLE_UART=y -CONFIG_CONSOLE_UART_NUM=0 -CONFIG_CONSOLE_UART_BAUDRATE=115200 -CONFIG_INT_WDT=y -CONFIG_INT_WDT_TIMEOUT_MS=300 -CONFIG_INT_WDT_CHECK_CPU1=y -CONFIG_TASK_WDT=y -# CONFIG_TASK_WDT_PANIC is not set -CONFIG_TASK_WDT_TIMEOUT_S=5 -CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y -CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y -# CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set -CONFIG_TIMER_TASK_STACK_SIZE=3584 -CONFIG_SW_COEXIST_ENABLE=y -# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set -# CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set -CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y -CONFIG_MB_MASTER_TIMEOUT_MS_RESPOND=150 -CONFIG_MB_MASTER_DELAY_MS_CONVERT=200 -CONFIG_MB_QUEUE_LENGTH=20 -CONFIG_MB_SERIAL_TASK_STACK_SIZE=4096 -CONFIG_MB_SERIAL_BUF_SIZE=256 -CONFIG_MB_SERIAL_TASK_PRIO=10 -CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT=y -CONFIG_MB_CONTROLLER_SLAVE_ID=0x00112233 -CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT=20 -CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE=20 -CONFIG_MB_CONTROLLER_STACK_SIZE=4096 -CONFIG_MB_EVENT_QUEUE_TIMEOUT=20 -# CONFIG_MB_TIMER_PORT_ENABLED is not set -# CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set -CONFIG_TIMER_TASK_PRIORITY=1 -CONFIG_TIMER_TASK_STACK_DEPTH=2048 -CONFIG_TIMER_QUEUE_LENGTH=10 -# CONFIG_L2_TO_L3_COPY is not set -# CONFIG_USE_ONLY_LWIP_SELECT is not set -CONFIG_ESP_GRATUITOUS_ARP=y -CONFIG_GARP_TMR_INTERVAL=60 -CONFIG_TCPIP_RECVMBOX_SIZE=16 -CONFIG_TCP_MAXRTX=12 -CONFIG_TCP_SYNMAXRTX=12 -CONFIG_TCP_MSS=1440 -CONFIG_TCP_MSL=60000 -CONFIG_TCP_SND_BUF_DEFAULT=5744 -CONFIG_TCP_WND_DEFAULT=5744 -CONFIG_TCP_RECVMBOX_SIZE=6 -CONFIG_TCP_QUEUE_OOSEQ=y -# CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set -CONFIG_TCP_OVERSIZE_MSS=y -# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set -# CONFIG_TCP_OVERSIZE_DISABLE is not set -CONFIG_UDP_RECVMBOX_SIZE=6 -CONFIG_TCPIP_TASK_STACK_SIZE=3072 -CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y -# CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set -# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set -CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF -# CONFIG_PPP_SUPPORT is not set -CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 -CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 -CONFIG_ESP32_PTHREAD_STACK_MIN=768 -CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y -# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set -# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set -CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 -CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" -CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y -# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set -# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set -# CONFIG_USB_ENABLED is not set -CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y -CONFIG_SUPPORT_TERMIOS=y -CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 -# End of deprecated options From 25f024d0f9dcb118e710523671204b8fe04967ee Mon Sep 17 00:00:00 2001 From: Krishna Kumar Sah Date: Thu, 22 Feb 2024 14:55:40 +0545 Subject: [PATCH 11/27] testing ws-server --- .../ezlopi_core_ws_server.c | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.c b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.c index 9c561ec30..28cca8241 100644 --- a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.c +++ b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.c @@ -64,8 +64,9 @@ static void __connection_process(void *pv) TRACE_D("here"); struct netbuf *net_buffer = NULL; err_t err = netconn_recv(ws_conn->conn, &net_buffer); + TRACE_D("here"); - if ((ESP_OK == err) && net_buffer) + if ((ERR_OK == err) && net_buffer) { char *data_str = NULL; uint32_t data_len = 0; @@ -93,7 +94,6 @@ static void __connection_process(void *pv) static void __server_process(void *pv) { - TRACE_D("Here"); struct netconn *listen_con = netconn_new(NETCONN_TCP); if (listen_con) @@ -102,7 +102,6 @@ static void __server_process(void *pv) err_t err = netconn_listen(listen_con); if (ERR_OK == err) { - TRACE_D("listening..."); while (1) { struct netconn *new_con = NULL; @@ -114,6 +113,24 @@ static void __server_process(void *pv) s_ws_server_connections_t *ws_conn = ezlopi_core_ws_server_conn_add_ws_conn(new_con); if (ws_conn) { + struct netbuf *tmp_net_buf = NULL; + err_t err = netconn_recv(new_con, &tmp_net_buf); + + TRACE_W("error: %s", lwip_strerr(err)); + + if ( tmp_net_buf) + { + char *data = NULL; + uint32_t data_len = 0; + + netbuf_data(tmp_net_buf, &data, &data_len); + + if (data) + { + TRACE_W("data: %s", data); + } + } + xTaskCreate(__connection_process, "ws-connection", 4 * 1024, ws_conn, 5, &ws_conn->handle); } else From 992701c67f02e5610444758d875b264f3fb11b18 Mon Sep 17 00:00:00 2001 From: Krishna Kumar Sah Date: Thu, 22 Feb 2024 21:09:11 +0545 Subject: [PATCH 12/27] added log on wifi-event, fixed issues on ws-server, working on header-frame --- .../ezlopi-core-wifi/ezlopi_core_wifi.c | 10 +- .../ezlopi-core-ws-server/CMakeLists.txt | 1 + .../ezlopi_core_ws_server.c | 332 ++++++++++++++---- .../ezlopi_core_ws_server_conn.c | 30 +- .../ezlopi_core_ws_server_conn.h | 4 +- sdkconfig | 7 - 6 files changed, 293 insertions(+), 91 deletions(-) diff --git a/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.c b/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.c index db5daf12d..fc5d400bc 100644 --- a/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.c +++ b/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.c @@ -127,6 +127,8 @@ static void __event_handler(void *arg, esp_event_base_t event_base, int32_t even } else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED) { + ezlopi_event_group_clear_event(EZLOPI_EVENT_WIFI_CONNECTED); + // event_data; // wifi_event_sta_disconnected_t *disconnected = (wifi_event_sta_disconnected_t *)event_data; TRACE_E("Disconnect reason[%d]: %s", disconnected->reason, ezlopi_wifi_err_reason_str(disconnected->reason)); @@ -166,6 +168,10 @@ static void __event_handler(void *arg, esp_event_base_t event_base, int32_t even // alert_qt_wifi_got_ip(); } + else + { + TRACE_E("unknown event:: event_base: %u, event_id: %d", (uint32_t)event_base, event_id); + } ll_ezlopi_wifi_event_upcall_t *curr_upcall = __event_upcall_head; while (curr_upcall) @@ -291,12 +297,12 @@ esp_err_t ezlopi_wifi_connect(const char *ssid, const char *pass) int ezlopi_wait_for_wifi_to_connect(uint32_t wait_time_ms) { uint32_t ret = 0; - while (-1 == ezlopi_event_group_wait_for_event(EZLOPI_EVENT_WIFI_CONNECTED, wait_time_ms, 0)) + while (-1 == ezlopi_event_group_wait_for_event(EZLOPI_EVENT_WIFI_CONNECTED, wait_time_ms, false)) { vTaskDelay(100 / portTICK_PERIOD_MS); } - ret = ezlopi_event_group_wait_for_event(EZLOPI_EVENT_WIFI_CONNECTED, wait_time_ms, 0); + ret = ezlopi_event_group_wait_for_event(EZLOPI_EVENT_WIFI_CONNECTED, wait_time_ms, false); return ret; } diff --git a/ezlopi-core/ezlopi-core-ws-server/CMakeLists.txt b/ezlopi-core/ezlopi-core-ws-server/CMakeLists.txt index 075e15c53..295fd7a47 100644 --- a/ezlopi-core/ezlopi-core-ws-server/CMakeLists.txt +++ b/ezlopi-core/ezlopi-core-ws-server/CMakeLists.txt @@ -25,6 +25,7 @@ set(EZLOPI_CORE_COMPONENTS ezlopi-core-scenes ezlopi-core-actions ezlopi-core-devices + ezlopi-core-event-group ) # Define HAL components diff --git a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.c b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.c index 28cca8241..67d99590f 100644 --- a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.c +++ b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.c @@ -4,7 +4,9 @@ #include #include #include -#include +#include +#include +#include #include #include @@ -12,14 +14,81 @@ #include "ezlopi_util_trace.h" #include "ezlopi_core_ws_server.h" +#include "ezlopi_core_event_group.h" #include "ezlopi_core_ws_server_conn.h" #include "ezlopi_core_ws_server_config.h" +/** + * @brief + * + * 0 1 2 3 + * _______________ _______________ _______________ _______________ + * 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 + * +-+-+-+-+-------+-+-------------+-------------------------------+ + * |F|R|R|R| opcode|M| Payload len | Extended payload length | + * |I|S|S|S| (4) |A| (7) | (16/64) | + * |N|V|V|V| |S| | (if payload len==126/127) | + * | |1|2|3| |K| | | + * +-+-+-+-+-------+-+-------------+ - - - - - - - - - - - - - - - + + * | Extended payload length continued, if payload len == 127 | + * + - - - - - - - - - - - - - - - +-------------------------------+ + * | |Masking-key, if MASK set to 1 | + * +-------------------------------+-------------------------------+ + * | Masking-key (continued) | Payload Data | + * +-------------------------------- - - - - - - - - - - - - - - - + + * : Payload Data continued ... : + * + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + * | Payload Data continued ... | + * +---------------------------------------------------------------+ + * for reference: https://datatracker.ietf.org/doc/html/rfc6455 -> page no. 28 (i.e. Base Framing Protocol) + */ + +typedef enum e_ws_opcode +{ + WS_OPCODE_CONTINUOUS_FRAME = 0x00, + WS_OPCODE_TEXT_FRAME, + WS_OPCODE_BINARY_FRAME, + + WS_OPCODE_CONNECTION_CLOSE = 0x08, + WS_OPCODE_PING_FRAME = 0x09, + WS_OPCODE_PONG_FRAME = 0x0A, +} e_ws_opcode_t; + +typedef struct s_ws_header_frame +{ + // Defines the interpretation of the "Payload data". + uint8_t opcode : 4; + + // MUST be 0 unless an extension is negotiated that defines meanings for non-zero values. + uint8_t rsv1 : 1; + uint8_t rsv2 : 1; + uint8_t rsv3 : 1; + + // Indicates that this is the final fragment in a message. The first fragment MAY also be the final fragment. + uint8_t fin : 1; + + // Payload length: 7 bits, 7+16 bits, or 7+64 bits + // range 0 to 125, is payload length in 7 bits + // if payload_len == 126, following 2 bytes interpreted as a 16-bit payload length + // if payload_len == 127, following 8 bytes interpreted as a 64-bit payload length + uint8_t payload_len : 7; + + // Defines whether the "Payload data" is masked. + uint8_t mask : 1; +} s_ws_header_frame_t; + static const char *gsc_sec_key_name = "Sec-WebSocket-Key:"; +static const char *gsc_wss_guid = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; static TaskHandle_t gs_task_handle = NULL; static void __server_init(void); static void __server_process(void *pv); +static int __ws_data_handle(s_ws_server_connections_t *ws_conn); +static int __new_connection_handsake(s_ws_server_connections_t *ws_conn); + +static int __process_payload(s_ws_header_frame_t *header_frame, uint8_t *rx_data); +static int __process_extended_payload_2(s_ws_header_frame_t *header_frame, uint8_t *rx_data); +static int __process_extended_payload_8(s_ws_header_frame_t *header_frame, uint8_t *rx_data); void ezlopi_core_ws_server_deinit(void) { @@ -39,48 +108,28 @@ void ezlopi_core_ws_server_init(void) } } -typedef struct s_ws_connections -{ - ezlopi_uuid_t server_uuid; - ezlopi_uuid_t client_uuid; - TaskHandle_t task_handle; - struct netconn *conn; - - struct s_ws_connections *next; -} s_ws_connections_t; - -static s_ws_connections_t *conn_head = NULL; - static void __connection_process(void *pv) { - s_ws_connections_t *ws_conn = (s_ws_connections_t *)pv; + s_ws_server_connections_t *ws_conn = (s_ws_server_connections_t *)pv; if (ws_conn) { - if (ws_conn->conn) + if (ws_conn->net_conn) { - while (1) + int ret = __new_connection_handsake(ws_conn); + + if (ret) { - TRACE_D("here"); - struct netbuf *net_buffer = NULL; - err_t err = netconn_recv(ws_conn->conn, &net_buffer); - TRACE_D("here"); - if ((ERR_OK == err) && net_buffer) + do { - char *data_str = NULL; - uint32_t data_len = 0; - netbuf_data(net_buffer, &data_str, &data_len); - - TRACE_D("ws-rx-data: %s", data_str); - } - - vTaskDelay(100 / portTICK_PERIOD_MS); + vTaskDelay(1); + } while (1); } - netconn_delete(ws_conn->conn); - ws_conn->conn = NULL; + netconn_delete(ws_conn->net_conn); + ws_conn->net_conn = NULL; ws_conn->task_handle = NULL; } } @@ -94,6 +143,8 @@ static void __connection_process(void *pv) static void __server_process(void *pv) { + ezlopi_event_group_wait_for_event(EZLOPI_EVENT_WIFI_CONNECTED, portMAX_DELAY, false); + struct netconn *listen_con = netconn_new(NETCONN_TCP); if (listen_con) @@ -110,28 +161,16 @@ static void __server_process(void *pv) err = netconn_accept(listen_con, &new_con); if ((ERR_OK == err) && new_con) { + ip_addr_t conn_ip; + uint16_t conn_port = 0; s_ws_server_connections_t *ws_conn = ezlopi_core_ws_server_conn_add_ws_conn(new_con); - if (ws_conn) - { - struct netbuf *tmp_net_buf = NULL; - err_t err = netconn_recv(new_con, &tmp_net_buf); - - TRACE_W("error: %s", lwip_strerr(err)); - - if ( tmp_net_buf) - { - char *data = NULL; - uint32_t data_len = 0; - - netbuf_data(tmp_net_buf, &data, &data_len); - if (data) - { - TRACE_W("data: %s", data); - } - } + netconn_getaddr(new_con, &conn_ip, &conn_port, 0); + TRACE_D("connection-request from: %s:%u", ipaddr_ntoa(&conn_ip), conn_port); - xTaskCreate(__connection_process, "ws-connection", 4 * 1024, ws_conn, 5, &ws_conn->handle); + if (ws_conn) + { + xTaskCreate(__connection_process, "ws-connection", 4 * 1024, ws_conn, 5, &ws_conn->task_handle); } else { @@ -156,41 +195,196 @@ static void __server_process(void *pv) vTaskDelete(NULL); } -static int __new_connection_handsake(s_ws_connections_t *ws_conn) +static int __new_connection_handsake(s_ws_server_connections_t *ws_conn) { int ret = 0; - if (ws_conn && ws_conn->conn) + if (ws_conn && ws_conn->net_conn) { struct netbuf *net_buffer = NULL; - err_t err = netconn_recv(ws_conn->conn, &net_buffer); + err_t err = netconn_recv(ws_conn->net_conn, &net_buffer); - if (err && net_buffer) + if (NULL != net_buffer) { - char *net_buf_data = NULL; - uint32_t data_size = 0; + char *buf_data = NULL; + uint16_t data_size = 0; - netbuf_data(net_buffer, net_buf_data, data_size); + netbuf_data(net_buffer, &buf_data, &data_size); + netbuf_delete(net_buffer); - if (net_buf_data) + if (buf_data) { - TRACE_D("handsake-data: %s", net_buf_data); - - char *client_sec_key = strstr(net_buf_data, gsc_sec_key_name); - if (client_sec_key) + char *client_sec_key_start = strstr(buf_data, gsc_sec_key_name); + if (client_sec_key_start) { char concated_strings[80]; - client_sec_key += strlen(gsc_sec_key_name) + 1; - uint32_t client_sec_key_len = strstr(client_sec_key, "\r\n") - (uint32_t)client_sec_key; + client_sec_key_start += strlen(gsc_sec_key_name) + 1; + uint32_t client_sec_key_len = strstr(client_sec_key_start, "\r\n") - client_sec_key_start; - ezlopi_util_uuid_generate_random(ws_conn->server_uuid); - uint32_t tmp_len = snprintf(concated_strings, sizeof(concated_strings), "%.*s", client_sec_key_len, client_sec_key); - ezlopi_util_uuid_unparse(ws_conn->server_uuid, concated_strings + tmp_len); + ezlopi_util_uuid_generate_random(ws_conn->uuid); + uint32_t tmp_len = snprintf(concated_strings, sizeof(concated_strings), "%.*s%s", client_sec_key_len, client_sec_key_start, gsc_wss_guid); - // esp_sha(SHA1, ) + free(buf_data); // work of buf_data finishes here + + uint8_t hash_of_cat[20]; + memset(hash_of_cat, 0, sizeof(hash_of_cat)); + esp_sha(SHA1, (uint8_t *)concated_strings, strlen(concated_strings), (uint8_t *)hash_of_cat); + + uint32_t o_len = 0; + char base64_data_of_cat[32]; + memset(base64_data_of_cat, 0, sizeof(base64_data_of_cat)); + mbedtls_base64_encode((uint8_t *)base64_data_of_cat, sizeof(base64_data_of_cat), &o_len, hash_of_cat, sizeof(hash_of_cat)); + + static const char *sc_handsake_response_frmt = + "HTTP/1.1 101 Switching Protocols \r\n" + "Upgrade: websocket\r\n" + "Connection: Upgrade\r\n" + "Sec-WebSocket-Accept: %.*s\r\n\r\n"; + + char *handshake_response = malloc(256); + if (handshake_response) + { + snprintf(handshake_response, 256, sc_handsake_response_frmt, sizeof(base64_data_of_cat), base64_data_of_cat); + netconn_write(ws_conn->net_conn, handshake_response, strlen(handshake_response), NETCONN_COPY); + + TRACE_D("handshake_response sent:\r\n%s", handshake_response); + free(handshake_response); + ret = 1; + } } + else + { + TRACE_E("Here"); + } + } + else + { + TRACE_E("Here"); } } + else + { + TRACE_E("Here"); + } } + else + { + TRACE_E("Here"); + } + return ret; -} \ No newline at end of file +} + +static int __ws_data_handle(s_ws_server_connections_t *ws_conn) +{ + if (ws_conn) + { + struct netbuf *net_buffer = NULL; + err_t err = netconn_recv(ws_conn->net_conn, &net_buffer); + TRACE_W("err: %s", lwip_strerr(err)); + + if (net_buffer) + { + + uint8_t *rx_data = NULL; + uint32_t data_len = 0; + + netbuf_data(net_buffer, &rx_data, &data_len); + netbuf_delete(net_buffer); + net_buffer = NULL; + + uint8_t *payload_start = NULL; + s_ws_header_frame_t *header_frame = (s_ws_header_frame_t *)rx_data; + + if (header_frame->payload_len <= 125) + { + __process_payload(header_frame, rx_data); + } + else if (header_frame == 126) + { + __process_extended_payload_2(header_frame, rx_data); + } + else if (header_frame == 127) + { + __process_extended_payload_8(header_frame, rx_data); + } + + TRACE_D("payload-len: %u", data_len); + + switch (header_frame->opcode) + { + case WS_OPCODE_TEXT_FRAME: + { + TRACE_I("text frame"); + break; + } + case WS_OPCODE_CONNECTION_CLOSE: + { + TRACE_I("connection close"); + break; + } + case WS_OPCODE_CONTINUOUS_FRAME: + { + TRACE_I("continuous frame"); + break; + } + case WS_OPCODE_BINARY_FRAME: + { + TRACE_I("binary frame"); + break; + } + case WS_OPCODE_PING_FRAME: + { + TRACE_I("ping"); + } + case WS_OPCODE_PONG_FRAME: + { + TRACE_I("pong"); + break; + } + default: + { + TRACE_E("unknown upcode"); + break; + } + } + + dump("rx-data", rx_data, 0, data_len); + } + } +} + +static int __process_payload(s_ws_header_frame_t *header_frame, uint8_t *rx_data) +{ + int ret = 0; + + if (header_frame && rx_data) + { + uint32_t data_len = (uint32_t)header_frame->payload_len; + uint8_t *payload_start = rx_data + 2; + } + + return ret; +} + +static int __process_extended_payload_2(s_ws_header_frame_t *header_frame, uint8_t *rx_data) +{ + int ret = 0; + if (header_frame && rx_data) + { + uint16_t data_len = (uint16_t)(rx_data + 2); + uint8_t *payload_start = rx_data + 4; + } + return ret; +} + +static int __process_extended_payload_8(s_ws_header_frame_t *header_frame, uint8_t *rx_data) +{ + int ret = 0; + if (header_frame && rx_data) + { + uint64_t data_len = ((uint64_t)(rx_data + 2)); + uint8_t *payload_start = rx_data + 10; + } + return ret; +} diff --git a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.c b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.c index b96cae354..ae5862bb3 100644 --- a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.c +++ b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.c @@ -7,7 +7,7 @@ static s_ws_server_connections_t *ws_conn_head = NULL; -static s_ws_server_connections_t *__create_ws_conn(struct netconn *conn); +static s_ws_server_connections_t *__create_ws_conn(void); s_ws_server_connections_t *ezlopi_core_ws_server_conn_get_head(void) { @@ -25,13 +25,21 @@ s_ws_server_connections_t *ezlopi_core_ws_server_conn_add_ws_conn(struct netconn curr_conn = curr_conn->next; } - curr_conn->next = __create_ws_conn(new_net_conn); - ws_conn = curr_conn->next; + ws_conn = __create_ws_conn(); + if (ws_conn) + { + curr_conn->next = ws_conn; + ws_conn->net_conn = new_net_conn; + } } else { - ws_conn_head = __create_ws_conn(new_net_conn); - ws_conn = ws_conn_head; + ws_conn = __create_ws_conn(); + if (ws_conn) + { + ws_conn_head = ws_conn; + ws_conn->net_conn = new_net_conn; + } } return ws_conn; @@ -52,7 +60,7 @@ s_ws_server_connections_t *ezlopi_core_ws_server_conn_pop(struct netconn *conn) { s_ws_server_connections_t *pop_con = NULL; - if (conn == ws_conn_head->conn) + if (conn == ws_conn_head->net_conn) { pop_con = ws_conn_head; ws_conn_head = ws_conn_head->next; @@ -63,7 +71,7 @@ s_ws_server_connections_t *ezlopi_core_ws_server_conn_pop(struct netconn *conn) s_ws_server_connections_t *curr_conn = ws_conn_head; while (curr_conn->next) { - if (curr_conn->next->conn == conn) + if (curr_conn->next->net_conn == conn) { pop_con = curr_conn->next; curr_conn->next = curr_conn->next->next; @@ -78,16 +86,16 @@ s_ws_server_connections_t *ezlopi_core_ws_server_conn_pop(struct netconn *conn) return pop_con; } -static s_ws_server_connections_t *__create_ws_conn(struct netconn *new_net_conn) +static s_ws_server_connections_t *__create_ws_conn(void) { s_ws_server_connections_t *new_ws_conn = malloc(sizeof(s_ws_server_connections_t)); if (new_ws_conn) { - memset(new_ws_conn, 0, sizeof(s_ws_server_connections_t)); + new_ws_conn->net_conn = NULL; + new_ws_conn->task_handle = NULL; - new_ws_conn->handle = NULL; - new_ws_conn->conn = new_net_conn; ezlopi_util_uuid_generate_random(new_ws_conn->uuid); + new_ws_conn->next = NULL; } diff --git a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.h b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.h index 5defd1b84..57f06d1f8 100644 --- a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.h +++ b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.h @@ -12,8 +12,8 @@ typedef struct s_ws_server_connections { ezlopi_uuid_t uuid; - TaskHandle_t handle; - struct netconn *conn; + TaskHandle_t task_handle; + struct netconn *net_conn; struct s_ws_server_connections *next; } s_ws_server_connections_t; diff --git a/sdkconfig b/sdkconfig index 79b441d36..cd4782851 100644 --- a/sdkconfig +++ b/sdkconfig @@ -1520,12 +1520,6 @@ CONFIG_WS_BUFFER_SIZE=1024 # end of Websocket # end of TCP Transport -# -# TinyUSB Stack -# -# CONFIG_TINYUSB is not set -# end of TinyUSB Stack - # # Unity unit testing library # @@ -1950,7 +1944,6 @@ CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y # CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set # CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set -# CONFIG_USB_ENABLED is not set CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y CONFIG_SUPPORT_TERMIOS=y CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 From c58d10e82760db7c96be083db4479faef8daf771 Mon Sep 17 00:00:00 2001 From: Krishna Kumar Sah Date: Thu, 22 Feb 2024 21:38:55 +0545 Subject: [PATCH 13/27] testing --- .../ezlopi_core_ws_server.c | 136 +++++++++--------- 1 file changed, 70 insertions(+), 66 deletions(-) diff --git a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.c b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.c index 67d99590f..ccda67240 100644 --- a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.c +++ b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.c @@ -120,9 +120,9 @@ static void __connection_process(void *pv) if (ret) { - do { + __ws_data_handle(ws_conn); vTaskDelay(1); } while (1); @@ -210,7 +210,6 @@ static int __new_connection_handsake(s_ws_server_connections_t *ws_conn) uint16_t data_size = 0; netbuf_data(net_buffer, &buf_data, &data_size); - netbuf_delete(net_buffer); if (buf_data) { @@ -224,8 +223,6 @@ static int __new_connection_handsake(s_ws_server_connections_t *ws_conn) ezlopi_util_uuid_generate_random(ws_conn->uuid); uint32_t tmp_len = snprintf(concated_strings, sizeof(concated_strings), "%.*s%s", client_sec_key_len, client_sec_key_start, gsc_wss_guid); - free(buf_data); // work of buf_data finishes here - uint8_t hash_of_cat[20]; memset(hash_of_cat, 0, sizeof(hash_of_cat)); esp_sha(SHA1, (uint8_t *)concated_strings, strlen(concated_strings), (uint8_t *)hash_of_cat); @@ -252,15 +249,9 @@ static int __new_connection_handsake(s_ws_server_connections_t *ws_conn) ret = 1; } } - else - { - TRACE_E("Here"); - } - } - else - { - TRACE_E("Here"); } + + netbuf_delete(net_buffer); } else { @@ -277,81 +268,91 @@ static int __new_connection_handsake(s_ws_server_connections_t *ws_conn) static int __ws_data_handle(s_ws_server_connections_t *ws_conn) { + int ret = 0; if (ws_conn) { + TRACE_D("Here"); struct netbuf *net_buffer = NULL; err_t err = netconn_recv(ws_conn->net_conn, &net_buffer); TRACE_W("err: %s", lwip_strerr(err)); if (net_buffer) { - uint8_t *rx_data = NULL; uint32_t data_len = 0; + netbuf_first(net_buffer); netbuf_data(net_buffer, &rx_data, &data_len); - netbuf_delete(net_buffer); net_buffer = NULL; - uint8_t *payload_start = NULL; - s_ws_header_frame_t *header_frame = (s_ws_header_frame_t *)rx_data; - - if (header_frame->payload_len <= 125) - { - __process_payload(header_frame, rx_data); - } - else if (header_frame == 126) + if (rx_data) { - __process_extended_payload_2(header_frame, rx_data); - } - else if (header_frame == 127) - { - __process_extended_payload_8(header_frame, rx_data); - } + dump("rx_data", rx_data, 0, data_len); - TRACE_D("payload-len: %u", data_len); + uint8_t *payload_start = NULL; + s_ws_header_frame_t *header_frame = (s_ws_header_frame_t *)rx_data; - switch (header_frame->opcode) - { - case WS_OPCODE_TEXT_FRAME: - { - TRACE_I("text frame"); - break; - } - case WS_OPCODE_CONNECTION_CLOSE: - { - TRACE_I("connection close"); - break; - } - case WS_OPCODE_CONTINUOUS_FRAME: - { - TRACE_I("continuous frame"); - break; - } - case WS_OPCODE_BINARY_FRAME: - { - TRACE_I("binary frame"); - break; - } - case WS_OPCODE_PING_FRAME: - { - TRACE_I("ping"); - } - case WS_OPCODE_PONG_FRAME: - { - TRACE_I("pong"); - break; - } - default: - { - TRACE_E("unknown upcode"); - break; - } + if (header_frame->payload_len <= 125) + { + __process_payload(header_frame, rx_data); + } + else if (header_frame == 126) + { + __process_extended_payload_2(header_frame, rx_data); + } + else if (header_frame == 127) + { + __process_extended_payload_8(header_frame, rx_data); + } + + switch (header_frame->opcode) + { + case WS_OPCODE_TEXT_FRAME: + { + TRACE_I("text frame"); + break; + } + case WS_OPCODE_CONNECTION_CLOSE: + { + TRACE_I("connection close"); + break; + } + case WS_OPCODE_CONTINUOUS_FRAME: + { + TRACE_I("continuous frame"); + break; + } + case WS_OPCODE_BINARY_FRAME: + { + TRACE_I("binary frame"); + break; + } + case WS_OPCODE_PING_FRAME: + { + TRACE_I("ping"); + } + case WS_OPCODE_PONG_FRAME: + { + TRACE_I("pong"); + break; + } + default: + { + TRACE_E("unknown upcode"); + break; + } + } } - dump("rx-data", rx_data, 0, data_len); + netbuf_delete(net_buffer); + } + else + { + TRACE_E("netbuf is null"); } } + + return ret; } static int __process_payload(s_ws_header_frame_t *header_frame, uint8_t *rx_data) @@ -362,6 +363,7 @@ static int __process_payload(s_ws_header_frame_t *header_frame, uint8_t *rx_data { uint32_t data_len = (uint32_t)header_frame->payload_len; uint8_t *payload_start = rx_data + 2; + TRACE_D("payload-len: %u", data_len); } return ret; @@ -374,6 +376,7 @@ static int __process_extended_payload_2(s_ws_header_frame_t *header_frame, uint8 { uint16_t data_len = (uint16_t)(rx_data + 2); uint8_t *payload_start = rx_data + 4; + TRACE_D("payload-len: %u", data_len); } return ret; } @@ -385,6 +388,7 @@ static int __process_extended_payload_8(s_ws_header_frame_t *header_frame, uint8 { uint64_t data_len = ((uint64_t)(rx_data + 2)); uint8_t *payload_start = rx_data + 10; + TRACE_D("payload-len: %llu", data_len); } return ret; } From 38734f819dd34029175ee0d0644a955f9fc58fa8 Mon Sep 17 00:00:00 2001 From: ezlo-rikenm Date: Fri, 23 Feb 2024 13:35:11 +0545 Subject: [PATCH 14/27] 1. renamed 'gpio','valueFormatted'... according to ezlopi_cloud_keyword; 2. esp32(4mb) change from 8mb to 4mb; 3. '0009'&'0031' bug fix in device-type : gpio_num --- .../ezlopi_cloud_keywords.c | 1 - .../ezlopi_cloud_keywords.h | 1 - .../ezlopi-core-devices/ezlopi_core_devices.c | 128 ++++++------- .../device_0004_digitalIn_generic.c | 2 +- .../device_0009_other_RMT_SK6812.c | 86 ++++----- .../device_0022_PWM_dimmable_lamp.c | 10 +- .../device_0036_PWM_servo_MG996R.c | 6 +- .../sensor_0005_I2C_MPU6050.c | 6 +- .../sensor_0006_I2C_ADXL345.c | 66 +++---- .../sensor_0007_I2C_GY271.c | 16 +- .../sensor_0010_I2C_BME680.c | 80 ++++---- .../sensor_0015_oneWire_DHT11.c | 84 ++++----- .../sensor_0016_oneWire_DHT22.c | 62 +++---- .../sensor_0019_digitalIn_PIR.c | 2 +- .../sensor_0020_other_2axis_joystick.c | 94 +++++----- ...nsor_0023_digitalIn_touch_switch_TTP223B.c | 2 +- .../sensor_0025_digitalIn_LDR.c | 2 +- .../sensor_0027_ADC_waterLeak.c | 2 +- .../sensor_0028_other_GY61.c | 78 ++++---- .../sensor_0029_I2C_GXHTC3.c | 6 +- .../sensor_0030_oneWire_DS18B20.c | 2 +- .../sensor_0031_other_JSNSR04T.c | 46 +++-- .../sensor_0032_ADC_soilMoisture.c | 2 +- .../sensor_0033_ADC_turbidity.c | 2 +- .../sensor_0034_digitalIn_proximity.c | 2 +- ...nsor_0035_digitalIn_touch_sensor_TPP223B.c | 2 +- .../pms_dev_items_prepare.c | 138 +++++++------- .../sensor_0040_other_TCS230.c | 172 +++++++++--------- .../sensor_0042_ADC_shunt_voltmeter.c | 4 +- .../sensor_0046_ADC_ACS712_05B_currentmeter.c | 56 +++--- .../sensor_0047_other_HX711_loadcell.c | 6 +- .../sensor_0054_PWM_YFS201_flowmeter.c | 2 +- .../sensor_0055_ADC_FlexResistor.c | 2 +- ...sensor_0056_ADC_Force_Sensitive_Resistor.c | 2 +- ...sensor_0060_digitalIn_vibration_detector.c | 2 +- .../sensor_0061_digitalIn_reed_switch.c | 2 +- .../sensor_0065_digitalIn_float_switch.c | 2 +- .../CMakeLists.txt | 1 + .../sensor_0066_other_R307_FingerPrint.c | 6 +- .../sensor_0067_hilink_presence_sensor.c | 98 +++++----- .../sensor_0068_ENS160_gas_sensor.c | 7 +- .../sensor_0069_ze08_ch02_gas_sensor.c | 6 +- sdkconfig | 9 - sdkconfig.esp32.4mb | 4 +- 44 files changed, 649 insertions(+), 660 deletions(-) diff --git a/ezlopi-cloud/ezlopi-cloud-constants/ezlopi_cloud_keywords.c b/ezlopi-cloud/ezlopi-cloud-constants/ezlopi_cloud_keywords.c index 55afdf8b9..446754881 100644 --- a/ezlopi-cloud/ezlopi-cloud-constants/ezlopi_cloud_keywords.c +++ b/ezlopi-cloud/ezlopi-cloud-constants/ezlopi_cloud_keywords.c @@ -216,7 +216,6 @@ const char *scene_status_finished_str = "finished"; const char *scene_status_partially_finished_str = "partially_finished"; const char *scene_status_failed_str = "failed"; const char *scene_status_stopped_str = "stopped"; -const char *ezlopi_valueformatted_str = "valueFormatted"; const char *ezlopi_value_default_str = "valueDefault"; const char *ezlopi_text_str = "text"; const char *ezlopi_lang_tag_str = "lang_tag"; diff --git a/ezlopi-cloud/ezlopi-cloud-constants/ezlopi_cloud_keywords.h b/ezlopi-cloud/ezlopi-cloud-constants/ezlopi_cloud_keywords.h index b1820ca74..106a865cf 100644 --- a/ezlopi-cloud/ezlopi-cloud-constants/ezlopi_cloud_keywords.h +++ b/ezlopi-cloud/ezlopi-cloud-constants/ezlopi_cloud_keywords.h @@ -220,7 +220,6 @@ extern const char* ezlopi_armed_str; extern const char* ezlopi_subtype_str; extern const char* ezlopi_scale_str; extern const char* ezlopi_enum_str; -extern const char* ezlopi_valueformatted_str; extern const char* ezlopi_value_default_str; extern const char* ezlopi_text_str; extern const char* ezlopi_label_str; diff --git a/ezlopi-core/ezlopi-core-devices/ezlopi_core_devices.c b/ezlopi-core/ezlopi-core-devices/ezlopi_core_devices.c index 6ef3bcab0..6c493f40b 100644 --- a/ezlopi-core/ezlopi-core-devices/ezlopi_core_devices.c +++ b/ezlopi-core/ezlopi-core-devices/ezlopi_core_devices.c @@ -6,19 +6,19 @@ #include "ezlopi_cloud_items.h" #include "ezlopi_cloud_constants.h" -static l_ezlopi_device_t *l_device_head = NULL; +static l_ezlopi_device_t* l_device_head = NULL; static volatile uint32_t g_store_dev_config_with_id = 0; static s_ezlopi_cloud_controller_t s_controller_information; -static void ezlopi_device_parse_json_v3(cJSON *cj_config); -static void ezlopi_device_free_single(l_ezlopi_device_t *device); +static void ezlopi_device_parse_json_v3(cJSON* cj_config); +static void ezlopi_device_free_single(l_ezlopi_device_t* device); static void ezlopi_device_print_controller_cloud_information_v3(void); -void ezlopi_device_name_set_by_device_id(uint32_t a_device_id, cJSON *cj_new_name) +void ezlopi_device_name_set_by_device_id(uint32_t a_device_id, cJSON* cj_new_name) { if (a_device_id && cj_new_name && cj_new_name->valuestring) { - l_ezlopi_device_t *l_device_node = l_device_head; + l_ezlopi_device_t* l_device_node = l_device_head; while (l_device_node) { if (a_device_id == l_device_node->cloud_properties.device_id) @@ -30,22 +30,22 @@ void ezlopi_device_name_set_by_device_id(uint32_t a_device_id, cJSON *cj_new_nam l_device_node = l_device_node->next; } - char *device_config_str = ezlopi_factory_info_v3_get_ezlopi_config(); + char* device_config_str = ezlopi_factory_info_v3_get_ezlopi_config(); if (device_config_str) { - cJSON *cj_device_config = cJSON_Parse(device_config_str); + cJSON* cj_device_config = cJSON_Parse(device_config_str); ezlopi_factory_info_v3_free(device_config_str); if (cj_device_config) { - cJSON *cj_devices = cJSON_GetObjectItem(cj_device_config, ezlopi_dev_detail_str); + cJSON* cj_devices = cJSON_GetObjectItem(cj_device_config, ezlopi_dev_detail_str); if (cj_devices) { uint32_t idx = 0; - cJSON *cj_device = NULL; + cJSON* cj_device = NULL; while (NULL != (cj_device = cJSON_GetArrayItem(cj_devices, idx))) { - cJSON *cj_device_id = cJSON_GetObjectItem(cj_device, ezlopi_device_id_str); + cJSON* cj_device_id = cJSON_GetObjectItem(cj_device, ezlopi_device_id_str); if (cj_device_id && cj_device_id->valuestring) { uint32_t device_id = strtoul(cj_device_id->valuestring, NULL, 16); @@ -61,7 +61,7 @@ void ezlopi_device_name_set_by_device_id(uint32_t a_device_id, cJSON *cj_new_nam } } - char *update_device_config = cJSON_Print(cj_device_config); + char* update_device_config = cJSON_Print(cj_device_config); cJSON_Delete(cj_device_config); if (update_device_config) { @@ -74,19 +74,19 @@ void ezlopi_device_name_set_by_device_id(uint32_t a_device_id, cJSON *cj_new_nam } } -s_ezlopi_cloud_controller_t *ezlopi_device_get_controller_information(void) +s_ezlopi_cloud_controller_t* ezlopi_device_get_controller_information(void) { return &s_controller_information; } -l_ezlopi_device_t *ezlopi_device_get_head(void) +l_ezlopi_device_t* ezlopi_device_get_head(void) { return l_device_head; } -l_ezlopi_device_t *ezlopi_device_get_by_id(uint32_t device_id) +l_ezlopi_device_t* ezlopi_device_get_by_id(uint32_t device_id) { - l_ezlopi_device_t *device_node = l_device_head; + l_ezlopi_device_t* device_node = l_device_head; while (device_node) { @@ -100,14 +100,14 @@ l_ezlopi_device_t *ezlopi_device_get_by_id(uint32_t device_id) return device_node; } -l_ezlopi_device_t *ezlopi_device_add_device(cJSON *cj_device) +l_ezlopi_device_t* ezlopi_device_add_device(cJSON* cj_device) { - l_ezlopi_device_t *new_device = malloc(sizeof(l_ezlopi_device_t)); + l_ezlopi_device_t* new_device = malloc(sizeof(l_ezlopi_device_t)); if (new_device) { memset(new_device, 0, sizeof(l_ezlopi_device_t)); - char *device_name = NULL; + char* device_name = NULL; CJSON_GET_VALUE_STRING(cj_device, ezlopi_dev_name_str, device_name); ASSIGN_DEVICE_NAME_V2(new_device, device_name); @@ -118,7 +118,7 @@ l_ezlopi_device_t *ezlopi_device_add_device(cJSON *cj_device) if (new_device->cloud_properties.device_id) { - l_ezlopi_device_t *curr_dev_node = l_device_head; + l_ezlopi_device_t* curr_dev_node = l_device_head; while (curr_dev_node) { if (curr_dev_node->cloud_properties.device_id == new_device->cloud_properties.device_id) @@ -148,7 +148,7 @@ l_ezlopi_device_t *ezlopi_device_add_device(cJSON *cj_device) } else { - l_ezlopi_device_t *curr_device = l_device_head; + l_ezlopi_device_t* curr_device = l_device_head; while (curr_device->next) { curr_device = curr_device->next; @@ -161,7 +161,7 @@ l_ezlopi_device_t *ezlopi_device_add_device(cJSON *cj_device) return new_device; } -void ezlopi_device_free_device(l_ezlopi_device_t *device) +void ezlopi_device_free_device(l_ezlopi_device_t* device) { if (device && l_device_head) { @@ -175,7 +175,7 @@ void ezlopi_device_free_device(l_ezlopi_device_t *device) } else { - l_ezlopi_device_t *curr_device = l_device_head; + l_ezlopi_device_t* curr_device = l_device_head; while (curr_device->next) { TRACE_D("Device-ID: %08x", curr_device->next->cloud_properties.device_id); @@ -183,7 +183,7 @@ void ezlopi_device_free_device(l_ezlopi_device_t *device) { TRACE_E("To free Device-ID: %08x", curr_device->next->cloud_properties.device_id); - l_ezlopi_device_t *free_device = curr_device->next; + l_ezlopi_device_t* free_device = curr_device->next; curr_device->next = curr_device->next->next; free_device->next = NULL; ezlopi_device_free_single(free_device); @@ -196,14 +196,14 @@ void ezlopi_device_free_device(l_ezlopi_device_t *device) } } -void ezlopi_device_free_device_by_item(l_ezlopi_item_t *item) +void ezlopi_device_free_device_by_item(l_ezlopi_item_t* item) { if (item) { - l_ezlopi_device_t *device_node = l_device_head; + l_ezlopi_device_t* device_node = l_device_head; while (device_node) { - l_ezlopi_item_t *item_node = device_node->items; + l_ezlopi_item_t* item_node = device_node->items; while (item_node) { if (item_node == item) @@ -220,14 +220,14 @@ void ezlopi_device_free_device_by_item(l_ezlopi_item_t *item) } } -l_ezlopi_item_t *ezlopi_device_get_item_by_id(uint32_t item_id) +l_ezlopi_item_t* ezlopi_device_get_item_by_id(uint32_t item_id) { - l_ezlopi_item_t *item_to_return = NULL; - l_ezlopi_device_t *device_node = l_device_head; + l_ezlopi_item_t* item_to_return = NULL; + l_ezlopi_device_t* device_node = l_device_head; while (device_node) { - l_ezlopi_item_t *item_node = device_node->items; + l_ezlopi_item_t* item_node = device_node->items; while (item_node) { if (item_id == item_node->cloud_properties.item_id) @@ -249,9 +249,9 @@ l_ezlopi_item_t *ezlopi_device_get_item_by_id(uint32_t item_id) return item_to_return; } -l_ezlopi_item_t *ezlopi_device_add_item_to_device(l_ezlopi_device_t *device, int (*item_func)(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void *arg, void *user_arg)) +l_ezlopi_item_t* ezlopi_device_add_item_to_device(l_ezlopi_device_t* device, int (*item_func)(e_ezlopi_actions_t action, l_ezlopi_item_t* item, void* arg, void* user_arg)) { - l_ezlopi_item_t *new_item = NULL; + l_ezlopi_item_t* new_item = NULL; if (device) { new_item = malloc(sizeof(l_ezlopi_item_t)); @@ -267,7 +267,7 @@ l_ezlopi_item_t *ezlopi_device_add_item_to_device(l_ezlopi_device_t *device, int } else { - l_ezlopi_item_t *curr_item = device->items; + l_ezlopi_item_t* curr_item = device->items; while (curr_item->next) { curr_item = curr_item->next; @@ -296,17 +296,17 @@ void ezlopi_device_prepare(void) s_controller_information.status = "idle"; #if (EZLOPI_DEVICE_TYPE_GENERIC == EZLOPI_DEVICE_TYPE) - char *config_string = ezlopi_factory_info_v3_get_ezlopi_config(); + char* config_string = ezlopi_factory_info_v3_get_ezlopi_config(); #elif (EZLOPI_DEVICE_TYPE_TEST_DEVICE == EZLOPI_DEVICE_TYPE) - char *config_string = ezlopi_config_test; + char* config_string = ezlopi_config_test; #else - char *config_string = ezlopi_factory_info_v3_get_ezlopi_config(); + char* config_string = ezlopi_factory_info_v3_get_ezlopi_config(); #endif if (config_string) { TRACE_D("Initial config:\r\n%s", config_string); - cJSON *cj_config = cJSON_Parse(config_string); + cJSON* cj_config = cJSON_Parse(config_string); // ezlopi_factory_info_v3_free(config_string); if (cj_config) { @@ -314,7 +314,7 @@ void ezlopi_device_prepare(void) if (g_store_dev_config_with_id) { - char *updated_config = cJSON_Print(cj_config); + char* updated_config = cJSON_Print(cj_config); if (updated_config) { TRACE_D("Updated config:\r\n%s", config_string); @@ -346,7 +346,7 @@ static void ezlopi_device_print_controller_cloud_information_v3(void) TRACE_I("Status: %s", s_controller_information.status ? s_controller_information.status : ezlopi_null_str); } -static void ezlopi_device_print_interface_digital_io(l_ezlopi_item_t *item) +static void ezlopi_device_print_interface_digital_io(l_ezlopi_item_t* item) { TRACE_D(" |~~~|- item->interface.gpio.gpio_in.enable: %s", item->interface.gpio.gpio_in.enable ? ezlopi_true_str : ezlopi_false_str); TRACE_D(" |~~~|- item->interface.gpio.gpio_in.gpio_num: %d", item->interface.gpio.gpio_in.gpio_num); @@ -363,15 +363,15 @@ static void ezlopi_device_print_interface_digital_io(l_ezlopi_item_t *item) TRACE_D(" |~~~|- item->interface.gpio.gpio_in.interrupt: %d", item->interface.gpio.gpio_in.interrupt); } -static void ezlopi_device_print_interface_analogue_input(l_ezlopi_item_t *item) +static void ezlopi_device_print_interface_analogue_input(l_ezlopi_item_t* item) { TRACE_D(" |~~~|- item->interface.adc.gpio_num: %d", item->interface.adc.gpio_num); TRACE_D(" |~~~|- item->interface.adc.resln_bit: %d", item->interface.adc.resln_bit); } -static void ezlopi_device_print_interface_analogue_output(l_ezlopi_item_t *item) {} +static void ezlopi_device_print_interface_analogue_output(l_ezlopi_item_t* item) {} -static void ezlopi_device_print_interface_pwm(l_ezlopi_item_t *item) +static void ezlopi_device_print_interface_pwm(l_ezlopi_item_t* item) { TRACE_D(" |~~~|- item->interface.pwm.gpio_num: %d", item->interface.pwm.gpio_num); TRACE_D(" |~~~|- item->interface.pwm.channel: %d", item->interface.pwm.channel); @@ -381,7 +381,7 @@ static void ezlopi_device_print_interface_pwm(l_ezlopi_item_t *item) TRACE_D(" |~~~|- item->interface.pwm.duty_cycle: %d", item->interface.pwm.duty_cycle); } -static void ezlopi_device_print_interface_uart(l_ezlopi_item_t *item) +static void ezlopi_device_print_interface_uart(l_ezlopi_item_t* item) { TRACE_D(" |~~~|- item->interface.uart.channel: %d", item->interface.uart.channel); TRACE_D(" |~~~|- item->interface.uart.baudrate: %d", item->interface.uart.baudrate); @@ -390,7 +390,7 @@ static void ezlopi_device_print_interface_uart(l_ezlopi_item_t *item) TRACE_D(" |~~~|- item->interface.uart.enable: %d", item->interface.uart.enable); } -static void ezlopi_device_print_interface_i2c_master(l_ezlopi_item_t *item) +static void ezlopi_device_print_interface_i2c_master(l_ezlopi_item_t* item) { TRACE_D("|~~~|- item->interface.i2c_master.enable: %s", item->interface.i2c_master.enable ? ezlopi_true_str : ezlopi_false_str); TRACE_D("|~~~|- item->interface.i2c_master.channel: %d", item->interface.i2c_master.channel); @@ -399,7 +399,7 @@ static void ezlopi_device_print_interface_i2c_master(l_ezlopi_item_t *item) TRACE_D("|~~~|- item->interface.i2c_master.sda: %d", item->interface.i2c_master.sda); } -static void ezlopi_device_print_interface_spi_master(l_ezlopi_item_t *item) +static void ezlopi_device_print_interface_spi_master(l_ezlopi_item_t* item) { TRACE_D(" |~~~|- item->interface.spi_master.enable: %d", item->interface.spi_master.enable); TRACE_D(" |~~~|- item->interface.spi_master.channel: %d", item->interface.spi_master.channel); @@ -416,13 +416,13 @@ static void ezlopi_device_print_interface_spi_master(l_ezlopi_item_t *item) TRACE_D(" |~~~|- item->interface.spi_master.flags: %d", item->interface.spi_master.flags); } -static void ezlopi_device_print_interface_onewire_master(l_ezlopi_item_t *item) +static void ezlopi_device_print_interface_onewire_master(l_ezlopi_item_t* item) { TRACE_D(" |~~~|- item->interface.onewire_master.enable: %d", item->interface.onewire_master.enable); TRACE_D(" |~~~|- item->interface.onewire_master.onewire_pin: %d", item->interface.onewire_master.onewire_pin); } -static void ezlopi_device_print_interface_type(l_ezlopi_item_t *item) +static void ezlopi_device_print_interface_type(l_ezlopi_item_t* item) { switch (item->interface_type) { @@ -476,14 +476,14 @@ static void ezlopi_device_print_interface_type(l_ezlopi_item_t *item) //////////////////// Print functions end here ///////////////////////// /////////////////////////////////////////////////////////////////////// -static void ezlopi_device_parse_json_v3(cJSON *cjson_config) +static void ezlopi_device_parse_json_v3(cJSON* cjson_config) { - cJSON *cjson_device_list = cJSON_GetObjectItem(cjson_config, ezlopi_dev_detail_str); + cJSON* cjson_device_list = cJSON_GetObjectItem(cjson_config, ezlopi_dev_detail_str); if (cjson_device_list) { int config_dev_idx = 0; - cJSON *cjson_device = NULL; + cJSON* cjson_device = NULL; TRACE_I("---------------------------------------------"); while (NULL != (cjson_device = cJSON_GetArrayItem(cjson_device_list, config_dev_idx))) @@ -496,15 +496,15 @@ static void ezlopi_device_parse_json_v3(cJSON *cjson_config) if (0 != id_item) { - s_ezlopi_device_v3_t *v3_sensor_list = ezlopi_devices_list_get_list_v3(); + s_ezlopi_device_v3_t* v3_sensor_list = ezlopi_devices_list_get_list_v3(); int dev_idx = 0; while (NULL != v3_sensor_list[dev_idx].func) { if (id_item == v3_sensor_list[dev_idx].id) { - s_ezlopi_prep_arg_t device_prep_arg = {.device = &v3_sensor_list[dev_idx], .cjson_device = cjson_device}; - v3_sensor_list[dev_idx].func(EZLOPI_ACTION_PREPARE, NULL, (void *)&device_prep_arg, NULL); + s_ezlopi_prep_arg_t device_prep_arg = { .device = &v3_sensor_list[dev_idx], .cjson_device = cjson_device }; + v3_sensor_list[dev_idx].func(EZLOPI_ACTION_PREPARE, NULL, (void*)&device_prep_arg, NULL); } dev_idx++; @@ -520,7 +520,7 @@ static void ezlopi_device_parse_json_v3(cJSON *cjson_config) ezlopi_device_print_controller_cloud_information_v3(); int device_count = 0; - l_ezlopi_device_t *tm_device_l_list = l_device_head; + l_ezlopi_device_t* tm_device_l_list = l_device_head; while (tm_device_l_list) { TRACE_D("|~~~~~~~~~~~~~~~~ Device - %d ~~~~~~~~~~~~~~~~|", device_count + 1); @@ -533,7 +533,7 @@ static void ezlopi_device_parse_json_v3(cJSON *cjson_config) TRACE_D("|- Device-type: %s", tm_device_l_list->cloud_properties.device_type ? tm_device_l_list->cloud_properties.device_type : ezlopi_null_str); int item_count = 0; - l_ezlopi_item_t *tm_itme_l_list = tm_device_l_list->items; + l_ezlopi_item_t* tm_itme_l_list = tm_device_l_list->items; while (tm_itme_l_list) { TRACE_D("|~~~|--------------- Item - %d ---------------|", item_count + 1); @@ -557,7 +557,7 @@ static void ezlopi_device_parse_json_v3(cJSON *cjson_config) #endif #if 0 - l_ezlopi_configured_devices_t *current_head = ezlopi_devices_list_get_configured_items(); + l_ezlopi_configured_devices_t* current_head = ezlopi_devices_list_get_configured_items(); while (NULL != current_head) { ezlopi_device_print_properties(current_head->properties); @@ -567,7 +567,7 @@ static void ezlopi_device_parse_json_v3(cJSON *cjson_config) #endif } -static void ezlopi_device_free_item(l_ezlopi_item_t *items) +static void ezlopi_device_free_item(l_ezlopi_item_t* items) { if (items->next) { @@ -581,13 +581,13 @@ static void ezlopi_device_free_item(l_ezlopi_item_t *items) // { // if (settings->next) // { -// ezlopi_device_free_item(settings->next); +// ezlopi_device_free_setting(settings->next);//recursive // } // // free(settings); // } -static void ezlopi_device_free_single(l_ezlopi_device_t *device) +static void ezlopi_device_free_single(l_ezlopi_device_t* device) { if (device->items) { @@ -598,9 +598,9 @@ static void ezlopi_device_free_single(l_ezlopi_device_t *device) free(device); } -l_ezlopi_device_settings_v3_t *ezlopi_device_add_settings_to_device_v3(l_ezlopi_device_t *device, int (*setting_func)(e_ezlopi_settings_action_t action, struct l_ezlopi_device_settings_v3 *setting, void *arg, void *user_arg)) +l_ezlopi_device_settings_v3_t* ezlopi_device_add_settings_to_device_v3(l_ezlopi_device_t* device, int (*setting_func)(e_ezlopi_settings_action_t action, struct l_ezlopi_device_settings_v3* setting, void* arg, void* user_arg)) { - l_ezlopi_device_settings_v3_t *new_setting = NULL; + l_ezlopi_device_settings_v3_t* new_setting = NULL; if (device) { new_setting = malloc(sizeof(l_ezlopi_device_settings_v3_t)); @@ -615,7 +615,7 @@ l_ezlopi_device_settings_v3_t *ezlopi_device_add_settings_to_device_v3(l_ezlopi_ } else { - l_ezlopi_device_settings_v3_t *curr_setting = device->settings; + l_ezlopi_device_settings_v3_t* curr_setting = device->settings; while (curr_setting->next) { curr_setting = curr_setting->next; @@ -629,9 +629,9 @@ l_ezlopi_device_settings_v3_t *ezlopi_device_add_settings_to_device_v3(l_ezlopi_ return new_setting; } -cJSON *ezlopi_device_create_device_table_from_prop(l_ezlopi_device_t *device_prop) +cJSON* ezlopi_device_create_device_table_from_prop(l_ezlopi_device_t* device_prop) { - cJSON *cj_device = NULL; + cJSON* cj_device = NULL; if (device_prop) { diff --git a/ezlopi-sensors-devices/device-0004-digitalIn-generic/device_0004_digitalIn_generic.c b/ezlopi-sensors-devices/device-0004-digitalIn-generic/device_0004_digitalIn_generic.c index 7f5b2ad45..209c81afe 100644 --- a/ezlopi-sensors-devices/device-0004-digitalIn-generic/device_0004_digitalIn_generic.c +++ b/ezlopi-sensors-devices/device-0004-digitalIn-generic/device_0004_digitalIn_generic.c @@ -84,7 +84,7 @@ static void __setup_item_properties(l_ezlopi_item_t *item, cJSON *cjson_device) item->interface.gpio.gpio_in.enable = true; CJSON_GET_VALUE_INT(cjson_device, ezlopi_dev_type_str, item->interface_type); - CJSON_GET_VALUE_INT(cjson_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_INT(cjson_device, ezlopi_gpio_str, item->interface.gpio.gpio_in.gpio_num); CJSON_GET_VALUE_INT(cjson_device, "logic_inv", item->interface.gpio.gpio_in.invert); CJSON_GET_VALUE_INT(cjson_device, "pull_up", tmp_var); item->interface.gpio.gpio_in.pull = tmp_var ? GPIO_PULLUP_ONLY : GPIO_PULLDOWN_ONLY; diff --git a/ezlopi-sensors-devices/device-0009-other-RMT-SK6812/device_0009_other_RMT_SK6812.c b/ezlopi-sensors-devices/device-0009-other-RMT-SK6812/device_0009_other_RMT_SK6812.c index 222a780ef..6a9a0fb2e 100644 --- a/ezlopi-sensors-devices/device-0009-other-RMT-SK6812/device_0009_other_RMT_SK6812.c +++ b/ezlopi-sensors-devices/device-0009-other-RMT-SK6812/device_0009_other_RMT_SK6812.c @@ -22,22 +22,22 @@ typedef struct s_dimmer_args { led_strip_t sk6812_strip; - l_ezlopi_item_t *switch_item; - l_ezlopi_item_t *dimmer_item; - l_ezlopi_item_t *dimmer_up_item; - l_ezlopi_item_t *dimmer_down_item; - l_ezlopi_item_t *dimmer_stop_item; - l_ezlopi_item_t *rgb_color_item; + l_ezlopi_item_t* switch_item; + l_ezlopi_item_t* dimmer_item; + l_ezlopi_item_t* dimmer_up_item; + l_ezlopi_item_t* dimmer_down_item; + l_ezlopi_item_t* dimmer_stop_item; + l_ezlopi_item_t* rgb_color_item; uint8_t previous_brightness; bool sk6812_led_strip_initialized; } s_dimmer_args_t; -static int __prepare(void *arg); -static int __init(l_ezlopi_item_t *item); -static int __set_cjson_value(l_ezlopi_item_t *item, void *arg); -static int __get_cjson_value(l_ezlopi_item_t *item, void *arg); +static int __prepare(void* arg); +static int __init(l_ezlopi_item_t* item); +static int __set_cjson_value(l_ezlopi_item_t* item, void* arg); +static int __get_cjson_value(l_ezlopi_item_t* item, void* arg); -int device_0009_other_RMT_SK6812(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void *arg, void *user_arg) +int device_0009_other_RMT_SK6812(e_ezlopi_actions_t action, l_ezlopi_item_t* item, void* arg, void* user_arg) { int ret = 0; @@ -73,17 +73,17 @@ int device_0009_other_RMT_SK6812(e_ezlopi_actions_t action, l_ezlopi_item_t *ite return ret; } -static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) +static int __get_cjson_value(l_ezlopi_item_t* item, void* arg) { int ret = 0; - led_strip_t *sk6812_strip = (led_strip_t *)item->user_arg; - cJSON *cjson_properties = (cJSON *)arg; + led_strip_t* sk6812_strip = (led_strip_t*)item->user_arg; + cJSON* cjson_properties = (cJSON*)arg; if ((NULL != cjson_properties) && (NULL != sk6812_strip)) { if (ezlopi_item_name_rgbcolor == item->cloud_properties.item_name) { - cJSON *color_json = cJSON_AddObjectToObject(cjson_properties, ezlopi_value_str); + cJSON* color_json = cJSON_AddObjectToObject(cjson_properties, ezlopi_value_str); if (color_json) { int green = sk6812_strip->buf[0]; @@ -93,7 +93,7 @@ static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) cJSON_AddNumberToObject(color_json, "green", green); cJSON_AddNumberToObject(color_json, "blue", blue); cJSON_AddNumberToObject(color_json, "cwhite", ((red << 16) | (green << 8) | (blue))); - char *formatted_val = ezlopi_valueformatter_rgb(red, green, blue); + char* formatted_val = ezlopi_valueformatter_rgb(red, green, blue); if (formatted_val) { cJSON_AddStringToObject(cjson_properties, ezlopi_valueFormatted_str, formatted_val); @@ -105,7 +105,7 @@ static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) { item->interface.pwm.duty_cycle = (int)ceil(((sk6812_strip->brightness * 100.0) / 255.0)); cJSON_AddNumberToObject(cjson_properties, ezlopi_value_str, item->interface.pwm.duty_cycle); - char *formatted_val = ezlopi_valueformatter_int32(item->interface.pwm.duty_cycle); + char* formatted_val = ezlopi_valueformatter_int32(item->interface.pwm.duty_cycle); if (formatted_val) { cJSON_AddStringToObject(cjson_properties, ezlopi_valueFormatted_str, formatted_val); @@ -116,27 +116,27 @@ static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) { item->interface.gpio.gpio_in.value = (0 == sk6812_strip->brightness) ? 0 : 1; cJSON_AddBoolToObject(cjson_properties, ezlopi_value_str, item->interface.gpio.gpio_in.value); - const char *formatted_val = ezlopi_valueformatter_bool(item->interface.gpio.gpio_in.value ? true : false); + const char* formatted_val = ezlopi_valueformatter_bool(item->interface.gpio.gpio_in.value ? true : false); cJSON_AddStringToObject(cjson_properties, ezlopi_valueFormatted_str, formatted_val); } } return ret; } -static int __set_cjson_value(l_ezlopi_item_t *item, void *arg) +static int __set_cjson_value(l_ezlopi_item_t* item, void* arg) { int ret = 0; if (arg && item) { - cJSON *cjson_params = (cJSON *)arg; - s_dimmer_args_t *dimmer_args = (s_dimmer_args_t *)item->user_arg; + cJSON* cjson_params = (cJSON*)arg; + s_dimmer_args_t* dimmer_args = (s_dimmer_args_t*)item->user_arg; if (NULL != dimmer_args) { if (ezlopi_item_name_rgbcolor == item->cloud_properties.item_name) { - cJSON *cjson_params_color_values = cJSON_GetObjectItem(cjson_params, ezlopi_value_str); + cJSON* cjson_params_color_values = cJSON_GetObjectItem(cjson_params, ezlopi_value_str); rgb_t color = { .red = 0, @@ -184,12 +184,12 @@ static int __set_cjson_value(l_ezlopi_item_t *item, void *arg) return ret; } -static int __init(l_ezlopi_item_t *item) +static int __init(l_ezlopi_item_t* item) { int ret = 0; if (item) { - s_dimmer_args_t *dimmer_args = (s_dimmer_args_t *)item->user_arg; + s_dimmer_args_t* dimmer_args = (s_dimmer_args_t*)item->user_arg; if (0 == dimmer_args->sk6812_led_strip_initialized) { @@ -241,7 +241,7 @@ static int __init(l_ezlopi_item_t *item) return ret; } -static void __prepare_device_properties(l_ezlopi_device_t *device, cJSON *cj_device) +static void __prepare_device_properties(l_ezlopi_device_t* device, cJSON* cj_device) { // char *device_name = NULL; // CJSON_GET_VALUE_STRING(cj_device, ezlopi_dev_name_str, device_name); @@ -255,43 +255,43 @@ static void __prepare_device_properties(l_ezlopi_device_t *device, cJSON *cj_dev device->cloud_properties.device_type_id = NULL; } -static void __prepare_SK6812_RGB_color_item(l_ezlopi_item_t *item, cJSON *cj_device) +static void __prepare_SK6812_RGB_color_item(l_ezlopi_item_t* item, cJSON* cj_device) { item->cloud_properties.has_getter = true; item->cloud_properties.has_setter = true; item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); item->cloud_properties.item_name = ezlopi_item_name_rgbcolor, - item->cloud_properties.show = true; + item->cloud_properties.show = true; item->cloud_properties.scale = NULL; item->cloud_properties.value_type = value_type_rgb; item->interface_type = EZLOPI_DEVICE_INTERFACE_PWM; item->interface.pwm.channel = 0; item->interface.pwm.value = 0; - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.pwm.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio1_str, item->interface.pwm.gpio_num); CJSON_GET_VALUE_INT(cj_device, "duty_cycle", item->interface.pwm.duty_cycle); CJSON_GET_VALUE_INT(cj_device, "freq_hz", item->interface.pwm.freq_hz); item->interface.pwm.pwm_resln = 12; } -static void __prepare_SK6812_RGB_dimmer_item(l_ezlopi_item_t *item, cJSON *cj_device) +static void __prepare_SK6812_RGB_dimmer_item(l_ezlopi_item_t* item, cJSON* cj_device) { item->cloud_properties.has_getter = true; item->cloud_properties.has_setter = true; item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); item->cloud_properties.item_name = ezlopi_item_name_dimmer, - item->cloud_properties.show = true; + item->cloud_properties.show = true; item->cloud_properties.scale = NULL; item->cloud_properties.value_type = value_type_int; item->interface_type = EZLOPI_DEVICE_INTERFACE_PWM; item->interface.pwm.channel = 0; item->interface.pwm.value = 0; - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.pwm.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio1_str, item->interface.pwm.gpio_num); CJSON_GET_VALUE_INT(cj_device, "duty_cycle", item->interface.pwm.duty_cycle); CJSON_GET_VALUE_INT(cj_device, "freq_hz", item->interface.pwm.freq_hz); item->interface.pwm.pwm_resln = 12; } -static void __prepare_SK6812_RGB_dimmer_up_item(l_ezlopi_item_t *item, cJSON *cj_device) +static void __prepare_SK6812_RGB_dimmer_up_item(l_ezlopi_item_t* item, cJSON* cj_device) { CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); item->cloud_properties.has_getter = true; @@ -302,13 +302,13 @@ static void __prepare_SK6812_RGB_dimmer_up_item(l_ezlopi_item_t *item, cJSON *cj item->cloud_properties.value_type = value_type_int; item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.pwm.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio1_str, item->interface.pwm.gpio_num); CJSON_GET_VALUE_INT(cj_device, "duty_cycle", item->interface.pwm.duty_cycle); CJSON_GET_VALUE_INT(cj_device, "freq_hz", item->interface.pwm.freq_hz); item->interface.pwm.pwm_resln = 12; } -static void __prepare_SK6812_RGB_dimmer_down_item(l_ezlopi_item_t *item, cJSON *cj_device) +static void __prepare_SK6812_RGB_dimmer_down_item(l_ezlopi_item_t* item, cJSON* cj_device) { CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); item->cloud_properties.has_getter = true; @@ -319,13 +319,13 @@ static void __prepare_SK6812_RGB_dimmer_down_item(l_ezlopi_item_t *item, cJSON * item->cloud_properties.value_type = value_type_int; item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.pwm.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio1_str, item->interface.pwm.gpio_num); CJSON_GET_VALUE_INT(cj_device, "duty_cycle", item->interface.pwm.duty_cycle); CJSON_GET_VALUE_INT(cj_device, "freq_hz", item->interface.pwm.freq_hz); item->interface.pwm.pwm_resln = 12; } -static void __prepare_SK6812_RGB_dimmer_stop_item(l_ezlopi_item_t *item, cJSON *cj_device) +static void __prepare_SK6812_RGB_dimmer_stop_item(l_ezlopi_item_t* item, cJSON* cj_device) { CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); item->cloud_properties.has_getter = true; @@ -336,19 +336,19 @@ static void __prepare_SK6812_RGB_dimmer_stop_item(l_ezlopi_item_t *item, cJSON * item->cloud_properties.value_type = value_type_int; item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.pwm.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio1_str, item->interface.pwm.gpio_num); CJSON_GET_VALUE_INT(cj_device, "duty_cycle", item->interface.pwm.duty_cycle); CJSON_GET_VALUE_INT(cj_device, "freq_hz", item->interface.pwm.freq_hz); item->interface.pwm.pwm_resln = 12; } -static void __prepare_SK6812_LED_onoff_switch_item(l_ezlopi_item_t *item, cJSON *cj_device) +static void __prepare_SK6812_LED_onoff_switch_item(l_ezlopi_item_t* item, cJSON* cj_device) { item->cloud_properties.has_getter = true; item->cloud_properties.has_setter = true; item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); item->cloud_properties.item_name = ezlopi_item_name_switch, - item->cloud_properties.show = true; + item->cloud_properties.show = true; item->cloud_properties.scale = NULL; item->cloud_properties.value_type = value_type_bool; item->interface_type = EZLOPI_DEVICE_INTERFACE_DIGITAL_OUTPUT; @@ -362,19 +362,19 @@ static void __prepare_SK6812_LED_onoff_switch_item(l_ezlopi_item_t *item, cJSON item->interface.gpio.gpio_in.enable = false; } -static int __prepare(void *arg) +static int __prepare(void* arg) { int ret = 0; - s_ezlopi_prep_arg_t *prep_arg = (s_ezlopi_prep_arg_t *)arg; + s_ezlopi_prep_arg_t* prep_arg = (s_ezlopi_prep_arg_t*)arg; if (prep_arg && prep_arg->cjson_device) { - l_ezlopi_device_t *device = ezlopi_device_add_device(prep_arg->cjson_device); + l_ezlopi_device_t* device = ezlopi_device_add_device(prep_arg->cjson_device); if (device) { __prepare_device_properties(device, prep_arg->cjson_device); - s_dimmer_args_t *dimmer_args = malloc(sizeof(s_dimmer_args_t)); + s_dimmer_args_t* dimmer_args = malloc(sizeof(s_dimmer_args_t)); if (dimmer_args) { memset(dimmer_args, 0, sizeof(s_dimmer_args_t)); diff --git a/ezlopi-sensors-devices/device-0022-PWM-dimmable-lamp/device_0022_PWM_dimmable_lamp.c b/ezlopi-sensors-devices/device-0022-PWM-dimmable-lamp/device_0022_PWM_dimmable_lamp.c index c114528ab..d83a27a1d 100644 --- a/ezlopi-sensors-devices/device-0022-PWM-dimmable-lamp/device_0022_PWM_dimmable_lamp.c +++ b/ezlopi-sensors-devices/device-0022-PWM-dimmable-lamp/device_0022_PWM_dimmable_lamp.c @@ -283,7 +283,7 @@ static void __prepare_dimmer_item_properties(l_ezlopi_item_t *item, cJSON *cj_de item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); item->cloud_properties.scale = NULL; - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.pwm.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.pwm.gpio_num); CJSON_GET_VALUE_INT(cj_device, "duty_cycle", item->interface.pwm.duty_cycle); CJSON_GET_VALUE_INT(cj_device, "freq_hz", item->interface.pwm.freq_hz); item->interface.pwm.pwm_resln = 12; @@ -300,7 +300,7 @@ static void __prepare_dimmer_up_item_properties(l_ezlopi_item_t *item, cJSON *cj item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); item->cloud_properties.scale = NULL; - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.pwm.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.pwm.gpio_num); CJSON_GET_VALUE_INT(cj_device, "duty_cycle", item->interface.pwm.duty_cycle); CJSON_GET_VALUE_INT(cj_device, "freq_hz", item->interface.pwm.freq_hz); item->interface.pwm.pwm_resln = 12; @@ -317,7 +317,7 @@ static void __prepare_dimmer_down_item_properties(l_ezlopi_item_t *item, cJSON * item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); item->cloud_properties.scale = NULL; - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.pwm.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.pwm.gpio_num); CJSON_GET_VALUE_INT(cj_device, "duty_cycle", item->interface.pwm.duty_cycle); CJSON_GET_VALUE_INT(cj_device, "freq_hz", item->interface.pwm.freq_hz); item->interface.pwm.pwm_resln = 12; @@ -334,7 +334,7 @@ static void __prepare_dimmer_stop_item_properties(l_ezlopi_item_t *item, cJSON * item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); item->cloud_properties.scale = NULL; - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.pwm.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.pwm.gpio_num); CJSON_GET_VALUE_INT(cj_device, "duty_cycle", item->interface.pwm.duty_cycle); CJSON_GET_VALUE_INT(cj_device, "freq_hz", item->interface.pwm.freq_hz); item->interface.pwm.pwm_resln = 12; @@ -351,7 +351,7 @@ static void __prepare_dimmer_switch_item_properties(l_ezlopi_item_t *item, cJSON item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); item->cloud_properties.scale = NULL; - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_out.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.gpio.gpio_out.gpio_num); item->interface.gpio.gpio_in.enable = false; item->interface.gpio.gpio_out.enable = true; item->interface.gpio.gpio_out.interrupt = false; diff --git a/ezlopi-sensors-devices/device-0036-PWM-servo-MG996R/device_0036_PWM_servo_MG996R.c b/ezlopi-sensors-devices/device-0036-PWM-servo-MG996R/device_0036_PWM_servo_MG996R.c index cebfcae67..98da03519 100644 --- a/ezlopi-sensors-devices/device-0036-PWM-servo-MG996R/device_0036_PWM_servo_MG996R.c +++ b/ezlopi-sensors-devices/device-0036-PWM-servo-MG996R/device_0036_PWM_servo_MG996R.c @@ -69,7 +69,7 @@ static void __prepare_device_cloud_properties(l_ezlopi_device_t *device, cJSON * static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_device) { - CJSON_GET_VALUE_INT(cj_device, "dev_type", item->interface_type); + CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); item->cloud_properties.item_name = ezlopi_item_name_dimmer; item->cloud_properties.has_getter = true; item->cloud_properties.has_setter = true; @@ -78,7 +78,7 @@ static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_dev item->cloud_properties.value_type = value_type_int; item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); - CJSON_GET_VALUE_INT(cj_device, "gpio", item->interface.pwm.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.pwm.gpio_num); CJSON_GET_VALUE_INT(cj_device, "duty_cycle", item->interface.pwm.duty_cycle); CJSON_GET_VALUE_INT(cj_device, "freq_hz", item->interface.pwm.freq_hz); #if CONFIG_IDF_TARGET_ESP32C3 @@ -307,7 +307,7 @@ static s_ezlopi_device_properties_t *ezlopi_servo_motor_MG_996R_prepare(cJSON *c ezlopi_servo_motor_MG_996R_properties->ezlopi_cloud.room_id = ezlopi_cloud_generate_room_id(); ezlopi_servo_motor_MG_996R_properties->ezlopi_cloud.item_id = ezlopi_cloud_generate_item_id(); - // CJSON_GET_VALUE_INT(cjson_device, ezlopi_dev_name_str, ezlopi_servo_motor_MG_996R_properties->interface.pwm.gpio_num); + // CJSON_GET_VALUE_INT(cjson_device, ezlopi_gpio_str, ezlopi_servo_motor_MG_996R_properties->interface.pwm.gpio_num); // CJSON_GET_VALUE_INT(cjson_device, "duty_cycle", ezlopi_servo_motor_MG_996R_properties->interface.pwm.duty_cycle); // CJSON_GET_VALUE_INT(cjson_device, "freq_hz", ezlopi_servo_motor_MG_996R_properties->interface.pwm.freq_hz); // CJSON_GET_VALUE_INT(cjson_device, "pwm_resln", ezlopi_servo_motor_MG_996R_properties->interface.pwm.pwm_resln); diff --git a/ezlopi-sensors-devices/sensor-0005-I2C-MPU6050/sensor_0005_I2C_MPU6050.c b/ezlopi-sensors-devices/sensor-0005-I2C-MPU6050/sensor_0005_I2C_MPU6050.c index 6174ae6fb..52b913acb 100644 --- a/ezlopi-sensors-devices/sensor-0005-I2C-MPU6050/sensor_0005_I2C_MPU6050.c +++ b/ezlopi-sensors-devices/sensor-0005-I2C-MPU6050/sensor_0005_I2C_MPU6050.c @@ -88,9 +88,9 @@ static void __prepare_item_interface_properties(l_ezlopi_item_t *item, cJSON *cj if (ezlopi_item_name_acceleration_x_axis == item->cloud_properties.item_name) { item->interface.i2c_master.enable = true; - CJSON_GET_VALUE_INT(cj_device, "dev_type", item->interface_type); - CJSON_GET_VALUE_INT(cj_device, "gpio_sda", item->interface.i2c_master.sda); - CJSON_GET_VALUE_INT(cj_device, "gpio_scl", item->interface.i2c_master.scl); + CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_sda_str, item->interface.i2c_master.sda); + CJSON_GET_VALUE_INT(cj_device,ezlopi_gpio_scl_str, item->interface.i2c_master.scl); CJSON_GET_VALUE_INT(cj_device, "slave_addr", item->interface.i2c_master.address); item->interface.i2c_master.clock_speed = 100000; diff --git a/ezlopi-sensors-devices/sensor-0006-I2C-ADXL345/sensor_0006_I2C_ADXL345.c b/ezlopi-sensors-devices/sensor-0006-I2C-ADXL345/sensor_0006_I2C_ADXL345.c index 914e468df..4d520f738 100644 --- a/ezlopi-sensors-devices/sensor-0006-I2C-ADXL345/sensor_0006_I2C_ADXL345.c +++ b/ezlopi-sensors-devices/sensor-0006-I2C-ADXL345/sensor_0006_I2C_ADXL345.c @@ -14,15 +14,15 @@ #include "sensor_0006_I2C_ADXL345.h" -static int __prepare(void *arg); -static int __init(l_ezlopi_item_t *item); -static int __get_cjson_value(l_ezlopi_item_t *item, void *arg); -static int __notify(l_ezlopi_item_t *item); -static void __prepare_device_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device); -static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, void *user_data); -static void __prepare_item_interface_properties(l_ezlopi_item_t *item, cJSON *cj_device); +static int __prepare(void* arg); +static int __init(l_ezlopi_item_t* item); +static int __get_cjson_value(l_ezlopi_item_t* item, void* arg); +static int __notify(l_ezlopi_item_t* item); +static void __prepare_device_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device); +static void __prepare_item_cloud_properties(l_ezlopi_item_t* item, void* user_data); +static void __prepare_item_interface_properties(l_ezlopi_item_t* item, cJSON* cj_device); -int sensor_0006_I2C_ADXL345(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void *arg, void *user_arg) +int sensor_0006_I2C_ADXL345(e_ezlopi_actions_t action, l_ezlopi_item_t* item, void* arg, void* user_arg) { int ret = 0; switch (action) @@ -56,9 +56,9 @@ int sensor_0006_I2C_ADXL345(e_ezlopi_actions_t action, l_ezlopi_item_t *item, vo return ret; } -static void __prepare_device_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device) +static void __prepare_device_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device) { - char *device_name = NULL; + char* device_name = NULL; CJSON_GET_VALUE_STRING(cj_device, "dev_name", device_name); ASSIGN_DEVICE_NAME_V2(device, device_name); device->cloud_properties.device_id = ezlopi_cloud_generate_device_id(); @@ -68,7 +68,7 @@ static void __prepare_device_cloud_properties(l_ezlopi_device_t *device, cJSON * device->cloud_properties.device_type_id = NULL; device->cloud_properties.device_type = dev_type_sensor; } -static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, void *user_data) +static void __prepare_item_cloud_properties(l_ezlopi_item_t* item, void* user_data) { if (item) { @@ -81,16 +81,16 @@ static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, void *user_da item->user_arg = user_data; } } -static void __prepare_item_interface_properties(l_ezlopi_item_t *item, cJSON *cj_device) +static void __prepare_item_interface_properties(l_ezlopi_item_t* item, cJSON* cj_device) { if (item && cj_device) { if (ezlopi_item_name_acceleration_x_axis == item->cloud_properties.item_name) { item->interface.i2c_master.enable = true; - CJSON_GET_VALUE_INT(cj_device, "dev_type", item->interface_type); - CJSON_GET_VALUE_INT(cj_device, "gpio_sda", item->interface.i2c_master.sda); - CJSON_GET_VALUE_INT(cj_device, "gpio_scl", item->interface.i2c_master.scl); + CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_sda_str, item->interface.i2c_master.sda); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_scl_str, item->interface.i2c_master.scl); CJSON_GET_VALUE_INT(cj_device, "slave_addr", item->interface.i2c_master.address); item->interface.i2c_master.clock_speed = 100000; if (0 == item->interface.i2c_master.address) @@ -105,36 +105,36 @@ static void __prepare_item_interface_properties(l_ezlopi_item_t *item, cJSON *cj } } -static int __prepare(void *arg) +static int __prepare(void* arg) { int ret = 0; - s_ezlopi_prep_arg_t *prep_arg = (s_ezlopi_prep_arg_t *)arg; + s_ezlopi_prep_arg_t* prep_arg = (s_ezlopi_prep_arg_t*)arg; if (prep_arg && prep_arg->cjson_device) { - cJSON *cj_device = prep_arg->cjson_device; - s_adxl345_data_t *user_data = (s_adxl345_data_t *)malloc(sizeof(s_adxl345_data_t)); + cJSON* cj_device = prep_arg->cjson_device; + s_adxl345_data_t* user_data = (s_adxl345_data_t*)malloc(sizeof(s_adxl345_data_t)); if (NULL != user_data) { memset(user_data, 0, sizeof(s_adxl345_data_t)); - l_ezlopi_device_t *adxl345_device = ezlopi_device_add_device(cj_device); + l_ezlopi_device_t* adxl345_device = ezlopi_device_add_device(cj_device); if (adxl345_device) { __prepare_device_cloud_properties(adxl345_device, cj_device); - l_ezlopi_item_t *x_item = ezlopi_device_add_item_to_device(adxl345_device, sensor_0006_I2C_ADXL345); + l_ezlopi_item_t* x_item = ezlopi_device_add_item_to_device(adxl345_device, sensor_0006_I2C_ADXL345); if (x_item) { x_item->cloud_properties.item_name = ezlopi_item_name_acceleration_x_axis; __prepare_item_cloud_properties(x_item, user_data); __prepare_item_interface_properties(x_item, cj_device); } - l_ezlopi_item_t *y_item = ezlopi_device_add_item_to_device(adxl345_device, sensor_0006_I2C_ADXL345); + l_ezlopi_item_t* y_item = ezlopi_device_add_item_to_device(adxl345_device, sensor_0006_I2C_ADXL345); if (y_item) { y_item->cloud_properties.item_name = ezlopi_item_name_acceleration_y_axis; __prepare_item_cloud_properties(y_item, user_data); __prepare_item_interface_properties(y_item, cj_device); } - l_ezlopi_item_t *z_item = ezlopi_device_add_item_to_device(adxl345_device, sensor_0006_I2C_ADXL345); + l_ezlopi_item_t* z_item = ezlopi_device_add_item_to_device(adxl345_device, sensor_0006_I2C_ADXL345); if (z_item) { z_item->cloud_properties.item_name = ezlopi_item_name_acceleration_z_axis; @@ -161,7 +161,7 @@ static int __prepare(void *arg) return ret; } -static int __init(l_ezlopi_item_t *item) +static int __init(l_ezlopi_item_t* item) { int ret = 0; if (item) @@ -189,19 +189,19 @@ static int __init(l_ezlopi_item_t *item) return ret; } -static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) +static int __get_cjson_value(l_ezlopi_item_t* item, void* arg) { int ret = 0; - cJSON *cj_result = (cJSON *)arg; + cJSON* cj_result = (cJSON*)arg; if (cj_result && item) { float acceleration_value; - s_adxl345_data_t *user_data = (s_adxl345_data_t *)item->user_arg; + s_adxl345_data_t* user_data = (s_adxl345_data_t*)item->user_arg; if (ezlopi_item_name_acceleration_x_axis == item->cloud_properties.item_name) { acceleration_value = (user_data->acc_x * ADXL345_CONVERTER_FACTOR_MG_TO_G * ADXL345_STANDARD_G_TO_ACCEL_CONVERSION_VALUE); cJSON_AddNumberToObject(cj_result, "value", acceleration_value); - char *valueFormatted = ezlopi_valueformatter_float(acceleration_value); + char* valueFormatted = ezlopi_valueformatter_float(acceleration_value); cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); free(valueFormatted); } @@ -209,7 +209,7 @@ static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) { acceleration_value = (user_data->acc_y * ADXL345_CONVERTER_FACTOR_MG_TO_G * ADXL345_STANDARD_G_TO_ACCEL_CONVERSION_VALUE); cJSON_AddNumberToObject(cj_result, "value", acceleration_value); - char *valueFormatted = ezlopi_valueformatter_float(acceleration_value); + char* valueFormatted = ezlopi_valueformatter_float(acceleration_value); cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); free(valueFormatted); } @@ -217,7 +217,7 @@ static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) { acceleration_value = (user_data->acc_z * ADXL345_CONVERTER_FACTOR_MG_TO_G * ADXL345_STANDARD_G_TO_ACCEL_CONVERSION_VALUE); cJSON_AddNumberToObject(cj_result, "value", acceleration_value); - char *valueFormatted = ezlopi_valueformatter_float(acceleration_value); + char* valueFormatted = ezlopi_valueformatter_float(acceleration_value); cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); free(valueFormatted); } @@ -226,13 +226,13 @@ static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) return ret; } -static int __notify(l_ezlopi_item_t *item) +static int __notify(l_ezlopi_item_t* item) { int ret = 0; - static float __prev[3] = {0}; + static float __prev[3] = { 0 }; if (item) { - s_adxl345_data_t *user_data = (s_adxl345_data_t *)item->user_arg; + s_adxl345_data_t* user_data = (s_adxl345_data_t*)item->user_arg; if (ezlopi_item_name_acceleration_x_axis == item->cloud_properties.item_name) { __prev[0] = user_data->acc_x; diff --git a/ezlopi-sensors-devices/sensor-0007-I2C-GY271/sensor_0007_I2C_GY271.c b/ezlopi-sensors-devices/sensor-0007-I2C-GY271/sensor_0007_I2C_GY271.c index 7a311073b..55d5e1d9e 100644 --- a/ezlopi-sensors-devices/sensor-0007-I2C-GY271/sensor_0007_I2C_GY271.c +++ b/ezlopi-sensors-devices/sensor-0007-I2C-GY271/sensor_0007_I2C_GY271.c @@ -151,9 +151,9 @@ static void __prepare_item_interface_properties(l_ezlopi_item_t* item, cJSON* cj if (ezlopi_item_name_magnetic_strength_x_axis == item->cloud_properties.item_name) { item->interface.i2c_master.enable = true; - CJSON_GET_VALUE_INT(cj_device, "dev_type", item->interface_type); - CJSON_GET_VALUE_INT(cj_device, "gpio_sda", item->interface.i2c_master.sda); - CJSON_GET_VALUE_INT(cj_device, "gpio_scl", item->interface.i2c_master.scl); + CJSON_GET_VALUE_INT(cj_device,ezlopi_dev_type_str, item->interface_type); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_sda_str, item->interface.i2c_master.sda); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_scl_str, item->interface.i2c_master.scl); CJSON_GET_VALUE_INT(cj_device, "slave_addr", item->interface.i2c_master.address); item->interface.i2c_master.clock_speed = 100000; @@ -316,7 +316,7 @@ static int __get_cjson_value(l_ezlopi_item_t* item, void* arg) char* valueFormatted = ezlopi_valueformatter_float(user_data->X); if (valueFormatted) { - cJSON_AddStringToObject(cj_result, ezlopi_valueformatted_str, valueFormatted); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); free(valueFormatted); } } @@ -326,7 +326,7 @@ static int __get_cjson_value(l_ezlopi_item_t* item, void* arg) char* valueFormatted = ezlopi_valueformatter_float(user_data->Y); if (valueFormatted) { - cJSON_AddStringToObject(cj_result, ezlopi_valueformatted_str, valueFormatted); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); free(valueFormatted); } } @@ -336,7 +336,7 @@ static int __get_cjson_value(l_ezlopi_item_t* item, void* arg) char* valueFormatted = ezlopi_valueformatter_float(user_data->Z); if (valueFormatted) { - cJSON_AddStringToObject(cj_result, ezlopi_valueformatted_str, valueFormatted); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); free(valueFormatted); } } @@ -347,7 +347,7 @@ static int __get_cjson_value(l_ezlopi_item_t* item, void* arg) char* valueFormatted = ezlopi_valueformatter_int(user_data->azimuth); if (valueFormatted) { - cJSON_AddStringToObject(cj_result, ezlopi_valueformatted_str, valueFormatted); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); free(valueFormatted); } } @@ -358,7 +358,7 @@ static int __get_cjson_value(l_ezlopi_item_t* item, void* arg) char* valueFormatted = ezlopi_valueformatter_float(user_data->T); if (valueFormatted) { - cJSON_AddStringToObject(cj_result, ezlopi_valueformatted_str, valueFormatted); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); free(valueFormatted); } } diff --git a/ezlopi-sensors-devices/sensor-0010-I2C-BME680/sensor_0010_I2C_BME680.c b/ezlopi-sensors-devices/sensor-0010-I2C-BME680/sensor_0010_I2C_BME680.c index b3a288615..681474cb6 100644 --- a/ezlopi-sensors-devices/sensor-0010-I2C-BME680/sensor_0010_I2C_BME680.c +++ b/ezlopi-sensors-devices/sensor-0010-I2C-BME680/sensor_0010_I2C_BME680.c @@ -15,15 +15,15 @@ #include "bme680_bsec.h" #include "sensor_0010_I2C_BME680.h" -static int __prepare(void *arg); -static int __init(l_ezlopi_item_t *item); -static int __notify(l_ezlopi_item_t *item); -static int __get_cjson_value(l_ezlopi_item_t *item, void *arg); +static int __prepare(void* arg); +static int __init(l_ezlopi_item_t* item); +static int __notify(l_ezlopi_item_t* item); +static int __get_cjson_value(l_ezlopi_item_t* item, void* arg); -static void __prepare_device_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device); -static void __prepare_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_device, void *user_arg); +static void __prepare_device_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device); +static void __prepare_cloud_properties(l_ezlopi_item_t* item, cJSON* cj_device, void* user_arg); -int sensor_0010_I2C_BME680(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void *arg, void *user_arg) +int sensor_0010_I2C_BME680(e_ezlopi_actions_t action, l_ezlopi_item_t* item, void* arg, void* user_arg) { switch (action) { @@ -56,9 +56,9 @@ int sensor_0010_I2C_BME680(e_ezlopi_actions_t action, l_ezlopi_item_t *item, voi return 0; } -static void __prepare_device_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device) +static void __prepare_device_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device) { - char *device_name = NULL; + char* device_name = NULL; CJSON_GET_VALUE_STRING(cj_device, "dev_name", device_name); ASSIGN_DEVICE_NAME_V2(device, device_name); @@ -69,9 +69,9 @@ static void __prepare_device_cloud_properties(l_ezlopi_device_t *device, cJSON * device->cloud_properties.device_type_id = NULL; } -static void __prepare_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_device, void *user_arg) +static void __prepare_cloud_properties(l_ezlopi_item_t* item, cJSON* cj_device, void* user_arg) { - CJSON_GET_VALUE_INT(cj_device, "dev_type", item->interface_type); + CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); item->cloud_properties.has_getter = true; item->cloud_properties.has_setter = false; @@ -82,8 +82,8 @@ static void __prepare_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_device, { item->interface.i2c_master.enable = true; item->interface.i2c_master.clock_speed = 100000; - CJSON_GET_VALUE_INT(cj_device, "gpio_scl", item->interface.i2c_master.scl); - CJSON_GET_VALUE_INT(cj_device, "gpio_sda", item->interface.i2c_master.sda); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_scl_str, item->interface.i2c_master.scl); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_sda_str, item->interface.i2c_master.sda); CJSON_GET_VALUE_INT(cj_device, "slave_addr", item->interface.i2c_master.address); } else @@ -92,23 +92,23 @@ static void __prepare_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_device, } } -static int __prepare(void *arg) +static int __prepare(void* arg) { int ret = 0; - s_ezlopi_prep_arg_t *prep_arg = (s_ezlopi_prep_arg_t *)arg; + s_ezlopi_prep_arg_t* prep_arg = (s_ezlopi_prep_arg_t*)arg; if (prep_arg && prep_arg->cjson_device) { - cJSON *cj_device = prep_arg->cjson_device; - bme680_data_t *user_data = (bme680_data_t *)malloc(sizeof(bme680_data_t)); + cJSON* cj_device = prep_arg->cjson_device; + bme680_data_t* user_data = (bme680_data_t*)malloc(sizeof(bme680_data_t)); if (user_data) { memset(user_data, 0, sizeof(bme680_data_t)); - l_ezlopi_device_t *temp_humid_device = ezlopi_device_add_device(cj_device); + l_ezlopi_device_t* temp_humid_device = ezlopi_device_add_device(cj_device); if (temp_humid_device) { temp_humid_device->cloud_properties.category = category_temperature; __prepare_device_cloud_properties(temp_humid_device, cj_device); - l_ezlopi_item_t *temperature_item = ezlopi_device_add_item_to_device(temp_humid_device, sensor_0010_I2C_BME680); + l_ezlopi_item_t* temperature_item = ezlopi_device_add_item_to_device(temp_humid_device, sensor_0010_I2C_BME680); if (temperature_item) { temperature_item->cloud_properties.item_name = ezlopi_item_name_temp; @@ -116,7 +116,7 @@ static int __prepare(void *arg) temperature_item->cloud_properties.scale = scales_celsius; __prepare_cloud_properties(temperature_item, cj_device, user_data); } - l_ezlopi_item_t *humidity_item = ezlopi_device_add_item_to_device(temp_humid_device, sensor_0010_I2C_BME680); + l_ezlopi_item_t* humidity_item = ezlopi_device_add_item_to_device(temp_humid_device, sensor_0010_I2C_BME680); if (humidity_item) { humidity_item->cloud_properties.item_name = ezlopi_item_name_humidity; @@ -131,12 +131,12 @@ static int __prepare(void *arg) } } - l_ezlopi_device_t *pressure_device = ezlopi_device_add_device(cj_device); + l_ezlopi_device_t* pressure_device = ezlopi_device_add_device(cj_device); if (pressure_device) { pressure_device->cloud_properties.category = category_level_sensor; __prepare_device_cloud_properties(pressure_device, cj_device); - l_ezlopi_item_t *pressure_item = ezlopi_device_add_item_to_device(pressure_device, sensor_0010_I2C_BME680); + l_ezlopi_item_t* pressure_item = ezlopi_device_add_item_to_device(pressure_device, sensor_0010_I2C_BME680); if (pressure_item) { pressure_item->cloud_properties.item_name = ezlopi_item_name_atmospheric_pressure; @@ -151,12 +151,12 @@ static int __prepare(void *arg) } } - l_ezlopi_device_t *aqi_device = ezlopi_device_add_device(cj_device); + l_ezlopi_device_t* aqi_device = ezlopi_device_add_device(cj_device); if (aqi_device) { aqi_device->cloud_properties.category = category_level_sensor; __prepare_device_cloud_properties(aqi_device, cj_device); - l_ezlopi_item_t *aqi_item = ezlopi_device_add_item_to_device(aqi_device, sensor_0010_I2C_BME680); + l_ezlopi_item_t* aqi_item = ezlopi_device_add_item_to_device(aqi_device, sensor_0010_I2C_BME680); if (aqi_item) { aqi_item->cloud_properties.item_name = ezlopi_item_name_volatile_organic_compound_level; @@ -171,12 +171,12 @@ static int __prepare(void *arg) } } - l_ezlopi_device_t *altitude_device = ezlopi_device_add_device(cj_device); + l_ezlopi_device_t* altitude_device = ezlopi_device_add_device(cj_device); if (altitude_device) { altitude_device->cloud_properties.category = category_level_sensor; __prepare_device_cloud_properties(altitude_device, cj_device); - l_ezlopi_item_t *altitude_item = ezlopi_device_add_item_to_device(altitude_device, sensor_0010_I2C_BME680); + l_ezlopi_item_t* altitude_item = ezlopi_device_add_item_to_device(altitude_device, sensor_0010_I2C_BME680); if (altitude_item) { altitude_item->cloud_properties.item_name = ezlopi_item_name_distance; @@ -191,12 +191,12 @@ static int __prepare(void *arg) } } - l_ezlopi_device_t *co2_device = ezlopi_device_add_device(cj_device); + l_ezlopi_device_t* co2_device = ezlopi_device_add_device(cj_device); if (co2_device) { co2_device->cloud_properties.category = category_level_sensor; __prepare_device_cloud_properties(co2_device, cj_device); - l_ezlopi_item_t *co2_item = ezlopi_device_add_item_to_device(co2_device, sensor_0010_I2C_BME680); + l_ezlopi_item_t* co2_item = ezlopi_device_add_item_to_device(co2_device, sensor_0010_I2C_BME680); if (co2_item) { co2_item->cloud_properties.item_name = ezlopi_item_name_co2_level; @@ -227,7 +227,7 @@ static int __prepare(void *arg) return ret; } -static int __init(l_ezlopi_item_t *item) +static int __init(l_ezlopi_item_t* item) { int ret = 0; if (item) @@ -251,51 +251,51 @@ static int __init(l_ezlopi_item_t *item) return ret; } -static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) +static int __get_cjson_value(l_ezlopi_item_t* item, void* arg) { int ret = 0; - cJSON *cj_device = (cJSON *)arg; + cJSON* cj_device = (cJSON*)arg; if (cj_device && item) { - bme680_data_t *user_data = (bme680_data_t *)item->user_arg; + bme680_data_t* user_data = (bme680_data_t*)item->user_arg; if (ezlopi_item_name_temp == item->cloud_properties.item_name) { - char *valueFormatted = ezlopi_valueformatter_float(user_data->temperature); + char* valueFormatted = ezlopi_valueformatter_float(user_data->temperature); cJSON_AddStringToObject(cj_device, "valueFormatted", valueFormatted); free(valueFormatted); cJSON_AddNumberToObject(cj_device, "value", user_data->temperature); } if (ezlopi_item_name_humidity == item->cloud_properties.item_name) { - char *valueFormatted = ezlopi_valueformatter_float(user_data->humidity); + char* valueFormatted = ezlopi_valueformatter_float(user_data->humidity); cJSON_AddStringToObject(cj_device, "valueFormatted", valueFormatted); free(valueFormatted); cJSON_AddNumberToObject(cj_device, "value", user_data->humidity); } if (ezlopi_item_name_atmospheric_pressure == item->cloud_properties.item_name) { - char *valueFormatted = ezlopi_valueformatter_float(user_data->pressure / 1000.0); + char* valueFormatted = ezlopi_valueformatter_float(user_data->pressure / 1000.0); cJSON_AddStringToObject(cj_device, "valueFormatted", valueFormatted); free(valueFormatted); cJSON_AddNumberToObject(cj_device, "value", (user_data->pressure / 1000.0)); } if (ezlopi_item_name_volatile_organic_compound_level == item->cloud_properties.item_name) { - char *valueFormatted = ezlopi_valueformatter_float(user_data->iaq); + char* valueFormatted = ezlopi_valueformatter_float(user_data->iaq); cJSON_AddStringToObject(cj_device, "valueFormatted", valueFormatted); free(valueFormatted); cJSON_AddNumberToObject(cj_device, "value", (user_data->iaq)); } if (ezlopi_item_name_distance == item->cloud_properties.item_name) { - char *valueFormatted = ezlopi_valueformatter_float(user_data->altitude); + char* valueFormatted = ezlopi_valueformatter_float(user_data->altitude); cJSON_AddStringToObject(cj_device, "valueFormatted", valueFormatted); free(valueFormatted); cJSON_AddNumberToObject(cj_device, "value", (user_data->altitude)); } if (ezlopi_item_name_co2_level == item->cloud_properties.item_name) { - char *valueFormatted = ezlopi_valueformatter_float(user_data->co2_equivalent); + char* valueFormatted = ezlopi_valueformatter_float(user_data->co2_equivalent); cJSON_AddStringToObject(cj_device, "valueFormatted", valueFormatted); free(valueFormatted); cJSON_AddNumberToObject(cj_device, "value", (user_data->co2_equivalent)); @@ -305,12 +305,12 @@ static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) return ret; } -static int __notify(l_ezlopi_item_t *item) +static int __notify(l_ezlopi_item_t* item) { int ret = 0; if (item) { - bme680_data_t *user_data = (bme680_data_t *)item->user_arg; + bme680_data_t* user_data = (bme680_data_t*)item->user_arg; float temperature = user_data->temperature; float humidity = user_data->humidity; float pressure = user_data->pressure; diff --git a/ezlopi-sensors-devices/sensor-0015-oneWire-DHT11/sensor_0015_oneWire_DHT11.c b/ezlopi-sensors-devices/sensor-0015-oneWire-DHT11/sensor_0015_oneWire_DHT11.c index cdba97e14..9b8c8ba5d 100644 --- a/ezlopi-sensors-devices/sensor-0015-oneWire-DHT11/sensor_0015_oneWire_DHT11.c +++ b/ezlopi-sensors-devices/sensor-0015-oneWire-DHT11/sensor_0015_oneWire_DHT11.c @@ -1,5 +1,5 @@ #include - + #include "ezlopi_util_trace.h" #include "ezlopi_core_timer.h" @@ -20,18 +20,18 @@ typedef struct s_ezlopi_dht11_data float humidity; } s_ezlopi_dht11_data_t; -static int __0015_prepare(void *arg); -static int __0015_init(l_ezlopi_item_t *item); -static int __0015_get_value(l_ezlopi_item_t *item, void *args); -static int __0015_notify(l_ezlopi_item_t *item); +static int __0015_prepare(void* arg); +static int __0015_init(l_ezlopi_item_t* item); +static int __0015_get_value(l_ezlopi_item_t* item, void* args); +static int __0015_notify(l_ezlopi_item_t* item); -static int __dht11_setup_item_properties_temperature(l_ezlopi_item_t *item, cJSON *cj_device, void *user_arg); -static int __dht11_setup_item_properties_humidity(l_ezlopi_item_t *item, cJSON *cj_device, void *user_arg); -static int __dht11_setup_device_cloud_properties_temperature(l_ezlopi_device_t *device, cJSON *cj_device); -static int __dht11_setup_device_cloud_properties_humidity(l_ezlopi_device_t *device, cJSON *cj_device); +static int __dht11_setup_item_properties_temperature(l_ezlopi_item_t* item, cJSON* cj_device, void* user_arg); +static int __dht11_setup_item_properties_humidity(l_ezlopi_item_t* item, cJSON* cj_device, void* user_arg); +static int __dht11_setup_device_cloud_properties_temperature(l_ezlopi_device_t* device, cJSON* cj_device); +static int __dht11_setup_device_cloud_properties_humidity(l_ezlopi_device_t* device, cJSON* cj_device); //----------------------------------------------------------------------------------------------- -int sensor_0015_oneWire_DHT11(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void *arg, void *user_arg) +int sensor_0015_oneWire_DHT11(e_ezlopi_actions_t action, l_ezlopi_item_t* item, void* arg, void* user_arg) { int ret = 0; switch (action) @@ -66,23 +66,23 @@ int sensor_0015_oneWire_DHT11(e_ezlopi_actions_t action, l_ezlopi_item_t *item, } //----------------------------------------------------------------------------------------------- -static int __0015_prepare(void *arg) +static int __0015_prepare(void* arg) { int ret = 0; - s_ezlopi_prep_arg_t *prep_arg = (s_ezlopi_prep_arg_t *)arg; + s_ezlopi_prep_arg_t* prep_arg = (s_ezlopi_prep_arg_t*)arg; if (prep_arg) { - cJSON *cjson_device = prep_arg->cjson_device; + cJSON* cjson_device = prep_arg->cjson_device; if (cjson_device) { - s_ezlopi_dht11_data_t *dht11_sensor_data = (s_ezlopi_dht11_data_t *)malloc(sizeof(s_ezlopi_dht11_data_t)); + s_ezlopi_dht11_data_t* dht11_sensor_data = (s_ezlopi_dht11_data_t*)malloc(sizeof(s_ezlopi_dht11_data_t)); if (dht11_sensor_data) { - l_ezlopi_device_t *device_temperature = ezlopi_device_add_device(cjson_device); + l_ezlopi_device_t* device_temperature = ezlopi_device_add_device(cjson_device); if (device_temperature) { __dht11_setup_device_cloud_properties_temperature(device_temperature, cjson_device); - l_ezlopi_item_t *item_temperature = ezlopi_device_add_item_to_device(device_temperature, sensor_0015_oneWire_DHT11); + l_ezlopi_item_t* item_temperature = ezlopi_device_add_item_to_device(device_temperature, sensor_0015_oneWire_DHT11); if (item_temperature) { item_temperature->cloud_properties.device_id = device_temperature->cloud_properties.device_id; @@ -94,11 +94,11 @@ static int __0015_prepare(void *arg) ret = -1; } } - l_ezlopi_device_t *device_humidity = ezlopi_device_add_device(cjson_device); + l_ezlopi_device_t* device_humidity = ezlopi_device_add_device(cjson_device); if (device_humidity) { __dht11_setup_device_cloud_properties_humidity(device_humidity, cjson_device); - l_ezlopi_item_t *item_humidity = ezlopi_device_add_item_to_device(device_humidity, sensor_0015_oneWire_DHT11); + l_ezlopi_item_t* item_humidity = ezlopi_device_add_item_to_device(device_humidity, sensor_0015_oneWire_DHT11); if (item_humidity) { item_humidity->cloud_properties.device_id = device_humidity->cloud_properties.device_id; @@ -121,12 +121,12 @@ static int __0015_prepare(void *arg) return ret; } -static int __dht11_setup_device_cloud_properties_temperature(l_ezlopi_device_t *device, cJSON *cj_device) +static int __dht11_setup_device_cloud_properties_temperature(l_ezlopi_device_t* device, cJSON* cj_device) { int ret = 0; if (device && cj_device) { - char *device_name = NULL; + char* device_name = NULL; CJSON_GET_VALUE_STRING(cj_device, "dev_name", device_name); ASSIGN_DEVICE_NAME_V2(device, device_name); @@ -140,12 +140,12 @@ static int __dht11_setup_device_cloud_properties_temperature(l_ezlopi_device_t * return ret; } -static int __dht11_setup_device_cloud_properties_humidity(l_ezlopi_device_t *device, cJSON *cj_device) +static int __dht11_setup_device_cloud_properties_humidity(l_ezlopi_device_t* device, cJSON* cj_device) { int ret = 0; if (device && cj_device) { - char *device_name = NULL; + char* device_name = NULL; CJSON_GET_VALUE_STRING(cj_device, "dev_name", device_name); ASSIGN_DEVICE_NAME_V2(device, device_name); @@ -159,7 +159,7 @@ static int __dht11_setup_device_cloud_properties_humidity(l_ezlopi_device_t *dev return ret; } -static int __dht11_setup_item_properties_temperature(l_ezlopi_item_t *item, cJSON *cj_device, void *user_arg) +static int __dht11_setup_item_properties_temperature(l_ezlopi_item_t* item, cJSON* cj_device, void* user_arg) { int ret = 0; if (item && cj_device) @@ -173,16 +173,16 @@ static int __dht11_setup_item_properties_temperature(l_ezlopi_item_t *item, cJSO item->cloud_properties.scale = scales_celsius; item->user_arg = user_arg; - CJSON_GET_VALUE_INT(cj_device, "dev_type", item->interface_type); + CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); item->interface.onewire_master.enable = true; - CJSON_GET_VALUE_INT(cj_device, "gpio", item->interface.onewire_master.onewire_pin); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.onewire_master.onewire_pin); } return ret; } -static int __dht11_setup_item_properties_humidity(l_ezlopi_item_t *item, cJSON *cj_device, void *user_arg) +static int __dht11_setup_item_properties_humidity(l_ezlopi_item_t* item, cJSON* cj_device, void* user_arg) { int ret = 0; if (item && cj_device) @@ -196,15 +196,15 @@ static int __dht11_setup_item_properties_humidity(l_ezlopi_item_t *item, cJSON * item->cloud_properties.scale = scales_percent; item->user_arg = user_arg; - CJSON_GET_VALUE_INT(cj_device, "dev_type", item->interface_type); + CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); item->interface.onewire_master.enable = true; - CJSON_GET_VALUE_INT(cj_device, "gpio", item->interface.onewire_master.onewire_pin); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.onewire_master.onewire_pin); } return ret; } -static int __0015_init(l_ezlopi_item_t *item) +static int __0015_init(l_ezlopi_item_t* item) { int ret = 0; if (item) @@ -227,39 +227,39 @@ static int __0015_init(l_ezlopi_item_t *item) return ret; } -static int __0015_get_value(l_ezlopi_item_t *item, void *args) +static int __0015_get_value(l_ezlopi_item_t* item, void* args) { int ret = 0; - cJSON *cj_properties = (cJSON *)args; + cJSON* cj_properties = (cJSON*)args; if (item && cj_properties) { - s_ezlopi_dht11_data_t *dht11_data = (s_ezlopi_dht11_data_t *)item->user_arg; + s_ezlopi_dht11_data_t* dht11_data = (s_ezlopi_dht11_data_t*)item->user_arg; if (ezlopi_item_name_temp == item->cloud_properties.item_name) { - cJSON_AddNumberToObject(cj_properties, "value", dht11_data->temperature); - char *valueFormatted = ezlopi_valueformatter_float(dht11_data->temperature); - cJSON_AddStringToObject(cj_properties, "valueFormatted", valueFormatted); + cJSON_AddNumberToObject(cj_properties, ezlopi_value_str, dht11_data->temperature); + char* valueFormatted = ezlopi_valueformatter_float(dht11_data->temperature); + cJSON_AddStringToObject(cj_properties, ezlopi_valueFormatted_str, valueFormatted); free(valueFormatted); - cJSON_AddStringToObject(cj_properties, "scale", item->cloud_properties.scale); + cJSON_AddStringToObject(cj_properties, ezlopi_scale_str, item->cloud_properties.scale); } if (ezlopi_item_name_humidity == item->cloud_properties.item_name) { - cJSON_AddNumberToObject(cj_properties, "value", dht11_data->humidity); - char *valueFormatted = ezlopi_valueformatter_float(dht11_data->humidity); - cJSON_AddStringToObject(cj_properties, "valueFormatted", valueFormatted); + cJSON_AddNumberToObject(cj_properties, ezlopi_value_str, dht11_data->humidity); + char* valueFormatted = ezlopi_valueformatter_float(dht11_data->humidity); + cJSON_AddStringToObject(cj_properties, ezlopi_valueFormatted_str, valueFormatted); free(valueFormatted); - cJSON_AddStringToObject(cj_properties, "scale", item->cloud_properties.scale); + cJSON_AddStringToObject(cj_properties, ezlopi_scale_str, item->cloud_properties.scale); } } return ret; } -static int __0015_notify(l_ezlopi_item_t *item) +static int __0015_notify(l_ezlopi_item_t* item) { int ret = 0; if (item) { - s_ezlopi_dht11_data_t *dht11_data = (s_ezlopi_dht11_data_t *)item->user_arg; + s_ezlopi_dht11_data_t* dht11_data = (s_ezlopi_dht11_data_t*)item->user_arg; if (dht11_data) { readDHT11(); diff --git a/ezlopi-sensors-devices/sensor-0016-oneWire-DHT22/sensor_0016_oneWire_DHT22.c b/ezlopi-sensors-devices/sensor-0016-oneWire-DHT22/sensor_0016_oneWire_DHT22.c index bef4598b6..1caac49a0 100644 --- a/ezlopi-sensors-devices/sensor-0016-oneWire-DHT22/sensor_0016_oneWire_DHT22.c +++ b/ezlopi-sensors-devices/sensor-0016-oneWire-DHT22/sensor_0016_oneWire_DHT22.c @@ -20,18 +20,18 @@ typedef struct s_ezlopi_dht22_data float humidity; } s_ezlopi_dht22_data_t; -static int dht22_sensor_prepare_v3(void *arg); -static int dht22_sensor_init_v3(l_ezlopi_item_t *item); -static int dht22_sensor_get_sensor_value_v3(l_ezlopi_item_t *item, void *args); -static int dht22_sensor_setup_item_properties_temperature(l_ezlopi_item_t *item, cJSON *cj_device, void *user_arg); -static int dht22_sensor_setup_item_properties_humidity(l_ezlopi_item_t *item, cJSON *cj_device, void *user_arg); +static int dht22_sensor_prepare_v3(void* arg); +static int dht22_sensor_init_v3(l_ezlopi_item_t* item); +static int dht22_sensor_get_sensor_value_v3(l_ezlopi_item_t* item, void* args); +static int dht22_sensor_setup_item_properties_temperature(l_ezlopi_item_t* item, cJSON* cj_device, void* user_arg); +static int dht22_sensor_setup_item_properties_humidity(l_ezlopi_item_t* item, cJSON* cj_device, void* user_arg); -static int dht22_sensor_setup_device_cloud_properties_temperature(l_ezlopi_device_t *device, cJSON *cj_device); -static int dht22_sensor_setup_device_cloud_properties_humidity(l_ezlopi_device_t *device, cJSON *cj_device); +static int dht22_sensor_setup_device_cloud_properties_temperature(l_ezlopi_device_t* device, cJSON* cj_device); +static int dht22_sensor_setup_device_cloud_properties_humidity(l_ezlopi_device_t* device, cJSON* cj_device); -static int __notify(l_ezlopi_item_t *item); +static int __notify(l_ezlopi_item_t* item); -int sensor_0016_oneWire_DHT22(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void *arg, void *user_arg) +int sensor_0016_oneWire_DHT22(e_ezlopi_actions_t action, l_ezlopi_item_t* item, void* arg, void* user_arg) { int ret = 0; switch (action) @@ -65,7 +65,7 @@ int sensor_0016_oneWire_DHT22(e_ezlopi_actions_t action, l_ezlopi_item_t *item, return ret; } -static int dht22_sensor_init_v3(l_ezlopi_item_t *item) +static int dht22_sensor_init_v3(l_ezlopi_item_t* item) { int ret = 0; if (item) @@ -88,12 +88,12 @@ static int dht22_sensor_init_v3(l_ezlopi_item_t *item) return ret; } -static int __notify(l_ezlopi_item_t *item) +static int __notify(l_ezlopi_item_t* item) { int ret = 0; if (item) { - s_ezlopi_dht22_data_t *dht22_data = (s_ezlopi_dht22_data_t *)item->user_arg; + s_ezlopi_dht22_data_t* dht22_data = (s_ezlopi_dht22_data_t*)item->user_arg; if (dht22_data) { readDHT22(); @@ -123,20 +123,20 @@ static int __notify(l_ezlopi_item_t *item) return ret; } -static int dht22_sensor_get_sensor_value_v3(l_ezlopi_item_t *item, void *args) +static int dht22_sensor_get_sensor_value_v3(l_ezlopi_item_t* item, void* args) { int ret = 0; - cJSON *cj_properties = (cJSON *)args; + cJSON* cj_properties = (cJSON*)args; if (item && cj_properties) { - s_ezlopi_dht22_data_t *dht22_data = (s_ezlopi_dht22_data_t *)item->user_arg; + s_ezlopi_dht22_data_t* dht22_data = (s_ezlopi_dht22_data_t*)item->user_arg; if (ezlopi_item_name_temp == item->cloud_properties.item_name) { cJSON_AddNumberToObject(cj_properties, ezlopi_value_str, dht22_data->temperature); - char *valueFormatted = ezlopi_valueformatter_float(dht22_data->temperature); + char* valueFormatted = ezlopi_valueformatter_float(dht22_data->temperature); cJSON_AddStringToObject(cj_properties, ezlopi_valueFormatted_str, valueFormatted); free(valueFormatted); cJSON_AddStringToObject(cj_properties, ezlopi_scale_str, item->cloud_properties.scale); @@ -145,7 +145,7 @@ static int dht22_sensor_get_sensor_value_v3(l_ezlopi_item_t *item, void *args) if (ezlopi_item_name_humidity == item->cloud_properties.item_name) { cJSON_AddNumberToObject(cj_properties, ezlopi_value_str, dht22_data->humidity); - char *valueFormatted = ezlopi_valueformatter_float(dht22_data->humidity); + char* valueFormatted = ezlopi_valueformatter_float(dht22_data->humidity); cJSON_AddStringToObject(cj_properties, ezlopi_valueFormatted_str, valueFormatted); free(valueFormatted); cJSON_AddStringToObject(cj_properties, ezlopi_scale_str, item->cloud_properties.scale); @@ -154,24 +154,24 @@ static int dht22_sensor_get_sensor_value_v3(l_ezlopi_item_t *item, void *args) return ret; } -static int dht22_sensor_prepare_v3(void *arg) +static int dht22_sensor_prepare_v3(void* arg) { int ret = 0; - s_ezlopi_prep_arg_t *prep_arg = (s_ezlopi_prep_arg_t *)arg; + s_ezlopi_prep_arg_t* prep_arg = (s_ezlopi_prep_arg_t*)arg; if (prep_arg) { - cJSON *cjson_device = prep_arg->cjson_device; + cJSON* cjson_device = prep_arg->cjson_device; if (cjson_device) { - l_ezlopi_device_t *device_temperature = ezlopi_device_add_device(prep_arg->cjson_device); + l_ezlopi_device_t* device_temperature = ezlopi_device_add_device(prep_arg->cjson_device); if (device_temperature) { - s_ezlopi_dht22_data_t *dht22_sensor_data_temp = (s_ezlopi_dht22_data_t *)malloc(sizeof(s_ezlopi_dht22_data_t)); + s_ezlopi_dht22_data_t* dht22_sensor_data_temp = (s_ezlopi_dht22_data_t*)malloc(sizeof(s_ezlopi_dht22_data_t)); if (dht22_sensor_data_temp) { dht22_sensor_setup_device_cloud_properties_temperature(device_temperature, cjson_device); - l_ezlopi_item_t *item_temperature = ezlopi_device_add_item_to_device(device_temperature, sensor_0016_oneWire_DHT22); + l_ezlopi_item_t* item_temperature = ezlopi_device_add_item_to_device(device_temperature, sensor_0016_oneWire_DHT22); if (item_temperature) { item_temperature->cloud_properties.device_id = device_temperature->cloud_properties.device_id; @@ -185,16 +185,16 @@ static int dht22_sensor_prepare_v3(void *arg) } } - l_ezlopi_device_t *device_humidity = ezlopi_device_add_device(prep_arg->cjson_device); + l_ezlopi_device_t* device_humidity = ezlopi_device_add_device(prep_arg->cjson_device); if (device_humidity) { device_humidity->cloud_properties.parent_device_id = device_temperature->cloud_properties.device_id; - s_ezlopi_dht22_data_t *dht22_sensor_data_hum = (s_ezlopi_dht22_data_t *)malloc(sizeof(s_ezlopi_dht22_data_t)); + s_ezlopi_dht22_data_t* dht22_sensor_data_hum = (s_ezlopi_dht22_data_t*)malloc(sizeof(s_ezlopi_dht22_data_t)); if (dht22_sensor_data_hum) { dht22_sensor_setup_device_cloud_properties_humidity(device_humidity, cjson_device); - l_ezlopi_item_t *item_humidity = ezlopi_device_add_item_to_device(device_humidity, sensor_0016_oneWire_DHT22); + l_ezlopi_item_t* item_humidity = ezlopi_device_add_item_to_device(device_humidity, sensor_0016_oneWire_DHT22); if (item_humidity) { item_humidity->cloud_properties.device_id = device_humidity->cloud_properties.device_id; @@ -213,7 +213,7 @@ static int dht22_sensor_prepare_v3(void *arg) return ret; } -static int dht22_sensor_setup_device_cloud_properties_temperature(l_ezlopi_device_t *device, cJSON *cj_device) +static int dht22_sensor_setup_device_cloud_properties_temperature(l_ezlopi_device_t* device, cJSON* cj_device) { int ret = 0; if (device && cj_device) @@ -232,7 +232,7 @@ static int dht22_sensor_setup_device_cloud_properties_temperature(l_ezlopi_devic return ret; } -static int dht22_sensor_setup_device_cloud_properties_humidity(l_ezlopi_device_t *device, cJSON *cj_device) +static int dht22_sensor_setup_device_cloud_properties_humidity(l_ezlopi_device_t* device, cJSON* cj_device) { int ret = 0; if (device && cj_device) @@ -251,7 +251,7 @@ static int dht22_sensor_setup_device_cloud_properties_humidity(l_ezlopi_device_t return ret; } -static int dht22_sensor_setup_item_properties_temperature(l_ezlopi_item_t *item, cJSON *cj_device, void *user_arg) +static int dht22_sensor_setup_item_properties_temperature(l_ezlopi_item_t* item, cJSON* cj_device, void* user_arg) { int ret = 0; @@ -269,13 +269,13 @@ static int dht22_sensor_setup_item_properties_temperature(l_ezlopi_item_t *item, CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); item->interface.onewire_master.enable = true; - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.onewire_master.onewire_pin); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.onewire_master.onewire_pin); } return ret; } -static int dht22_sensor_setup_item_properties_humidity(l_ezlopi_item_t *item, cJSON *cj_device, void *user_arg) +static int dht22_sensor_setup_item_properties_humidity(l_ezlopi_item_t* item, cJSON* cj_device, void* user_arg) { int ret = 0; diff --git a/ezlopi-sensors-devices/sensor-0019-digitalIn-PIR/sensor_0019_digitalIn_PIR.c b/ezlopi-sensors-devices/sensor-0019-digitalIn-PIR/sensor_0019_digitalIn_PIR.c index 8be843951..d233b2761 100644 --- a/ezlopi-sensors-devices/sensor-0019-digitalIn-PIR/sensor_0019_digitalIn_PIR.c +++ b/ezlopi-sensors-devices/sensor-0019-digitalIn-PIR/sensor_0019_digitalIn_PIR.c @@ -182,7 +182,7 @@ static void sensor_pir_setup_item_properties_v3(l_ezlopi_item_t *item, cJSON *cj item->interface.gpio.gpio_in.enable = true; item->interface.gpio.gpio_in.mode = GPIO_MODE_INPUT; - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.gpio.gpio_in.gpio_num); CJSON_GET_VALUE_INT(cj_device, "logic_inv", item->interface.gpio.gpio_in.invert); CJSON_GET_VALUE_INT(cj_device, "pull_up", tmp_var); item->interface.gpio.gpio_in.pull = tmp_var ? GPIO_PULLUP_ONLY : GPIO_PULLDOWN_ONLY; diff --git a/ezlopi-sensors-devices/sensor-0020-other-2axis-joystick/sensor_0020_other_2axis_joystick.c b/ezlopi-sensors-devices/sensor-0020-other-2axis-joystick/sensor_0020_other_2axis_joystick.c index 17645366b..19187a5e9 100644 --- a/ezlopi-sensors-devices/sensor-0020-other-2axis-joystick/sensor_0020_other_2axis_joystick.c +++ b/ezlopi-sensors-devices/sensor-0020-other-2axis-joystick/sensor_0020_other_2axis_joystick.c @@ -25,13 +25,13 @@ typedef struct s_joystick_data uint32_t adc_y; } s_joystick_data_t; -static int __prepare(void *arg); -static int __init(l_ezlopi_item_t *item); -static int __get_value_cjson(l_ezlopi_item_t *item, void *arg); -static int __notify(l_ezlopi_item_t *item); -static void __joystick_intr_callback(void *arg); +static int __prepare(void* arg); +static int __init(l_ezlopi_item_t* item); +static int __get_value_cjson(l_ezlopi_item_t* item, void* arg); +static int __notify(l_ezlopi_item_t* item); +static void __joystick_intr_callback(void* arg); -int sensor_0020_other_2axis_joystick(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void *arg, void *user_arg) +int sensor_0020_other_2axis_joystick(e_ezlopi_actions_t action, l_ezlopi_item_t* item, void* arg, void* user_arg) { int ret = 0; @@ -69,9 +69,9 @@ int sensor_0020_other_2axis_joystick(e_ezlopi_actions_t action, l_ezlopi_item_t return ret; } -static void __setup_device_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device) +static void __setup_device_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device) { - char *device_name = NULL; + char* device_name = NULL; CJSON_GET_VALUE_STRING(cj_device, "dev_name", device_name); ASSIGN_DEVICE_NAME_V2(device, device_name); @@ -81,14 +81,14 @@ static void __setup_device_cloud_properties(l_ezlopi_device_t *device, cJSON *cj device->cloud_properties.device_type = dev_type_device; } -static void __setup_item_cloud_properties(l_ezlopi_item_t *item, s_joystick_data_t *user_data) +static void __setup_item_cloud_properties(l_ezlopi_item_t* item, s_joystick_data_t* user_data) { if (item) { item->cloud_properties.has_getter = true; item->cloud_properties.has_setter = true; item->cloud_properties.show = true; - item->user_arg = (void *)user_data; + item->user_arg = (void*)user_data; if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_X] == item->cloud_properties.item_id) { @@ -111,27 +111,27 @@ static void __setup_item_cloud_properties(l_ezlopi_item_t *item, s_joystick_data } } -static void __setup_item_interface_properties(l_ezlopi_item_t *item, cJSON *cj_device) +static void __setup_item_interface_properties(l_ezlopi_item_t* item, cJSON* cj_device) { if (item) { - s_joystick_data_t *user_data = (s_joystick_data_t *)item->user_arg; + s_joystick_data_t* user_data = (s_joystick_data_t*)item->user_arg; if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_X] == item->cloud_properties.item_id) { item->interface_type = EZLOPI_DEVICE_INTERFACE_ANALOG_INPUT; - CJSON_GET_VALUE_INT(cj_device, "gpio1", item->interface.adc.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio1_str, item->interface.adc.gpio_num); item->interface.adc.resln_bit = 3; } if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_Y] == item->cloud_properties.item_id) { item->interface_type = EZLOPI_DEVICE_INTERFACE_ANALOG_INPUT; - CJSON_GET_VALUE_INT(cj_device, "gpio2", item->interface.adc.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio2_str, item->interface.adc.gpio_num); item->interface.adc.resln_bit = 3; } if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_SWITCH] == item->cloud_properties.item_id) { item->interface_type = EZLOPI_DEVICE_INTERFACE_DIGITAL_INPUT; - CJSON_GET_VALUE_INT(cj_device, "gpio3", item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio3_str, item->interface.gpio.gpio_in.gpio_num); item->interface.gpio.gpio_in.enable = true; item->interface.gpio.gpio_in.interrupt = GPIO_INTR_ANYEDGE; item->interface.gpio.gpio_in.pull = GPIO_PULLUP_ONLY; @@ -139,16 +139,16 @@ static void __setup_item_interface_properties(l_ezlopi_item_t *item, cJSON *cj_d } } -static int __prepare(void *arg) +static int __prepare(void* arg) { int ret = 0; - s_ezlopi_prep_arg_t *dev_prep_arg = (s_ezlopi_prep_arg_t *)arg; + s_ezlopi_prep_arg_t* dev_prep_arg = (s_ezlopi_prep_arg_t*)arg; if (dev_prep_arg && (dev_prep_arg->cjson_device)) { - cJSON *cj_device = dev_prep_arg->cjson_device; + cJSON* cj_device = dev_prep_arg->cjson_device; if (cj_device) { - s_joystick_data_t *user_data = (s_joystick_data_t *)malloc(sizeof(s_joystick_data_t)); + s_joystick_data_t* user_data = (s_joystick_data_t*)malloc(sizeof(s_joystick_data_t)); if (user_data) { memset(user_data, 0, sizeof(s_joystick_data_t)); @@ -157,14 +157,14 @@ static int __prepare(void *arg) user_data->sensor_0020_joystick_item_ids[i] = ezlopi_cloud_generate_item_id(); } - l_ezlopi_device_t *joystick_x_device = ezlopi_device_add_device(cj_device); + l_ezlopi_device_t* joystick_x_device = ezlopi_device_add_device(cj_device); if (joystick_x_device) { joystick_x_device->cloud_properties.category = category_level_sensor; joystick_x_device->cloud_properties.subcategory = subcategory_electricity; __setup_device_cloud_properties(joystick_x_device, cj_device); - l_ezlopi_item_t *joystick_x_item = ezlopi_device_add_item_to_device(joystick_x_device, sensor_0020_other_2axis_joystick); + l_ezlopi_item_t* joystick_x_item = ezlopi_device_add_item_to_device(joystick_x_device, sensor_0020_other_2axis_joystick); if (joystick_x_item) { joystick_x_item->cloud_properties.item_id = user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_X]; @@ -178,14 +178,14 @@ static int __prepare(void *arg) ret = -1; } } - l_ezlopi_device_t *joystick_y_device = ezlopi_device_add_device(cj_device); + l_ezlopi_device_t* joystick_y_device = ezlopi_device_add_device(cj_device); if (joystick_y_device) { joystick_y_device->cloud_properties.category = category_level_sensor; joystick_y_device->cloud_properties.subcategory = subcategory_electricity; __setup_device_cloud_properties(joystick_y_device, cj_device); - l_ezlopi_item_t *joystick_y_item = ezlopi_device_add_item_to_device(joystick_y_device, sensor_0020_other_2axis_joystick); + l_ezlopi_item_t* joystick_y_item = ezlopi_device_add_item_to_device(joystick_y_device, sensor_0020_other_2axis_joystick); if (joystick_y_item) { joystick_y_item->cloud_properties.item_id = user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_Y]; @@ -199,14 +199,14 @@ static int __prepare(void *arg) ret = -1; } } - l_ezlopi_device_t *joystick_sw_device = ezlopi_device_add_device(cj_device); + l_ezlopi_device_t* joystick_sw_device = ezlopi_device_add_device(cj_device); if (joystick_sw_device) { joystick_sw_device->cloud_properties.category = category_switch; joystick_sw_device->cloud_properties.subcategory = subcategory_in_wall; __setup_device_cloud_properties(joystick_sw_device, cj_device); - l_ezlopi_item_t *joystick_sw_item = ezlopi_device_add_item_to_device(joystick_sw_device, sensor_0020_other_2axis_joystick); + l_ezlopi_item_t* joystick_sw_item = ezlopi_device_add_item_to_device(joystick_sw_device, sensor_0020_other_2axis_joystick); if (joystick_sw_item) { joystick_sw_item->cloud_properties.item_id = user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_SWITCH]; @@ -227,12 +227,12 @@ static int __prepare(void *arg) return ret; } -static int __init(l_ezlopi_item_t *item) +static int __init(l_ezlopi_item_t* item) { int ret = 0; if (item) { - s_joystick_data_t *user_data = (s_joystick_data_t *)item->user_arg; + s_joystick_data_t* user_data = (s_joystick_data_t*)item->user_arg; if ((item->cloud_properties.item_id == user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_X]) || (item->cloud_properties.item_id == user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_Y])) { if (GPIO_IS_VALID_GPIO(item->interface.adc.gpio_num)) @@ -288,52 +288,52 @@ static int __init(l_ezlopi_item_t *item) return ret; } -static int __get_value_cjson(l_ezlopi_item_t *item, void *arg) +static int __get_value_cjson(l_ezlopi_item_t* item, void* arg) { int ret = 0; - cJSON *cj_result = (cJSON *)arg; + cJSON* cj_result = (cJSON*)arg; if (cj_result && item) { - s_joystick_data_t *user_data = (s_joystick_data_t *)item->user_arg; + s_joystick_data_t* user_data = (s_joystick_data_t*)item->user_arg; if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_X] == item->cloud_properties.item_id) { - char *valueFormatted = ezlopi_valueformatter_uint32(user_data->adc_x); - cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); - cJSON_AddNumberToObject(cj_result, "value", user_data->adc_x); - cJSON_AddStringToObject(cj_result, "scale", "milli_volt"); + char* valueFormatted = ezlopi_valueformatter_uint32(user_data->adc_x); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, user_data->adc_x); + cJSON_AddStringToObject(cj_result,ezlopi_scale_str, "milli_volt"); free(valueFormatted); } if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_Y] == item->cloud_properties.item_id) { - char *valueFormatted = ezlopi_valueformatter_uint32(user_data->adc_y); - cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); - cJSON_AddNumberToObject(cj_result, "value", user_data->adc_y); - cJSON_AddStringToObject(cj_result, "scale", "milli_volt"); + char* valueFormatted = ezlopi_valueformatter_uint32(user_data->adc_y); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, user_data->adc_y); + cJSON_AddStringToObject(cj_result,ezlopi_scale_str, "milli_volt"); free(valueFormatted); } if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_SWITCH] == item->cloud_properties.item_id) { - cJSON_AddBoolToObject(cj_result, "value", ((0 == item->interface.gpio.gpio_in.value) ? true : false)); - const char *valueFormatted = ezlopi_valueformatter_bool((0 == item->interface.gpio.gpio_in.value) ? true : false); - cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); + cJSON_AddBoolToObject(cj_result, ezlopi_value_str, ((0 == item->interface.gpio.gpio_in.value) ? true : false)); + const char* valueFormatted = ezlopi_valueformatter_bool((0 == item->interface.gpio.gpio_in.value) ? true : false); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); } ret = 1; } return ret; } -static int __notify(l_ezlopi_item_t *item) +static int __notify(l_ezlopi_item_t* item) { int ret = 0; if (item) { if (ezlopi_item_name_switch != item->cloud_properties.item_name) { - s_joystick_data_t *user_data = (s_joystick_data_t *)item->user_arg; - s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; + s_joystick_data_t* user_data = (s_joystick_data_t*)item->user_arg; + s_ezlopi_analog_data_t ezlopi_analog_data = { .value = 0, .voltage = 0 }; if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_X] == item->cloud_properties.item_id) { @@ -361,12 +361,12 @@ static int __notify(l_ezlopi_item_t *item) return ret; } -static void __joystick_intr_callback(void *arg) +static void __joystick_intr_callback(void* arg) { - l_ezlopi_item_t *item = (l_ezlopi_item_t *)arg; + l_ezlopi_item_t* item = (l_ezlopi_item_t*)arg; if (item) { - s_joystick_data_t *user_data = (s_joystick_data_t *)item->user_arg; + s_joystick_data_t* user_data = (s_joystick_data_t*)item->user_arg; item->interface.gpio.gpio_in.value = gpio_get_level(item->interface.gpio.gpio_in.gpio_num); item->interface.gpio.gpio_in.value = (false == item->interface.gpio.gpio_in.invert) ? (item->interface.gpio.gpio_in.value) : (!item->interface.gpio.gpio_in.value); ezlopi_device_value_updated_from_device_item_id_v3(user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_SWITCH]); diff --git a/ezlopi-sensors-devices/sensor-0023-digitalIn-touch-switch-TTP223B/sensor_0023_digitalIn_touch_switch_TTP223B.c b/ezlopi-sensors-devices/sensor-0023-digitalIn-touch-switch-TTP223B/sensor_0023_digitalIn_touch_switch_TTP223B.c index 09ff06f3c..94c700878 100644 --- a/ezlopi-sensors-devices/sensor-0023-digitalIn-touch-switch-TTP223B/sensor_0023_digitalIn_touch_switch_TTP223B.c +++ b/ezlopi-sensors-devices/sensor-0023-digitalIn-touch-switch-TTP223B/sensor_0023_digitalIn_touch_switch_TTP223B.c @@ -163,7 +163,7 @@ static void __prepare_touch_switch_properties(l_ezlopi_item_t *item, cJSON *cj_d item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); item->cloud_properties.scale = NULL; - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.gpio.gpio_in.gpio_num); CJSON_GET_VALUE_INT(cj_device, ezlopi_ip_inv_str, item->interface.gpio.gpio_in.invert); int val_ip = 0; CJSON_GET_VALUE_INT(cj_device, ezlopi_val_ip_str, val_ip); diff --git a/ezlopi-sensors-devices/sensor-0025-digitalIn-LDR/sensor_0025_digitalIn_LDR.c b/ezlopi-sensors-devices/sensor-0025-digitalIn-LDR/sensor_0025_digitalIn_LDR.c index 771e5b2e7..8ffba08ab 100644 --- a/ezlopi-sensors-devices/sensor-0025-digitalIn-LDR/sensor_0025_digitalIn_LDR.c +++ b/ezlopi-sensors-devices/sensor-0025-digitalIn-LDR/sensor_0025_digitalIn_LDR.c @@ -154,7 +154,7 @@ static void __setup_item_properties(l_ezlopi_item_t *item, cJSON *cj_device) item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.gpio.gpio_in.gpio_num); CJSON_GET_VALUE_INT(cj_device, "logic_inv", item->interface.gpio.gpio_in.invert); CJSON_GET_VALUE_INT(cj_device, ezlopi_val_ip_str, item->interface.gpio.gpio_in.value); item->interface.gpio.gpio_in.enable = true; diff --git a/ezlopi-sensors-devices/sensor-0027-ADC-waterLeak/sensor_0027_ADC_waterLeak.c b/ezlopi-sensors-devices/sensor-0027-ADC-waterLeak/sensor_0027_ADC_waterLeak.c index f68385030..8c505cf2d 100644 --- a/ezlopi-sensors-devices/sensor-0027-ADC-waterLeak/sensor_0027_ADC_waterLeak.c +++ b/ezlopi-sensors-devices/sensor-0027-ADC-waterLeak/sensor_0027_ADC_waterLeak.c @@ -94,7 +94,7 @@ static void prepare_item_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_devic static void prepare_item_interface_properties(l_ezlopi_item_t *item, cJSON *cj_device) { item->interface_type = EZLOPI_DEVICE_INTERFACE_ANALOG_INPUT; - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.adc.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.adc.gpio_num); item->interface.adc.resln_bit = 3; } diff --git a/ezlopi-sensors-devices/sensor-0028-other-GY61/sensor_0028_other_GY61.c b/ezlopi-sensors-devices/sensor-0028-other-GY61/sensor_0028_other_GY61.c index 8ec9438b7..b164595c3 100644 --- a/ezlopi-sensors-devices/sensor-0028-other-GY61/sensor_0028_other_GY61.c +++ b/ezlopi-sensors-devices/sensor-0028-other-GY61/sensor_0028_other_GY61.c @@ -1,6 +1,6 @@ #include #include "ezlopi_util_trace.h" - + #include "ezlopi_core_timer.h" #include "ezlopi_core_cloud.h" @@ -30,14 +30,14 @@ typedef struct s_gy61_data #define esp32S3_convert_mV_to_G(temp_vol) (((6.0f / 3000.0f) * (temp_vol - 100)) - 3.0f) #endif -static int __0028_prepare(void *arg); -static int __0028_init(l_ezlopi_item_t *item); -static int __0028_get_cjson_value(l_ezlopi_item_t *item, void *arg); -static int __0028_notify(l_ezlopi_item_t *item); +static int __0028_prepare(void* arg); +static int __0028_init(l_ezlopi_item_t* item); +static int __0028_get_cjson_value(l_ezlopi_item_t* item, void* arg); +static int __0028_notify(l_ezlopi_item_t* item); -static float __update_gy61_axis_value(l_ezlopi_item_t *item); +static float __update_gy61_axis_value(l_ezlopi_item_t* item); //-------------------------------------------------------------------------------------------------------- -int sensor_0028_other_GY61(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void *arg, void *user_arg) +int sensor_0028_other_GY61(e_ezlopi_actions_t action, l_ezlopi_item_t* item, void* arg, void* user_arg) { int ret = 0; switch (action) @@ -71,9 +71,9 @@ int sensor_0028_other_GY61(e_ezlopi_actions_t action, l_ezlopi_item_t *item, voi return ret; } //------------------------------------------------------------------------------------------------------------------------- -static void __prepare_device_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device) +static void __prepare_device_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device) { - char *dev_name = NULL; + char* dev_name = NULL; CJSON_GET_VALUE_STRING(cj_device, "dev_name", dev_name); ASSIGN_DEVICE_NAME_V2(device, dev_name); device->cloud_properties.device_id = ezlopi_cloud_generate_device_id(); @@ -83,7 +83,7 @@ static void __prepare_device_cloud_properties(l_ezlopi_device_t *device, cJSON * device->cloud_properties.info = NULL; device->cloud_properties.device_type = dev_type_sensor; } -static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, void *user_data) +static void __prepare_item_cloud_properties(l_ezlopi_item_t* item, void* user_data) { item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); item->cloud_properties.has_getter = true; @@ -95,7 +95,7 @@ static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, void *user_da item->user_arg = user_data; } -static void __prepare_item_interface_properties(l_ezlopi_item_t *item, cJSON *cj_device) +static void __prepare_item_interface_properties(l_ezlopi_item_t* item, cJSON* cj_device) { if (item && cj_device) { @@ -103,54 +103,54 @@ static void __prepare_item_interface_properties(l_ezlopi_item_t *item, cJSON *cj item->interface.adc.resln_bit = 3; if (ezlopi_item_name_acceleration_x_axis == item->cloud_properties.item_name) { - CJSON_GET_VALUE_INT(cj_device, "gpio1", item->interface.adc.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio1_str, item->interface.adc.gpio_num); TRACE_S("Accel X-axis gpio1: %d ", item->interface.adc.gpio_num); } else if (ezlopi_item_name_acceleration_y_axis == item->cloud_properties.item_name) { - CJSON_GET_VALUE_INT(cj_device, "gpio2", item->interface.adc.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio2_str, item->interface.adc.gpio_num); TRACE_S("Accel Y-axis gpio2: %d ", item->interface.adc.gpio_num); } else if (ezlopi_item_name_acceleration_z_axis == item->cloud_properties.item_name) { - CJSON_GET_VALUE_INT(cj_device, "gpio3", item->interface.adc.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio3_str, item->interface.adc.gpio_num); TRACE_S("Accel Z-axis gpio3: %d ", item->interface.adc.gpio_num); } } } //------------------------------------------------------------------------------------------------------------------------- -static int __0028_prepare(void *arg) +static int __0028_prepare(void* arg) { int ret = 0; - s_ezlopi_prep_arg_t *device_prep_arg = (s_ezlopi_prep_arg_t *)arg; + s_ezlopi_prep_arg_t* device_prep_arg = (s_ezlopi_prep_arg_t*)arg; if (device_prep_arg && (NULL != device_prep_arg->cjson_device)) { - cJSON *cj_device = device_prep_arg->cjson_device; + cJSON* cj_device = device_prep_arg->cjson_device; - s_gy61_data_t *gy61_value = (s_gy61_data_t *)malloc(sizeof(s_gy61_data_t)); + s_gy61_data_t* gy61_value = (s_gy61_data_t*)malloc(sizeof(s_gy61_data_t)); if (NULL != gy61_value) { memset(gy61_value, 0, sizeof(s_gy61_data_t)); - l_ezlopi_device_t *gy61_device = ezlopi_device_add_device(cj_device); + l_ezlopi_device_t* gy61_device = ezlopi_device_add_device(cj_device); if (gy61_device) { __prepare_device_cloud_properties(gy61_device, cj_device); - l_ezlopi_item_t *gy61_item_x = ezlopi_device_add_item_to_device(gy61_device, sensor_0028_other_GY61); + l_ezlopi_item_t* gy61_item_x = ezlopi_device_add_item_to_device(gy61_device, sensor_0028_other_GY61); if (gy61_item_x) { gy61_item_x->cloud_properties.item_name = ezlopi_item_name_acceleration_x_axis; __prepare_item_cloud_properties(gy61_item_x, gy61_value); __prepare_item_interface_properties(gy61_item_x, cj_device); } - l_ezlopi_item_t *gy61_item_y = ezlopi_device_add_item_to_device(gy61_device, sensor_0028_other_GY61); + l_ezlopi_item_t* gy61_item_y = ezlopi_device_add_item_to_device(gy61_device, sensor_0028_other_GY61); if (gy61_item_y) { gy61_item_y->cloud_properties.item_name = ezlopi_item_name_acceleration_y_axis; __prepare_item_cloud_properties(gy61_item_y, gy61_value); __prepare_item_interface_properties(gy61_item_y, cj_device); } - l_ezlopi_item_t *gy61_item_z = ezlopi_device_add_item_to_device(gy61_device, sensor_0028_other_GY61); + l_ezlopi_item_t* gy61_item_z = ezlopi_device_add_item_to_device(gy61_device, sensor_0028_other_GY61); if (gy61_item_z) { gy61_item_z->cloud_properties.item_name = ezlopi_item_name_acceleration_z_axis; @@ -176,7 +176,7 @@ static int __0028_prepare(void *arg) return ret; } -static int __0028_init(l_ezlopi_item_t *item) +static int __0028_init(l_ezlopi_item_t* item) { int ret = 0; if (NULL != item) @@ -199,36 +199,36 @@ static int __0028_init(l_ezlopi_item_t *item) return ret; } -static int __0028_get_cjson_value(l_ezlopi_item_t *item, void *arg) +static int __0028_get_cjson_value(l_ezlopi_item_t* item, void* arg) { int ret = 0; if (item && arg) { - cJSON *cj_result = (cJSON *)arg; + cJSON* cj_result = (cJSON*)arg; if (cj_result) { - s_gy61_data_t *user_data = ((s_gy61_data_t *)item->user_arg); + s_gy61_data_t* user_data = ((s_gy61_data_t*)item->user_arg); if (ezlopi_item_name_acceleration_x_axis == item->cloud_properties.item_name) { - char *valueFormatted = ezlopi_valueformatter_float(user_data->x_data); - cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); - cJSON_AddNumberToObject(cj_result, "value", (user_data->x_data)); + char* valueFormatted = ezlopi_valueformatter_float(user_data->x_data); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, (user_data->x_data)); // TRACE_S("x-axis-G : %.2f", user_data->x_data); free(valueFormatted); } if (ezlopi_item_name_acceleration_y_axis == item->cloud_properties.item_name) { - char *valueFormatted = ezlopi_valueformatter_float(user_data->y_data); - cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); - cJSON_AddNumberToObject(cj_result, "value", (user_data->y_data)); + char* valueFormatted = ezlopi_valueformatter_float(user_data->y_data); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, (user_data->y_data)); // TRACE_S("y-axis-G : %.2f", user_data->y_data); free(valueFormatted); } if (ezlopi_item_name_acceleration_z_axis == item->cloud_properties.item_name) { - char *valueFormatted = ezlopi_valueformatter_float(user_data->z_data); - cJSON_AddStringToObject(cj_result, "valueFormatted", valueFormatted); - cJSON_AddNumberToObject(cj_result, "value", (user_data->z_data)); + char* valueFormatted = ezlopi_valueformatter_float(user_data->z_data); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); + cJSON_AddNumberToObject(cj_result, ezlopi_value_str, (user_data->z_data)); // TRACE_S("z-axis-G : %.2f", user_data->z_data); free(valueFormatted); } @@ -238,12 +238,12 @@ static int __0028_get_cjson_value(l_ezlopi_item_t *item, void *arg) return ret; } -static int __0028_notify(l_ezlopi_item_t *item) +static int __0028_notify(l_ezlopi_item_t* item) { int ret = 0; if (item) { - s_gy61_data_t *user_data = (s_gy61_data_t *)item->user_arg; + s_gy61_data_t* user_data = (s_gy61_data_t*)item->user_arg; float new_value = 0; if (ezlopi_item_name_acceleration_x_axis == item->cloud_properties.item_name) { @@ -278,12 +278,12 @@ static int __0028_notify(l_ezlopi_item_t *item) return ret; } -static float __update_gy61_axis_value(l_ezlopi_item_t *item) +static float __update_gy61_axis_value(l_ezlopi_item_t* item) { float G_data = 0; if (item) { - s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; + s_ezlopi_analog_data_t ezlopi_analog_data = { .value = 0, .voltage = 0 }; ezlopi_adc_get_adc_data(item->interface.adc.gpio_num, &ezlopi_analog_data); int temp_vol = ezlopi_analog_data.voltage; #if (CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32C3) diff --git a/ezlopi-sensors-devices/sensor-0029-I2C-GXHTC3/sensor_0029_I2C_GXHTC3.c b/ezlopi-sensors-devices/sensor-0029-I2C-GXHTC3/sensor_0029_I2C_GXHTC3.c index 803e9dec5..5e20a050f 100644 --- a/ezlopi-sensors-devices/sensor-0029-I2C-GXHTC3/sensor_0029_I2C_GXHTC3.c +++ b/ezlopi-sensors-devices/sensor-0029-I2C-GXHTC3/sensor_0029_I2C_GXHTC3.c @@ -90,7 +90,7 @@ static int gxhtc3_sensor_init(l_ezlopi_item_t *item) // char *valueFormatted = ezlopi_valueformatter_float(value_ptr->temperature); // if (valueFormatted) // { -// cJSON_AddStringToObject(cj_result, ezlopi_valueformatted_str, valueFormatted); +// cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); // free(valueFormatted); // } // cJSON_AddStringToObject(cj_result, ezlopi_scale_str, scales_celsius); @@ -151,7 +151,7 @@ static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) char *valueFormatted = ezlopi_valueformatter_float(value_ptr->temperature); if (valueFormatted) { - cJSON_AddStringToObject(cj_result, ezlopi_valueformatted_str, valueFormatted); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); free(valueFormatted); } cJSON_AddStringToObject(cj_result, ezlopi_scale_str, scales_celsius); @@ -162,7 +162,7 @@ static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) char *valueFormatted = ezlopi_valueformatter_float(value_ptr->humidity); if (valueFormatted) { - cJSON_AddStringToObject(cj_result, ezlopi_valueformatted_str, valueFormatted); + cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); free(valueFormatted); } cJSON_AddStringToObject(cj_result, ezlopi_scale_str, scales_percent); diff --git a/ezlopi-sensors-devices/sensor-0030-oneWire-DS18B20/sensor_0030_oneWire_DS18B20.c b/ezlopi-sensors-devices/sensor-0030-oneWire-DS18B20/sensor_0030_oneWire_DS18B20.c index f179228d0..5a44555cf 100644 --- a/ezlopi-sensors-devices/sensor-0030-oneWire-DS18B20/sensor_0030_oneWire_DS18B20.c +++ b/ezlopi-sensors-devices/sensor-0030-oneWire-DS18B20/sensor_0030_oneWire_DS18B20.c @@ -163,7 +163,7 @@ static void __prepare_item_properties(l_ezlopi_item_t* item, cJSON* cj_device) item->interface_type = EZLOPI_DEVICE_INTERFACE_ONEWIRE_MASTER; item->interface.onewire_master.enable = true; - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.onewire_master.onewire_pin); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.onewire_master.onewire_pin); } static int __prepare(void* arg) diff --git a/ezlopi-sensors-devices/sensor-0031-other-JSNSR04T/sensor_0031_other_JSNSR04T.c b/ezlopi-sensors-devices/sensor-0031-other-JSNSR04T/sensor_0031_other_JSNSR04T.c index bd2586bf1..e9401045c 100644 --- a/ezlopi-sensors-devices/sensor-0031-other-JSNSR04T/sensor_0031_other_JSNSR04T.c +++ b/ezlopi-sensors-devices/sensor-0031-other-JSNSR04T/sensor_0031_other_JSNSR04T.c @@ -12,12 +12,12 @@ #include "jsn_sr04t.h" #include "sensor_0031_other_JSNSR04T.h" -static int __prepare(void *arg); -static int __init(l_ezlopi_item_t *item); -static int __notify(l_ezlopi_item_t *item); -static int __get_cjson_value(l_ezlopi_item_t *item, void *arg); +static int __prepare(void* arg); +static int __init(l_ezlopi_item_t* item); +static int __notify(l_ezlopi_item_t* item); +static int __get_cjson_value(l_ezlopi_item_t* item, void* arg); -int sensor_0031_other_JSNSR04T(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void *arg, void *user_arg) +int sensor_0031_other_JSNSR04T(e_ezlopi_actions_t action, l_ezlopi_item_t* item, void* arg, void* user_arg) { int ret = 0; switch (action) @@ -51,19 +51,19 @@ int sensor_0031_other_JSNSR04T(e_ezlopi_actions_t action, l_ezlopi_item_t *item, return ret; } -static int __notify(l_ezlopi_item_t *item) +static int __notify(l_ezlopi_item_t* item) { return ezlopi_device_value_updated_from_device_v3(item); } -static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) +static int __get_cjson_value(l_ezlopi_item_t* item, void* arg) { int ret = 0; if (item && arg) { - cJSON *cj_result = (cJSON *)arg; - jsn_sr04t_config_t *tmp_config = (jsn_sr04t_config_t *)item->user_arg; + cJSON* cj_result = (cJSON*)arg; + jsn_sr04t_config_t* tmp_config = (jsn_sr04t_config_t*)item->user_arg; if (tmp_config) { jsn_sr04t_data_t jsn_sr04t_data; @@ -75,7 +75,7 @@ static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) float distance = (jsn_sr04t_data.distance_cm / 100.0f); cJSON_AddNumberToObject(cj_result, ezlopi_value_str, distance); - char *valueFormatted = ezlopi_valueformatter_float(distance); + char* valueFormatted = ezlopi_valueformatter_float(distance); cJSON_AddStringToObject(cj_result, ezlopi_valueFormatted_str, valueFormatted); free(valueFormatted); cJSON_AddStringToObject(cj_result, ezlopi_scale_str, scales_meter); @@ -91,13 +91,13 @@ static int __get_cjson_value(l_ezlopi_item_t *item, void *arg) return ret; } -static int __init(l_ezlopi_item_t *item) +static int __init(l_ezlopi_item_t* item) { int ret = 0; if (item) { - jsn_sr04t_config_t *jsn_sr04t_config = malloc(sizeof(jsn_sr04t_config_t)); + jsn_sr04t_config_t* jsn_sr04t_config = malloc(sizeof(jsn_sr04t_config_t)); if (jsn_sr04t_config) { jsn_sr04t_config_t tmp_config = (jsn_sr04t_config_t)JSN_SR04T_CONFIG_DEFAULT(); @@ -106,7 +106,7 @@ static int __init(l_ezlopi_item_t *item) tmp_config.rmt_channel = 4; memcpy(jsn_sr04t_config, &tmp_config, sizeof(jsn_sr04t_config_t)); - item->user_arg = (void *)jsn_sr04t_config; + item->user_arg = (void*)jsn_sr04t_config; if (ESP_OK == init_JSN_SR04T(jsn_sr04t_config)) { @@ -126,7 +126,7 @@ static int __init(l_ezlopi_item_t *item) return ret; } -static void __prepare_device_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device) +static void __prepare_device_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device) { // char *device_name = NULL; // CJSON_GET_VALUE_STRING(cj_device, ezlopi_dev_name_str, device_name); @@ -140,7 +140,7 @@ static void __prepare_device_cloud_properties(l_ezlopi_device_t *device, cJSON * device->cloud_properties.device_type_id = NULL; } -static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_device) +static void __prepare_item_cloud_properties(l_ezlopi_item_t* item, cJSON* cj_device) { CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); item->cloud_properties.has_getter = true; @@ -152,19 +152,17 @@ static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_dev item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); } -static void __prepare_item_interface_properties(l_ezlopi_item_t *item, cJSON *cj_device) +static void __prepare_item_interface_properties(l_ezlopi_item_t* item, cJSON* cj_device) { item->interface_type = EZLOPI_DEVICE_INTERFACE_DIGITAL_OUTPUT; - - CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_out_str, item->interface.gpio.gpio_out.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio1_str, item->interface.gpio.gpio_out.gpio_num); item->interface.gpio.gpio_out.enable = true; item->interface.gpio.gpio_out.interrupt = GPIO_INTR_DISABLE; item->interface.gpio.gpio_out.invert = EZLOPI_GPIO_LOGIC_NONINVERTED; item->interface.gpio.gpio_out.mode = GPIO_MODE_OUTPUT; item->interface.gpio.gpio_out.pull = GPIO_PULLDOWN_ONLY; item->interface.gpio.gpio_out.value = 0; - - CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_in_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio2_str, item->interface.gpio.gpio_in.gpio_num); item->interface.gpio.gpio_in.enable = true; item->interface.gpio.gpio_in.interrupt = GPIO_INTR_DISABLE; item->interface.gpio.gpio_in.invert = EZLOPI_GPIO_LOGIC_NONINVERTED; @@ -173,18 +171,18 @@ static void __prepare_item_interface_properties(l_ezlopi_item_t *item, cJSON *cj item->interface.gpio.gpio_in.value = 0; } -static int __prepare(void *arg) +static int __prepare(void* arg) { int ret = 0; - s_ezlopi_prep_arg_t *prep_arg = (s_ezlopi_prep_arg_t *)arg; + s_ezlopi_prep_arg_t* prep_arg = (s_ezlopi_prep_arg_t*)arg; if (prep_arg && prep_arg->cjson_device) { - l_ezlopi_device_t *device = ezlopi_device_add_device(prep_arg->cjson_device); + l_ezlopi_device_t* device = ezlopi_device_add_device(prep_arg->cjson_device); if (device) { __prepare_device_cloud_properties(device, prep_arg->cjson_device); - l_ezlopi_item_t *item_temperature = ezlopi_device_add_item_to_device(device, sensor_0031_other_JSNSR04T); + l_ezlopi_item_t* item_temperature = ezlopi_device_add_item_to_device(device, sensor_0031_other_JSNSR04T); if (item_temperature) { __prepare_item_cloud_properties(item_temperature, prep_arg->cjson_device); diff --git a/ezlopi-sensors-devices/sensor-0032-ADC-soilMoisture/sensor_0032_ADC_soilMoisture.c b/ezlopi-sensors-devices/sensor-0032-ADC-soilMoisture/sensor_0032_ADC_soilMoisture.c index a0228b42b..96dbcf34e 100644 --- a/ezlopi-sensors-devices/sensor-0032-ADC-soilMoisture/sensor_0032_ADC_soilMoisture.c +++ b/ezlopi-sensors-devices/sensor-0032-ADC-soilMoisture/sensor_0032_ADC_soilMoisture.c @@ -146,7 +146,7 @@ static void __prepare_item_properties(l_ezlopi_item_t *item, cJSON *cj_device, v item->interface_type = EZLOPI_DEVICE_INTERFACE_ANALOG_INPUT; item->interface.adc.resln_bit = 3; - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.adc.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.adc.gpio_num); item->user_arg = user_arg; } diff --git a/ezlopi-sensors-devices/sensor-0033-ADC-turbidity/sensor_0033_ADC_turbidity.c b/ezlopi-sensors-devices/sensor-0033-ADC-turbidity/sensor_0033_ADC_turbidity.c index 99621243c..66842862f 100644 --- a/ezlopi-sensors-devices/sensor-0033-ADC-turbidity/sensor_0033_ADC_turbidity.c +++ b/ezlopi-sensors-devices/sensor-0033-ADC-turbidity/sensor_0033_ADC_turbidity.c @@ -206,7 +206,7 @@ static void __prepare_item_properties(l_ezlopi_item_t* item, cJSON* cj_device, v item->interface_type = EZLOPI_DEVICE_INTERFACE_ANALOG_INPUT; item->interface.adc.resln_bit = 3; - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.adc.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.adc.gpio_num); item->user_arg = user_arg; } diff --git a/ezlopi-sensors-devices/sensor-0034-digitalIn-proximity/sensor_0034_digitalIn_proximity.c b/ezlopi-sensors-devices/sensor-0034-digitalIn-proximity/sensor_0034_digitalIn_proximity.c index fa8f69fc4..a927cf76e 100644 --- a/ezlopi-sensors-devices/sensor-0034-digitalIn-proximity/sensor_0034_digitalIn_proximity.c +++ b/ezlopi-sensors-devices/sensor-0034-digitalIn-proximity/sensor_0034_digitalIn_proximity.c @@ -83,7 +83,7 @@ static void proximity_sensor_setup_item_properties(l_ezlopi_item_t* item, cJSON* item->interface.gpio.gpio_in.enable = true; item->interface.gpio.gpio_in.mode = GPIO_MODE_INPUT; - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.gpio.gpio_in.gpio_num); CJSON_GET_VALUE_INT(cj_device, "logic_inv", item->interface.gpio.gpio_in.invert); // CJSON_GET_VALUE_INT(cj_device, "pull_up", tmp_var); item->interface.gpio.gpio_in.pull = GPIO_PULLUP_ONLY; // tmp_var ? GPIO_PULLUP_ONLY : GPIO_PULLDOWN_ONLY; diff --git a/ezlopi-sensors-devices/sensor-0035-digitalIn-touch-sensor-TPP223B/sensor_0035_digitalIn_touch_sensor_TPP223B.c b/ezlopi-sensors-devices/sensor-0035-digitalIn-touch-sensor-TPP223B/sensor_0035_digitalIn_touch_sensor_TPP223B.c index de1c4de36..c646e3789 100644 --- a/ezlopi-sensors-devices/sensor-0035-digitalIn-touch-sensor-TPP223B/sensor_0035_digitalIn_touch_sensor_TPP223B.c +++ b/ezlopi-sensors-devices/sensor-0035-digitalIn-touch-sensor-TPP223B/sensor_0035_digitalIn_touch_sensor_TPP223B.c @@ -164,7 +164,7 @@ static void __prepare_touch_sensor_properties(l_ezlopi_item_t *item, cJSON *cj_d item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); item->cloud_properties.scale = NULL; - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.gpio.gpio_in.gpio_num); CJSON_GET_VALUE_INT(cj_device, ezlopi_ip_inv_str, item->interface.gpio.gpio_in.invert); CJSON_GET_VALUE_INT(cj_device, ezlopi_val_ip_str, item->interface.gpio.gpio_in.value); diff --git a/ezlopi-sensors-devices/sensor-0037-pms5003-sensor/pms_dev_items_prepare.c b/ezlopi-sensors-devices/sensor-0037-pms5003-sensor/pms_dev_items_prepare.c index c2ba11a1c..f7e822fbf 100644 --- a/ezlopi-sensors-devices/sensor-0037-pms5003-sensor/pms_dev_items_prepare.c +++ b/ezlopi-sensors-devices/sensor-0037-pms5003-sensor/pms_dev_items_prepare.c @@ -12,14 +12,14 @@ #include "sensor_0037_pms5003_sensor.h" // Device 0 -static int __prepare_particulate_matter_particles_0_dot_3_um_device_and_items(cJSON *cj_properties, uint32_t *parent_id, void *user_arg) +static int __prepare_particulate_matter_particles_0_dot_3_um_device_and_items(cJSON* cj_properties, uint32_t* parent_id, void* user_arg) { int ret = 0; - l_ezlopi_device_t *particles_0_dot_3_um_device = ezlopi_device_add_device(cj_properties); + l_ezlopi_device_t* particles_0_dot_3_um_device = ezlopi_device_add_device(cj_properties); if (particles_0_dot_3_um_device) { - char *dev_name = "Dust Particles 0.3 um"; + char* dev_name = "Dust Particles 0.3 um"; ASSIGN_DEVICE_NAME_V2(particles_0_dot_3_um_device, dev_name); particles_0_dot_3_um_device->cloud_properties.category = category_level_sensor; particles_0_dot_3_um_device->cloud_properties.subcategory = subcategory_particulate_matter; @@ -28,7 +28,7 @@ static int __prepare_particulate_matter_particles_0_dot_3_um_device_and_items(cJ particles_0_dot_3_um_device->cloud_properties.parent_device_id = particles_0_dot_3_um_device->cloud_properties.device_id; *parent_id = particles_0_dot_3_um_device->cloud_properties.parent_device_id; - l_ezlopi_item_t *particles_0_dot_3_um_item = ezlopi_device_add_item_to_device(particles_0_dot_3_um_device, sensor_pms5003_v3); + l_ezlopi_item_t* particles_0_dot_3_um_item = ezlopi_device_add_item_to_device(particles_0_dot_3_um_device, sensor_pms5003_v3); if (particles_0_dot_3_um_item) { particles_0_dot_3_um_item->cloud_properties.has_getter = true; @@ -41,8 +41,8 @@ static int __prepare_particulate_matter_particles_0_dot_3_um_device_and_items(cJ particles_0_dot_3_um_item->interface_type = EZLOPI_DEVICE_INTERFACE_UART; particles_0_dot_3_um_item->interface.uart.enable = true; - CJSON_GET_VALUE_INT(cj_properties, "gpio1", particles_0_dot_3_um_item->interface.uart.tx); - CJSON_GET_VALUE_INT(cj_properties, "gpio2", particles_0_dot_3_um_item->interface.uart.rx); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio1_str, particles_0_dot_3_um_item->interface.uart.tx); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio2_str, particles_0_dot_3_um_item->interface.uart.rx); particles_0_dot_3_um_item->interface.uart.baudrate = 9600; particles_0_dot_3_um_item->user_arg = user_arg; @@ -61,14 +61,14 @@ static int __prepare_particulate_matter_particles_0_dot_3_um_device_and_items(cJ } // Device 1 -static int __prepare_particulate_matter_particles_0_dot_5_um_device_and_items(cJSON *cj_properties, uint32_t parent_id, void *user_arg) +static int __prepare_particulate_matter_particles_0_dot_5_um_device_and_items(cJSON* cj_properties, uint32_t parent_id, void* user_arg) { int ret = 0; - l_ezlopi_device_t *particles_0_dot_5_um_device = ezlopi_device_add_device(cj_properties); + l_ezlopi_device_t* particles_0_dot_5_um_device = ezlopi_device_add_device(cj_properties); if (particles_0_dot_5_um_device) { - char *dev_name = "Dust Particles 0.5 um"; + char* dev_name = "Dust Particles 0.5 um"; ASSIGN_DEVICE_NAME_V2(particles_0_dot_5_um_device, dev_name); particles_0_dot_5_um_device->cloud_properties.category = category_level_sensor; particles_0_dot_5_um_device->cloud_properties.subcategory = subcategory_particulate_matter; @@ -76,7 +76,7 @@ static int __prepare_particulate_matter_particles_0_dot_5_um_device_and_items(cJ particles_0_dot_5_um_device->cloud_properties.device_type = dev_type_sensor; particles_0_dot_5_um_device->cloud_properties.parent_device_id = parent_id; - l_ezlopi_item_t *particles_0_dot_5_um_item = ezlopi_device_add_item_to_device(particles_0_dot_5_um_device, sensor_pms5003_v3); + l_ezlopi_item_t* particles_0_dot_5_um_item = ezlopi_device_add_item_to_device(particles_0_dot_5_um_device, sensor_pms5003_v3); if (particles_0_dot_5_um_item) { particles_0_dot_5_um_item->cloud_properties.has_getter = true; @@ -89,8 +89,8 @@ static int __prepare_particulate_matter_particles_0_dot_5_um_device_and_items(cJ particles_0_dot_5_um_item->interface_type = EZLOPI_DEVICE_INTERFACE_UART; particles_0_dot_5_um_item->interface.uart.enable = false; - CJSON_GET_VALUE_INT(cj_properties, "gpio1", particles_0_dot_5_um_item->interface.uart.tx); - CJSON_GET_VALUE_INT(cj_properties, "gpio2", particles_0_dot_5_um_item->interface.uart.rx); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio1_str, particles_0_dot_5_um_item->interface.uart.tx); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio2_str, particles_0_dot_5_um_item->interface.uart.rx); particles_0_dot_5_um_item->interface.uart.baudrate = 9600; particles_0_dot_5_um_item->user_arg = user_arg; @@ -109,14 +109,14 @@ static int __prepare_particulate_matter_particles_0_dot_5_um_device_and_items(cJ } // Device 2 -static int __prepare_particulate_matter_particles_1_um_device_and_items(cJSON *cj_properties, uint32_t parent_id, void *user_arg) +static int __prepare_particulate_matter_particles_1_um_device_and_items(cJSON* cj_properties, uint32_t parent_id, void* user_arg) { int ret = 0; - l_ezlopi_device_t *particles_1_um_device = ezlopi_device_add_device(cj_properties); + l_ezlopi_device_t* particles_1_um_device = ezlopi_device_add_device(cj_properties); if (particles_1_um_device) { - char *dev_name = "Dust Particles 1 um"; + char* dev_name = "Dust Particles 1 um"; ASSIGN_DEVICE_NAME_V2(particles_1_um_device, dev_name); particles_1_um_device->cloud_properties.category = category_level_sensor; particles_1_um_device->cloud_properties.subcategory = subcategory_particulate_matter; @@ -124,7 +124,7 @@ static int __prepare_particulate_matter_particles_1_um_device_and_items(cJSON *c particles_1_um_device->cloud_properties.device_type = dev_type_sensor; particles_1_um_device->cloud_properties.parent_device_id = parent_id; - l_ezlopi_item_t *particles_1_um_item = ezlopi_device_add_item_to_device(particles_1_um_device, sensor_pms5003_v3); + l_ezlopi_item_t* particles_1_um_item = ezlopi_device_add_item_to_device(particles_1_um_device, sensor_pms5003_v3); if (particles_1_um_item) { particles_1_um_item->cloud_properties.has_getter = true; @@ -137,8 +137,8 @@ static int __prepare_particulate_matter_particles_1_um_device_and_items(cJSON *c particles_1_um_item->interface_type = EZLOPI_DEVICE_INTERFACE_UART; particles_1_um_item->interface.uart.enable = false; - CJSON_GET_VALUE_INT(cj_properties, "gpio1", particles_1_um_item->interface.uart.tx); - CJSON_GET_VALUE_INT(cj_properties, "gpio2", particles_1_um_item->interface.uart.rx); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio1_str, particles_1_um_item->interface.uart.tx); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio2_str, particles_1_um_item->interface.uart.rx); particles_1_um_item->interface.uart.baudrate = 9600; particles_1_um_item->user_arg = user_arg; @@ -157,14 +157,14 @@ static int __prepare_particulate_matter_particles_1_um_device_and_items(cJSON *c } // Device 3 -static int __prepare_particulate_matter_particles_2_dot_5_um_device_and_items(cJSON *cj_properties, uint32_t parent_id, void *user_arg) +static int __prepare_particulate_matter_particles_2_dot_5_um_device_and_items(cJSON* cj_properties, uint32_t parent_id, void* user_arg) { int ret = 0; - l_ezlopi_device_t *particles_2_dot_5_um_device = ezlopi_device_add_device(cj_properties); + l_ezlopi_device_t* particles_2_dot_5_um_device = ezlopi_device_add_device(cj_properties); if (particles_2_dot_5_um_device) { - char *dev_name = "Dust Particles 2.5 um"; + char* dev_name = "Dust Particles 2.5 um"; ASSIGN_DEVICE_NAME_V2(particles_2_dot_5_um_device, dev_name); particles_2_dot_5_um_device->cloud_properties.category = category_level_sensor; particles_2_dot_5_um_device->cloud_properties.subcategory = subcategory_particulate_matter; @@ -172,7 +172,7 @@ static int __prepare_particulate_matter_particles_2_dot_5_um_device_and_items(cJ particles_2_dot_5_um_device->cloud_properties.device_type = dev_type_sensor; particles_2_dot_5_um_device->cloud_properties.parent_device_id = parent_id; - l_ezlopi_item_t *particles_2_dot_5_um_item = ezlopi_device_add_item_to_device(particles_2_dot_5_um_device, sensor_pms5003_v3); + l_ezlopi_item_t* particles_2_dot_5_um_item = ezlopi_device_add_item_to_device(particles_2_dot_5_um_device, sensor_pms5003_v3); if (particles_2_dot_5_um_item) { particles_2_dot_5_um_item->cloud_properties.has_getter = true; @@ -185,8 +185,8 @@ static int __prepare_particulate_matter_particles_2_dot_5_um_device_and_items(cJ particles_2_dot_5_um_item->interface_type = EZLOPI_DEVICE_INTERFACE_UART; particles_2_dot_5_um_item->interface.uart.enable = false; - CJSON_GET_VALUE_INT(cj_properties, "gpio1", particles_2_dot_5_um_item->interface.uart.tx); - CJSON_GET_VALUE_INT(cj_properties, "gpio2", particles_2_dot_5_um_item->interface.uart.rx); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio1_str, particles_2_dot_5_um_item->interface.uart.tx); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio2_str, particles_2_dot_5_um_item->interface.uart.rx); particles_2_dot_5_um_item->interface.uart.baudrate = 9600; particles_2_dot_5_um_item->user_arg = user_arg; @@ -205,14 +205,14 @@ static int __prepare_particulate_matter_particles_2_dot_5_um_device_and_items(cJ } // Device 4 -static int __prepare_particulate_matter_particles_5_um_device_and_items(cJSON *cj_properties, uint32_t parent_id, void *user_arg) +static int __prepare_particulate_matter_particles_5_um_device_and_items(cJSON* cj_properties, uint32_t parent_id, void* user_arg) { int ret = 0; - l_ezlopi_device_t *particles_5_um_device = ezlopi_device_add_device(cj_properties); + l_ezlopi_device_t* particles_5_um_device = ezlopi_device_add_device(cj_properties); if (particles_5_um_device) { - char *dev_name = "Dust Particles 5 um"; + char* dev_name = "Dust Particles 5 um"; ASSIGN_DEVICE_NAME_V2(particles_5_um_device, dev_name); particles_5_um_device->cloud_properties.category = category_level_sensor; particles_5_um_device->cloud_properties.subcategory = subcategory_particulate_matter; @@ -220,7 +220,7 @@ static int __prepare_particulate_matter_particles_5_um_device_and_items(cJSON *c particles_5_um_device->cloud_properties.device_type = dev_type_sensor; particles_5_um_device->cloud_properties.parent_device_id = parent_id; - l_ezlopi_item_t *particles_5_um_item = ezlopi_device_add_item_to_device(particles_5_um_device, sensor_pms5003_v3); + l_ezlopi_item_t* particles_5_um_item = ezlopi_device_add_item_to_device(particles_5_um_device, sensor_pms5003_v3); if (particles_5_um_item) { particles_5_um_item->cloud_properties.has_getter = true; @@ -233,8 +233,8 @@ static int __prepare_particulate_matter_particles_5_um_device_and_items(cJSON *c particles_5_um_item->interface_type = EZLOPI_DEVICE_INTERFACE_UART; particles_5_um_item->interface.uart.enable = false; - CJSON_GET_VALUE_INT(cj_properties, "gpio1", particles_5_um_item->interface.uart.tx); - CJSON_GET_VALUE_INT(cj_properties, "gpio2", particles_5_um_item->interface.uart.rx); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio1_str, particles_5_um_item->interface.uart.tx); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio2_str, particles_5_um_item->interface.uart.rx); particles_5_um_item->interface.uart.baudrate = 9600; particles_5_um_item->user_arg = user_arg; @@ -253,14 +253,14 @@ static int __prepare_particulate_matter_particles_5_um_device_and_items(cJSON *c } // Device 5 -static int __prepare_particulate_matter_particles_10_um_device_and_items(cJSON *cj_properties, uint32_t parent_id, void *user_arg) +static int __prepare_particulate_matter_particles_10_um_device_and_items(cJSON* cj_properties, uint32_t parent_id, void* user_arg) { int ret = 0; - l_ezlopi_device_t *particles_10_um_device = ezlopi_device_add_device(cj_properties); + l_ezlopi_device_t* particles_10_um_device = ezlopi_device_add_device(cj_properties); if (particles_10_um_device) { - char *dev_name = "Dust Particles 10 um"; + char* dev_name = "Dust Particles 10 um"; ASSIGN_DEVICE_NAME_V2(particles_10_um_device, dev_name); particles_10_um_device->cloud_properties.category = category_level_sensor; particles_10_um_device->cloud_properties.subcategory = subcategory_particulate_matter; @@ -268,7 +268,7 @@ static int __prepare_particulate_matter_particles_10_um_device_and_items(cJSON * particles_10_um_device->cloud_properties.device_type = dev_type_sensor; particles_10_um_device->cloud_properties.parent_device_id = parent_id; - l_ezlopi_item_t *particles_10_um_item = ezlopi_device_add_item_to_device(particles_10_um_device, sensor_pms5003_v3); + l_ezlopi_item_t* particles_10_um_item = ezlopi_device_add_item_to_device(particles_10_um_device, sensor_pms5003_v3); if (particles_10_um_item) { particles_10_um_item->cloud_properties.has_getter = true; @@ -281,8 +281,8 @@ static int __prepare_particulate_matter_particles_10_um_device_and_items(cJSON * particles_10_um_item->interface_type = EZLOPI_DEVICE_INTERFACE_UART; particles_10_um_item->interface.uart.enable = false; - CJSON_GET_VALUE_INT(cj_properties, "gpio1", particles_10_um_item->interface.uart.tx); - CJSON_GET_VALUE_INT(cj_properties, "gpio2", particles_10_um_item->interface.uart.rx); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio1_str, particles_10_um_item->interface.uart.tx); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio2_str, particles_10_um_item->interface.uart.rx); particles_10_um_item->interface.uart.baudrate = 9600; particles_10_um_item->user_arg = user_arg; @@ -301,14 +301,14 @@ static int __prepare_particulate_matter_particles_10_um_device_and_items(cJSON * } // Device 6 -static int __prepare_particulate_matter_standard_particles_1_um_device_and_items(cJSON *cj_properties, uint32_t parent_id, void *user_arg) +static int __prepare_particulate_matter_standard_particles_1_um_device_and_items(cJSON* cj_properties, uint32_t parent_id, void* user_arg) { int ret = 0; - l_ezlopi_device_t *standard_particles_1_um_device = ezlopi_device_add_device(cj_properties); + l_ezlopi_device_t* standard_particles_1_um_device = ezlopi_device_add_device(cj_properties); if (standard_particles_1_um_device) { - char *dev_name = "Dust Particles PM 1 um"; + char* dev_name = "Dust Particles PM 1 um"; ASSIGN_DEVICE_NAME_V2(standard_particles_1_um_device, dev_name); standard_particles_1_um_device->cloud_properties.category = category_level_sensor; standard_particles_1_um_device->cloud_properties.subcategory = subcategory_particulate_matter; @@ -316,7 +316,7 @@ static int __prepare_particulate_matter_standard_particles_1_um_device_and_items standard_particles_1_um_device->cloud_properties.device_type = dev_type_sensor; standard_particles_1_um_device->cloud_properties.parent_device_id = parent_id; - l_ezlopi_item_t *standard_particles_1_um_item = ezlopi_device_add_item_to_device(standard_particles_1_um_device, sensor_pms5003_v3); + l_ezlopi_item_t* standard_particles_1_um_item = ezlopi_device_add_item_to_device(standard_particles_1_um_device, sensor_pms5003_v3); if (standard_particles_1_um_item) { standard_particles_1_um_item->cloud_properties.has_getter = true; @@ -329,8 +329,8 @@ static int __prepare_particulate_matter_standard_particles_1_um_device_and_items standard_particles_1_um_item->interface_type = EZLOPI_DEVICE_INTERFACE_UART; standard_particles_1_um_item->interface.uart.enable = false; - CJSON_GET_VALUE_INT(cj_properties, "gpio1", standard_particles_1_um_item->interface.uart.tx); - CJSON_GET_VALUE_INT(cj_properties, "gpio2", standard_particles_1_um_item->interface.uart.rx); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio1_str, standard_particles_1_um_item->interface.uart.tx); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio2_str, standard_particles_1_um_item->interface.uart.rx); standard_particles_1_um_item->interface.uart.baudrate = 9600; standard_particles_1_um_item->user_arg = user_arg; @@ -349,14 +349,14 @@ static int __prepare_particulate_matter_standard_particles_1_um_device_and_items } // Device 7 -static int __prepare_particulate_matter_standard_particles_2_dot_5_um_device_and_items(cJSON *cj_properties, uint32_t parent_id, void *user_arg) +static int __prepare_particulate_matter_standard_particles_2_dot_5_um_device_and_items(cJSON* cj_properties, uint32_t parent_id, void* user_arg) { int ret = 0; - l_ezlopi_device_t *standard_particles_2_dot_5_um_device = ezlopi_device_add_device(cj_properties); + l_ezlopi_device_t* standard_particles_2_dot_5_um_device = ezlopi_device_add_device(cj_properties); if (standard_particles_2_dot_5_um_device) { - char *dev_name = "Dust Particles PM 2.5 um"; + char* dev_name = "Dust Particles PM 2.5 um"; ASSIGN_DEVICE_NAME_V2(standard_particles_2_dot_5_um_device, dev_name); standard_particles_2_dot_5_um_device->cloud_properties.category = category_level_sensor; standard_particles_2_dot_5_um_device->cloud_properties.subcategory = subcategory_particulate_matter; @@ -364,7 +364,7 @@ static int __prepare_particulate_matter_standard_particles_2_dot_5_um_device_and standard_particles_2_dot_5_um_device->cloud_properties.device_type = dev_type_sensor; standard_particles_2_dot_5_um_device->cloud_properties.parent_device_id = parent_id; - l_ezlopi_item_t *standard_particles_2_dot_5_um_item = ezlopi_device_add_item_to_device(standard_particles_2_dot_5_um_device, sensor_pms5003_v3); + l_ezlopi_item_t* standard_particles_2_dot_5_um_item = ezlopi_device_add_item_to_device(standard_particles_2_dot_5_um_device, sensor_pms5003_v3); if (standard_particles_2_dot_5_um_item) { standard_particles_2_dot_5_um_item->cloud_properties.has_getter = true; @@ -377,8 +377,8 @@ static int __prepare_particulate_matter_standard_particles_2_dot_5_um_device_and standard_particles_2_dot_5_um_item->interface_type = EZLOPI_DEVICE_INTERFACE_UART; standard_particles_2_dot_5_um_item->interface.uart.enable = false; - CJSON_GET_VALUE_INT(cj_properties, "gpio1", standard_particles_2_dot_5_um_item->interface.uart.tx); - CJSON_GET_VALUE_INT(cj_properties, "gpio2", standard_particles_2_dot_5_um_item->interface.uart.rx); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio1_str, standard_particles_2_dot_5_um_item->interface.uart.tx); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio2_str, standard_particles_2_dot_5_um_item->interface.uart.rx); standard_particles_2_dot_5_um_item->interface.uart.baudrate = 9600; standard_particles_2_dot_5_um_item->user_arg = user_arg; @@ -397,14 +397,14 @@ static int __prepare_particulate_matter_standard_particles_2_dot_5_um_device_and } // Device 8 -static int __prepare_particulate_matter_standard_particles_10_um_device_and_items(cJSON *cj_properties, uint32_t parent_id, void *user_arg) +static int __prepare_particulate_matter_standard_particles_10_um_device_and_items(cJSON* cj_properties, uint32_t parent_id, void* user_arg) { int ret = 0; - l_ezlopi_device_t *standard_particles_10_um_device = ezlopi_device_add_device(cj_properties); + l_ezlopi_device_t* standard_particles_10_um_device = ezlopi_device_add_device(cj_properties); if (standard_particles_10_um_device) { - char *dev_name = "Dust Particles PM 10 um"; + char* dev_name = "Dust Particles PM 10 um"; ASSIGN_DEVICE_NAME_V2(standard_particles_10_um_device, dev_name); standard_particles_10_um_device->cloud_properties.category = category_level_sensor; standard_particles_10_um_device->cloud_properties.subcategory = subcategory_particulate_matter; @@ -412,7 +412,7 @@ static int __prepare_particulate_matter_standard_particles_10_um_device_and_item standard_particles_10_um_device->cloud_properties.device_type = dev_type_sensor; standard_particles_10_um_device->cloud_properties.parent_device_id = parent_id; - l_ezlopi_item_t *standard_particles_10_um_item = ezlopi_device_add_item_to_device(standard_particles_10_um_device, sensor_pms5003_v3); + l_ezlopi_item_t* standard_particles_10_um_item = ezlopi_device_add_item_to_device(standard_particles_10_um_device, sensor_pms5003_v3); if (standard_particles_10_um_item) { standard_particles_10_um_item->cloud_properties.has_getter = true; @@ -425,8 +425,8 @@ static int __prepare_particulate_matter_standard_particles_10_um_device_and_item standard_particles_10_um_item->interface_type = EZLOPI_DEVICE_INTERFACE_UART; standard_particles_10_um_item->interface.uart.enable = false; - CJSON_GET_VALUE_INT(cj_properties, "gpio1", standard_particles_10_um_item->interface.uart.tx); - CJSON_GET_VALUE_INT(cj_properties, "gpio2", standard_particles_10_um_item->interface.uart.rx); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio1_str, standard_particles_10_um_item->interface.uart.tx); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio2_str, standard_particles_10_um_item->interface.uart.rx); standard_particles_10_um_item->interface.uart.baudrate = 9600; standard_particles_10_um_item->user_arg = user_arg; @@ -444,15 +444,15 @@ static int __prepare_particulate_matter_standard_particles_10_um_device_and_item return ret; } -static int pms5003_set_pms_object_details(cJSON *cj_properties, s_pms5003_sensor_object *pms_object) +static int pms5003_set_pms_object_details(cJSON* cj_properties, s_pms5003_sensor_object* pms_object) { int ret = 0; assert(pms_object != NULL); - CJSON_GET_VALUE_INT(cj_properties, "gpio1", pms_object->pms_tx_pin); - CJSON_GET_VALUE_INT(cj_properties, "gpio2", pms_object->pms_rx_pin); - CJSON_GET_VALUE_INT(cj_properties, "gpio3", pms_object->pms_set_pin); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio1_str, pms_object->pms_tx_pin); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio2_str, pms_object->pms_rx_pin); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio3_str, pms_object->pms_set_pin); CJSON_GET_VALUE_INT(cj_properties, "gpio4", pms_object->pms_reset_pin); pms_object->pms_baud_rate = 9600; @@ -468,23 +468,23 @@ static int pms5003_set_pms_object_details(cJSON *cj_properties, s_pms5003_sensor return ret; } -int pms5003_sensor_preapre_devices_and_items(cJSON *cj_properties, uint32_t *parent_id) +int pms5003_sensor_preapre_devices_and_items(cJSON* cj_properties, uint32_t* parent_id) { int ret = 0; - s_pms5003_sensor_object *pms_object = (s_pms5003_sensor_object *)malloc(sizeof(s_pms5003_sensor_object)); + s_pms5003_sensor_object* pms_object = (s_pms5003_sensor_object*)malloc(sizeof(s_pms5003_sensor_object)); if (pms_object) { pms5003_set_pms_object_details(cj_properties, pms_object); - ESP_ERROR_CHECK(__prepare_particulate_matter_particles_0_dot_3_um_device_and_items(cj_properties, parent_id, (void *)pms_object)); - ESP_ERROR_CHECK(__prepare_particulate_matter_particles_0_dot_5_um_device_and_items(cj_properties, *parent_id, (void *)pms_object)); - ESP_ERROR_CHECK(__prepare_particulate_matter_particles_1_um_device_and_items(cj_properties, *parent_id, (void *)pms_object)); - ESP_ERROR_CHECK(__prepare_particulate_matter_particles_2_dot_5_um_device_and_items(cj_properties, *parent_id, (void *)pms_object)); - ESP_ERROR_CHECK(__prepare_particulate_matter_particles_5_um_device_and_items(cj_properties, *parent_id, (void *)pms_object)); - ESP_ERROR_CHECK(__prepare_particulate_matter_particles_10_um_device_and_items(cj_properties, *parent_id, (void *)pms_object)); - ESP_ERROR_CHECK(__prepare_particulate_matter_standard_particles_1_um_device_and_items(cj_properties, *parent_id, (void *)pms_object)); - ESP_ERROR_CHECK(__prepare_particulate_matter_standard_particles_2_dot_5_um_device_and_items(cj_properties, *parent_id, (void *)pms_object)); - ESP_ERROR_CHECK(__prepare_particulate_matter_standard_particles_10_um_device_and_items(cj_properties, *parent_id, (void *)pms_object)); + ESP_ERROR_CHECK(__prepare_particulate_matter_particles_0_dot_3_um_device_and_items(cj_properties, parent_id, (void*)pms_object)); + ESP_ERROR_CHECK(__prepare_particulate_matter_particles_0_dot_5_um_device_and_items(cj_properties, *parent_id, (void*)pms_object)); + ESP_ERROR_CHECK(__prepare_particulate_matter_particles_1_um_device_and_items(cj_properties, *parent_id, (void*)pms_object)); + ESP_ERROR_CHECK(__prepare_particulate_matter_particles_2_dot_5_um_device_and_items(cj_properties, *parent_id, (void*)pms_object)); + ESP_ERROR_CHECK(__prepare_particulate_matter_particles_5_um_device_and_items(cj_properties, *parent_id, (void*)pms_object)); + ESP_ERROR_CHECK(__prepare_particulate_matter_particles_10_um_device_and_items(cj_properties, *parent_id, (void*)pms_object)); + ESP_ERROR_CHECK(__prepare_particulate_matter_standard_particles_1_um_device_and_items(cj_properties, *parent_id, (void*)pms_object)); + ESP_ERROR_CHECK(__prepare_particulate_matter_standard_particles_2_dot_5_um_device_and_items(cj_properties, *parent_id, (void*)pms_object)); + ESP_ERROR_CHECK(__prepare_particulate_matter_standard_particles_10_um_device_and_items(cj_properties, *parent_id, (void*)pms_object)); ret = 0; } else diff --git a/ezlopi-sensors-devices/sensor-0040-other-TCS230/sensor_0040_other_TCS230.c b/ezlopi-sensors-devices/sensor-0040-other-TCS230/sensor_0040_other_TCS230.c index 32e4e584b..a35a2bc69 100644 --- a/ezlopi-sensors-devices/sensor-0040-other-TCS230/sensor_0040_other_TCS230.c +++ b/ezlopi-sensors-devices/sensor-0040-other-TCS230/sensor_0040_other_TCS230.c @@ -17,16 +17,16 @@ #include "sensor_0040_other_TCS230.h" -static int __0040_prepare(void *arg); -static int __0040_init(l_ezlopi_item_t *item); -static int __0040_get_cjson_value(l_ezlopi_item_t *item, void *arg); -static int __0040_notify(l_ezlopi_item_t *item); +static int __0040_prepare(void* arg); +static int __0040_init(l_ezlopi_item_t* item); +static int __0040_get_cjson_value(l_ezlopi_item_t* item, void* arg); +static int __0040_notify(l_ezlopi_item_t* item); static void __tcs230_setup_gpio(gpio_num_t s0_pin, gpio_num_t s1_pin, gpio_num_t s2_pin, gpio_num_t s3_pin, gpio_num_t gpio_output_en, gpio_num_t gpio_pulse_output); -static void __tcs230_calibration_task(void *params); +static void __tcs230_calibration_task(void* params); //------------------------------------------------------------------------------------------------------ -int sensor_0040_other_TCS230(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void *arg, void *user_arg) +int sensor_0040_other_TCS230(e_ezlopi_actions_t action, l_ezlopi_item_t* item, void* arg, void* user_arg) { int ret = 0; switch (action) @@ -53,11 +53,11 @@ int sensor_0040_other_TCS230(e_ezlopi_actions_t action, l_ezlopi_item_t *item, v //------------------------------------------------------------------------------------------------------ static void __tcs230_setup_gpio(gpio_num_t s0_pin, - gpio_num_t s1_pin, - gpio_num_t s2_pin, - gpio_num_t s3_pin, - gpio_num_t gpio_output_en, - gpio_num_t gpio_pulse_output) + gpio_num_t s1_pin, + gpio_num_t s2_pin, + gpio_num_t s3_pin, + gpio_num_t gpio_output_en, + gpio_num_t gpio_pulse_output) { esp_err_t ret = ESP_FAIL; // Configure GPIO ouput pins (S0, S1, S2, S3 & Freq_scale) for TCS230. @@ -88,9 +88,9 @@ static void __tcs230_setup_gpio(gpio_num_t s0_pin, } //------------------------------------------------------------------------------------------------------ -static void __prepare_device_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device) +static void __prepare_device_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device) { - char *device_name = NULL; + char* device_name = NULL; CJSON_GET_VALUE_STRING(cj_device, "dev_name", device_name); ASSIGN_DEVICE_NAME_V2(device, device_name); device->cloud_properties.device_id = ezlopi_cloud_generate_device_id(); @@ -100,7 +100,7 @@ static void __prepare_device_cloud_properties(l_ezlopi_device_t *device, cJSON * device->cloud_properties.info = NULL; device->cloud_properties.device_type = dev_type_sensor; } -static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, void *user_data) +static void __prepare_item_cloud_properties(l_ezlopi_item_t* item, void* user_data) { item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); item->cloud_properties.has_getter = true; @@ -112,36 +112,36 @@ static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, void *user_da item->user_arg = user_data; } -static void __prepare_item_interface_properties(l_ezlopi_item_t *item, cJSON *cj_device) +static void __prepare_item_interface_properties(l_ezlopi_item_t* item, cJSON* cj_device) { if (item && cj_device) { - s_TCS230_data_t *user_data = (s_TCS230_data_t *)item->user_arg; + s_TCS230_data_t* user_data = (s_TCS230_data_t*)item->user_arg; item->interface_type = EZLOPI_DEVICE_INTERFACE_MAX; - CJSON_GET_VALUE_INT(cj_device, "gpio1", user_data->TCS230_pin.gpio_s0); // gpio_s0 - CJSON_GET_VALUE_INT(cj_device, "gpio2", user_data->TCS230_pin.gpio_s1); // gpio_s1 - CJSON_GET_VALUE_INT(cj_device, "gpio3", user_data->TCS230_pin.gpio_s2); // gpio_s2 + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio1_str, user_data->TCS230_pin.gpio_s0); // gpio_s0 + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio2_str, user_data->TCS230_pin.gpio_s1); // gpio_s1 + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio3_str, user_data->TCS230_pin.gpio_s2); // gpio_s2 CJSON_GET_VALUE_INT(cj_device, "gpio4", user_data->TCS230_pin.gpio_s3); // gpio_s3 CJSON_GET_VALUE_INT(cj_device, "gpio5", user_data->TCS230_pin.gpio_output_en); // gpio_output_en CJSON_GET_VALUE_INT(cj_device, "gpio6", user_data->TCS230_pin.gpio_pulse_output); // gpio_pulse_output } } //------------------------------------------------------------------------------------------------------ -static int __0040_prepare(void *arg) +static int __0040_prepare(void* arg) { int ret = 0; - s_ezlopi_prep_arg_t *device_prep_arg = (s_ezlopi_prep_arg_t *)arg; + s_ezlopi_prep_arg_t* device_prep_arg = (s_ezlopi_prep_arg_t*)arg; if (device_prep_arg && (NULL != device_prep_arg->cjson_device)) { - cJSON *cj_device = device_prep_arg->cjson_device; - s_TCS230_data_t *user_data = (s_TCS230_data_t *)malloc(sizeof(s_TCS230_data_t)); + cJSON* cj_device = device_prep_arg->cjson_device; + s_TCS230_data_t* user_data = (s_TCS230_data_t*)malloc(sizeof(s_TCS230_data_t)); if (user_data) { - l_ezlopi_device_t *tcs230_device = ezlopi_device_add_device(cj_device); + l_ezlopi_device_t* tcs230_device = ezlopi_device_add_device(cj_device); if (tcs230_device) { __prepare_device_cloud_properties(tcs230_device, cj_device); - l_ezlopi_item_t *tcs230_item = ezlopi_device_add_item_to_device(tcs230_device, sensor_0040_other_TCS230); + l_ezlopi_item_t* tcs230_item = ezlopi_device_add_item_to_device(tcs230_device, sensor_0040_other_TCS230); if (tcs230_item) { __prepare_item_cloud_properties(tcs230_item, user_data); @@ -165,12 +165,12 @@ static int __0040_prepare(void *arg) return ret; } -static int __0040_init(l_ezlopi_item_t *item) +static int __0040_init(l_ezlopi_item_t* item) { int ret = 0; if (item) { - s_TCS230_data_t *user_data = (s_TCS230_data_t *)item->user_arg; + s_TCS230_data_t* user_data = (s_TCS230_data_t*)item->user_arg; if (GPIO_IS_VALID_GPIO(user_data->TCS230_pin.gpio_s0) && GPIO_IS_VALID_GPIO(user_data->TCS230_pin.gpio_s1) && GPIO_IS_VALID_GPIO(user_data->TCS230_pin.gpio_s2) && @@ -179,11 +179,11 @@ static int __0040_init(l_ezlopi_item_t *item) GPIO_IS_VALID_GPIO(user_data->TCS230_pin.gpio_pulse_output)) { __tcs230_setup_gpio(user_data->TCS230_pin.gpio_s0, - user_data->TCS230_pin.gpio_s1, - user_data->TCS230_pin.gpio_s2, - user_data->TCS230_pin.gpio_s3, - user_data->TCS230_pin.gpio_output_en, - user_data->TCS230_pin.gpio_pulse_output); + user_data->TCS230_pin.gpio_s1, + user_data->TCS230_pin.gpio_s2, + user_data->TCS230_pin.gpio_s3, + user_data->TCS230_pin.gpio_output_en, + user_data->TCS230_pin.gpio_pulse_output); TRACE_W("Entering Calibration Phase for 30 seconds....."); // configure Freq_scale at 20% @@ -206,20 +206,20 @@ static int __0040_init(l_ezlopi_item_t *item) return ret; } -static int __0040_get_cjson_value(l_ezlopi_item_t *item, void *args) +static int __0040_get_cjson_value(l_ezlopi_item_t* item, void* args) { int ret = 0; - cJSON *cj_result = (cJSON *)args; + cJSON* cj_result = (cJSON*)args; if (cj_result && item) { - s_TCS230_data_t *user_data = (s_TCS230_data_t *)item->user_arg; + s_TCS230_data_t* user_data = (s_TCS230_data_t*)item->user_arg; if (ezlopi_item_name_rgbcolor == item->cloud_properties.item_name) { - cJSON *color_values = cJSON_AddObjectToObject(cj_result, "value"); + cJSON* color_values = cJSON_AddObjectToObject(cj_result, "value"); cJSON_AddNumberToObject(color_values, "red", user_data->red_mapped); cJSON_AddNumberToObject(color_values, "green", user_data->green_mapped); cJSON_AddNumberToObject(color_values, "blue", user_data->blue_mapped); - char *formatted_val = ezlopi_valueformatter_rgb(user_data->red_mapped, user_data->green_mapped, user_data->blue_mapped); + char* formatted_val = ezlopi_valueformatter_rgb(user_data->red_mapped, user_data->green_mapped, user_data->blue_mapped); cJSON_AddStringToObject(cj_result, "valueFormatted", formatted_val); free(formatted_val); } @@ -228,12 +228,12 @@ static int __0040_get_cjson_value(l_ezlopi_item_t *item, void *args) return ret; } -static int __0040_notify(l_ezlopi_item_t *item) +static int __0040_notify(l_ezlopi_item_t* item) { int ret = 0; if (item) { - s_TCS230_data_t *user_data = (s_TCS230_data_t *)item->user_arg; + s_TCS230_data_t* user_data = (s_TCS230_data_t*)item->user_arg; uint32_t red = user_data->red_mapped; uint32_t green = user_data->green_mapped; uint32_t blue = user_data->blue_mapped; @@ -257,61 +257,61 @@ static int __0040_notify(l_ezlopi_item_t *item) } //------------------------------------------------------------------------------ -static void __tcs230_calibration_task(void *params) // calibration task +static void __tcs230_calibration_task(void* params) // calibration task { vTaskDelay(4000 / portTICK_PERIOD_MS); // 4sec - l_ezlopi_item_t *item = (l_ezlopi_item_t *)params; + l_ezlopi_item_t* item = (l_ezlopi_item_t*)params; if (item) { // extracting the 'user_args' from "item" - s_TCS230_data_t *user_data = (s_TCS230_data_t *)item->user_arg; + s_TCS230_data_t* user_data = (s_TCS230_data_t*)item->user_arg; #if 0 - //-------------------------------------------------- - // calculate red min-max periods for each colour - TRACE_E("Please, place the red paper in front of colour sensor..... Starting Calibration for RED in ...."); - for (uint8_t j = 5; j > 0; j--) - { - TRACE_E("....................................................... {%d} ", j); - vTaskDelay(1000 / portTICK_PERIOD_MS); // 4sec - } - // choose RED filter - tcs230_set_filter_color(item, COLOR_SENSOR_COLOR_RED); - calculate_max_min_color_values(user_data->TCS230_pin.gpio_output_en, - user_data->TCS230_pin.gpio_pulse_output, - &user_data->calib_data.least_red_timeP, - &user_data->calib_data.most_red_timeP); + //-------------------------------------------------- + // calculate red min-max periods for each colour + TRACE_E("Please, place the red paper in front of colour sensor..... Starting Calibration for RED in ...."); + for (uint8_t j = 5; j > 0; j--) + { + TRACE_E("....................................................... {%d} ", j); + vTaskDelay(1000 / portTICK_PERIOD_MS); // 4sec + } + // choose RED filter + tcs230_set_filter_color(item, COLOR_SENSOR_COLOR_RED); + calculate_max_min_color_values(user_data->TCS230_pin.gpio_output_en, + user_data->TCS230_pin.gpio_pulse_output, + &user_data->calib_data.least_red_timeP, + &user_data->calib_data.most_red_timeP); - //-------------------------------------------------- - // calculate green min-max periods for each colour - TRACE_S("Please, place the green paper in front of colour sensor..... Starting Calibration for GREEN in ...."); - for (uint8_t j = 5; j > 0; j--) - { - TRACE_S("....................................................... {%d} ", j); - vTaskDelay(1000 / portTICK_PERIOD_MS); // 4sec - } - // choose GREEN filter - tcs230_set_filter_color(item, COLOR_SENSOR_COLOR_GREEN); - calculate_max_min_color_values(user_data->TCS230_pin.gpio_output_en, - user_data->TCS230_pin.gpio_pulse_output, - &user_data->calib_data.least_green_timeP, - &user_data->calib_data.most_green_timeP); + //-------------------------------------------------- + // calculate green min-max periods for each colour + TRACE_S("Please, place the green paper in front of colour sensor..... Starting Calibration for GREEN in ...."); + for (uint8_t j = 5; j > 0; j--) + { + TRACE_S("....................................................... {%d} ", j); + vTaskDelay(1000 / portTICK_PERIOD_MS); // 4sec + } + // choose GREEN filter + tcs230_set_filter_color(item, COLOR_SENSOR_COLOR_GREEN); + calculate_max_min_color_values(user_data->TCS230_pin.gpio_output_en, + user_data->TCS230_pin.gpio_pulse_output, + &user_data->calib_data.least_green_timeP, + &user_data->calib_data.most_green_timeP); - //-------------------------------------------------- - // calculate blue min-max periods for each colour - TRACE_I("Please, place the blue paper in front of colour sensor..... Starting Calibration for BLUE in ...."); - for (uint8_t j = 5; j > 0; j--) - { - TRACE_I("....................................................... {%d} ", j); - vTaskDelay(1000 / portTICK_PERIOD_MS); // 4sec - } - // choose BLUE filter - tcs230_set_filter_color(item, COLOR_SENSOR_COLOR_BLUE); - calculate_max_min_color_values(user_data->TCS230_pin.gpio_output_en, - user_data->TCS230_pin.gpio_pulse_output, - &user_data->calib_data.least_blue_timeP, - &user_data->calib_data.most_blue_timeP); + //-------------------------------------------------- + // calculate blue min-max periods for each colour + TRACE_I("Please, place the blue paper in front of colour sensor..... Starting Calibration for BLUE in ...."); + for (uint8_t j = 5; j > 0; j--) + { + TRACE_I("....................................................... {%d} ", j); + vTaskDelay(1000 / portTICK_PERIOD_MS); // 4sec + } + // choose BLUE filter + tcs230_set_filter_color(item, COLOR_SENSOR_COLOR_BLUE); + calculate_max_min_color_values(user_data->TCS230_pin.gpio_output_en, + user_data->TCS230_pin.gpio_pulse_output, + &user_data->calib_data.least_blue_timeP, + &user_data->calib_data.most_blue_timeP); - //-------------------------------------------------- - // show (LOW,HIGH) -> (max,min) + //-------------------------------------------------- + // show (LOW,HIGH) -> (max,min) #endif user_data->calib_data.least_red_timeP = 120; /*Defaults*/ diff --git a/ezlopi-sensors-devices/sensor-0042-ADC-shunt-voltmeter/sensor_0042_ADC_shunt_voltmeter.c b/ezlopi-sensors-devices/sensor-0042-ADC-shunt-voltmeter/sensor_0042_ADC_shunt_voltmeter.c index f5a345b2d..956064862 100644 --- a/ezlopi-sensors-devices/sensor-0042-ADC-shunt-voltmeter/sensor_0042_ADC_shunt_voltmeter.c +++ b/ezlopi-sensors-devices/sensor-0042-ADC-shunt-voltmeter/sensor_0042_ADC_shunt_voltmeter.c @@ -82,8 +82,8 @@ static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_dev item->cloud_properties.value_type = value_type_electric_potential; item->cloud_properties.scale = scales_volt; - CJSON_GET_VALUE_INT(cj_device, "dev_type", item->interface_type); // _max = 10 - CJSON_GET_VALUE_INT(cj_device, "gpio", item->interface.adc.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); // _max = 10 + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.adc.gpio_num); item->interface.adc.resln_bit = 3; // ADC 12_bit // passing the custom data_structure diff --git a/ezlopi-sensors-devices/sensor-0046-ADC-ACS712-05B-currentmeter/sensor_0046_ADC_ACS712_05B_currentmeter.c b/ezlopi-sensors-devices/sensor-0046-ADC-ACS712-05B-currentmeter/sensor_0046_ADC_ACS712_05B_currentmeter.c index 7cb6d682a..5c450357f 100644 --- a/ezlopi-sensors-devices/sensor-0046-ADC-ACS712-05B-currentmeter/sensor_0046_ADC_ACS712_05B_currentmeter.c +++ b/ezlopi-sensors-devices/sensor-0046-ADC-ACS712-05B-currentmeter/sensor_0046_ADC_ACS712_05B_currentmeter.c @@ -22,13 +22,13 @@ typedef struct s_currentmeter float amp_value; } s_currentmeter_t; -static int __0046_prepare(void *arg); -static int __0046_init(l_ezlopi_item_t *item); -static int __0046_get_cjson_value(l_ezlopi_item_t *item, void *arg); -static int __0046_notify(l_ezlopi_item_t *item); -static void __calculate_current_value(l_ezlopi_item_t *item); +static int __0046_prepare(void* arg); +static int __0046_init(l_ezlopi_item_t* item); +static int __0046_get_cjson_value(l_ezlopi_item_t* item, void* arg); +static int __0046_notify(l_ezlopi_item_t* item); +static void __calculate_current_value(l_ezlopi_item_t* item); -int sensor_0046_ADC_ACS712_05B_currentmeter(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void *arg, void *user_arg) +int sensor_0046_ADC_ACS712_05B_currentmeter(e_ezlopi_actions_t action, l_ezlopi_item_t* item, void* arg, void* user_arg) { int ret = 0; switch (action) @@ -62,9 +62,9 @@ int sensor_0046_ADC_ACS712_05B_currentmeter(e_ezlopi_actions_t action, l_ezlopi_ return ret; } -static void __prepare_device_cloud_properties(l_ezlopi_device_t *device, cJSON *cj_device) +static void __prepare_device_cloud_properties(l_ezlopi_device_t* device, cJSON* cj_device) { - char *device_name = NULL; + char* device_name = NULL; CJSON_GET_VALUE_STRING(cj_device, "dev_name", device_name); ASSIGN_DEVICE_NAME_V2(device, device_name); device->cloud_properties.device_id = ezlopi_cloud_generate_device_id(); @@ -74,7 +74,7 @@ static void __prepare_device_cloud_properties(l_ezlopi_device_t *device, cJSON * device->cloud_properties.info = NULL; device->cloud_properties.device_type = dev_type_sensor; } -static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_device, void *user_data) +static void __prepare_item_cloud_properties(l_ezlopi_item_t* item, cJSON* cj_device, void* user_data) { item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); item->cloud_properties.has_getter = true; @@ -84,8 +84,8 @@ static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_dev item->cloud_properties.value_type = value_type_electric_current; item->cloud_properties.scale = scales_ampere; - CJSON_GET_VALUE_INT(cj_device, "dev_type", item->interface_type); // _max = 10 - CJSON_GET_VALUE_INT(cj_device, "gpio", item->interface.adc.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); // _max = 10 + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.adc.gpio_num); item->interface.adc.resln_bit = 3; // ADC 12_bit // passing the custom data_structure @@ -93,21 +93,21 @@ static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_dev } //---------------------------------------------------- -static int __0046_prepare(void *arg) +static int __0046_prepare(void* arg) { int ret = 0; - s_ezlopi_prep_arg_t *device_prep_arg = (s_ezlopi_prep_arg_t *)arg; + s_ezlopi_prep_arg_t* device_prep_arg = (s_ezlopi_prep_arg_t*)arg; if (device_prep_arg && (NULL != device_prep_arg->cjson_device)) { - s_currentmeter_t *user_data = (s_currentmeter_t *)malloc(sizeof(s_currentmeter_t)); + s_currentmeter_t* user_data = (s_currentmeter_t*)malloc(sizeof(s_currentmeter_t)); if (NULL != user_data) { memset(user_data, 0, sizeof(s_currentmeter_t)); - l_ezlopi_device_t *currentmeter_device = ezlopi_device_add_device(device_prep_arg->cjson_device); + l_ezlopi_device_t* currentmeter_device = ezlopi_device_add_device(device_prep_arg->cjson_device); if (currentmeter_device) { __prepare_device_cloud_properties(currentmeter_device, device_prep_arg->cjson_device); - l_ezlopi_item_t *currentmeter_item = ezlopi_device_add_item_to_device(currentmeter_device, sensor_0046_ADC_ACS712_05B_currentmeter); + l_ezlopi_item_t* currentmeter_item = ezlopi_device_add_item_to_device(currentmeter_device, sensor_0046_ADC_ACS712_05B_currentmeter); if (currentmeter_item) { __prepare_item_cloud_properties(currentmeter_item, device_prep_arg->cjson_device, user_data); @@ -130,7 +130,7 @@ static int __0046_prepare(void *arg) return ret; } -static int __0046_init(l_ezlopi_item_t *item) +static int __0046_init(l_ezlopi_item_t* item) { int ret = 0; if (item) @@ -153,29 +153,29 @@ static int __0046_init(l_ezlopi_item_t *item) return ret; } -static int __0046_get_cjson_value(l_ezlopi_item_t *item, void *arg) +static int __0046_get_cjson_value(l_ezlopi_item_t* item, void* arg) { int ret = 0; - cJSON *cjson_properties = (cJSON *)arg; + cJSON* cjson_properties = (cJSON*)arg; if (cjson_properties && item) { - s_currentmeter_t *user_data = (s_currentmeter_t *)item->user_arg; - char *valueFormatted = ezlopi_valueformatter_float(user_data->amp_value); - cJSON_AddStringToObject(cjson_properties, "valueFormatted", valueFormatted); - cJSON_AddNumberToObject(cjson_properties, "value", user_data->amp_value); // Irms [A] + s_currentmeter_t* user_data = (s_currentmeter_t*)item->user_arg; + char* valueFormatted = ezlopi_valueformatter_float(user_data->amp_value); + cJSON_AddStringToObject(cjson_properties, ezlopi_valueFormatted_str, valueFormatted); + cJSON_AddNumberToObject(cjson_properties, ezlopi_value_str, user_data->amp_value); // Irms [A] free(valueFormatted); ret = 1; } return ret; } -static int __0046_notify(l_ezlopi_item_t *item) +static int __0046_notify(l_ezlopi_item_t* item) { // During this calculation the system is polled for 20mS int ret = 0; if (item) { - s_currentmeter_t *user_data = (s_currentmeter_t *)item->user_arg; + s_currentmeter_t* user_data = (s_currentmeter_t*)item->user_arg; float prev_amp = user_data->amp_value; __calculate_current_value(item); // update amp if (fabs(user_data->amp_value - prev_amp) > 0.5) @@ -186,12 +186,12 @@ static int __0046_notify(l_ezlopi_item_t *item) return ret; } //-------------------------------------------------------------------------------------------------------------------------------------- -static void __calculate_current_value(l_ezlopi_item_t *item) +static void __calculate_current_value(l_ezlopi_item_t* item) { if (NULL != item) { - s_currentmeter_t *user_data = (s_currentmeter_t *)item->user_arg; - s_ezlopi_analog_data_t ezlopi_analog_data = {.value = 0, .voltage = 0}; + s_currentmeter_t* user_data = (s_currentmeter_t*)item->user_arg; + s_ezlopi_analog_data_t ezlopi_analog_data = { .value = 0, .voltage = 0 }; uint32_t period_dur = (1000000 / DEFAULT_AC_FREQUENCY); // 20000uS int Vnow = 0; diff --git a/ezlopi-sensors-devices/sensor-0047-other-HX711-loadcell/sensor_0047_other_HX711_loadcell.c b/ezlopi-sensors-devices/sensor-0047-other-HX711-loadcell/sensor_0047_other_HX711_loadcell.c index 89acff5cc..6b4fc8c69 100644 --- a/ezlopi-sensors-devices/sensor-0047-other-HX711-loadcell/sensor_0047_other_HX711_loadcell.c +++ b/ezlopi-sensors-devices/sensor-0047-other-HX711-loadcell/sensor_0047_other_HX711_loadcell.c @@ -110,10 +110,10 @@ static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_dev item->cloud_properties.scale = scales_kilo_gram; item->user_arg = user_data; - CJSON_GET_VALUE_INT(cj_device, "dev_type", item->interface_type); // _max = 10 - CJSON_GET_VALUE_INT(cj_device, "gpio1", user_data->HX711_SCK_pin); + CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); // _max = 10 + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio1_str, user_data->HX711_SCK_pin); TRACE_S("hx711_SCL_PIN: %d ", user_data->HX711_SCK_pin); - CJSON_GET_VALUE_INT(cj_device, "gpio2", user_data->HX711_DT_pin); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio2_str, user_data->HX711_DT_pin); TRACE_S("hx711_DT_PIN: %d ", user_data->HX711_DT_pin); } diff --git a/ezlopi-sensors-devices/sensor-0054-PWM-YFS201-flowmeter/sensor_0054_PWM_YFS201_flowmeter.c b/ezlopi-sensors-devices/sensor-0054-PWM-YFS201-flowmeter/sensor_0054_PWM_YFS201_flowmeter.c index 67511932c..4a01bb9de 100644 --- a/ezlopi-sensors-devices/sensor-0054-PWM-YFS201-flowmeter/sensor_0054_PWM_YFS201_flowmeter.c +++ b/ezlopi-sensors-devices/sensor-0054-PWM-YFS201-flowmeter/sensor_0054_PWM_YFS201_flowmeter.c @@ -112,7 +112,7 @@ static void __prepare_item_properties(l_ezlopi_item_t *item, cJSON *cj_device, v item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); // _max = 10 - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.pwm.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.pwm.gpio_num); // passing the custom data_structure item->user_arg = user_data; diff --git a/ezlopi-sensors-devices/sensor-0055-ADC-FlexResistor/sensor_0055_ADC_FlexResistor.c b/ezlopi-sensors-devices/sensor-0055-ADC-FlexResistor/sensor_0055_ADC_FlexResistor.c index a081aa090..05dbae15f 100644 --- a/ezlopi-sensors-devices/sensor-0055-ADC-FlexResistor/sensor_0055_ADC_FlexResistor.c +++ b/ezlopi-sensors-devices/sensor-0055-ADC-FlexResistor/sensor_0055_ADC_FlexResistor.c @@ -81,7 +81,7 @@ static void __prepare_item_adc_cloud_properties(l_ezlopi_item_t *item, cJSON *cj item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); // _max = 10 - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.adc.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.adc.gpio_num); item->interface.adc.resln_bit = 3; // ADC 12_bit // passing the custom data_structure diff --git a/ezlopi-sensors-devices/sensor-0056-ADC-Force-Sensitive-Resistor/sensor_0056_ADC_Force_Sensitive_Resistor.c b/ezlopi-sensors-devices/sensor-0056-ADC-Force-Sensitive-Resistor/sensor_0056_ADC_Force_Sensitive_Resistor.c index f3e385bfb..248da9ca3 100644 --- a/ezlopi-sensors-devices/sensor-0056-ADC-Force-Sensitive-Resistor/sensor_0056_ADC_Force_Sensitive_Resistor.c +++ b/ezlopi-sensors-devices/sensor-0056-ADC-Force-Sensitive-Resistor/sensor_0056_ADC_Force_Sensitive_Resistor.c @@ -81,7 +81,7 @@ static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_dev item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); // _max = 10 - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.adc.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.adc.gpio_num); item->interface.adc.resln_bit = 3; // ADC 12_bit // passing the custom data_structure diff --git a/ezlopi-sensors-devices/sensor-0060-digitalIn-vibration-detector/sensor_0060_digitalIn_vibration_detector.c b/ezlopi-sensors-devices/sensor-0060-digitalIn-vibration-detector/sensor_0060_digitalIn_vibration_detector.c index f229cd793..59b69afc6 100644 --- a/ezlopi-sensors-devices/sensor-0060-digitalIn-vibration-detector/sensor_0060_digitalIn_vibration_detector.c +++ b/ezlopi-sensors-devices/sensor-0060-digitalIn-vibration-detector/sensor_0060_digitalIn_vibration_detector.c @@ -93,7 +93,7 @@ static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_dev item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); // _max = 10 - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.gpio.gpio_in.gpio_num); CJSON_GET_VALUE_INT(cj_device, "logic_inv", item->interface.gpio.gpio_in.invert); item->interface.gpio.gpio_in.enable = true; diff --git a/ezlopi-sensors-devices/sensor-0061-digitalIn-reed-switch/sensor_0061_digitalIn_reed_switch.c b/ezlopi-sensors-devices/sensor-0061-digitalIn-reed-switch/sensor_0061_digitalIn_reed_switch.c index 686d7f564..65d8cf84f 100644 --- a/ezlopi-sensors-devices/sensor-0061-digitalIn-reed-switch/sensor_0061_digitalIn_reed_switch.c +++ b/ezlopi-sensors-devices/sensor-0061-digitalIn-reed-switch/sensor_0061_digitalIn_reed_switch.c @@ -89,7 +89,7 @@ static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_dev item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); // _max = 10 - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.gpio.gpio_in.gpio_num); CJSON_GET_VALUE_INT(cj_device, "logic_inv", item->interface.gpio.gpio_in.invert); item->interface.gpio.gpio_in.enable = true; diff --git a/ezlopi-sensors-devices/sensor-0065-digitalIn-float-switch/sensor_0065_digitalIn_float_switch.c b/ezlopi-sensors-devices/sensor-0065-digitalIn-float-switch/sensor_0065_digitalIn_float_switch.c index 0f36241c0..ecdc81e17 100644 --- a/ezlopi-sensors-devices/sensor-0065-digitalIn-float-switch/sensor_0065_digitalIn_float_switch.c +++ b/ezlopi-sensors-devices/sensor-0065-digitalIn-float-switch/sensor_0065_digitalIn_float_switch.c @@ -90,7 +90,7 @@ static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_dev item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); // _max = 10 - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_str, item->interface.gpio.gpio_in.gpio_num); CJSON_GET_VALUE_INT(cj_device, "logic_inv", item->interface.gpio.gpio_in.invert); item->interface.gpio.gpio_in.enable = true; diff --git a/ezlopi-sensors-devices/sensor-0066-other-R307-FingerPrint/CMakeLists.txt b/ezlopi-sensors-devices/sensor-0066-other-R307-FingerPrint/CMakeLists.txt index e79d01160..3cd30a5b1 100644 --- a/ezlopi-sensors-devices/sensor-0066-other-R307-FingerPrint/CMakeLists.txt +++ b/ezlopi-sensors-devices/sensor-0066-other-R307-FingerPrint/CMakeLists.txt @@ -5,6 +5,7 @@ idf_component_register(SRCS "sensor_0066_other_R307_FingerPrint.c" "R307_AS606.c driver freertos esp_timer + ezlopi-core-timer ezlopi-core-cloud ezlopi-core-actions diff --git a/ezlopi-sensors-devices/sensor-0066-other-R307-FingerPrint/sensor_0066_other_R307_FingerPrint.c b/ezlopi-sensors-devices/sensor-0066-other-R307-FingerPrint/sensor_0066_other_R307_FingerPrint.c index 41f34b114..8e841a718 100644 --- a/ezlopi-sensors-devices/sensor-0066-other-R307-FingerPrint/sensor_0066_other_R307_FingerPrint.c +++ b/ezlopi-sensors-devices/sensor-0066-other-R307-FingerPrint/sensor_0066_other_R307_FingerPrint.c @@ -187,9 +187,9 @@ static void __prepare_item_interface_properties(l_ezlopi_item_t *item, cJSON *cj server_packet_t *user_data = (server_packet_t *)item->user_arg; if (user_data->sensor_fp_item_ids[SENSOR_FP_ITEM_ID_ENROLL] == item->cloud_properties.item_id) // while initialization; setup only once (during Match item setup) { - CJSON_GET_VALUE_INT(cj_device, "gpio1", item->interface.uart.tx); - CJSON_GET_VALUE_INT(cj_device, "gpio2", item->interface.uart.rx); - CJSON_GET_VALUE_INT(cj_device, "gpio3", user_data->intr_pin); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio1_str, item->interface.uart.tx); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio2_str, item->interface.uart.rx); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio3_str, user_data->intr_pin); item->interface.uart.baudrate = FINGERPRINT_UART_BAUDRATE; item->interface.uart.enable = true; } diff --git a/ezlopi-sensors-devices/sensor-0067-UART-hilink-presence-sensor/sensor_0067_hilink_presence_sensor.c b/ezlopi-sensors-devices/sensor-0067-UART-hilink-presence-sensor/sensor_0067_hilink_presence_sensor.c index f5523347f..4dc98872c 100644 --- a/ezlopi-sensors-devices/sensor-0067-UART-hilink-presence-sensor/sensor_0067_hilink_presence_sensor.c +++ b/ezlopi-sensors-devices/sensor-0067-UART-hilink-presence-sensor/sensor_0067_hilink_presence_sensor.c @@ -14,24 +14,24 @@ #include "sensor_0067_hilink_presence_sensor.h" #include "hilink_presence_sensor_setting.h" -static const char *hilink_presence_sensor_motion_direction_enum[] = { +static const char* hilink_presence_sensor_motion_direction_enum[] = { "unknown", "no_motion", "incoming", "outgoing", }; -static l_ezlopi_item_t *motion_item; -static l_ezlopi_item_t *motion_direction_item; -static l_ezlopi_item_t *distance_item; +static l_ezlopi_item_t* motion_item; +static l_ezlopi_item_t* motion_direction_item; +static l_ezlopi_item_t* distance_item; -static int __prepare(void *arg, void *user_arg); -static int __init(l_ezlopi_item_t *item); -static int __get_hub_item_value(l_ezlopi_item_t *item, void *args); -static int __get_cjson_value(l_ezlopi_item_t *item, void *args); -static int __notify(l_ezlopi_item_t *item); +static int __prepare(void* arg, void* user_arg); +static int __init(l_ezlopi_item_t* item); +static int __get_hub_item_value(l_ezlopi_item_t* item, void* args); +static int __get_cjson_value(l_ezlopi_item_t* item, void* args); +static int __notify(l_ezlopi_item_t* item); -int sensor_0067_hilink_presence_sensor_v3(e_ezlopi_actions_t action, l_ezlopi_item_t *item, void *arg, void *user_arg) +int sensor_0067_hilink_presence_sensor_v3(e_ezlopi_actions_t action, l_ezlopi_item_t* item, void* arg, void* user_arg) { int ret = 0; switch (action) @@ -69,7 +69,7 @@ int sensor_0067_hilink_presence_sensor_v3(e_ezlopi_actions_t action, l_ezlopi_it return ret; } -static void __notify_if_needed(ld2410_outputs_t *hilink_data, ld2410_outputs_t *present_hilink_data) +static void __notify_if_needed(ld2410_outputs_t* hilink_data, ld2410_outputs_t* present_hilink_data) { // Update specific item to the cloud only when the target's value is changed, else continue. if (hilink_data->direction != present_hilink_data->direction) @@ -89,11 +89,11 @@ static void __notify_if_needed(ld2410_outputs_t *hilink_data, ld2410_outputs_t * } } -static int __notify(l_ezlopi_item_t *item) +static int __notify(l_ezlopi_item_t* item) { int ret = 0; static int sec_count = 0; - ld2410_outputs_t *hilink_data = (ld2410_outputs_t *)item->user_arg; + ld2410_outputs_t* hilink_data = (ld2410_outputs_t*)item->user_arg; if (hilink_data) { ld2410_outputs_t present_hilink_data; @@ -133,12 +133,12 @@ static int __notify(l_ezlopi_item_t *item) return ret; } -static int __add_array_to_object(cJSON *cj_params, const char *const *arr, const int count) +static int __add_array_to_object(cJSON* cj_params, const char* const* arr, const int count) { int ret = 0; if (cj_params && arr) { - cJSON *enum_array = cJSON_CreateStringArray(arr, count); + cJSON* enum_array = cJSON_CreateStringArray(arr, count); cJSON_AddItemToObject(cj_params, "enum", enum_array); TRACE_I("%s", cJSON_Print(cj_params)); } @@ -149,10 +149,10 @@ static int __add_array_to_object(cJSON *cj_params, const char *const *arr, const return ret; } -static int __add_value_to_cjson(l_ezlopi_item_t *item, cJSON *cj_params, bool is_hub_request) +static int __add_value_to_cjson(l_ezlopi_item_t* item, cJSON* cj_params, bool is_hub_request) { int ret = 0; - ld2410_outputs_t *hilink_data = (ld2410_outputs_t *)item->user_arg; + ld2410_outputs_t* hilink_data = (ld2410_outputs_t*)item->user_arg; if (item && cj_params && hilink_data) { @@ -163,8 +163,8 @@ static int __add_value_to_cjson(l_ezlopi_item_t *item, cJSON *cj_params, bool is { motion = true; } - cJSON_AddBoolToObject(cj_params, "valueFormatted", motion); - cJSON_AddBoolToObject(cj_params, "value", motion); + cJSON_AddBoolToObject(cj_params, ezlopi_valueFormatted_str, motion); + cJSON_AddBoolToObject(cj_params, ezlopi_value_str, motion); } if (ezlopi_item_name_motion_direction == item->cloud_properties.item_name) { @@ -172,24 +172,24 @@ static int __add_value_to_cjson(l_ezlopi_item_t *item, cJSON *cj_params, bool is { ESP_ERROR_CHECK(__add_array_to_object(cj_params, hilink_presence_sensor_motion_direction_enum, 4)); } - cJSON_AddStringToObject(cj_params, "valueFormatted", hilink_presence_sensor_motion_direction_enum[hilink_data->direction + 1]); - cJSON_AddStringToObject(cj_params, "value", hilink_presence_sensor_motion_direction_enum[hilink_data->direction + 1]); + cJSON_AddStringToObject(cj_params, ezlopi_valueFormatted_str, hilink_presence_sensor_motion_direction_enum[hilink_data->direction + 1]); + cJSON_AddStringToObject(cj_params, ezlopi_value_str, hilink_presence_sensor_motion_direction_enum[hilink_data->direction + 1]); } if (ezlopi_item_name_distance == item->cloud_properties.item_name) { - cJSON_AddNumberToObject(cj_params, "valueFormatted", hilink_data->moving_target_distance); - cJSON_AddNumberToObject(cj_params, "value", hilink_data->moving_target_distance); + cJSON_AddNumberToObject(cj_params, ezlopi_valueFormatted_str, hilink_data->moving_target_distance); + cJSON_AddNumberToObject(cj_params, ezlopi_value_str, hilink_data->moving_target_distance); } } return ret; } -static int __get_hub_item_value(l_ezlopi_item_t *item, void *args) +static int __get_hub_item_value(l_ezlopi_item_t* item, void* args) { int ret = 0; - cJSON *cj_params = (cJSON *)args; + cJSON* cj_params = (cJSON*)args; if (cj_params) { ESP_ERROR_CHECK(__add_value_to_cjson(item, cj_params, true)); @@ -202,11 +202,11 @@ static int __get_hub_item_value(l_ezlopi_item_t *item, void *args) return ret; } -static int __get_cjson_value(l_ezlopi_item_t *item, void *args) +static int __get_cjson_value(l_ezlopi_item_t* item, void* args) { int ret = 0; - cJSON *cj_params = (cJSON *)args; + cJSON* cj_params = (cJSON*)args; if (cj_params) { @@ -220,12 +220,12 @@ static int __get_cjson_value(l_ezlopi_item_t *item, void *args) return ret; } -static int __init(l_ezlopi_item_t *item) +static int __init(l_ezlopi_item_t* item) { int ret = 0; if (item) { - ld2410_outputs_t *hilink_data = (ld2410_outputs_t *)item->user_arg; + ld2410_outputs_t* hilink_data = (ld2410_outputs_t*)item->user_arg; if (item->interface.uart.enable && hilink_data) { s_ezlopi_uart_t uart_settings = { @@ -262,7 +262,7 @@ static int __init(l_ezlopi_item_t *item) return ret; } -static void __perare_hilink_device_cloud_properties(l_ezlopi_device_t *device) +static void __perare_hilink_device_cloud_properties(l_ezlopi_device_t* device) { device->cloud_properties.category = category_security_sensor; device->cloud_properties.subcategory = subcategory_motion; @@ -271,7 +271,7 @@ static void __perare_hilink_device_cloud_properties(l_ezlopi_device_t *device) device->cloud_properties.parent_device_id = device->cloud_properties.device_id; } -static void __prepare_hilink_motion_item_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_properties, void *user_args) +static void __prepare_hilink_motion_item_cloud_properties(l_ezlopi_item_t* item, cJSON* cj_properties, void* user_args) { item->cloud_properties.has_getter = true; item->cloud_properties.has_setter = false; @@ -285,14 +285,14 @@ static void __prepare_hilink_motion_item_cloud_properties(l_ezlopi_item_t *item, item->interface.uart.enable = true; item->interface.uart.channel = 0; - CJSON_GET_VALUE_INT(cj_properties, "baudrate", item->interface.uart.baudrate); - CJSON_GET_VALUE_INT(cj_properties, "tx", item->interface.uart.tx); - CJSON_GET_VALUE_INT(cj_properties, "rx", item->interface.uart.rx); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_baud_str, item->interface.uart.baudrate); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio_tx_str, item->interface.uart.tx); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio_rx_str, item->interface.uart.rx); item->user_arg = user_args; } -static void __prepare_hilink_motion_direction_item_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_properties, void *user_arg) +static void __prepare_hilink_motion_direction_item_cloud_properties(l_ezlopi_item_t* item, cJSON* cj_properties, void* user_arg) { item->cloud_properties.has_getter = true; item->cloud_properties.has_setter = false; @@ -306,14 +306,14 @@ static void __prepare_hilink_motion_direction_item_cloud_properties(l_ezlopi_ite item->interface.uart.enable = false; item->interface.uart.channel = 0; - CJSON_GET_VALUE_INT(cj_properties, "baudrate", item->interface.uart.baudrate); - CJSON_GET_VALUE_INT(cj_properties, "tx", item->interface.uart.tx); - CJSON_GET_VALUE_INT(cj_properties, "rx", item->interface.uart.rx); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_baud_str, item->interface.uart.baudrate); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio_tx_str, item->interface.uart.tx); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio_rx_str, item->interface.uart.rx); item->user_arg = user_arg; } -static void __prepare_hilink_distance_item_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_properties, void *user_arg) +static void __prepare_hilink_distance_item_cloud_properties(l_ezlopi_item_t* item, cJSON* cj_properties, void* user_arg) { item->cloud_properties.has_getter = true; item->cloud_properties.has_setter = false; @@ -327,23 +327,23 @@ static void __prepare_hilink_distance_item_cloud_properties(l_ezlopi_item_t *ite item->interface.uart.enable = false; item->interface.uart.channel = 0; - CJSON_GET_VALUE_INT(cj_properties, "baudrate", item->interface.uart.baudrate); - CJSON_GET_VALUE_INT(cj_properties, "tx", item->interface.uart.tx); - CJSON_GET_VALUE_INT(cj_properties, "rx", item->interface.uart.rx); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_baud_str, item->interface.uart.baudrate); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio_tx_str, item->interface.uart.tx); + CJSON_GET_VALUE_INT(cj_properties, ezlopi_gpio_rx_str, item->interface.uart.rx); item->user_arg = user_arg; } -static int __prepare(void *arg, void *user_arg) +static int __prepare(void* arg, void* user_arg) { int ret = 0; - s_ezlopi_prep_arg_t *prep_arg = (s_ezlopi_prep_arg_t *)arg; + s_ezlopi_prep_arg_t* prep_arg = (s_ezlopi_prep_arg_t*)arg; if (prep_arg) { - ld2410_outputs_t *hilink_data = (ld2410_outputs_t *)malloc(sizeof(ld2410_outputs_t)); + ld2410_outputs_t* hilink_data = (ld2410_outputs_t*)malloc(sizeof(ld2410_outputs_t)); if (hilink_data) { - l_ezlopi_device_t *hilink_device = ezlopi_device_add_device(prep_arg->cjson_device); + l_ezlopi_device_t* hilink_device = ezlopi_device_add_device(prep_arg->cjson_device); if (hilink_device) { memset(hilink_data, 0, sizeof(ld2410_outputs_t)); @@ -352,18 +352,18 @@ static int __prepare(void *arg, void *user_arg) motion_item = ezlopi_device_add_item_to_device(hilink_device, sensor_0067_hilink_presence_sensor_v3); if (motion_item) { - __prepare_hilink_motion_item_cloud_properties(motion_item, prep_arg->cjson_device, (void *)hilink_data); + __prepare_hilink_motion_item_cloud_properties(motion_item, prep_arg->cjson_device, (void*)hilink_data); } motion_direction_item = ezlopi_device_add_item_to_device(hilink_device, sensor_0067_hilink_presence_sensor_v3); if (motion_direction_item) { - __prepare_hilink_motion_direction_item_cloud_properties(motion_direction_item, prep_arg->cjson_device, (void *)hilink_data); + __prepare_hilink_motion_direction_item_cloud_properties(motion_direction_item, prep_arg->cjson_device, (void*)hilink_data); } distance_item = ezlopi_device_add_item_to_device(hilink_device, sensor_0067_hilink_presence_sensor_v3); if (distance_item) { - __prepare_hilink_distance_item_cloud_properties(distance_item, prep_arg->cjson_device, (void *)hilink_data); + __prepare_hilink_distance_item_cloud_properties(distance_item, prep_arg->cjson_device, (void*)hilink_data); } if (!motion_item && !motion_direction_item && !distance_item) { diff --git a/ezlopi-sensors-devices/sensor-0068-I2C-ENS160-gas-sensor/sensor_0068_ENS160_gas_sensor.c b/ezlopi-sensors-devices/sensor-0068-I2C-ENS160-gas-sensor/sensor_0068_ENS160_gas_sensor.c index f1b89a6fe..4b1bff128 100644 --- a/ezlopi-sensors-devices/sensor-0068-I2C-ENS160-gas-sensor/sensor_0068_ENS160_gas_sensor.c +++ b/ezlopi-sensors-devices/sensor-0068-I2C-ENS160-gas-sensor/sensor_0068_ENS160_gas_sensor.c @@ -11,6 +11,7 @@ #include "ezlopi_hal_i2c_master.h" +#include "ezlopi_cloud_keywords.h" #include "ezlopi_cloud_category_str.h" #include "ezlopi_cloud_subcategory_str.h" #include "ezlopi_cloud_device_types_str.h" @@ -208,7 +209,7 @@ static void __prepare_ens160_gas_sensor_device_cloud_properties(l_ezlopi_device_ static void __prepare_item_cloud_properties(l_ezlopi_item_t* item, cJSON* cj_device, void* user_arg) { - CJSON_GET_VALUE_INT(cj_device, "dev_type", item->interface_type); + CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); item->cloud_properties.has_getter = true; item->cloud_properties.has_setter = false; @@ -216,8 +217,8 @@ static void __prepare_item_cloud_properties(l_ezlopi_item_t* item, cJSON* cj_dev item->user_arg = user_arg; item->interface.i2c_master.clock_speed = ENS160_I2C_SPEED; - CJSON_GET_VALUE_INT(cj_device, "gpio_scl", item->interface.i2c_master.scl); - CJSON_GET_VALUE_INT(cj_device, "gpio_sda", item->interface.i2c_master.sda); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_scl_str, item->interface.i2c_master.scl); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_sda_str, item->interface.i2c_master.sda); item->interface.i2c_master.channel = I2C_NUM_0; item->interface.i2c_master.address = ENS160_I2C_ADDRESS; item->interface.i2c_master.enable = false; diff --git a/ezlopi-sensors-devices/sensor-0069-UART-ze08-ch02-gas-sensor/sensor_0069_ze08_ch02_gas_sensor.c b/ezlopi-sensors-devices/sensor-0069-UART-ze08-ch02-gas-sensor/sensor_0069_ze08_ch02_gas_sensor.c index c1a90e90c..c877e423a 100644 --- a/ezlopi-sensors-devices/sensor-0069-UART-ze08-ch02-gas-sensor/sensor_0069_ze08_ch02_gas_sensor.c +++ b/ezlopi-sensors-devices/sensor-0069-UART-ze08-ch02-gas-sensor/sensor_0069_ze08_ch02_gas_sensor.c @@ -149,9 +149,9 @@ static void __prepare_ze08_ch2o_sensor_ppm_item_cloud_properties(l_ezlopi_item_t item->cloud_properties.value_type = value_type_substance_amount; item->cloud_properties.scale = scales_parts_per_million; - CJSON_GET_VALUE_INT(cj_device, "gpio_tx", item->interface.uart.tx); - CJSON_GET_VALUE_INT(cj_device, "gpio_rx", item->interface.uart.rx); - CJSON_GET_VALUE_INT(cj_device, "baud", item->interface.uart.baudrate); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_tx_str, item->interface.uart.tx); + CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_rx_str, item->interface.uart.rx); + CJSON_GET_VALUE_INT(cj_device,ezlopi_baud_str, item->interface.uart.baudrate); item->interface.uart.enable = true; item->user_arg = user_arg; diff --git a/sdkconfig b/sdkconfig index 6099d5962..4c9824471 100644 --- a/sdkconfig +++ b/sdkconfig @@ -265,7 +265,6 @@ CONFIG_BT_CTRL_SLEEP_CLOCK_EFF=0 CONFIG_BT_CTRL_HCI_TL_EFF=1 # CONFIG_BT_CTRL_AGC_RECORRECT_EN is not set # CONFIG_BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX is not set -# CONFIG_BT_BLE_ADV_DATA_LENGTH_ZERO_AUX is not set # end of Bluetooth controller CONFIG_BT_BLUEDROID_ENABLED=y @@ -845,7 +844,6 @@ CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y # CONFIG_ESP_PANIC_HANDLER_IRAM is not set # CONFIG_ESP_DEBUG_STUBS_ENABLE is not set CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y -CONFIG_ESP_SYSTEM_BBPLL_RECALIB=y # end of ESP System Settings # @@ -871,10 +869,6 @@ CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8 CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=16 -CONFIG_ESP_WIFI_STATIC_RX_MGMT_BUFFER=y -# CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUFFER is not set -CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0 -CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF=5 # CONFIG_ESP32_WIFI_CSI_ENABLED is not set CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y CONFIG_ESP32_WIFI_TX_BA_WIN=6 @@ -1088,7 +1082,6 @@ CONFIG_LWIP_SO_REUSE=y CONFIG_LWIP_SO_REUSE_RXTOALL=y # CONFIG_LWIP_SO_RCVBUF is not set # CONFIG_LWIP_NETBUF_RECVINFO is not set -CONFIG_LWIP_IP_DEFAULT_TTL=64 CONFIG_LWIP_IP4_FRAG=y CONFIG_LWIP_IP6_FRAG=y # CONFIG_LWIP_IP4_REASSEMBLY is not set @@ -1141,8 +1134,6 @@ CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744 CONFIG_LWIP_TCP_WND_DEFAULT=5744 CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 CONFIG_LWIP_TCP_QUEUE_OOSEQ=y -CONFIG_LWIP_TCP_OOSEQ_TIMEOUT=6 -CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=4 # CONFIG_LWIP_TCP_SACK_OUT is not set # CONFIG_LWIP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set CONFIG_LWIP_TCP_OVERSIZE_MSS=y diff --git a/sdkconfig.esp32.4mb b/sdkconfig.esp32.4mb index 73c136805..88183b5de 100644 --- a/sdkconfig.esp32.4mb +++ b/sdkconfig.esp32.4mb @@ -93,8 +93,8 @@ CONFIG_ESPTOOLPY_FLASHFREQ_40M=y CONFIG_ESPTOOLPY_FLASHFREQ="40m" # CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set From 8740a7384e085a24aec51baab97d7b2b08078254 Mon Sep 17 00:00:00 2001 From: NDJ-Ezlo Date: Fri, 23 Feb 2024 18:11:13 +0545 Subject: [PATCH 15/27] Confirmed working of run scene with id and run scene with id and else --- .../ezlopi_core_factory_info.h | 17 ++++++++++++----- ezlopi-user-config/EZLOPI_USER_CONFIG.h | 1 + 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ezlopi-core/ezlopi-core-factory-info/ezlopi_core_factory_info.h b/ezlopi-core/ezlopi-core-factory-info/ezlopi_core_factory_info.h index bba08fbbf..0a11fb826 100644 --- a/ezlopi-core/ezlopi-core-factory-info/ezlopi_core_factory_info.h +++ b/ezlopi-core/ezlopi-core-factory-info/ezlopi_core_factory_info.h @@ -160,12 +160,19 @@ extern "C" \"dev_detail\":\ [\ {\ - \"dev_type\":8,\ - \"dev_name\":\"ENS160\",\ + \"dev_type\": 1,\ + \"dev_name\": \"Dining Room Main Lamp\",\ \"id_room\":\"\",\ - \"id_item\":68,\ - \"gpio_scl\":17,\ - \"gpio_sda\":18\ + \"id_item\": 2,\ + \"val_ip\": false,\ + \"val_op\": false,\ + \"gpio_in\": 21,\ + \"gpio_out\": 13,\ + \"is_ip\": false,\ + \"ip_inv\": true,\ + \"pullup_ip\": true,\ + \"pullup_op\": true,\ + \"op_inv\": false\ }\ ],\ \"dev_total\": 1}"; diff --git a/ezlopi-user-config/EZLOPI_USER_CONFIG.h b/ezlopi-user-config/EZLOPI_USER_CONFIG.h index d6d674cf5..2b869126e 100644 --- a/ezlopi-user-config/EZLOPI_USER_CONFIG.h +++ b/ezlopi-user-config/EZLOPI_USER_CONFIG.h @@ -31,6 +31,7 @@ #undef EZPI_USR_CONFIG_ENABLE_HEARTBIT_LED #undef EZPI_CORE_ENABLE_ETH +#undef EZPI_DEV_TYPE_GENERIC // #undef EZPI_SERV_ENABLE_MESHBOTS // #undef EZPI_UTIL_ENABLE_TRACE From bdea0566d397ee92b753f002ed0f73fc6ea20b18 Mon Sep 17 00:00:00 2001 From: lomasSE89 Date: Sat, 24 Feb 2024 02:45:45 +0545 Subject: [PATCH 16/27] https://jira.mios.com/browse/EZPI-316 --- .../ezlopi-core-wifi/ezlopi_core_wifi.c | 58 ++------- .../ezlopi-core-wifi/ezlopi_core_wifi.h | 1 - .../ezlopi-service-uart/ezlopi_service_uart.c | 114 +++++++++--------- sdkconfig.esp32s3.4mb | 24 ++-- sdkconfig.old | 2 +- 5 files changed, 82 insertions(+), 117 deletions(-) diff --git a/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.c b/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.c index 78ea87e56..43d85eddf 100644 --- a/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.c +++ b/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.c @@ -36,9 +36,9 @@ static esp_netif_t* wifi_sta_netif = NULL; static esp_netif_ip_info_t my_ip; -static uint32_t new_wifi = 0; +// static uint32_t new_wifi = 0; static int s_retry_num = 0; -static char wifi_ssid_pass_global_buffer[64]; +// static char wifi_ssid_pass_global_buffer[EZLOPI_FINFO_LEN_WIFI_SSID + EZLOPI_FINFO_LEN_WIFI_PASS]; static int station_got_ip = 0; static const char* const wifi_no_error_str = "NO_ERROR"; static const char* last_disconnect_reason = wifi_no_error_str; @@ -92,10 +92,10 @@ int ezlopi_wifi_got_ip(void) return station_got_ip; } -void ezlopi_wifi_set_new_wifi_flag(void) -{ - new_wifi = 1; -} +// void ezlopi_wifi_set_new_wifi_flag(void) +// { +// new_wifi = 1; +// } ezlopi_wifi_status_t* ezlopi_wifi_status(void) { @@ -270,8 +270,6 @@ static void __event_handler(void* arg, esp_event_base_t event_base, int32_t even memcpy(&my_ip, &event->ip_info, sizeof(esp_netif_ip_info_t)); ezlopi_event_group_set_event(EZLOPI_EVENT_WIFI_CONNECTED); ezlopi_flag_wifi_status = true; - - // alert_qt_wifi_got_ip(); } ll_ezlopi_wifi_event_upcall_t* curr_upcall = __event_upcall_head; @@ -308,42 +306,13 @@ void ezlopi_wifi_connect_from_id_bin(void) { char* wifi_ssid = ezlopi_factory_info_v3_get_ssid(); char* wifi_password = ezlopi_factory_info_v3_get_password(); - ezlopi_wifi_set_new_wifi_flag(); if ((NULL != wifi_ssid) && ('\0' != wifi_ssid[0]) && (NULL != wifi_password) && ('\0' != wifi_password[0])) { - memset(wifi_ssid_pass_global_buffer, 0, sizeof(wifi_ssid_pass_global_buffer)); - snprintf(&wifi_ssid_pass_global_buffer[00], 31, "%s", wifi_ssid); - snprintf(&wifi_ssid_pass_global_buffer[32], 31, "%s", wifi_password); - } - else - { - strcpy(&wifi_ssid_pass_global_buffer[00], "ezlopitest"); - strcpy(&wifi_ssid_pass_global_buffer[32], "ezlopitest"); - } - - ezlopi_factory_info_v3_free(wifi_ssid); - ezlopi_factory_info_v3_free(wifi_password); - - esp_err_t wifi_error = ezlopi_wifi_connect(&wifi_ssid_pass_global_buffer[0], &wifi_ssid_pass_global_buffer[32]); - TRACE_W("wifi_error: %u", wifi_error); -} - -void ezlopi_wifi_connect_from_nvs(void) -{ - memset(wifi_ssid_pass_global_buffer, 0, sizeof(wifi_ssid_pass_global_buffer)); - ezlopi_nvs_read_wifi(wifi_ssid_pass_global_buffer, sizeof(wifi_ssid_pass_global_buffer)); - - if (wifi_ssid_pass_global_buffer[0] == 0) - { - strcpy(&wifi_ssid_pass_global_buffer[00], "ezlopitest"); - strcpy(&wifi_ssid_pass_global_buffer[32], "ezlopitest"); - ezlopi_wifi_set_new_wifi_flag(); + esp_err_t wifi_error = ezlopi_wifi_connect(wifi_ssid, wifi_password); + TRACE_W("wifi_error: %u", wifi_error); } - - esp_err_t wifi_error = ezlopi_wifi_connect(&wifi_ssid_pass_global_buffer[0], &wifi_ssid_pass_global_buffer[32]); - TRACE_W("wifi_error: %u", wifi_error); } esp_err_t ezlopi_wifi_connect(const char* ssid, const char* pass) @@ -352,13 +321,6 @@ esp_err_t ezlopi_wifi_connect(const char* ssid, const char* pass) if ((NULL != ssid) && (NULL != pass)) { - if ((0 != strncmp(ssid, &wifi_ssid_pass_global_buffer[0], 32)) || ((0 != strncmp(pass, &wifi_ssid_pass_global_buffer[32], 32)))) - { - ezlopi_wifi_set_new_wifi_flag(); - strncpy((char*)&wifi_ssid_pass_global_buffer[0], ssid, 32); - strncpy((char*)&wifi_ssid_pass_global_buffer[32], pass, 32); - } - TRACE_D("SSID: %s, Password: %s,\r\n", ssid, pass); wifi_config_t wifi_config = { @@ -371,6 +333,10 @@ esp_err_t ezlopi_wifi_connect(const char* ssid, const char* pass) strncpy((char*)wifi_config.sta.password, pass, sizeof(wifi_config.sta.password)); wifi_config.sta.threshold.authmode = WIFI_AUTH_WPA2_PSK; + + ezlopi_factory_info_v3_free(ssid); + ezlopi_factory_info_v3_free(pass); + esp_wifi_stop(); esp_err_t _err = esp_wifi_set_mode(WIFI_MODE_STA); // TRACE_W("WiFi Err : %s", esp_err_to_name(_err)); diff --git a/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.h b/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.h index f26532e2e..b74bad8bc 100644 --- a/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.h +++ b/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.h @@ -30,7 +30,6 @@ extern "C" void ezlopi_wifi_set_new_wifi_flag(void); void ezlopi_wifi_initialize(void); esp_err_t ezlopi_wifi_connect(const char* ssid, const char* pass); - void ezlopi_wifi_connect_from_nvs(void); void ezlopi_wifi_connect_from_id_bin(void); int ezlopi_wait_for_wifi_to_connect(uint32_t wait_time_ms); esp_netif_ip_info_t* ezlopi_wifi_get_ip_infos(void); diff --git a/ezlopi-services/ezlopi-service-uart/ezlopi_service_uart.c b/ezlopi-services/ezlopi-service-uart/ezlopi_service_uart.c index 41ff66ac2..c44e08a52 100644 --- a/ezlopi-services/ezlopi-service-uart/ezlopi_service_uart.c +++ b/ezlopi-services/ezlopi-service-uart/ezlopi_service_uart.c @@ -50,12 +50,12 @@ static const int RX_BUF_SIZE = 3096; // cJson Types static void ezlopi_service_uart_get_info(); -static void ezlopi_service_uart_set_wifi(const char *data); +static void ezlopi_service_uart_set_wifi(const char* data); static void ezlopi_service_uart_response(uint8_t cmd, uint8_t status_write, uint8_t status_connect); -static void ezlopi_service_uart_save_config(const char *data); +static void ezlopi_service_uart_save_config(const char* data); static void ezlopi_service_uart_read_config(void); -int EZPI_SERVICE_uart_tx_data(int len, uint8_t *data) +int EZPI_SERVICE_uart_tx_data(int len, uint8_t* data) { int ret = 0; // char start_bytes[] = {0x80, '\r', '\n'}; @@ -82,7 +82,7 @@ static void serial_init(void) uart_set_pin(UART_NUM_0, TXD_PIN, RXD_PIN, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE); } -static char *ezlopi_esp_reset_reason_str(esp_reset_reason_t reason) +static char* ezlopi_esp_reset_reason_str(esp_reset_reason_t reason) { switch (reason) { @@ -125,7 +125,7 @@ static char *ezlopi_esp_reset_reason_str(esp_reset_reason_t reason) } } -static char *ezlopi_chip_type_str(int chip_type) +static char* ezlopi_chip_type_str(int chip_type) { switch (chip_type) { @@ -158,16 +158,16 @@ static int ezlopi_service_uart_execute_command_0(uint8_t sub_cmd) case 0: { TRACE_E("Factory restore command"); - const static char *reboot_response = "{\"cmd\":0, \"sub_cmd\":0,\"status\":1}"; - EZPI_SERVICE_uart_tx_data(strlen(reboot_response), (uint8_t *)reboot_response); + const static char* reboot_response = "{\"cmd\":0, \"sub_cmd\":0,\"status\":1}"; + EZPI_SERVICE_uart_tx_data(strlen(reboot_response), (uint8_t*)reboot_response); EZPI_CORE_factory_restore(); break; } case 1: { TRACE_E("Reboot only command"); - const static char *reboot_response = "{\"cmd\":0, \"sub_cmd\":1, \"status\":1}"; - EZPI_SERVICE_uart_tx_data(strlen(reboot_response), (uint8_t *)reboot_response); + const static char* reboot_response = "{\"cmd\":0, \"sub_cmd\":1, \"status\":1}"; + EZPI_SERVICE_uart_tx_data(strlen(reboot_response), (uint8_t*)reboot_response); EZPI_CORE_reboot(); break; } @@ -179,9 +179,9 @@ static int ezlopi_service_uart_execute_command_0(uint8_t sub_cmd) return ret; } -static int qt_serial_parse_rx_data(const char *data) +static int qt_serial_parse_rx_data(const char* data) { - cJSON *root = cJSON_Parse(data); + cJSON* root = cJSON_Parse(data); if (root) { @@ -239,11 +239,11 @@ static int qt_serial_parse_rx_data(const char *data) return 1; } -static void ezlopi_service_uart_rx_task(void *arg) +static void ezlopi_service_uart_rx_task(void* arg) { - static const char *RX_TASK_TAG = "RX_TASK"; + static const char* RX_TASK_TAG = "RX_TASK"; esp_log_level_set(RX_TASK_TAG, ESP_LOG_INFO); - uint8_t *data = (uint8_t *)malloc(RX_BUF_SIZE + 1); + uint8_t* data = (uint8_t*)malloc(RX_BUF_SIZE + 1); memset(data, 0, RX_BUF_SIZE + 1); while (1) @@ -254,7 +254,7 @@ static void ezlopi_service_uart_rx_task(void *arg) { data[rxBytes] = 0; TRACE_I("%s", data); - qt_serial_parse_rx_data((const char *)data); + qt_serial_parse_rx_data((const char*)data); } } @@ -264,26 +264,26 @@ static void ezlopi_service_uart_rx_task(void *arg) static void ezlopi_service_uart_get_info() { - cJSON *get_info = cJSON_CreateObject(); + cJSON* get_info = cJSON_CreateObject(); if (get_info) { unsigned long long serial_id = ezlopi_factory_info_v3_get_id(); - char *controller_uuid = ezlopi_factory_info_v3_get_device_uuid(); - char *provisioning_uuid = ezlopi_factory_info_v3_get_provisioning_uuid(); - char *device_model = ezlopi_factory_info_v3_get_model(); - char *device_brand = ezlopi_factory_info_v3_get_brand(); - char *device_manufacturer = ezlopi_factory_info_v3_get_manufacturer(); - char *device_name = ezlopi_factory_info_v3_get_name(); - char *device_type = ezlopi_factory_info_v3_get_device_type(); - char *device_mac = ezlopi_factory_info_v3_get_ezlopi_mac(); - char *wifi_ssid = ezlopi_factory_info_v3_get_ssid(); + char* controller_uuid = ezlopi_factory_info_v3_get_device_uuid(); + char* provisioning_uuid = ezlopi_factory_info_v3_get_provisioning_uuid(); + char* device_model = ezlopi_factory_info_v3_get_model(); + char* device_brand = ezlopi_factory_info_v3_get_brand(); + char* device_manufacturer = ezlopi_factory_info_v3_get_manufacturer(); + char* device_name = ezlopi_factory_info_v3_get_name(); + char* device_type = ezlopi_factory_info_v3_get_device_type(); + char* device_mac = ezlopi_factory_info_v3_get_ezlopi_mac(); + char* wifi_ssid = ezlopi_factory_info_v3_get_ssid(); cJSON_AddNumberToObject(get_info, "cmd", 1); cJSON_AddStringToObject(get_info, "firmware_version", VERSION_STR); cJSON_AddNumberToObject(get_info, "build", BUILD); - cJSON *json_chip_info = cJSON_CreateObject(); + cJSON* json_chip_info = cJSON_CreateObject(); if (json_chip_info) { esp_chip_info_t chip_info; @@ -315,11 +315,11 @@ static void ezlopi_service_uart_get_info() cJSON_AddStringToObject(get_info, ezlopi_manf_name_str, device_manufacturer ? device_manufacturer : ""); cJSON_AddStringToObject(get_info, ezlopi_model_num_str, device_model ? device_model : ""); - cJSON *json_net_info = cJSON_CreateObject(); + cJSON* json_net_info = cJSON_CreateObject(); if (json_net_info) { - s_ezlopi_net_status_t *net_stat = ezlopi_get_net_status(); + s_ezlopi_net_status_t* net_stat = ezlopi_get_net_status(); cJSON_AddStringToObject(json_net_info, "wifi_mode", "STA"); if (net_stat) { @@ -327,7 +327,7 @@ static void ezlopi_service_uart_get_info() { cJSON_AddTrueToObject(json_net_info, "wifi_connection_status"); - char *ip_addr = (char *)malloc(sizeof(char) * 30); + char* ip_addr = (char*)malloc(sizeof(char) * 30); ip_addr = esp_ip4addr_ntoa(&net_stat->wifi_status->ip_info->ip, ip_addr, 30); cJSON_AddStringToObject(json_net_info, "ip_sta", ip_addr); @@ -369,20 +369,20 @@ static void ezlopi_service_uart_get_info() cJSON_AddItemToObject(get_info, "net_info", json_net_info); } - ezlopi_factory_info_v3_free((void *)controller_uuid); - ezlopi_factory_info_v3_free((void *)provisioning_uuid); - ezlopi_factory_info_v3_free((void *)device_model); - ezlopi_factory_info_v3_free((void *)device_brand); - ezlopi_factory_info_v3_free((void *)device_manufacturer); - ezlopi_factory_info_v3_free((void *)device_name); - ezlopi_factory_info_v3_free((void *)device_mac); - ezlopi_factory_info_v3_free((void *)wifi_ssid); + ezlopi_factory_info_v3_free((void*)controller_uuid); + ezlopi_factory_info_v3_free((void*)provisioning_uuid); + ezlopi_factory_info_v3_free((void*)device_model); + ezlopi_factory_info_v3_free((void*)device_brand); + ezlopi_factory_info_v3_free((void*)device_manufacturer); + ezlopi_factory_info_v3_free((void*)device_name); + ezlopi_factory_info_v3_free((void*)device_mac); + ezlopi_factory_info_v3_free((void*)wifi_ssid); - char *serial_data_json_string = cJSON_Print(get_info); + char* serial_data_json_string = cJSON_Print(get_info); if (serial_data_json_string) { cJSON_Minify(serial_data_json_string); - EZPI_SERVICE_uart_tx_data(strlen(serial_data_json_string), (uint8_t *)serial_data_json_string); + EZPI_SERVICE_uart_tx_data(strlen(serial_data_json_string), (uint8_t*)serial_data_json_string); cJSON_free(serial_data_json_string); } @@ -390,20 +390,20 @@ static void ezlopi_service_uart_get_info() } } -static void ezlopi_service_uart_set_wifi(const char *data) +static void ezlopi_service_uart_set_wifi(const char* data) { uint32_t status = 0; - cJSON *root = cJSON_Parse(data); + cJSON* root = cJSON_Parse(data); uint8_t status_write = 0; if (root) { - cJSON *cj_wifi_ssid = cJSON_GetObjectItem(root, ezlopi_ssid_str); - cJSON *cj_wifi_pass = cJSON_GetObjectItem(root, ezlopi_pass_str); + cJSON* cj_wifi_ssid = cJSON_GetObjectItem(root, ezlopi_ssid_str); + cJSON* cj_wifi_pass = cJSON_GetObjectItem(root, ezlopi_pass_str); if (cj_wifi_ssid && cj_wifi_pass && cj_wifi_ssid->valuestring && cj_wifi_pass->valuestring) { - char *ssid = cj_wifi_ssid->valuestring; - char *pass = cj_wifi_pass->valuestring; + char* ssid = cj_wifi_ssid->valuestring; + char* pass = cj_wifi_pass->valuestring; if (strlen(pass) >= EZLOPI_WIFI_MIN_PASS_CHAR) { @@ -412,13 +412,13 @@ static void ezlopi_service_uart_set_wifi(const char *data) { status_write = 1; } - ezlopi_wifi_set_new_wifi_flag(); + // ezlopi_wifi_set_new_wifi_flag(); uint8_t attempt = 1; while (attempt <= EZLOPI_WIFI_CONN_RETRY_ATTEMPT) { - ezlopi_wifi_connect((const char *)ssid, (const char *)pass); + ezlopi_wifi_connect((const char*)ssid, (const char*)pass); ezlopi_wait_for_wifi_to_connect((uint32_t)EZLOPI_WIFI_CONN_ATTEMPT_INTERVAL); - s_ezlopi_net_status_t *net_stat = ezlopi_get_net_status(); + s_ezlopi_net_status_t* net_stat = ezlopi_get_net_status(); if (net_stat) { if (net_stat->wifi_status->wifi_connection) @@ -455,7 +455,7 @@ static void ezlopi_service_uart_set_wifi(const char *data) static void ezlopi_service_uart_response(uint8_t cmd, uint8_t status_write, uint8_t status_connect) { - cJSON *response = NULL; + cJSON* response = NULL; response = cJSON_CreateObject(); if (response) @@ -464,22 +464,22 @@ static void ezlopi_service_uart_response(uint8_t cmd, uint8_t status_write, uint cJSON_AddNumberToObject(response, ezlopi_status_write_str, status_write); cJSON_AddNumberToObject(response, "status_connect", status_connect); - char *my_json_string = cJSON_Print(response); + char* my_json_string = cJSON_Print(response); cJSON_Delete(response); // free Json string if (my_json_string) { cJSON_Minify(my_json_string); - EZPI_SERVICE_uart_tx_data(strlen(my_json_string), (uint8_t *)my_json_string); + EZPI_SERVICE_uart_tx_data(strlen(my_json_string), (uint8_t*)my_json_string); cJSON_free(my_json_string); } } } -static void ezlopi_service_uart_save_config(const char *data) +static void ezlopi_service_uart_save_config(const char* data) { - uint8_t ret = ezlopi_nvs_write_config_data_str((char *)data); + uint8_t ret = ezlopi_nvs_write_config_data_str((char*)data); TRACE_I("ezlopi_factory_info_set_ezlopi_config: %d", ret); if (ret) { @@ -491,8 +491,8 @@ static void ezlopi_service_uart_save_config(const char *data) static void ezlopi_service_uart_read_config(void) { - cJSON *root = NULL; - char *buf = ezlopi_factory_info_v3_get_ezlopi_config(); + cJSON* root = NULL; + char* buf = ezlopi_factory_info_v3_get_ezlopi_config(); if (buf) { @@ -531,14 +531,14 @@ static void ezlopi_service_uart_read_config(void) if (root) { - char *my_json_string = cJSON_Print(root); + char* my_json_string = cJSON_Print(root); if (my_json_string) { cJSON_Minify(my_json_string); cJSON_Delete(root); // free Json string const int len = strlen(my_json_string); - EZPI_SERVICE_uart_tx_data(len, (uint8_t *)my_json_string); // Send the data over uart + EZPI_SERVICE_uart_tx_data(len, (uint8_t*)my_json_string); // Send the data over uart // TRACE_D("Sending: %s", my_json_string); cJSON_free(my_json_string); } diff --git a/sdkconfig.esp32s3.4mb b/sdkconfig.esp32s3.4mb index 093e6436a..0fbf65865 100644 --- a/sdkconfig.esp32s3.4mb +++ b/sdkconfig.esp32s3.4mb @@ -196,8 +196,8 @@ CONFIG_BT_SOC_SUPPORT_5_0=y # Bluetooth controller # CONFIG_BT_CTRL_MODE_EFF=1 -CONFIG_BT_CTRL_BLE_MAX_ACT=10 -CONFIG_BT_CTRL_BLE_MAX_ACT_EFF=10 +CONFIG_BT_CTRL_BLE_MAX_ACT=6 +CONFIG_BT_CTRL_BLE_MAX_ACT_EFF=6 CONFIG_BT_CTRL_BLE_STATIC_ACL_TX_BUF_NB=0 CONFIG_BT_CTRL_PINNED_TO_CORE_0=y # CONFIG_BT_CTRL_PINNED_TO_CORE_1 is not set @@ -231,14 +231,14 @@ CONFIG_BT_CTRL_RX_ANTENNA_INDEX_EFF=0 # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N6 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N3 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N0 is not set -CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3=y +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P6 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P9 is not set +CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P9=y # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P12 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P15 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P18 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P21 is not set -CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF=9 +CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF=11 CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP=y CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM=100 CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 @@ -579,9 +579,9 @@ CONFIG_ESP32S3_REV_MAX_FULL_STR_OPT=y CONFIG_ESP32S3_REV_MAX_FULL=99 CONFIG_ESP_REV_MAX_FULL=99 # CONFIG_ESP32S3_DEFAULT_CPU_FREQ_80 is not set -# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_160 is not set -CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y -CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=240 +CONFIG_ESP32S3_DEFAULT_CPU_FREQ_160=y +# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240 is not set +CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=160 # # Cache config @@ -877,8 +877,8 @@ CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y # CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 -CONFIG_ESP32_WIFI_IRAM_OPT=y -CONFIG_ESP32_WIFI_RX_IRAM_OPT=y +# CONFIG_ESP32_WIFI_IRAM_OPT is not set +# CONFIG_ESP32_WIFI_RX_IRAM_OPT is not set CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y # CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set # CONFIG_ESP_WIFI_FTM_ENABLE is not set @@ -1070,7 +1070,7 @@ CONFIG_LWIP_LOCAL_HOSTNAME="espressif" # CONFIG_LWIP_CHECK_THREAD_SAFETY is not set CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y # CONFIG_LWIP_L2_TO_L3_COPY is not set -CONFIG_LWIP_IRAM_OPTIMIZATION=y +# CONFIG_LWIP_IRAM_OPTIMIZATION is not set CONFIG_LWIP_TIMERS_ONDEMAND=y CONFIG_LWIP_MAX_SOCKETS=10 # CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set @@ -1652,7 +1652,7 @@ CONFIG_ESP32_APPTRACE_DEST_NONE=y CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y CONFIG_BLUEDROID_ENABLED=y # CONFIG_NIMBLE_ENABLED is not set -CONFIG_BTC_TASK_STACK_SIZE=4096 +CONFIG_BTC_TASK_STACK_SIZE=3072 CONFIG_BLUEDROID_PINNED_TO_CORE_0=y # CONFIG_BLUEDROID_PINNED_TO_CORE_1 is not set CONFIG_BLUEDROID_PINNED_TO_CORE=0 diff --git a/sdkconfig.old b/sdkconfig.old index d6b51c0b1..6c8bc39bd 100644 --- a/sdkconfig.old +++ b/sdkconfig.old @@ -841,7 +841,7 @@ CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 # CONFIG_ESP32_WIFI_IRAM_OPT is not set -CONFIG_ESP32_WIFI_RX_IRAM_OPT=y +# CONFIG_ESP32_WIFI_RX_IRAM_OPT is not set CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y # CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set # CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set From 32d41028533c237fe420f000566ba84a1611c9ad Mon Sep 17 00:00:00 2001 From: Krishna Kumar Sah Date: Sun, 25 Feb 2024 00:37:49 +0545 Subject: [PATCH 17/27] added local ws-server, encountered null-ptr returned by function --- CMakeLists.txt | 1 + .../ezlopi_cloud_keywords.c | 4 + .../ezlopi_cloud_keywords.h | 3 + ezlopi-components/lua/lua/lua.h | 1 - ezlopi-core/ezlopi-core-ezlopi/CMakeLists.txt | 25 +- .../ezlopi-core-ezlopi/ezlopi_core_ezlopi.c | 4 - .../ezlopi_core_ezlopi_cloud_api_macros.h | 2 +- .../ezlopi_core_ezlopi_methods.c | 115 +++++ .../ezlopi_core_ezlopi_methods.h | 30 ++ .../ezlopi_core_factory_info.c | 11 +- ezlopi-core/ezlopi-core-reboot/CMakeLists.txt | 2 +- ezlopi-core/ezlopi-core-scenes/CMakeLists.txt | 2 +- .../ezlopi_core_scenes_scripts.c | 1 + .../ezlopi_core_scenes_scripts_custom_libs.h | 2 +- .../ezlopi-core-sntp/ezlopi_core_sntp.c | 1 - .../ezlopi-core-wifi/ezlopi_core_wifi.c | 17 +- .../ezlopi-core-wifi/ezlopi_core_wifi.h | 2 +- .../ezlopi-core-ws-server/CMakeLists.txt | 67 --- .../ezlopi-core-ws-server/component.mk | 8 - .../ezlopi_core_ws_server.c | 394 --------------- .../ezlopi_core_ws_server.h | 11 - .../ezlopi_core_ws_server_config.h | 6 - .../ezlopi_core_ws_server_conn.c | 103 ---- .../ezlopi_core_ws_server_conn.h | 24 - ezlopi-lua-modules/core/CMakeLists.txt | 2 +- ezlopi-lua-modules/core/core_getters_api.c | 14 +- .../helper_functions/lua_helper_functions.h | 2 +- .../ezlopi-service-webprov/CMakeLists.txt | 32 +- .../ezlopi_service_webprov.c | 116 ++--- .../ezlopi-service-ws-server/CMakeLists.txt | 29 ++ .../ezlopi_service_ws_server.c | 448 ++++++++++++++++++ .../ezlopi_service_ws_server.h | 20 + .../ezlopi_service_ws_server_clients.c | 134 ++++++ .../ezlopi_service_ws_server_clients.h | 19 + main/CMakeLists.txt | 20 +- main/ezlopi_main.c | 19 +- sdkconfig | 51 +- sdkconfig.old | 343 +------------- 38 files changed, 971 insertions(+), 1114 deletions(-) rename ezlopi-services/ezlopi-service-webprov/ezlopi_api_url_macros.h => ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_cloud_api_macros.h (98%) create mode 100644 ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_methods.c create mode 100644 ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_methods.h delete mode 100644 ezlopi-core/ezlopi-core-ws-server/CMakeLists.txt delete mode 100644 ezlopi-core/ezlopi-core-ws-server/component.mk delete mode 100644 ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.c delete mode 100644 ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.h delete mode 100644 ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_config.h delete mode 100644 ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.c delete mode 100644 ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.h create mode 100644 ezlopi-services/ezlopi-service-ws-server/CMakeLists.txt create mode 100644 ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.c create mode 100644 ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.h create mode 100644 ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server_clients.c create mode 100644 ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server_clients.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 92a218de8..da5157f42 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,6 +53,7 @@ foreach(component ${external_components_list}) LIST(APPEND ALL_COMPONENTS ${SUBDIRS}) endforeach() +LIST(APPEND ALL_COMPONENTS $ENV{IDF_PATH}/components/esp_http_server) set(EXTRA_COMPONENT_DIRS ${ALL_COMPONENTS} ) # add the list of directories 'SUBDIRS' to 'EXTRA_COMPONENT_DIRS'(ESP32 VARIABLES), links the external components message(STATUS "EXTRA_COMPONENTS_DIRS: ${EXTRA_COMPONENT_DIRS}\r\n") diff --git a/ezlopi-cloud/ezlopi-cloud-constants/ezlopi_cloud_keywords.c b/ezlopi-cloud/ezlopi-cloud-constants/ezlopi_cloud_keywords.c index 51f7f8c95..51138ec5e 100644 --- a/ezlopi-cloud/ezlopi-cloud-constants/ezlopi_cloud_keywords.c +++ b/ezlopi-cloud/ezlopi-cloud-constants/ezlopi_cloud_keywords.c @@ -213,6 +213,7 @@ const char *scene_status_finished_str = "finished"; const char *scene_status_partially_finished_str = "partially_finished"; const char *scene_status_failed_str = "failed"; const char *scene_status_stopped_str = "stopped"; + const char *ezlopi_valueformatted_str = "valueFormatted"; const char *ezlopi_value_default_str = "valueDefault"; const char *ezlopi_text_str = "text"; @@ -250,6 +251,7 @@ const char *ezlopi_service_str = "service"; const char *ezlopi_alarmed_str = "alarmed"; const char *ezlopi_timeIsLeft_str = "timeIsLeft"; const char *ezlopi_sources_str = "sources"; +const char *ezlopi_source_str = "source"; const char *ezlopi_timestamp_str = "timestamp"; const char *ezlopi_Home_str = "Home"; const char *ezlopi_Away_str = "Away"; @@ -257,4 +259,6 @@ const char *ezlopi_Night_str = "Night"; const char *ezlopi_Vacation_str = "Vacation"; const char *ezlopi_houseMode_str = "houseMode"; +const char *ezlopi_client_id_str = "client_id"; + #endif // __EZLOPI_CLOUD_KEYWORDS_H__ diff --git a/ezlopi-cloud/ezlopi-cloud-constants/ezlopi_cloud_keywords.h b/ezlopi-cloud/ezlopi-cloud-constants/ezlopi_cloud_keywords.h index 83a2ec9ff..17739f402 100644 --- a/ezlopi-cloud/ezlopi-cloud-constants/ezlopi_cloud_keywords.h +++ b/ezlopi-cloud/ezlopi-cloud-constants/ezlopi_cloud_keywords.h @@ -256,6 +256,7 @@ extern const char *ezlopi_service_str; extern const char *ezlopi_alarmed_str; extern const char *ezlopi_timeIsLeft_str; extern const char *ezlopi_sources_str; +extern const char *ezlopi_source_str; extern const char *ezlopi_timestamp_str; extern const char *ezlopi_Home_str; extern const char *ezlopi_Away_str; @@ -263,4 +264,6 @@ extern const char *ezlopi_Night_str; extern const char *ezlopi_Vacation_str; extern const char *ezlopi_houseMode_str; +extern const char *ezlopi_client_id_str; + #endif // __EZLOPI_CLOUD_KEYWORDS_H__ diff --git a/ezlopi-components/lua/lua/lua.h b/ezlopi-components/lua/lua/lua.h index 55c05dbfd..aba159a1b 100644 --- a/ezlopi-components/lua/lua/lua.h +++ b/ezlopi-components/lua/lua/lua.h @@ -212,7 +212,6 @@ LUA_API const char *(lua_pushvfstring)(lua_State *L, const char *fmt, va_list argp); LUA_API const char *(lua_pushfstring)(lua_State *L, const char *fmt, ...); LUA_API void(lua_pushcclosure)(lua_State *L, lua_CFunction fn, int n); -#warning "Compile and check the warning details, Krishna needs to resolve it. note: expected 'int' but argument is of type 'const char *'" LUA_API void(lua_pushboolean)(lua_State *L, int b); LUA_API void(lua_pushlightuserdata)(lua_State *L, void *p); LUA_API int(lua_pushthread)(lua_State *L); diff --git a/ezlopi-core/ezlopi-core-ezlopi/CMakeLists.txt b/ezlopi-core/ezlopi-core-ezlopi/CMakeLists.txt index 538abceec..e54eab148 100644 --- a/ezlopi-core/ezlopi-core-ezlopi/CMakeLists.txt +++ b/ezlopi-core/ezlopi-core-ezlopi/CMakeLists.txt @@ -6,9 +6,28 @@ set(EZLOPI_CORE_COMPONENTS ezlopi-core-wifi ezlopi-core-modes ezlopi-core-sntp - ezlopi-core-ws-server + ezlopi-core-reboot + ezlopi-util-trace ) -idf_component_register(SRCS "ezlopi_core_ezlopi.c" "${config_src}" +set(EZLOPI_CLOUD_COMPONENTS + ezlopi-cloud-data + ezlopi-cloud-devices + ezlopi-cloud-scenes + ezlopi-cloud-registration + ezlopi-cloud-favorite + ezlopi-cloud-gateways + ezlopi-cloud-info + ezlopi-cloud-modes + ezlopi-cloud-items + ezlopi-cloud-room + ezlopi-cloud-settings + ezlopi-cloud-network + ezlopi-cloud-ota +) + +idf_component_register(SRCS "ezlopi_core_ezlopi_methods.c" "ezlopi_core_ezlopi.c" "${config_src}" INCLUDE_DIRS "." - REQUIRES ${EZLOPI_CORE_COMPONENTS}) + REQUIRES ${EZLOPI_CORE_COMPONENTS} + ${EZLOPI_CLOUD_COMPONENTS} +) diff --git a/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi.c b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi.c index b6d003c8c..4d89c4df3 100644 --- a/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi.c +++ b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi.c @@ -9,7 +9,6 @@ #include "ezlopi_core_room.h" #include "ezlopi_core_timer.h" #include "ezlopi_core_modes.h" -#include "ezlopi_core_ws_server.h" #include "ezlopi_core_event_queue.h" #include "ezlopi_core_event_group.h" #include "ezlopi_core_factory_info.h" @@ -38,7 +37,6 @@ void ezlopi_init(void) ezlopi_wifi_initialize(); vTaskDelay(10); -#if 1 // Init devices ezlopi_device_prepare(); vTaskDelay(10); @@ -61,8 +59,6 @@ void ezlopi_init(void) ezlopi_ping_init(); ezlopi_core_sntp_init(); ezlopi_timer_start_1000ms(); - ezlopi_core_ws_server_init(); -#endif } static void ezlopi_initialize_devices_v3(void) diff --git a/ezlopi-services/ezlopi-service-webprov/ezlopi_api_url_macros.h b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_cloud_api_macros.h similarity index 98% rename from ezlopi-services/ezlopi-service-webprov/ezlopi_api_url_macros.h rename to ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_cloud_api_macros.h index 6d5ee725a..00233f864 100644 --- a/ezlopi-services/ezlopi-service-webprov/ezlopi_api_url_macros.h +++ b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_cloud_api_macros.h @@ -79,5 +79,5 @@ CLOUD_METHOD("hub.scenes.expressions.delete", scenes_expressions_delete, NULL) CLOUD_METHOD("hub.nma.register.repeat", register_repeat, NULL) -CLOUD_METHOD("hub.reboot", __hub_reboot, NULL) +CLOUD_METHOD("hub.reboot", ezlopi_core_ezlopi_methods_reboot, NULL) CLOUD_METHOD("registered", registered, NULL) diff --git a/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_methods.c b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_methods.c new file mode 100644 index 000000000..62113ad06 --- /dev/null +++ b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_methods.c @@ -0,0 +1,115 @@ + +#include "ezlopi_cloud_ota.h" +#include "ezlopi_cloud_data.h" +#include "ezlopi_cloud_info.h" +#include "ezlopi_cloud_room.h" +#include "ezlopi_cloud_items.h" +#include "ezlopi_cloud_modes.h" +#include "ezlopi_cloud_scenes.h" +#include "ezlopi_cloud_devices.h" +#include "ezlopi_cloud_network.h" +#include "ezlopi_cloud_favorite.h" +#include "ezlopi_cloud_gateways.h" +#include "ezlopi_cloud_settings.h" +#include "ezlopi_cloud_constants.h" +#include "ezlopi_cloud_registration.h" +#include "ezlopi_cloud_modes_updaters.h" +#include "ezlopi_cloud_scenes_scripts.h" +#include "ezlopi_cloud_scenes_expressions.h" + +#include "ezlopi_core_reboot.h" +#include "ezlopi_core_ezlopi_methods.h" +#include "ezlopi_util_trace.h" + +static const s_method_list_v2_t method_list_v2[] = { +#define CLOUD_METHOD(name, _method, _updater) {.method_name = name, .method = _method, .updater = _updater}, +#include "ezlopi_core_ezlopi_cloud_api_macros.h" +#undef CLOUD_METHOD + {.method_name = NULL, .method = NULL, .updater = NULL}, +}; + +f_method_func_t ezlopi_core_ezlopi_methods_get_by_id(uint32_t method_id) +{ + TRACE_D("method_id: %u", method_id); + TRACE_D("function ptr: %p", method_list_v2[method_id].method); + return method_list_v2[method_id].method; +} + +f_method_func_t ezlopi_core_ezlopi_methods_get_updater_by_id(uint32_t method_id) +{ + TRACE_D("method_id: %u", method_id); + TRACE_D("function ptr: %p", method_list_v2[method_id].updater); + return method_list_v2[method_id].updater; +} + +char *ezlopi_core_ezlopi_methods_get_name_by_id(uint32_t method_id) +{ + TRACE_D("method_id: %u", method_id); + TRACE_D("method_name: %s", method_list_v2[method_id].method_name); + return method_list_v2[method_id].method_name; +} + +uint32_t ezlopi_core_ezlopi_methods_search_in_list(cJSON *cj_method) +{ + uint32_t found_method = 0; + uint32_t idx = 0; + + if (cj_method && cj_method->valuestring) + { + while (method_list_v2[idx].method_name) + { + TRACE_D("idx: %d", idx); + TRACE_D("name: %s", method_list_v2[idx].method_name); + TRACE_D("method: %p", method_list_v2[idx].method); + TRACE_D("updater: %p\n", method_list_v2[idx].updater); + + uint32_t request_method_name_len = strlen(cj_method->valuestring); + uint32_t list_method_name_len = strlen(method_list_v2[idx].method_name); + uint32_t comp_len = list_method_name_len > request_method_name_len ? list_method_name_len : request_method_name_len; + if (0 == strncmp(cj_method->valuestring, method_list_v2[idx].method_name, comp_len)) + { + found_method = 1; + break; + } + + idx++; + } + } + + return (found_method ? idx : UINT32_MAX); +} + +void ezlopi_core_ezlopi_methods_rpc_method_notfound(cJSON *cj_request, cJSON *cj_response) +{ + cJSON_AddItemReferenceToObject(cj_response, ezlopi_id_str, cJSON_GetObjectItem(cj_request, ezlopi_id_str)); + cJSON_AddItemReferenceToObject(cj_response, ezlopi_method_str, cJSON_GetObjectItem(cj_request, ezlopi_method_str)); + cJSON *cjson_error = cJSON_AddObjectToObject(cj_response, ezlopi_error_str); + if (cjson_error) + { + cJSON_AddNumberToObject(cjson_error, ezlopi_code_str, -32602); + cJSON_AddStringToObject(cjson_error, ezlopi_data_str, ezlopi_rpc_method_notfound_str); + cJSON_AddStringToObject(cjson_error, ezlopi_message_str, ezlopi_Unknown_method_str); + } + + cJSON_AddObjectToObject(cj_response, ezlopi_result_str); +} + +void ezlopi_core_ezlopi_methods_registration_init(void) +{ + registration_init(); +} + +bool ezlopi_core_elzlopi_methods_check_method_register(f_method_func_t method) +{ + bool ret = false; + if (registered == method) + { + ret = true; + } + return ret; +} + +void ezlopi_core_ezlopi_methods_reboot(cJSON *cj_request, cJSON *cj_response) +{ + ezlopi_reboot(); +} diff --git a/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_methods.h b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_methods.h new file mode 100644 index 000000000..2eab424b9 --- /dev/null +++ b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_methods.h @@ -0,0 +1,30 @@ +#ifndef __EZLOPI_CORE_EZLOPI_METHODS_H__ +#define __EZLOPI_CORE_EZLOPI_METHODS_H__ + +#include +#include +#include +#include +#include + +typedef void (*f_method_func_t)(cJSON *cj_request, cJSON *cj_response); +typedef struct s_method_list_v2 +{ + char *method_name; + f_method_func_t method; + f_method_func_t updater; +} s_method_list_v2_t; + +void ezlopi_core_ezlopi_methods_registration_init(void); +bool ezlopi_core_elzlopi_methods_check_method_register(f_method_func_t method); + +uint32_t ezlopi_core_ezlopi_methods_search_in_list(cJSON *cj_method); + +char *ezlopi_core_ezlopi_methods_get_name_by_id(uint32_t method_id); +f_method_func_t ezlopi_core_ezlopi_methods_get_by_id(uint32_t method_id); +f_method_func_t ezlopi_core_ezlopi_methods_get_updater_by_id(uint32_t method_id); + +void ezlopi_core_ezlopi_methods_reboot(cJSON *cj_request, cJSON *cj_response); +void ezlopi_core_ezlopi_methods_rpc_method_notfound(cJSON *cj_request, cJSON *cj_response); + +#endif // __EZLOPI_CORE_EZLOPI_METHODS_H__ \ No newline at end of file diff --git a/ezlopi-core/ezlopi-core-factory-info/ezlopi_core_factory_info.c b/ezlopi-core/ezlopi-core-factory-info/ezlopi_core_factory_info.c index e1c9ffe46..6d45b4ffa 100644 --- a/ezlopi-core/ezlopi-core-factory-info/ezlopi_core_factory_info.c +++ b/ezlopi-core/ezlopi-core-factory-info/ezlopi_core_factory_info.c @@ -446,7 +446,16 @@ char *ezlopi_factory_info_v3_get_ssl_shared_key(void) char *ezlopi_factory_info_v3_get_ezlopi_config(void) { - return ezlopi_factory_info_v3_read_string(ezlopi_factory_info_v3_get_abs_address(EZLOPI_FINFO_REL_OFFSET_EZLOPI_CONFIG_JSON, E_EZLOPI_FACTORY_INFO_CONN_DATA), EZLOPI_FINFO_LEN_EZLOPI_CONFIG_JSON); + char *ret = ezlopi_factory_info_v3_read_string(ezlopi_factory_info_v3_get_abs_address(EZLOPI_FINFO_REL_OFFSET_EZLOPI_CONFIG_JSON, E_EZLOPI_FACTORY_INFO_CONN_DATA), EZLOPI_FINFO_LEN_EZLOPI_CONFIG_JSON); + if (false == isprint(ret[0])) + { + if (ret) + { + free(ret); + ret = NULL; + } + } + return ret; } #if 0 // IF version 2 diff --git a/ezlopi-core/ezlopi-core-reboot/CMakeLists.txt b/ezlopi-core/ezlopi-core-reboot/CMakeLists.txt index c42de6d35..8ea83ae48 100644 --- a/ezlopi-core/ezlopi-core-reboot/CMakeLists.txt +++ b/ezlopi-core/ezlopi-core-reboot/CMakeLists.txt @@ -4,6 +4,6 @@ set(EZLOPI_SERVICE_COMPONENTS ezlopi-service-webprov ) -idf_component_register(SRCS "${config_src}" +idf_component_register(SRCS "ezlopi_core_reboot.c" "${config_src}" INCLUDE_DIRS "." REQUIRES ${EZLOPI_SERVICE_COMPONENTS}) diff --git a/ezlopi-core/ezlopi-core-scenes/CMakeLists.txt b/ezlopi-core/ezlopi-core-scenes/CMakeLists.txt index b0e17ee1d..37367538a 100644 --- a/ezlopi-core/ezlopi-core-scenes/CMakeLists.txt +++ b/ezlopi-core/ezlopi-core-scenes/CMakeLists.txt @@ -2,7 +2,7 @@ file(GLOB_RECURSE config_src "*.c") -idf_component_register(SRCS "ezlopi_core_scenes_cjson.c" "ezlopi_core_scenes_print.c" "ezlopi_core_scenes_value.c" "${config_src}" +idf_component_register(SRCS "${config_src}" INCLUDE_DIRS "." REQUIRES core ) \ No newline at end of file diff --git a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_scripts.c b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_scripts.c index 0766822a0..c4b5bb03a 100755 --- a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_scripts.c +++ b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_scripts.c @@ -10,6 +10,7 @@ #include "lua/lualib.h" #include "lua/lauxlib.h" +#include "corelib.h" #include "ezlopi_core_nvs.h" #include "ezlopi_core_cloud.h" #include "ezlopi_core_scenes_scripts.h" diff --git a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_scripts_custom_libs.h b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_scripts_custom_libs.h index 8ce489902..08fe9135c 100755 --- a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_scripts_custom_libs.h +++ b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_scripts_custom_libs.h @@ -1 +1 @@ -SCRIPTS_CUSTOM_LIB("core", luaopen_lcore) // luaopen_lcore) +// SCRIPTS_CUSTOM_LIB("core", luaopen_lcore) // luaopen_lcore) diff --git a/ezlopi-core/ezlopi-core-sntp/ezlopi_core_sntp.c b/ezlopi-core/ezlopi-core-sntp/ezlopi_core_sntp.c index 0bb429107..4eea18d1f 100644 --- a/ezlopi-core/ezlopi-core-sntp/ezlopi_core_sntp.c +++ b/ezlopi-core/ezlopi-core-sntp/ezlopi_core_sntp.c @@ -41,7 +41,6 @@ void ezlopi_core_sntp_init(void) static void sntp_sync_time_call_back(struct timeval *tv) { sntp_set_sync_interval(60 * 60 * 1000); - TRACE_S("Notification of a time synchronization event"); time_t now; time(&now); diff --git a/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.c b/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.c index fc5d400bc..a8b9a54de 100644 --- a/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.c +++ b/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.c @@ -73,12 +73,6 @@ esp_netif_ip_info_t *ezlopi_wifi_get_ip_infos(void) return &my_ip; } -// static void alert_qt_wifi_fail(void) -// { -// char *qt_resp = "{\"cmd\":2,\"status_write\":0,\"status_connect\":0}"; -// qt_serial_tx_data(strlen(qt_resp), (uint8_t *)qt_resp); -// } - int ezlopi_wifi_got_ip(void) { return station_got_ip; @@ -178,7 +172,7 @@ static void __event_handler(void *arg, esp_event_base_t event_base, int32_t even { if (curr_upcall->upcall) { - curr_upcall->upcall(event_base, curr_upcall->arg); + curr_upcall->upcall(event_base, event_id, curr_upcall->arg); } curr_upcall = curr_upcall->next; } @@ -216,8 +210,8 @@ void ezlopi_wifi_connect_from_id_bin(void) } else { - strcpy(&wifi_ssid_pass_global_buffer[00], "ezlopitest"); - strcpy(&wifi_ssid_pass_global_buffer[32], "ezlopitest"); + strcpy(&wifi_ssid_pass_global_buffer[00], "krishna home_2.4"); + strcpy(&wifi_ssid_pass_global_buffer[32], "coldWinter"); } ezlopi_factory_info_v3_free(wifi_ssid); @@ -234,8 +228,8 @@ void ezlopi_wifi_connect_from_nvs(void) if (wifi_ssid_pass_global_buffer[0] == 0) { - strcpy(&wifi_ssid_pass_global_buffer[00], "ezlopitest"); - strcpy(&wifi_ssid_pass_global_buffer[32], "ezlopitest"); + strcpy(&wifi_ssid_pass_global_buffer[00], "nepaldigisys"); + strcpy(&wifi_ssid_pass_global_buffer[32], "NDS_0ffice"); ezlopi_wifi_set_new_wifi_flag(); } @@ -312,7 +306,6 @@ static ll_ezlopi_wifi_event_upcall_t *ezlopi_wifi_event_upcall_create(f_ezlopi_w if (_upcall) { _upcall->arg = arg; -#warning "Krishna needs to test and fix it" _upcall->upcall = upcall; _upcall->next = NULL; } diff --git a/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.h b/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.h index 0fb73bd5e..f7fcd2ab5 100644 --- a/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.h +++ b/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.h @@ -9,7 +9,7 @@ extern "C" { #endif - typedef void (*f_ezlopi_wifi_event_upcall)(esp_event_base_t event, void *arg); + typedef void (*f_ezlopi_wifi_event_upcall)(esp_event_base_t event, int32_t event_id, void *arg); typedef struct ll_ezlopi_wifi_event_upcall { diff --git a/ezlopi-core/ezlopi-core-ws-server/CMakeLists.txt b/ezlopi-core/ezlopi-core-ws-server/CMakeLists.txt deleted file mode 100644 index 295fd7a47..000000000 --- a/ezlopi-core/ezlopi-core-ws-server/CMakeLists.txt +++ /dev/null @@ -1,67 +0,0 @@ -file(GLOB_RECURSE config_src "*.c") - -# Define SDK components -set(EZLOPI_SDK_COMPONENTS - driver - nghttp - esp_http_server - protocol_examples_common - wpa_supplicant - esp_https_server -) - -# Define ezlopi-components -set(EZLOPI_COMPONENTS - ezlopi-util-uuid - ezlopi-util-trace -) - -# Define core components -set(EZLOPI_CORE_COMPONENTS - ezlopi-core-ble - ezlopi-core-sntp - ezlopi-core-cloud - ezlopi-core-ezlopi - ezlopi-core-scenes - ezlopi-core-actions - ezlopi-core-devices - ezlopi-core-event-group -) - -# Define HAL components -set(EZLOPI_HAL_COMPONENTS - ezlopi-hal-adc - ezlopi-hal-pwm - ezlopi-hal-i2c - ezlopi-hal-spi - ezlopi-hal-uart - ezlopi-hal-gpio - ezlopi-hal-onewire -) - -# Define cloud components -set(EZLOPI_CLOUD_COMPONENTS - ezlopi-cloud-settings -) - -# Define sensor device components -set(EZLOPI_SENSOR_DEVICE_COMPONENTS - - # Add other sensor device components here -) - -# Define service components -set(EZLOPI_SERVICES - -) - -# Register the components -idf_component_register(SRCS "ezlopi_core_ws_server.c" "ezlopi_core_ws_server_conn.c" "${config_src}" - INCLUDE_DIRS "." - REQUIRES ${EZLOPI_SERVICES} - ${EZLOPI_COMPONENTS} - ${EZLOPI_HAL_COMPONENTS} - ${EZLOPI_CORE_COMPONENTS} - ${EZLOPI_CLOUD_COMPONENTS} - ${EZLOPI_SENSOR_DEVICE_COMPONENTS} -) diff --git a/ezlopi-core/ezlopi-core-ws-server/component.mk b/ezlopi-core/ezlopi-core-ws-server/component.mk deleted file mode 100644 index 608de873e..000000000 --- a/ezlopi-core/ezlopi-core-ws-server/component.mk +++ /dev/null @@ -1,8 +0,0 @@ -# -# "main" pseudo-component makefile. -# -# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) - - -COMPONENT_ADD_SRCDIRS := .. -COMPONENT_ADD_INCLUDEDIRS := .. \ No newline at end of file diff --git a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.c b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.c deleted file mode 100644 index ccda67240..000000000 --- a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.c +++ /dev/null @@ -1,394 +0,0 @@ -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ezlopi_util_uuid.h" -#include "ezlopi_util_trace.h" - -#include "ezlopi_core_ws_server.h" -#include "ezlopi_core_event_group.h" -#include "ezlopi_core_ws_server_conn.h" -#include "ezlopi_core_ws_server_config.h" - -/** - * @brief - * - * 0 1 2 3 - * _______________ _______________ _______________ _______________ - * 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 - * +-+-+-+-+-------+-+-------------+-------------------------------+ - * |F|R|R|R| opcode|M| Payload len | Extended payload length | - * |I|S|S|S| (4) |A| (7) | (16/64) | - * |N|V|V|V| |S| | (if payload len==126/127) | - * | |1|2|3| |K| | | - * +-+-+-+-+-------+-+-------------+ - - - - - - - - - - - - - - - + - * | Extended payload length continued, if payload len == 127 | - * + - - - - - - - - - - - - - - - +-------------------------------+ - * | |Masking-key, if MASK set to 1 | - * +-------------------------------+-------------------------------+ - * | Masking-key (continued) | Payload Data | - * +-------------------------------- - - - - - - - - - - - - - - - + - * : Payload Data continued ... : - * + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - * | Payload Data continued ... | - * +---------------------------------------------------------------+ - * for reference: https://datatracker.ietf.org/doc/html/rfc6455 -> page no. 28 (i.e. Base Framing Protocol) - */ - -typedef enum e_ws_opcode -{ - WS_OPCODE_CONTINUOUS_FRAME = 0x00, - WS_OPCODE_TEXT_FRAME, - WS_OPCODE_BINARY_FRAME, - - WS_OPCODE_CONNECTION_CLOSE = 0x08, - WS_OPCODE_PING_FRAME = 0x09, - WS_OPCODE_PONG_FRAME = 0x0A, -} e_ws_opcode_t; - -typedef struct s_ws_header_frame -{ - // Defines the interpretation of the "Payload data". - uint8_t opcode : 4; - - // MUST be 0 unless an extension is negotiated that defines meanings for non-zero values. - uint8_t rsv1 : 1; - uint8_t rsv2 : 1; - uint8_t rsv3 : 1; - - // Indicates that this is the final fragment in a message. The first fragment MAY also be the final fragment. - uint8_t fin : 1; - - // Payload length: 7 bits, 7+16 bits, or 7+64 bits - // range 0 to 125, is payload length in 7 bits - // if payload_len == 126, following 2 bytes interpreted as a 16-bit payload length - // if payload_len == 127, following 8 bytes interpreted as a 64-bit payload length - uint8_t payload_len : 7; - - // Defines whether the "Payload data" is masked. - uint8_t mask : 1; -} s_ws_header_frame_t; - -static const char *gsc_sec_key_name = "Sec-WebSocket-Key:"; -static const char *gsc_wss_guid = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; -static TaskHandle_t gs_task_handle = NULL; - -static void __server_init(void); -static void __server_process(void *pv); -static int __ws_data_handle(s_ws_server_connections_t *ws_conn); -static int __new_connection_handsake(s_ws_server_connections_t *ws_conn); - -static int __process_payload(s_ws_header_frame_t *header_frame, uint8_t *rx_data); -static int __process_extended_payload_2(s_ws_header_frame_t *header_frame, uint8_t *rx_data); -static int __process_extended_payload_8(s_ws_header_frame_t *header_frame, uint8_t *rx_data); - -void ezlopi_core_ws_server_deinit(void) -{ - if (gs_task_handle) - { - vTaskDelete(gs_task_handle); - } - - s_ws_server_connections_t *curr_con = ezlopi_core_ws_server_conn_get_head(); -} - -void ezlopi_core_ws_server_init(void) -{ - if (NULL == gs_task_handle) - { - xTaskCreate(__server_process, "ws-server-process", 2048, NULL, 4, &gs_task_handle); - } -} - -static void __connection_process(void *pv) -{ - s_ws_server_connections_t *ws_conn = (s_ws_server_connections_t *)pv; - - if (ws_conn) - { - if (ws_conn->net_conn) - { - int ret = __new_connection_handsake(ws_conn); - - if (ret) - { - do - { - __ws_data_handle(ws_conn); - - vTaskDelay(1); - } while (1); - } - - netconn_delete(ws_conn->net_conn); - ws_conn->net_conn = NULL; - ws_conn->task_handle = NULL; - } - } - else - { - TRACE_E("ws-conn is NULL"); - } - - vTaskDelete(NULL); -} - -static void __server_process(void *pv) -{ - ezlopi_event_group_wait_for_event(EZLOPI_EVENT_WIFI_CONNECTED, portMAX_DELAY, false); - - struct netconn *listen_con = netconn_new(NETCONN_TCP); - - if (listen_con) - { - netconn_bind(listen_con, IP4_ADDR_ANY, 80); - err_t err = netconn_listen(listen_con); - if (ERR_OK == err) - { - while (1) - { - struct netconn *new_con = NULL; - - TRACE_D("waiting for new connection..."); - err = netconn_accept(listen_con, &new_con); - if ((ERR_OK == err) && new_con) - { - ip_addr_t conn_ip; - uint16_t conn_port = 0; - s_ws_server_connections_t *ws_conn = ezlopi_core_ws_server_conn_add_ws_conn(new_con); - - netconn_getaddr(new_con, &conn_ip, &conn_port, 0); - TRACE_D("connection-request from: %s:%u", ipaddr_ntoa(&conn_ip), conn_port); - - if (ws_conn) - { - xTaskCreate(__connection_process, "ws-connection", 4 * 1024, ws_conn, 5, &ws_conn->task_handle); - } - else - { - netconn_delete(new_con); - } - } - } - } - else - { - TRACE_E("error[%d]: %s", err, lwip_strerr(err)); - netconn_delete(listen_con); - TRACE_E("failed"); - } - } - else - { - TRACE_E("FAILED"); - } - - gs_task_handle = NULL; - vTaskDelete(NULL); -} - -static int __new_connection_handsake(s_ws_server_connections_t *ws_conn) -{ - int ret = 0; - - if (ws_conn && ws_conn->net_conn) - { - struct netbuf *net_buffer = NULL; - err_t err = netconn_recv(ws_conn->net_conn, &net_buffer); - - if (NULL != net_buffer) - { - char *buf_data = NULL; - uint16_t data_size = 0; - - netbuf_data(net_buffer, &buf_data, &data_size); - - if (buf_data) - { - char *client_sec_key_start = strstr(buf_data, gsc_sec_key_name); - if (client_sec_key_start) - { - char concated_strings[80]; - client_sec_key_start += strlen(gsc_sec_key_name) + 1; - uint32_t client_sec_key_len = strstr(client_sec_key_start, "\r\n") - client_sec_key_start; - - ezlopi_util_uuid_generate_random(ws_conn->uuid); - uint32_t tmp_len = snprintf(concated_strings, sizeof(concated_strings), "%.*s%s", client_sec_key_len, client_sec_key_start, gsc_wss_guid); - - uint8_t hash_of_cat[20]; - memset(hash_of_cat, 0, sizeof(hash_of_cat)); - esp_sha(SHA1, (uint8_t *)concated_strings, strlen(concated_strings), (uint8_t *)hash_of_cat); - - uint32_t o_len = 0; - char base64_data_of_cat[32]; - memset(base64_data_of_cat, 0, sizeof(base64_data_of_cat)); - mbedtls_base64_encode((uint8_t *)base64_data_of_cat, sizeof(base64_data_of_cat), &o_len, hash_of_cat, sizeof(hash_of_cat)); - - static const char *sc_handsake_response_frmt = - "HTTP/1.1 101 Switching Protocols \r\n" - "Upgrade: websocket\r\n" - "Connection: Upgrade\r\n" - "Sec-WebSocket-Accept: %.*s\r\n\r\n"; - - char *handshake_response = malloc(256); - if (handshake_response) - { - snprintf(handshake_response, 256, sc_handsake_response_frmt, sizeof(base64_data_of_cat), base64_data_of_cat); - netconn_write(ws_conn->net_conn, handshake_response, strlen(handshake_response), NETCONN_COPY); - - TRACE_D("handshake_response sent:\r\n%s", handshake_response); - free(handshake_response); - ret = 1; - } - } - } - - netbuf_delete(net_buffer); - } - else - { - TRACE_E("Here"); - } - } - else - { - TRACE_E("Here"); - } - - return ret; -} - -static int __ws_data_handle(s_ws_server_connections_t *ws_conn) -{ - int ret = 0; - if (ws_conn) - { - TRACE_D("Here"); - struct netbuf *net_buffer = NULL; - err_t err = netconn_recv(ws_conn->net_conn, &net_buffer); - TRACE_W("err: %s", lwip_strerr(err)); - - if (net_buffer) - { - uint8_t *rx_data = NULL; - uint32_t data_len = 0; - - netbuf_first(net_buffer); - netbuf_data(net_buffer, &rx_data, &data_len); - net_buffer = NULL; - - if (rx_data) - { - dump("rx_data", rx_data, 0, data_len); - - uint8_t *payload_start = NULL; - s_ws_header_frame_t *header_frame = (s_ws_header_frame_t *)rx_data; - - if (header_frame->payload_len <= 125) - { - __process_payload(header_frame, rx_data); - } - else if (header_frame == 126) - { - __process_extended_payload_2(header_frame, rx_data); - } - else if (header_frame == 127) - { - __process_extended_payload_8(header_frame, rx_data); - } - - switch (header_frame->opcode) - { - case WS_OPCODE_TEXT_FRAME: - { - TRACE_I("text frame"); - break; - } - case WS_OPCODE_CONNECTION_CLOSE: - { - TRACE_I("connection close"); - break; - } - case WS_OPCODE_CONTINUOUS_FRAME: - { - TRACE_I("continuous frame"); - break; - } - case WS_OPCODE_BINARY_FRAME: - { - TRACE_I("binary frame"); - break; - } - case WS_OPCODE_PING_FRAME: - { - TRACE_I("ping"); - } - case WS_OPCODE_PONG_FRAME: - { - TRACE_I("pong"); - break; - } - default: - { - TRACE_E("unknown upcode"); - break; - } - } - } - - netbuf_delete(net_buffer); - } - else - { - TRACE_E("netbuf is null"); - } - } - - return ret; -} - -static int __process_payload(s_ws_header_frame_t *header_frame, uint8_t *rx_data) -{ - int ret = 0; - - if (header_frame && rx_data) - { - uint32_t data_len = (uint32_t)header_frame->payload_len; - uint8_t *payload_start = rx_data + 2; - TRACE_D("payload-len: %u", data_len); - } - - return ret; -} - -static int __process_extended_payload_2(s_ws_header_frame_t *header_frame, uint8_t *rx_data) -{ - int ret = 0; - if (header_frame && rx_data) - { - uint16_t data_len = (uint16_t)(rx_data + 2); - uint8_t *payload_start = rx_data + 4; - TRACE_D("payload-len: %u", data_len); - } - return ret; -} - -static int __process_extended_payload_8(s_ws_header_frame_t *header_frame, uint8_t *rx_data) -{ - int ret = 0; - if (header_frame && rx_data) - { - uint64_t data_len = ((uint64_t)(rx_data + 2)); - uint8_t *payload_start = rx_data + 10; - TRACE_D("payload-len: %llu", data_len); - } - return ret; -} diff --git a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.h b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.h deleted file mode 100644 index bb92c1ef8..000000000 --- a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __EZLOPI_CORE_WS_H__ -#define __EZLOPI_CORE_WS_H__ - -typedef struct s_ezlopi_ws_server -{ - -} s_ezlopi_ws_server_t; - -void ezlopi_core_ws_server_init(void); - -#endif // __EZLOPI_CORE_WS_H__ diff --git a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_config.h b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_config.h deleted file mode 100644 index 7e88708b6..000000000 --- a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_config.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __EZLOPI_CORE_WS_SERVER_CONFIG_H__ -#define __EZLOPI_CORE_WS_SERVER_CONFIG_H__ - -#define WEBSOCKET_CLIENT_KEY_LEN 24 - -#endif // __EZLOPI_CORE_WS_SERVER_CONFIG_H__ diff --git a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.c b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.c deleted file mode 100644 index ae5862bb3..000000000 --- a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.c +++ /dev/null @@ -1,103 +0,0 @@ -#include -#include -#include - -#include "ezlopi_util_uuid.h" -#include "ezlopi_core_ws_server_conn.h" - -static s_ws_server_connections_t *ws_conn_head = NULL; - -static s_ws_server_connections_t *__create_ws_conn(void); - -s_ws_server_connections_t *ezlopi_core_ws_server_conn_get_head(void) -{ - return ws_conn_head; -} - -s_ws_server_connections_t *ezlopi_core_ws_server_conn_add_ws_conn(struct netconn *new_net_conn) -{ - s_ws_server_connections_t *ws_conn = NULL; - if (ws_conn_head) - { - s_ws_server_connections_t *curr_conn = ws_conn_head; - while (curr_conn->next) - { - curr_conn = curr_conn->next; - } - - ws_conn = __create_ws_conn(); - if (ws_conn) - { - curr_conn->next = ws_conn; - ws_conn->net_conn = new_net_conn; - } - } - else - { - ws_conn = __create_ws_conn(); - if (ws_conn) - { - ws_conn_head = ws_conn; - ws_conn->net_conn = new_net_conn; - } - } - - return ws_conn; -} - -int ezlopi_core_ws_server_conn_remove(s_ws_server_connections_t *remove_con) -{ - int ret = 0; - - if (remove_con) - { - } - - return ret; -} - -s_ws_server_connections_t *ezlopi_core_ws_server_conn_pop(struct netconn *conn) -{ - s_ws_server_connections_t *pop_con = NULL; - - if (conn == ws_conn_head->net_conn) - { - pop_con = ws_conn_head; - ws_conn_head = ws_conn_head->next; - pop_con->next = NULL; - } - else - { - s_ws_server_connections_t *curr_conn = ws_conn_head; - while (curr_conn->next) - { - if (curr_conn->next->net_conn == conn) - { - pop_con = curr_conn->next; - curr_conn->next = curr_conn->next->next; - pop_con->next = NULL; - break; - } - - curr_conn = curr_conn->next; - } - } - - return pop_con; -} - -static s_ws_server_connections_t *__create_ws_conn(void) -{ - s_ws_server_connections_t *new_ws_conn = malloc(sizeof(s_ws_server_connections_t)); - if (new_ws_conn) - { - new_ws_conn->net_conn = NULL; - new_ws_conn->task_handle = NULL; - - ezlopi_util_uuid_generate_random(new_ws_conn->uuid); - - new_ws_conn->next = NULL; - } - - return new_ws_conn; -} \ No newline at end of file diff --git a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.h b/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.h deleted file mode 100644 index 57f06d1f8..000000000 --- a/ezlopi-core/ezlopi-core-ws-server/ezlopi_core_ws_server_conn.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef __EZLOPI_CORE_WS_SERVER_CONN_H__ -#define __EZLOPI_CORE_WS_SERVER_CONN_H__ - -#include -#include -#include -#include -#include - -#include "ezlopi_util_uuid.h" - -typedef struct s_ws_server_connections -{ - ezlopi_uuid_t uuid; - TaskHandle_t task_handle; - struct netconn *net_conn; - - struct s_ws_server_connections *next; -} s_ws_server_connections_t; - -s_ws_server_connections_t *ezlopi_core_ws_server_conn_get_head(void); -s_ws_server_connections_t *ezlopi_core_ws_server_conn_add_ws_conn(struct netconn *conn); - -#endif // __EZLOPI_CORE_WS_SERVER_CONN_H__ diff --git a/ezlopi-lua-modules/core/CMakeLists.txt b/ezlopi-lua-modules/core/CMakeLists.txt index dfa50a13b..f40e01745 100644 --- a/ezlopi-lua-modules/core/CMakeLists.txt +++ b/ezlopi-lua-modules/core/CMakeLists.txt @@ -1,4 +1,4 @@ file(GLOB_RECURSE src_files "*.c*") idf_component_register(SRCS "core_external_gateway_api.c" "core_others_api.c" "core_updaters_api.c" "core_removers_api.c" "core_adders_api.c" "core_getters_api.c" "corelib.c" "${src_files}" INCLUDE_DIRS "." - REQUIRES lua ezlopi-util-trace ezlopi-core-factory-info ezlopi-core-devices ezlopi-core-gateway ezlopi-util-version helper_functions ) \ No newline at end of file + REQUIRES lua ezlopi-util-trace ezlopi-core-factory-info ezlopi-core-devices ezlopi-core-gateway ezlopi-util-version helper_functions) \ No newline at end of file diff --git a/ezlopi-lua-modules/core/core_getters_api.c b/ezlopi-lua-modules/core/core_getters_api.c index 07fa8ab42..59da10fc5 100644 --- a/ezlopi-lua-modules/core/core_getters_api.c +++ b/ezlopi-lua-modules/core/core_getters_api.c @@ -257,10 +257,8 @@ static int __create_lua_table_for_device(lua_State *lua_state, l_ezlopi_device_t lua_create_table_string_key_value(ezlopi_security_str, controller_info->security); lua_create_table_bool_key_value(ezlopi_ready_str, controller_info->ready); lua_create_table_string_key_value(ezlopi_status_str, controller_info->status ? controller_info->status : ezlopi__str); - -#warning "Krishna needs to verify below 2 lines" - lua_create_table_bool_key_value(ezlopi_house_modes_options_str, ezlopi__str); - lua_create_table_bool_key_value(ezlopi_parent_room_str, ezlopi__str); + lua_create_table_string_key_value(ezlopi_house_modes_options_str, ezlopi__str); + lua_create_table_string_key_value(ezlopi_parent_room_str, ezlopi__str); return 1; } @@ -347,11 +345,9 @@ static int __create_lua_table_for_gateway(lua_State *lua_state, s_ezlopi_gateway lua_create_table_string_key_value(ezlopi_name_str, gateway_prop->name); -#warning "Krishna needs to check below 3 lines" - lua_create_table_bool_key_value(ezlopi_plugin_id_str, gateway_prop->pluginid); - lua_create_table_bool_key_value(ezlopi_label_str, gateway_prop->label); - lua_create_table_bool_key_value(ezlopi_reason_str, ezlopi__str); - + lua_create_table_string_key_value(ezlopi_plugin_id_str, gateway_prop->pluginid); + lua_create_table_string_key_value(ezlopi_label_str, gateway_prop->label); + lua_create_table_string_key_value(ezlopi_reason_str, ezlopi__str); lua_create_table_string_key_value(ezlopi_unreachable_reasons_str, ezlopi__str); lua_create_table_string_key_value(ezlopi_unreachable_actions_str, ezlopi__str); lua_create_table_bool_key_value(ezlopi_manual_device_adding_str, gateway_prop->manual_device_adding); diff --git a/ezlopi-lua-modules/helper_functions/lua_helper_functions.h b/ezlopi-lua-modules/helper_functions/lua_helper_functions.h index d143654dc..47302db3c 100644 --- a/ezlopi-lua-modules/helper_functions/lua_helper_functions.h +++ b/ezlopi-lua-modules/helper_functions/lua_helper_functions.h @@ -7,7 +7,7 @@ lua_pushstring(lua_state, value ? value : ezlopi__str); \ lua_settable(lua_state, -3); \ } -#warning "Compile and check the warning details, Krishna needs to resolve it." +// #warning "Compile and check the warning details, Krishna needs to resolve it." #define lua_create_table_bool_key_value(key, value) \ { \ lua_pushstring(lua_state, key); \ diff --git a/ezlopi-services/ezlopi-service-webprov/CMakeLists.txt b/ezlopi-services/ezlopi-service-webprov/CMakeLists.txt index 6a0ad16e0..0077a47e2 100644 --- a/ezlopi-services/ezlopi-service-webprov/CMakeLists.txt +++ b/ezlopi-services/ezlopi-service-webprov/CMakeLists.txt @@ -2,26 +2,28 @@ file(GLOB_RECURSE provisioning_src "*.c*") set(EZLOPI_CORE_COMPONENTS - ezlopi-core-factory-info ezlopi-core-wifi - ezlopi-core-websocket_client ezlopi-core-http + ezlopi-core-ezlopi + ezlopi-core-event-group + ezlopi-core-factory-info + ezlopi-core-websocket_client ) set(EZLOPI_CLOUD_COMPONENTS - ezlopi-cloud-data - ezlopi-cloud-devices - ezlopi-cloud-scenes - ezlopi-cloud-registration - ezlopi-cloud-favorite - ezlopi-cloud-gateways - ezlopi-cloud-info - ezlopi-cloud-modes - ezlopi-cloud-items - ezlopi-cloud-room - ezlopi-cloud-settings - ezlopi-cloud-network - ezlopi-cloud-ota + # ezlopi-cloud-data + # ezlopi-cloud-devices + # ezlopi-cloud-scenes + # ezlopi-cloud-registration + # ezlopi-cloud-favorite + # ezlopi-cloud-gateways + # ezlopi-cloud-info + # ezlopi-cloud-modes + # ezlopi-cloud-items + # ezlopi-cloud-room + # ezlopi-cloud-settings + # ezlopi-cloud-network + # ezlopi-cloud-ota ) diff --git a/ezlopi-services/ezlopi-service-webprov/ezlopi_service_webprov.c b/ezlopi-services/ezlopi-service-webprov/ezlopi_service_webprov.c index 83be96994..a3fa29dee 100644 --- a/ezlopi-services/ezlopi-service-webprov/ezlopi_service_webprov.c +++ b/ezlopi-services/ezlopi-service-webprov/ezlopi_service_webprov.c @@ -1,34 +1,20 @@ -#include "esp_mac.h" -#include "esp_wifi_types.h" -#include "esp_idf_version.h" +#include +#include +#include +#include +#include #include "ezlopi_util_trace.h" #include "ezlopi_core_wifi.h" #include "ezlopi_core_http.h" -#include "ezlopi_core_factory_info.h" +#include "ezlopi_cloud_constants.h" #include "ezlopi_core_event_group.h" +#include "ezlopi_core_factory_info.h" +#include "ezlopi_core_ezlopi_methods.h" #include "ezlopi_core_websocket_client.h" -#include "ezlopi_cloud_data.h" -#include "ezlopi_cloud_devices.h" -#include "ezlopi_cloud_scenes.h" -#include "ezlopi_cloud_registration.h" -#include "ezlopi_cloud_favorite.h" -#include "ezlopi_cloud_gateways.h" -#include "ezlopi_cloud_info.h" -#include "ezlopi_cloud_modes.h" -#include "ezlopi_cloud_modes_updaters.h" -#include "ezlopi_cloud_items.h" -#include "ezlopi_cloud_room.h" -#include "ezlopi_cloud_network.h" -#include "ezlopi_cloud_ota.h" -#include "ezlopi_cloud_settings.h" -#include "ezlopi_cloud_constants.h" -#include "ezlopi_cloud_scenes_scripts.h" -#include "ezlopi_cloud_scenes_expressions.h" - #include "ezlopi_service_webprov.h" static uint32_t message_counter = 0; @@ -38,27 +24,10 @@ static TaskHandle_t ezlopi_update_config_notifier = NULL; static void __connection_upcall(bool connected); static void __message_upcall(const char *payload, uint32_t len); -static void __rpc_method_notfound(cJSON *cj_request, cJSON *cj_response); -static void __hub_reboot(cJSON *cj_request, cJSON *cj_response); static void __fetch_wss_endpoint(void *pv); static void web_provisioning_config_check(void *pv); static void __print_sending_data(char *data_str, e_trace_type_t print_type); -typedef void (*f_method_func_t)(cJSON *cj_request, cJSON *cj_response); -typedef struct s_method_list_v2 -{ - char *method_name; - f_method_func_t method; - f_method_func_t updater; -} s_method_list_v2_t; - -static const s_method_list_v2_t method_list_v2[] = { -#define CLOUD_METHOD(name, func, updater_func) {.method_name = name, .method = func, .updater = updater_func}, -#include "ezlopi_api_url_macros.h" -#undef CLOUD_METHOD - {.method_name = NULL, .method = NULL, .updater = NULL}, -}; - uint32_t web_provisioning_get_message_count(void) { return message_counter; @@ -500,7 +469,7 @@ static void __connection_upcall(bool connected) { TRACE_S("Web-socket re-connected."); TRACE_I("Starting registration process...."); - registration_init(); + ezlopi_core_ezlopi_methods_registration_init(); } } else @@ -511,32 +480,11 @@ static void __connection_upcall(bool connected) prev_status = connected; } -static uint32_t __search_method_in_list(cJSON *method) -{ - uint32_t found_method = 0; - uint32_t idx = 0; - - while (method_list_v2[idx].method_name) - { - uint32_t request_method_name_len = strlen(method->valuestring); - uint32_t list_method_name_len = strlen(method_list_v2[idx].method_name); - uint32_t comp_len = list_method_name_len > request_method_name_len ? list_method_name_len : request_method_name_len; - if (0 == strncmp(method->valuestring, method_list_v2[idx].method_name, comp_len)) - { - found_method = 1; - break; - } - idx++; - } - - return (found_method ? idx : UINT32_MAX); -} - static void __call_method_and_send_response(cJSON *cj_request, cJSON *cj_method, f_method_func_t method_func, e_trace_type_t print_type) { if (method_func) { - if (registered == method_func) + if (ezlopi_core_elzlopi_methods_check_method_register(method_func)) { method_func(cj_request, NULL); } @@ -586,17 +534,28 @@ static void __message_upcall(const char *payload, uint32_t len) { TRACE_S("## WS Rx <<<<<<<<<< '%s'\r\n%.*s", (cj_method->valuestring ? cj_method->valuestring : ezlopi__str), len, payload); - uint32_t method_idx = __search_method_in_list(cj_method); + uint32_t method_id = ezlopi_core_ezlopi_methods_search_in_list(cj_method); - if (UINT32_MAX != method_idx) + if (UINT32_MAX != method_id) { - TRACE_D("Method[%d]: %s", method_idx, method_list_v2[method_idx].method_name); - __call_method_and_send_response(cj_request, cj_method, method_list_v2[method_idx].method, TRACE_TYPE_D); - __call_method_and_send_response(cj_request, cj_method, method_list_v2[method_idx].updater, TRACE_TYPE_D); + char *method_name = ezlopi_core_ezlopi_methods_get_name_by_id(method_id); + TRACE_D("Method[%d]: %s", method_id, method_name ? method_name : "null"); + + f_method_func_t method = ezlopi_core_ezlopi_methods_get_updater_by_id(method_id); + if (method) + { + __call_method_and_send_response(cj_request, cj_method, method, TRACE_TYPE_D); + } + + f_method_func_t updater = ezlopi_core_ezlopi_methods_get_updater_by_id(method_id); + if (updater) + { + __call_method_and_send_response(cj_request, cj_method, updater, TRACE_TYPE_D); + } } else { - __call_method_and_send_response(cj_request, cj_method, __rpc_method_notfound, TRACE_TYPE_E); + __call_method_and_send_response(cj_request, cj_method, ezlopi_core_ezlopi_methods_rpc_method_notfound, TRACE_TYPE_E); } } } @@ -610,27 +569,6 @@ static void __message_upcall(const char *payload, uint32_t len) } } -static void __rpc_method_notfound(cJSON *cj_request, cJSON *cj_response) -{ - cJSON_AddItemReferenceToObject(cj_response, ezlopi_id_str, cJSON_GetObjectItem(cj_request, ezlopi_id_str)); - cJSON_AddItemReferenceToObject(cj_response, ezlopi_method_str, cJSON_GetObjectItem(cj_request, ezlopi_method_str)); - cJSON *cjson_error = cJSON_AddObjectToObject(cj_response, ezlopi_error_str); - if (cjson_error) - { - cJSON_AddNumberToObject(cjson_error, ezlopi_code_str, -32602); - cJSON_AddStringToObject(cjson_error, ezlopi_data_str, ezlopi_rpc_method_notfound_str); - cJSON_AddStringToObject(cjson_error, ezlopi_message_str, ezlopi_Unknown_method_str); - } - - cJSON_AddObjectToObject(cj_response, ezlopi_result_str); -} - -static void __hub_reboot(cJSON *cj_request, cJSON *cj_response) -{ - web_provisioning_deinit(); - esp_restart(); -} - static void __print_sending_data(char *data_str, e_trace_type_t print_type) { switch (print_type) diff --git a/ezlopi-services/ezlopi-service-ws-server/CMakeLists.txt b/ezlopi-services/ezlopi-service-ws-server/CMakeLists.txt new file mode 100644 index 000000000..b1b372d19 --- /dev/null +++ b/ezlopi-services/ezlopi-service-ws-server/CMakeLists.txt @@ -0,0 +1,29 @@ + +file(GLOB_RECURSE provisioning_src "*.c*") + +set(EZLOPI_UTIL_COMPONENTS + ezlopi-util-trace +) + +set(SDK_COMPONENTS + esp_http_server +) + +set(EZLOPI_CORE_COMPONENTS + ezlopi-core-wifi + ezlopi-core-ezlopi +) + +set(EZLOPI_CLOUD_COMPONENTS + +) + + + +idf_component_register(SRCS "ezlopi_service_ws_server.c" "ezlopi_service_ws_server_clients.c" "${provisioning_src}" + INCLUDE_DIRS "." + REQUIRES ${SDK_COMPONENTS} + ${EZLOPI_CORE_COMPONENTS} + ${EZLOPI_UTIL_COMPONENTS} + ${EZLOPI_CLOUD_COMPONENTS} + ) diff --git a/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.c b/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.c new file mode 100644 index 000000000..d01429706 --- /dev/null +++ b/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.c @@ -0,0 +1,448 @@ +/* WebSocket Echo Server Example + + This example code is in the Public Domain (or CC0 licensed, at your option.) + + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../../build/config/sdkconfig.h" +#include + +#include "ezlopi_core_wifi.h" +#include "ezlopi_util_trace.h" +#include "ezlopi_cloud_constants.h" +#include "ezlopi_service_ws_server.h" +#include "ezlopi_core_cjson_macros.h" +#include "ezlopi_service_ws_server_clients.h" +#include "ezlopi_core_ezlopi_methods.h" + +typedef enum e_trace_type +{ + TRACE_TYPE_NONE = 0, + TRACE_TYPE_W, // Warning (Orange) + TRACE_TYPE_B, + TRACE_TYPE_D, // debug (White) + TRACE_TYPE_I, // Info (Blue) + TRACE_TYPE_E // Error (Red) +} e_trace_type_t; + +typedef struct s_async_resp_arg +{ + int fd; + httpd_handle_t hd; +} s_async_resp_arg_t; + +static uint32_t message_counter = 0; +static httpd_handle_t gs_ws_handle = NULL; +static e_ws_status_t gs_ws_status = WS_STATUS_STOPPED; + +static void __stop_server(void); +static void __start_server(void); +static void __ws_async_send(void *arg); +static esp_err_t __msg_handler(httpd_req_t *req); +static esp_err_t __trigger_async_send(httpd_req_t *req); +static void __ws_api_handler(httpd_req_t *req, const char *payload, uint32_t payload_len); +static void __wifi_connection_event(esp_event_base_t event, int32_t event_id, void *arg); +static void __call_method_and_send_response(cJSON *cj_request, cJSON *cj_method, f_method_func_t method_func, e_trace_type_t print_type); + +e_ws_status_t ezlopi_service_ws_server_status(void) +{ + return gs_ws_status; +} + +int ezlopi_service_ws_server_send_cjson(cJSON *cj_data) +{ + int ret = 0; + + if (cj_data) + { + cJSON *cj_srouce = cJSON_GetObjectItem(cj_data, ezlopi_source_str); + if (cj_srouce) + { + uint32_t client_id = 0; + + CJSON_GET_VALUE_DOUBLE(cj_srouce, ezlopi_client_id_str, client_id) + l_ws_server_client_conn_t *curr_client = ezlopi_service_ws_server_clients_get_by_handle((void *)client_id); + if (curr_client) + { + char *data = cJSON_Print(cj_data); + if (data) + { + cJSON_Minify(data); + ret = ezlopi_service_ws_server_send(curr_client, data, strlen(data)); + free(data); + } + } + } + else + { + char *data = cJSON_Print(cj_data); + if (data) + { + cJSON_Minify(data); + ret = ezlopi_service_ws_server_broadcast(data, strlen(data)); + free(data); + } + } + } + + return ret; +} + +int ezlopi_service_ws_server_broadcast(char *data, uint32_t len) +{ + int ret = 0; + + if (data && len) + { + l_ws_server_client_conn_t *curr_client = ezlopi_service_ws_server_clients_get_head(); + while (curr_client) + { + ret = 1; + ezlopi_service_ws_server_send(curr_client, data, len); + curr_client = curr_client->next; + } + } + + return ret; +} + +int ezlopi_service_ws_server_send(l_ws_server_client_conn_t *client, char *data, uint32_t len) +{ + int ret = 0; + if (data && len && client && client->http_handle) + { + httpd_ws_frame_t frm_pkt = { + .final = false, + .fragmented = false, + .len = len, + .payload = (uint8_t *)data, + .type = HTTPD_WS_TYPE_TEXT, + }; + + TRACE_D("sending to client: %p", client->http_handle); + + if (ESP_OK == httpd_ws_send_data((httpd_req_t *)client->http_handle, client->http_descriptor, &frm_pkt)) + { + client->fail_count = 0; + ret = 1; + } + else + { + client->fail_count += 1; + if (client->fail_count > 5) + { + frm_pkt.len = 0; + frm_pkt.payload = NULL; + frm_pkt.fragmented = false; + frm_pkt.type = HTTPD_WS_TYPE_CLOSE; + httpd_ws_send_data(client->http_handle, client->http_descriptor, &frm_pkt); + ezlopi_service_ws_server_clients_remove_by_handle(client->http_handle); + } + } + } + + return ret; +} + +void ezlopi_service_ws_server_start(void) +{ + ezlopi_wifi_event_add(__wifi_connection_event, NULL); +} + +void ezlopi_service_ws_server_stop(void) +{ + __stop_server(); +} + +static void __wifi_connection_event(esp_event_base_t event_base, int32_t event_id, void *arg) +{ + TRACE_D("event-base: %d, event-id: %d", (uint32_t)event_base, event_id); + + if (IP_EVENT == event_base) + { + if (IP_EVENT_STA_GOT_IP == event_id) + { + __start_server(); + } + else + { + __stop_server(); + } + } + else if (WIFI_EVENT == event_base) + { + if (WIFI_EVENT_STA_DISCONNECTED == event_id) + { + __stop_server(); + } + } +} + +static void __ws_api_handler(httpd_req_t *req, const char *payload, uint32_t payload_len) +{ + TRACE_D("req: %p", req); + + if (payload && payload_len) + { + cJSON *cj_request = cJSON_ParseWithLength(payload, payload_len); + if (cj_request) + { + cJSON *cj_src = cJSON_AddObjectToObject(cj_request, ezlopi_source_str); + if (cj_src) + { + cJSON_AddNumberToObject(cj_src, ezlopi_type_str, 1); + cJSON_AddNumberToObject(cj_src, ezlopi_client_id_str, (uint32_t)req->handle); + } + + CJSON_TRACE("request", cj_request); + + cJSON *cj_error = cJSON_GetObjectItem(cj_request, ezlopi_error_str); + cJSON *cj_method = cJSON_GetObjectItem(cj_request, ezlopi_method_str); + + if ((NULL == cj_error) || (cJSON_NULL == cj_error->type) || (NULL != cj_error->valuestring) || + ((NULL != cj_error->valuestring) && (0 == strncmp(cj_error->valuestring, ezlopi_null_str, 4)))) + { + if ((NULL != cj_method) && (NULL != cj_method->valuestring)) + { + TRACE_S("## WS Rx <<<<<<<<<< '%s'\r\n%.*s", (cj_method->valuestring ? cj_method->valuestring : ezlopi__str), payload_len, payload); + + uint32_t method_id = ezlopi_core_ezlopi_methods_search_in_list(cj_method); + TRACE_D("method_id: %d", method_id); + + if (UINT32_MAX != method_id) + { + char *method_name = ezlopi_core_ezlopi_methods_get_name_by_id(method_id); + TRACE_D("Method[%d]: %s", method_id, method_name ? method_name : "null"); + + f_method_func_t method = ezlopi_core_ezlopi_methods_get_updater_by_id(method_id); + TRACE_D("method: %p", method); + + if (method) + { + __call_method_and_send_response(cj_request, cj_method, method, TRACE_TYPE_D); + } + + f_method_func_t updater = ezlopi_core_ezlopi_methods_get_updater_by_id(method_id); + TRACE_D("method: %p", method); + + if (updater) + { + __call_method_and_send_response(cj_request, cj_method, updater, TRACE_TYPE_D); + } + } + else + { + __call_method_and_send_response(cj_request, cj_method, ezlopi_core_ezlopi_methods_rpc_method_notfound, TRACE_TYPE_E); + } + } + } + else + { + TRACE_E("## WS Rx <<<<<<<<<< '%s'\r\n%.*s", (NULL != cj_method) ? (cj_method->valuestring ? cj_method->valuestring : ezlopi__str) : ezlopi__str, payload_len, payload); + TRACE_E("cj_error: %p, cj_error->type: %u, cj_error->value_string: %s", cj_error, cj_error->type, cj_error ? (cj_error->valuestring ? cj_error->valuestring : ezlopi_null_str) : ezlopi_null_str); + } + + cJSON_Delete(cj_request); + } + else + { + TRACE_W("Invalid json packet!"); + } + } +} + +static void __ws_async_send(void *arg) +{ + static const char *data = "Async data"; + s_async_resp_arg_t *resp_arg = (s_async_resp_arg_t *)arg; + + if (resp_arg) + { + httpd_ws_frame_t ws_pkt; + memset(&ws_pkt, 0, sizeof(httpd_ws_frame_t)); + + ws_pkt.len = strlen(data); + ws_pkt.payload = (uint8_t *)data; + ws_pkt.type = HTTPD_WS_TYPE_TEXT; + + httpd_ws_send_frame_async(resp_arg->hd, resp_arg->fd, &ws_pkt); + free(resp_arg); + } +} + +static esp_err_t __trigger_async_send(httpd_req_t *req) +{ + esp_err_t ret = ESP_OK; + s_async_resp_arg_t *resp_arg = malloc(sizeof(s_async_resp_arg_t)); + + if (resp_arg) + { + resp_arg->hd = req->handle; + resp_arg->fd = httpd_req_to_sockfd(req); + ret = httpd_queue_work(req->handle, __ws_async_send, resp_arg); + } + + return ret; +} + +static esp_err_t __msg_handler(httpd_req_t *req) +{ + esp_err_t ret = ESP_OK; + + if (req->method == HTTP_GET) + { + TRACE_I("Handshake done, the new connection was opened, id: %p", req); + ezlopi_service_ws_server_clients_add((void *)req->handle, httpd_req_to_sockfd(req)); + } + else + { + uint8_t *buf = NULL; + httpd_ws_frame_t ws_pkt; + + memset(&ws_pkt, 0, sizeof(httpd_ws_frame_t)); + ws_pkt.type = HTTPD_WS_TYPE_TEXT; + + ret = httpd_ws_recv_frame(req, &ws_pkt, 0); + + if ((ESP_OK == ret) && (0 < ws_pkt.len)) + { + TRACE_I("frame len is %d", ws_pkt.len); + buf = malloc(ws_pkt.len + 1); + + if (NULL != buf) + { + ws_pkt.payload = buf; + ret = httpd_ws_recv_frame(req, &ws_pkt, ws_pkt.len); + + if (ESP_OK == ret) + { + TRACE_D("Packet type: %d", ws_pkt.type); + TRACE_D("Message: %.*s", ws_pkt.len, ws_pkt.payload); + + if ((HTTPD_WS_TYPE_TEXT == ws_pkt.type) && (0 == strcmp((char *)ws_pkt.payload, "Trigger async"))) + { + ret = __trigger_async_send(req); + } + else if (HTTPD_WS_TYPE_TEXT == ws_pkt.type) + { + __ws_api_handler(req, (char *)ws_pkt.payload, (uint32_t)ws_pkt.len); + } + else if (HTTPD_WS_TYPE_CLOSE == ws_pkt.type) + { + TRACE_D("closing connection!"); + ezlopi_service_ws_server_clients_remove_by_handle(req); + } + else + { + TRACE_W("packet type un-handled!"); + } + } + else + { + TRACE_E("httpd_ws_recv_frame failed with %d", ret); + } + + free(buf); + } + else + { + TRACE_E("malloc failed!"); + ret = ESP_ERR_NO_MEM; + } + } + else + { + TRACE_E("httpd_ws_recv_frame failed to get frame len with %d", ret); + } + } + + return ret; +} + +static void __start_server(void) +{ + static const httpd_uri_t ws = { + .uri = "/ws", + .method = HTTP_GET, + .handler = __msg_handler, + .user_ctx = NULL, + .is_websocket = true, + .handle_ws_control_frames = true, + }; + + httpd_config_t config = HTTPD_DEFAULT_CONFIG(); + config.task_priority = 8; + config.stack_size = 1024 * 8; + + TRACE_I("Starting ws-server on port: '%d'", config.server_port); + + esp_err_t err = httpd_start(&gs_ws_handle, &config); + + if (ESP_OK == err) + { + TRACE_I("Registering URI handlers"); + if (ESP_OK == httpd_register_uri_handler(gs_ws_handle, &ws)) + { + gs_ws_status = WS_STATUS_RUNNING; + } + } + else + { + TRACE_E("Error starting server!, err: %d", err); + } +} + +static void __stop_server(void) +{ + if (gs_ws_handle) + { + TRACE_E("stopping ws-server!"); + httpd_stop(gs_ws_handle); + gs_ws_handle = NULL; + gs_ws_status = WS_STATUS_STOPPED; + } +} + +static void __call_method_and_send_response(cJSON *cj_request, cJSON *cj_method, f_method_func_t method_func, e_trace_type_t print_type) +{ + if (method_func) + { + if (ezlopi_core_elzlopi_methods_check_method_register(method_func)) + { + method_func(cj_request, NULL); + } + else + { + cJSON *cj_response = cJSON_CreateObject(); + if (NULL != cj_response) + { + cJSON *cj_sender = cJSON_GetObjectItem(cj_request, ezlopi_sender_str); + + cJSON_AddNumberToObject(cj_response, ezlopi_msg_id_str, message_counter); + cJSON_AddItemReferenceToObject(cj_response, ezlopi_sender_str, cj_sender); + cJSON_AddNullToObject(cj_response, ezlopi_error_str); + + method_func(cj_request, cj_response); + + ezlopi_service_ws_server_send_cjson(cj_response); + cJSON_Delete(cj_response); + } + else + { + TRACE_E("Error - cj_response: %d", (uint32_t)cj_response); + } + } + } +} diff --git a/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.h b/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.h new file mode 100644 index 000000000..8e8c74895 --- /dev/null +++ b/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.h @@ -0,0 +1,20 @@ +#ifndef __EZLOPI_SERVICE_WS_SERVER_H__ +#define __EZLOPI_SERVICE_WS_SERVER_H__ + +#include +#include "ezlopi_service_ws_server_clients.h" + +typedef enum e_ws_status +{ + WS_STATUS_RUNNING = 0, + WS_STATUS_STOPPED, +} e_ws_status_t; + +void ezlopi_service_ws_server_stop(void); +void ezlopi_service_ws_server_start(void); +e_ws_status_t ezlopi_service_ws_server_status(void); +int ezlopi_service_ws_server_send_cjson(cJSON *cj_data); +int ezlopi_service_ws_server_broadcast(char *data, uint32_t len); +int ezlopi_service_ws_server_send(l_ws_server_client_conn_t *client, char *data, uint32_t len); + +#endif // __EZLOPI_SERVICE_WS_SERVER_H__ \ No newline at end of file diff --git a/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server_clients.c b/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server_clients.c new file mode 100644 index 000000000..55a6e03fd --- /dev/null +++ b/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server_clients.c @@ -0,0 +1,134 @@ +#include +#include + +#include "ezlopi_service_ws_server.h" +#include "ezlopi_service_ws_server_clients.h" + +static l_ws_server_client_conn_t *l_client_conn_head = NULL; + +static l_ws_server_client_conn_t *__create_client_conn(void); + +l_ws_server_client_conn_t *ezlopi_service_ws_server_clients_get_head(void) +{ + return l_client_conn_head; +} + +l_ws_server_client_conn_t *ezlopi_service_ws_server_clients_get_by_handle(void *http_handle) +{ + l_ws_server_client_conn_t *curr_client = l_client_conn_head; + while (curr_client) + { + if (curr_client->http_handle == http_handle) + { + break; + } + curr_client = curr_client->next; + } + + return curr_client; +} + +l_ws_server_client_conn_t *ezlopi_service_ws_server_clients_add(void *http_handle, int http_descriptor) +{ + l_ws_server_client_conn_t *ws_client_conn = NULL; + if (l_client_conn_head) + { + if (l_client_conn_head->http_handle != http_handle) + { + uint32_t dup_flag = 0; + l_ws_server_client_conn_t *curr_conn = l_client_conn_head; + while (curr_conn->next) + { + if (curr_conn->next->http_handle == http_handle) + { + dup_flag = 1; + break; + } + curr_conn = curr_conn->next; + } + + if (0 == dup_flag) + { + ws_client_conn = __create_client_conn(); + if (ws_client_conn) + { + curr_conn->next = ws_client_conn; + ws_client_conn->http_handle = http_handle; + ws_client_conn->http_descriptor = http_descriptor; + } + } + } + } + else + { + ws_client_conn = __create_client_conn(); + if (ws_client_conn) + { + l_client_conn_head = ws_client_conn; + ws_client_conn->http_handle = http_handle; + ws_client_conn->http_descriptor = http_descriptor; + } + } + + return ws_client_conn; +} + +int ezlopi_service_ws_server_clients_remove_by_handle(void *http_handle) +{ + int ret = 0; + + if (http_handle) + { + l_ws_server_client_conn_t *ws_popped_con = ezlopi_service_ws_server_clients_pop(http_handle); + if (ws_popped_con) + { + free(ws_popped_con); + } + } + + return ret; +} + +l_ws_server_client_conn_t *ezlopi_service_ws_server_clients_pop(void *http_handle) +{ + l_ws_server_client_conn_t *pop_con = NULL; + + if (http_handle == l_client_conn_head->http_handle) + { + pop_con = l_client_conn_head; + l_client_conn_head = l_client_conn_head->next; + pop_con->next = NULL; + } + else + { + l_ws_server_client_conn_t *curr_conn = l_client_conn_head; + while (curr_conn->next) + { + if (curr_conn->next->http_handle == http_handle) + { + pop_con = curr_conn->next; + curr_conn->next = curr_conn->next->next; + pop_con->next = NULL; + break; + } + + curr_conn = curr_conn->next; + } + } + + return pop_con; +} + +static l_ws_server_client_conn_t *__create_client_conn(void) +{ + l_ws_server_client_conn_t *new_ws_conn = malloc(sizeof(l_ws_server_client_conn_t)); + if (new_ws_conn) + { + new_ws_conn->fail_count = 0; + new_ws_conn->http_handle = NULL; + new_ws_conn->http_descriptor = 0; + new_ws_conn->next = NULL; + } + + return new_ws_conn; +} diff --git a/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server_clients.h b/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server_clients.h new file mode 100644 index 000000000..bbda95223 --- /dev/null +++ b/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server_clients.h @@ -0,0 +1,19 @@ +#ifndef __EZLOPI_SERVICE_WS_SERVER_CLIENTS_H__ +#define __EZLOPI_SERVICE_WS_SERVER_CLIENTS_H__ + +typedef struct l_ws_server_client_conn +{ + void *http_handle; + int http_descriptor; + uint32_t fail_count; + + struct l_ws_server_client_conn *next; +} l_ws_server_client_conn_t; + +int ezlopi_service_ws_server_clients_remove_by_handle(void *http_handle); +l_ws_server_client_conn_t *ezlopi_service_ws_server_clients_get_head(void); +l_ws_server_client_conn_t *ezlopi_service_ws_server_clients_pop(void *http_handle); +l_ws_server_client_conn_t *ezlopi_service_ws_server_clients_get_by_handle(void *http_handle); +l_ws_server_client_conn_t *ezlopi_service_ws_server_clients_add(void *http_handle, int http_desc); + +#endif // __EZLOPI_SERVICE_WS_SERVER_CLIENTS_H__ \ No newline at end of file diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 043851d6f..fd6b2e515 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -3,9 +3,9 @@ file(GLOB_RECURSE config_src "*.c") # Define SDK components set(EZLOPI_SDK_COMPONENTS - driver - nghttp - esp_http_server + # driver + # nghttp + # esp_http_server # protocol_examples_common ) @@ -36,20 +36,22 @@ set(EZLOPI_SENSOR_DEVICE_COMPONENTS # Define service components set(EZLOPI_SERVICES - ezlopi-service-webprov - ezlopi-service-timer - ezlopi-service-gpioisr ezlopi-service-ble ezlopi-service-ota - ezlopi-service-meshbot ezlopi-service-uart ezlopi-service-modes + ezlopi-service-timer + ezlopi-service-webprov + ezlopi-service-gpioisr + ezlopi-service-meshbot + ezlopi-service-ws-server ) # Register the components -idf_component_register(SRCS "ezlopi_main.c" "${config_src}" +idf_component_register(SRCS "${config_src}" INCLUDE_DIRS "." - REQUIRES ${EZLOPI_CORE_COMPONENTS} + REQUIRES ${EZLOPI_COMPONENTS} + ${EZLOPI_CORE_COMPONENTS} ${EZLOPI_HAL_COMPONENTS} ${EZLOPI_CLOUD_COMPONENTS} ${EZLOPI_SENSOR_DEVICE_COMPONENTS} diff --git a/main/ezlopi_main.c b/main/ezlopi_main.c index 019f231f0..73678daca 100644 --- a/main/ezlopi_main.c +++ b/main/ezlopi_main.c @@ -19,11 +19,11 @@ #include "ezlopi_service_meshbot.h" #include "ezlopi_service_gpioisr.h" #include "ezlopi_service_webprov.h" +#include "ezlopi_service_ws_server.h" #define ENABLE_HEARTBIT_LED 0 static void blinky(void *pv); -// extern void wss_server_init(void); void app_main(void) { @@ -31,13 +31,13 @@ void app_main(void) qt_serial_init(); gpio_isr_service_init(); ezlopi_init(); - // ezlopi_ble_service_init(); - // timer_service_init(); - // ezlopi_scenes_meshbot_init(); - // web_provisioning_init(); - // ota_service_init(); - // ezlopi_service_modes_init(); - // wss_server_init(); + ezlopi_ble_service_init(); + timer_service_init(); + ezlopi_scenes_meshbot_init(); + web_provisioning_init(); + ota_service_init(); + ezlopi_service_modes_init(); + ezlopi_service_ws_server_start(); xTaskCreate(blinky, "blinky", 2 * 2048, NULL, 1, NULL); } @@ -67,11 +67,12 @@ static void blinky(void *pv) if (count++ > 10) { + count = 0; + trace_wb("-----------------------------------------"); trace_wb("esp_get_free_heap_size - %f kB", esp_get_free_heap_size() / 1024.0); trace_wb("esp_get_minimum_free_heap_size: %f kB", esp_get_minimum_free_heap_size() / 1024.0); trace_wb("-----------------------------------------"); - count = 0; } vTaskDelay(1000 / portTICK_PERIOD_MS); diff --git a/sdkconfig b/sdkconfig index cd4782851..7c8e0f577 100644 --- a/sdkconfig +++ b/sdkconfig @@ -50,6 +50,14 @@ CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y # CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set # CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set CONFIG_BOOTLOADER_LOG_LEVEL=0 + +# +# Serial Flash Configurations +# +# CONFIG_BOOTLOADER_FLASH_DC_AWARE is not set +CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y +# end of Serial Flash Configurations + # CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V is not set CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y # CONFIG_BOOTLOADER_FACTORY_RESET is not set @@ -64,7 +72,6 @@ CONFIG_BOOTLOADER_WDT_TIME_MS=9000 # CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 # CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set -CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y # end of Bootloader config # @@ -98,6 +105,7 @@ CONFIG_ESPTOOLPY_FLASHMODE_DIO=y # CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y CONFIG_ESPTOOLPY_FLASHMODE="dio" +CONFIG_ESPTOOLPY_S3_STR=y # CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set CONFIG_ESPTOOLPY_FLASHFREQ_40M=y @@ -481,6 +489,7 @@ CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=y # CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY is not set # CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK is not set CONFIG_BT_SMP_ENABLE=y +CONFIG_BT_SMP_MAX_BONDS=15 # CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN is not set CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT=30 CONFIG_BT_MAX_DEVICE_NAME_LEN=32 @@ -706,7 +715,7 @@ CONFIG_OTA_ALLOW_HTTP=y # # ESP HTTPS server # -CONFIG_ESP_HTTPS_SERVER_ENABLE=y +# CONFIG_ESP_HTTPS_SERVER_ENABLE is not set # end of ESP HTTPS server # @@ -754,6 +763,10 @@ CONFIG_ESP_IPC_ISR_ENABLE=y # LCD and Touch Panel # +# +# LCD Touch Drivers are maintained in the IDF Component Registry +# + # # LCD Peripheral Configuration # @@ -1203,6 +1216,13 @@ CONFIG_LWIP_SNTP_MAX_SERVERS=3 CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 # end of SNTP +# +# DNS +# +CONFIG_LWIP_DNS_MAX_SERVERS=3 +# CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT is not set +# end of DNS + CONFIG_LWIP_ESP_LWIP_ASSERT=y # @@ -1436,6 +1456,26 @@ CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" # end of PThreads +# +# Main Flash configuration +# + +# +# Optional and Experimental Features (READ DOCS FIRST) +# + +# +# Features here require specific hardware (READ DOCS FIRST!) +# +# CONFIG_SPI_FLASH_HPM_ENA is not set +CONFIG_SPI_FLASH_HPM_AUTO=y +# CONFIG_SPI_FLASH_HPM_DIS is not set +CONFIG_SPI_FLASH_HPM_ON=y +CONFIG_SPI_FLASH_HPM_DC_AUTO=y +# CONFIG_SPI_FLASH_HPM_DC_DISABLE is not set +# end of Optional and Experimental Features (READ DOCS FIRST) +# end of Main Flash configuration + # # SPI Flash driver # @@ -1520,6 +1560,12 @@ CONFIG_WS_BUFFER_SIZE=1024 # end of Websocket # end of TCP Transport +# +# TinyUSB Stack +# +# CONFIG_TINYUSB is not set +# end of TinyUSB Stack + # # Unity unit testing library # @@ -1944,6 +1990,7 @@ CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y # CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set # CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set +# CONFIG_USB_ENABLED is not set CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y CONFIG_SUPPORT_TERMIOS=y CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 diff --git a/sdkconfig.old b/sdkconfig.old index 3749415e8..d629eb163 100644 --- a/sdkconfig.old +++ b/sdkconfig.old @@ -106,12 +106,12 @@ CONFIG_ESPTOOLPY_FLASHFREQ="40m" # CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y +CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y +# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE="16MB" +CONFIG_ESPTOOLPY_FLASHSIZE="8MB" CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y CONFIG_ESPTOOLPY_BEFORE_RESET=y # CONFIG_ESPTOOLPY_BEFORE_NORESET is not set @@ -694,7 +694,7 @@ CONFIG_HTTPD_MAX_URI_LEN=512 CONFIG_HTTPD_ERR_RESP_NO_DELAY=y CONFIG_HTTPD_PURGE_BUF_LEN=32 # CONFIG_HTTPD_LOG_PURGE_DATA is not set -CONFIG_HTTPD_WS_SUPPORT=y +# CONFIG_HTTPD_WS_SUPPORT is not set # end of HTTP Server # @@ -1520,12 +1520,6 @@ CONFIG_WS_BUFFER_SIZE=1024 # end of Websocket # end of TCP Transport -# -# TinyUSB Stack -# -# CONFIG_TINYUSB is not set -# end of TinyUSB Stack - # # Unity unit testing library # @@ -1626,332 +1620,3 @@ CONFIG_LUA_ROOT="/lua" # # CONFIG_LEGACY_INCLUDE_COMMON_HEADERS is not set # end of Compatibility options - -# Deprecated options for backward compatibility -CONFIG_TOOLPREFIX="xtensa-esp32s3-elf-" -CONFIG_LOG_BOOTLOADER_LEVEL_NONE=y -# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_INFO is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set -CONFIG_LOG_BOOTLOADER_LEVEL=0 -# CONFIG_APP_ROLLBACK_ENABLE is not set -# CONFIG_FLASH_ENCRYPTION_ENABLED is not set -# CONFIG_FLASHMODE_QIO is not set -# CONFIG_FLASHMODE_QOUT is not set -CONFIG_FLASHMODE_DIO=y -# CONFIG_FLASHMODE_DOUT is not set -# CONFIG_MONITOR_BAUD_9600B is not set -# CONFIG_MONITOR_BAUD_57600B is not set -CONFIG_MONITOR_BAUD_115200B=y -# CONFIG_MONITOR_BAUD_230400B is not set -# CONFIG_MONITOR_BAUD_921600B is not set -# CONFIG_MONITOR_BAUD_2MB is not set -# CONFIG_MONITOR_BAUD_OTHER is not set -CONFIG_MONITOR_BAUD_OTHER_VAL=115200 -CONFIG_MONITOR_BAUD=115200 -CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG=y -# CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set -CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y -# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set -# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set -CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2 -# CONFIG_CXX_EXCEPTIONS is not set -CONFIG_STACK_CHECK_NONE=y -# CONFIG_STACK_CHECK_NORM is not set -# CONFIG_STACK_CHECK_STRONG is not set -# CONFIG_STACK_CHECK_ALL is not set -# CONFIG_WARN_WRITE_STRINGS is not set -# CONFIG_DISABLE_GCC8_WARNINGS is not set -# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set -CONFIG_ESP32_APPTRACE_DEST_NONE=y -CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y -CONFIG_BLUEDROID_ENABLED=y -# CONFIG_NIMBLE_ENABLED is not set -CONFIG_BTC_TASK_STACK_SIZE=3072 -CONFIG_BLUEDROID_PINNED_TO_CORE_0=y -# CONFIG_BLUEDROID_PINNED_TO_CORE_1 is not set -CONFIG_BLUEDROID_PINNED_TO_CORE=0 -CONFIG_BTU_TASK_STACK_SIZE=4096 -# CONFIG_BLUEDROID_MEM_DEBUG is not set -CONFIG_GATTS_ENABLE=y -# CONFIG_GATTS_SEND_SERVICE_CHANGE_MANUAL is not set -CONFIG_GATTS_SEND_SERVICE_CHANGE_AUTO=y -CONFIG_GATTS_SEND_SERVICE_CHANGE_MODE=0 -CONFIG_GATTC_ENABLE=y -# CONFIG_GATTC_CACHE_NVS_FLASH is not set -CONFIG_BLE_SMP_ENABLE=y -# CONFIG_SMP_SLAVE_CON_PARAMS_UPD_ENABLE is not set -# CONFIG_HCI_TRACE_LEVEL_NONE is not set -# CONFIG_HCI_TRACE_LEVEL_ERROR is not set -CONFIG_HCI_TRACE_LEVEL_WARNING=y -# CONFIG_HCI_TRACE_LEVEL_API is not set -# CONFIG_HCI_TRACE_LEVEL_EVENT is not set -# CONFIG_HCI_TRACE_LEVEL_DEBUG is not set -# CONFIG_HCI_TRACE_LEVEL_VERBOSE is not set -CONFIG_HCI_INITIAL_TRACE_LEVEL=2 -# CONFIG_BTM_TRACE_LEVEL_NONE is not set -# CONFIG_BTM_TRACE_LEVEL_ERROR is not set -CONFIG_BTM_TRACE_LEVEL_WARNING=y -# CONFIG_BTM_TRACE_LEVEL_API is not set -# CONFIG_BTM_TRACE_LEVEL_EVENT is not set -# CONFIG_BTM_TRACE_LEVEL_DEBUG is not set -# CONFIG_BTM_TRACE_LEVEL_VERBOSE is not set -CONFIG_BTM_INITIAL_TRACE_LEVEL=2 -# CONFIG_L2CAP_TRACE_LEVEL_NONE is not set -# CONFIG_L2CAP_TRACE_LEVEL_ERROR is not set -CONFIG_L2CAP_TRACE_LEVEL_WARNING=y -# CONFIG_L2CAP_TRACE_LEVEL_API is not set -# CONFIG_L2CAP_TRACE_LEVEL_EVENT is not set -# CONFIG_L2CAP_TRACE_LEVEL_DEBUG is not set -# CONFIG_L2CAP_TRACE_LEVEL_VERBOSE is not set -CONFIG_L2CAP_INITIAL_TRACE_LEVEL=2 -# CONFIG_RFCOMM_TRACE_LEVEL_NONE is not set -# CONFIG_RFCOMM_TRACE_LEVEL_ERROR is not set -CONFIG_RFCOMM_TRACE_LEVEL_WARNING=y -# CONFIG_RFCOMM_TRACE_LEVEL_API is not set -# CONFIG_RFCOMM_TRACE_LEVEL_EVENT is not set -# CONFIG_RFCOMM_TRACE_LEVEL_DEBUG is not set -# CONFIG_RFCOMM_TRACE_LEVEL_VERBOSE is not set -CONFIG_RFCOMM_INITIAL_TRACE_LEVEL=2 -# CONFIG_SDP_TRACE_LEVEL_NONE is not set -# CONFIG_SDP_TRACE_LEVEL_ERROR is not set -CONFIG_SDP_TRACE_LEVEL_WARNING=y -# CONFIG_SDP_TRACE_LEVEL_API is not set -# CONFIG_SDP_TRACE_LEVEL_EVENT is not set -# CONFIG_SDP_TRACE_LEVEL_DEBUG is not set -# CONFIG_SDP_TRACE_LEVEL_VERBOSE is not set -CONFIG_BTH_LOG_SDP_INITIAL_TRACE_LEVEL=2 -# CONFIG_GAP_TRACE_LEVEL_NONE is not set -# CONFIG_GAP_TRACE_LEVEL_ERROR is not set -CONFIG_GAP_TRACE_LEVEL_WARNING=y -# CONFIG_GAP_TRACE_LEVEL_API is not set -# CONFIG_GAP_TRACE_LEVEL_EVENT is not set -# CONFIG_GAP_TRACE_LEVEL_DEBUG is not set -# CONFIG_GAP_TRACE_LEVEL_VERBOSE is not set -CONFIG_GAP_INITIAL_TRACE_LEVEL=2 -CONFIG_BNEP_INITIAL_TRACE_LEVEL=2 -# CONFIG_PAN_TRACE_LEVEL_NONE is not set -# CONFIG_PAN_TRACE_LEVEL_ERROR is not set -CONFIG_PAN_TRACE_LEVEL_WARNING=y -# CONFIG_PAN_TRACE_LEVEL_API is not set -# CONFIG_PAN_TRACE_LEVEL_EVENT is not set -# CONFIG_PAN_TRACE_LEVEL_DEBUG is not set -# CONFIG_PAN_TRACE_LEVEL_VERBOSE is not set -CONFIG_PAN_INITIAL_TRACE_LEVEL=2 -# CONFIG_A2D_TRACE_LEVEL_NONE is not set -# CONFIG_A2D_TRACE_LEVEL_ERROR is not set -CONFIG_A2D_TRACE_LEVEL_WARNING=y -# CONFIG_A2D_TRACE_LEVEL_API is not set -# CONFIG_A2D_TRACE_LEVEL_EVENT is not set -# CONFIG_A2D_TRACE_LEVEL_DEBUG is not set -# CONFIG_A2D_TRACE_LEVEL_VERBOSE is not set -CONFIG_A2D_INITIAL_TRACE_LEVEL=2 -# CONFIG_AVDT_TRACE_LEVEL_NONE is not set -# CONFIG_AVDT_TRACE_LEVEL_ERROR is not set -CONFIG_AVDT_TRACE_LEVEL_WARNING=y -# CONFIG_AVDT_TRACE_LEVEL_API is not set -# CONFIG_AVDT_TRACE_LEVEL_EVENT is not set -# CONFIG_AVDT_TRACE_LEVEL_DEBUG is not set -# CONFIG_AVDT_TRACE_LEVEL_VERBOSE is not set -CONFIG_AVDT_INITIAL_TRACE_LEVEL=2 -# CONFIG_AVCT_TRACE_LEVEL_NONE is not set -# CONFIG_AVCT_TRACE_LEVEL_ERROR is not set -CONFIG_AVCT_TRACE_LEVEL_WARNING=y -# CONFIG_AVCT_TRACE_LEVEL_API is not set -# CONFIG_AVCT_TRACE_LEVEL_EVENT is not set -# CONFIG_AVCT_TRACE_LEVEL_DEBUG is not set -# CONFIG_AVCT_TRACE_LEVEL_VERBOSE is not set -CONFIG_AVCT_INITIAL_TRACE_LEVEL=2 -# CONFIG_AVRC_TRACE_LEVEL_NONE is not set -# CONFIG_AVRC_TRACE_LEVEL_ERROR is not set -CONFIG_AVRC_TRACE_LEVEL_WARNING=y -# CONFIG_AVRC_TRACE_LEVEL_API is not set -# CONFIG_AVRC_TRACE_LEVEL_EVENT is not set -# CONFIG_AVRC_TRACE_LEVEL_DEBUG is not set -# CONFIG_AVRC_TRACE_LEVEL_VERBOSE is not set -CONFIG_AVRC_INITIAL_TRACE_LEVEL=2 -# CONFIG_MCA_TRACE_LEVEL_NONE is not set -# CONFIG_MCA_TRACE_LEVEL_ERROR is not set -CONFIG_MCA_TRACE_LEVEL_WARNING=y -# CONFIG_MCA_TRACE_LEVEL_API is not set -# CONFIG_MCA_TRACE_LEVEL_EVENT is not set -# CONFIG_MCA_TRACE_LEVEL_DEBUG is not set -# CONFIG_MCA_TRACE_LEVEL_VERBOSE is not set -CONFIG_MCA_INITIAL_TRACE_LEVEL=2 -# CONFIG_HID_TRACE_LEVEL_NONE is not set -# CONFIG_HID_TRACE_LEVEL_ERROR is not set -CONFIG_HID_TRACE_LEVEL_WARNING=y -# CONFIG_HID_TRACE_LEVEL_API is not set -# CONFIG_HID_TRACE_LEVEL_EVENT is not set -# CONFIG_HID_TRACE_LEVEL_DEBUG is not set -# CONFIG_HID_TRACE_LEVEL_VERBOSE is not set -CONFIG_HID_INITIAL_TRACE_LEVEL=2 -# CONFIG_APPL_TRACE_LEVEL_NONE is not set -# CONFIG_APPL_TRACE_LEVEL_ERROR is not set -CONFIG_APPL_TRACE_LEVEL_WARNING=y -# CONFIG_APPL_TRACE_LEVEL_API is not set -# CONFIG_APPL_TRACE_LEVEL_EVENT is not set -# CONFIG_APPL_TRACE_LEVEL_DEBUG is not set -# CONFIG_APPL_TRACE_LEVEL_VERBOSE is not set -CONFIG_APPL_INITIAL_TRACE_LEVEL=2 -# CONFIG_GATT_TRACE_LEVEL_NONE is not set -# CONFIG_GATT_TRACE_LEVEL_ERROR is not set -CONFIG_GATT_TRACE_LEVEL_WARNING=y -# CONFIG_GATT_TRACE_LEVEL_API is not set -# CONFIG_GATT_TRACE_LEVEL_EVENT is not set -# CONFIG_GATT_TRACE_LEVEL_DEBUG is not set -# CONFIG_GATT_TRACE_LEVEL_VERBOSE is not set -CONFIG_GATT_INITIAL_TRACE_LEVEL=2 -# CONFIG_SMP_TRACE_LEVEL_NONE is not set -# CONFIG_SMP_TRACE_LEVEL_ERROR is not set -CONFIG_SMP_TRACE_LEVEL_WARNING=y -# CONFIG_SMP_TRACE_LEVEL_API is not set -# CONFIG_SMP_TRACE_LEVEL_EVENT is not set -# CONFIG_SMP_TRACE_LEVEL_DEBUG is not set -# CONFIG_SMP_TRACE_LEVEL_VERBOSE is not set -CONFIG_SMP_INITIAL_TRACE_LEVEL=2 -# CONFIG_BTIF_TRACE_LEVEL_NONE is not set -# CONFIG_BTIF_TRACE_LEVEL_ERROR is not set -CONFIG_BTIF_TRACE_LEVEL_WARNING=y -# CONFIG_BTIF_TRACE_LEVEL_API is not set -# CONFIG_BTIF_TRACE_LEVEL_EVENT is not set -# CONFIG_BTIF_TRACE_LEVEL_DEBUG is not set -# CONFIG_BTIF_TRACE_LEVEL_VERBOSE is not set -CONFIG_BTIF_INITIAL_TRACE_LEVEL=2 -# CONFIG_BTC_TRACE_LEVEL_NONE is not set -# CONFIG_BTC_TRACE_LEVEL_ERROR is not set -CONFIG_BTC_TRACE_LEVEL_WARNING=y -# CONFIG_BTC_TRACE_LEVEL_API is not set -# CONFIG_BTC_TRACE_LEVEL_EVENT is not set -# CONFIG_BTC_TRACE_LEVEL_DEBUG is not set -# CONFIG_BTC_TRACE_LEVEL_VERBOSE is not set -CONFIG_BTC_INITIAL_TRACE_LEVEL=2 -# CONFIG_OSI_TRACE_LEVEL_NONE is not set -# CONFIG_OSI_TRACE_LEVEL_ERROR is not set -CONFIG_OSI_TRACE_LEVEL_WARNING=y -# CONFIG_OSI_TRACE_LEVEL_API is not set -# CONFIG_OSI_TRACE_LEVEL_EVENT is not set -# CONFIG_OSI_TRACE_LEVEL_DEBUG is not set -# CONFIG_OSI_TRACE_LEVEL_VERBOSE is not set -CONFIG_OSI_INITIAL_TRACE_LEVEL=2 -# CONFIG_BLUFI_TRACE_LEVEL_NONE is not set -# CONFIG_BLUFI_TRACE_LEVEL_ERROR is not set -CONFIG_BLUFI_TRACE_LEVEL_WARNING=y -# CONFIG_BLUFI_TRACE_LEVEL_API is not set -# CONFIG_BLUFI_TRACE_LEVEL_EVENT is not set -# CONFIG_BLUFI_TRACE_LEVEL_DEBUG is not set -# CONFIG_BLUFI_TRACE_LEVEL_VERBOSE is not set -CONFIG_BLUFI_INITIAL_TRACE_LEVEL=2 -# CONFIG_BLE_HOST_QUEUE_CONGESTION_CHECK is not set -CONFIG_SMP_ENABLE=y -# CONFIG_BLE_ACTIVE_SCAN_REPORT_ADV_SCAN_RSP_INDIVIDUALLY is not set -CONFIG_BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT=30 -CONFIG_ADC2_DISABLE_DAC=y -# CONFIG_EVENT_LOOP_PROFILING is not set -CONFIG_POST_EVENTS_FROM_ISR=y -CONFIG_POST_EVENTS_FROM_IRAM_ISR=y -CONFIG_ESP_SYSTEM_PD_FLASH=y -CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND=y -CONFIG_IPC_TASK_STACK_SIZE=1536 -CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y -# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set -CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 -CONFIG_ESP32_PHY_MAX_TX_POWER=20 -# CONFIG_ESP32_REDUCE_PHY_TX_POWER is not set -CONFIG_ESP_SYSTEM_PM_POWER_DOWN_CPU=y -# CONFIG_ESP32S2_PANIC_PRINT_HALT is not set -CONFIG_ESP32S2_PANIC_PRINT_REBOOT=y -# CONFIG_ESP32S2_PANIC_SILENT_REBOOT is not set -# CONFIG_ESP32S2_PANIC_GDBSTUB is not set -CONFIG_ESP32S2_ALLOW_RTC_FAST_MEM_AS_HEAP=y -CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 -CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=3072 -CONFIG_MAIN_TASK_STACK_SIZE=3584 -CONFIG_CONSOLE_UART_DEFAULT=y -# CONFIG_CONSOLE_UART_CUSTOM is not set -# CONFIG_ESP_CONSOLE_UART_NONE is not set -CONFIG_CONSOLE_UART=y -CONFIG_CONSOLE_UART_NUM=0 -CONFIG_CONSOLE_UART_BAUDRATE=115200 -CONFIG_INT_WDT=y -CONFIG_INT_WDT_TIMEOUT_MS=300 -CONFIG_INT_WDT_CHECK_CPU1=y -CONFIG_TASK_WDT=y -# CONFIG_TASK_WDT_PANIC is not set -CONFIG_TASK_WDT_TIMEOUT_S=5 -CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y -CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y -# CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set -CONFIG_TIMER_TASK_STACK_SIZE=3584 -CONFIG_SW_COEXIST_ENABLE=y -# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set -CONFIG_ESP32_ENABLE_COREDUMP_TO_UART=y -# CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE is not set -# CONFIG_ESP32_COREDUMP_DATA_FORMAT_BIN is not set -CONFIG_ESP32_COREDUMP_DATA_FORMAT_ELF=y -CONFIG_ESP32_COREDUMP_CHECKSUM_CRC32=y -CONFIG_ESP32_ENABLE_COREDUMP=y -CONFIG_ESP32_CORE_DUMP_MAX_TASKS_NUM=64 -CONFIG_ESP32_CORE_DUMP_UART_DELAY=0 -CONFIG_ESP32_CORE_DUMP_STACK_SIZE=0 -CONFIG_ESP32_CORE_DUMP_DECODE_INFO=y -# CONFIG_ESP32_CORE_DUMP_DECODE_DISABLE is not set -CONFIG_ESP32_CORE_DUMP_DECODE="info" -CONFIG_MB_MASTER_TIMEOUT_MS_RESPOND=150 -CONFIG_MB_MASTER_DELAY_MS_CONVERT=200 -CONFIG_MB_QUEUE_LENGTH=20 -CONFIG_MB_SERIAL_TASK_STACK_SIZE=4096 -CONFIG_MB_SERIAL_BUF_SIZE=256 -CONFIG_MB_SERIAL_TASK_PRIO=10 -# CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT is not set -CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT=20 -CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE=20 -CONFIG_MB_CONTROLLER_STACK_SIZE=4096 -CONFIG_MB_EVENT_QUEUE_TIMEOUT=20 -# CONFIG_MB_TIMER_PORT_ENABLED is not set -# CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set -CONFIG_TIMER_TASK_PRIORITY=1 -CONFIG_TIMER_TASK_STACK_DEPTH=2048 -CONFIG_TIMER_QUEUE_LENGTH=10 -# CONFIG_L2_TO_L3_COPY is not set -# CONFIG_USE_ONLY_LWIP_SELECT is not set -CONFIG_ESP_GRATUITOUS_ARP=y -CONFIG_GARP_TMR_INTERVAL=60 -CONFIG_TCPIP_RECVMBOX_SIZE=32 -CONFIG_TCP_MAXRTX=12 -CONFIG_TCP_SYNMAXRTX=12 -CONFIG_TCP_MSS=1440 -CONFIG_TCP_MSL=60000 -CONFIG_TCP_SND_BUF_DEFAULT=5744 -CONFIG_TCP_WND_DEFAULT=5744 -CONFIG_TCP_RECVMBOX_SIZE=6 -CONFIG_TCP_QUEUE_OOSEQ=y -# CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set -CONFIG_TCP_OVERSIZE_MSS=y -# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set -# CONFIG_TCP_OVERSIZE_DISABLE is not set -CONFIG_UDP_RECVMBOX_SIZE=6 -CONFIG_TCPIP_TASK_STACK_SIZE=3072 -CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y -# CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set -# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set -CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF -# CONFIG_PPP_SUPPORT is not set -CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 -CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 -CONFIG_ESP32_PTHREAD_STACK_MIN=768 -CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y -# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set -# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set -CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 -CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" -CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y -# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set -# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set -# CONFIG_USB_ENABLED is not set -CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y -CONFIG_SUPPORT_TERMIOS=y -CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 -# End of deprecated options From eab0930c467031385683f4918b362afd276392ee Mon Sep 17 00:00:00 2001 From: Krishna Kumar Sah Date: Sun, 25 Feb 2024 15:17:20 +0545 Subject: [PATCH 18/27] fixed pointer issue, encountered ws-freezing on ws-send --- .../ezlopi_core_ezlopi_methods.c | 11 -- .../ezlopi_service_ws_server.c | 102 ++++++++++++++---- main/CMakeLists.txt | 2 +- main/ezlopi_main.c | 4 + 4 files changed, 85 insertions(+), 34 deletions(-) diff --git a/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_methods.c b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_methods.c index 62113ad06..7c3559304 100644 --- a/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_methods.c +++ b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_methods.c @@ -30,22 +30,16 @@ static const s_method_list_v2_t method_list_v2[] = { f_method_func_t ezlopi_core_ezlopi_methods_get_by_id(uint32_t method_id) { - TRACE_D("method_id: %u", method_id); - TRACE_D("function ptr: %p", method_list_v2[method_id].method); return method_list_v2[method_id].method; } f_method_func_t ezlopi_core_ezlopi_methods_get_updater_by_id(uint32_t method_id) { - TRACE_D("method_id: %u", method_id); - TRACE_D("function ptr: %p", method_list_v2[method_id].updater); return method_list_v2[method_id].updater; } char *ezlopi_core_ezlopi_methods_get_name_by_id(uint32_t method_id) { - TRACE_D("method_id: %u", method_id); - TRACE_D("method_name: %s", method_list_v2[method_id].method_name); return method_list_v2[method_id].method_name; } @@ -58,11 +52,6 @@ uint32_t ezlopi_core_ezlopi_methods_search_in_list(cJSON *cj_method) { while (method_list_v2[idx].method_name) { - TRACE_D("idx: %d", idx); - TRACE_D("name: %s", method_list_v2[idx].method_name); - TRACE_D("method: %p", method_list_v2[idx].method); - TRACE_D("updater: %p\n", method_list_v2[idx].updater); - uint32_t request_method_name_len = strlen(cj_method->valuestring); uint32_t list_method_name_len = strlen(method_list_v2[idx].method_name); uint32_t comp_len = list_method_name_len > request_method_name_len ? list_method_name_len : request_method_name_len; diff --git a/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.c b/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.c index d01429706..68d61dd2a 100644 --- a/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.c +++ b/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.c @@ -55,6 +55,7 @@ static esp_err_t __trigger_async_send(httpd_req_t *req); static void __ws_api_handler(httpd_req_t *req, const char *payload, uint32_t payload_len); static void __wifi_connection_event(esp_event_base_t event, int32_t event_id, void *arg); static void __call_method_and_send_response(cJSON *cj_request, cJSON *cj_method, f_method_func_t method_func, e_trace_type_t print_type); +static void __print_sending_data(char *data_str, e_trace_type_t print_type); e_ws_status_t ezlopi_service_ws_server_status(void) { @@ -79,11 +80,17 @@ int ezlopi_service_ws_server_send_cjson(cJSON *cj_data) char *data = cJSON_Print(cj_data); if (data) { + TRACE_D("sending: %s", data); cJSON_Minify(data); - ret = ezlopi_service_ws_server_send(curr_client, data, strlen(data)); + ret = ezlopi_service_ws_server_broadcast(data, strlen(data)); + free(data); } } + else + { + TRACE_E("NULL"); + } } else { @@ -123,31 +130,39 @@ int ezlopi_service_ws_server_send(l_ws_server_client_conn_t *client, char *data, int ret = 0; if (data && len && client && client->http_handle) { - httpd_ws_frame_t frm_pkt = { - .final = false, - .fragmented = false, - .len = len, - .payload = (uint8_t *)data, - .type = HTTPD_WS_TYPE_TEXT, - }; + httpd_ws_frame_t frm_pkt; - TRACE_D("sending to client: %p", client->http_handle); + memset(&frm_pkt, 0, sizeof(httpd_ws_frame_t)); - if (ESP_OK == httpd_ws_send_data((httpd_req_t *)client->http_handle, client->http_descriptor, &frm_pkt)) + frm_pkt.len = len; + frm_pkt.payload = (uint8_t *)data; + frm_pkt.type = HTTPD_WS_TYPE_TEXT; + + TRACE_D("client-handle: %p", client->http_handle); + TRACE_D("client-desc: %d", client->http_descriptor); + TRACE_D("data: %.*s", frm_pkt.len, frm_pkt.payload); + + if (ESP_OK == httpd_ws_send_data(client->http_handle, client->http_descriptor, &frm_pkt)) { - client->fail_count = 0; ret = 1; + client->fail_count = 0; + + TRACE_S("Done"); + __print_sending_data((char *)frm_pkt.payload, TRACE_TYPE_D); } else { client->fail_count += 1; + + TRACE_E("Failed!"); + __print_sending_data((char *)frm_pkt.payload, TRACE_TYPE_E); + if (client->fail_count > 5) { - frm_pkt.len = 0; - frm_pkt.payload = NULL; - frm_pkt.fragmented = false; - frm_pkt.type = HTTPD_WS_TYPE_CLOSE; - httpd_ws_send_data(client->http_handle, client->http_descriptor, &frm_pkt); + // frm_pkt.len = 0; + // frm_pkt.payload = ""; + // frm_pkt.type = HTTPD_WS_TYPE_CLOSE; + // httpd_ws_send_data(client->http_handle, client->http_descriptor, &frm_pkt); ezlopi_service_ws_server_clients_remove_by_handle(client->http_handle); } } @@ -224,9 +239,9 @@ static void __ws_api_handler(httpd_req_t *req, const char *payload, uint32_t pay if (UINT32_MAX != method_id) { char *method_name = ezlopi_core_ezlopi_methods_get_name_by_id(method_id); - TRACE_D("Method[%d]: %s", method_id, method_name ? method_name : "null"); + TRACE_D("Method:: id:[%d], name: %s", method_id, method_name ? method_name : "null"); - f_method_func_t method = ezlopi_core_ezlopi_methods_get_updater_by_id(method_id); + f_method_func_t method = ezlopi_core_ezlopi_methods_get_by_id(method_id); TRACE_D("method: %p", method); if (method) @@ -235,7 +250,7 @@ static void __ws_api_handler(httpd_req_t *req, const char *payload, uint32_t pay } f_method_func_t updater = ezlopi_core_ezlopi_methods_get_updater_by_id(method_id); - TRACE_D("method: %p", method); + TRACE_D("updater: %p", updater); if (updater) { @@ -428,15 +443,21 @@ static void __call_method_and_send_response(cJSON *cj_request, cJSON *cj_method, cJSON *cj_response = cJSON_CreateObject(); if (NULL != cj_response) { - cJSON *cj_sender = cJSON_GetObjectItem(cj_request, ezlopi_sender_str); - cJSON_AddNumberToObject(cj_response, ezlopi_msg_id_str, message_counter); - cJSON_AddItemReferenceToObject(cj_response, ezlopi_sender_str, cj_sender); + cJSON_AddItemReferenceToObject(cj_response, ezlopi_sender_str, cJSON_GetObjectItem(cj_request, ezlopi_sender_str)); cJSON_AddNullToObject(cj_response, ezlopi_error_str); method_func(cj_request, cj_response); + CJSON_TRACE("cj_response", cj_response); ezlopi_service_ws_server_send_cjson(cj_response); + // char *data = cJSON_Print(cj_request); + // if (data) + // { + // cJSON_Minify(data); + // ezlopi_service_ws_server_send(); + // free(data); + // } cJSON_Delete(cj_response); } else @@ -446,3 +467,40 @@ static void __call_method_and_send_response(cJSON *cj_request, cJSON *cj_method, } } } + +static void __print_sending_data(char *data_str, e_trace_type_t print_type) +{ + switch (print_type) + { + case TRACE_TYPE_W: + { + TRACE_W("## WSS-SENDING >>>>>>>>>>>>>>>>>>>\r\n%s", data_str); + break; + } + case TRACE_TYPE_B: + { + TRACE_I("## WSS-SENDING >>>>>>>>>>>>>>>>>>>\r\n%s", data_str); + break; + } + case TRACE_TYPE_D: + { + TRACE_D("## WSS-SENDING >>>>>>>>>>>>>>>>>>>\r\n%s", data_str); + break; + } + case TRACE_TYPE_E: + { + TRACE_E("## WSS-SENDING >>>>>>>>>>>>>>>>>>>\r\n%s", data_str); + break; + } + case TRACE_TYPE_I: + { + TRACE_S("## WSS-SENDING >>>>>>>>>>\r\n%s", data_str); + break; + } + default: + { + TRACE_E("## WSS-SENDING >>>>>>>>>>\r\n%s", data_str); + break; + } + } +} diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index fd6b2e515..a0f507eef 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -48,7 +48,7 @@ set(EZLOPI_SERVICES ) # Register the components -idf_component_register(SRCS "${config_src}" +idf_component_register(SRCS "ezlopi_main.c" "${config_src}" INCLUDE_DIRS "." REQUIRES ${EZLOPI_COMPONENTS} ${EZLOPI_CORE_COMPONENTS} diff --git a/main/ezlopi_main.c b/main/ezlopi_main.c index 73678daca..96852d976 100644 --- a/main/ezlopi_main.c +++ b/main/ezlopi_main.c @@ -72,7 +72,11 @@ static void blinky(void *pv) trace_wb("-----------------------------------------"); trace_wb("esp_get_free_heap_size - %f kB", esp_get_free_heap_size() / 1024.0); trace_wb("esp_get_minimum_free_heap_size: %f kB", esp_get_minimum_free_heap_size() / 1024.0); + trace_wb("-----------------------------------------"); + + char *sdfgh = "asdfghjkl"; + ezlopi_service_ws_server_broadcast(sdfgh, strlen(sdfgh)); } vTaskDelay(1000 / portTICK_PERIOD_MS); From bfe0638e6101e0295034585351f58e445b2f1c14 Mon Sep 17 00:00:00 2001 From: Krishna Kumar Sah Date: Mon, 26 Feb 2024 14:47:23 +0545 Subject: [PATCH 19/27] debugging issue - ws-server freezes while sending data from response --- .../ezlopi-core-wifi/ezlopi_core_wifi.c | 4 +- .../ezlopi_service_ws_server.c | 178 ++++++++++++------ 2 files changed, 120 insertions(+), 62 deletions(-) diff --git a/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.c b/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.c index a8b9a54de..e0f236b59 100644 --- a/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.c +++ b/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.c @@ -210,8 +210,8 @@ void ezlopi_wifi_connect_from_id_bin(void) } else { - strcpy(&wifi_ssid_pass_global_buffer[00], "krishna home_2.4"); - strcpy(&wifi_ssid_pass_global_buffer[32], "coldWinter"); + strcpy(&wifi_ssid_pass_global_buffer[00], "nepaldigisys"); + strcpy(&wifi_ssid_pass_global_buffer[32], "NDS_0ffice"); } ezlopi_factory_info_v3_free(wifi_ssid); diff --git a/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.c b/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.c index 68d61dd2a..59e2afcf2 100644 --- a/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.c +++ b/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.c @@ -15,6 +15,9 @@ #include #include #include +#include +#include +#include #include "../../build/config/sdkconfig.h" #include @@ -46,6 +49,7 @@ typedef struct s_async_resp_arg static uint32_t message_counter = 0; static httpd_handle_t gs_ws_handle = NULL; static e_ws_status_t gs_ws_status = WS_STATUS_STOPPED; +static SemaphoreHandle_t send_lock = NULL; static void __stop_server(void); static void __start_server(void); @@ -128,43 +132,84 @@ int ezlopi_service_ws_server_broadcast(char *data, uint32_t len) int ezlopi_service_ws_server_send(l_ws_server_client_conn_t *client, char *data, uint32_t len) { int ret = 0; - if (data && len && client && client->http_handle) + if (data && len && client && client->http_handle && send_lock) { - httpd_ws_frame_t frm_pkt; + if (pdTRUE == xSemaphoreTake(send_lock, 2000 / portTICK_PERIOD_MS)) + { + TRACE_S("ws-server send-lock acquired."); - memset(&frm_pkt, 0, sizeof(httpd_ws_frame_t)); + static const uint32_t data_buffer_len = 20; + static uint8_t data_buffer[20]; - frm_pkt.len = len; - frm_pkt.payload = (uint8_t *)data; - frm_pkt.type = HTTPD_WS_TYPE_TEXT; + uint32_t loop_count = len / data_buffer_len; + loop_count = (len % data_buffer_len) ? (loop_count + 1) : loop_count; - TRACE_D("client-handle: %p", client->http_handle); - TRACE_D("client-desc: %d", client->http_descriptor); - TRACE_D("data: %.*s", frm_pkt.len, frm_pkt.payload); + TRACE_D("loop-count: %d", loop_count); - if (ESP_OK == httpd_ws_send_data(client->http_handle, client->http_descriptor, &frm_pkt)) - { - ret = 1; - client->fail_count = 0; + for (uint32_t count = 0; count < loop_count; count++) + { + memset(data_buffer, 0, data_buffer_len); - TRACE_S("Done"); - __print_sending_data((char *)frm_pkt.payload, TRACE_TYPE_D); - } - else - { - client->fail_count += 1; + httpd_ws_frame_t frm_pkt; + memset(&frm_pkt, 0, sizeof(httpd_ws_frame_t)); - TRACE_E("Failed!"); - __print_sending_data((char *)frm_pkt.payload, TRACE_TYPE_E); + static const char *test_data = "hello world!"; + frm_pkt.len = strlen(test_data); + frm_pkt.payload = test_data; + frm_pkt.type = HTTPD_WS_TYPE_TEXT; - if (client->fail_count > 5) - { - // frm_pkt.len = 0; - // frm_pkt.payload = ""; - // frm_pkt.type = HTTPD_WS_TYPE_CLOSE; - // httpd_ws_send_data(client->http_handle, client->http_descriptor, &frm_pkt); - ezlopi_service_ws_server_clients_remove_by_handle(client->http_handle); + // frm_pkt.len = snprintf((char *)frm_pkt.payload, data_buffer_len, "%.*s", data_buffer_len, (char *)(data + (data_buffer_len * count))); + + if (loop_count > 1) + { + frm_pkt.fragmented = true; + } + + if (count == loop_count - 1) + { + frm_pkt.final = true; + } + + TRACE_D("count: %d", count); + TRACE_D("client-handle: %p", client->http_handle); + TRACE_D("client-desc: %d", client->http_descriptor); + TRACE_D("data[%d]: %.*s", frm_pkt.len, frm_pkt.len, frm_pkt.payload); + + if (ESP_OK == httpd_ws_send_data(client->http_handle, client->http_descriptor, &frm_pkt)) + { + ret = 1; + client->fail_count = 0; + + TRACE_S("Done"); + __print_sending_data((char *)frm_pkt.payload, TRACE_TYPE_D); + } + else + { + TRACE_E("Failed!"); + + ret = 0; + client->fail_count += 1; + __print_sending_data((char *)frm_pkt.payload, TRACE_TYPE_E); + + if (client->fail_count > 5) + { + ezlopi_service_ws_server_clients_remove_by_handle(client->http_handle); + break; + } + } + + if (count == loop_count) + { + frm_pkt.final = true; + } } + + TRACE_S("ws-server send-lock released."); + xSemaphoreGive(send_lock); + } + else + { + TRACE_E("ws-server send-lock failed!"); } } @@ -388,34 +433,38 @@ static esp_err_t __msg_handler(httpd_req_t *req) static void __start_server(void) { - static const httpd_uri_t ws = { - .uri = "/ws", - .method = HTTP_GET, - .handler = __msg_handler, - .user_ctx = NULL, - .is_websocket = true, - .handle_ws_control_frames = true, - }; + send_lock = xSemaphoreCreateMutex(); + if (send_lock) + { + static const httpd_uri_t ws = { + .uri = "/ws", + .method = HTTP_GET, + .handler = __msg_handler, + .user_ctx = NULL, + .is_websocket = true, + .handle_ws_control_frames = true, + }; - httpd_config_t config = HTTPD_DEFAULT_CONFIG(); - config.task_priority = 8; - config.stack_size = 1024 * 8; + httpd_config_t config = HTTPD_DEFAULT_CONFIG(); + config.task_priority = 8; + config.stack_size = 1024 * 18; - TRACE_I("Starting ws-server on port: '%d'", config.server_port); + TRACE_I("Starting ws-server on port: '%d'", config.server_port); - esp_err_t err = httpd_start(&gs_ws_handle, &config); + esp_err_t err = httpd_start(&gs_ws_handle, &config); - if (ESP_OK == err) - { - TRACE_I("Registering URI handlers"); - if (ESP_OK == httpd_register_uri_handler(gs_ws_handle, &ws)) + if (ESP_OK == err) { - gs_ws_status = WS_STATUS_RUNNING; + TRACE_I("Registering URI handlers"); + if (ESP_OK == httpd_register_uri_handler(gs_ws_handle, &ws)) + { + gs_ws_status = WS_STATUS_RUNNING; + } + } + else + { + TRACE_E("Error starting server!, err: %d", err); } - } - else - { - TRACE_E("Error starting server!, err: %d", err); } } @@ -428,6 +477,12 @@ static void __stop_server(void) gs_ws_handle = NULL; gs_ws_status = WS_STATUS_STOPPED; } + + if (send_lock) + { + vSemaphoreDelete(send_lock); + send_lock = NULL; + } } static void __call_method_and_send_response(cJSON *cj_request, cJSON *cj_method, f_method_func_t method_func, e_trace_type_t print_type) @@ -448,17 +503,20 @@ static void __call_method_and_send_response(cJSON *cj_request, cJSON *cj_method, cJSON_AddNullToObject(cj_response, ezlopi_error_str); method_func(cj_request, cj_response); - CJSON_TRACE("cj_response", cj_response); - - ezlopi_service_ws_server_send_cjson(cj_response); - // char *data = cJSON_Print(cj_request); - // if (data) - // { - // cJSON_Minify(data); - // ezlopi_service_ws_server_send(); - // free(data); - // } + // CJSON_TRACE("cj_response", cj_response); + + // ezlopi_service_ws_server_send_cjson(cj_response); + char *data = cJSON_Print(cj_request); cJSON_Delete(cj_response); + + if (data) + { + cJSON_Minify(data); + // ezlopi_service_ws_server_send(); + ezlopi_service_ws_server_broadcast(data, strlen(data)); + vTaskDelay(5000 / portTICK_PERIOD_MS); + free(data); + } } else { From bc2360fddf2fe0f31d509d23d35a70238353ade7 Mon Sep 17 00:00:00 2001 From: KrrishnaShah Date: Mon, 26 Feb 2024 15:59:30 +0545 Subject: [PATCH 20/27] fixed ws-server freezing isssue, added broadcast-methods registration --- .../ezlopi_cloud_registration.c | 2 + .../ezlopi-core-devices/CMakeLists.txt | 2 +- .../ezlopi_core_device_value_updated.c | 62 ++- ezlopi-core/ezlopi-core-ezlopi/CMakeLists.txt | 2 +- .../ezlopi_core_ezlopi_broadcast.c | 79 ++++ .../ezlopi_core_ezlopi_broadcast.h | 23 + .../ezlopi-core-room/ezlopi_core_room.c | 2 + ezlopi-core/ezlopi-core-scenes/CMakeLists.txt | 2 +- .../ezlopi_core_scenes_status_changed.c | 11 +- .../ezlopi_service_modes.c | 20 +- .../ezlopi-service-ota/ezlopi_service_ota.c | 2 + .../ezlopi_service_webprov.h | 3 +- .../ezlopi_service_ws_server.c | 262 ++++++----- .../ezlopi_service_ws_server.h | 7 +- ezlopi_partitions_v3_1_4_181_8mb.csv | 8 + main/ezlopi_main.c | 5 +- sdkconfig | 75 +--- sdkconfig.old | 422 +++++++++++++++++- 18 files changed, 756 insertions(+), 233 deletions(-) create mode 100644 ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_broadcast.c create mode 100644 ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_broadcast.h create mode 100644 ezlopi_partitions_v3_1_4_181_8mb.csv diff --git a/ezlopi-cloud/ezlopi-cloud-registration/ezlopi_cloud_registration.c b/ezlopi-cloud/ezlopi-cloud-registration/ezlopi_cloud_registration.c index 63c33ff6f..daef44d00 100644 --- a/ezlopi-cloud/ezlopi-cloud-registration/ezlopi_cloud_registration.c +++ b/ezlopi-cloud/ezlopi-cloud-registration/ezlopi_cloud_registration.c @@ -46,7 +46,9 @@ static void registration_process(void *pv) cJSON_AddStringToObject(cj_register, "id", "__ID__"); cJSON_AddStringToObject(cj_register, ezlopi_method_str, "register"); + cJSON *cj_params = cJSON_AddObjectToObject(cj_register, ezlopi_params_str); + if (cj_params) { cJSON_AddStringToObject(cj_params, ezlopi_firmware_str, VERSION_STR); diff --git a/ezlopi-core/ezlopi-core-devices/CMakeLists.txt b/ezlopi-core/ezlopi-core-devices/CMakeLists.txt index 12738a8bf..4fba00a83 100644 --- a/ezlopi-core/ezlopi-core-devices/CMakeLists.txt +++ b/ezlopi-core/ezlopi-core-devices/CMakeLists.txt @@ -86,7 +86,7 @@ set(EZLOPI_SENSOR_DEVICE_COMPONENTS ) -idf_component_register(SRCS "ezlopi_core_devices.c" "${config_src}" +idf_component_register(SRCS "ezlopi_core_device_value_updated.c" "ezlopi_core_devices.c" "${config_src}" INCLUDE_DIRS "." REQUIRES ${EZLOPI_CORE_COMPONENTS} ${EZLOPI_HAL_COMPONENTS} diff --git a/ezlopi-core/ezlopi-core-devices/ezlopi_core_device_value_updated.c b/ezlopi-core/ezlopi-core-devices/ezlopi_core_device_value_updated.c index ea5a04d69..cbcd8f8d0 100644 --- a/ezlopi-core/ezlopi-core-devices/ezlopi_core_device_value_updated.c +++ b/ezlopi-core/ezlopi-core-devices/ezlopi_core_device_value_updated.c @@ -1,7 +1,11 @@ #include "ezlopi_cloud_items.h" #include "ezlopi_cloud_settings.h" -#include "ezlopi_service_webprov.h" + #include "ezlopi_core_devices_list.h" +#include "ezlopi_core_ezlopi_broadcast.h" + +#include "ezlopi_service_webprov.h" +// #include "ezlopi_service_ws_server.h" int ezlopi_device_value_updated_from_device_v3(l_ezlopi_item_t *item) { @@ -13,27 +17,33 @@ int ezlopi_device_value_updated_from_device_v3(l_ezlopi_item_t *item) while (curr_device) { l_ezlopi_item_t *curr_item = curr_device->items; + while (curr_item) { if (item == curr_item) { cJSON *cj_response = ezlopi_cloud_items_updated_from_devices_v3(curr_device, item); + if (cj_response) { char *data_to_send = cJSON_Print(cj_response); cJSON_Delete(cj_response); + if (data_to_send) { cJSON_Minify(data_to_send); ret = web_provisioning_send_str_data_to_nma_websocket(data_to_send, TRACE_TYPE_D); - // ret = web_provisioning_send_to_nma_websocket(cj_response, TRACE_TYPE_D); + ezlopi_core_ezlopi_broadcast_execute(data_to_send); free(data_to_send); } } + break; } + curr_item = curr_item->next; } + curr_device = curr_device->next; } } @@ -45,35 +55,37 @@ int ezlopi_device_value_updated_from_device_item_id_v3(uint32_t item_id) { int ret = 0; - // if (item) + l_ezlopi_device_t *curr_device = ezlopi_device_get_head(); + while (curr_device) { - l_ezlopi_device_t *curr_device = ezlopi_device_get_head(); - while (curr_device) + l_ezlopi_item_t *curr_item = curr_device->items; + + while (curr_item) { - l_ezlopi_item_t *curr_item = curr_device->items; - while (curr_item) + if (item_id == curr_item->cloud_properties.item_id) { - if (item_id == curr_item->cloud_properties.item_id) + cJSON *cj_response = ezlopi_cloud_items_updated_from_devices_v3(curr_device, curr_item); + + if (cj_response) { - cJSON *cj_response = ezlopi_cloud_items_updated_from_devices_v3(curr_device, curr_item); - if (cj_response) + char *data_to_send = cJSON_Print(cj_response); + cJSON_Delete(cj_response); + + if (data_to_send) { - char *data_to_send = cJSON_Print(cj_response); - cJSON_Delete(cj_response); - if (data_to_send) - { - cJSON_Minify(data_to_send); - ret = web_provisioning_send_str_data_to_nma_websocket(data_to_send, TRACE_TYPE_D); - // ret = web_provisioning_send_to_nma_websocket(cj_response, TRACE_TYPE_D); - free(data_to_send); - } + cJSON_Minify(data_to_send); + ret = web_provisioning_send_str_data_to_nma_websocket(data_to_send, TRACE_TYPE_D); + ezlopi_core_ezlopi_broadcast_execute(data_to_send); + free(data_to_send); } - break; } - curr_item = curr_item->next; + break; } - curr_device = curr_device->next; + + curr_item = curr_item->next; } + + curr_device = curr_device->next; } return ret; @@ -98,12 +110,13 @@ int ezlopi_setting_value_updated_from_device_v3(l_ezlopi_device_settings_v3_t *s { char *data_to_send = cJSON_Print(cj_response); cJSON_Delete(cj_response); + if (data_to_send) { cJSON_Minify(data_to_send); ret = web_provisioning_send_str_data_to_nma_websocket(data_to_send, TRACE_TYPE_D); + ezlopi_core_ezlopi_broadcast_execute(data_to_send); free(data_to_send); - // ret = web_provisioning_send_to_nma_websocket(cj_response, TRACE_TYPE_B); } } break; @@ -136,12 +149,13 @@ int ezlopi_setting_value_updated_from_device_settings_id_v3(uint32_t setting_id) { char *data_to_send = cJSON_Print(cj_response); cJSON_Delete(cj_response); + if (data_to_send) { cJSON_Minify(data_to_send); ret = web_provisioning_send_str_data_to_nma_websocket(data_to_send, TRACE_TYPE_D); + ezlopi_core_ezlopi_broadcast_execute(data_to_send); free(data_to_send); - // ret = web_provisioning_send_to_nma_websocket(cj_response, TRACE_TYPE_B); } } break; diff --git a/ezlopi-core/ezlopi-core-ezlopi/CMakeLists.txt b/ezlopi-core/ezlopi-core-ezlopi/CMakeLists.txt index e54eab148..c4002429e 100644 --- a/ezlopi-core/ezlopi-core-ezlopi/CMakeLists.txt +++ b/ezlopi-core/ezlopi-core-ezlopi/CMakeLists.txt @@ -26,7 +26,7 @@ set(EZLOPI_CLOUD_COMPONENTS ezlopi-cloud-ota ) -idf_component_register(SRCS "ezlopi_core_ezlopi_methods.c" "ezlopi_core_ezlopi.c" "${config_src}" +idf_component_register(SRCS "ezlopi_core_ezlopi_broadcast.c" "ezlopi_core_ezlopi_methods.c" "ezlopi_core_ezlopi.c" "${config_src}" INCLUDE_DIRS "." REQUIRES ${EZLOPI_CORE_COMPONENTS} ${EZLOPI_CLOUD_COMPONENTS} diff --git a/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_broadcast.c b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_broadcast.c new file mode 100644 index 000000000..1556dff21 --- /dev/null +++ b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_broadcast.c @@ -0,0 +1,79 @@ +#include "ezlopi_util_trace.h" +#include "ezlopi_core_ezlopi_broadcast.h" + +static l_broadcast_method_t *method_head = NULL; + +static l_broadcast_method_t *__method_create(f_broadcast_method_t method, uint32_t retries); + +void ezlopi_core_ezlopi_broadcast_execute(char *data) +{ + if (data) + { + l_broadcast_method_t *curr_node = method_head; + while (curr_node) + { + if (curr_node->func) + { + uint32_t retries = curr_node->fail_retry; + TRACE_D("broadcast-method-name: %s", curr_node->method_name ? curr_node->method_name : ""); + do + { + if (curr_node->func(data) > 0) + { + break; + } + + } while (--retries); + } + + curr_node = curr_node->next; + } + } +} + +l_broadcast_method_t *ezlopi_core_ezlopi_broadcast_method_add(f_broadcast_method_t broadcast_method, uint32_t retries) +{ + l_broadcast_method_t *ret = __method_create(broadcast_method, retries); + + if (ret) + { + if (method_head) + { + l_broadcast_method_t *curr_node = method_head; + + while (curr_node->next) + { + curr_node = curr_node->next; + } + + curr_node->next = ret; + } + else + { + method_head = ret; + } + } + + return ret; +} + +static l_broadcast_method_t *__method_create(f_broadcast_method_t method, uint32_t retries) +{ + l_broadcast_method_t *method_node = NULL; + + if (method) + { + l_broadcast_method_t *method_node = malloc(sizeof(l_broadcast_method_t)); + + if (method_node) + { + memset(method_node, 0, sizeof(l_broadcast_method_t)); + + method_node->next = NULL; + method_node->func = method; + method_node->fail_retry = retries; + } + } + + return method_node; +} \ No newline at end of file diff --git a/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_broadcast.h b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_broadcast.h new file mode 100644 index 000000000..0be0ffe30 --- /dev/null +++ b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_broadcast.h @@ -0,0 +1,23 @@ +#ifndef __EZLOPI_CORE_EZLOPI_BROADCAST_H__ +#define __EZLOPI_CORE_EZLOPI_BROADCAST_H__ + +#include +#include +#include +#include + +typedef int (*f_broadcast_method_t)(char *data); + +typedef struct l_broadcast_method +{ + char *method_name; + uint32_t fail_retry; + f_broadcast_method_t func; + struct l_broadcast_method *next; + +} l_broadcast_method_t; + +void ezlopi_core_ezlopi_broadcast_execute(char *data); +l_broadcast_method_t *ezlopi_core_ezlopi_broadcast_method_add(f_broadcast_method_t broadcast_method, uint32_t retries); + +#endif // __EZLOPI_CORE_EZLOPI_BROADCAST_H__ diff --git a/ezlopi-core/ezlopi-core-room/ezlopi_core_room.c b/ezlopi-core/ezlopi-core-room/ezlopi_core_room.c index f854aaf02..b05c542b8 100644 --- a/ezlopi-core/ezlopi-core-room/ezlopi_core_room.c +++ b/ezlopi-core/ezlopi-core-room/ezlopi_core_room.c @@ -4,6 +4,7 @@ #include "ezlopi_core_room.h" #include "ezlopi_core_cloud.h" #include "ezlopi_core_cjson_macros.h" +#include "ezlopi_core_ezlopi_broadcast.h" #include "ezlopi_cloud_constants.h" @@ -437,6 +438,7 @@ static void __update_cloud_room_deleted(uint32_t room_id) { cJSON_Minify(data_str); web_provisioning_send_str_data_to_nma_websocket(data_str, TRACE_TYPE_B); + ezlopi_core_ezlopi_broadcast_execute(data_str); free(data_str); } } diff --git a/ezlopi-core/ezlopi-core-scenes/CMakeLists.txt b/ezlopi-core/ezlopi-core-scenes/CMakeLists.txt index 37367538a..9cb73c5f0 100644 --- a/ezlopi-core/ezlopi-core-scenes/CMakeLists.txt +++ b/ezlopi-core/ezlopi-core-scenes/CMakeLists.txt @@ -2,7 +2,7 @@ file(GLOB_RECURSE config_src "*.c") -idf_component_register(SRCS "${config_src}" +idf_component_register(SRCS "ezlopi_core_scenes_status_changed.c" "${config_src}" INCLUDE_DIRS "." REQUIRES core ) \ No newline at end of file diff --git a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_status_changed.c b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_status_changed.c index c22097782..cbfb3e4da 100644 --- a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_status_changed.c +++ b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_status_changed.c @@ -1,7 +1,10 @@ -#include "ezlopi_service_webprov.h" #include "ezlopi_cloud_constants.h" + +#include "ezlopi_core_ezlopi_broadcast.h" #include "ezlopi_core_scenes_status_changed.h" +#include "ezlopi_service_webprov.h" + int ezlopi_scenes_status_change_broadcast(l_scenes_list_v2_t *scene_node, const char *status_str) { int ret = 0; @@ -48,16 +51,14 @@ int ezlopi_scenes_status_change_broadcast(l_scenes_list_v2_t *scene_node, const char *data_to_send = cJSON_Print(cj_response); cJSON_Delete(cj_response); - + if (data_to_send) { cJSON_Minify(data_to_send); ret = web_provisioning_send_str_data_to_nma_websocket(data_to_send, TRACE_TYPE_D); + ezlopi_core_ezlopi_broadcast_execute(data_to_send); free(data_to_send); } - - // ret = web_provisioning_send_to_nma_websocket(cj_response, TRACE_TYPE_I); - // cJSON_Delete(cj_response); } } diff --git a/ezlopi-services/ezlopi-service-modes/ezlopi_service_modes.c b/ezlopi-services/ezlopi-service-modes/ezlopi_service_modes.c index 9269808a9..26ba27f5d 100644 --- a/ezlopi-services/ezlopi-service-modes/ezlopi_service_modes.c +++ b/ezlopi-services/ezlopi-service-modes/ezlopi_service_modes.c @@ -3,13 +3,15 @@ #include "ezlopi_util_trace.h" +#include "ezlopi_cloud_modes.h" + #include "ezlopi_core_modes.h" #include "ezlopi_core_devices.h" -#include "ezlopi_cloud_modes.h" #include "ezlopi_core_modes_cjson.h" -#include "ezlopi_service_webprov.h" +#include "ezlopi_core_ezlopi_broadcast.h" #include "ezlopi_service_modes.h" +#include "ezlopi_service_webprov.h" static TaskHandle_t sg_process_handle = NULL; @@ -81,10 +83,18 @@ static void __modes_service(void *pv) ezlopi_core_modes_store_to_nvs(); - cJSON *cj_response = ezlopi_core_modes_cjson_changed(); - if (cj_response) + cJSON *cj_update = ezlopi_core_modes_cjson_changed(); + if (cj_update) { - web_provisioning_send_to_nma_websocket(cj_response, TRACE_TYPE_I); + char *update_str = cJSON_Print(cj_update); + cJSON_Delete(cj_update); + + if (update_str) + { + web_provisioning_send_str_data_to_nma_websocket(update_str, TRACE_TYPE_I); + ezlopi_core_ezlopi_broadcast_execute(update_str); + free(update_str); + } } } } diff --git a/ezlopi-services/ezlopi-service-ota/ezlopi_service_ota.c b/ezlopi-services/ezlopi-service-ota/ezlopi_service_ota.c index 2259a2d93..27db9c472 100644 --- a/ezlopi-services/ezlopi-service-ota/ezlopi_service_ota.c +++ b/ezlopi-services/ezlopi-service-ota/ezlopi_service_ota.c @@ -13,6 +13,7 @@ #include "ezlopi_service_ota.h" #include "ezlopi_service_webprov.h" +#include "ezlopi_core_ezlopi_broadcast.h" static void ota_service_process(void *pv); @@ -47,6 +48,7 @@ static void ota_service_process(void *pv) { cJSON_Minify(data_to_send); ret_ota = web_provisioning_send_str_data_to_nma_websocket(data_to_send, TRACE_TYPE_D); + ezlopi_core_ezlopi_broadcast_execute(data_to_send); free(data_to_send); } } diff --git a/ezlopi-services/ezlopi-service-webprov/ezlopi_service_webprov.h b/ezlopi-services/ezlopi-service-webprov/ezlopi_service_webprov.h index f4da63f58..a599fb026 100644 --- a/ezlopi-services/ezlopi-service-webprov/ezlopi_service_webprov.h +++ b/ezlopi-services/ezlopi-service-webprov/ezlopi_service_webprov.h @@ -17,7 +17,8 @@ extern "C" TRACE_TYPE_B, TRACE_TYPE_D, // debug (White) TRACE_TYPE_I, // Info (Blue) - TRACE_TYPE_E // Error (Red) + TRACE_TYPE_E, // Error (Red) + } e_trace_type_t; void web_provisioning_init(void); diff --git a/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.c b/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.c index 59e2afcf2..7e585a8e9 100644 --- a/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.c +++ b/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.c @@ -22,13 +22,17 @@ #include "../../build/config/sdkconfig.h" #include -#include "ezlopi_core_wifi.h" #include "ezlopi_util_trace.h" + #include "ezlopi_cloud_constants.h" -#include "ezlopi_service_ws_server.h" + +#include "ezlopi_core_wifi.h" #include "ezlopi_core_cjson_macros.h" -#include "ezlopi_service_ws_server_clients.h" #include "ezlopi_core_ezlopi_methods.h" +#include "ezlopi_core_ezlopi_broadcast.h" + +#include "ezlopi_service_ws_server.h" +#include "ezlopi_service_ws_server_clients.h" typedef enum e_trace_type { @@ -53,20 +57,25 @@ static SemaphoreHandle_t send_lock = NULL; static void __stop_server(void); static void __start_server(void); +static void __wifi_connection_event(esp_event_base_t event, int32_t event_id, void *arg); + static void __ws_async_send(void *arg); -static esp_err_t __msg_handler(httpd_req_t *req); static esp_err_t __trigger_async_send(httpd_req_t *req); +static int __respond_cjson(httpd_req_t *req, cJSON *cj_response); +static int __ws_server_send(l_ws_server_client_conn_t *client, char *data, uint32_t len); + +static esp_err_t __msg_handler(httpd_req_t *req); static void __ws_api_handler(httpd_req_t *req, const char *payload, uint32_t payload_len); -static void __wifi_connection_event(esp_event_base_t event, int32_t event_id, void *arg); -static void __call_method_and_send_response(cJSON *cj_request, cJSON *cj_method, f_method_func_t method_func, e_trace_type_t print_type); + static void __print_sending_data(char *data_str, e_trace_type_t print_type); +static void __call_method_and_send_response(httpd_req_t *req, cJSON *cj_request, cJSON *cj_method, f_method_func_t method_func, e_trace_type_t print_type); e_ws_status_t ezlopi_service_ws_server_status(void) { return gs_ws_status; } -int ezlopi_service_ws_server_send_cjson(cJSON *cj_data) +int __ws_server_send_cjson(cJSON *cj_data) { int ret = 0; @@ -86,7 +95,7 @@ int ezlopi_service_ws_server_send_cjson(cJSON *cj_data) { TRACE_D("sending: %s", data); cJSON_Minify(data); - ret = ezlopi_service_ws_server_broadcast(data, strlen(data)); + ret = __ws_server_send(curr_client, data, strlen(data)); free(data); } @@ -102,7 +111,7 @@ int ezlopi_service_ws_server_send_cjson(cJSON *cj_data) if (data) { cJSON_Minify(data); - ret = ezlopi_service_ws_server_broadcast(data, strlen(data)); + ret = ezlopi_service_ws_server_broadcast(data); free(data); } } @@ -111,105 +120,36 @@ int ezlopi_service_ws_server_send_cjson(cJSON *cj_data) return ret; } -int ezlopi_service_ws_server_broadcast(char *data, uint32_t len) +int ezlopi_service_ws_server_broadcast_cjson(cJSON *cj_data) { int ret = 0; - - if (data && len) + if (cj_data) { - l_ws_server_client_conn_t *curr_client = ezlopi_service_ws_server_clients_get_head(); - while (curr_client) + char *data = cJSON_Print(cj_data); + if (data) { - ret = 1; - ezlopi_service_ws_server_send(curr_client, data, len); - curr_client = curr_client->next; + cJSON_Minify(data); + ezlopi_service_ws_server_broadcast(data); + free(data); } } return ret; } -int ezlopi_service_ws_server_send(l_ws_server_client_conn_t *client, char *data, uint32_t len) +int ezlopi_service_ws_server_broadcast(char *data) { int ret = 0; - if (data && len && client && client->http_handle && send_lock) - { - if (pdTRUE == xSemaphoreTake(send_lock, 2000 / portTICK_PERIOD_MS)) - { - TRACE_S("ws-server send-lock acquired."); - - static const uint32_t data_buffer_len = 20; - static uint8_t data_buffer[20]; - - uint32_t loop_count = len / data_buffer_len; - loop_count = (len % data_buffer_len) ? (loop_count + 1) : loop_count; - - TRACE_D("loop-count: %d", loop_count); - - for (uint32_t count = 0; count < loop_count; count++) - { - memset(data_buffer, 0, data_buffer_len); - - httpd_ws_frame_t frm_pkt; - memset(&frm_pkt, 0, sizeof(httpd_ws_frame_t)); - - static const char *test_data = "hello world!"; - frm_pkt.len = strlen(test_data); - frm_pkt.payload = test_data; - frm_pkt.type = HTTPD_WS_TYPE_TEXT; - - // frm_pkt.len = snprintf((char *)frm_pkt.payload, data_buffer_len, "%.*s", data_buffer_len, (char *)(data + (data_buffer_len * count))); - if (loop_count > 1) - { - frm_pkt.fragmented = true; - } - - if (count == loop_count - 1) - { - frm_pkt.final = true; - } - - TRACE_D("count: %d", count); - TRACE_D("client-handle: %p", client->http_handle); - TRACE_D("client-desc: %d", client->http_descriptor); - TRACE_D("data[%d]: %.*s", frm_pkt.len, frm_pkt.len, frm_pkt.payload); - - if (ESP_OK == httpd_ws_send_data(client->http_handle, client->http_descriptor, &frm_pkt)) - { - ret = 1; - client->fail_count = 0; - - TRACE_S("Done"); - __print_sending_data((char *)frm_pkt.payload, TRACE_TYPE_D); - } - else - { - TRACE_E("Failed!"); - - ret = 0; - client->fail_count += 1; - __print_sending_data((char *)frm_pkt.payload, TRACE_TYPE_E); - - if (client->fail_count > 5) - { - ezlopi_service_ws_server_clients_remove_by_handle(client->http_handle); - break; - } - } - - if (count == loop_count) - { - frm_pkt.final = true; - } - } + if (data) + { + l_ws_server_client_conn_t *curr_client = ezlopi_service_ws_server_clients_get_head(); - TRACE_S("ws-server send-lock released."); - xSemaphoreGive(send_lock); - } - else + while (curr_client) { - TRACE_E("ws-server send-lock failed!"); + ret = 1; + __ws_server_send(curr_client, data, strlen(data)); + curr_client = curr_client->next; } } @@ -252,8 +192,6 @@ static void __wifi_connection_event(esp_event_base_t event_base, int32_t event_i static void __ws_api_handler(httpd_req_t *req, const char *payload, uint32_t payload_len) { - TRACE_D("req: %p", req); - if (payload && payload_len) { cJSON *cj_request = cJSON_ParseWithLength(payload, payload_len); @@ -266,8 +204,6 @@ static void __ws_api_handler(httpd_req_t *req, const char *payload, uint32_t pay cJSON_AddNumberToObject(cj_src, ezlopi_client_id_str, (uint32_t)req->handle); } - CJSON_TRACE("request", cj_request); - cJSON *cj_error = cJSON_GetObjectItem(cj_request, ezlopi_error_str); cJSON *cj_method = cJSON_GetObjectItem(cj_request, ezlopi_method_str); @@ -279,32 +215,26 @@ static void __ws_api_handler(httpd_req_t *req, const char *payload, uint32_t pay TRACE_S("## WS Rx <<<<<<<<<< '%s'\r\n%.*s", (cj_method->valuestring ? cj_method->valuestring : ezlopi__str), payload_len, payload); uint32_t method_id = ezlopi_core_ezlopi_methods_search_in_list(cj_method); - TRACE_D("method_id: %d", method_id); if (UINT32_MAX != method_id) { - char *method_name = ezlopi_core_ezlopi_methods_get_name_by_id(method_id); - TRACE_D("Method:: id:[%d], name: %s", method_id, method_name ? method_name : "null"); - f_method_func_t method = ezlopi_core_ezlopi_methods_get_by_id(method_id); - TRACE_D("method: %p", method); if (method) { - __call_method_and_send_response(cj_request, cj_method, method, TRACE_TYPE_D); + __call_method_and_send_response(req, cj_request, cj_method, method, TRACE_TYPE_D); } f_method_func_t updater = ezlopi_core_ezlopi_methods_get_updater_by_id(method_id); - TRACE_D("updater: %p", updater); if (updater) { - __call_method_and_send_response(cj_request, cj_method, updater, TRACE_TYPE_D); + __call_method_and_send_response(req, cj_request, cj_method, updater, TRACE_TYPE_D); } } else { - __call_method_and_send_response(cj_request, cj_method, ezlopi_core_ezlopi_methods_rpc_method_notfound, TRACE_TYPE_E); + __call_method_and_send_response(req, cj_request, cj_method, ezlopi_core_ezlopi_methods_rpc_method_notfound, TRACE_TYPE_E); } } } @@ -389,7 +319,6 @@ static esp_err_t __msg_handler(httpd_req_t *req) if (ESP_OK == ret) { TRACE_D("Packet type: %d", ws_pkt.type); - TRACE_D("Message: %.*s", ws_pkt.len, ws_pkt.payload); if ((HTTPD_WS_TYPE_TEXT == ws_pkt.type) && (0 == strcmp((char *)ws_pkt.payload, "Trigger async"))) { @@ -397,6 +326,7 @@ static esp_err_t __msg_handler(httpd_req_t *req) } else if (HTTPD_WS_TYPE_TEXT == ws_pkt.type) { + httpd_ws_send_frame(req, &ws_pkt); __ws_api_handler(req, (char *)ws_pkt.payload, (uint32_t)ws_pkt.len); } else if (HTTPD_WS_TYPE_CLOSE == ws_pkt.type) @@ -447,7 +377,7 @@ static void __start_server(void) httpd_config_t config = HTTPD_DEFAULT_CONFIG(); config.task_priority = 8; - config.stack_size = 1024 * 18; + config.stack_size = 1024 * 4; TRACE_I("Starting ws-server on port: '%d'", config.server_port); @@ -465,6 +395,8 @@ static void __start_server(void) { TRACE_E("Error starting server!, err: %d", err); } + + ezlopi_core_ezlopi_broadcast_method_add(ezlopi_service_ws_server_broadcast, 2); } } @@ -485,7 +417,7 @@ static void __stop_server(void) } } -static void __call_method_and_send_response(cJSON *cj_request, cJSON *cj_method, f_method_func_t method_func, e_trace_type_t print_type) +static void __call_method_and_send_response(httpd_req_t *req, cJSON *cj_request, cJSON *cj_method, f_method_func_t method_func, e_trace_type_t print_type) { if (method_func) { @@ -503,27 +435,117 @@ static void __call_method_and_send_response(cJSON *cj_request, cJSON *cj_method, cJSON_AddNullToObject(cj_response, ezlopi_error_str); method_func(cj_request, cj_response); - // CJSON_TRACE("cj_response", cj_response); - // ezlopi_service_ws_server_send_cjson(cj_response); - char *data = cJSON_Print(cj_request); - cJSON_Delete(cj_response); + __respond_cjson(req, cj_response); + } + else + { + TRACE_E("Error - cj_response: %d", (uint32_t)cj_response); + } + } + } +} + +static int __respond_cjson(httpd_req_t *req, cJSON *cj_response) +{ + int ret = 0; + if (req && cj_response && send_lock) + { + if (xSemaphoreTake(send_lock, 2000 / portTICK_PERIOD_MS)) + { + TRACE_S("ws-server send-lock acquired."); - if (data) + char *data = cJSON_Print(cj_response); + if (data) + { + cJSON_Minify(data); + + httpd_ws_frame_t data_frame = { + .final = false, + .fragmented = false, + .len = strlen(data), + .payload = (uint8_t *)data, + .type = HTTPD_WS_TYPE_TEXT, + }; + + ret = (ESP_OK == httpd_ws_send_frame(req, &data_frame)) ? true : false; + + if (ret) { - cJSON_Minify(data); - // ezlopi_service_ws_server_send(); - ezlopi_service_ws_server_broadcast(data, strlen(data)); - vTaskDelay(5000 / portTICK_PERIOD_MS); - free(data); + __print_sending_data(data, TRACE_TYPE_D); + } + else + { + __print_sending_data(data, TRACE_TYPE_E); } + + free(data); + } + + xSemaphoreGive(send_lock); + TRACE_S("ws-server send-lock released."); + } + else + { + TRACE_E("send-lock acquired failed!"); + } + } + + return ret; +} + +static int __ws_server_send(l_ws_server_client_conn_t *client, char *data, uint32_t len) +{ + int ret = 0; + if (data && len && client && client->http_handle && send_lock) + { + if (pdTRUE == xSemaphoreTake(send_lock, 2000 / portTICK_PERIOD_MS)) + { + TRACE_S("ws-server send-lock acquired."); + + httpd_ws_frame_t frm_pkt; + memset(&frm_pkt, 0, sizeof(httpd_ws_frame_t)); + + frm_pkt.len = strlen(data); + frm_pkt.payload = (uint8_t *)data; + frm_pkt.type = HTTPD_WS_TYPE_TEXT; + + TRACE_D("client-handle: %p", client->http_handle); + TRACE_D("client-desc: %d", client->http_descriptor); + TRACE_D("data[%d]: %.*s", frm_pkt.len, frm_pkt.len, frm_pkt.payload); + + if (ESP_OK == httpd_ws_send_data(client->http_handle, client->http_descriptor, &frm_pkt)) + { + ret = 1; + client->fail_count = 0; + + TRACE_S("Done"); + __print_sending_data((char *)frm_pkt.payload, TRACE_TYPE_D); } else { - TRACE_E("Error - cj_response: %d", (uint32_t)cj_response); + TRACE_E("Failed!"); + + ret = 0; + client->fail_count += 1; + __print_sending_data((char *)frm_pkt.payload, TRACE_TYPE_E); + + if (client->fail_count > 5) + { + ezlopi_service_ws_server_clients_remove_by_handle(client->http_handle); + } } + + xSemaphoreGive(send_lock); + TRACE_S("ws-server send-lock released."); + } + else + { + TRACE_E("ws-server send-lock failed!"); } } + + return ret; } static void __print_sending_data(char *data_str, e_trace_type_t print_type) diff --git a/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.h b/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.h index 8e8c74895..d86b06875 100644 --- a/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.h +++ b/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.h @@ -12,9 +12,12 @@ typedef enum e_ws_status void ezlopi_service_ws_server_stop(void); void ezlopi_service_ws_server_start(void); + e_ws_status_t ezlopi_service_ws_server_status(void); + int ezlopi_service_ws_server_send_cjson(cJSON *cj_data); -int ezlopi_service_ws_server_broadcast(char *data, uint32_t len); -int ezlopi_service_ws_server_send(l_ws_server_client_conn_t *client, char *data, uint32_t len); + +int ezlopi_service_ws_server_broadcast(char *data); +int ezlopi_service_ws_server_broadcast_cjson(cJSON *cj_data); #endif // __EZLOPI_SERVICE_WS_SERVER_H__ \ No newline at end of file diff --git a/ezlopi_partitions_v3_1_4_181_8mb.csv b/ezlopi_partitions_v3_1_4_181_8mb.csv new file mode 100644 index 000000000..314c7c8ad --- /dev/null +++ b/ezlopi_partitions_v3_1_4_181_8mb.csv @@ -0,0 +1,8 @@ +# ESP32 Partition Table +# Name, Type, SubType, Offset, Size, Flags +nvs, data, nvs, 0x9000, 0xC000, +otadata, data, ota, 0x15000, 0x2000, +phy_init, data, phy, 0x17000, 0x1000, +prov_data, 0x40, 0, 0x18000, 0x8000, +ota0, app, ota_0, 0x20000, 0x2EFC00, +ota1, app, ota_1, , 0x2EFC00, diff --git a/main/ezlopi_main.c b/main/ezlopi_main.c index 96852d976..f74f6573d 100644 --- a/main/ezlopi_main.c +++ b/main/ezlopi_main.c @@ -28,9 +28,11 @@ static void blinky(void *pv); void app_main(void) { gpio_install_isr_service(0); + qt_serial_init(); gpio_isr_service_init(); ezlopi_init(); + ezlopi_ble_service_init(); timer_service_init(); ezlopi_scenes_meshbot_init(); @@ -74,9 +76,6 @@ static void blinky(void *pv) trace_wb("esp_get_minimum_free_heap_size: %f kB", esp_get_minimum_free_heap_size() / 1024.0); trace_wb("-----------------------------------------"); - - char *sdfgh = "asdfghjkl"; - ezlopi_service_ws_server_broadcast(sdfgh, strlen(sdfgh)); } vTaskDelay(1000 / portTICK_PERIOD_MS); diff --git a/sdkconfig b/sdkconfig index 7c8e0f577..c1c9c7c0c 100644 --- a/sdkconfig +++ b/sdkconfig @@ -50,14 +50,6 @@ CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y # CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set # CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set CONFIG_BOOTLOADER_LOG_LEVEL=0 - -# -# Serial Flash Configurations -# -# CONFIG_BOOTLOADER_FLASH_DC_AWARE is not set -CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y -# end of Serial Flash Configurations - # CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V is not set CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y # CONFIG_BOOTLOADER_FACTORY_RESET is not set @@ -72,6 +64,7 @@ CONFIG_BOOTLOADER_WDT_TIME_MS=9000 # CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 # CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set +CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y # end of Bootloader config # @@ -105,7 +98,6 @@ CONFIG_ESPTOOLPY_FLASHMODE_DIO=y # CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y CONFIG_ESPTOOLPY_FLASHMODE="dio" -CONFIG_ESPTOOLPY_S3_STR=y # CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set CONFIG_ESPTOOLPY_FLASHFREQ_40M=y @@ -146,8 +138,8 @@ CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 # CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set # CONFIG_PARTITION_TABLE_TWO_OTA is not set CONFIG_PARTITION_TABLE_CUSTOM=y -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="ezlopi_partitions_v3_1_4_181_4mb.csv" -CONFIG_PARTITION_TABLE_FILENAME="ezlopi_partitions_v3_1_4_181_4mb.csv" +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="ezlopi_partitions_v3_1_4_181_8mb.csv" +CONFIG_PARTITION_TABLE_FILENAME="ezlopi_partitions_v3_1_4_181_8mb.csv" CONFIG_PARTITION_TABLE_OFFSET=0x8000 CONFIG_PARTITION_TABLE_MD5=y # end of Partition Table @@ -273,7 +265,6 @@ CONFIG_BT_CTRL_SLEEP_CLOCK_EFF=0 CONFIG_BT_CTRL_HCI_TL_EFF=1 # CONFIG_BT_CTRL_AGC_RECORRECT_EN is not set # CONFIG_BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX is not set -# CONFIG_BT_BLE_ADV_DATA_LENGTH_ZERO_AUX is not set # end of Bluetooth controller CONFIG_BT_BLUEDROID_ENABLED=y @@ -489,7 +480,6 @@ CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=y # CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY is not set # CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK is not set CONFIG_BT_SMP_ENABLE=y -CONFIG_BT_SMP_MAX_BONDS=15 # CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN is not set CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT=30 CONFIG_BT_MAX_DEVICE_NAME_LEN=32 @@ -698,8 +688,8 @@ CONFIG_ESP_HTTP_CLIENT_ENABLE_DIGEST_AUTH=y # # HTTP Server # -CONFIG_HTTPD_MAX_REQ_HDR_LEN=512 -CONFIG_HTTPD_MAX_URI_LEN=512 +CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024 +CONFIG_HTTPD_MAX_URI_LEN=1024 CONFIG_HTTPD_ERR_RESP_NO_DELAY=y CONFIG_HTTPD_PURGE_BUF_LEN=32 # CONFIG_HTTPD_LOG_PURGE_DATA is not set @@ -715,7 +705,7 @@ CONFIG_OTA_ALLOW_HTTP=y # # ESP HTTPS server # -# CONFIG_ESP_HTTPS_SERVER_ENABLE is not set +CONFIG_ESP_HTTPS_SERVER_ENABLE=y # end of ESP HTTPS server # @@ -763,10 +753,6 @@ CONFIG_ESP_IPC_ISR_ENABLE=y # LCD and Touch Panel # -# -# LCD Touch Drivers are maintained in the IDF Component Registry -# - # # LCD Peripheral Configuration # @@ -860,7 +846,6 @@ CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y # CONFIG_ESP_PANIC_HANDLER_IRAM is not set # CONFIG_ESP_DEBUG_STUBS_ENABLE is not set CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y -CONFIG_ESP_SYSTEM_BBPLL_RECALIB=y # end of ESP System Settings # @@ -1097,7 +1082,7 @@ CONFIG_LWIP_TCPIP_TASK_PRIO=18 # CONFIG_LWIP_CHECK_THREAD_SAFETY is not set CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y # CONFIG_LWIP_L2_TO_L3_COPY is not set -# CONFIG_LWIP_IRAM_OPTIMIZATION is not set +CONFIG_LWIP_IRAM_OPTIMIZATION=y CONFIG_LWIP_TIMERS_ONDEMAND=y CONFIG_LWIP_MAX_SOCKETS=10 # CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set @@ -1106,7 +1091,6 @@ CONFIG_LWIP_SO_REUSE=y CONFIG_LWIP_SO_REUSE_RXTOALL=y # CONFIG_LWIP_SO_RCVBUF is not set # CONFIG_LWIP_NETBUF_RECVINFO is not set -CONFIG_LWIP_IP_DEFAULT_TTL=64 CONFIG_LWIP_IP4_FRAG=y CONFIG_LWIP_IP6_FRAG=y # CONFIG_LWIP_IP4_REASSEMBLY is not set @@ -1216,13 +1200,6 @@ CONFIG_LWIP_SNTP_MAX_SERVERS=3 CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 # end of SNTP -# -# DNS -# -CONFIG_LWIP_DNS_MAX_SERVERS=3 -# CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT is not set -# end of DNS - CONFIG_LWIP_ESP_LWIP_ASSERT=y # @@ -1242,7 +1219,21 @@ CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_NONE=y # CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM is not set # end of Hooks -# CONFIG_LWIP_DEBUG is not set +CONFIG_LWIP_DEBUG=y +# CONFIG_LWIP_DEBUG_ESP_LOG is not set +# CONFIG_LWIP_NETIF_DEBUG is not set +# CONFIG_LWIP_PBUF_DEBUG is not set +# CONFIG_LWIP_ETHARP_DEBUG is not set +# CONFIG_LWIP_API_LIB_DEBUG is not set +# CONFIG_LWIP_SOCKETS_DEBUG is not set +# CONFIG_LWIP_IP_DEBUG is not set +# CONFIG_LWIP_ICMP_DEBUG is not set +# CONFIG_LWIP_DHCP_STATE_DEBUG is not set +# CONFIG_LWIP_DHCP_DEBUG is not set +# CONFIG_LWIP_IP6_DEBUG is not set +# CONFIG_LWIP_ICMP6_DEBUG is not set +# CONFIG_LWIP_TCP_DEBUG is not set +# CONFIG_LWIP_SNTP_DEBUG is not set # end of LWIP # @@ -1456,26 +1447,6 @@ CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" # end of PThreads -# -# Main Flash configuration -# - -# -# Optional and Experimental Features (READ DOCS FIRST) -# - -# -# Features here require specific hardware (READ DOCS FIRST!) -# -# CONFIG_SPI_FLASH_HPM_ENA is not set -CONFIG_SPI_FLASH_HPM_AUTO=y -# CONFIG_SPI_FLASH_HPM_DIS is not set -CONFIG_SPI_FLASH_HPM_ON=y -CONFIG_SPI_FLASH_HPM_DC_AUTO=y -# CONFIG_SPI_FLASH_HPM_DC_DISABLE is not set -# end of Optional and Experimental Features (READ DOCS FIRST) -# end of Main Flash configuration - # # SPI Flash driver # @@ -1556,7 +1527,7 @@ CONFIG_SPIFFS_USE_MTIME=y # Websocket # CONFIG_WS_TRANSPORT=y -CONFIG_WS_BUFFER_SIZE=1024 +CONFIG_WS_BUFFER_SIZE=2048 # end of Websocket # end of TCP Transport diff --git a/sdkconfig.old b/sdkconfig.old index d629eb163..b2ab899c9 100644 --- a/sdkconfig.old +++ b/sdkconfig.old @@ -50,6 +50,14 @@ CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y # CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set # CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set CONFIG_BOOTLOADER_LOG_LEVEL=0 + +# +# Serial Flash Configurations +# +# CONFIG_BOOTLOADER_FLASH_DC_AWARE is not set +CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y +# end of Serial Flash Configurations + # CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V is not set CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y # CONFIG_BOOTLOADER_FACTORY_RESET is not set @@ -64,7 +72,6 @@ CONFIG_BOOTLOADER_WDT_TIME_MS=9000 # CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 # CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set -CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y # end of Bootloader config # @@ -98,6 +105,7 @@ CONFIG_ESPTOOLPY_FLASHMODE_DIO=y # CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y CONFIG_ESPTOOLPY_FLASHMODE="dio" +CONFIG_ESPTOOLPY_S3_STR=y # CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set CONFIG_ESPTOOLPY_FLASHFREQ_40M=y @@ -138,8 +146,8 @@ CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 # CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set # CONFIG_PARTITION_TABLE_TWO_OTA is not set CONFIG_PARTITION_TABLE_CUSTOM=y -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="ezlopi_partitions_v3_1_4_181_4mb.csv" -CONFIG_PARTITION_TABLE_FILENAME="ezlopi_partitions_v3_1_4_181_4mb.csv" +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="ezlopi_partitions_v3_1_4_181_8mb.csv" +CONFIG_PARTITION_TABLE_FILENAME="ezlopi_partitions_v3_1_4_181_8mb.csv" CONFIG_PARTITION_TABLE_OFFSET=0x8000 CONFIG_PARTITION_TABLE_MD5=y # end of Partition Table @@ -481,6 +489,7 @@ CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=y # CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY is not set # CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK is not set CONFIG_BT_SMP_ENABLE=y +CONFIG_BT_SMP_MAX_BONDS=15 # CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN is not set CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT=30 CONFIG_BT_MAX_DEVICE_NAME_LEN=32 @@ -689,12 +698,12 @@ CONFIG_ESP_HTTP_CLIENT_ENABLE_DIGEST_AUTH=y # # HTTP Server # -CONFIG_HTTPD_MAX_REQ_HDR_LEN=512 -CONFIG_HTTPD_MAX_URI_LEN=512 +CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024 +CONFIG_HTTPD_MAX_URI_LEN=1024 CONFIG_HTTPD_ERR_RESP_NO_DELAY=y CONFIG_HTTPD_PURGE_BUF_LEN=32 -# CONFIG_HTTPD_LOG_PURGE_DATA is not set -# CONFIG_HTTPD_WS_SUPPORT is not set +CONFIG_HTTPD_LOG_PURGE_DATA=y +CONFIG_HTTPD_WS_SUPPORT=y # end of HTTP Server # @@ -706,7 +715,7 @@ CONFIG_OTA_ALLOW_HTTP=y # # ESP HTTPS server # -CONFIG_ESP_HTTPS_SERVER_ENABLE=y +# CONFIG_ESP_HTTPS_SERVER_ENABLE is not set # end of ESP HTTPS server # @@ -754,6 +763,10 @@ CONFIG_ESP_IPC_ISR_ENABLE=y # LCD and Touch Panel # +# +# LCD Touch Drivers are maintained in the IDF Component Registry +# + # # LCD Peripheral Configuration # @@ -1059,16 +1072,13 @@ CONFIG_HEAP_TRACING_OFF=y # # CONFIG_LOG_DEFAULT_LEVEL_NONE is not set # CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set -CONFIG_LOG_DEFAULT_LEVEL_WARN=y +# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set # CONFIG_LOG_DEFAULT_LEVEL_INFO is not set # CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set -# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set -CONFIG_LOG_DEFAULT_LEVEL=2 +CONFIG_LOG_DEFAULT_LEVEL_VERBOSE=y +CONFIG_LOG_DEFAULT_LEVEL=5 CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y -# CONFIG_LOG_MAXIMUM_LEVEL_INFO is not set -# CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set -# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set -CONFIG_LOG_MAXIMUM_LEVEL=2 +CONFIG_LOG_MAXIMUM_LEVEL=5 CONFIG_LOG_COLORS=y CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y # CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set @@ -1084,7 +1094,7 @@ CONFIG_LWIP_TCPIP_TASK_PRIO=18 # CONFIG_LWIP_CHECK_THREAD_SAFETY is not set CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y # CONFIG_LWIP_L2_TO_L3_COPY is not set -# CONFIG_LWIP_IRAM_OPTIMIZATION is not set +CONFIG_LWIP_IRAM_OPTIMIZATION=y CONFIG_LWIP_TIMERS_ONDEMAND=y CONFIG_LWIP_MAX_SOCKETS=10 # CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set @@ -1203,6 +1213,13 @@ CONFIG_LWIP_SNTP_MAX_SERVERS=3 CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 # end of SNTP +# +# DNS +# +CONFIG_LWIP_DNS_MAX_SERVERS=3 +# CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT is not set +# end of DNS + CONFIG_LWIP_ESP_LWIP_ASSERT=y # @@ -1222,7 +1239,21 @@ CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_NONE=y # CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM is not set # end of Hooks -# CONFIG_LWIP_DEBUG is not set +CONFIG_LWIP_DEBUG=y +# CONFIG_LWIP_DEBUG_ESP_LOG is not set +# CONFIG_LWIP_NETIF_DEBUG is not set +# CONFIG_LWIP_PBUF_DEBUG is not set +# CONFIG_LWIP_ETHARP_DEBUG is not set +# CONFIG_LWIP_API_LIB_DEBUG is not set +# CONFIG_LWIP_SOCKETS_DEBUG is not set +# CONFIG_LWIP_IP_DEBUG is not set +# CONFIG_LWIP_ICMP_DEBUG is not set +# CONFIG_LWIP_DHCP_STATE_DEBUG is not set +# CONFIG_LWIP_DHCP_DEBUG is not set +# CONFIG_LWIP_IP6_DEBUG is not set +# CONFIG_LWIP_ICMP6_DEBUG is not set +# CONFIG_LWIP_TCP_DEBUG is not set +# CONFIG_LWIP_SNTP_DEBUG is not set # end of LWIP # @@ -1436,6 +1467,26 @@ CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" # end of PThreads +# +# Main Flash configuration +# + +# +# Optional and Experimental Features (READ DOCS FIRST) +# + +# +# Features here require specific hardware (READ DOCS FIRST!) +# +# CONFIG_SPI_FLASH_HPM_ENA is not set +CONFIG_SPI_FLASH_HPM_AUTO=y +# CONFIG_SPI_FLASH_HPM_DIS is not set +CONFIG_SPI_FLASH_HPM_ON=y +CONFIG_SPI_FLASH_HPM_DC_AUTO=y +# CONFIG_SPI_FLASH_HPM_DC_DISABLE is not set +# end of Optional and Experimental Features (READ DOCS FIRST) +# end of Main Flash configuration + # # SPI Flash driver # @@ -1516,10 +1567,16 @@ CONFIG_SPIFFS_USE_MTIME=y # Websocket # CONFIG_WS_TRANSPORT=y -CONFIG_WS_BUFFER_SIZE=1024 +CONFIG_WS_BUFFER_SIZE=2048 # end of Websocket # end of TCP Transport +# +# TinyUSB Stack +# +# CONFIG_TINYUSB is not set +# end of TinyUSB Stack + # # Unity unit testing library # @@ -1620,3 +1677,332 @@ CONFIG_LUA_ROOT="/lua" # # CONFIG_LEGACY_INCLUDE_COMMON_HEADERS is not set # end of Compatibility options + +# Deprecated options for backward compatibility +CONFIG_TOOLPREFIX="xtensa-esp32s3-elf-" +CONFIG_LOG_BOOTLOADER_LEVEL_NONE=y +# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_INFO is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set +CONFIG_LOG_BOOTLOADER_LEVEL=0 +# CONFIG_APP_ROLLBACK_ENABLE is not set +# CONFIG_FLASH_ENCRYPTION_ENABLED is not set +# CONFIG_FLASHMODE_QIO is not set +# CONFIG_FLASHMODE_QOUT is not set +CONFIG_FLASHMODE_DIO=y +# CONFIG_FLASHMODE_DOUT is not set +# CONFIG_MONITOR_BAUD_9600B is not set +# CONFIG_MONITOR_BAUD_57600B is not set +CONFIG_MONITOR_BAUD_115200B=y +# CONFIG_MONITOR_BAUD_230400B is not set +# CONFIG_MONITOR_BAUD_921600B is not set +# CONFIG_MONITOR_BAUD_2MB is not set +# CONFIG_MONITOR_BAUD_OTHER is not set +CONFIG_MONITOR_BAUD_OTHER_VAL=115200 +CONFIG_MONITOR_BAUD=115200 +CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG=y +# CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set +CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y +# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set +# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set +CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2 +# CONFIG_CXX_EXCEPTIONS is not set +CONFIG_STACK_CHECK_NONE=y +# CONFIG_STACK_CHECK_NORM is not set +# CONFIG_STACK_CHECK_STRONG is not set +# CONFIG_STACK_CHECK_ALL is not set +# CONFIG_WARN_WRITE_STRINGS is not set +# CONFIG_DISABLE_GCC8_WARNINGS is not set +# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set +CONFIG_ESP32_APPTRACE_DEST_NONE=y +CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y +CONFIG_BLUEDROID_ENABLED=y +# CONFIG_NIMBLE_ENABLED is not set +CONFIG_BTC_TASK_STACK_SIZE=3072 +CONFIG_BLUEDROID_PINNED_TO_CORE_0=y +# CONFIG_BLUEDROID_PINNED_TO_CORE_1 is not set +CONFIG_BLUEDROID_PINNED_TO_CORE=0 +CONFIG_BTU_TASK_STACK_SIZE=4096 +# CONFIG_BLUEDROID_MEM_DEBUG is not set +CONFIG_GATTS_ENABLE=y +# CONFIG_GATTS_SEND_SERVICE_CHANGE_MANUAL is not set +CONFIG_GATTS_SEND_SERVICE_CHANGE_AUTO=y +CONFIG_GATTS_SEND_SERVICE_CHANGE_MODE=0 +CONFIG_GATTC_ENABLE=y +# CONFIG_GATTC_CACHE_NVS_FLASH is not set +CONFIG_BLE_SMP_ENABLE=y +# CONFIG_SMP_SLAVE_CON_PARAMS_UPD_ENABLE is not set +# CONFIG_HCI_TRACE_LEVEL_NONE is not set +# CONFIG_HCI_TRACE_LEVEL_ERROR is not set +CONFIG_HCI_TRACE_LEVEL_WARNING=y +# CONFIG_HCI_TRACE_LEVEL_API is not set +# CONFIG_HCI_TRACE_LEVEL_EVENT is not set +# CONFIG_HCI_TRACE_LEVEL_DEBUG is not set +# CONFIG_HCI_TRACE_LEVEL_VERBOSE is not set +CONFIG_HCI_INITIAL_TRACE_LEVEL=2 +# CONFIG_BTM_TRACE_LEVEL_NONE is not set +# CONFIG_BTM_TRACE_LEVEL_ERROR is not set +CONFIG_BTM_TRACE_LEVEL_WARNING=y +# CONFIG_BTM_TRACE_LEVEL_API is not set +# CONFIG_BTM_TRACE_LEVEL_EVENT is not set +# CONFIG_BTM_TRACE_LEVEL_DEBUG is not set +# CONFIG_BTM_TRACE_LEVEL_VERBOSE is not set +CONFIG_BTM_INITIAL_TRACE_LEVEL=2 +# CONFIG_L2CAP_TRACE_LEVEL_NONE is not set +# CONFIG_L2CAP_TRACE_LEVEL_ERROR is not set +CONFIG_L2CAP_TRACE_LEVEL_WARNING=y +# CONFIG_L2CAP_TRACE_LEVEL_API is not set +# CONFIG_L2CAP_TRACE_LEVEL_EVENT is not set +# CONFIG_L2CAP_TRACE_LEVEL_DEBUG is not set +# CONFIG_L2CAP_TRACE_LEVEL_VERBOSE is not set +CONFIG_L2CAP_INITIAL_TRACE_LEVEL=2 +# CONFIG_RFCOMM_TRACE_LEVEL_NONE is not set +# CONFIG_RFCOMM_TRACE_LEVEL_ERROR is not set +CONFIG_RFCOMM_TRACE_LEVEL_WARNING=y +# CONFIG_RFCOMM_TRACE_LEVEL_API is not set +# CONFIG_RFCOMM_TRACE_LEVEL_EVENT is not set +# CONFIG_RFCOMM_TRACE_LEVEL_DEBUG is not set +# CONFIG_RFCOMM_TRACE_LEVEL_VERBOSE is not set +CONFIG_RFCOMM_INITIAL_TRACE_LEVEL=2 +# CONFIG_SDP_TRACE_LEVEL_NONE is not set +# CONFIG_SDP_TRACE_LEVEL_ERROR is not set +CONFIG_SDP_TRACE_LEVEL_WARNING=y +# CONFIG_SDP_TRACE_LEVEL_API is not set +# CONFIG_SDP_TRACE_LEVEL_EVENT is not set +# CONFIG_SDP_TRACE_LEVEL_DEBUG is not set +# CONFIG_SDP_TRACE_LEVEL_VERBOSE is not set +CONFIG_BTH_LOG_SDP_INITIAL_TRACE_LEVEL=2 +# CONFIG_GAP_TRACE_LEVEL_NONE is not set +# CONFIG_GAP_TRACE_LEVEL_ERROR is not set +CONFIG_GAP_TRACE_LEVEL_WARNING=y +# CONFIG_GAP_TRACE_LEVEL_API is not set +# CONFIG_GAP_TRACE_LEVEL_EVENT is not set +# CONFIG_GAP_TRACE_LEVEL_DEBUG is not set +# CONFIG_GAP_TRACE_LEVEL_VERBOSE is not set +CONFIG_GAP_INITIAL_TRACE_LEVEL=2 +CONFIG_BNEP_INITIAL_TRACE_LEVEL=2 +# CONFIG_PAN_TRACE_LEVEL_NONE is not set +# CONFIG_PAN_TRACE_LEVEL_ERROR is not set +CONFIG_PAN_TRACE_LEVEL_WARNING=y +# CONFIG_PAN_TRACE_LEVEL_API is not set +# CONFIG_PAN_TRACE_LEVEL_EVENT is not set +# CONFIG_PAN_TRACE_LEVEL_DEBUG is not set +# CONFIG_PAN_TRACE_LEVEL_VERBOSE is not set +CONFIG_PAN_INITIAL_TRACE_LEVEL=2 +# CONFIG_A2D_TRACE_LEVEL_NONE is not set +# CONFIG_A2D_TRACE_LEVEL_ERROR is not set +CONFIG_A2D_TRACE_LEVEL_WARNING=y +# CONFIG_A2D_TRACE_LEVEL_API is not set +# CONFIG_A2D_TRACE_LEVEL_EVENT is not set +# CONFIG_A2D_TRACE_LEVEL_DEBUG is not set +# CONFIG_A2D_TRACE_LEVEL_VERBOSE is not set +CONFIG_A2D_INITIAL_TRACE_LEVEL=2 +# CONFIG_AVDT_TRACE_LEVEL_NONE is not set +# CONFIG_AVDT_TRACE_LEVEL_ERROR is not set +CONFIG_AVDT_TRACE_LEVEL_WARNING=y +# CONFIG_AVDT_TRACE_LEVEL_API is not set +# CONFIG_AVDT_TRACE_LEVEL_EVENT is not set +# CONFIG_AVDT_TRACE_LEVEL_DEBUG is not set +# CONFIG_AVDT_TRACE_LEVEL_VERBOSE is not set +CONFIG_AVDT_INITIAL_TRACE_LEVEL=2 +# CONFIG_AVCT_TRACE_LEVEL_NONE is not set +# CONFIG_AVCT_TRACE_LEVEL_ERROR is not set +CONFIG_AVCT_TRACE_LEVEL_WARNING=y +# CONFIG_AVCT_TRACE_LEVEL_API is not set +# CONFIG_AVCT_TRACE_LEVEL_EVENT is not set +# CONFIG_AVCT_TRACE_LEVEL_DEBUG is not set +# CONFIG_AVCT_TRACE_LEVEL_VERBOSE is not set +CONFIG_AVCT_INITIAL_TRACE_LEVEL=2 +# CONFIG_AVRC_TRACE_LEVEL_NONE is not set +# CONFIG_AVRC_TRACE_LEVEL_ERROR is not set +CONFIG_AVRC_TRACE_LEVEL_WARNING=y +# CONFIG_AVRC_TRACE_LEVEL_API is not set +# CONFIG_AVRC_TRACE_LEVEL_EVENT is not set +# CONFIG_AVRC_TRACE_LEVEL_DEBUG is not set +# CONFIG_AVRC_TRACE_LEVEL_VERBOSE is not set +CONFIG_AVRC_INITIAL_TRACE_LEVEL=2 +# CONFIG_MCA_TRACE_LEVEL_NONE is not set +# CONFIG_MCA_TRACE_LEVEL_ERROR is not set +CONFIG_MCA_TRACE_LEVEL_WARNING=y +# CONFIG_MCA_TRACE_LEVEL_API is not set +# CONFIG_MCA_TRACE_LEVEL_EVENT is not set +# CONFIG_MCA_TRACE_LEVEL_DEBUG is not set +# CONFIG_MCA_TRACE_LEVEL_VERBOSE is not set +CONFIG_MCA_INITIAL_TRACE_LEVEL=2 +# CONFIG_HID_TRACE_LEVEL_NONE is not set +# CONFIG_HID_TRACE_LEVEL_ERROR is not set +CONFIG_HID_TRACE_LEVEL_WARNING=y +# CONFIG_HID_TRACE_LEVEL_API is not set +# CONFIG_HID_TRACE_LEVEL_EVENT is not set +# CONFIG_HID_TRACE_LEVEL_DEBUG is not set +# CONFIG_HID_TRACE_LEVEL_VERBOSE is not set +CONFIG_HID_INITIAL_TRACE_LEVEL=2 +# CONFIG_APPL_TRACE_LEVEL_NONE is not set +# CONFIG_APPL_TRACE_LEVEL_ERROR is not set +CONFIG_APPL_TRACE_LEVEL_WARNING=y +# CONFIG_APPL_TRACE_LEVEL_API is not set +# CONFIG_APPL_TRACE_LEVEL_EVENT is not set +# CONFIG_APPL_TRACE_LEVEL_DEBUG is not set +# CONFIG_APPL_TRACE_LEVEL_VERBOSE is not set +CONFIG_APPL_INITIAL_TRACE_LEVEL=2 +# CONFIG_GATT_TRACE_LEVEL_NONE is not set +# CONFIG_GATT_TRACE_LEVEL_ERROR is not set +CONFIG_GATT_TRACE_LEVEL_WARNING=y +# CONFIG_GATT_TRACE_LEVEL_API is not set +# CONFIG_GATT_TRACE_LEVEL_EVENT is not set +# CONFIG_GATT_TRACE_LEVEL_DEBUG is not set +# CONFIG_GATT_TRACE_LEVEL_VERBOSE is not set +CONFIG_GATT_INITIAL_TRACE_LEVEL=2 +# CONFIG_SMP_TRACE_LEVEL_NONE is not set +# CONFIG_SMP_TRACE_LEVEL_ERROR is not set +CONFIG_SMP_TRACE_LEVEL_WARNING=y +# CONFIG_SMP_TRACE_LEVEL_API is not set +# CONFIG_SMP_TRACE_LEVEL_EVENT is not set +# CONFIG_SMP_TRACE_LEVEL_DEBUG is not set +# CONFIG_SMP_TRACE_LEVEL_VERBOSE is not set +CONFIG_SMP_INITIAL_TRACE_LEVEL=2 +# CONFIG_BTIF_TRACE_LEVEL_NONE is not set +# CONFIG_BTIF_TRACE_LEVEL_ERROR is not set +CONFIG_BTIF_TRACE_LEVEL_WARNING=y +# CONFIG_BTIF_TRACE_LEVEL_API is not set +# CONFIG_BTIF_TRACE_LEVEL_EVENT is not set +# CONFIG_BTIF_TRACE_LEVEL_DEBUG is not set +# CONFIG_BTIF_TRACE_LEVEL_VERBOSE is not set +CONFIG_BTIF_INITIAL_TRACE_LEVEL=2 +# CONFIG_BTC_TRACE_LEVEL_NONE is not set +# CONFIG_BTC_TRACE_LEVEL_ERROR is not set +CONFIG_BTC_TRACE_LEVEL_WARNING=y +# CONFIG_BTC_TRACE_LEVEL_API is not set +# CONFIG_BTC_TRACE_LEVEL_EVENT is not set +# CONFIG_BTC_TRACE_LEVEL_DEBUG is not set +# CONFIG_BTC_TRACE_LEVEL_VERBOSE is not set +CONFIG_BTC_INITIAL_TRACE_LEVEL=2 +# CONFIG_OSI_TRACE_LEVEL_NONE is not set +# CONFIG_OSI_TRACE_LEVEL_ERROR is not set +CONFIG_OSI_TRACE_LEVEL_WARNING=y +# CONFIG_OSI_TRACE_LEVEL_API is not set +# CONFIG_OSI_TRACE_LEVEL_EVENT is not set +# CONFIG_OSI_TRACE_LEVEL_DEBUG is not set +# CONFIG_OSI_TRACE_LEVEL_VERBOSE is not set +CONFIG_OSI_INITIAL_TRACE_LEVEL=2 +# CONFIG_BLUFI_TRACE_LEVEL_NONE is not set +# CONFIG_BLUFI_TRACE_LEVEL_ERROR is not set +CONFIG_BLUFI_TRACE_LEVEL_WARNING=y +# CONFIG_BLUFI_TRACE_LEVEL_API is not set +# CONFIG_BLUFI_TRACE_LEVEL_EVENT is not set +# CONFIG_BLUFI_TRACE_LEVEL_DEBUG is not set +# CONFIG_BLUFI_TRACE_LEVEL_VERBOSE is not set +CONFIG_BLUFI_INITIAL_TRACE_LEVEL=2 +# CONFIG_BLE_HOST_QUEUE_CONGESTION_CHECK is not set +CONFIG_SMP_ENABLE=y +# CONFIG_BLE_ACTIVE_SCAN_REPORT_ADV_SCAN_RSP_INDIVIDUALLY is not set +CONFIG_BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT=30 +CONFIG_ADC2_DISABLE_DAC=y +# CONFIG_EVENT_LOOP_PROFILING is not set +CONFIG_POST_EVENTS_FROM_ISR=y +CONFIG_POST_EVENTS_FROM_IRAM_ISR=y +CONFIG_ESP_SYSTEM_PD_FLASH=y +CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND=y +CONFIG_IPC_TASK_STACK_SIZE=1536 +CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y +# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP32_PHY_MAX_TX_POWER=20 +# CONFIG_ESP32_REDUCE_PHY_TX_POWER is not set +CONFIG_ESP_SYSTEM_PM_POWER_DOWN_CPU=y +# CONFIG_ESP32S2_PANIC_PRINT_HALT is not set +CONFIG_ESP32S2_PANIC_PRINT_REBOOT=y +# CONFIG_ESP32S2_PANIC_SILENT_REBOOT is not set +# CONFIG_ESP32S2_PANIC_GDBSTUB is not set +CONFIG_ESP32S2_ALLOW_RTC_FAST_MEM_AS_HEAP=y +CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=3072 +CONFIG_MAIN_TASK_STACK_SIZE=3584 +CONFIG_CONSOLE_UART_DEFAULT=y +# CONFIG_CONSOLE_UART_CUSTOM is not set +# CONFIG_ESP_CONSOLE_UART_NONE is not set +CONFIG_CONSOLE_UART=y +CONFIG_CONSOLE_UART_NUM=0 +CONFIG_CONSOLE_UART_BAUDRATE=115200 +CONFIG_INT_WDT=y +CONFIG_INT_WDT_TIMEOUT_MS=300 +CONFIG_INT_WDT_CHECK_CPU1=y +CONFIG_TASK_WDT=y +# CONFIG_TASK_WDT_PANIC is not set +CONFIG_TASK_WDT_TIMEOUT_S=5 +CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y +# CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set +CONFIG_TIMER_TASK_STACK_SIZE=3584 +CONFIG_SW_COEXIST_ENABLE=y +# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set +CONFIG_ESP32_ENABLE_COREDUMP_TO_UART=y +# CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE is not set +# CONFIG_ESP32_COREDUMP_DATA_FORMAT_BIN is not set +CONFIG_ESP32_COREDUMP_DATA_FORMAT_ELF=y +CONFIG_ESP32_COREDUMP_CHECKSUM_CRC32=y +CONFIG_ESP32_ENABLE_COREDUMP=y +CONFIG_ESP32_CORE_DUMP_MAX_TASKS_NUM=64 +CONFIG_ESP32_CORE_DUMP_UART_DELAY=0 +CONFIG_ESP32_CORE_DUMP_STACK_SIZE=0 +CONFIG_ESP32_CORE_DUMP_DECODE_INFO=y +# CONFIG_ESP32_CORE_DUMP_DECODE_DISABLE is not set +CONFIG_ESP32_CORE_DUMP_DECODE="info" +CONFIG_MB_MASTER_TIMEOUT_MS_RESPOND=150 +CONFIG_MB_MASTER_DELAY_MS_CONVERT=200 +CONFIG_MB_QUEUE_LENGTH=20 +CONFIG_MB_SERIAL_TASK_STACK_SIZE=4096 +CONFIG_MB_SERIAL_BUF_SIZE=256 +CONFIG_MB_SERIAL_TASK_PRIO=10 +# CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT is not set +CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT=20 +CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE=20 +CONFIG_MB_CONTROLLER_STACK_SIZE=4096 +CONFIG_MB_EVENT_QUEUE_TIMEOUT=20 +# CONFIG_MB_TIMER_PORT_ENABLED is not set +# CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set +CONFIG_TIMER_TASK_PRIORITY=1 +CONFIG_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_TIMER_QUEUE_LENGTH=10 +# CONFIG_L2_TO_L3_COPY is not set +# CONFIG_USE_ONLY_LWIP_SELECT is not set +CONFIG_ESP_GRATUITOUS_ARP=y +CONFIG_GARP_TMR_INTERVAL=60 +CONFIG_TCPIP_RECVMBOX_SIZE=32 +CONFIG_TCP_MAXRTX=12 +CONFIG_TCP_SYNMAXRTX=12 +CONFIG_TCP_MSS=1440 +CONFIG_TCP_MSL=60000 +CONFIG_TCP_SND_BUF_DEFAULT=5744 +CONFIG_TCP_WND_DEFAULT=5744 +CONFIG_TCP_RECVMBOX_SIZE=6 +CONFIG_TCP_QUEUE_OOSEQ=y +# CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set +CONFIG_TCP_OVERSIZE_MSS=y +# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set +# CONFIG_TCP_OVERSIZE_DISABLE is not set +CONFIG_UDP_RECVMBOX_SIZE=6 +CONFIG_TCPIP_TASK_STACK_SIZE=3072 +CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y +# CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set +# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set +CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF +# CONFIG_PPP_SUPPORT is not set +CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 +CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 +CONFIG_ESP32_PTHREAD_STACK_MIN=768 +CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set +CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" +CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set +# CONFIG_USB_ENABLED is not set +CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y +CONFIG_SUPPORT_TERMIOS=y +CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 +# End of deprecated options From dfacc163b043b99c2e8d6241f409d883d6af5fcf Mon Sep 17 00:00:00 2001 From: lomasSE89 Date: Mon, 26 Feb 2024 23:55:34 +0545 Subject: [PATCH 21/27] updated readme --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 62142465e..44b48e589 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ EzloPi features a [web-based configurator](https://config.ezlopi.com/) that allo # 2. Customizing and building EzloPi firmware in your local setup It is required to have [ESP-IDF](https://github.com/espressif/esp-idf) installed in your machine. -Install ESP-IDF with taking help from the docs [here](https://docs.espressif.com/projects/esp-idf/en/v4.4.4/esp32/). ESP-IDF version [v4.4.4-292-g7894f032f6-dirty](https://github.com/espressif/esp-idf/releases/tag/v4.4.4). +Install ESP-IDF with taking help from the docs [here](https://docs.espressif.com/projects/esp-idf/en/v4.4.4/esp32/). ESP-IDF version [v4.4.6](https://github.com/espressif/esp-idf/releases/tag/v4.4.6). ### 1. Clone the Ezlo-Pi Repository from GitHub @@ -34,9 +34,9 @@ Navigate to your terminal or bash shell and execute the following commands: git clone --recursive git@github.com:ezloteam/Ezlo_Pi.git ezlopi cd ezlopi/firmware/ezlopi ``` -### 3. Configure the Projec +### 2. Configure the Projec You need to configure the project as per the chip type you are using. It needs to be modified the file ```sdkconfig``` , equivalent to making changes with ```idf.py menuconfig```. -EzloPi needs to have constant set of configurations which are defined for different variants of chips and saved in the file such that ```sdkconfig..```. Copy the content of the chip you are using and paste it into ```sdkconfig```. For example if I want to build and run this firmware on ESP32C3 with 4MB of memory, I need to copy content of ```[sdkconfig.esp32c3.4mb](sdkconfig.esp32c3.4mb)``` into ```sdkconfig``` or rename the file ```sdkconfig.esp32c3.4mb``` to ```sdkconfig```, clean the existing build with ```idf.py fullclean``` and then build as mentioned at #2. The list of pre-defined ```sdkconfig``` for different varients of ESP32 are listed as : +EzloPi needs to have constant set of configurations which are defined for different variants of chips and saved in the file such that ```sdkconfig..```. Copy the content of the chip you are using and paste it into ```sdkconfig```. For example if I want to build and run this firmware on ESP32C3 with 4MB of memory, I need to copy content of [sdkconfig.esp32c3.4mb](sdkconfig.esp32c3.4mb) into ```sdkconfig``` or rename the file ```sdkconfig.esp32c3.4mb``` to ```sdkconfig```, and then build as mentioned at #2. The list of pre-defined ```sdkconfig``` for different variants of ESP32 are listed as : * __[ESP32 4MB Standard](sdkconfig.esp32.4mb)__ * __[ESP32-S3 4MB ](sdkconfig.esp32s3.4mb)__ @@ -44,7 +44,7 @@ EzloPi needs to have constant set of configurations which are defined for differ * __[ESP32-C3 4MB](sdkconfig.esp32c3.4mb)__ -### 2. Build the Project +### 3. Build the Project Execute the following command to build the project: @@ -52,7 +52,7 @@ Execute the following command to build the project: idf.py build ``` -### 3. Flash the Firmware +### 4. Flash the Firmware To flash the firmware, use the following command: @@ -60,7 +60,7 @@ To flash the firmware, use the following command: idf.py -p -b flash ``` -### 4. Open Serial Monitor +### 5. Open Serial Monitor To open the serial monitor, use the following command: From 8fd8078f3ef7c93d2874550f18e2614b5b6f10c8 Mon Sep 17 00:00:00 2001 From: Krishna Kumar Sah Date: Tue, 27 Feb 2024 00:59:54 +0545 Subject: [PATCH 22/27] ws-server is complete, fixes are done for gpio parsing --- .../ezlopi_cloud_registration.c | 2 +- .../ezlopi-core-devices/ezlopi_core_devices.h | 15 ++++++ .../ezlopi-core-event-group/CMakeLists.txt | 4 +- .../ezlopi_core_event_group.c | 4 ++ .../ezlopi_core_ezlopi_broadcast.c | 52 ++++++++++++++++++- .../ezlopi_core_ezlopi_broadcast.h | 1 + .../ezlopi_core_ezlopi_methods.c | 5 ++ .../ezlopi_core_factory_info.c | 8 +-- .../device_0001_digitalOut_generic.c | 9 ++-- .../device_0002_digitalOut_relay.c | 2 +- .../device_0003_digitalOut_plug.c | 4 +- .../device_0004_digitalIn_generic.c | 2 +- .../device_0022_PWM_dimmable_lamp.c | 2 +- .../sensor_0019_digitalIn_PIR.c | 2 +- .../sensor_0020_other_2axis_joystick.c | 6 +-- ...nsor_0023_digitalIn_touch_switch_TTP223B.c | 2 +- .../sensor_0024_other_HCSR04.c | 4 +- .../sensor_0025_digitalIn_LDR.c | 2 +- .../sensor_0031_other_JSNSR04T.c | 4 +- .../sensor_0034_digitalIn_proximity.c | 2 +- ...nsor_0035_digitalIn_touch_sensor_TPP223B.c | 2 +- .../sensor_0048_other_MQ4_CH4_detector.c | 2 +- .../sensor_0049_other_MQ2_LPG_detector.c | 2 +- .../sensor_0050_other_MQ3_alcohol_detector.c | 2 +- .../sensor_0051_other_MQ8_H2_detector.c | 2 +- .../sensor_0052_other_MQ135_NH3_detector.c | 2 +- .../sensor_0057_other_KY026_FlameDetector.c | 2 +- .../sensor_0059_other_MQ6_LPG_detector.c | 2 +- ...sensor_0060_digitalIn_vibration_detector.c | 2 +- .../sensor_0061_digitalIn_reed_switch.c | 2 +- .../sensor_0062_other_MQ7_CO_detector.c | 2 +- ...or_0063_other_MQ9_LPG_flameable_detector.c | 2 +- .../sensor_0065_digitalIn_float_switch.c | 2 +- .../ezlopi_service_gpioisr..c | 2 +- .../ezlopi_service_webprov.c | 2 +- .../ezlopi_service_ws_server.c | 2 + sdkconfig | 49 +++++++++++++++-- sdkconfig.old | 15 +++--- 38 files changed, 177 insertions(+), 51 deletions(-) diff --git a/ezlopi-cloud/ezlopi-cloud-registration/ezlopi_cloud_registration.c b/ezlopi-cloud/ezlopi-cloud-registration/ezlopi_cloud_registration.c index daef44d00..df94709dc 100644 --- a/ezlopi-cloud/ezlopi-cloud-registration/ezlopi_cloud_registration.c +++ b/ezlopi-cloud/ezlopi-cloud-registration/ezlopi_cloud_registration.c @@ -64,7 +64,7 @@ static void registration_process(void *pv) vTaskDelay(200 / portTICK_RATE_MS); } - while (0 >= ezlopi_event_group_wait_for_event(EZLOPI_EVENT_NMA_REG, 2000, false)) + while (ezlopi_event_group_wait_for_event(EZLOPI_EVENT_NMA_REG, 2000, false) <= 0) { web_provisioning_send_to_nma_websocket(cj_register, TRACE_TYPE_B); } diff --git a/ezlopi-core/ezlopi-core-devices/ezlopi_core_devices.h b/ezlopi-core/ezlopi-core-devices/ezlopi_core_devices.h index 69305331a..7e66e1806 100644 --- a/ezlopi-core/ezlopi-core-devices/ezlopi_core_devices.h +++ b/ezlopi-core/ezlopi-core-devices/ezlopi_core_devices.h @@ -44,6 +44,21 @@ TRACE_E("%s not found!", item_name); \ } \ } + +#define CJSON_GET_VALUE_GPIO(root, item_name, item_val) \ + { \ + cJSON *o_item = cJSON_GetObjectItem(root, item_name); \ + if (o_item && o_item->type == cJSON_Number) \ + { \ + item_val = o_item->valueint; \ + } \ + else \ + { \ + item_val = -1; \ + TRACE_E("%s not found!", item_name); \ + } \ + } + // TRACE_I("%s: %d", item_name, item_val); #define CJSON_GET_VALUE_STRING(root, item_name, item_val) \ diff --git a/ezlopi-core/ezlopi-core-event-group/CMakeLists.txt b/ezlopi-core/ezlopi-core-event-group/CMakeLists.txt index 16ad428dc..29c3a8493 100644 --- a/ezlopi-core/ezlopi-core-event-group/CMakeLists.txt +++ b/ezlopi-core/ezlopi-core-event-group/CMakeLists.txt @@ -3,6 +3,8 @@ file(GLOB_RECURSE config_src "*.c") idf_component_register(SRCS "${config_src}" - INCLUDE_DIRS ".") + INCLUDE_DIRS "." + REQUIRES ezlopi-util-trace +) diff --git a/ezlopi-core/ezlopi-core-event-group/ezlopi_core_event_group.c b/ezlopi-core/ezlopi-core-event-group/ezlopi_core_event_group.c index edbee2e11..166bb27dc 100644 --- a/ezlopi-core/ezlopi-core-event-group/ezlopi_core_event_group.c +++ b/ezlopi-core/ezlopi-core-event-group/ezlopi_core_event_group.c @@ -4,6 +4,8 @@ #include "freertos/task.h" #include "freertos/event_groups.h" +#include "ezlopi_util_trace.h" + #include "ezlopi_core_event_group.h" static EventGroupHandle_t ezlopi_event_group_handle = NULL; @@ -42,6 +44,8 @@ int ezlopi_event_group_wait_for_event(e_ezlopi_event_t event, uint32_t wait_time { ret = 1; } + + TRACE_D("event-bits: %08x, event: %08x", event_bits, event); } else { diff --git a/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_broadcast.c b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_broadcast.c index 1556dff21..a94d47228 100644 --- a/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_broadcast.c +++ b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_broadcast.c @@ -10,12 +10,13 @@ void ezlopi_core_ezlopi_broadcast_execute(char *data) if (data) { l_broadcast_method_t *curr_node = method_head; + while (curr_node) { if (curr_node->func) { uint32_t retries = curr_node->fail_retry; - TRACE_D("broadcast-method-name: %s", curr_node->method_name ? curr_node->method_name : ""); + do { if (curr_node->func(data) > 0) @@ -37,6 +38,8 @@ l_broadcast_method_t *ezlopi_core_ezlopi_broadcast_method_add(f_broadcast_method if (ret) { + TRACE_D("registering broadcast method ..."); + if (method_head) { l_broadcast_method_t *curr_node = method_head; @@ -46,24 +49,60 @@ l_broadcast_method_t *ezlopi_core_ezlopi_broadcast_method_add(f_broadcast_method curr_node = curr_node->next; } + TRACE_D("registered ..."); curr_node->next = ret; } else { + TRACE_D("registered ..."); method_head = ret; } } + else + { + TRACE_E("registering broadcast method failed ..."); + } return ret; } +void ezlopi_core_ezlopi_broadcast_remove_method(f_broadcast_method_t broadcast_method) +{ + if (method_head) + { + if (broadcast_method == method_head->func) + { + l_broadcast_method_t *remove_node = method_head; + method_head = method_head->next; + free(remove_node); + } + else + { + l_broadcast_method_t *curr_node = method_head; + while (curr_node->next) + { + if (curr_node->next->func == broadcast_method) + { + l_broadcast_method_t *remove_node = curr_node->next; + curr_node->next = curr_node->next->next; + free(remove_node); + + break; + } + + curr_node = curr_node->next; + } + } + } +} + static l_broadcast_method_t *__method_create(f_broadcast_method_t method, uint32_t retries) { l_broadcast_method_t *method_node = NULL; if (method) { - l_broadcast_method_t *method_node = malloc(sizeof(l_broadcast_method_t)); + method_node = malloc(sizeof(l_broadcast_method_t)); if (method_node) { @@ -72,7 +111,16 @@ static l_broadcast_method_t *__method_create(f_broadcast_method_t method, uint32 method_node->next = NULL; method_node->func = method; method_node->fail_retry = retries; + method_node->method_name = ""; } + else + { + TRACE_E("malloc failed"); + } + } + else + { + TRACE_E("method is NULL"); } return method_node; diff --git a/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_broadcast.h b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_broadcast.h index 0be0ffe30..cb1bac77e 100644 --- a/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_broadcast.h +++ b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_broadcast.h @@ -18,6 +18,7 @@ typedef struct l_broadcast_method } l_broadcast_method_t; void ezlopi_core_ezlopi_broadcast_execute(char *data); +void ezlopi_core_ezlopi_broadcast_remove_method(f_broadcast_method_t broadcast_method); l_broadcast_method_t *ezlopi_core_ezlopi_broadcast_method_add(f_broadcast_method_t broadcast_method, uint32_t retries); #endif // __EZLOPI_CORE_EZLOPI_BROADCAST_H__ diff --git a/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_methods.c b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_methods.c index 7c3559304..8495a6cbc 100644 --- a/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_methods.c +++ b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_methods.c @@ -91,10 +91,15 @@ void ezlopi_core_ezlopi_methods_registration_init(void) bool ezlopi_core_elzlopi_methods_check_method_register(f_method_func_t method) { bool ret = false; + + TRACE_D("method: %p", method); + TRACE_D("registered: %p", registered); + if (registered == method) { ret = true; } + return ret; } diff --git a/ezlopi-core/ezlopi-core-factory-info/ezlopi_core_factory_info.c b/ezlopi-core/ezlopi-core-factory-info/ezlopi_core_factory_info.c index 6d45b4ffa..762f7117b 100644 --- a/ezlopi-core/ezlopi-core-factory-info/ezlopi_core_factory_info.c +++ b/ezlopi-core/ezlopi-core-factory-info/ezlopi_core_factory_info.c @@ -165,11 +165,11 @@ void print_factory_info_v3(void) // TRACE_W("PROVISIONING_UUID [off: 0x%04X, size: 0x%04X]: %s", ezlopi_factory_info_v3_get_abs_address(EZLOPI_FINFO_REL_OFFSET_PROVISIONING_UUID, E_EZLOPI_FACTORY_INFO_CONN_DATA), EZLOPI_FINFO_LEN_PROV_UUID, provisioning_uuid ? provisioning_uuid : "null"); TRACE_W("WIFI-SSID [off: 0x%04X, size: 0x%04X]: %s", ezlopi_factory_info_v3_get_abs_address(EZLOPI_FINFO_REL_OFFSET_WIFI_SSID, E_EZLOPI_FACTORY_INFO_HUB_DATA), EZLOPI_FINFO_LEN_WIFI_SSID, wifi_ssid ? wifi_ssid : "null"); TRACE_W("WIFI-PASSWORD [off: 0x%04X, size: 0x%04X]: %s", ezlopi_factory_info_v3_get_abs_address(EZLOPI_FINFO_REL_OFFSET_WIFI_PASS, E_EZLOPI_FACTORY_INFO_HUB_DATA), EZLOPI_FINFO_LEN_WIFI_PASS, wifi_password ? wifi_password : "null"); - // TRACE_W("CLOUD_SERVER [off: 0x%04X, size: 0x%04X]: %s", ezlopi_factory_info_v3_get_abs_address(EZLOPI_FINFO_REL_OFFSET_CLOUD_SERVER_URL, E_EZLOPI_FACTORY_INFO_CONN_DATA), EZLOPI_FINFO_LEN_CLOUD_SERVER_URL, cloud_server ? cloud_server : "null"); + TRACE_W("CLOUD_SERVER [off: 0x%04X, size: 0x%04X]: %s", ezlopi_factory_info_v3_get_abs_address(EZLOPI_FINFO_REL_OFFSET_CLOUD_SERVER_URL, E_EZLOPI_FACTORY_INFO_CONN_DATA), EZLOPI_FINFO_LEN_CLOUD_SERVER_URL, cloud_server ? cloud_server : "null"); TRACE_W("DEVICE_TYPE [off: 0x%04X, size: 0x%04X]: %s", ezlopi_factory_info_v3_get_abs_address(EZLOPI_FINFO_REL_OFFSET_EZLOPI_DEVICE_TYPE, E_EZLOPI_FACTORY_INFO_HUB_DATA), EZLOPI_FINFO_LEN_EZLOPI_DEVICE_TYPE, device_type ? device_type : "null"); - // TRACE_W("CA_CERTIFICATE [off: 0x%04X, size: 0x%04X]: %s", ezlopi_factory_info_v3_get_abs_address(EZLOPI_FINFO_REL_OFFSET_CA_CERTIFICATE, E_EZLOPI_FACTORY_INFO_CONN_DATA), EZLOPI_FINFO_LEN_CA_CERTIFICATE, ca_certificate ? ca_certificate : "null"); - // TRACE_W("SSL_PRIVATE_KEY [off: 0x%04X, size: 0x%04X]: %s", ezlopi_factory_info_v3_get_abs_address(EZLOPI_FINFO_REL_OFFSET_SSL_PRIVATE_KEY, E_EZLOPI_FACTORY_INFO_CONN_DATA), EZLOPI_FINFO_LEN_SSL_PRIVATE_KEY, ssl_private_key ? ssl_private_key : "null"); - // TRACE_W("SSL_SHARED_KEY [off: 0x%04X, size: 0x%04X]: %s", ezlopi_factory_info_v3_get_abs_address(EZLOPI_FINFO_REL_OFFSET_SSL_SHARED_KEY, E_EZLOPI_FACTORY_INFO_CONN_DATA), EZLOPI_FINFO_LEN_SSL_SHARED_KEY, ssl_shared_key ? ssl_shared_key : "null"); + TRACE_W("CA_CERTIFICATE [off: 0x%04X, size: 0x%04X]: %s", ezlopi_factory_info_v3_get_abs_address(EZLOPI_FINFO_REL_OFFSET_CA_CERTIFICATE, E_EZLOPI_FACTORY_INFO_CONN_DATA), EZLOPI_FINFO_LEN_CA_CERTIFICATE, ca_certificate ? ca_certificate : "null"); + TRACE_W("SSL_PRIVATE_KEY [off: 0x%04X, size: 0x%04X]: %s", ezlopi_factory_info_v3_get_abs_address(EZLOPI_FINFO_REL_OFFSET_SSL_PRIVATE_KEY, E_EZLOPI_FACTORY_INFO_CONN_DATA), EZLOPI_FINFO_LEN_SSL_PRIVATE_KEY, ssl_private_key ? ssl_private_key : "null"); + TRACE_W("SSL_SHARED_KEY [off: 0x%04X, size: 0x%04X]: %s", ezlopi_factory_info_v3_get_abs_address(EZLOPI_FINFO_REL_OFFSET_SSL_SHARED_KEY, E_EZLOPI_FACTORY_INFO_CONN_DATA), EZLOPI_FINFO_LEN_SSL_SHARED_KEY, ssl_shared_key ? ssl_shared_key : "null"); TRACE_W("EZLOPI_CONFIG [off: 0x%04X, size: 0x%04X]: %s", ezlopi_factory_info_v3_get_abs_address(EZLOPI_FINFO_REL_OFFSET_EZLOPI_CONFIG_JSON, E_EZLOPI_FACTORY_INFO_CONN_DATA), EZLOPI_FINFO_LEN_EZLOPI_CONFIG_JSON, ezlopi_config ? ezlopi_config : "null"); TRACE_W("-------------------------------------------------"); diff --git a/ezlopi-sensors-devices/device-0001-digitalOut-generic/device_0001_digitalOut_generic.c b/ezlopi-sensors-devices/device-0001-digitalOut-generic/device_0001_digitalOut_generic.c index 853648f4a..b7c21685f 100644 --- a/ezlopi-sensors-devices/device-0001-digitalOut-generic/device_0001_digitalOut_generic.c +++ b/ezlopi-sensors-devices/device-0001-digitalOut-generic/device_0001_digitalOut_generic.c @@ -274,7 +274,7 @@ static void __setup_item_properties(l_ezlopi_item_t *item, cJSON *cjson_device) CJSON_GET_VALUE_INT(cjson_device, ezlopi_dev_type_str, item->interface_type); CJSON_GET_VALUE_INT(cjson_device, ezlopi_is_ip_str, item->interface.gpio.gpio_in.enable); - CJSON_GET_VALUE_INT(cjson_device, ezlopi_gpio_in_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_GPIO(cjson_device, ezlopi_gpio_in_str, item->interface.gpio.gpio_in.gpio_num); CJSON_GET_VALUE_INT(cjson_device, ezlopi_ip_inv_str, item->interface.gpio.gpio_in.invert); CJSON_GET_VALUE_INT(cjson_device, ezlopi_val_ip_str, item->interface.gpio.gpio_in.value); CJSON_GET_VALUE_INT(cjson_device, ezlopi_pullup_ip_str, tmp_var); @@ -282,7 +282,7 @@ static void __setup_item_properties(l_ezlopi_item_t *item, cJSON *cjson_device) item->interface.gpio.gpio_in.interrupt = GPIO_INTR_DISABLE; item->interface.gpio.gpio_out.enable = true; - CJSON_GET_VALUE_INT(cjson_device, ezlopi_gpio_out_str, item->interface.gpio.gpio_out.gpio_num); + CJSON_GET_VALUE_GPIO(cjson_device, ezlopi_gpio_out_str, item->interface.gpio.gpio_out.gpio_num); CJSON_GET_VALUE_INT(cjson_device, ezlopi_op_inv_str, item->interface.gpio.gpio_out.invert); CJSON_GET_VALUE_INT(cjson_device, ezlopi_val_op_str, item->interface.gpio.gpio_out.value); CJSON_GET_VALUE_INT(cjson_device, ezlopi_pullup_op_str, tmp_var); @@ -395,7 +395,8 @@ static int __init(l_ezlopi_item_t *item) if (GPIO_IS_VALID_GPIO(item->interface.gpio.gpio_in.gpio_num) && (-1 != item->interface.gpio.gpio_in.gpio_num) && - (255 != item->interface.gpio.gpio_in.gpio_num)) + (255 != item->interface.gpio.gpio_in.gpio_num)) // && + // (0 != item->interface.gpio.gpio_in.gpio_num)) { const gpio_config_t io_conf = { .pin_bit_mask = (1ULL << item->interface.gpio.gpio_in.gpio_num), @@ -413,6 +414,8 @@ static int __init(l_ezlopi_item_t *item) : GPIO_INTR_NEGEDGE, }; + TRACE_D("enabling interrup for pin: %d", item->interface.gpio.gpio_in.gpio_num); + gpio_config(&io_conf); gpio_isr_service_register_v3(item, __interrupt_upcall, 1000); ret = 1; diff --git a/ezlopi-sensors-devices/device-0002-digitalOut-relay/device_0002_digitalOut_relay.c b/ezlopi-sensors-devices/device-0002-digitalOut-relay/device_0002_digitalOut_relay.c index e2acab0fb..4e17c65d3 100644 --- a/ezlopi-sensors-devices/device-0002-digitalOut-relay/device_0002_digitalOut_relay.c +++ b/ezlopi-sensors-devices/device-0002-digitalOut-relay/device_0002_digitalOut_relay.c @@ -100,7 +100,7 @@ static void __setup_item_properties(l_ezlopi_item_t *item, cJSON *cjson_device) item->interface.gpio.gpio_in.interrupt = GPIO_INTR_DISABLE; item->interface.gpio.gpio_out.enable = true; - CJSON_GET_VALUE_INT(cjson_device, ezlopi_gpio_out_str, item->interface.gpio.gpio_out.gpio_num); + CJSON_GET_VALUE_GPIO(cjson_device, ezlopi_gpio_out_str, item->interface.gpio.gpio_out.gpio_num); CJSON_GET_VALUE_INT(cjson_device, ezlopi_op_inv_str, item->interface.gpio.gpio_out.invert); CJSON_GET_VALUE_INT(cjson_device, ezlopi_val_op_str, item->interface.gpio.gpio_out.value); CJSON_GET_VALUE_INT(cjson_device, ezlopi_pullup_op_str, tmp_var); diff --git a/ezlopi-sensors-devices/device-0003-digitalOut-plug/device_0003_digitalOut_plug.c b/ezlopi-sensors-devices/device-0003-digitalOut-plug/device_0003_digitalOut_plug.c index 76e5cae5f..256619306 100644 --- a/ezlopi-sensors-devices/device-0003-digitalOut-plug/device_0003_digitalOut_plug.c +++ b/ezlopi-sensors-devices/device-0003-digitalOut-plug/device_0003_digitalOut_plug.c @@ -92,7 +92,7 @@ static void __setup_item_properties(l_ezlopi_item_t *item, cJSON *cjson_device) CJSON_GET_VALUE_INT(cjson_device, ezlopi_dev_type_str, item->interface_type); CJSON_GET_VALUE_INT(cjson_device, ezlopi_is_ip_str, item->interface.gpio.gpio_in.enable); - CJSON_GET_VALUE_INT(cjson_device, ezlopi_gpio_in_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_GPIO(cjson_device, ezlopi_gpio_in_str, item->interface.gpio.gpio_in.gpio_num); CJSON_GET_VALUE_INT(cjson_device, ezlopi_ip_inv_str, item->interface.gpio.gpio_in.invert); CJSON_GET_VALUE_INT(cjson_device, ezlopi_val_ip_str, item->interface.gpio.gpio_in.value); CJSON_GET_VALUE_INT(cjson_device, ezlopi_pullup_ip_str, tmp_var); @@ -100,7 +100,7 @@ static void __setup_item_properties(l_ezlopi_item_t *item, cJSON *cjson_device) item->interface.gpio.gpio_in.interrupt = GPIO_INTR_DISABLE; item->interface.gpio.gpio_out.enable = true; - CJSON_GET_VALUE_INT(cjson_device, ezlopi_gpio_out_str, item->interface.gpio.gpio_out.gpio_num); + CJSON_GET_VALUE_GPIO(cjson_device, ezlopi_gpio_out_str, item->interface.gpio.gpio_out.gpio_num); CJSON_GET_VALUE_INT(cjson_device, ezlopi_op_inv_str, item->interface.gpio.gpio_out.invert); CJSON_GET_VALUE_INT(cjson_device, ezlopi_val_op_str, item->interface.gpio.gpio_out.value); CJSON_GET_VALUE_INT(cjson_device, ezlopi_pullup_op_str, tmp_var); diff --git a/ezlopi-sensors-devices/device-0004-digitalIn-generic/device_0004_digitalIn_generic.c b/ezlopi-sensors-devices/device-0004-digitalIn-generic/device_0004_digitalIn_generic.c index 7e92e39c3..7be9360b3 100644 --- a/ezlopi-sensors-devices/device-0004-digitalIn-generic/device_0004_digitalIn_generic.c +++ b/ezlopi-sensors-devices/device-0004-digitalIn-generic/device_0004_digitalIn_generic.c @@ -84,7 +84,7 @@ static void __setup_item_properties(l_ezlopi_item_t *item, cJSON *cjson_device) item->interface.gpio.gpio_in.enable = true; CJSON_GET_VALUE_INT(cjson_device, ezlopi_dev_type_str, item->interface_type); - CJSON_GET_VALUE_INT(cjson_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_GPIO(cjson_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); CJSON_GET_VALUE_INT(cjson_device, "logic_inv", item->interface.gpio.gpio_in.invert); CJSON_GET_VALUE_INT(cjson_device, "pull_up", tmp_var); item->interface.gpio.gpio_in.pull = tmp_var ? GPIO_PULLUP_ONLY : GPIO_PULLDOWN_ONLY; diff --git a/ezlopi-sensors-devices/device-0022-PWM-dimmable-lamp/device_0022_PWM_dimmable_lamp.c b/ezlopi-sensors-devices/device-0022-PWM-dimmable-lamp/device_0022_PWM_dimmable_lamp.c index efda647f9..33971ef36 100644 --- a/ezlopi-sensors-devices/device-0022-PWM-dimmable-lamp/device_0022_PWM_dimmable_lamp.c +++ b/ezlopi-sensors-devices/device-0022-PWM-dimmable-lamp/device_0022_PWM_dimmable_lamp.c @@ -354,7 +354,7 @@ static void __prepare_dimmer_switch_item_properties(l_ezlopi_item_t *item, cJSON item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); item->cloud_properties.scale = NULL; - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_out.gpio_num); + CJSON_GET_VALUE_GPIO(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_out.gpio_num); item->interface.gpio.gpio_in.enable = false; item->interface.gpio.gpio_out.enable = true; item->interface.gpio.gpio_out.interrupt = false; diff --git a/ezlopi-sensors-devices/sensor-0019-digitalIn-PIR/sensor_0019_digitalIn_PIR.c b/ezlopi-sensors-devices/sensor-0019-digitalIn-PIR/sensor_0019_digitalIn_PIR.c index 377da85ff..560fc8532 100644 --- a/ezlopi-sensors-devices/sensor-0019-digitalIn-PIR/sensor_0019_digitalIn_PIR.c +++ b/ezlopi-sensors-devices/sensor-0019-digitalIn-PIR/sensor_0019_digitalIn_PIR.c @@ -172,7 +172,7 @@ static void sensor_pir_setup_item_properties_v3(l_ezlopi_item_t *item, cJSON *cj item->interface.gpio.gpio_in.enable = true; item->interface.gpio.gpio_in.mode = GPIO_MODE_INPUT; - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_GPIO(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); CJSON_GET_VALUE_INT(cj_device, "logic_inv", item->interface.gpio.gpio_in.invert); CJSON_GET_VALUE_INT(cj_device, "pull_up", tmp_var); item->interface.gpio.gpio_in.pull = tmp_var ? GPIO_PULLUP_ONLY : GPIO_PULLDOWN_ONLY; diff --git a/ezlopi-sensors-devices/sensor-0020-other-2axis-joystick/sensor_0020_other_2axis_joystick.c b/ezlopi-sensors-devices/sensor-0020-other-2axis-joystick/sensor_0020_other_2axis_joystick.c index 673e9cf2c..0f1314536 100644 --- a/ezlopi-sensors-devices/sensor-0020-other-2axis-joystick/sensor_0020_other_2axis_joystick.c +++ b/ezlopi-sensors-devices/sensor-0020-other-2axis-joystick/sensor_0020_other_2axis_joystick.c @@ -120,19 +120,19 @@ static void __setup_item_interface_properties(l_ezlopi_item_t *item, cJSON *cj_d if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_X] == item->cloud_properties.item_id) { item->interface_type = EZLOPI_DEVICE_INTERFACE_ANALOG_INPUT; - CJSON_GET_VALUE_INT(cj_device, "gpio1", item->interface.adc.gpio_num); + CJSON_GET_VALUE_GPIO(cj_device, "gpio1", item->interface.adc.gpio_num); item->interface.adc.resln_bit = 3; } if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_Y] == item->cloud_properties.item_id) { item->interface_type = EZLOPI_DEVICE_INTERFACE_ANALOG_INPUT; - CJSON_GET_VALUE_INT(cj_device, "gpio2", item->interface.adc.gpio_num); + CJSON_GET_VALUE_GPIO(cj_device, "gpio2", item->interface.adc.gpio_num); item->interface.adc.resln_bit = 3; } if (user_data->sensor_0020_joystick_item_ids[JOYSTICK_ITEM_ID_SWITCH] == item->cloud_properties.item_id) { item->interface_type = EZLOPI_DEVICE_INTERFACE_DIGITAL_INPUT; - CJSON_GET_VALUE_INT(cj_device, "gpio3", item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_GPIO(cj_device, "gpio3", item->interface.gpio.gpio_in.gpio_num); item->interface.gpio.gpio_in.enable = true; item->interface.gpio.gpio_in.interrupt = GPIO_INTR_ANYEDGE; item->interface.gpio.gpio_in.pull = GPIO_PULLUP_ONLY; diff --git a/ezlopi-sensors-devices/sensor-0023-digitalIn-touch-switch-TTP223B/sensor_0023_digitalIn_touch_switch_TTP223B.c b/ezlopi-sensors-devices/sensor-0023-digitalIn-touch-switch-TTP223B/sensor_0023_digitalIn_touch_switch_TTP223B.c index 8f52d30e8..b8deed8f2 100644 --- a/ezlopi-sensors-devices/sensor-0023-digitalIn-touch-switch-TTP223B/sensor_0023_digitalIn_touch_switch_TTP223B.c +++ b/ezlopi-sensors-devices/sensor-0023-digitalIn-touch-switch-TTP223B/sensor_0023_digitalIn_touch_switch_TTP223B.c @@ -148,7 +148,7 @@ static void __prepare_touch_switch_properties(l_ezlopi_item_t *item, cJSON *cj_d item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); item->cloud_properties.scale = NULL; - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_GPIO(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); CJSON_GET_VALUE_INT(cj_device, ezlopi_ip_inv_str, item->interface.gpio.gpio_in.invert); int val_ip = 0; CJSON_GET_VALUE_INT(cj_device, ezlopi_val_ip_str, val_ip); diff --git a/ezlopi-sensors-devices/sensor-0024-other-HCSR04/sensor_0024_other_HCSR04.c b/ezlopi-sensors-devices/sensor-0024-other-HCSR04/sensor_0024_other_HCSR04.c index 1561b6c15..d23864821 100644 --- a/ezlopi-sensors-devices/sensor-0024-other-HCSR04/sensor_0024_other_HCSR04.c +++ b/ezlopi-sensors-devices/sensor-0024-other-HCSR04/sensor_0024_other_HCSR04.c @@ -186,8 +186,8 @@ static void __setup_item_properties(l_ezlopi_item_t *item, cJSON *cj_device) item->cloud_properties.scale = scales_centi_meter; item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); - CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio1_str, item->interface.gpio.gpio_out.gpio_num); - CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio2_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_GPIO(cj_device, ezlopi_gpio1_str, item->interface.gpio.gpio_out.gpio_num); + CJSON_GET_VALUE_GPIO(cj_device, ezlopi_gpio2_str, item->interface.gpio.gpio_in.gpio_num); item->interface.gpio.gpio_out.enable = true; item->interface.gpio.gpio_out.interrupt = GPIO_INTR_DISABLE; diff --git a/ezlopi-sensors-devices/sensor-0025-digitalIn-LDR/sensor_0025_digitalIn_LDR.c b/ezlopi-sensors-devices/sensor-0025-digitalIn-LDR/sensor_0025_digitalIn_LDR.c index b5e3e54c8..687dd49c3 100644 --- a/ezlopi-sensors-devices/sensor-0025-digitalIn-LDR/sensor_0025_digitalIn_LDR.c +++ b/ezlopi-sensors-devices/sensor-0025-digitalIn-LDR/sensor_0025_digitalIn_LDR.c @@ -148,7 +148,7 @@ static void __setup_item_properties(l_ezlopi_item_t *item, cJSON *cj_device) item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_GPIO(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); CJSON_GET_VALUE_INT(cj_device, "logic_inv", item->interface.gpio.gpio_in.invert); CJSON_GET_VALUE_INT(cj_device, ezlopi_val_ip_str, item->interface.gpio.gpio_in.value); item->interface.gpio.gpio_in.enable = true; diff --git a/ezlopi-sensors-devices/sensor-0031-other-JSNSR04T/sensor_0031_other_JSNSR04T.c b/ezlopi-sensors-devices/sensor-0031-other-JSNSR04T/sensor_0031_other_JSNSR04T.c index 50a10fdc1..2cd36d228 100644 --- a/ezlopi-sensors-devices/sensor-0031-other-JSNSR04T/sensor_0031_other_JSNSR04T.c +++ b/ezlopi-sensors-devices/sensor-0031-other-JSNSR04T/sensor_0031_other_JSNSR04T.c @@ -156,7 +156,7 @@ static void __prepare_item_interface_properties(l_ezlopi_item_t *item, cJSON *cj { item->interface_type = EZLOPI_DEVICE_INTERFACE_DIGITAL_OUTPUT; - CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_out_str, item->interface.gpio.gpio_out.gpio_num); + CJSON_GET_VALUE_GPIO(cj_device, ezlopi_gpio_out_str, item->interface.gpio.gpio_out.gpio_num); item->interface.gpio.gpio_out.enable = true; item->interface.gpio.gpio_out.interrupt = GPIO_INTR_DISABLE; item->interface.gpio.gpio_out.invert = EZLOPI_GPIO_LOGIC_NONINVERTED; @@ -164,7 +164,7 @@ static void __prepare_item_interface_properties(l_ezlopi_item_t *item, cJSON *cj item->interface.gpio.gpio_out.pull = GPIO_PULLDOWN_ONLY; item->interface.gpio.gpio_out.value = 0; - CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio_in_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_GPIO(cj_device, ezlopi_gpio_in_str, item->interface.gpio.gpio_in.gpio_num); item->interface.gpio.gpio_in.enable = true; item->interface.gpio.gpio_in.interrupt = GPIO_INTR_DISABLE; item->interface.gpio.gpio_in.invert = EZLOPI_GPIO_LOGIC_NONINVERTED; diff --git a/ezlopi-sensors-devices/sensor-0034-digitalIn-proximity/sensor_0034_digitalIn_proximity.c b/ezlopi-sensors-devices/sensor-0034-digitalIn-proximity/sensor_0034_digitalIn_proximity.c index c04054ab9..e8df4903b 100644 --- a/ezlopi-sensors-devices/sensor-0034-digitalIn-proximity/sensor_0034_digitalIn_proximity.c +++ b/ezlopi-sensors-devices/sensor-0034-digitalIn-proximity/sensor_0034_digitalIn_proximity.c @@ -83,7 +83,7 @@ static void proximity_sensor_setup_item_properties(l_ezlopi_item_t *item, cJSON item->interface.gpio.gpio_in.enable = true; item->interface.gpio.gpio_in.mode = GPIO_MODE_INPUT; - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_GPIO(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); CJSON_GET_VALUE_INT(cj_device, "logic_inv", item->interface.gpio.gpio_in.invert); // CJSON_GET_VALUE_INT(cj_device, "pull_up", tmp_var); item->interface.gpio.gpio_in.pull = GPIO_PULLUP_ONLY; // tmp_var ? GPIO_PULLUP_ONLY : GPIO_PULLDOWN_ONLY; diff --git a/ezlopi-sensors-devices/sensor-0035-digitalIn-touch-sensor-TPP223B/sensor_0035_digitalIn_touch_sensor_TPP223B.c b/ezlopi-sensors-devices/sensor-0035-digitalIn-touch-sensor-TPP223B/sensor_0035_digitalIn_touch_sensor_TPP223B.c index 685998233..f6fd82217 100644 --- a/ezlopi-sensors-devices/sensor-0035-digitalIn-touch-sensor-TPP223B/sensor_0035_digitalIn_touch_sensor_TPP223B.c +++ b/ezlopi-sensors-devices/sensor-0035-digitalIn-touch-sensor-TPP223B/sensor_0035_digitalIn_touch_sensor_TPP223B.c @@ -148,7 +148,7 @@ static void __prepare_touch_sensor_properties(l_ezlopi_item_t *item, cJSON *cj_d item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); item->cloud_properties.scale = NULL; - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_GPIO(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); CJSON_GET_VALUE_INT(cj_device, ezlopi_ip_inv_str, item->interface.gpio.gpio_in.invert); CJSON_GET_VALUE_INT(cj_device, ezlopi_val_ip_str, item->interface.gpio.gpio_in.value); diff --git a/ezlopi-sensors-devices/sensor-0048-other-MQ4-CH4-detector/sensor_0048_other_MQ4_CH4_detector.c b/ezlopi-sensors-devices/sensor-0048-other-MQ4-CH4-detector/sensor_0048_other_MQ4_CH4_detector.c index 3a202c948..e1a9babe0 100644 --- a/ezlopi-sensors-devices/sensor-0048-other-MQ4-CH4-detector/sensor_0048_other_MQ4_CH4_detector.c +++ b/ezlopi-sensors-devices/sensor-0048-other-MQ4-CH4-detector/sensor_0048_other_MQ4_CH4_detector.c @@ -196,7 +196,7 @@ static void __prepare_item_digi_cloud_properties(l_ezlopi_item_t *item, cJSON *c item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); // _max = 10 - CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio1_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_GPIO(cj_device, ezlopi_gpio1_str, item->interface.gpio.gpio_in.gpio_num); TRACE_S("MQ4-> DIGITAL_PIN: %d ", item->interface.gpio.gpio_in.gpio_num); } //------------------------------------------------------------------------------------------------------ diff --git a/ezlopi-sensors-devices/sensor-0049-other-MQ2-LPG-detector/sensor_0049_other_MQ2_LPG_detector.c b/ezlopi-sensors-devices/sensor-0049-other-MQ2-LPG-detector/sensor_0049_other_MQ2_LPG_detector.c index 5763573fa..ebc9fb064 100644 --- a/ezlopi-sensors-devices/sensor-0049-other-MQ2-LPG-detector/sensor_0049_other_MQ2_LPG_detector.c +++ b/ezlopi-sensors-devices/sensor-0049-other-MQ2-LPG-detector/sensor_0049_other_MQ2_LPG_detector.c @@ -194,7 +194,7 @@ static void __prepare_item_digi_cloud_properties(l_ezlopi_item_t *item, cJSON *c item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); // _max = 10 - CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio1_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_GPIO(cj_device, ezlopi_gpio1_str, item->interface.gpio.gpio_in.gpio_num); TRACE_S("MQ2-> DIGITAL_PIN: %d ", item->interface.gpio.gpio_in.gpio_num); } //------------------------------------------------------------------------------------------------------ diff --git a/ezlopi-sensors-devices/sensor-0050-other-MQ3-alcohol-detector/sensor_0050_other_MQ3_alcohol_detector.c b/ezlopi-sensors-devices/sensor-0050-other-MQ3-alcohol-detector/sensor_0050_other_MQ3_alcohol_detector.c index 1de31fdd7..f229f69f2 100644 --- a/ezlopi-sensors-devices/sensor-0050-other-MQ3-alcohol-detector/sensor_0050_other_MQ3_alcohol_detector.c +++ b/ezlopi-sensors-devices/sensor-0050-other-MQ3-alcohol-detector/sensor_0050_other_MQ3_alcohol_detector.c @@ -195,7 +195,7 @@ static void __prepare_item_digi_cloud_properties(l_ezlopi_item_t *item, cJSON *c item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); // _max = 10 - CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio1_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_GPIO(cj_device, ezlopi_gpio1_str, item->interface.gpio.gpio_in.gpio_num); TRACE_S("MQ3-> DIGITAL_PIN: %d ", item->interface.gpio.gpio_in.gpio_num); } //------------------------------------------------------------------------------------------------------ diff --git a/ezlopi-sensors-devices/sensor-0051-other-MQ8-H2-detector/sensor_0051_other_MQ8_H2_detector.c b/ezlopi-sensors-devices/sensor-0051-other-MQ8-H2-detector/sensor_0051_other_MQ8_H2_detector.c index a3c35e01b..ea45835c4 100644 --- a/ezlopi-sensors-devices/sensor-0051-other-MQ8-H2-detector/sensor_0051_other_MQ8_H2_detector.c +++ b/ezlopi-sensors-devices/sensor-0051-other-MQ8-H2-detector/sensor_0051_other_MQ8_H2_detector.c @@ -193,7 +193,7 @@ static void __prepare_item_digi_cloud_properties(l_ezlopi_item_t *item, cJSON *c item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); // _max = 10 - CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio1_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_GPIO(cj_device, ezlopi_gpio1_str, item->interface.gpio.gpio_in.gpio_num); TRACE_S("MQ8-> DIGITAL_PIN: %d ", item->interface.gpio.gpio_in.gpio_num); } //------------------------------------------------------------------------------------------------------ diff --git a/ezlopi-sensors-devices/sensor-0052-other-MQ135-NH3-detector/sensor_0052_other_MQ135_NH3_detector.c b/ezlopi-sensors-devices/sensor-0052-other-MQ135-NH3-detector/sensor_0052_other_MQ135_NH3_detector.c index d5fb22b59..975df72cf 100644 --- a/ezlopi-sensors-devices/sensor-0052-other-MQ135-NH3-detector/sensor_0052_other_MQ135_NH3_detector.c +++ b/ezlopi-sensors-devices/sensor-0052-other-MQ135-NH3-detector/sensor_0052_other_MQ135_NH3_detector.c @@ -194,7 +194,7 @@ static void __prepare_item_digi_cloud_properties(l_ezlopi_item_t *item, cJSON *c item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); // _max = 10 - CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio1_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_GPIO(cj_device, ezlopi_gpio1_str, item->interface.gpio.gpio_in.gpio_num); TRACE_S("MQ135-> DIGITAL_PIN: %d ", item->interface.gpio.gpio_in.gpio_num); } //------------------------------------------------------------------------------------------------------ diff --git a/ezlopi-sensors-devices/sensor-0057-other-KY026-FlameDetector/sensor_0057_other_KY026_FlameDetector.c b/ezlopi-sensors-devices/sensor-0057-other-KY026-FlameDetector/sensor_0057_other_KY026_FlameDetector.c index 2f994dc34..f3a32559e 100644 --- a/ezlopi-sensors-devices/sensor-0057-other-KY026-FlameDetector/sensor_0057_other_KY026_FlameDetector.c +++ b/ezlopi-sensors-devices/sensor-0057-other-KY026-FlameDetector/sensor_0057_other_KY026_FlameDetector.c @@ -178,7 +178,7 @@ static void __prepare_item_digi_cloud_properties(l_ezlopi_item_t *item, cJSON *c item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); // _max = 10 - CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio1_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_GPIO(cj_device, ezlopi_gpio1_str, item->interface.gpio.gpio_in.gpio_num); TRACE_S("flame_> DIGITAL_PIN: %d ", item->interface.gpio.gpio_in.gpio_num); } //------------------------------------------------------------------------------------------------------ diff --git a/ezlopi-sensors-devices/sensor-0059-other-MQ6-LPG-detector/sensor_0059_other_MQ6_LPG_detector.c b/ezlopi-sensors-devices/sensor-0059-other-MQ6-LPG-detector/sensor_0059_other_MQ6_LPG_detector.c index 6384a5906..119add2d2 100644 --- a/ezlopi-sensors-devices/sensor-0059-other-MQ6-LPG-detector/sensor_0059_other_MQ6_LPG_detector.c +++ b/ezlopi-sensors-devices/sensor-0059-other-MQ6-LPG-detector/sensor_0059_other_MQ6_LPG_detector.c @@ -195,7 +195,7 @@ static void __prepare_item_digi_cloud_properties(l_ezlopi_item_t *item, cJSON *c item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); // _max = 10 - CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio1_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_GPIO(cj_device, ezlopi_gpio1_str, item->interface.gpio.gpio_in.gpio_num); TRACE_S("MQ6-> DIGITAL_PIN: %d ", item->interface.gpio.gpio_in.gpio_num); } //------------------------------------------------------------------------------------------------------ diff --git a/ezlopi-sensors-devices/sensor-0060-digitalIn-vibration-detector/sensor_0060_digitalIn_vibration_detector.c b/ezlopi-sensors-devices/sensor-0060-digitalIn-vibration-detector/sensor_0060_digitalIn_vibration_detector.c index b0708fee7..2e302f48b 100644 --- a/ezlopi-sensors-devices/sensor-0060-digitalIn-vibration-detector/sensor_0060_digitalIn_vibration_detector.c +++ b/ezlopi-sensors-devices/sensor-0060-digitalIn-vibration-detector/sensor_0060_digitalIn_vibration_detector.c @@ -94,7 +94,7 @@ static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_dev item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); // _max = 10 - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_GPIO(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); CJSON_GET_VALUE_INT(cj_device, "logic_inv", item->interface.gpio.gpio_in.invert); item->interface.gpio.gpio_in.enable = true; diff --git a/ezlopi-sensors-devices/sensor-0061-digitalIn-reed-switch/sensor_0061_digitalIn_reed_switch.c b/ezlopi-sensors-devices/sensor-0061-digitalIn-reed-switch/sensor_0061_digitalIn_reed_switch.c index 3f7ff975c..d5771d4f3 100644 --- a/ezlopi-sensors-devices/sensor-0061-digitalIn-reed-switch/sensor_0061_digitalIn_reed_switch.c +++ b/ezlopi-sensors-devices/sensor-0061-digitalIn-reed-switch/sensor_0061_digitalIn_reed_switch.c @@ -89,7 +89,7 @@ static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_dev item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); // _max = 10 - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_GPIO(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); CJSON_GET_VALUE_INT(cj_device, "logic_inv", item->interface.gpio.gpio_in.invert); item->interface.gpio.gpio_in.enable = true; diff --git a/ezlopi-sensors-devices/sensor-0062-other-MQ7-CO-detector/sensor_0062_other_MQ7_CO_detector.c b/ezlopi-sensors-devices/sensor-0062-other-MQ7-CO-detector/sensor_0062_other_MQ7_CO_detector.c index 0efa3956f..9b4ba41e7 100644 --- a/ezlopi-sensors-devices/sensor-0062-other-MQ7-CO-detector/sensor_0062_other_MQ7_CO_detector.c +++ b/ezlopi-sensors-devices/sensor-0062-other-MQ7-CO-detector/sensor_0062_other_MQ7_CO_detector.c @@ -198,7 +198,7 @@ static void __prepare_item_digi_cloud_properties(l_ezlopi_item_t *item, cJSON *c item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); // _max = 10 - CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio1_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_GPIO(cj_device, ezlopi_gpio1_str, item->interface.gpio.gpio_in.gpio_num); TRACE_S("MQ7-> DIGITAL_PIN: %d ", item->interface.gpio.gpio_in.gpio_num); } //------------------------------------------------------------------------------------------------------ diff --git a/ezlopi-sensors-devices/sensor-0063-other-MQ9-LPG-flameable-detector/sensor_0063_other_MQ9_LPG_flameable_detector.c b/ezlopi-sensors-devices/sensor-0063-other-MQ9-LPG-flameable-detector/sensor_0063_other_MQ9_LPG_flameable_detector.c index 7fc670470..ed67ebb9d 100644 --- a/ezlopi-sensors-devices/sensor-0063-other-MQ9-LPG-flameable-detector/sensor_0063_other_MQ9_LPG_flameable_detector.c +++ b/ezlopi-sensors-devices/sensor-0063-other-MQ9-LPG-flameable-detector/sensor_0063_other_MQ9_LPG_flameable_detector.c @@ -195,7 +195,7 @@ static void __prepare_item_digi_cloud_properties(l_ezlopi_item_t *item, cJSON *c item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); // _max = 10 - CJSON_GET_VALUE_INT(cj_device, ezlopi_gpio1_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_GPIO(cj_device, ezlopi_gpio1_str, item->interface.gpio.gpio_in.gpio_num); TRACE_S("MQ9-> DIGITAL_PIN: %d ", item->interface.gpio.gpio_in.gpio_num); char *user_arg = (char *)malloc(40); if (user_arg) diff --git a/ezlopi-sensors-devices/sensor-0065-digitalIn-float-switch/sensor_0065_digitalIn_float_switch.c b/ezlopi-sensors-devices/sensor-0065-digitalIn-float-switch/sensor_0065_digitalIn_float_switch.c index 903a7422d..9970f042a 100644 --- a/ezlopi-sensors-devices/sensor-0065-digitalIn-float-switch/sensor_0065_digitalIn_float_switch.c +++ b/ezlopi-sensors-devices/sensor-0065-digitalIn-float-switch/sensor_0065_digitalIn_float_switch.c @@ -91,7 +91,7 @@ static void __prepare_item_cloud_properties(l_ezlopi_item_t *item, cJSON *cj_dev item->cloud_properties.item_id = ezlopi_cloud_generate_item_id(); CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_type_str, item->interface_type); // _max = 10 - CJSON_GET_VALUE_INT(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); + CJSON_GET_VALUE_GPIO(cj_device, ezlopi_dev_name_str, item->interface.gpio.gpio_in.gpio_num); CJSON_GET_VALUE_INT(cj_device, "logic_inv", item->interface.gpio.gpio_in.invert); item->interface.gpio.gpio_in.enable = true; diff --git a/ezlopi-services/ezlopi-service-gpioisr/ezlopi_service_gpioisr..c b/ezlopi-services/ezlopi-service-gpioisr/ezlopi_service_gpioisr..c index e0071590d..7e64bdfb0 100644 --- a/ezlopi-services/ezlopi-service-gpioisr/ezlopi_service_gpioisr..c +++ b/ezlopi-services/ezlopi-service-gpioisr/ezlopi_service_gpioisr..c @@ -55,7 +55,7 @@ void gpio_isr_service_register_v3(l_ezlopi_item_t *item, f_interrupt_upcall_t __ } else { - TRACE_S("Successfully added GPIO ISR handler."); + TRACE_S("Successfully added GPIO ISR handler for pin: %d.", item->interface.gpio.gpio_in.gpio_num); } } } diff --git a/ezlopi-services/ezlopi-service-webprov/ezlopi_service_webprov.c b/ezlopi-services/ezlopi-service-webprov/ezlopi_service_webprov.c index a3fa29dee..01463fab6 100644 --- a/ezlopi-services/ezlopi-service-webprov/ezlopi_service_webprov.c +++ b/ezlopi-services/ezlopi-service-webprov/ezlopi_service_webprov.c @@ -541,7 +541,7 @@ static void __message_upcall(const char *payload, uint32_t len) char *method_name = ezlopi_core_ezlopi_methods_get_name_by_id(method_id); TRACE_D("Method[%d]: %s", method_id, method_name ? method_name : "null"); - f_method_func_t method = ezlopi_core_ezlopi_methods_get_updater_by_id(method_id); + f_method_func_t method = ezlopi_core_ezlopi_methods_get_by_id(method_id); if (method) { __call_method_and_send_response(cj_request, cj_method, method, TRACE_TYPE_D); diff --git a/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.c b/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.c index 7e585a8e9..780c1ab87 100644 --- a/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.c +++ b/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.c @@ -415,6 +415,8 @@ static void __stop_server(void) vSemaphoreDelete(send_lock); send_lock = NULL; } + + ezlopi_core_ezlopi_broadcast_remove_method(ezlopi_service_ws_server_broadcast); } static void __call_method_and_send_response(httpd_req_t *req, cJSON *cj_request, cJSON *cj_method, f_method_func_t method_func, e_trace_type_t print_type) diff --git a/sdkconfig b/sdkconfig index c1c9c7c0c..c6cc1dbfc 100644 --- a/sdkconfig +++ b/sdkconfig @@ -50,6 +50,14 @@ CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y # CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set # CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set CONFIG_BOOTLOADER_LOG_LEVEL=0 + +# +# Serial Flash Configurations +# +# CONFIG_BOOTLOADER_FLASH_DC_AWARE is not set +CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y +# end of Serial Flash Configurations + # CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V is not set CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y # CONFIG_BOOTLOADER_FACTORY_RESET is not set @@ -64,7 +72,6 @@ CONFIG_BOOTLOADER_WDT_TIME_MS=9000 # CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 # CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set -CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y # end of Bootloader config # @@ -98,6 +105,7 @@ CONFIG_ESPTOOLPY_FLASHMODE_DIO=y # CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y CONFIG_ESPTOOLPY_FLASHMODE="dio" +CONFIG_ESPTOOLPY_S3_STR=y # CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set CONFIG_ESPTOOLPY_FLASHFREQ_40M=y @@ -138,8 +146,8 @@ CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 # CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set # CONFIG_PARTITION_TABLE_TWO_OTA is not set CONFIG_PARTITION_TABLE_CUSTOM=y -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="ezlopi_partitions_v3_1_4_181_8mb.csv" -CONFIG_PARTITION_TABLE_FILENAME="ezlopi_partitions_v3_1_4_181_8mb.csv" +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="ezlopi_partitions_v3_1_4_181_4mb.csv" +CONFIG_PARTITION_TABLE_FILENAME="ezlopi_partitions_v3_1_4_181_4mb.csv" CONFIG_PARTITION_TABLE_OFFSET=0x8000 CONFIG_PARTITION_TABLE_MD5=y # end of Partition Table @@ -265,6 +273,7 @@ CONFIG_BT_CTRL_SLEEP_CLOCK_EFF=0 CONFIG_BT_CTRL_HCI_TL_EFF=1 # CONFIG_BT_CTRL_AGC_RECORRECT_EN is not set # CONFIG_BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX is not set +# CONFIG_BT_BLE_ADV_DATA_LENGTH_ZERO_AUX is not set # end of Bluetooth controller CONFIG_BT_BLUEDROID_ENABLED=y @@ -480,6 +489,7 @@ CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=y # CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY is not set # CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK is not set CONFIG_BT_SMP_ENABLE=y +CONFIG_BT_SMP_MAX_BONDS=15 # CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN is not set CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT=30 CONFIG_BT_MAX_DEVICE_NAME_LEN=32 @@ -753,6 +763,10 @@ CONFIG_ESP_IPC_ISR_ENABLE=y # LCD and Touch Panel # +# +# LCD Touch Drivers are maintained in the IDF Component Registry +# + # # LCD Peripheral Configuration # @@ -846,6 +860,7 @@ CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y # CONFIG_ESP_PANIC_HANDLER_IRAM is not set # CONFIG_ESP_DEBUG_STUBS_ENABLE is not set CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y +CONFIG_ESP_SYSTEM_BBPLL_RECALIB=y # end of ESP System Settings # @@ -1091,6 +1106,7 @@ CONFIG_LWIP_SO_REUSE=y CONFIG_LWIP_SO_REUSE_RXTOALL=y # CONFIG_LWIP_SO_RCVBUF is not set # CONFIG_LWIP_NETBUF_RECVINFO is not set +CONFIG_LWIP_IP_DEFAULT_TTL=64 CONFIG_LWIP_IP4_FRAG=y CONFIG_LWIP_IP6_FRAG=y # CONFIG_LWIP_IP4_REASSEMBLY is not set @@ -1200,6 +1216,13 @@ CONFIG_LWIP_SNTP_MAX_SERVERS=3 CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 # end of SNTP +# +# DNS +# +CONFIG_LWIP_DNS_MAX_SERVERS=3 +# CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT is not set +# end of DNS + CONFIG_LWIP_ESP_LWIP_ASSERT=y # @@ -1447,6 +1470,26 @@ CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" # end of PThreads +# +# Main Flash configuration +# + +# +# Optional and Experimental Features (READ DOCS FIRST) +# + +# +# Features here require specific hardware (READ DOCS FIRST!) +# +# CONFIG_SPI_FLASH_HPM_ENA is not set +CONFIG_SPI_FLASH_HPM_AUTO=y +# CONFIG_SPI_FLASH_HPM_DIS is not set +CONFIG_SPI_FLASH_HPM_ON=y +CONFIG_SPI_FLASH_HPM_DC_AUTO=y +# CONFIG_SPI_FLASH_HPM_DC_DISABLE is not set +# end of Optional and Experimental Features (READ DOCS FIRST) +# end of Main Flash configuration + # # SPI Flash driver # diff --git a/sdkconfig.old b/sdkconfig.old index b2ab899c9..8287abfbd 100644 --- a/sdkconfig.old +++ b/sdkconfig.old @@ -702,7 +702,7 @@ CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024 CONFIG_HTTPD_MAX_URI_LEN=1024 CONFIG_HTTPD_ERR_RESP_NO_DELAY=y CONFIG_HTTPD_PURGE_BUF_LEN=32 -CONFIG_HTTPD_LOG_PURGE_DATA=y +# CONFIG_HTTPD_LOG_PURGE_DATA is not set CONFIG_HTTPD_WS_SUPPORT=y # end of HTTP Server @@ -715,7 +715,7 @@ CONFIG_OTA_ALLOW_HTTP=y # # ESP HTTPS server # -# CONFIG_ESP_HTTPS_SERVER_ENABLE is not set +CONFIG_ESP_HTTPS_SERVER_ENABLE=y # end of ESP HTTPS server # @@ -1072,13 +1072,16 @@ CONFIG_HEAP_TRACING_OFF=y # # CONFIG_LOG_DEFAULT_LEVEL_NONE is not set # CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set -# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set +CONFIG_LOG_DEFAULT_LEVEL_WARN=y # CONFIG_LOG_DEFAULT_LEVEL_INFO is not set # CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set -CONFIG_LOG_DEFAULT_LEVEL_VERBOSE=y -CONFIG_LOG_DEFAULT_LEVEL=5 +# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set +CONFIG_LOG_DEFAULT_LEVEL=2 CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y -CONFIG_LOG_MAXIMUM_LEVEL=5 +# CONFIG_LOG_MAXIMUM_LEVEL_INFO is not set +# CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set +# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set +CONFIG_LOG_MAXIMUM_LEVEL=2 CONFIG_LOG_COLORS=y CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y # CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set From 270070474da44837fc2aacc922100f81dcea5624 Mon Sep 17 00:00:00 2001 From: Krishna Kumar Sah Date: Tue, 27 Feb 2024 03:32:19 +0545 Subject: [PATCH 23/27] buid generated and updated sdkconfig.esp32*.*mb --- ezlopi-user-config/EZLOPI_USER_CONFIG.h | 2 +- ezlopi-util/ezlopi-util-trace/CMakeLists.txt | 2 +- .../ezlopi-util-uuid/ezlopi_util_uuid.c | 10 +- sdkconfig | 248 +++----- sdkconfig.esp32.4mb | 519 ++++++++-------- sdkconfig.esp32c3.4mb | 55 +- sdkconfig.esp32s3.4mb | 89 ++- sdkconfig.esp32s3.8mb | 58 +- sdkconfig.old | 553 +++--------------- 9 files changed, 613 insertions(+), 923 deletions(-) diff --git a/ezlopi-user-config/EZLOPI_USER_CONFIG.h b/ezlopi-user-config/EZLOPI_USER_CONFIG.h index 0eb502681..50aa50f06 100644 --- a/ezlopi-user-config/EZLOPI_USER_CONFIG.h +++ b/ezlopi-user-config/EZLOPI_USER_CONFIG.h @@ -33,6 +33,6 @@ #undef EZPI_CORE_ENABLE_ETH // #undef EZPI_DEV_TYPE_GENERIC // #undef EZPI_SERV_ENABLE_MESHBOTS -#undef EZPI_UTIL_ENABLE_TRACE +// #undef EZPI_UTIL_ENABLE_TRACE #endif // _EZLOPI_USER_CONFIG_H_ \ No newline at end of file diff --git a/ezlopi-util/ezlopi-util-trace/CMakeLists.txt b/ezlopi-util/ezlopi-util-trace/CMakeLists.txt index 81a078211..99745e7fc 100644 --- a/ezlopi-util/ezlopi-util-trace/CMakeLists.txt +++ b/ezlopi-util/ezlopi-util-trace/CMakeLists.txt @@ -6,5 +6,5 @@ idf_component_register(SRCS "${config_src}" INCLUDE_DIRS "." REQUIRES log - # ezlopi-user-config + ezlopi-user-config ) \ No newline at end of file diff --git a/ezlopi-util/ezlopi-util-uuid/ezlopi_util_uuid.c b/ezlopi-util/ezlopi-util-uuid/ezlopi_util_uuid.c index 46c8466f2..72db41483 100644 --- a/ezlopi-util/ezlopi-util-uuid/ezlopi_util_uuid.c +++ b/ezlopi-util/ezlopi-util-uuid/ezlopi_util_uuid.c @@ -1,7 +1,7 @@ #include #include -#include "config.h" +// #include "config.h" #include "ezlopi_util_uuid.h" const unsigned char hex[16] = "0123456789abcdef"; @@ -36,7 +36,7 @@ void ezlopi_util_uuid_generate_random(ezlopi_uuid_t out) out[8] = (out[8] & 0x0f) | 0xa0; } -void ezlopi_util_uuid_parse(const char *in, ezlopi_uuid_t uuid) +void ezlopi_util_uuid_parse(const char* in, ezlopi_uuid_t uuid) { int i, j; @@ -56,12 +56,12 @@ void ezlopi_util_uuid_parse(const char *in, ezlopi_uuid_t uuid) } } - i+=2; - + i += 2; + } while (j < 16 && i < 36); } -void ezlopi_util_uuid_unparse(const ezlopi_uuid_t uuid, char *out) +void ezlopi_util_uuid_unparse(const ezlopi_uuid_t uuid, char* out) { int i, j; diff --git a/sdkconfig b/sdkconfig index 571ea575c..e2343561a 100644 --- a/sdkconfig +++ b/sdkconfig @@ -3,15 +3,15 @@ # Espressif IoT Development Framework (ESP-IDF) Project Configuration # CONFIG_IDF_CMAKE=y -CONFIG_IDF_TARGET_ARCH_XTENSA=y -CONFIG_IDF_TARGET="esp32s3" -CONFIG_IDF_TARGET_ESP32S3=y -CONFIG_IDF_FIRMWARE_CHIP_ID=0x0009 +CONFIG_IDF_TARGET_ARCH_RISCV=y +CONFIG_IDF_TARGET="esp32c3" +CONFIG_IDF_TARGET_ESP32C3=y +CONFIG_IDF_FIRMWARE_CHIP_ID=0x0005 # # SDK tool configuration # -CONFIG_SDK_TOOLPREFIX="xtensa-esp32s3-elf-" +CONFIG_SDK_TOOLPREFIX="riscv32-esp-elf-" # CONFIG_SDK_TOOLCHAIN_SUPPORTS_TIME_WIDE_64_BITS is not set # end of SDK tool configuration @@ -58,7 +58,6 @@ CONFIG_BOOTLOADER_LOG_LEVEL=0 CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y # end of Serial Flash Configurations -# CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V is not set CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y # CONFIG_BOOTLOADER_FACTORY_RESET is not set # CONFIG_BOOTLOADER_APP_TEST is not set @@ -98,28 +97,26 @@ CONFIG_BOOT_ROM_LOG_ALWAYS_ON=y # CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200 # CONFIG_ESPTOOLPY_NO_STUB is not set -# CONFIG_ESPTOOLPY_OCT_FLASH is not set # CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set # CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set CONFIG_ESPTOOLPY_FLASHMODE_DIO=y # CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y CONFIG_ESPTOOLPY_FLASHMODE="dio" -CONFIG_ESPTOOLPY_S3_STR=y -# CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set -# CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set -CONFIG_ESPTOOLPY_FLASHFREQ_40M=y +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y +# CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set +# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set -CONFIG_ESPTOOLPY_FLASHFREQ="40m" +CONFIG_ESPTOOLPY_FLASHFREQ="80m" # CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE="8MB" +CONFIG_ESPTOOLPY_FLASHSIZE="4MB" CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y CONFIG_ESPTOOLPY_BEFORE_RESET=y # CONFIG_ESPTOOLPY_BEFORE_NORESET is not set @@ -172,6 +169,7 @@ CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y # CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set # CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set # CONFIG_COMPILER_WARN_WRITE_STRINGS is not set +# CONFIG_COMPILER_SAVE_RESTORE_LIBCALLS is not set # CONFIG_COMPILER_DISABLE_GCC8_WARNINGS is not set # CONFIG_COMPILER_DUMP_RTL_FILES is not set # end of Compiler options @@ -207,8 +205,6 @@ CONFIG_BT_CTRL_MODE_EFF=1 CONFIG_BT_CTRL_BLE_MAX_ACT=10 CONFIG_BT_CTRL_BLE_MAX_ACT_EFF=10 CONFIG_BT_CTRL_BLE_STATIC_ACL_TX_BUF_NB=0 -CONFIG_BT_CTRL_PINNED_TO_CORE_0=y -# CONFIG_BT_CTRL_PINNED_TO_CORE_1 is not set CONFIG_BT_CTRL_PINNED_TO_CORE=0 CONFIG_BT_CTRL_HCI_MODE_VHCI=y # CONFIG_BT_CTRL_HCI_MODE_UART_H4 is not set @@ -239,14 +235,14 @@ CONFIG_BT_CTRL_RX_ANTENNA_INDEX_EFF=0 # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N6 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N3 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N0 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3 is not set +CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3=y # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P6 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P9 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P12 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P15 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P18 is not set -CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P21=y -CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF=15 +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P21 is not set +CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF=9 CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP=y CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM=100 CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 @@ -284,8 +280,6 @@ CONFIG_BT_BLUEDROID_ENABLED=y # Bluedroid Options # CONFIG_BT_BTC_TASK_STACK_SIZE=3072 -CONFIG_BT_BLUEDROID_PINNED_TO_CORE_0=y -# CONFIG_BT_BLUEDROID_PINNED_TO_CORE_1 is not set CONFIG_BT_BLUEDROID_PINNED_TO_CORE=0 CONFIG_BT_BTU_TASK_STACK_SIZE=4096 # CONFIG_BT_BLUEDROID_MEM_DEBUG is not set @@ -485,7 +479,7 @@ CONFIG_BT_LOG_BLUFI_TRACE_LEVEL=2 CONFIG_BT_ACL_CONNECTIONS=4 CONFIG_BT_MULTI_CONNECTION_ENBALE=y -CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=y +# CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST is not set # CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY is not set # CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK is not set CONFIG_BT_SMP_ENABLE=y @@ -494,7 +488,7 @@ CONFIG_BT_SMP_MAX_BONDS=15 CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT=30 CONFIG_BT_MAX_DEVICE_NAME_LEN=32 CONFIG_BT_BLE_RPA_TIMEOUT=900 -# CONFIG_BT_BLE_50_FEATURES_SUPPORTED is not set +CONFIG_BT_BLE_50_FEATURES_SUPPORTED=y CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y # CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL is not set # end of Bluedroid Options @@ -521,6 +515,7 @@ CONFIG_COAP_LOG_DEFAULT_LEVEL=0 # CONFIG_ADC_FORCE_XPD_FSM is not set CONFIG_ADC_DISABLE_DAC=y # CONFIG_ADC_CONTINUOUS_FORCE_USE_ADC2_ON_C3_S3 is not set +# CONFIG_ADC_ONESHOT_FORCE_USE_ADC2_ON_C3 is not set # end of ADC configuration # @@ -548,7 +543,7 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=y # # UART configuration # -CONFIG_UART_ISR_IN_IRAM=y +# CONFIG_UART_ISR_IN_IRAM is not set # end of UART configuration # @@ -579,76 +574,42 @@ CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y # end of ESP-TLS # -# ESP32S3-Specific -# -CONFIG_ESP32S3_REV_MIN_0=y -# CONFIG_ESP32S3_REV_MIN_1 is not set -# CONFIG_ESP32S3_REV_MIN_2 is not set -CONFIG_ESP32S3_REV_MIN_FULL=0 -CONFIG_ESP_REV_MIN_FULL=0 -CONFIG_ESP32S3_REV_MAX_FULL_STR_OPT=y -CONFIG_ESP32S3_REV_MAX_FULL=99 -CONFIG_ESP_REV_MAX_FULL=99 -# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_80 is not set -# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_160 is not set -CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y -CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=240 - -# -# Cache config -# -CONFIG_ESP32S3_INSTRUCTION_CACHE_16KB=y -# CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB is not set -CONFIG_ESP32S3_INSTRUCTION_CACHE_SIZE=0x4000 -# CONFIG_ESP32S3_INSTRUCTION_CACHE_4WAYS is not set -CONFIG_ESP32S3_INSTRUCTION_CACHE_8WAYS=y -CONFIG_ESP32S3_ICACHE_ASSOCIATED_WAYS=8 -# CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_16B is not set -CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_32B=y -CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_SIZE=32 -# CONFIG_ESP32S3_INSTRUCTION_CACHE_WRAP is not set -# CONFIG_ESP32S3_DATA_CACHE_16KB is not set -CONFIG_ESP32S3_DATA_CACHE_32KB=y -# CONFIG_ESP32S3_DATA_CACHE_64KB is not set -CONFIG_ESP32S3_DATA_CACHE_SIZE=0x8000 -# CONFIG_ESP32S3_DATA_CACHE_4WAYS is not set -CONFIG_ESP32S3_DATA_CACHE_8WAYS=y -CONFIG_ESP32S3_DCACHE_ASSOCIATED_WAYS=8 -# CONFIG_ESP32S3_DATA_CACHE_LINE_16B is not set -CONFIG_ESP32S3_DATA_CACHE_LINE_32B=y -# CONFIG_ESP32S3_DATA_CACHE_LINE_64B is not set -CONFIG_ESP32S3_DATA_CACHE_LINE_SIZE=32 -# CONFIG_ESP32S3_DATA_CACHE_WRAP is not set -# end of Cache config - -# CONFIG_ESP32S3_SPIRAM_SUPPORT is not set -# CONFIG_ESP32S3_TRAX is not set -CONFIG_ESP32S3_TRACEMEM_RESERVE_DRAM=0x0 -# CONFIG_ESP32S3_ULP_COPROC_ENABLED is not set -CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM=0 -CONFIG_ESP32S3_DEBUG_OCDAWARE=y -CONFIG_ESP32S3_BROWNOUT_DET=y -CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_7=y -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_6 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_5 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_4 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_3 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_2 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_1 is not set -CONFIG_ESP32S3_BROWNOUT_DET_LVL=7 -CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC_FRC1=y -# CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC is not set -# CONFIG_ESP32S3_TIME_SYSCALL_USE_FRC1 is not set -# CONFIG_ESP32S3_TIME_SYSCALL_USE_NONE is not set -CONFIG_ESP32S3_RTC_CLK_SRC_INT_RC=y -# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_CRYS is not set -# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_OSC is not set -# CONFIG_ESP32S3_RTC_CLK_SRC_INT_8MD256 is not set -CONFIG_ESP32S3_RTC_CLK_CAL_CYCLES=1024 -CONFIG_ESP32S3_DEEP_SLEEP_WAKEUP_DELAY=2000 -# CONFIG_ESP32S3_RTCDATA_IN_FAST_MEM is not set -# CONFIG_ESP32S3_USE_FIXED_STATIC_RAM_SIZE is not set -# end of ESP32S3-Specific +# ESP32C3-Specific +# +# CONFIG_ESP32C3_DEFAULT_CPU_FREQ_80 is not set +CONFIG_ESP32C3_DEFAULT_CPU_FREQ_160=y +CONFIG_ESP32C3_DEFAULT_CPU_FREQ_MHZ=160 +# CONFIG_ESP32C3_REV_MIN_0 is not set +# CONFIG_ESP32C3_REV_MIN_1 is not set +# CONFIG_ESP32C3_REV_MIN_2 is not set +CONFIG_ESP32C3_REV_MIN_3=y +# CONFIG_ESP32C3_REV_MIN_4 is not set +# CONFIG_ESP32C3_REV_MIN_101 is not set +CONFIG_ESP32C3_REV_MIN=3 +CONFIG_ESP32C3_REV_MIN_FULL=3 +CONFIG_ESP_REV_MIN_FULL=3 +CONFIG_ESP32C3_REV_MAX_FULL_STR_OPT=y +CONFIG_ESP32C3_REV_MAX_FULL=199 +CONFIG_ESP_REV_MAX_FULL=199 +CONFIG_ESP32C3_DEBUG_OCDAWARE=y +CONFIG_ESP32C3_BROWNOUT_DET=y +CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_7=y +# CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_2 is not set +CONFIG_ESP32C3_BROWNOUT_DET_LVL=7 +CONFIG_ESP32C3_TIME_SYSCALL_USE_RTC_SYSTIMER=y +# CONFIG_ESP32C3_TIME_SYSCALL_USE_RTC is not set +# CONFIG_ESP32C3_TIME_SYSCALL_USE_SYSTIMER is not set +# CONFIG_ESP32C3_TIME_SYSCALL_USE_NONE is not set +CONFIG_ESP32C3_RTC_CLK_SRC_INT_RC=y +# CONFIG_ESP32C3_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_ESP32C3_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_ESP32C3_RTC_CLK_SRC_INT_8MD256 is not set +CONFIG_ESP32C3_RTC_CLK_CAL_CYCLES=1024 +# end of ESP32C3-Specific # # ADC-Calibration @@ -727,21 +688,22 @@ CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y -# CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO is not set -CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_FOUR=y -CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES=4 +# CONFIG_ESP32C3_UNIVERSAL_MAC_ADDRESSES_TWO is not set +CONFIG_ESP32C3_UNIVERSAL_MAC_ADDRESSES_FOUR=y +CONFIG_ESP32C3_UNIVERSAL_MAC_ADDRESSES=4 # end of MAC Config # # Sleep Config # CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y -CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y # CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND is not set CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y # end of Sleep Config +CONFIG_ESP_SLEEP_SYSTIMER_STALL_WORKAROUND=y + # # RTC Clock Config # @@ -753,8 +715,6 @@ CONFIG_RTC_CLOCK_BBPLL_POWER_ON_WITH_USB=y # IPC (Inter-Processor Call) # CONFIG_ESP_IPC_TASK_STACK_SIZE=1536 -CONFIG_ESP_IPC_USES_CALLERS_PRIORITY=y -CONFIG_ESP_IPC_ISR_ENABLE=y # end of IPC (Inter-Processor Call) # @@ -769,7 +729,6 @@ CONFIG_ESP_IPC_ISR_ENABLE=y # LCD Peripheral Configuration # CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE=32 -# CONFIG_LCD_RGB_ISR_IRAM_SAFE is not set # end of LCD Peripheral Configuration # end of LCD and Touch Panel @@ -802,7 +761,6 @@ CONFIG_ESP_PHY_CALIBRATION_MODE=0 # # CONFIG_PM_ENABLE is not set CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y -CONFIG_PM_POWER_DOWN_TAGMEM_IN_LIGHT_SLEEP=y # end of Power Management # @@ -820,45 +778,46 @@ CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set # CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set # CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set +CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE=y CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK=y CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=y +# CONFIG_ESP_SYSTEM_USE_EH_FRAME is not set # # Memory protection # +CONFIG_ESP_SYSTEM_MEMPROT_DEPCHECK=y +CONFIG_ESP_SYSTEM_MEMPROT_FEATURE=y +CONFIG_ESP_SYSTEM_MEMPROT_FEATURE_LOCK=y +CONFIG_ESP_SYSTEM_MEMPROT_CPU_PREFETCH_PAD_SIZE=16 +CONFIG_ESP_SYSTEM_MEMPROT_MEM_ALIGN_SIZE=512 # end of Memory protection CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 -CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=3072 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 CONFIG_ESP_MAIN_TASK_STACK_SIZE=3584 CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y -# CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1 is not set # CONFIG_ESP_MAIN_TASK_AFFINITY_NO_AFFINITY is not set CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 CONFIG_ESP_CONSOLE_UART_DEFAULT=y -# CONFIG_ESP_CONSOLE_USB_CDC is not set # CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG is not set # CONFIG_ESP_CONSOLE_UART_CUSTOM is not set # CONFIG_ESP_CONSOLE_NONE is not set # CONFIG_ESP_CONSOLE_SECONDARY_NONE is not set CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y CONFIG_ESP_CONSOLE_UART=y -CONFIG_ESP_CONSOLE_MULTIPLE_UART=y CONFIG_ESP_CONSOLE_UART_NUM=0 CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 CONFIG_ESP_INT_WDT=y CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 -CONFIG_ESP_INT_WDT_CHECK_CPU1=y CONFIG_ESP_TASK_WDT=y # CONFIG_ESP_TASK_WDT_PANIC is not set CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y -CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y # CONFIG_ESP_PANIC_HANDLER_IRAM is not set # CONFIG_ESP_DEBUG_STUBS_ENABLE is not set CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y -CONFIG_ESP_SYSTEM_BBPLL_RECALIB=y # end of ESP System Settings # @@ -879,7 +838,7 @@ CONFIG_ESP_TIMER_IMPL_SYSTIMER=y CONFIG_ESP32_WIFI_ENABLED=y CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE=y CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=4 -CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8 +CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=16 # CONFIG_ESP32_WIFI_STATIC_TX_BUFFER is not set CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 @@ -894,8 +853,6 @@ CONFIG_ESP32_WIFI_TX_BA_WIN=6 CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y CONFIG_ESP32_WIFI_RX_BA_WIN=6 CONFIG_ESP32_WIFI_NVS_ENABLED=y -CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y -# CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 CONFIG_ESP32_WIFI_IRAM_OPT=y @@ -971,10 +928,7 @@ CONFIG_FMB_SERIAL_BUF_SIZE=256 CONFIG_FMB_SERIAL_ASCII_BITS_PER_SYMB=8 CONFIG_FMB_SERIAL_ASCII_TIMEOUT_RESPOND_MS=1000 CONFIG_FMB_PORT_TASK_PRIO=10 -# CONFIG_FMB_PORT_TASK_AFFINITY_NO_AFFINITY is not set -CONFIG_FMB_PORT_TASK_AFFINITY_CPU0=y -# CONFIG_FMB_PORT_TASK_AFFINITY_CPU1 is not set -CONFIG_FMB_PORT_TASK_AFFINITY=0x0 +CONFIG_FMB_PORT_TASK_AFFINITY=0x7FFFFFFF CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT=y CONFIG_FMB_CONTROLLER_SLAVE_ID=0x00112233 CONFIG_FMB_CONTROLLER_NOTIFY_TIMEOUT=20 @@ -988,13 +942,14 @@ CONFIG_FMB_EVENT_QUEUE_TIMEOUT=20 # # FreeRTOS # -# CONFIG_FREERTOS_UNICORE is not set +CONFIG_FREERTOS_UNICORE=y CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF CONFIG_FREERTOS_TICK_SUPPORT_SYSTIMER=y CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL1=y # CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL3 is not set CONFIG_FREERTOS_SYSTICK_USES_SYSTIMER=y -CONFIG_FREERTOS_HZ=1000 +CONFIG_FREERTOS_OPTIMIZED_SCHEDULER=y +CONFIG_FREERTOS_HZ=100 CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION=y # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set @@ -1182,7 +1137,6 @@ CONFIG_LWIP_CHECKSUM_CHECK_ICMP=y CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072 CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y # CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 is not set -# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1 is not set CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF # CONFIG_LWIP_PPP_SUPPORT is not set CONFIG_LWIP_IPV6_MEMP_NUM_ND6_QUEUE=3 @@ -1259,7 +1213,6 @@ CONFIG_MBEDTLS_DYNAMIC_FREE_CA_CERT=y # mbedTLS v2.28.x related # # CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is not set -CONFIG_MBEDTLS_ECDH_LEGACY_CONTEXT=y # CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK is not set # CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION is not set # end of mbedTLS v2.28.x related @@ -1275,8 +1228,8 @@ CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200 # end of Certificate Bundle -CONFIG_MBEDTLS_ECP_RESTARTABLE=y -CONFIG_MBEDTLS_CMAC_C=y +# CONFIG_MBEDTLS_ECP_RESTARTABLE is not set +# CONFIG_MBEDTLS_CMAC_C is not set CONFIG_MBEDTLS_HARDWARE_AES=y CONFIG_MBEDTLS_AES_USE_INTERRUPT=y CONFIG_MBEDTLS_HARDWARE_MPI=y @@ -1370,7 +1323,7 @@ CONFIG_MBEDTLS_ECP_NIST_OPTIM=y # CONFIG_MBEDTLS_CHACHA20_C is not set # CONFIG_MBEDTLS_HKDF_C is not set # CONFIG_MBEDTLS_THREADING_C is not set -# CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI is not set +CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI=y # CONFIG_MBEDTLS_SECURITY_RISKS is not set # end of mbedTLS @@ -1382,7 +1335,6 @@ CONFIG_MDNS_TASK_PRIORITY=1 CONFIG_MDNS_TASK_STACK_SIZE=4096 # CONFIG_MDNS_TASK_AFFINITY_NO_AFFINITY is not set CONFIG_MDNS_TASK_AFFINITY_CPU0=y -# CONFIG_MDNS_TASK_AFFINITY_CPU1 is not set CONFIG_MDNS_TASK_AFFINITY=0x0 CONFIG_MDNS_SERVICE_ADD_TIMEOUT_MS=2000 # CONFIG_MDNS_STRICT_MODE is not set @@ -1445,9 +1397,6 @@ CONFIG_OPENSSL_ASSERT_EXIT=y CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5 CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 CONFIG_PTHREAD_STACK_MIN=768 -CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY=y -# CONFIG_PTHREAD_DEFAULT_CORE_0 is not set -# CONFIG_PTHREAD_DEFAULT_CORE_1 is not set CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" # end of PThreads @@ -1463,12 +1412,7 @@ CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" # # Features here require specific hardware (READ DOCS FIRST!) # -# CONFIG_SPI_FLASH_HPM_ENA is not set -CONFIG_SPI_FLASH_HPM_AUTO=y -# CONFIG_SPI_FLASH_HPM_DIS is not set -CONFIG_SPI_FLASH_HPM_ON=y -CONFIG_SPI_FLASH_HPM_DC_AUTO=y -# CONFIG_SPI_FLASH_HPM_DC_DISABLE is not set +# CONFIG_SPI_FLASH_AUTO_SUSPEND is not set # end of Optional and Experimental Features (READ DOCS FIRST) # end of Main Flash configuration @@ -1502,7 +1446,6 @@ CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP=y CONFIG_SPI_FLASH_SUPPORT_TH_CHIP=y -CONFIG_SPI_FLASH_SUPPORT_MXIC_OPI_CHIP=y # end of Auto-detect flash chips CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y @@ -1556,12 +1499,6 @@ CONFIG_WS_BUFFER_SIZE=1024 # end of Websocket # end of TCP Transport -# -# TinyUSB Stack -# -# CONFIG_TINYUSB is not set -# end of TinyUSB Stack - # # Unity unit testing library # @@ -1574,24 +1511,10 @@ CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y # CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set # end of Unity unit testing library -# -# USB-OTG -# -CONFIG_USB_OTG_SUPPORTED=y -CONFIG_USB_HOST_CONTROL_TRANSFER_MAX_SIZE=256 -CONFIG_USB_HOST_HW_BUFFER_BIAS_BALANCED=y -# CONFIG_USB_HOST_HW_BUFFER_BIAS_IN is not set -# CONFIG_USB_HOST_HW_BUFFER_BIAS_PERIODIC_OUT is not set - # # Root Hub configuration # -CONFIG_USB_HOST_DEBOUNCE_DELAY_MS=250 -CONFIG_USB_HOST_RESET_HOLD_MS=30 -CONFIG_USB_HOST_RESET_RECOVERY_MS=30 -CONFIG_USB_HOST_SET_ADDR_RECOVERY_MS=10 # end of Root Hub configuration -# end of USB-OTG # # Virtual file system @@ -1664,7 +1587,7 @@ CONFIG_LUA_ROOT="/lua" # end of Compatibility options # Deprecated options for backward compatibility -CONFIG_TOOLPREFIX="xtensa-esp32s3-elf-" +CONFIG_TOOLPREFIX="riscv32-esp-elf-" CONFIG_LOG_BOOTLOADER_LEVEL_NONE=y # CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set # CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set @@ -1706,8 +1629,6 @@ CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y CONFIG_BLUEDROID_ENABLED=y # CONFIG_NIMBLE_ENABLED is not set CONFIG_BTC_TASK_STACK_SIZE=3072 -CONFIG_BLUEDROID_PINNED_TO_CORE_0=y -# CONFIG_BLUEDROID_PINNED_TO_CORE_1 is not set CONFIG_BLUEDROID_PINNED_TO_CORE=0 CONFIG_BTU_TASK_STACK_SIZE=4096 # CONFIG_BLUEDROID_MEM_DEBUG is not set @@ -1902,8 +1823,10 @@ CONFIG_ESP32S2_PANIC_PRINT_REBOOT=y # CONFIG_ESP32S2_PANIC_SILENT_REBOOT is not set # CONFIG_ESP32S2_PANIC_GDBSTUB is not set CONFIG_ESP32S2_ALLOW_RTC_FAST_MEM_AS_HEAP=y +CONFIG_ESP32H2_MEMPROT_FEATURE=y +CONFIG_ESP32H2_MEMPROT_FEATURE_LOCK=y CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 -CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=3072 +CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 CONFIG_MAIN_TASK_STACK_SIZE=3584 CONFIG_CONSOLE_UART_DEFAULT=y # CONFIG_CONSOLE_UART_CUSTOM is not set @@ -1913,12 +1836,10 @@ CONFIG_CONSOLE_UART_NUM=0 CONFIG_CONSOLE_UART_BAUDRATE=115200 CONFIG_INT_WDT=y CONFIG_INT_WDT_TIMEOUT_MS=300 -CONFIG_INT_WDT_CHECK_CPU1=y CONFIG_TASK_WDT=y # CONFIG_TASK_WDT_PANIC is not set CONFIG_TASK_WDT_TIMEOUT_S=5 CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y -CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y # CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set CONFIG_TIMER_TASK_STACK_SIZE=3584 CONFIG_SW_COEXIST_ENABLE=y @@ -1963,21 +1884,16 @@ CONFIG_UDP_RECVMBOX_SIZE=6 CONFIG_TCPIP_TASK_STACK_SIZE=3072 CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y # CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set -# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF # CONFIG_PPP_SUPPORT is not set CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 CONFIG_ESP32_PTHREAD_STACK_MIN=768 -CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y -# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set -# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y # CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set # CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set -# CONFIG_USB_ENABLED is not set CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y CONFIG_SUPPORT_TERMIOS=y CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 diff --git a/sdkconfig.esp32.4mb b/sdkconfig.esp32.4mb index 0fbf65865..436756b4d 100644 --- a/sdkconfig.esp32.4mb +++ b/sdkconfig.esp32.4mb @@ -4,14 +4,14 @@ # CONFIG_IDF_CMAKE=y CONFIG_IDF_TARGET_ARCH_XTENSA=y -CONFIG_IDF_TARGET="esp32s3" -CONFIG_IDF_TARGET_ESP32S3=y -CONFIG_IDF_FIRMWARE_CHIP_ID=0x0009 +CONFIG_IDF_TARGET="esp32" +CONFIG_IDF_TARGET_ESP32=y +CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000 # # SDK tool configuration # -CONFIG_SDK_TOOLPREFIX="xtensa-esp32s3-elf-" +CONFIG_SDK_TOOLPREFIX="xtensa-esp32-elf-" # CONFIG_SDK_TOOLCHAIN_SUPPORTS_TIME_WIDE_64_BITS is not set # end of SDK tool configuration @@ -38,18 +38,26 @@ CONFIG_APP_RETRIEVE_LEN_ELF_SHA=16 # # Bootloader config # -CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x0 +CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x1000 CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE is not set -CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y +# CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set # CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set # CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set -# CONFIG_BOOTLOADER_LOG_LEVEL_INFO is not set +CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y # CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set # CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set -CONFIG_BOOTLOADER_LOG_LEVEL=0 +CONFIG_BOOTLOADER_LOG_LEVEL=3 + +# +# Serial Flash Configurations +# +# CONFIG_BOOTLOADER_FLASH_DC_AWARE is not set +CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y +# end of Serial Flash Configurations + # CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V is not set CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y # CONFIG_BOOTLOADER_FACTORY_RESET is not set @@ -64,43 +72,30 @@ CONFIG_BOOTLOADER_WDT_TIME_MS=9000 # CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 # CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set -CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y # end of Bootloader config # # Security features # -CONFIG_SECURE_BOOT_SUPPORTS_RSA=y -CONFIG_SECURE_TARGET_HAS_SECURE_ROM_DL_MODE=y # CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set # CONFIG_SECURE_BOOT is not set # CONFIG_SECURE_FLASH_ENC_ENABLED is not set # end of Security features -# -# Boot ROM Behavior -# -CONFIG_BOOT_ROM_LOG_ALWAYS_ON=y -# CONFIG_BOOT_ROM_LOG_ALWAYS_OFF is not set -# CONFIG_BOOT_ROM_LOG_ON_GPIO_HIGH is not set -# CONFIG_BOOT_ROM_LOG_ON_GPIO_LOW is not set -# end of Boot ROM Behavior - # # Serial flasher config # CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200 # CONFIG_ESPTOOLPY_NO_STUB is not set -# CONFIG_ESPTOOLPY_OCT_FLASH is not set # CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set # CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set CONFIG_ESPTOOLPY_FLASHMODE_DIO=y # CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y CONFIG_ESPTOOLPY_FLASHMODE="dio" -# CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set CONFIG_ESPTOOLPY_FLASHFREQ_40M=y +# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set CONFIG_ESPTOOLPY_FLASHFREQ="40m" # CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set @@ -190,81 +185,51 @@ CONFIG_APPTRACE_LOCK_ENABLE=y # Bluetooth # CONFIG_BT_ENABLED=y -CONFIG_BT_SOC_SUPPORT_5_0=y # # Bluetooth controller # -CONFIG_BT_CTRL_MODE_EFF=1 -CONFIG_BT_CTRL_BLE_MAX_ACT=6 -CONFIG_BT_CTRL_BLE_MAX_ACT_EFF=6 -CONFIG_BT_CTRL_BLE_STATIC_ACL_TX_BUF_NB=0 -CONFIG_BT_CTRL_PINNED_TO_CORE_0=y -# CONFIG_BT_CTRL_PINNED_TO_CORE_1 is not set -CONFIG_BT_CTRL_PINNED_TO_CORE=0 -CONFIG_BT_CTRL_HCI_MODE_VHCI=y -# CONFIG_BT_CTRL_HCI_MODE_UART_H4 is not set -CONFIG_BT_CTRL_HCI_TL=1 -CONFIG_BT_CTRL_ADV_DUP_FILT_MAX=30 -CONFIG_BT_BLE_CCA_MODE_NONE=y -# CONFIG_BT_BLE_CCA_MODE_HW is not set -# CONFIG_BT_BLE_CCA_MODE_SW is not set -CONFIG_BT_BLE_CCA_MODE=0 -CONFIG_BT_CTRL_HW_CCA_VAL=20 -CONFIG_BT_CTRL_HW_CCA_EFF=0 -CONFIG_BT_CTRL_CE_LENGTH_TYPE_ORIG=y -# CONFIG_BT_CTRL_CE_LENGTH_TYPE_CE is not set -# CONFIG_BT_CTRL_CE_LENGTH_TYPE_SD is not set -CONFIG_BT_CTRL_CE_LENGTH_TYPE_EFF=0 -CONFIG_BT_CTRL_TX_ANTENNA_INDEX_0=y -# CONFIG_BT_CTRL_TX_ANTENNA_INDEX_1 is not set -CONFIG_BT_CTRL_TX_ANTENNA_INDEX_EFF=0 -CONFIG_BT_CTRL_RX_ANTENNA_INDEX_0=y -# CONFIG_BT_CTRL_RX_ANTENNA_INDEX_1 is not set -CONFIG_BT_CTRL_RX_ANTENNA_INDEX_EFF=0 -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N24 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N21 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N18 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N15 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N12 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N9 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N6 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N3 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N0 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P6 is not set -CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P9=y -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P12 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P15 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P18 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P21 is not set -CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF=11 -CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP=y -CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM=100 -CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 -CONFIG_BT_CTRL_BLE_SCAN_DUPL=y -CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DEVICE=y -# CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DATA is not set -# CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DATA_DEVICE is not set -CONFIG_BT_CTRL_SCAN_DUPL_TYPE=0 -CONFIG_BT_CTRL_SCAN_DUPL_CACHE_SIZE=100 -CONFIG_BT_CTRL_DUPL_SCAN_CACHE_REFRESH_PERIOD=0 -# CONFIG_BT_CTRL_BLE_MESH_SCAN_DUPL_EN is not set -# CONFIG_BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_EN is not set -CONFIG_BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_DIS=y -CONFIG_BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_EFF=0 +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +# CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY is not set +# CONFIG_BTDM_CTRL_MODE_BTDM is not set +CONFIG_BTDM_CTRL_BLE_MAX_CONN=3 +CONFIG_BTDM_CTRL_BR_EDR_SCO_DATA_PATH_EFF=0 +CONFIG_BTDM_CTRL_PCM_ROLE_EFF=0 +CONFIG_BTDM_CTRL_PCM_POLAR_EFF=0 +CONFIG_BTDM_CTRL_BLE_MAX_CONN_EFF=3 +CONFIG_BTDM_CTRL_BR_EDR_MAX_ACL_CONN_EFF=0 +CONFIG_BTDM_CTRL_BR_EDR_MAX_SYNC_CONN_EFF=0 +CONFIG_BTDM_CTRL_PINNED_TO_CORE_0=y +# CONFIG_BTDM_CTRL_PINNED_TO_CORE_1 is not set +CONFIG_BTDM_CTRL_PINNED_TO_CORE=0 +CONFIG_BTDM_CTRL_HCI_MODE_VHCI=y +# CONFIG_BTDM_CTRL_HCI_MODE_UART_H4 is not set # # MODEM SLEEP Options # -# CONFIG_BT_CTRL_MODEM_SLEEP is not set +CONFIG_BTDM_CTRL_MODEM_SLEEP=y +CONFIG_BTDM_CTRL_MODEM_SLEEP_MODE_ORIG=y +# CONFIG_BTDM_CTRL_MODEM_SLEEP_MODE_EVED is not set +CONFIG_BTDM_CTRL_LPCLK_SEL_MAIN_XTAL=y # end of MODEM SLEEP Options -CONFIG_BT_CTRL_SLEEP_MODE_EFF=0 -CONFIG_BT_CTRL_SLEEP_CLOCK_EFF=0 -CONFIG_BT_CTRL_HCI_TL_EFF=1 -# CONFIG_BT_CTRL_AGC_RECORRECT_EN is not set -# CONFIG_BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX is not set +CONFIG_BTDM_BLE_DEFAULT_SCA_250PPM=y +CONFIG_BTDM_BLE_SLEEP_CLOCK_ACCURACY_INDEX_EFF=1 +CONFIG_BTDM_BLE_SCAN_DUPL=y +CONFIG_BTDM_SCAN_DUPL_TYPE_DEVICE=y +# CONFIG_BTDM_SCAN_DUPL_TYPE_DATA is not set +# CONFIG_BTDM_SCAN_DUPL_TYPE_DATA_DEVICE is not set +CONFIG_BTDM_SCAN_DUPL_TYPE=0 +CONFIG_BTDM_SCAN_DUPL_CACHE_SIZE=100 +CONFIG_BTDM_SCAN_DUPL_CACHE_REFRESH_PERIOD=0 +# CONFIG_BTDM_BLE_MESH_SCAN_DUPL_EN is not set +CONFIG_BTDM_CTRL_FULL_SCAN_SUPPORTED=y +CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP=y +CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM=100 +CONFIG_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 +CONFIG_BTDM_RESERVE_DRAM=0xdb5c +CONFIG_BTDM_CTRL_HLI=y # end of Bluetooth controller CONFIG_BT_BLUEDROID_ENABLED=y @@ -278,8 +243,9 @@ CONFIG_BT_BTC_TASK_STACK_SIZE=3072 CONFIG_BT_BLUEDROID_PINNED_TO_CORE_0=y # CONFIG_BT_BLUEDROID_PINNED_TO_CORE_1 is not set CONFIG_BT_BLUEDROID_PINNED_TO_CORE=0 -CONFIG_BT_BTU_TASK_STACK_SIZE=4096 +CONFIG_BT_BTU_TASK_STACK_SIZE=4352 # CONFIG_BT_BLUEDROID_MEM_DEBUG is not set +# CONFIG_BT_CLASSIC_ENABLED is not set CONFIG_BT_BLE_ENABLED=y CONFIG_BT_GATTS_ENABLE=y # CONFIG_BT_GATTS_PPCP_CHAR_GAP is not set @@ -294,6 +260,7 @@ CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE=0 # CONFIG_BT_GATTS_APPEARANCE_WRITABLE is not set CONFIG_BT_GATTC_ENABLE=y CONFIG_BT_GATTC_MAX_CACHE_CHAR=40 +CONFIG_BT_GATTC_NOTIF_REG_MAX=5 # CONFIG_BT_GATTC_CACHE_NVS_FLASH is not set CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=3 CONFIG_BT_BLE_SMP_ENABLE=y @@ -479,12 +446,12 @@ CONFIG_BT_MULTI_CONNECTION_ENBALE=y # CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY is not set # CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK is not set CONFIG_BT_SMP_ENABLE=y +CONFIG_BT_SMP_MAX_BONDS=15 # CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN is not set CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT=30 CONFIG_BT_MAX_DEVICE_NAME_LEN=32 +# CONFIG_BT_BLE_RPA_SUPPORTED is not set CONFIG_BT_BLE_RPA_TIMEOUT=900 -CONFIG_BT_BLE_50_FEATURES_SUPPORTED=y -CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y # CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL is not set # end of Bluedroid Options # end of Bluetooth @@ -509,7 +476,6 @@ CONFIG_COAP_LOG_DEFAULT_LEVEL=0 # # CONFIG_ADC_FORCE_XPD_FSM is not set CONFIG_ADC_DISABLE_DAC=y -# CONFIG_ADC_CONTINUOUS_FORCE_USE_ADC2_ON_C3_S3 is not set # end of ADC configuration # @@ -524,13 +490,17 @@ CONFIG_ADC_DISABLE_DAC=y # CONFIG_SPI_MASTER_IN_IRAM is not set CONFIG_SPI_MASTER_ISR_IN_IRAM=y # CONFIG_SPI_SLAVE_IN_IRAM is not set -CONFIG_SPI_SLAVE_ISR_IN_IRAM=y +# CONFIG_SPI_SLAVE_ISR_IN_IRAM is not set # end of SPI configuration # # TWAI configuration # # CONFIG_TWAI_ISR_IN_IRAM is not set +# CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC is not set +# CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST is not set +# CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID is not set +# CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT is not set # CONFIG_TWAI_ERRATA_FIX_LISTEN_ONLY_DOM is not set # end of TWAI configuration @@ -540,6 +510,18 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=y # CONFIG_UART_ISR_IN_IRAM is not set # end of UART configuration +# +# RTCIO configuration +# +# CONFIG_RTCIO_SUPPORT_RTC_GPIO_DESC is not set +# end of RTCIO configuration + +# +# GPIO Configuration +# +# CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL is not set +# end of GPIO Configuration + # # GDMA Configuration # @@ -553,14 +535,17 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=y # # CONFIG_EFUSE_CUSTOM_TABLE is not set # CONFIG_EFUSE_VIRTUAL is not set -CONFIG_EFUSE_MAX_BLK_LEN=256 +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_NONE is not set +CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4=y +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_REPEAT is not set +CONFIG_EFUSE_MAX_BLK_LEN=192 # end of eFuse Bit Manager # # ESP-TLS # CONFIG_ESP_TLS_USING_MBEDTLS=y -CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y +# CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set # CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set # CONFIG_ESP_TLS_SERVER is not set # CONFIG_ESP_TLS_PSK_VERIFICATION is not set @@ -568,80 +553,68 @@ CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y # end of ESP-TLS # -# ESP32S3-Specific +# ESP32-specific # -CONFIG_ESP32S3_REV_MIN_0=y -# CONFIG_ESP32S3_REV_MIN_1 is not set -# CONFIG_ESP32S3_REV_MIN_2 is not set -CONFIG_ESP32S3_REV_MIN_FULL=0 +CONFIG_ESP32_REV_MIN_0=y +# CONFIG_ESP32_REV_MIN_1 is not set +# CONFIG_ESP32_REV_MIN_1_1 is not set +# CONFIG_ESP32_REV_MIN_2 is not set +# CONFIG_ESP32_REV_MIN_3 is not set +# CONFIG_ESP32_REV_MIN_3_1 is not set +CONFIG_ESP32_REV_MIN=0 +CONFIG_ESP32_REV_MIN_FULL=0 CONFIG_ESP_REV_MIN_FULL=0 -CONFIG_ESP32S3_REV_MAX_FULL_STR_OPT=y -CONFIG_ESP32S3_REV_MAX_FULL=99 -CONFIG_ESP_REV_MAX_FULL=99 -# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_80 is not set -CONFIG_ESP32S3_DEFAULT_CPU_FREQ_160=y -# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240 is not set -CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=160 - -# -# Cache config -# -CONFIG_ESP32S3_INSTRUCTION_CACHE_16KB=y -# CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB is not set -CONFIG_ESP32S3_INSTRUCTION_CACHE_SIZE=0x4000 -# CONFIG_ESP32S3_INSTRUCTION_CACHE_4WAYS is not set -CONFIG_ESP32S3_INSTRUCTION_CACHE_8WAYS=y -CONFIG_ESP32S3_ICACHE_ASSOCIATED_WAYS=8 -# CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_16B is not set -CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_32B=y -CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_SIZE=32 -# CONFIG_ESP32S3_INSTRUCTION_CACHE_WRAP is not set -# CONFIG_ESP32S3_DATA_CACHE_16KB is not set -CONFIG_ESP32S3_DATA_CACHE_32KB=y -# CONFIG_ESP32S3_DATA_CACHE_64KB is not set -CONFIG_ESP32S3_DATA_CACHE_SIZE=0x8000 -# CONFIG_ESP32S3_DATA_CACHE_4WAYS is not set -CONFIG_ESP32S3_DATA_CACHE_8WAYS=y -CONFIG_ESP32S3_DCACHE_ASSOCIATED_WAYS=8 -# CONFIG_ESP32S3_DATA_CACHE_LINE_16B is not set -CONFIG_ESP32S3_DATA_CACHE_LINE_32B=y -# CONFIG_ESP32S3_DATA_CACHE_LINE_64B is not set -CONFIG_ESP32S3_DATA_CACHE_LINE_SIZE=32 -# CONFIG_ESP32S3_DATA_CACHE_WRAP is not set -# end of Cache config - -# CONFIG_ESP32S3_SPIRAM_SUPPORT is not set -# CONFIG_ESP32S3_TRAX is not set -CONFIG_ESP32S3_TRACEMEM_RESERVE_DRAM=0x0 -# CONFIG_ESP32S3_ULP_COPROC_ENABLED is not set -CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM=0 -CONFIG_ESP32S3_DEBUG_OCDAWARE=y -CONFIG_ESP32S3_BROWNOUT_DET=y -CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_7=y -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_6 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_5 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_4 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_3 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_2 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_1 is not set -CONFIG_ESP32S3_BROWNOUT_DET_LVL=7 -CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC_FRC1=y -# CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC is not set -# CONFIG_ESP32S3_TIME_SYSCALL_USE_FRC1 is not set -# CONFIG_ESP32S3_TIME_SYSCALL_USE_NONE is not set -CONFIG_ESP32S3_RTC_CLK_SRC_INT_RC=y -# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_CRYS is not set -# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_OSC is not set -# CONFIG_ESP32S3_RTC_CLK_SRC_INT_8MD256 is not set -CONFIG_ESP32S3_RTC_CLK_CAL_CYCLES=1024 -CONFIG_ESP32S3_DEEP_SLEEP_WAKEUP_DELAY=2000 -# CONFIG_ESP32S3_RTCDATA_IN_FAST_MEM is not set -# CONFIG_ESP32S3_USE_FIXED_STATIC_RAM_SIZE is not set -# end of ESP32S3-Specific +CONFIG_ESP32_REV_MAX_FULL_STR_OPT=y +CONFIG_ESP32_REV_MAX_FULL=399 +CONFIG_ESP_REV_MAX_FULL=399 +CONFIG_ESP32_DPORT_WORKAROUND=y +# CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set +CONFIG_ESP32_DEFAULT_CPU_FREQ_160=y +# CONFIG_ESP32_DEFAULT_CPU_FREQ_240 is not set +CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=160 +# CONFIG_ESP32_SPIRAM_SUPPORT is not set +# CONFIG_ESP32_TRAX is not set +CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0x0 +# CONFIG_ESP32_ULP_COPROC_ENABLED is not set +CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0 +CONFIG_ESP32_DEBUG_OCDAWARE=y +CONFIG_ESP32_BROWNOUT_DET=y +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_0=y +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_7 is not set +CONFIG_ESP32_BROWNOUT_DET_LVL=0 +CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1=y +# CONFIG_ESP32_TIME_SYSCALL_USE_RTC is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_FRC1 is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_NONE is not set +CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y +# CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_ESP32_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_ESP32_RTC_CLK_SRC_INT_8MD256 is not set +CONFIG_ESP32_RTC_CLK_CAL_CYCLES=1024 +CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000 +CONFIG_ESP32_XTAL_FREQ_40=y +# CONFIG_ESP32_XTAL_FREQ_26 is not set +# CONFIG_ESP32_XTAL_FREQ_AUTO is not set +CONFIG_ESP32_XTAL_FREQ=40 +# CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE is not set +# CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set +# CONFIG_ESP32_COMPATIBLE_PRE_V3_1_BOOTLOADERS is not set +# CONFIG_ESP32_USE_FIXED_STATIC_RAM_SIZE is not set +CONFIG_ESP32_DPORT_DIS_INTERRUPT_LVL=5 +# end of ESP32-specific # # ADC-Calibration # +CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y +CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y +CONFIG_ADC_CAL_LUT_ENABLE=y # end of ADC-Calibration # @@ -654,6 +627,14 @@ CONFIG_ESP_ERR_TO_NAME_LOOKUP=y # Ethernet # CONFIG_ETH_ENABLED=y +CONFIG_ETH_USE_ESP32_EMAC=y +CONFIG_ETH_PHY_INTERFACE_RMII=y +CONFIG_ETH_RMII_CLK_INPUT=y +# CONFIG_ETH_RMII_CLK_OUTPUT is not set +CONFIG_ETH_RMII_CLK_IN_GPIO=0 +CONFIG_ETH_DMA_BUFFER_SIZE=512 +CONFIG_ETH_DMA_RX_BUFFER_NUM=10 +CONFIG_ETH_DMA_TX_BUFFER_NUM=10 CONFIG_ETH_USE_SPI_ETHERNET=y # CONFIG_ETH_SPI_ETHERNET_DM9051 is not set CONFIG_ETH_SPI_ETHERNET_W5500=y @@ -690,7 +671,7 @@ CONFIG_HTTPD_MAX_URI_LEN=512 CONFIG_HTTPD_ERR_RESP_NO_DELAY=y CONFIG_HTTPD_PURGE_BUF_LEN=32 # CONFIG_HTTPD_LOG_PURGE_DATA is not set -# CONFIG_HTTPD_WS_SUPPORT is not set +CONFIG_HTTPD_WS_SUPPORT=y # end of HTTP Server # @@ -716,24 +697,26 @@ CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y -# CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO is not set -CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_FOUR=y -CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES=4 +# CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_TWO is not set +CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR=y +CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=4 +# CONFIG_ESP_MAC_IGNORE_MAC_CRC_ERROR is not set # end of MAC Config # # Sleep Config # -CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y +# CONFIG_ESP_SLEEP_POWER_DOWN_FLASH is not set CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y -CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y -# CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND is not set +# CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND is not set +CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND=y +# CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU is not set +CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y # end of Sleep Config # # RTC Clock Config # -CONFIG_RTC_CLOCK_BBPLL_POWER_ON_WITH_USB=y # end of RTC Clock Config # end of Hardware Settings @@ -749,11 +732,14 @@ CONFIG_ESP_IPC_ISR_ENABLE=y # LCD and Touch Panel # +# +# LCD Touch Drivers are maintained in the IDF Component Registry +# + # # LCD Peripheral Configuration # CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE=32 -# CONFIG_LCD_RGB_ISR_IRAM_SAFE is not set # end of LCD Peripheral Configuration # end of LCD and Touch Panel @@ -774,7 +760,6 @@ CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20 CONFIG_ESP_PHY_MAX_TX_POWER=20 # CONFIG_ESP_PHY_REDUCE_TX_POWER is not set -CONFIG_ESP_PHY_ENABLE_USB=y CONFIG_ESP_PHY_RF_CAL_PARTIAL=y # CONFIG_ESP_PHY_RF_CAL_NONE is not set # CONFIG_ESP_PHY_RF_CAL_FULL is not set @@ -785,8 +770,6 @@ CONFIG_ESP_PHY_CALIBRATION_MODE=0 # Power Management # # CONFIG_PM_ENABLE is not set -CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y -CONFIG_PM_POWER_DOWN_TAGMEM_IN_LIGHT_SLEEP=y # end of Power Management # @@ -804,8 +787,6 @@ CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set # CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set # CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set -CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK=y -CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=y # # Memory protection @@ -813,7 +794,7 @@ CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=y # end of Memory protection CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 -CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=3072 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 CONFIG_ESP_MAIN_TASK_STACK_SIZE=3584 CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y # CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1 is not set @@ -821,12 +802,8 @@ CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 CONFIG_ESP_CONSOLE_UART_DEFAULT=y -# CONFIG_ESP_CONSOLE_USB_CDC is not set -# CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG is not set # CONFIG_ESP_CONSOLE_UART_CUSTOM is not set # CONFIG_ESP_CONSOLE_NONE is not set -# CONFIG_ESP_CONSOLE_SECONDARY_NONE is not set -CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y CONFIG_ESP_CONSOLE_UART=y CONFIG_ESP_CONSOLE_MULTIPLE_UART=y CONFIG_ESP_CONSOLE_UART_NUM=0 @@ -841,7 +818,7 @@ CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y # CONFIG_ESP_PANIC_HANDLER_IRAM is not set # CONFIG_ESP_DEBUG_STUBS_ENABLE is not set -CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y +CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5=y # end of ESP System Settings # @@ -853,7 +830,8 @@ CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER=y CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584 CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1 # CONFIG_ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD is not set -CONFIG_ESP_TIMER_IMPL_SYSTIMER=y +# CONFIG_ESP_TIMER_IMPL_FRC2 is not set +CONFIG_ESP_TIMER_IMPL_TG0_LAC=y # end of High resolution timer (esp_timer) # @@ -861,12 +839,16 @@ CONFIG_ESP_TIMER_IMPL_SYSTIMER=y # CONFIG_ESP32_WIFI_ENABLED=y CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE=y -CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=4 -CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8 +CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10 +CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32 # CONFIG_ESP32_WIFI_STATIC_TX_BUFFER is not set CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 -CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=16 +CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=32 +CONFIG_ESP_WIFI_STATIC_RX_MGMT_BUFFER=y +# CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUFFER is not set +CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0 +CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF=5 # CONFIG_ESP32_WIFI_CSI_ENABLED is not set CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y CONFIG_ESP32_WIFI_TX_BA_WIN=6 @@ -881,9 +863,7 @@ CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 # CONFIG_ESP32_WIFI_RX_IRAM_OPT is not set CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y # CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set -# CONFIG_ESP_WIFI_FTM_ENABLE is not set # CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set -# CONFIG_ESP_WIFI_GCMP_SUPPORT is not set # CONFIG_ESP_WIFI_GMAC_SUPPORT is not set CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y # CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set @@ -969,11 +949,11 @@ CONFIG_FMB_EVENT_QUEUE_TIMEOUT=20 # # CONFIG_FREERTOS_UNICORE is not set CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF -CONFIG_FREERTOS_TICK_SUPPORT_SYSTIMER=y -CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL1=y -# CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL3 is not set -CONFIG_FREERTOS_SYSTICK_USES_SYSTIMER=y -CONFIG_FREERTOS_HZ=1000 +CONFIG_FREERTOS_TICK_SUPPORT_CORETIMER=y +CONFIG_FREERTOS_CORETIMER_0=y +# CONFIG_FREERTOS_CORETIMER_1 is not set +CONFIG_FREERTOS_SYSTICK_USES_CCOUNT=y +CONFIG_FREERTOS_HZ=100 CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION=y # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set @@ -1001,6 +981,7 @@ CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y # CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set # CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set CONFIG_FREERTOS_DEBUG_OCDAWARE=y +# CONFIG_FREERTOS_FPU_IN_ISR is not set CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y # CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH is not set # end of FreeRTOS @@ -1042,20 +1023,17 @@ CONFIG_HEAP_TRACING_OFF=y # # Log output # -CONFIG_LOG_DEFAULT_LEVEL_NONE=y +# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set # CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set # CONFIG_LOG_DEFAULT_LEVEL_WARN is not set -# CONFIG_LOG_DEFAULT_LEVEL_INFO is not set +CONFIG_LOG_DEFAULT_LEVEL_INFO=y # CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set # CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set -CONFIG_LOG_DEFAULT_LEVEL=0 +CONFIG_LOG_DEFAULT_LEVEL=3 CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y -# CONFIG_LOG_MAXIMUM_LEVEL_ERROR is not set -# CONFIG_LOG_MAXIMUM_LEVEL_WARN is not set -# CONFIG_LOG_MAXIMUM_LEVEL_INFO is not set # CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set # CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set -CONFIG_LOG_MAXIMUM_LEVEL=0 +CONFIG_LOG_MAXIMUM_LEVEL=3 CONFIG_LOG_COLORS=y CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y # CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set @@ -1066,6 +1044,7 @@ CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y # CONFIG_LWIP_LOCAL_HOSTNAME="espressif" # CONFIG_LWIP_NETIF_API is not set +CONFIG_LWIP_TCPIP_TASK_PRIO=18 # CONFIG_LWIP_TCPIP_CORE_LOCKING is not set # CONFIG_LWIP_CHECK_THREAD_SAFETY is not set CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y @@ -1079,6 +1058,7 @@ CONFIG_LWIP_SO_REUSE=y CONFIG_LWIP_SO_REUSE_RXTOALL=y # CONFIG_LWIP_SO_RCVBUF is not set # CONFIG_LWIP_NETBUF_RECVINFO is not set +CONFIG_LWIP_IP_DEFAULT_TTL=64 CONFIG_LWIP_IP4_FRAG=y CONFIG_LWIP_IP6_FRAG=y # CONFIG_LWIP_IP4_REASSEMBLY is not set @@ -1090,7 +1070,7 @@ CONFIG_LWIP_ESP_GRATUITOUS_ARP=y CONFIG_LWIP_GARP_TMR_INTERVAL=60 CONFIG_LWIP_ESP_MLDV6_REPORT=y CONFIG_LWIP_MLDV6_TMR_INTERVAL=40 -CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=16 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y # CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y @@ -1127,10 +1107,12 @@ CONFIG_LWIP_TCP_MSS=1440 CONFIG_LWIP_TCP_TMR_INTERVAL=250 CONFIG_LWIP_TCP_MSL=60000 CONFIG_LWIP_TCP_FIN_WAIT_TIMEOUT=20000 -CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744 -CONFIG_LWIP_TCP_WND_DEFAULT=5744 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5760 +CONFIG_LWIP_TCP_WND_DEFAULT=5760 CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 CONFIG_LWIP_TCP_QUEUE_OOSEQ=y +CONFIG_LWIP_TCP_OOSEQ_TIMEOUT=6 +CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=4 # CONFIG_LWIP_TCP_SACK_OUT is not set # CONFIG_LWIP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set CONFIG_LWIP_TCP_OVERSIZE_MSS=y @@ -1186,6 +1168,13 @@ CONFIG_LWIP_SNTP_MAX_SERVERS=1 CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 # end of SNTP +# +# DNS +# +CONFIG_LWIP_DNS_MAX_SERVERS=3 +# CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT is not set +# end of DNS + CONFIG_LWIP_ESP_LWIP_ASSERT=y # @@ -1216,11 +1205,8 @@ CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y # CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 -CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=2048 -CONFIG_MBEDTLS_DYNAMIC_BUFFER=y -CONFIG_MBEDTLS_DYNAMIC_FREE_PEER_CERT=y -CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA=y -CONFIG_MBEDTLS_DYNAMIC_FREE_CA_CERT=y +CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096 +# CONFIG_MBEDTLS_DYNAMIC_BUFFER is not set # CONFIG_MBEDTLS_DEBUG is not set # @@ -1229,6 +1215,7 @@ CONFIG_MBEDTLS_DYNAMIC_FREE_CA_CERT=y # CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is not set # CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK is not set # CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION is not set +CONFIG_MBEDTLS_SSL_KEEP_PEER_CERTIFICATE=y # end of mbedTLS v2.28.x related # @@ -1245,7 +1232,6 @@ CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200 # CONFIG_MBEDTLS_ECP_RESTARTABLE is not set # CONFIG_MBEDTLS_CMAC_C is not set CONFIG_MBEDTLS_HARDWARE_AES=y -CONFIG_MBEDTLS_AES_USE_INTERRUPT=y CONFIG_MBEDTLS_HARDWARE_MPI=y CONFIG_MBEDTLS_HARDWARE_SHA=y CONFIG_MBEDTLS_ROM_MD5=y @@ -1419,13 +1405,26 @@ CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" # end of PThreads +# +# Main Flash configuration +# + +# +# Optional and Experimental Features (READ DOCS FIRST) +# + +# +# Features here require specific hardware (READ DOCS FIRST!) +# +# end of Optional and Experimental Features (READ DOCS FIRST) +# end of Main Flash configuration + # # SPI Flash driver # # CONFIG_SPI_FLASH_VERIFY_WRITE is not set # CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y -# CONFIG_SPI_FLASH_ROM_IMPL is not set CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y # CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set # CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set @@ -1447,9 +1446,8 @@ CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP=y CONFIG_SPI_FLASH_SUPPORT_MXIC_CHIP=y CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y -CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP=y -CONFIG_SPI_FLASH_SUPPORT_TH_CHIP=y -CONFIG_SPI_FLASH_SUPPORT_MXIC_OPI_CHIP=y +# CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP is not set +# CONFIG_SPI_FLASH_SUPPORT_TH_CHIP is not set # end of Auto-detect flash chips CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y @@ -1503,12 +1501,6 @@ CONFIG_WS_BUFFER_SIZE=1024 # end of Websocket # end of TCP Transport -# -# TinyUSB Stack -# -# CONFIG_TINYUSB is not set -# end of TinyUSB Stack - # # Unity unit testing library # @@ -1521,24 +1513,10 @@ CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y # CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set # end of Unity unit testing library -# -# USB-OTG -# -CONFIG_USB_OTG_SUPPORTED=y -CONFIG_USB_HOST_CONTROL_TRANSFER_MAX_SIZE=256 -CONFIG_USB_HOST_HW_BUFFER_BIAS_BALANCED=y -# CONFIG_USB_HOST_HW_BUFFER_BIAS_IN is not set -# CONFIG_USB_HOST_HW_BUFFER_BIAS_PERIODIC_OUT is not set - # # Root Hub configuration # -CONFIG_USB_HOST_DEBOUNCE_DELAY_MS=250 -CONFIG_USB_HOST_RESET_HOLD_MS=30 -CONFIG_USB_HOST_RESET_RECOVERY_MS=30 -CONFIG_USB_HOST_SET_ADDR_RECOVERY_MS=10 # end of Root Hub configuration -# end of USB-OTG # # Virtual file system @@ -1569,8 +1547,8 @@ CONFIG_WL_SECTOR_SIZE=4096 # CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 -CONFIG_WIFI_PROV_BLE_BONDING=y -CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION=y +# CONFIG_WIFI_PROV_BLE_BONDING is not set +# CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION is not set # CONFIG_WIFI_PROV_KEEP_BLE_ON_AFTER_PROV is not set # end of Wi-Fi Provisioning Manager @@ -1611,14 +1589,14 @@ CONFIG_LUA_ROOT="/lua" # end of Compatibility options # Deprecated options for backward compatibility -CONFIG_TOOLPREFIX="xtensa-esp32s3-elf-" -CONFIG_LOG_BOOTLOADER_LEVEL_NONE=y +CONFIG_TOOLPREFIX="xtensa-esp32-elf-" +# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set # CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set # CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_INFO is not set +CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y # CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set # CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set -CONFIG_LOG_BOOTLOADER_LEVEL=0 +CONFIG_LOG_BOOTLOADER_LEVEL=3 # CONFIG_APP_ROLLBACK_ENABLE is not set # CONFIG_FLASH_ENCRYPTION_ENABLED is not set # CONFIG_FLASHMODE_QIO is not set @@ -1650,14 +1628,37 @@ CONFIG_STACK_CHECK_NONE=y # CONFIG_ESP32_APPTRACE_DEST_TRAX is not set CONFIG_ESP32_APPTRACE_DEST_NONE=y CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y +CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY=y +# CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY is not set +# CONFIG_BTDM_CONTROLLER_MODE_BTDM is not set +CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN=3 +CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN_EFF=3 +CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN_EFF=0 +CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_EFF=0 +CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE=0 +CONFIG_BTDM_CONTROLLER_HCI_MODE_VHCI=y +# CONFIG_BTDM_CONTROLLER_HCI_MODE_UART_H4 is not set +CONFIG_BTDM_CONTROLLER_MODEM_SLEEP=y +CONFIG_BLE_SCAN_DUPLICATE=y +CONFIG_SCAN_DUPLICATE_BY_DEVICE_ADDR=y +# CONFIG_SCAN_DUPLICATE_BY_ADV_DATA is not set +# CONFIG_SCAN_DUPLICATE_BY_ADV_DATA_AND_DEVICE_ADDR is not set +CONFIG_SCAN_DUPLICATE_TYPE=0 +CONFIG_DUPLICATE_SCAN_CACHE_SIZE=100 +# CONFIG_BLE_MESH_SCAN_DUPLICATE_EN is not set +CONFIG_BTDM_CONTROLLER_FULL_SCAN_SUPPORTED=y +CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_SUPPORTED=y +CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_NUM=100 +CONFIG_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 CONFIG_BLUEDROID_ENABLED=y # CONFIG_NIMBLE_ENABLED is not set CONFIG_BTC_TASK_STACK_SIZE=3072 CONFIG_BLUEDROID_PINNED_TO_CORE_0=y # CONFIG_BLUEDROID_PINNED_TO_CORE_1 is not set CONFIG_BLUEDROID_PINNED_TO_CORE=0 -CONFIG_BTU_TASK_STACK_SIZE=4096 +CONFIG_BTU_TASK_STACK_SIZE=4352 # CONFIG_BLUEDROID_MEM_DEBUG is not set +# CONFIG_CLASSIC_BT_ENABLED is not set CONFIG_GATTS_ENABLE=y # CONFIG_GATTS_SEND_SERVICE_CHANGE_MANUAL is not set CONFIG_GATTS_SEND_SERVICE_CHANGE_AUTO=y @@ -1832,25 +1833,46 @@ CONFIG_SMP_ENABLE=y # CONFIG_BLE_ACTIVE_SCAN_REPORT_ADV_SCAN_RSP_INDIVIDUALLY is not set CONFIG_BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT=30 CONFIG_ADC2_DISABLE_DAC=y +# CONFIG_SPIRAM_SUPPORT is not set +CONFIG_TRACEMEM_RESERVE_DRAM=0x0 +# CONFIG_ULP_COPROC_ENABLED is not set +CONFIG_ULP_COPROC_RESERVE_MEM=0 +CONFIG_BROWNOUT_DET=y +CONFIG_BROWNOUT_DET_LVL_SEL_0=y +# CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_7 is not set +CONFIG_BROWNOUT_DET_LVL=0 +CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y +# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256 is not set +# CONFIG_DISABLE_BASIC_ROM_CONSOLE is not set +# CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set # CONFIG_EVENT_LOOP_PROFILING is not set CONFIG_POST_EVENTS_FROM_ISR=y CONFIG_POST_EVENTS_FROM_IRAM_ISR=y -CONFIG_ESP_SYSTEM_PD_FLASH=y -CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND=y +# CONFIG_TWO_UNIVERSAL_MAC_ADDRESS is not set +CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y +CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4 +# CONFIG_ESP_SYSTEM_PD_FLASH is not set +# CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND is not set CONFIG_IPC_TASK_STACK_SIZE=1536 CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y # CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 CONFIG_ESP32_PHY_MAX_TX_POWER=20 # CONFIG_ESP32_REDUCE_PHY_TX_POWER is not set -CONFIG_ESP_SYSTEM_PM_POWER_DOWN_CPU=y # CONFIG_ESP32S2_PANIC_PRINT_HALT is not set CONFIG_ESP32S2_PANIC_PRINT_REBOOT=y # CONFIG_ESP32S2_PANIC_SILENT_REBOOT is not set # CONFIG_ESP32S2_PANIC_GDBSTUB is not set -CONFIG_ESP32S2_ALLOW_RTC_FAST_MEM_AS_HEAP=y CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 -CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=3072 +CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 CONFIG_MAIN_TASK_STACK_SIZE=3584 CONFIG_CONSOLE_UART_DEFAULT=y # CONFIG_CONSOLE_UART_CUSTOM is not set @@ -1893,13 +1915,13 @@ CONFIG_TIMER_QUEUE_LENGTH=10 # CONFIG_USE_ONLY_LWIP_SELECT is not set CONFIG_ESP_GRATUITOUS_ARP=y CONFIG_GARP_TMR_INTERVAL=60 -CONFIG_TCPIP_RECVMBOX_SIZE=16 +CONFIG_TCPIP_RECVMBOX_SIZE=32 CONFIG_TCP_MAXRTX=12 CONFIG_TCP_SYNMAXRTX=12 CONFIG_TCP_MSS=1440 CONFIG_TCP_MSL=60000 -CONFIG_TCP_SND_BUF_DEFAULT=5744 -CONFIG_TCP_WND_DEFAULT=5744 +CONFIG_TCP_SND_BUF_DEFAULT=5760 +CONFIG_TCP_WND_DEFAULT=5760 CONFIG_TCP_RECVMBOX_SIZE=6 CONFIG_TCP_QUEUE_OOSEQ=y # CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set @@ -1924,7 +1946,6 @@ CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y # CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set # CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set -# CONFIG_USB_ENABLED is not set CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y CONFIG_SUPPORT_TERMIOS=y CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 diff --git a/sdkconfig.esp32c3.4mb b/sdkconfig.esp32c3.4mb index 1da1021f0..e2343561a 100644 --- a/sdkconfig.esp32c3.4mb +++ b/sdkconfig.esp32c3.4mb @@ -50,6 +50,14 @@ CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y # CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set # CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set CONFIG_BOOTLOADER_LOG_LEVEL=0 + +# +# Serial Flash Configurations +# +# CONFIG_BOOTLOADER_FLASH_DC_AWARE is not set +CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y +# end of Serial Flash Configurations + CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y # CONFIG_BOOTLOADER_FACTORY_RESET is not set # CONFIG_BOOTLOADER_APP_TEST is not set @@ -63,7 +71,6 @@ CONFIG_BOOTLOADER_WDT_TIME_MS=9000 # CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 # CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set -CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y # end of Bootloader config # @@ -262,6 +269,7 @@ CONFIG_BT_CTRL_SLEEP_CLOCK_EFF=0 CONFIG_BT_CTRL_HCI_TL_EFF=1 # CONFIG_BT_CTRL_AGC_RECORRECT_EN is not set # CONFIG_BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX is not set +# CONFIG_BT_BLE_ADV_DATA_LENGTH_ZERO_AUX is not set # end of Bluetooth controller CONFIG_BT_BLUEDROID_ENABLED=y @@ -289,6 +297,7 @@ CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE=0 # CONFIG_BT_GATTS_APPEARANCE_WRITABLE is not set CONFIG_BT_GATTC_ENABLE=y CONFIG_BT_GATTC_MAX_CACHE_CHAR=40 +CONFIG_BT_GATTC_NOTIF_REG_MAX=5 # CONFIG_BT_GATTC_CACHE_NVS_FLASH is not set CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=3 CONFIG_BT_BLE_SMP_ENABLE=y @@ -474,6 +483,7 @@ CONFIG_BT_MULTI_CONNECTION_ENBALE=y # CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY is not set # CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK is not set CONFIG_BT_SMP_ENABLE=y +CONFIG_BT_SMP_MAX_BONDS=15 # CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN is not set CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT=30 CONFIG_BT_MAX_DEVICE_NAME_LEN=32 @@ -574,12 +584,13 @@ CONFIG_ESP32C3_DEFAULT_CPU_FREQ_MHZ=160 # CONFIG_ESP32C3_REV_MIN_2 is not set CONFIG_ESP32C3_REV_MIN_3=y # CONFIG_ESP32C3_REV_MIN_4 is not set +# CONFIG_ESP32C3_REV_MIN_101 is not set CONFIG_ESP32C3_REV_MIN=3 CONFIG_ESP32C3_REV_MIN_FULL=3 CONFIG_ESP_REV_MIN_FULL=3 CONFIG_ESP32C3_REV_MAX_FULL_STR_OPT=y -CONFIG_ESP32C3_REV_MAX_FULL=99 -CONFIG_ESP_REV_MAX_FULL=99 +CONFIG_ESP32C3_REV_MAX_FULL=199 +CONFIG_ESP_REV_MAX_FULL=199 CONFIG_ESP32C3_DEBUG_OCDAWARE=y CONFIG_ESP32C3_BROWNOUT_DET=y CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_7=y @@ -651,7 +662,7 @@ CONFIG_HTTPD_MAX_URI_LEN=512 CONFIG_HTTPD_ERR_RESP_NO_DELAY=y CONFIG_HTTPD_PURGE_BUF_LEN=32 # CONFIG_HTTPD_LOG_PURGE_DATA is not set -# CONFIG_HTTPD_WS_SUPPORT is not set +CONFIG_HTTPD_WS_SUPPORT=y # end of HTTP Server # @@ -688,6 +699,7 @@ CONFIG_ESP32C3_UNIVERSAL_MAC_ADDRESSES=4 CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y # CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND is not set +CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y # end of Sleep Config CONFIG_ESP_SLEEP_SYSTIMER_STALL_WORKAROUND=y @@ -709,6 +721,10 @@ CONFIG_ESP_IPC_TASK_STACK_SIZE=1536 # LCD and Touch Panel # +# +# LCD Touch Drivers are maintained in the IDF Component Registry +# + # # LCD Peripheral Configuration # @@ -827,6 +843,10 @@ CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=16 CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=16 +CONFIG_ESP_WIFI_STATIC_RX_MGMT_BUFFER=y +# CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUFFER is not set +CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0 +CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF=5 # CONFIG_ESP32_WIFI_CSI_ENABLED is not set CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y CONFIG_ESP32_WIFI_TX_BA_WIN=6 @@ -1022,6 +1042,7 @@ CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y # CONFIG_LWIP_LOCAL_HOSTNAME="espressif" # CONFIG_LWIP_NETIF_API is not set +CONFIG_LWIP_TCPIP_TASK_PRIO=18 # CONFIG_LWIP_TCPIP_CORE_LOCKING is not set # CONFIG_LWIP_CHECK_THREAD_SAFETY is not set CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y @@ -1035,6 +1056,7 @@ CONFIG_LWIP_SO_REUSE=y CONFIG_LWIP_SO_REUSE_RXTOALL=y # CONFIG_LWIP_SO_RCVBUF is not set # CONFIG_LWIP_NETBUF_RECVINFO is not set +CONFIG_LWIP_IP_DEFAULT_TTL=64 CONFIG_LWIP_IP4_FRAG=y CONFIG_LWIP_IP6_FRAG=y # CONFIG_LWIP_IP4_REASSEMBLY is not set @@ -1087,6 +1109,8 @@ CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744 CONFIG_LWIP_TCP_WND_DEFAULT=5744 CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 CONFIG_LWIP_TCP_QUEUE_OOSEQ=y +CONFIG_LWIP_TCP_OOSEQ_TIMEOUT=6 +CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=4 # CONFIG_LWIP_TCP_SACK_OUT is not set # CONFIG_LWIP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set CONFIG_LWIP_TCP_OVERSIZE_MSS=y @@ -1141,6 +1165,13 @@ CONFIG_LWIP_SNTP_MAX_SERVERS=1 CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 # end of SNTP +# +# DNS +# +CONFIG_LWIP_DNS_MAX_SERVERS=3 +# CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT is not set +# end of DNS + CONFIG_LWIP_ESP_LWIP_ASSERT=y # @@ -1370,6 +1401,21 @@ CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" # end of PThreads +# +# Main Flash configuration +# + +# +# Optional and Experimental Features (READ DOCS FIRST) +# + +# +# Features here require specific hardware (READ DOCS FIRST!) +# +# CONFIG_SPI_FLASH_AUTO_SUSPEND is not set +# end of Optional and Experimental Features (READ DOCS FIRST) +# end of Main Flash configuration + # # SPI Flash driver # @@ -1386,7 +1432,6 @@ CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y CONFIG_SPI_FLASH_YIELD_DURING_ERASE=y CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=20 CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=1 -# CONFIG_SPI_FLASH_AUTO_SUSPEND is not set CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=8192 # CONFIG_SPI_FLASH_SIZE_OVERRIDE is not set # CONFIG_SPI_FLASH_CHECK_ERASE_TIMEOUT_DISABLED is not set diff --git a/sdkconfig.esp32s3.4mb b/sdkconfig.esp32s3.4mb index 0fbf65865..01763ce59 100644 --- a/sdkconfig.esp32s3.4mb +++ b/sdkconfig.esp32s3.4mb @@ -50,6 +50,14 @@ CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y # CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set # CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set CONFIG_BOOTLOADER_LOG_LEVEL=0 + +# +# Serial Flash Configurations +# +# CONFIG_BOOTLOADER_FLASH_DC_AWARE is not set +CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y +# end of Serial Flash Configurations + # CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V is not set CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y # CONFIG_BOOTLOADER_FACTORY_RESET is not set @@ -64,7 +72,6 @@ CONFIG_BOOTLOADER_WDT_TIME_MS=9000 # CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 # CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set -CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y # end of Bootloader config # @@ -98,6 +105,7 @@ CONFIG_ESPTOOLPY_FLASHMODE_DIO=y # CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y CONFIG_ESPTOOLPY_FLASHMODE="dio" +CONFIG_ESPTOOLPY_S3_STR=y # CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set CONFIG_ESPTOOLPY_FLASHFREQ_40M=y @@ -196,8 +204,8 @@ CONFIG_BT_SOC_SUPPORT_5_0=y # Bluetooth controller # CONFIG_BT_CTRL_MODE_EFF=1 -CONFIG_BT_CTRL_BLE_MAX_ACT=6 -CONFIG_BT_CTRL_BLE_MAX_ACT_EFF=6 +CONFIG_BT_CTRL_BLE_MAX_ACT=10 +CONFIG_BT_CTRL_BLE_MAX_ACT_EFF=10 CONFIG_BT_CTRL_BLE_STATIC_ACL_TX_BUF_NB=0 CONFIG_BT_CTRL_PINNED_TO_CORE_0=y # CONFIG_BT_CTRL_PINNED_TO_CORE_1 is not set @@ -233,12 +241,12 @@ CONFIG_BT_CTRL_RX_ANTENNA_INDEX_EFF=0 # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N0 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P6 is not set -CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P9=y +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P9 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P12 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P15 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P18 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P21 is not set -CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF=11 +CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P21=y +CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF=15 CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP=y CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM=100 CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 @@ -265,6 +273,7 @@ CONFIG_BT_CTRL_SLEEP_CLOCK_EFF=0 CONFIG_BT_CTRL_HCI_TL_EFF=1 # CONFIG_BT_CTRL_AGC_RECORRECT_EN is not set # CONFIG_BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX is not set +# CONFIG_BT_BLE_ADV_DATA_LENGTH_ZERO_AUX is not set # end of Bluetooth controller CONFIG_BT_BLUEDROID_ENABLED=y @@ -294,6 +303,7 @@ CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE=0 # CONFIG_BT_GATTS_APPEARANCE_WRITABLE is not set CONFIG_BT_GATTC_ENABLE=y CONFIG_BT_GATTC_MAX_CACHE_CHAR=40 +CONFIG_BT_GATTC_NOTIF_REG_MAX=5 # CONFIG_BT_GATTC_CACHE_NVS_FLASH is not set CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=3 CONFIG_BT_BLE_SMP_ENABLE=y @@ -475,15 +485,16 @@ CONFIG_BT_LOG_BLUFI_TRACE_LEVEL=2 CONFIG_BT_ACL_CONNECTIONS=4 CONFIG_BT_MULTI_CONNECTION_ENBALE=y -# CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST is not set +CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=y # CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY is not set # CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK is not set CONFIG_BT_SMP_ENABLE=y +CONFIG_BT_SMP_MAX_BONDS=15 # CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN is not set CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT=30 CONFIG_BT_MAX_DEVICE_NAME_LEN=32 CONFIG_BT_BLE_RPA_TIMEOUT=900 -CONFIG_BT_BLE_50_FEATURES_SUPPORTED=y +# CONFIG_BT_BLE_50_FEATURES_SUPPORTED is not set CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y # CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL is not set # end of Bluedroid Options @@ -537,7 +548,7 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=y # # UART configuration # -# CONFIG_UART_ISR_IN_IRAM is not set +CONFIG_UART_ISR_IN_IRAM=y # end of UART configuration # @@ -579,9 +590,9 @@ CONFIG_ESP32S3_REV_MAX_FULL_STR_OPT=y CONFIG_ESP32S3_REV_MAX_FULL=99 CONFIG_ESP_REV_MAX_FULL=99 # CONFIG_ESP32S3_DEFAULT_CPU_FREQ_80 is not set -CONFIG_ESP32S3_DEFAULT_CPU_FREQ_160=y -# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240 is not set -CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=160 +# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_160 is not set +CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y +CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=240 # # Cache config @@ -690,7 +701,7 @@ CONFIG_HTTPD_MAX_URI_LEN=512 CONFIG_HTTPD_ERR_RESP_NO_DELAY=y CONFIG_HTTPD_PURGE_BUF_LEN=32 # CONFIG_HTTPD_LOG_PURGE_DATA is not set -# CONFIG_HTTPD_WS_SUPPORT is not set +CONFIG_HTTPD_WS_SUPPORT=y # end of HTTP Server # @@ -728,6 +739,7 @@ CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y # CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND is not set +CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y # end of Sleep Config # @@ -749,6 +761,10 @@ CONFIG_ESP_IPC_ISR_ENABLE=y # LCD and Touch Panel # +# +# LCD Touch Drivers are maintained in the IDF Component Registry +# + # # LCD Peripheral Configuration # @@ -842,6 +858,7 @@ CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y # CONFIG_ESP_PANIC_HANDLER_IRAM is not set # CONFIG_ESP_DEBUG_STUBS_ENABLE is not set CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y +CONFIG_ESP_SYSTEM_BBPLL_RECALIB=y # end of ESP System Settings # @@ -867,6 +884,10 @@ CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8 CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=16 +CONFIG_ESP_WIFI_STATIC_RX_MGMT_BUFFER=y +# CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUFFER is not set +CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0 +CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF=5 # CONFIG_ESP32_WIFI_CSI_ENABLED is not set CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y CONFIG_ESP32_WIFI_TX_BA_WIN=6 @@ -877,8 +898,8 @@ CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y # CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 -# CONFIG_ESP32_WIFI_IRAM_OPT is not set -# CONFIG_ESP32_WIFI_RX_IRAM_OPT is not set +CONFIG_ESP32_WIFI_IRAM_OPT=y +CONFIG_ESP32_WIFI_RX_IRAM_OPT=y CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y # CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set # CONFIG_ESP_WIFI_FTM_ENABLE is not set @@ -1066,11 +1087,12 @@ CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y # CONFIG_LWIP_LOCAL_HOSTNAME="espressif" # CONFIG_LWIP_NETIF_API is not set +CONFIG_LWIP_TCPIP_TASK_PRIO=18 # CONFIG_LWIP_TCPIP_CORE_LOCKING is not set # CONFIG_LWIP_CHECK_THREAD_SAFETY is not set CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y # CONFIG_LWIP_L2_TO_L3_COPY is not set -# CONFIG_LWIP_IRAM_OPTIMIZATION is not set +CONFIG_LWIP_IRAM_OPTIMIZATION=y CONFIG_LWIP_TIMERS_ONDEMAND=y CONFIG_LWIP_MAX_SOCKETS=10 # CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set @@ -1079,6 +1101,7 @@ CONFIG_LWIP_SO_REUSE=y CONFIG_LWIP_SO_REUSE_RXTOALL=y # CONFIG_LWIP_SO_RCVBUF is not set # CONFIG_LWIP_NETBUF_RECVINFO is not set +CONFIG_LWIP_IP_DEFAULT_TTL=64 CONFIG_LWIP_IP4_FRAG=y CONFIG_LWIP_IP6_FRAG=y # CONFIG_LWIP_IP4_REASSEMBLY is not set @@ -1131,6 +1154,8 @@ CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744 CONFIG_LWIP_TCP_WND_DEFAULT=5744 CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 CONFIG_LWIP_TCP_QUEUE_OOSEQ=y +CONFIG_LWIP_TCP_OOSEQ_TIMEOUT=6 +CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=4 # CONFIG_LWIP_TCP_SACK_OUT is not set # CONFIG_LWIP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set CONFIG_LWIP_TCP_OVERSIZE_MSS=y @@ -1186,6 +1211,13 @@ CONFIG_LWIP_SNTP_MAX_SERVERS=1 CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 # end of SNTP +# +# DNS +# +CONFIG_LWIP_DNS_MAX_SERVERS=3 +# CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT is not set +# end of DNS + CONFIG_LWIP_ESP_LWIP_ASSERT=y # @@ -1227,6 +1259,7 @@ CONFIG_MBEDTLS_DYNAMIC_FREE_CA_CERT=y # mbedTLS v2.28.x related # # CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is not set +CONFIG_MBEDTLS_ECDH_LEGACY_CONTEXT=y # CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK is not set # CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION is not set # end of mbedTLS v2.28.x related @@ -1242,8 +1275,8 @@ CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200 # end of Certificate Bundle -# CONFIG_MBEDTLS_ECP_RESTARTABLE is not set -# CONFIG_MBEDTLS_CMAC_C is not set +CONFIG_MBEDTLS_ECP_RESTARTABLE=y +CONFIG_MBEDTLS_CMAC_C=y CONFIG_MBEDTLS_HARDWARE_AES=y CONFIG_MBEDTLS_AES_USE_INTERRUPT=y CONFIG_MBEDTLS_HARDWARE_MPI=y @@ -1419,6 +1452,26 @@ CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" # end of PThreads +# +# Main Flash configuration +# + +# +# Optional and Experimental Features (READ DOCS FIRST) +# + +# +# Features here require specific hardware (READ DOCS FIRST!) +# +# CONFIG_SPI_FLASH_HPM_ENA is not set +CONFIG_SPI_FLASH_HPM_AUTO=y +# CONFIG_SPI_FLASH_HPM_DIS is not set +CONFIG_SPI_FLASH_HPM_ON=y +CONFIG_SPI_FLASH_HPM_DC_AUTO=y +# CONFIG_SPI_FLASH_HPM_DC_DISABLE is not set +# end of Optional and Experimental Features (READ DOCS FIRST) +# end of Main Flash configuration + # # SPI Flash driver # diff --git a/sdkconfig.esp32s3.8mb b/sdkconfig.esp32s3.8mb index 11a4697db..571ea575c 100644 --- a/sdkconfig.esp32s3.8mb +++ b/sdkconfig.esp32s3.8mb @@ -50,6 +50,14 @@ CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y # CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set # CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set CONFIG_BOOTLOADER_LOG_LEVEL=0 + +# +# Serial Flash Configurations +# +# CONFIG_BOOTLOADER_FLASH_DC_AWARE is not set +CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y +# end of Serial Flash Configurations + # CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V is not set CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y # CONFIG_BOOTLOADER_FACTORY_RESET is not set @@ -64,7 +72,6 @@ CONFIG_BOOTLOADER_WDT_TIME_MS=9000 # CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 # CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set -CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y # end of Bootloader config # @@ -98,6 +105,7 @@ CONFIG_ESPTOOLPY_FLASHMODE_DIO=y # CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y CONFIG_ESPTOOLPY_FLASHMODE="dio" +CONFIG_ESPTOOLPY_S3_STR=y # CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set CONFIG_ESPTOOLPY_FLASHFREQ_40M=y @@ -265,6 +273,7 @@ CONFIG_BT_CTRL_SLEEP_CLOCK_EFF=0 CONFIG_BT_CTRL_HCI_TL_EFF=1 # CONFIG_BT_CTRL_AGC_RECORRECT_EN is not set # CONFIG_BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX is not set +# CONFIG_BT_BLE_ADV_DATA_LENGTH_ZERO_AUX is not set # end of Bluetooth controller CONFIG_BT_BLUEDROID_ENABLED=y @@ -294,6 +303,7 @@ CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE=0 # CONFIG_BT_GATTS_APPEARANCE_WRITABLE is not set CONFIG_BT_GATTC_ENABLE=y CONFIG_BT_GATTC_MAX_CACHE_CHAR=40 +CONFIG_BT_GATTC_NOTIF_REG_MAX=5 # CONFIG_BT_GATTC_CACHE_NVS_FLASH is not set CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=3 CONFIG_BT_BLE_SMP_ENABLE=y @@ -479,6 +489,7 @@ CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=y # CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY is not set # CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK is not set CONFIG_BT_SMP_ENABLE=y +CONFIG_BT_SMP_MAX_BONDS=15 # CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN is not set CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT=30 CONFIG_BT_MAX_DEVICE_NAME_LEN=32 @@ -690,7 +701,7 @@ CONFIG_HTTPD_MAX_URI_LEN=512 CONFIG_HTTPD_ERR_RESP_NO_DELAY=y CONFIG_HTTPD_PURGE_BUF_LEN=32 # CONFIG_HTTPD_LOG_PURGE_DATA is not set -# CONFIG_HTTPD_WS_SUPPORT is not set +CONFIG_HTTPD_WS_SUPPORT=y # end of HTTP Server # @@ -728,6 +739,7 @@ CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y # CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND is not set +CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y # end of Sleep Config # @@ -749,6 +761,10 @@ CONFIG_ESP_IPC_ISR_ENABLE=y # LCD and Touch Panel # +# +# LCD Touch Drivers are maintained in the IDF Component Registry +# + # # LCD Peripheral Configuration # @@ -842,6 +858,7 @@ CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y # CONFIG_ESP_PANIC_HANDLER_IRAM is not set # CONFIG_ESP_DEBUG_STUBS_ENABLE is not set CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y +CONFIG_ESP_SYSTEM_BBPLL_RECALIB=y # end of ESP System Settings # @@ -867,6 +884,10 @@ CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8 CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=16 +CONFIG_ESP_WIFI_STATIC_RX_MGMT_BUFFER=y +# CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUFFER is not set +CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0 +CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF=5 # CONFIG_ESP32_WIFI_CSI_ENABLED is not set CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y CONFIG_ESP32_WIFI_TX_BA_WIN=6 @@ -1066,6 +1087,7 @@ CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y # CONFIG_LWIP_LOCAL_HOSTNAME="espressif" # CONFIG_LWIP_NETIF_API is not set +CONFIG_LWIP_TCPIP_TASK_PRIO=18 # CONFIG_LWIP_TCPIP_CORE_LOCKING is not set # CONFIG_LWIP_CHECK_THREAD_SAFETY is not set CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y @@ -1079,6 +1101,7 @@ CONFIG_LWIP_SO_REUSE=y CONFIG_LWIP_SO_REUSE_RXTOALL=y # CONFIG_LWIP_SO_RCVBUF is not set # CONFIG_LWIP_NETBUF_RECVINFO is not set +CONFIG_LWIP_IP_DEFAULT_TTL=64 CONFIG_LWIP_IP4_FRAG=y CONFIG_LWIP_IP6_FRAG=y # CONFIG_LWIP_IP4_REASSEMBLY is not set @@ -1131,6 +1154,8 @@ CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744 CONFIG_LWIP_TCP_WND_DEFAULT=5744 CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 CONFIG_LWIP_TCP_QUEUE_OOSEQ=y +CONFIG_LWIP_TCP_OOSEQ_TIMEOUT=6 +CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=4 # CONFIG_LWIP_TCP_SACK_OUT is not set # CONFIG_LWIP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set CONFIG_LWIP_TCP_OVERSIZE_MSS=y @@ -1186,6 +1211,13 @@ CONFIG_LWIP_SNTP_MAX_SERVERS=1 CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 # end of SNTP +# +# DNS +# +CONFIG_LWIP_DNS_MAX_SERVERS=3 +# CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT is not set +# end of DNS + CONFIG_LWIP_ESP_LWIP_ASSERT=y # @@ -1420,6 +1452,26 @@ CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" # end of PThreads +# +# Main Flash configuration +# + +# +# Optional and Experimental Features (READ DOCS FIRST) +# + +# +# Features here require specific hardware (READ DOCS FIRST!) +# +# CONFIG_SPI_FLASH_HPM_ENA is not set +CONFIG_SPI_FLASH_HPM_AUTO=y +# CONFIG_SPI_FLASH_HPM_DIS is not set +CONFIG_SPI_FLASH_HPM_ON=y +CONFIG_SPI_FLASH_HPM_DC_AUTO=y +# CONFIG_SPI_FLASH_HPM_DC_DISABLE is not set +# end of Optional and Experimental Features (READ DOCS FIRST) +# end of Main Flash configuration + # # SPI Flash driver # @@ -1653,7 +1705,7 @@ CONFIG_ESP32_APPTRACE_DEST_NONE=y CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y CONFIG_BLUEDROID_ENABLED=y # CONFIG_NIMBLE_ENABLED is not set -CONFIG_BTC_TASK_STACK_SIZE=4096 +CONFIG_BTC_TASK_STACK_SIZE=3072 CONFIG_BLUEDROID_PINNED_TO_CORE_0=y # CONFIG_BLUEDROID_PINNED_TO_CORE_1 is not set CONFIG_BLUEDROID_PINNED_TO_CORE=0 diff --git a/sdkconfig.old b/sdkconfig.old index c6993157e..12ec26fec 100644 --- a/sdkconfig.old +++ b/sdkconfig.old @@ -3,15 +3,15 @@ # Espressif IoT Development Framework (ESP-IDF) Project Configuration # CONFIG_IDF_CMAKE=y -CONFIG_IDF_TARGET_ARCH_XTENSA=y -CONFIG_IDF_TARGET="esp32s3" -CONFIG_IDF_TARGET_ESP32S3=y -CONFIG_IDF_FIRMWARE_CHIP_ID=0x0009 +CONFIG_IDF_TARGET_ARCH_RISCV=y +CONFIG_IDF_TARGET="esp32c3" +CONFIG_IDF_TARGET_ESP32C3=y +CONFIG_IDF_FIRMWARE_CHIP_ID=0x0005 # # SDK tool configuration # -CONFIG_SDK_TOOLPREFIX="xtensa-esp32s3-elf-" +CONFIG_SDK_TOOLPREFIX="riscv32-esp-elf-" # CONFIG_SDK_TOOLCHAIN_SUPPORTS_TIME_WIDE_64_BITS is not set # end of SDK tool configuration @@ -58,7 +58,6 @@ CONFIG_BOOTLOADER_LOG_LEVEL=0 CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y # end of Serial Flash Configurations -# CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V is not set CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y # CONFIG_BOOTLOADER_FACTORY_RESET is not set # CONFIG_BOOTLOADER_APP_TEST is not set @@ -98,28 +97,26 @@ CONFIG_BOOT_ROM_LOG_ALWAYS_ON=y # CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200 # CONFIG_ESPTOOLPY_NO_STUB is not set -# CONFIG_ESPTOOLPY_OCT_FLASH is not set # CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set # CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set CONFIG_ESPTOOLPY_FLASHMODE_DIO=y # CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y CONFIG_ESPTOOLPY_FLASHMODE="dio" -CONFIG_ESPTOOLPY_S3_STR=y -# CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set -# CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set -CONFIG_ESPTOOLPY_FLASHFREQ_40M=y +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y +# CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set +# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set -CONFIG_ESPTOOLPY_FLASHFREQ="40m" +CONFIG_ESPTOOLPY_FLASHFREQ="80m" # CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE="8MB" +CONFIG_ESPTOOLPY_FLASHSIZE="4MB" CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y CONFIG_ESPTOOLPY_BEFORE_RESET=y # CONFIG_ESPTOOLPY_BEFORE_NORESET is not set @@ -172,6 +169,7 @@ CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y # CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set # CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set # CONFIG_COMPILER_WARN_WRITE_STRINGS is not set +# CONFIG_COMPILER_SAVE_RESTORE_LIBCALLS is not set # CONFIG_COMPILER_DISABLE_GCC8_WARNINGS is not set # CONFIG_COMPILER_DUMP_RTL_FILES is not set # end of Compiler options @@ -207,8 +205,6 @@ CONFIG_BT_CTRL_MODE_EFF=1 CONFIG_BT_CTRL_BLE_MAX_ACT=10 CONFIG_BT_CTRL_BLE_MAX_ACT_EFF=10 CONFIG_BT_CTRL_BLE_STATIC_ACL_TX_BUF_NB=0 -CONFIG_BT_CTRL_PINNED_TO_CORE_0=y -# CONFIG_BT_CTRL_PINNED_TO_CORE_1 is not set CONFIG_BT_CTRL_PINNED_TO_CORE=0 CONFIG_BT_CTRL_HCI_MODE_VHCI=y # CONFIG_BT_CTRL_HCI_MODE_UART_H4 is not set @@ -239,14 +235,14 @@ CONFIG_BT_CTRL_RX_ANTENNA_INDEX_EFF=0 # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N6 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N3 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N0 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3 is not set +CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3=y # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P6 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P9 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P12 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P15 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P18 is not set -CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P21=y -CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF=15 +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P21 is not set +CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF=9 CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP=y CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM=100 CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 @@ -284,8 +280,6 @@ CONFIG_BT_BLUEDROID_ENABLED=y # Bluedroid Options # CONFIG_BT_BTC_TASK_STACK_SIZE=3072 -CONFIG_BT_BLUEDROID_PINNED_TO_CORE_0=y -# CONFIG_BT_BLUEDROID_PINNED_TO_CORE_1 is not set CONFIG_BT_BLUEDROID_PINNED_TO_CORE=0 CONFIG_BT_BTU_TASK_STACK_SIZE=4096 # CONFIG_BT_BLUEDROID_MEM_DEBUG is not set @@ -485,7 +479,7 @@ CONFIG_BT_LOG_BLUFI_TRACE_LEVEL=2 CONFIG_BT_ACL_CONNECTIONS=4 CONFIG_BT_MULTI_CONNECTION_ENBALE=y -CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=y +# CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST is not set # CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY is not set # CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK is not set CONFIG_BT_SMP_ENABLE=y @@ -494,7 +488,7 @@ CONFIG_BT_SMP_MAX_BONDS=15 CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT=30 CONFIG_BT_MAX_DEVICE_NAME_LEN=32 CONFIG_BT_BLE_RPA_TIMEOUT=900 -# CONFIG_BT_BLE_50_FEATURES_SUPPORTED is not set +CONFIG_BT_BLE_50_FEATURES_SUPPORTED=y CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y # CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL is not set # end of Bluedroid Options @@ -521,6 +515,7 @@ CONFIG_COAP_LOG_DEFAULT_LEVEL=0 # CONFIG_ADC_FORCE_XPD_FSM is not set CONFIG_ADC_DISABLE_DAC=y # CONFIG_ADC_CONTINUOUS_FORCE_USE_ADC2_ON_C3_S3 is not set +# CONFIG_ADC_ONESHOT_FORCE_USE_ADC2_ON_C3 is not set # end of ADC configuration # @@ -548,7 +543,7 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=y # # UART configuration # -CONFIG_UART_ISR_IN_IRAM=y +# CONFIG_UART_ISR_IN_IRAM is not set # end of UART configuration # @@ -579,76 +574,42 @@ CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y # end of ESP-TLS # -# ESP32S3-Specific -# -CONFIG_ESP32S3_REV_MIN_0=y -# CONFIG_ESP32S3_REV_MIN_1 is not set -# CONFIG_ESP32S3_REV_MIN_2 is not set -CONFIG_ESP32S3_REV_MIN_FULL=0 -CONFIG_ESP_REV_MIN_FULL=0 -CONFIG_ESP32S3_REV_MAX_FULL_STR_OPT=y -CONFIG_ESP32S3_REV_MAX_FULL=99 -CONFIG_ESP_REV_MAX_FULL=99 -# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_80 is not set -# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_160 is not set -CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y -CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=240 - -# -# Cache config -# -CONFIG_ESP32S3_INSTRUCTION_CACHE_16KB=y -# CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB is not set -CONFIG_ESP32S3_INSTRUCTION_CACHE_SIZE=0x4000 -# CONFIG_ESP32S3_INSTRUCTION_CACHE_4WAYS is not set -CONFIG_ESP32S3_INSTRUCTION_CACHE_8WAYS=y -CONFIG_ESP32S3_ICACHE_ASSOCIATED_WAYS=8 -# CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_16B is not set -CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_32B=y -CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_SIZE=32 -# CONFIG_ESP32S3_INSTRUCTION_CACHE_WRAP is not set -# CONFIG_ESP32S3_DATA_CACHE_16KB is not set -CONFIG_ESP32S3_DATA_CACHE_32KB=y -# CONFIG_ESP32S3_DATA_CACHE_64KB is not set -CONFIG_ESP32S3_DATA_CACHE_SIZE=0x8000 -# CONFIG_ESP32S3_DATA_CACHE_4WAYS is not set -CONFIG_ESP32S3_DATA_CACHE_8WAYS=y -CONFIG_ESP32S3_DCACHE_ASSOCIATED_WAYS=8 -# CONFIG_ESP32S3_DATA_CACHE_LINE_16B is not set -CONFIG_ESP32S3_DATA_CACHE_LINE_32B=y -# CONFIG_ESP32S3_DATA_CACHE_LINE_64B is not set -CONFIG_ESP32S3_DATA_CACHE_LINE_SIZE=32 -# CONFIG_ESP32S3_DATA_CACHE_WRAP is not set -# end of Cache config - -# CONFIG_ESP32S3_SPIRAM_SUPPORT is not set -# CONFIG_ESP32S3_TRAX is not set -CONFIG_ESP32S3_TRACEMEM_RESERVE_DRAM=0x0 -# CONFIG_ESP32S3_ULP_COPROC_ENABLED is not set -CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM=0 -CONFIG_ESP32S3_DEBUG_OCDAWARE=y -CONFIG_ESP32S3_BROWNOUT_DET=y -CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_7=y -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_6 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_5 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_4 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_3 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_2 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_1 is not set -CONFIG_ESP32S3_BROWNOUT_DET_LVL=7 -CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC_FRC1=y -# CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC is not set -# CONFIG_ESP32S3_TIME_SYSCALL_USE_FRC1 is not set -# CONFIG_ESP32S3_TIME_SYSCALL_USE_NONE is not set -CONFIG_ESP32S3_RTC_CLK_SRC_INT_RC=y -# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_CRYS is not set -# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_OSC is not set -# CONFIG_ESP32S3_RTC_CLK_SRC_INT_8MD256 is not set -CONFIG_ESP32S3_RTC_CLK_CAL_CYCLES=1024 -CONFIG_ESP32S3_DEEP_SLEEP_WAKEUP_DELAY=2000 -# CONFIG_ESP32S3_RTCDATA_IN_FAST_MEM is not set -# CONFIG_ESP32S3_USE_FIXED_STATIC_RAM_SIZE is not set -# end of ESP32S3-Specific +# ESP32C3-Specific +# +# CONFIG_ESP32C3_DEFAULT_CPU_FREQ_80 is not set +CONFIG_ESP32C3_DEFAULT_CPU_FREQ_160=y +CONFIG_ESP32C3_DEFAULT_CPU_FREQ_MHZ=160 +# CONFIG_ESP32C3_REV_MIN_0 is not set +# CONFIG_ESP32C3_REV_MIN_1 is not set +# CONFIG_ESP32C3_REV_MIN_2 is not set +CONFIG_ESP32C3_REV_MIN_3=y +# CONFIG_ESP32C3_REV_MIN_4 is not set +# CONFIG_ESP32C3_REV_MIN_101 is not set +CONFIG_ESP32C3_REV_MIN=3 +CONFIG_ESP32C3_REV_MIN_FULL=3 +CONFIG_ESP_REV_MIN_FULL=3 +CONFIG_ESP32C3_REV_MAX_FULL_STR_OPT=y +CONFIG_ESP32C3_REV_MAX_FULL=199 +CONFIG_ESP_REV_MAX_FULL=199 +CONFIG_ESP32C3_DEBUG_OCDAWARE=y +CONFIG_ESP32C3_BROWNOUT_DET=y +CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_7=y +# CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_2 is not set +CONFIG_ESP32C3_BROWNOUT_DET_LVL=7 +CONFIG_ESP32C3_TIME_SYSCALL_USE_RTC_SYSTIMER=y +# CONFIG_ESP32C3_TIME_SYSCALL_USE_RTC is not set +# CONFIG_ESP32C3_TIME_SYSCALL_USE_SYSTIMER is not set +# CONFIG_ESP32C3_TIME_SYSCALL_USE_NONE is not set +CONFIG_ESP32C3_RTC_CLK_SRC_INT_RC=y +# CONFIG_ESP32C3_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_ESP32C3_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_ESP32C3_RTC_CLK_SRC_INT_8MD256 is not set +CONFIG_ESP32C3_RTC_CLK_CAL_CYCLES=1024 +# end of ESP32C3-Specific # # ADC-Calibration @@ -727,21 +688,22 @@ CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y -# CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO is not set -CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_FOUR=y -CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES=4 +# CONFIG_ESP32C3_UNIVERSAL_MAC_ADDRESSES_TWO is not set +CONFIG_ESP32C3_UNIVERSAL_MAC_ADDRESSES_FOUR=y +CONFIG_ESP32C3_UNIVERSAL_MAC_ADDRESSES=4 # end of MAC Config # # Sleep Config # CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y -CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y # CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND is not set CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y # end of Sleep Config +CONFIG_ESP_SLEEP_SYSTIMER_STALL_WORKAROUND=y + # # RTC Clock Config # @@ -753,8 +715,6 @@ CONFIG_RTC_CLOCK_BBPLL_POWER_ON_WITH_USB=y # IPC (Inter-Processor Call) # CONFIG_ESP_IPC_TASK_STACK_SIZE=1536 -CONFIG_ESP_IPC_USES_CALLERS_PRIORITY=y -CONFIG_ESP_IPC_ISR_ENABLE=y # end of IPC (Inter-Processor Call) # @@ -769,7 +729,6 @@ CONFIG_ESP_IPC_ISR_ENABLE=y # LCD Peripheral Configuration # CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE=32 -# CONFIG_LCD_RGB_ISR_IRAM_SAFE is not set # end of LCD Peripheral Configuration # end of LCD and Touch Panel @@ -802,7 +761,6 @@ CONFIG_ESP_PHY_CALIBRATION_MODE=0 # # CONFIG_PM_ENABLE is not set CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y -CONFIG_PM_POWER_DOWN_TAGMEM_IN_LIGHT_SLEEP=y # end of Power Management # @@ -820,45 +778,46 @@ CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set # CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set # CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set +CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE=y CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK=y CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=y +# CONFIG_ESP_SYSTEM_USE_EH_FRAME is not set # # Memory protection # +CONFIG_ESP_SYSTEM_MEMPROT_DEPCHECK=y +CONFIG_ESP_SYSTEM_MEMPROT_FEATURE=y +CONFIG_ESP_SYSTEM_MEMPROT_FEATURE_LOCK=y +CONFIG_ESP_SYSTEM_MEMPROT_CPU_PREFETCH_PAD_SIZE=16 +CONFIG_ESP_SYSTEM_MEMPROT_MEM_ALIGN_SIZE=512 # end of Memory protection CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 -CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=3072 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 CONFIG_ESP_MAIN_TASK_STACK_SIZE=3584 CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y -# CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1 is not set # CONFIG_ESP_MAIN_TASK_AFFINITY_NO_AFFINITY is not set CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 CONFIG_ESP_CONSOLE_UART_DEFAULT=y -# CONFIG_ESP_CONSOLE_USB_CDC is not set # CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG is not set # CONFIG_ESP_CONSOLE_UART_CUSTOM is not set # CONFIG_ESP_CONSOLE_NONE is not set # CONFIG_ESP_CONSOLE_SECONDARY_NONE is not set CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y CONFIG_ESP_CONSOLE_UART=y -CONFIG_ESP_CONSOLE_MULTIPLE_UART=y CONFIG_ESP_CONSOLE_UART_NUM=0 CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 CONFIG_ESP_INT_WDT=y CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 -CONFIG_ESP_INT_WDT_CHECK_CPU1=y CONFIG_ESP_TASK_WDT=y # CONFIG_ESP_TASK_WDT_PANIC is not set CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y -CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y # CONFIG_ESP_PANIC_HANDLER_IRAM is not set # CONFIG_ESP_DEBUG_STUBS_ENABLE is not set CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y -CONFIG_ESP_SYSTEM_BBPLL_RECALIB=y # end of ESP System Settings # @@ -879,7 +838,7 @@ CONFIG_ESP_TIMER_IMPL_SYSTIMER=y CONFIG_ESP32_WIFI_ENABLED=y CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE=y CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=4 -CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8 +CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=16 # CONFIG_ESP32_WIFI_STATIC_TX_BUFFER is not set CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 @@ -894,8 +853,6 @@ CONFIG_ESP32_WIFI_TX_BA_WIN=6 CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y CONFIG_ESP32_WIFI_RX_BA_WIN=6 CONFIG_ESP32_WIFI_NVS_ENABLED=y -CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y -# CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 CONFIG_ESP32_WIFI_IRAM_OPT=y @@ -971,10 +928,7 @@ CONFIG_FMB_SERIAL_BUF_SIZE=256 CONFIG_FMB_SERIAL_ASCII_BITS_PER_SYMB=8 CONFIG_FMB_SERIAL_ASCII_TIMEOUT_RESPOND_MS=1000 CONFIG_FMB_PORT_TASK_PRIO=10 -# CONFIG_FMB_PORT_TASK_AFFINITY_NO_AFFINITY is not set -CONFIG_FMB_PORT_TASK_AFFINITY_CPU0=y -# CONFIG_FMB_PORT_TASK_AFFINITY_CPU1 is not set -CONFIG_FMB_PORT_TASK_AFFINITY=0x0 +CONFIG_FMB_PORT_TASK_AFFINITY=0x7FFFFFFF CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT=y CONFIG_FMB_CONTROLLER_SLAVE_ID=0x00112233 CONFIG_FMB_CONTROLLER_NOTIFY_TIMEOUT=20 @@ -988,13 +942,14 @@ CONFIG_FMB_EVENT_QUEUE_TIMEOUT=20 # # FreeRTOS # -# CONFIG_FREERTOS_UNICORE is not set +CONFIG_FREERTOS_UNICORE=y CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF CONFIG_FREERTOS_TICK_SUPPORT_SYSTIMER=y CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL1=y # CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL3 is not set CONFIG_FREERTOS_SYSTICK_USES_SYSTIMER=y -CONFIG_FREERTOS_HZ=1000 +CONFIG_FREERTOS_OPTIMIZED_SCHEDULER=y +CONFIG_FREERTOS_HZ=100 CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION=y # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set @@ -1182,7 +1137,6 @@ CONFIG_LWIP_CHECKSUM_CHECK_ICMP=y CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072 CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y # CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 is not set -# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1 is not set CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF # CONFIG_LWIP_PPP_SUPPORT is not set CONFIG_LWIP_IPV6_MEMP_NUM_ND6_QUEUE=3 @@ -1259,7 +1213,6 @@ CONFIG_MBEDTLS_DYNAMIC_FREE_CA_CERT=y # mbedTLS v2.28.x related # # CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is not set -CONFIG_MBEDTLS_ECDH_LEGACY_CONTEXT=y # CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK is not set # CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION is not set # end of mbedTLS v2.28.x related @@ -1275,8 +1228,8 @@ CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200 # end of Certificate Bundle -CONFIG_MBEDTLS_ECP_RESTARTABLE=y -CONFIG_MBEDTLS_CMAC_C=y +# CONFIG_MBEDTLS_ECP_RESTARTABLE is not set +# CONFIG_MBEDTLS_CMAC_C is not set CONFIG_MBEDTLS_HARDWARE_AES=y CONFIG_MBEDTLS_AES_USE_INTERRUPT=y CONFIG_MBEDTLS_HARDWARE_MPI=y @@ -1370,7 +1323,7 @@ CONFIG_MBEDTLS_ECP_NIST_OPTIM=y # CONFIG_MBEDTLS_CHACHA20_C is not set # CONFIG_MBEDTLS_HKDF_C is not set # CONFIG_MBEDTLS_THREADING_C is not set -# CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI is not set +CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI=y # CONFIG_MBEDTLS_SECURITY_RISKS is not set # end of mbedTLS @@ -1382,7 +1335,6 @@ CONFIG_MDNS_TASK_PRIORITY=1 CONFIG_MDNS_TASK_STACK_SIZE=4096 # CONFIG_MDNS_TASK_AFFINITY_NO_AFFINITY is not set CONFIG_MDNS_TASK_AFFINITY_CPU0=y -# CONFIG_MDNS_TASK_AFFINITY_CPU1 is not set CONFIG_MDNS_TASK_AFFINITY=0x0 CONFIG_MDNS_SERVICE_ADD_TIMEOUT_MS=2000 # CONFIG_MDNS_STRICT_MODE is not set @@ -1445,9 +1397,6 @@ CONFIG_OPENSSL_ASSERT_EXIT=y CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5 CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 CONFIG_PTHREAD_STACK_MIN=768 -CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY=y -# CONFIG_PTHREAD_DEFAULT_CORE_0 is not set -# CONFIG_PTHREAD_DEFAULT_CORE_1 is not set CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" # end of PThreads @@ -1463,12 +1412,7 @@ CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" # # Features here require specific hardware (READ DOCS FIRST!) # -# CONFIG_SPI_FLASH_HPM_ENA is not set -CONFIG_SPI_FLASH_HPM_AUTO=y -# CONFIG_SPI_FLASH_HPM_DIS is not set -CONFIG_SPI_FLASH_HPM_ON=y -CONFIG_SPI_FLASH_HPM_DC_AUTO=y -# CONFIG_SPI_FLASH_HPM_DC_DISABLE is not set +# CONFIG_SPI_FLASH_AUTO_SUSPEND is not set # end of Optional and Experimental Features (READ DOCS FIRST) # end of Main Flash configuration @@ -1502,7 +1446,6 @@ CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP=y CONFIG_SPI_FLASH_SUPPORT_TH_CHIP=y -CONFIG_SPI_FLASH_SUPPORT_MXIC_OPI_CHIP=y # end of Auto-detect flash chips CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y @@ -1556,12 +1499,6 @@ CONFIG_WS_BUFFER_SIZE=1024 # end of Websocket # end of TCP Transport -# -# TinyUSB Stack -# -# CONFIG_TINYUSB is not set -# end of TinyUSB Stack - # # Unity unit testing library # @@ -1574,24 +1511,10 @@ CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y # CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set # end of Unity unit testing library -# -# USB-OTG -# -CONFIG_USB_OTG_SUPPORTED=y -CONFIG_USB_HOST_CONTROL_TRANSFER_MAX_SIZE=256 -CONFIG_USB_HOST_HW_BUFFER_BIAS_BALANCED=y -# CONFIG_USB_HOST_HW_BUFFER_BIAS_IN is not set -# CONFIG_USB_HOST_HW_BUFFER_BIAS_PERIODIC_OUT is not set - # # Root Hub configuration # -CONFIG_USB_HOST_DEBOUNCE_DELAY_MS=250 -CONFIG_USB_HOST_RESET_HOLD_MS=30 -CONFIG_USB_HOST_RESET_RECOVERY_MS=30 -CONFIG_USB_HOST_SET_ADDR_RECOVERY_MS=10 # end of Root Hub configuration -# end of USB-OTG # # Virtual file system @@ -1662,323 +1585,3 @@ CONFIG_LUA_ROOT="/lua" # # CONFIG_LEGACY_INCLUDE_COMMON_HEADERS is not set # end of Compatibility options - -# Deprecated options for backward compatibility -CONFIG_TOOLPREFIX="xtensa-esp32s3-elf-" -CONFIG_LOG_BOOTLOADER_LEVEL_NONE=y -# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_INFO is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set -CONFIG_LOG_BOOTLOADER_LEVEL=0 -# CONFIG_APP_ROLLBACK_ENABLE is not set -# CONFIG_FLASH_ENCRYPTION_ENABLED is not set -# CONFIG_FLASHMODE_QIO is not set -# CONFIG_FLASHMODE_QOUT is not set -CONFIG_FLASHMODE_DIO=y -# CONFIG_FLASHMODE_DOUT is not set -# CONFIG_MONITOR_BAUD_9600B is not set -# CONFIG_MONITOR_BAUD_57600B is not set -CONFIG_MONITOR_BAUD_115200B=y -# CONFIG_MONITOR_BAUD_230400B is not set -# CONFIG_MONITOR_BAUD_921600B is not set -# CONFIG_MONITOR_BAUD_2MB is not set -# CONFIG_MONITOR_BAUD_OTHER is not set -CONFIG_MONITOR_BAUD_OTHER_VAL=115200 -CONFIG_MONITOR_BAUD=115200 -CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG=y -# CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set -CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y -# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set -# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set -CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2 -# CONFIG_CXX_EXCEPTIONS is not set -CONFIG_STACK_CHECK_NONE=y -# CONFIG_STACK_CHECK_NORM is not set -# CONFIG_STACK_CHECK_STRONG is not set -# CONFIG_STACK_CHECK_ALL is not set -# CONFIG_WARN_WRITE_STRINGS is not set -# CONFIG_DISABLE_GCC8_WARNINGS is not set -# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set -CONFIG_ESP32_APPTRACE_DEST_NONE=y -CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y -CONFIG_BLUEDROID_ENABLED=y -# CONFIG_NIMBLE_ENABLED is not set -CONFIG_BTC_TASK_STACK_SIZE=3072 -CONFIG_BLUEDROID_PINNED_TO_CORE_0=y -# CONFIG_BLUEDROID_PINNED_TO_CORE_1 is not set -CONFIG_BLUEDROID_PINNED_TO_CORE=0 -CONFIG_BTU_TASK_STACK_SIZE=4096 -# CONFIG_BLUEDROID_MEM_DEBUG is not set -CONFIG_GATTS_ENABLE=y -# CONFIG_GATTS_SEND_SERVICE_CHANGE_MANUAL is not set -CONFIG_GATTS_SEND_SERVICE_CHANGE_AUTO=y -CONFIG_GATTS_SEND_SERVICE_CHANGE_MODE=0 -CONFIG_GATTC_ENABLE=y -# CONFIG_GATTC_CACHE_NVS_FLASH is not set -CONFIG_BLE_SMP_ENABLE=y -# CONFIG_SMP_SLAVE_CON_PARAMS_UPD_ENABLE is not set -# CONFIG_HCI_TRACE_LEVEL_NONE is not set -# CONFIG_HCI_TRACE_LEVEL_ERROR is not set -CONFIG_HCI_TRACE_LEVEL_WARNING=y -# CONFIG_HCI_TRACE_LEVEL_API is not set -# CONFIG_HCI_TRACE_LEVEL_EVENT is not set -# CONFIG_HCI_TRACE_LEVEL_DEBUG is not set -# CONFIG_HCI_TRACE_LEVEL_VERBOSE is not set -CONFIG_HCI_INITIAL_TRACE_LEVEL=2 -# CONFIG_BTM_TRACE_LEVEL_NONE is not set -# CONFIG_BTM_TRACE_LEVEL_ERROR is not set -CONFIG_BTM_TRACE_LEVEL_WARNING=y -# CONFIG_BTM_TRACE_LEVEL_API is not set -# CONFIG_BTM_TRACE_LEVEL_EVENT is not set -# CONFIG_BTM_TRACE_LEVEL_DEBUG is not set -# CONFIG_BTM_TRACE_LEVEL_VERBOSE is not set -CONFIG_BTM_INITIAL_TRACE_LEVEL=2 -# CONFIG_L2CAP_TRACE_LEVEL_NONE is not set -# CONFIG_L2CAP_TRACE_LEVEL_ERROR is not set -CONFIG_L2CAP_TRACE_LEVEL_WARNING=y -# CONFIG_L2CAP_TRACE_LEVEL_API is not set -# CONFIG_L2CAP_TRACE_LEVEL_EVENT is not set -# CONFIG_L2CAP_TRACE_LEVEL_DEBUG is not set -# CONFIG_L2CAP_TRACE_LEVEL_VERBOSE is not set -CONFIG_L2CAP_INITIAL_TRACE_LEVEL=2 -# CONFIG_RFCOMM_TRACE_LEVEL_NONE is not set -# CONFIG_RFCOMM_TRACE_LEVEL_ERROR is not set -CONFIG_RFCOMM_TRACE_LEVEL_WARNING=y -# CONFIG_RFCOMM_TRACE_LEVEL_API is not set -# CONFIG_RFCOMM_TRACE_LEVEL_EVENT is not set -# CONFIG_RFCOMM_TRACE_LEVEL_DEBUG is not set -# CONFIG_RFCOMM_TRACE_LEVEL_VERBOSE is not set -CONFIG_RFCOMM_INITIAL_TRACE_LEVEL=2 -# CONFIG_SDP_TRACE_LEVEL_NONE is not set -# CONFIG_SDP_TRACE_LEVEL_ERROR is not set -CONFIG_SDP_TRACE_LEVEL_WARNING=y -# CONFIG_SDP_TRACE_LEVEL_API is not set -# CONFIG_SDP_TRACE_LEVEL_EVENT is not set -# CONFIG_SDP_TRACE_LEVEL_DEBUG is not set -# CONFIG_SDP_TRACE_LEVEL_VERBOSE is not set -CONFIG_BTH_LOG_SDP_INITIAL_TRACE_LEVEL=2 -# CONFIG_GAP_TRACE_LEVEL_NONE is not set -# CONFIG_GAP_TRACE_LEVEL_ERROR is not set -CONFIG_GAP_TRACE_LEVEL_WARNING=y -# CONFIG_GAP_TRACE_LEVEL_API is not set -# CONFIG_GAP_TRACE_LEVEL_EVENT is not set -# CONFIG_GAP_TRACE_LEVEL_DEBUG is not set -# CONFIG_GAP_TRACE_LEVEL_VERBOSE is not set -CONFIG_GAP_INITIAL_TRACE_LEVEL=2 -CONFIG_BNEP_INITIAL_TRACE_LEVEL=2 -# CONFIG_PAN_TRACE_LEVEL_NONE is not set -# CONFIG_PAN_TRACE_LEVEL_ERROR is not set -CONFIG_PAN_TRACE_LEVEL_WARNING=y -# CONFIG_PAN_TRACE_LEVEL_API is not set -# CONFIG_PAN_TRACE_LEVEL_EVENT is not set -# CONFIG_PAN_TRACE_LEVEL_DEBUG is not set -# CONFIG_PAN_TRACE_LEVEL_VERBOSE is not set -CONFIG_PAN_INITIAL_TRACE_LEVEL=2 -# CONFIG_A2D_TRACE_LEVEL_NONE is not set -# CONFIG_A2D_TRACE_LEVEL_ERROR is not set -CONFIG_A2D_TRACE_LEVEL_WARNING=y -# CONFIG_A2D_TRACE_LEVEL_API is not set -# CONFIG_A2D_TRACE_LEVEL_EVENT is not set -# CONFIG_A2D_TRACE_LEVEL_DEBUG is not set -# CONFIG_A2D_TRACE_LEVEL_VERBOSE is not set -CONFIG_A2D_INITIAL_TRACE_LEVEL=2 -# CONFIG_AVDT_TRACE_LEVEL_NONE is not set -# CONFIG_AVDT_TRACE_LEVEL_ERROR is not set -CONFIG_AVDT_TRACE_LEVEL_WARNING=y -# CONFIG_AVDT_TRACE_LEVEL_API is not set -# CONFIG_AVDT_TRACE_LEVEL_EVENT is not set -# CONFIG_AVDT_TRACE_LEVEL_DEBUG is not set -# CONFIG_AVDT_TRACE_LEVEL_VERBOSE is not set -CONFIG_AVDT_INITIAL_TRACE_LEVEL=2 -# CONFIG_AVCT_TRACE_LEVEL_NONE is not set -# CONFIG_AVCT_TRACE_LEVEL_ERROR is not set -CONFIG_AVCT_TRACE_LEVEL_WARNING=y -# CONFIG_AVCT_TRACE_LEVEL_API is not set -# CONFIG_AVCT_TRACE_LEVEL_EVENT is not set -# CONFIG_AVCT_TRACE_LEVEL_DEBUG is not set -# CONFIG_AVCT_TRACE_LEVEL_VERBOSE is not set -CONFIG_AVCT_INITIAL_TRACE_LEVEL=2 -# CONFIG_AVRC_TRACE_LEVEL_NONE is not set -# CONFIG_AVRC_TRACE_LEVEL_ERROR is not set -CONFIG_AVRC_TRACE_LEVEL_WARNING=y -# CONFIG_AVRC_TRACE_LEVEL_API is not set -# CONFIG_AVRC_TRACE_LEVEL_EVENT is not set -# CONFIG_AVRC_TRACE_LEVEL_DEBUG is not set -# CONFIG_AVRC_TRACE_LEVEL_VERBOSE is not set -CONFIG_AVRC_INITIAL_TRACE_LEVEL=2 -# CONFIG_MCA_TRACE_LEVEL_NONE is not set -# CONFIG_MCA_TRACE_LEVEL_ERROR is not set -CONFIG_MCA_TRACE_LEVEL_WARNING=y -# CONFIG_MCA_TRACE_LEVEL_API is not set -# CONFIG_MCA_TRACE_LEVEL_EVENT is not set -# CONFIG_MCA_TRACE_LEVEL_DEBUG is not set -# CONFIG_MCA_TRACE_LEVEL_VERBOSE is not set -CONFIG_MCA_INITIAL_TRACE_LEVEL=2 -# CONFIG_HID_TRACE_LEVEL_NONE is not set -# CONFIG_HID_TRACE_LEVEL_ERROR is not set -CONFIG_HID_TRACE_LEVEL_WARNING=y -# CONFIG_HID_TRACE_LEVEL_API is not set -# CONFIG_HID_TRACE_LEVEL_EVENT is not set -# CONFIG_HID_TRACE_LEVEL_DEBUG is not set -# CONFIG_HID_TRACE_LEVEL_VERBOSE is not set -CONFIG_HID_INITIAL_TRACE_LEVEL=2 -# CONFIG_APPL_TRACE_LEVEL_NONE is not set -# CONFIG_APPL_TRACE_LEVEL_ERROR is not set -CONFIG_APPL_TRACE_LEVEL_WARNING=y -# CONFIG_APPL_TRACE_LEVEL_API is not set -# CONFIG_APPL_TRACE_LEVEL_EVENT is not set -# CONFIG_APPL_TRACE_LEVEL_DEBUG is not set -# CONFIG_APPL_TRACE_LEVEL_VERBOSE is not set -CONFIG_APPL_INITIAL_TRACE_LEVEL=2 -# CONFIG_GATT_TRACE_LEVEL_NONE is not set -# CONFIG_GATT_TRACE_LEVEL_ERROR is not set -CONFIG_GATT_TRACE_LEVEL_WARNING=y -# CONFIG_GATT_TRACE_LEVEL_API is not set -# CONFIG_GATT_TRACE_LEVEL_EVENT is not set -# CONFIG_GATT_TRACE_LEVEL_DEBUG is not set -# CONFIG_GATT_TRACE_LEVEL_VERBOSE is not set -CONFIG_GATT_INITIAL_TRACE_LEVEL=2 -# CONFIG_SMP_TRACE_LEVEL_NONE is not set -# CONFIG_SMP_TRACE_LEVEL_ERROR is not set -CONFIG_SMP_TRACE_LEVEL_WARNING=y -# CONFIG_SMP_TRACE_LEVEL_API is not set -# CONFIG_SMP_TRACE_LEVEL_EVENT is not set -# CONFIG_SMP_TRACE_LEVEL_DEBUG is not set -# CONFIG_SMP_TRACE_LEVEL_VERBOSE is not set -CONFIG_SMP_INITIAL_TRACE_LEVEL=2 -# CONFIG_BTIF_TRACE_LEVEL_NONE is not set -# CONFIG_BTIF_TRACE_LEVEL_ERROR is not set -CONFIG_BTIF_TRACE_LEVEL_WARNING=y -# CONFIG_BTIF_TRACE_LEVEL_API is not set -# CONFIG_BTIF_TRACE_LEVEL_EVENT is not set -# CONFIG_BTIF_TRACE_LEVEL_DEBUG is not set -# CONFIG_BTIF_TRACE_LEVEL_VERBOSE is not set -CONFIG_BTIF_INITIAL_TRACE_LEVEL=2 -# CONFIG_BTC_TRACE_LEVEL_NONE is not set -# CONFIG_BTC_TRACE_LEVEL_ERROR is not set -CONFIG_BTC_TRACE_LEVEL_WARNING=y -# CONFIG_BTC_TRACE_LEVEL_API is not set -# CONFIG_BTC_TRACE_LEVEL_EVENT is not set -# CONFIG_BTC_TRACE_LEVEL_DEBUG is not set -# CONFIG_BTC_TRACE_LEVEL_VERBOSE is not set -CONFIG_BTC_INITIAL_TRACE_LEVEL=2 -# CONFIG_OSI_TRACE_LEVEL_NONE is not set -# CONFIG_OSI_TRACE_LEVEL_ERROR is not set -CONFIG_OSI_TRACE_LEVEL_WARNING=y -# CONFIG_OSI_TRACE_LEVEL_API is not set -# CONFIG_OSI_TRACE_LEVEL_EVENT is not set -# CONFIG_OSI_TRACE_LEVEL_DEBUG is not set -# CONFIG_OSI_TRACE_LEVEL_VERBOSE is not set -CONFIG_OSI_INITIAL_TRACE_LEVEL=2 -# CONFIG_BLUFI_TRACE_LEVEL_NONE is not set -# CONFIG_BLUFI_TRACE_LEVEL_ERROR is not set -CONFIG_BLUFI_TRACE_LEVEL_WARNING=y -# CONFIG_BLUFI_TRACE_LEVEL_API is not set -# CONFIG_BLUFI_TRACE_LEVEL_EVENT is not set -# CONFIG_BLUFI_TRACE_LEVEL_DEBUG is not set -# CONFIG_BLUFI_TRACE_LEVEL_VERBOSE is not set -CONFIG_BLUFI_INITIAL_TRACE_LEVEL=2 -# CONFIG_BLE_HOST_QUEUE_CONGESTION_CHECK is not set -CONFIG_SMP_ENABLE=y -# CONFIG_BLE_ACTIVE_SCAN_REPORT_ADV_SCAN_RSP_INDIVIDUALLY is not set -CONFIG_BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT=30 -CONFIG_ADC2_DISABLE_DAC=y -# CONFIG_EVENT_LOOP_PROFILING is not set -CONFIG_POST_EVENTS_FROM_ISR=y -CONFIG_POST_EVENTS_FROM_IRAM_ISR=y -CONFIG_ESP_SYSTEM_PD_FLASH=y -CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND=y -CONFIG_IPC_TASK_STACK_SIZE=1536 -CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y -# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set -CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 -CONFIG_ESP32_PHY_MAX_TX_POWER=20 -# CONFIG_ESP32_REDUCE_PHY_TX_POWER is not set -CONFIG_ESP_SYSTEM_PM_POWER_DOWN_CPU=y -# CONFIG_ESP32S2_PANIC_PRINT_HALT is not set -CONFIG_ESP32S2_PANIC_PRINT_REBOOT=y -# CONFIG_ESP32S2_PANIC_SILENT_REBOOT is not set -# CONFIG_ESP32S2_PANIC_GDBSTUB is not set -CONFIG_ESP32S2_ALLOW_RTC_FAST_MEM_AS_HEAP=y -CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 -CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=3072 -CONFIG_MAIN_TASK_STACK_SIZE=3584 -CONFIG_CONSOLE_UART_DEFAULT=y -# CONFIG_CONSOLE_UART_CUSTOM is not set -# CONFIG_ESP_CONSOLE_UART_NONE is not set -CONFIG_CONSOLE_UART=y -CONFIG_CONSOLE_UART_NUM=0 -CONFIG_CONSOLE_UART_BAUDRATE=115200 -CONFIG_INT_WDT=y -CONFIG_INT_WDT_TIMEOUT_MS=300 -CONFIG_INT_WDT_CHECK_CPU1=y -CONFIG_TASK_WDT=y -# CONFIG_TASK_WDT_PANIC is not set -CONFIG_TASK_WDT_TIMEOUT_S=5 -CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y -CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y -# CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set -CONFIG_TIMER_TASK_STACK_SIZE=3584 -CONFIG_SW_COEXIST_ENABLE=y -# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set -# CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set -CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y -CONFIG_MB_MASTER_TIMEOUT_MS_RESPOND=150 -CONFIG_MB_MASTER_DELAY_MS_CONVERT=200 -CONFIG_MB_QUEUE_LENGTH=20 -CONFIG_MB_SERIAL_TASK_STACK_SIZE=4096 -CONFIG_MB_SERIAL_BUF_SIZE=256 -CONFIG_MB_SERIAL_TASK_PRIO=10 -CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT=y -CONFIG_MB_CONTROLLER_SLAVE_ID=0x00112233 -CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT=20 -CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE=20 -CONFIG_MB_CONTROLLER_STACK_SIZE=4096 -CONFIG_MB_EVENT_QUEUE_TIMEOUT=20 -# CONFIG_MB_TIMER_PORT_ENABLED is not set -# CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set -CONFIG_TIMER_TASK_PRIORITY=1 -CONFIG_TIMER_TASK_STACK_DEPTH=2048 -CONFIG_TIMER_QUEUE_LENGTH=10 -# CONFIG_L2_TO_L3_COPY is not set -# CONFIG_USE_ONLY_LWIP_SELECT is not set -CONFIG_ESP_GRATUITOUS_ARP=y -CONFIG_GARP_TMR_INTERVAL=60 -CONFIG_TCPIP_RECVMBOX_SIZE=16 -CONFIG_TCP_MAXRTX=12 -CONFIG_TCP_SYNMAXRTX=12 -CONFIG_TCP_MSS=1440 -CONFIG_TCP_MSL=60000 -CONFIG_TCP_SND_BUF_DEFAULT=5744 -CONFIG_TCP_WND_DEFAULT=5744 -CONFIG_TCP_RECVMBOX_SIZE=6 -CONFIG_TCP_QUEUE_OOSEQ=y -# CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set -CONFIG_TCP_OVERSIZE_MSS=y -# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set -# CONFIG_TCP_OVERSIZE_DISABLE is not set -CONFIG_UDP_RECVMBOX_SIZE=6 -CONFIG_TCPIP_TASK_STACK_SIZE=3072 -CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y -# CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set -# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set -CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF -# CONFIG_PPP_SUPPORT is not set -CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 -CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 -CONFIG_ESP32_PTHREAD_STACK_MIN=768 -CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y -# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set -# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set -CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 -CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" -CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y -# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set -# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set -# CONFIG_USB_ENABLED is not set -CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y -CONFIG_SUPPORT_TERMIOS=y -CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 -# End of deprecated options From aab8bf311e296024d06b39dc91229508994c1fa9 Mon Sep 17 00:00:00 2001 From: Krishna Kumar Sah Date: Tue, 27 Feb 2024 18:35:22 +0545 Subject: [PATCH 24/27] added broadcast service with queue --- .../ezlopi-cloud-items/ezlopi_cloud_items.c | 60 +- .../ezlopi_cloud_registration.c | 16 +- .../ezlopi_cloud_settings.c | 44 +- .../ezlopi_core_device_value_updated.c | 34 +- .../ezlopi_core_ezlopi_broadcast.c | 55 +- .../ezlopi_core_ezlopi_broadcast.h | 13 +- .../ezlopi_core_ezlopi_methods.c | 3 - .../ezlopi-core-reset/ezlopi_core_reset.c | 2 +- .../ezlopi-core-room/ezlopi_core_room.c | 123 ++-- .../ezlopi_core_scenes_status_changed.c | 25 +- .../ezlopi_service_ble_provisioning.c | 1 - .../ezlopi-service-broadcast/CMakeLists.txt | 27 + .../ezlopi_service_broadcast.c | 64 ++ .../ezlopi_service_broadcast.h | 9 + .../ezlopi_service_modes.c | 11 +- .../ezlopi-service-ota/ezlopi_service_ota.c | 18 +- .../ezlopi_service_webprov.c | 12 +- .../ezlopi_service_webprov.h | 11 +- .../ezlopi-service-ws-server/CMakeLists.txt | 2 +- .../ezlopi_service_ws_server.c | 39 +- main/CMakeLists.txt | 1 + main/ezlopi_main.c | 14 +- sdkconfig | 248 ++++--- sdkconfig.old | 697 ++++++++---------- 24 files changed, 838 insertions(+), 691 deletions(-) create mode 100644 ezlopi-services/ezlopi-service-broadcast/CMakeLists.txt create mode 100644 ezlopi-services/ezlopi-service-broadcast/ezlopi_service_broadcast.c create mode 100644 ezlopi-services/ezlopi-service-broadcast/ezlopi_service_broadcast.h diff --git a/ezlopi-cloud/ezlopi-cloud-items/ezlopi_cloud_items.c b/ezlopi-cloud/ezlopi-cloud-items/ezlopi_cloud_items.c index 417d5e2bf..17558bcaa 100644 --- a/ezlopi-cloud/ezlopi-cloud-items/ezlopi_cloud_items.c +++ b/ezlopi-cloud/ezlopi-cloud-items/ezlopi_cloud_items.c @@ -16,9 +16,9 @@ #include "ezlopi_service_webprov.h" -static cJSON *ezlopi_device_create_item_table_from_prop(l_ezlopi_item_t *item_properties) +static cJSON* ezlopi_device_create_item_table_from_prop(l_ezlopi_item_t* item_properties) { - cJSON *cj_item_properties = cJSON_CreateObject(); + cJSON* cj_item_properties = cJSON_CreateObject(); if (cj_item_properties) { char tmp_string[64]; @@ -49,23 +49,23 @@ static cJSON *ezlopi_device_create_item_table_from_prop(l_ezlopi_item_t *item_pr return cj_item_properties; } -void items_list_v3(cJSON *cj_request, cJSON *cj_response) +void items_list_v3(cJSON* cj_request, cJSON* cj_response) { cJSON_AddItemReferenceToObject(cj_response, ezlopi_id_str, cJSON_GetObjectItem(cj_request, ezlopi_id_str)); cJSON_AddItemReferenceToObject(cj_response, ezlopi_method_str, cJSON_GetObjectItem(cj_request, ezlopi_method_str)); - cJSON *cj_result = cJSON_AddObjectToObject(cj_response, ezlopi_result_str); + cJSON* cj_result = cJSON_AddObjectToObject(cj_response, ezlopi_result_str); if (cj_result) { - cJSON *cj_items_array = cJSON_AddArrayToObject(cj_result, ezlopi_items_str); + cJSON* cj_items_array = cJSON_AddArrayToObject(cj_result, ezlopi_items_str); if (cj_items_array) { - cJSON *params = cJSON_GetObjectItem(cj_request, ezlopi_params_str); + cJSON* params = cJSON_GetObjectItem(cj_request, ezlopi_params_str); if (params != NULL) { - cJSON *device_ids_array = cJSON_GetObjectItem(params, ezlopi_device_ids_str); + cJSON* device_ids_array = cJSON_GetObjectItem(params, ezlopi_device_ids_str); if (device_ids_array != NULL) { @@ -73,23 +73,23 @@ void items_list_v3(cJSON *cj_request, cJSON *cj_response) { if (cJSON_GetArraySize(device_ids_array) > 0) { - cJSON *device_id; + cJSON* device_id; cJSON_ArrayForEach(device_id, device_ids_array) { if (cJSON_IsString(device_id)) { - char *device_id_str = device_id->valuestring; + char* device_id_str = device_id->valuestring; uint32_t device_id = strtol(device_id_str, NULL, 16); - l_ezlopi_device_t *curr_device = ezlopi_device_get_head(); + l_ezlopi_device_t* curr_device = ezlopi_device_get_head(); while (curr_device) { if (curr_device->cloud_properties.device_id == device_id) { - l_ezlopi_item_t *curr_item = curr_device->items; + l_ezlopi_item_t* curr_item = curr_device->items; while (curr_item) { - cJSON *cj_item_properties = ezlopi_device_create_item_table_from_prop(curr_item); + cJSON* cj_item_properties = ezlopi_device_create_item_table_from_prop(curr_item); if (cj_item_properties) { if (!cJSON_AddItemToArray(cj_items_array, cj_item_properties)) @@ -111,13 +111,13 @@ void items_list_v3(cJSON *cj_request, cJSON *cj_response) } else { - l_ezlopi_device_t *curr_device = ezlopi_device_get_head(); + l_ezlopi_device_t* curr_device = ezlopi_device_get_head(); while (curr_device) { - l_ezlopi_item_t *curr_item = curr_device->items; + l_ezlopi_item_t* curr_item = curr_device->items; while (curr_item) { - cJSON *cj_item_properties = ezlopi_device_create_item_table_from_prop(curr_item); + cJSON* cj_item_properties = ezlopi_device_create_item_table_from_prop(curr_item); if (cj_item_properties) { @@ -138,25 +138,25 @@ void items_list_v3(cJSON *cj_request, cJSON *cj_response) } } -void items_set_value_v3(cJSON *cj_request, cJSON *cj_response) +void items_set_value_v3(cJSON* cj_request, cJSON* cj_response) { cJSON_AddItemReferenceToObject(cj_response, ezlopi_id_str, cJSON_GetObjectItem(cj_request, ezlopi_id_str)); cJSON_AddItemReferenceToObject(cj_response, ezlopi_method_str, cJSON_GetObjectItem(cj_request, ezlopi_method_str)); cJSON_AddObjectToObject(cj_response, ezlopi_result_str); - cJSON *cj_params = cJSON_GetObjectItem(cj_request, ezlopi_params_str); + cJSON* cj_params = cJSON_GetObjectItem(cj_request, ezlopi_params_str); if (cj_params) { - char *item_id_str = 0; + char* item_id_str = 0; CJSON_GET_VALUE_STRING(cj_params, ezlopi__id_str, item_id_str); int item_id = strtol(item_id_str, NULL, 16); TRACE_S("item_id: %X", item_id); - l_ezlopi_device_t *curr_device = ezlopi_device_get_head(); + l_ezlopi_device_t* curr_device = ezlopi_device_get_head(); uint32_t found_item = 0; while (curr_device) { - l_ezlopi_item_t *curr_item = curr_device->items; + l_ezlopi_item_t* curr_item = curr_device->items; while (curr_item) { if (item_id == curr_item->cloud_properties.item_id) @@ -176,26 +176,26 @@ void items_set_value_v3(cJSON *cj_request, cJSON *cj_response) } } -void items_update_v3(cJSON *cj_request, cJSON *cj_response) +void items_update_v3(cJSON* cj_request, cJSON* cj_response) { - cJSON *cjson_params = cJSON_GetObjectItem(cj_request, ezlopi_params_str); + cJSON* cjson_params = cJSON_GetObjectItem(cj_request, ezlopi_params_str); if (cjson_params) { - char *item_id_str = NULL; + char* item_id_str = NULL; CJSON_GET_VALUE_STRING(cjson_params, ezlopi__id_str, item_id_str); int item_id = strtol(item_id_str, NULL, 16); - l_ezlopi_device_t *curr_device = ezlopi_device_get_head(); + l_ezlopi_device_t* curr_device = ezlopi_device_get_head(); while (curr_device) { - l_ezlopi_item_t *curr_item = curr_device->items; + l_ezlopi_item_t* curr_item = curr_device->items; while (curr_item) { if (item_id == curr_item->cloud_properties.item_id) { cJSON_AddStringToObject(cj_response, ezlopi_id_str, ezlopi_ui_broadcast_str); cJSON_AddStringToObject(cj_response, ezlopi_msg_subclass_str, method_hub_item_updated); - cJSON *cj_result = cJSON_AddObjectToObject(cj_response, ezlopi_result_str); + cJSON* cj_result = cJSON_AddObjectToObject(cj_response, ezlopi_result_str); if (cj_result) { char tmp_string[64]; @@ -229,18 +229,18 @@ void items_update_v3(cJSON *cj_request, cJSON *cj_response) } } -cJSON *ezlopi_cloud_items_updated_from_devices_v3(l_ezlopi_device_t *device, l_ezlopi_item_t *item) +cJSON* ezlopi_cloud_items_updated_from_devices_v3(l_ezlopi_device_t* device, l_ezlopi_item_t* item) { - cJSON *cjson_response = cJSON_CreateObject(); + cJSON* cjson_response = cJSON_CreateObject(); if (cjson_response) { if (NULL != item) { cJSON_AddStringToObject(cjson_response, ezlopi_msg_subclass_str, method_hub_item_updated); - cJSON_AddNumberToObject(cjson_response, ezlopi_msg_id_str, web_provisioning_get_message_count()); + cJSON_AddNumberToObject(cjson_response, ezlopi_msg_id_str, ezlopi_service_web_provisioning_get_message_count()); cJSON_AddStringToObject(cjson_response, ezlopi_id_str, ezlopi_ui_broadcast_str); - cJSON *cj_result = cJSON_AddObjectToObject(cjson_response, ezlopi_result_str); + cJSON* cj_result = cJSON_AddObjectToObject(cjson_response, ezlopi_result_str); if (cj_result) { char tmp_string[64]; diff --git a/ezlopi-cloud/ezlopi-cloud-registration/ezlopi_cloud_registration.c b/ezlopi-cloud/ezlopi-cloud-registration/ezlopi_cloud_registration.c index df94709dc..30be7e399 100644 --- a/ezlopi-cloud/ezlopi-cloud-registration/ezlopi_cloud_registration.c +++ b/ezlopi-cloud/ezlopi-cloud-registration/ezlopi_cloud_registration.c @@ -12,19 +12,19 @@ #include "ezlopi_core_websocket_client.h" #include "ezlopi_core_event_group.h" -static void registration_process(void *pv); +static void registration_process(void* pv); void registration_init(void) { xTaskCreate(registration_process, "registration_process", 2 * 2048, NULL, 2, NULL); } -void register_repeat(cJSON *cj_request, cJSON *cj_response) +void register_repeat(cJSON* cj_request, cJSON* cj_response) { registration_init(); } -void registered(cJSON *cj_request, cJSON *cj_response) +void registered(cJSON* cj_request, cJSON* cj_response) { cJSON_AddItemReferenceToObject(cj_response, ezlopi_id_str, cJSON_GetObjectItem(cj_request, ezlopi_id_str)); cJSON_AddItemReferenceToObject(cj_response, ezlopi_method_str, cJSON_GetObjectItem(cj_request, ezlopi_method_str)); @@ -32,9 +32,9 @@ void registered(cJSON *cj_request, cJSON *cj_response) ezlopi_event_group_set_event(EZLOPI_EVENT_NMA_REG); } -static void registration_process(void *pv) +static void registration_process(void* pv) { - cJSON *cj_register = cJSON_CreateObject(); + cJSON* cj_register = cJSON_CreateObject(); if (cj_register) { char mac_str[18]; @@ -42,12 +42,12 @@ static void registration_process(void *pv) esp_read_mac(mac_addr, ESP_MAC_WIFI_STA); snprintf(mac_str, sizeof(mac_str), "%02X:%02X:%02X:%02X:%02X:%02X", - mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]); + mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]); cJSON_AddStringToObject(cj_register, "id", "__ID__"); cJSON_AddStringToObject(cj_register, ezlopi_method_str, "register"); - cJSON *cj_params = cJSON_AddObjectToObject(cj_register, ezlopi_params_str); + cJSON* cj_params = cJSON_AddObjectToObject(cj_register, ezlopi_params_str); if (cj_params) { @@ -66,7 +66,7 @@ static void registration_process(void *pv) while (ezlopi_event_group_wait_for_event(EZLOPI_EVENT_NMA_REG, 2000, false) <= 0) { - web_provisioning_send_to_nma_websocket(cj_register, TRACE_TYPE_B); + ezlopi_service_web_provisioning_send_to_nma_websocket(cj_register, TRACE_TYPE_B); } cJSON_Delete(cj_register); diff --git a/ezlopi-cloud/ezlopi-cloud-settings/ezlopi_cloud_settings.c b/ezlopi-cloud/ezlopi-cloud-settings/ezlopi_cloud_settings.c index 5e825f680..d07bdd6a8 100644 --- a/ezlopi-cloud/ezlopi-cloud-settings/ezlopi_cloud_settings.c +++ b/ezlopi-cloud/ezlopi-cloud-settings/ezlopi_cloud_settings.c @@ -11,24 +11,24 @@ #include "ezlopi_service_webprov.h" -void ezlopi_device_settings_list_v3(cJSON *cj_request, cJSON *cj_response) +void ezlopi_device_settings_list_v3(cJSON* cj_request, cJSON* cj_response) { cJSON_AddItemReferenceToObject(cj_response, ezlopi_id_str, cJSON_GetObjectItem(cj_request, ezlopi_id_str)); cJSON_AddItemReferenceToObject(cj_response, ezlopi_method_str, cJSON_GetObjectItem(cj_request, ezlopi_method_str)); - cJSON *cj_result = cJSON_AddObjectToObject(cj_response, ezlopi_result_str); + cJSON* cj_result = cJSON_AddObjectToObject(cj_response, ezlopi_result_str); if (cj_result) { - cJSON *cj_settings_array = cJSON_AddArrayToObject(cj_result, ezlopi_settings_str); + cJSON* cj_settings_array = cJSON_AddArrayToObject(cj_result, ezlopi_settings_str); if (cj_settings_array) { - l_ezlopi_device_t *curr_device = ezlopi_device_get_head(); + l_ezlopi_device_t* curr_device = ezlopi_device_get_head(); while (curr_device) { - l_ezlopi_device_settings_v3_t *curr_setting = curr_device->settings; + l_ezlopi_device_settings_v3_t* curr_setting = curr_device->settings; while (curr_setting) { - cJSON *cj_properties = cJSON_CreateObject(); + cJSON* cj_properties = cJSON_CreateObject(); if (cj_properties) { char tmp_string[64]; @@ -50,24 +50,24 @@ void ezlopi_device_settings_list_v3(cJSON *cj_request, cJSON *cj_response) } } } -void ezlopi_device_settings_value_set_v3(cJSON *cj_request, cJSON *cj_response) +void ezlopi_device_settings_value_set_v3(cJSON* cj_request, cJSON* cj_response) { cJSON_AddItemReferenceToObject(cj_response, ezlopi_id_str, cJSON_GetObjectItem(cj_request, ezlopi_id_str)); cJSON_AddItemReferenceToObject(cj_response, ezlopi_method_str, cJSON_GetObjectItem(cj_request, ezlopi_method_str)); cJSON_AddObjectToObject(cj_response, ezlopi_result_str); - cJSON *cj_params = cJSON_GetObjectItem(cj_request, ezlopi_params_str); + cJSON* cj_params = cJSON_GetObjectItem(cj_request, ezlopi_params_str); if (cj_params) { - char *setting_id_str = 0; + char* setting_id_str = 0; CJSON_GET_VALUE_STRING(cj_params, ezlopi__id_str, setting_id_str); uint32_t setting_id = strtoul(setting_id_str, NULL, 16); - l_ezlopi_device_t *curr_device = ezlopi_device_get_head(); + l_ezlopi_device_t* curr_device = ezlopi_device_get_head(); uint32_t found_setting = 0; while (curr_device) { - l_ezlopi_device_settings_v3_t *curr_setting = curr_device->settings; + l_ezlopi_device_settings_v3_t* curr_setting = curr_device->settings; while (curr_setting) { if (setting_id == curr_setting->cloud_properties.setting_id) @@ -86,28 +86,28 @@ void ezlopi_device_settings_value_set_v3(cJSON *cj_request, cJSON *cj_response) } } } -void ezlopi_device_settings_reset_v3(cJSON *cj_request, cJSON *cj_response) +void ezlopi_device_settings_reset_v3(cJSON* cj_request, cJSON* cj_response) { cJSON_AddItemReferenceToObject(cj_response, ezlopi_id_str, cJSON_GetObjectItem(cj_request, ezlopi_id_str)); cJSON_AddItemReferenceToObject(cj_response, ezlopi_method_str, cJSON_GetObjectItem(cj_request, ezlopi_method_str)); cJSON_AddObjectToObject(cj_response, ezlopi_result_str); - cJSON *cj_params = cJSON_GetObjectItem(cj_request, ezlopi_params_str); + cJSON* cj_params = cJSON_GetObjectItem(cj_request, ezlopi_params_str); if (cj_params) { - l_ezlopi_device_t *curr_device = ezlopi_device_get_head(); + l_ezlopi_device_t* curr_device = ezlopi_device_get_head(); while (curr_device) { if (cJSON_HasObjectItem(cj_params, ezlopi_deviceId_str)) { - char *device_id_str = 0; + char* device_id_str = 0; CJSON_GET_VALUE_STRING(cj_params, ezlopi_deviceId_str, device_id_str); int device_id = strtol(device_id_str, NULL, 16); TRACE_E("device_id: %X", device_id); if (device_id == curr_device->cloud_properties.device_id) { - l_ezlopi_device_settings_v3_t *curr_setting = curr_device->settings; + l_ezlopi_device_settings_v3_t* curr_setting = curr_device->settings; while (curr_setting) { curr_setting->func(EZLOPI_SETTINGS_ACTION_RESET_SETTING, curr_setting, cj_params, curr_setting->user_arg); @@ -118,11 +118,11 @@ void ezlopi_device_settings_reset_v3(cJSON *cj_request, cJSON *cj_response) else if (cJSON_HasObjectItem(cj_params, ezlopi__id_str)) { - char *setting_id_str = 0; + char* setting_id_str = 0; CJSON_GET_VALUE_STRING(cj_params, ezlopi__id_str, setting_id_str); uint32_t setting_id = strtol(setting_id_str, NULL, 16); TRACE_E("setting_id: %X", setting_id); - l_ezlopi_device_settings_v3_t *curr_setting = curr_device->settings; + l_ezlopi_device_settings_v3_t* curr_setting = curr_device->settings; while (curr_setting) { if (setting_id == curr_setting->cloud_properties.setting_id) @@ -141,18 +141,18 @@ void ezlopi_device_settings_reset_v3(cJSON *cj_request, cJSON *cj_response) } } -cJSON *ezlopi_cloud_settings_updated_from_devices_v3(l_ezlopi_device_t *device, l_ezlopi_device_settings_v3_t *setting) +cJSON* ezlopi_cloud_settings_updated_from_devices_v3(l_ezlopi_device_t* device, l_ezlopi_device_settings_v3_t* setting) { - cJSON *cjson_response = cJSON_CreateObject(); + cJSON* cjson_response = cJSON_CreateObject(); if (cjson_response) { if (NULL != setting) { cJSON_AddStringToObject(cjson_response, ezlopi_msg_subclass_str, method_hub_device_setting_updated); - cJSON_AddNumberToObject(cjson_response, ezlopi_msg_id_str, web_provisioning_get_message_count()); + cJSON_AddNumberToObject(cjson_response, ezlopi_msg_id_str, ezlopi_service_web_provisioning_get_message_count()); cJSON_AddStringToObject(cjson_response, ezlopi_id_str, ezlopi_ui_broadcast_str); - cJSON *cj_result = cJSON_AddObjectToObject(cjson_response, ezlopi_result_str); + cJSON* cj_result = cJSON_AddObjectToObject(cjson_response, ezlopi_result_str); if (cj_result) { char tmp_string[64]; diff --git a/ezlopi-core/ezlopi-core-devices/ezlopi_core_device_value_updated.c b/ezlopi-core/ezlopi-core-devices/ezlopi_core_device_value_updated.c index fa222d3d5..2087c23cc 100644 --- a/ezlopi-core/ezlopi-core-devices/ezlopi_core_device_value_updated.c +++ b/ezlopi-core/ezlopi-core-devices/ezlopi_core_device_value_updated.c @@ -32,9 +32,10 @@ int ezlopi_device_value_updated_from_device_v3(l_ezlopi_item_t* item) if (data_to_send) { cJSON_Minify(data_to_send); - ret = web_provisioning_send_str_data_to_nma_websocket(data_to_send, TRACE_TYPE_D); - ezlopi_core_ezlopi_broadcast_execute(data_to_send); - free(data_to_send); + ret = ezlopi_service_web_provisioning_send_str_data_to_nma_websocket(data_to_send, TRACE_TYPE_D); + if (0 == ezlopi_core_ezlopi_broadcast_methods_send_to_queue(data_to_send)) { + free(data_to_send); + } } } @@ -74,9 +75,11 @@ int ezlopi_device_value_updated_from_device_item_id_v3(uint32_t item_id) if (data_to_send) { cJSON_Minify(data_to_send); - ret = web_provisioning_send_str_data_to_nma_websocket(data_to_send, TRACE_TYPE_D); - ezlopi_core_ezlopi_broadcast_execute(data_to_send); - free(data_to_send); + ret = ezlopi_service_web_provisioning_send_str_data_to_nma_websocket(data_to_send, TRACE_TYPE_D); + if (0 == ezlopi_core_ezlopi_broadcast_methods_send_to_queue(data_to_send)) + { + free(data_to_send); + } } } @@ -115,9 +118,11 @@ int ezlopi_setting_value_updated_from_device_v3(l_ezlopi_device_settings_v3_t* s if (data_to_send) { cJSON_Minify(data_to_send); - ret = web_provisioning_send_str_data_to_nma_websocket(data_to_send, TRACE_TYPE_D); - ezlopi_core_ezlopi_broadcast_execute(data_to_send); - free(data_to_send); + ret = ezlopi_service_web_provisioning_send_str_data_to_nma_websocket(data_to_send, TRACE_TYPE_D); + if (0 == ezlopi_core_ezlopi_broadcast_methods_send_to_queue(data_to_send)) + { + free(data_to_send); + } } } break; @@ -154,9 +159,10 @@ int ezlopi_setting_value_updated_from_device_settings_id_v3(uint32_t setting_id) if (data_to_send) { cJSON_Minify(data_to_send); - ret = web_provisioning_send_str_data_to_nma_websocket(data_to_send, TRACE_TYPE_D); - ezlopi_core_ezlopi_broadcast_execute(data_to_send); - free(data_to_send); + ret = ezlopi_service_web_provisioning_send_str_data_to_nma_websocket(data_to_send, TRACE_TYPE_D); + if (0 == ezlopi_core_ezlopi_broadcast_methods_send_to_queue(data_to_send)) { + free(data_to_send); + } } } break; @@ -180,7 +186,7 @@ int ezlopi_network_update_wifi_scan_process(cJSON* network_array) { cJSON_AddStringToObject(cjson_response, ezlopi_id_str, ezlopi_ui_broadcast_str); cJSON_AddStringToObject(cjson_response, ezlopi_msg_subclass_str, method_hub_network_wifi_scan_progress); - cJSON_AddNumberToObject(cjson_response, ezlopi_msg_id_str, web_provisioning_get_message_count()); + cJSON_AddNumberToObject(cjson_response, ezlopi_msg_id_str, ezlopi_service_web_provisioning_get_message_count()); cJSON* result = cJSON_AddObjectToObject(cjson_response, "result"); if (result) { @@ -191,7 +197,7 @@ int ezlopi_network_update_wifi_scan_process(cJSON* network_array) if (data_to_send) { cJSON_Minify(data_to_send); - ret = web_provisioning_send_str_data_to_nma_websocket(data_to_send, TRACE_TYPE_D); + ret = ezlopi_service_web_provisioning_send_str_data_to_nma_websocket(data_to_send, TRACE_TYPE_D); } else { diff --git a/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_broadcast.c b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_broadcast.c index a94d47228..fe8454fd1 100644 --- a/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_broadcast.c +++ b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_broadcast.c @@ -1,15 +1,36 @@ #include "ezlopi_util_trace.h" #include "ezlopi_core_ezlopi_broadcast.h" -static l_broadcast_method_t *method_head = NULL; +static l_broadcast_method_t* __method_head = NULL; +static int (*__broadcast_queue_func)(char*) = NULL; -static l_broadcast_method_t *__method_create(f_broadcast_method_t method, uint32_t retries); +static l_broadcast_method_t* __method_create(f_broadcast_method_t method, uint32_t retries); -void ezlopi_core_ezlopi_broadcast_execute(char *data) +void ezlopi_core_ezlopi_broadcast_methods_set_queue(int(*func)(char*)) +{ + __broadcast_queue_func = func; +} + +int ezlopi_core_ezlopi_broadcast_methods_send_to_queue(char* data) +{ + int ret = 0; + if (__broadcast_queue_func) + { + ret = __broadcast_queue_func(data); + } + return ret; +} + +l_broadcast_method_t* ezlopi_core_ezlopi_broadcast_methods_get_head(void) +{ + return __method_head; +} + +void ezlopi_core_ezlopi_broadcast_execute(char* data) { if (data) { - l_broadcast_method_t *curr_node = method_head; + l_broadcast_method_t* curr_node = __method_head; while (curr_node) { @@ -32,17 +53,17 @@ void ezlopi_core_ezlopi_broadcast_execute(char *data) } } -l_broadcast_method_t *ezlopi_core_ezlopi_broadcast_method_add(f_broadcast_method_t broadcast_method, uint32_t retries) +l_broadcast_method_t* ezlopi_core_ezlopi_broadcast_method_add(f_broadcast_method_t broadcast_method, uint32_t retries) { - l_broadcast_method_t *ret = __method_create(broadcast_method, retries); + l_broadcast_method_t* ret = __method_create(broadcast_method, retries); if (ret) { TRACE_D("registering broadcast method ..."); - if (method_head) + if (__method_head) { - l_broadcast_method_t *curr_node = method_head; + l_broadcast_method_t* curr_node = __method_head; while (curr_node->next) { @@ -55,7 +76,7 @@ l_broadcast_method_t *ezlopi_core_ezlopi_broadcast_method_add(f_broadcast_method else { TRACE_D("registered ..."); - method_head = ret; + __method_head = ret; } } else @@ -68,22 +89,22 @@ l_broadcast_method_t *ezlopi_core_ezlopi_broadcast_method_add(f_broadcast_method void ezlopi_core_ezlopi_broadcast_remove_method(f_broadcast_method_t broadcast_method) { - if (method_head) + if (__method_head) { - if (broadcast_method == method_head->func) + if (broadcast_method == __method_head->func) { - l_broadcast_method_t *remove_node = method_head; - method_head = method_head->next; + l_broadcast_method_t* remove_node = __method_head; + __method_head = __method_head->next; free(remove_node); } else { - l_broadcast_method_t *curr_node = method_head; + l_broadcast_method_t* curr_node = __method_head; while (curr_node->next) { if (curr_node->next->func == broadcast_method) { - l_broadcast_method_t *remove_node = curr_node->next; + l_broadcast_method_t* remove_node = curr_node->next; curr_node->next = curr_node->next->next; free(remove_node); @@ -96,9 +117,9 @@ void ezlopi_core_ezlopi_broadcast_remove_method(f_broadcast_method_t broadcast_m } } -static l_broadcast_method_t *__method_create(f_broadcast_method_t method, uint32_t retries) +static l_broadcast_method_t* __method_create(f_broadcast_method_t method, uint32_t retries) { - l_broadcast_method_t *method_node = NULL; + l_broadcast_method_t* method_node = NULL; if (method) { diff --git a/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_broadcast.h b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_broadcast.h index cb1bac77e..0f472a799 100644 --- a/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_broadcast.h +++ b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_broadcast.h @@ -6,19 +6,22 @@ #include #include -typedef int (*f_broadcast_method_t)(char *data); +typedef int (*f_broadcast_method_t)(char* data); typedef struct l_broadcast_method { - char *method_name; + char* method_name; uint32_t fail_retry; f_broadcast_method_t func; - struct l_broadcast_method *next; + struct l_broadcast_method* next; } l_broadcast_method_t; -void ezlopi_core_ezlopi_broadcast_execute(char *data); +void ezlopi_core_ezlopi_broadcast_execute(char* data); +int ezlopi_core_ezlopi_broadcast_methods_send_to_queue(char* data); +void ezlopi_core_ezlopi_broadcast_methods_set_queue(int(*func)(char*)); +l_broadcast_method_t* ezlopi_core_ezlopi_broadcast_methods_get_head(void); void ezlopi_core_ezlopi_broadcast_remove_method(f_broadcast_method_t broadcast_method); -l_broadcast_method_t *ezlopi_core_ezlopi_broadcast_method_add(f_broadcast_method_t broadcast_method, uint32_t retries); +l_broadcast_method_t* ezlopi_core_ezlopi_broadcast_method_add(f_broadcast_method_t broadcast_method, uint32_t retries); #endif // __EZLOPI_CORE_EZLOPI_BROADCAST_H__ diff --git a/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_methods.c b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_methods.c index b590dfddf..06e50e9cc 100644 --- a/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_methods.c +++ b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_methods.c @@ -94,9 +94,6 @@ bool ezlopi_core_elzlopi_methods_check_method_register(f_method_func_t method) { bool ret = false; - TRACE_D("method: %p", method); - TRACE_D("registered: %p", registered); - if (registered == method) { ret = true; diff --git a/ezlopi-core/ezlopi-core-reset/ezlopi_core_reset.c b/ezlopi-core/ezlopi-core-reset/ezlopi_core_reset.c index be1f4e8b1..bcd8773e4 100644 --- a/ezlopi-core/ezlopi-core-reset/ezlopi_core_reset.c +++ b/ezlopi-core/ezlopi-core-reset/ezlopi_core_reset.c @@ -10,7 +10,7 @@ void EZPI_CORE_reboot(void) { - web_provisioning_deinit(); + ezlopi_service_web_provisioning_deinit(); esp_restart(); } diff --git a/ezlopi-core/ezlopi-core-room/ezlopi_core_room.c b/ezlopi-core/ezlopi-core-room/ezlopi_core_room.c index b05c542b8..677513e4e 100644 --- a/ezlopi-core/ezlopi-core-room/ezlopi_core_room.c +++ b/ezlopi-core/ezlopi-core-room/ezlopi_core_room.c @@ -10,9 +10,9 @@ #include "ezlopi_service_webprov.h" -static s_ezlopi_room_t *l_room_head = NULL; +static s_ezlopi_room_t* l_room_head = NULL; -static const char *sc_room_subtype_name[] = { +static const char* sc_room_subtype_name[] = { #ifndef ROOM_SUBTYPE #define ROOM_SUBTYPE(name, e_num) name, #undef ROOM_SUBTYPE @@ -20,45 +20,45 @@ static const char *sc_room_subtype_name[] = { }; static void __sort_by_pos(void); -static void __free_nodes(s_ezlopi_room_t *room); +static void __free_nodes(s_ezlopi_room_t* room); static int __free_room_from_list_by_id(uint32_t room_id); static void __update_cloud_room_deleted(uint32_t room_id); static int __remove_room_from_nvs_by_id(uint32_t a_room_id); -static e_room_subtype_t __get_subtype_enum(char *subtype_str); +static e_room_subtype_t __get_subtype_enum(char* subtype_str); // static const char *__get_subtype_name(e_room_subtype_t subtype); -s_ezlopi_room_t *ezlopi_room_get_room_head(void) +s_ezlopi_room_t* ezlopi_room_get_room_head(void) { return l_room_head; } -int ezlopi_room_name_set(cJSON *cj_room) +int ezlopi_room_name_set(cJSON* cj_room) { int ret = 0; if (cj_room) { - cJSON *cj_room_id = cJSON_GetObjectItem(cj_room, ezlopi__id_str); - cJSON *cj_room_name = cJSON_GetObjectItem(cj_room, ezlopi_name_str); + cJSON* cj_room_id = cJSON_GetObjectItem(cj_room, ezlopi__id_str); + cJSON* cj_room_name = cJSON_GetObjectItem(cj_room, ezlopi_name_str); if (cj_room_id && cj_room_id->valuestring && cj_room_name && cj_room_name->valuestring) { uint32_t room_id = strtoul(cj_room_id->valuestring, NULL, 16); if (room_id) { - char *rooms_str = ezlopi_nvs_read_rooms(); + char* rooms_str = ezlopi_nvs_read_rooms(); if (rooms_str) { - cJSON *cj_rooms = cJSON_Parse(rooms_str); + cJSON* cj_rooms = cJSON_Parse(rooms_str); free(rooms_str); if (cj_rooms) { int idx = 0; - cJSON *cj_room_tmp = NULL; + cJSON* cj_room_tmp = NULL; while (NULL != (cj_room_tmp = cJSON_GetArrayItem(cj_rooms, idx++))) { - cJSON *cj_room_tmp_id = cJSON_GetObjectItem(cj_room_tmp, ezlopi__id_str); + cJSON* cj_room_tmp_id = cJSON_GetObjectItem(cj_room_tmp, ezlopi__id_str); if (cj_room_tmp_id && cj_room_tmp_id->valuestring) { uint32_t tmp_room_id = strtoul(cj_room_tmp_id->valuestring, NULL, 16); @@ -67,7 +67,7 @@ int ezlopi_room_name_set(cJSON *cj_room) cJSON_DeleteItemFromObject(cj_room_tmp, ezlopi_name_str); ret = cJSON_AddItemReferenceToObject(cj_room_tmp, ezlopi_name_str, cj_room_name); - s_ezlopi_room_t *room_node = l_room_head; + s_ezlopi_room_t* room_node = l_room_head; while (room_node) { if (room_node->_id == room_id) @@ -84,7 +84,7 @@ int ezlopi_room_name_set(cJSON *cj_room) if (ret) { - char *updated_rooms = cJSON_Print(cj_rooms); + char* updated_rooms = cJSON_Print(cj_rooms); if (updated_rooms) { cJSON_Minify(updated_rooms); @@ -103,13 +103,13 @@ int ezlopi_room_name_set(cJSON *cj_room) return ret; } -int ezlopi_room_delete(cJSON *cj_room) +int ezlopi_room_delete(cJSON* cj_room) { int ret = 0; if (cj_room) { CJSON_TRACE("cj_room", cj_room); - cJSON *cj_room_id = cJSON_GetObjectItem(cj_room, ezlopi__id_str); + cJSON* cj_room_id = cJSON_GetObjectItem(cj_room, ezlopi__id_str); if (cj_room_id && cj_room_id->valuestring) { @@ -143,7 +143,7 @@ int ezlopi_room_delete_all(void) return ret; } -int ezlopi_room_add_to_nvs(cJSON *cj_room) +int ezlopi_room_add_to_nvs(cJSON* cj_room) { CJSON_TRACE("cj_room", cj_room); @@ -151,7 +151,7 @@ int ezlopi_room_add_to_nvs(cJSON *cj_room) if (cj_room) { int room_free = 1; - char *rooms_str = ezlopi_nvs_read_rooms(); + char* rooms_str = ezlopi_nvs_read_rooms(); if (NULL == rooms_str) { @@ -159,7 +159,7 @@ int ezlopi_room_add_to_nvs(cJSON *cj_room) room_free = 0; } - cJSON *cj_rooms = cJSON_Parse(rooms_str); + cJSON* cj_rooms = cJSON_Parse(rooms_str); if (room_free) { free(rooms_str); @@ -173,7 +173,7 @@ int ezlopi_room_add_to_nvs(cJSON *cj_room) { CJSON_TRACE("cj_rooms", cj_rooms); - char *updated_rooms_str = cJSON_Print(cj_rooms); + char* updated_rooms_str = cJSON_Print(cj_rooms); if (updated_rooms_str) { cJSON_Minify(updated_rooms_str); @@ -195,7 +195,7 @@ int ezlopi_room_add_to_nvs(cJSON *cj_room) return ret; } -int ezlopi_room_reorder(cJSON *cj_rooms_ids) +int ezlopi_room_reorder(cJSON* cj_rooms_ids) { int ret = 0; @@ -207,25 +207,25 @@ int ezlopi_room_reorder(cJSON *cj_rooms_ids) if (rooms_id_arr_size) { int idx = 0; - cJSON *cj_reordered_rooms = cJSON_CreateArray(); + cJSON* cj_reordered_rooms = cJSON_CreateArray(); if (cj_reordered_rooms) { - cJSON *cj_room_id = NULL; + cJSON* cj_room_id = NULL; while (NULL != (cj_room_id = cJSON_GetArrayItem(cj_rooms_ids, idx))) { uint32_t room_id = strtoul(cj_room_id->valuestring, NULL, 16); if (room_id) { - s_ezlopi_room_t *room_node = l_room_head; + s_ezlopi_room_t* room_node = l_room_head; while (room_node) { if (room_id == room_node->_id) { room_node->_pos = idx; - cJSON *cj_room = cJSON_CreateObject(); + cJSON* cj_room = cJSON_CreateObject(); if (cj_room) { cJSON_AddStringToObject(cj_room, ezlopi__id_str, cj_room_id->valuestring); @@ -249,7 +249,7 @@ int ezlopi_room_reorder(cJSON *cj_rooms_ids) if (cJSON_GetArraySize(cj_reordered_rooms)) { - char *reordered_rooms_str = cJSON_Print(cj_reordered_rooms); + char* reordered_rooms_str = cJSON_Print(cj_reordered_rooms); if (reordered_rooms_str) { cJSON_Minify(reordered_rooms_str); @@ -263,7 +263,7 @@ int ezlopi_room_reorder(cJSON *cj_rooms_ids) #if 0 int idx = 0; - cJSON *cj_room_id = NULL; + cJSON* cj_room_id = NULL; uint32_t rooms_id_arr[rooms_id_arr_size]; while (NULL != (cj_room_id = cJSON_GetArrayItem(cj_rooms_ids, idx))) @@ -271,17 +271,17 @@ int ezlopi_room_reorder(cJSON *cj_rooms_ids) rooms_id_arr[idx] = strtoul(cj_room_id->valuestring, NULL, 16); idx++; } - char *room_list_str = ezlopi_nvs_read_rooms(); + char* room_list_str = ezlopi_nvs_read_rooms(); if (room_list_str) { TRACE_D("old-order list: %s", room_list_str); - cJSON *cj_stored_room_list = cJSON_Parse(room_list_str); + cJSON* cj_stored_room_list = cJSON_Parse(room_list_str); free(room_list_str); if (cj_stored_room_list) { - cJSON *cj_reordered_rooms = cJSON_CreateArray(); + cJSON* cj_reordered_rooms = cJSON_CreateArray(); if (cj_reordered_rooms) { @@ -289,10 +289,10 @@ int ezlopi_room_reorder(cJSON *cj_rooms_ids) while (idx1 < rooms_id_arr_size) { int idx2 = 0; - cJSON *cj_stored_room = NULL; + cJSON* cj_stored_room = NULL; while (NULL != (cj_stored_room = cJSON_GetArrayItem(cj_stored_room_list, idx2))) { - cJSON *cj_stored_room_id = cJSON_GetObjectItem(cj_stored_room, ezlopi__id_str); + cJSON* cj_stored_room_id = cJSON_GetObjectItem(cj_stored_room, ezlopi__id_str); if (cj_stored_room_id && cj_stored_room_id->valuestring) { uint32_t stored_room_id = strtoul(cj_stored_room_id->valuestring, NULL, 16); @@ -309,7 +309,7 @@ int ezlopi_room_reorder(cJSON *cj_rooms_ids) idx1++; } - char *reordered_rooms_str = cJSON_Print(cj_reordered_rooms); + char* reordered_rooms_str = cJSON_Print(cj_reordered_rooms); cJSON_Delete(cj_reordered_rooms); if (reordered_rooms_str) @@ -331,9 +331,9 @@ int ezlopi_room_reorder(cJSON *cj_rooms_ids) return ret; } -s_ezlopi_room_t *ezlopi_room_add_to_list(cJSON *cj_room) +s_ezlopi_room_t* ezlopi_room_add_to_list(cJSON* cj_room) { - s_ezlopi_room_t *new_room = malloc(sizeof(s_ezlopi_room_t)); + s_ezlopi_room_t* new_room = malloc(sizeof(s_ezlopi_room_t)); if (new_room) { memset(new_room, 0, sizeof(s_ezlopi_room_t)); @@ -342,7 +342,7 @@ s_ezlopi_room_t *ezlopi_room_add_to_list(cJSON *cj_room) { CJSON_TRACE("room", cj_room); - cJSON *cj_room_id = cJSON_GetObjectItem(cj_room, ezlopi__id_str); + cJSON* cj_room_id = cJSON_GetObjectItem(cj_room, ezlopi__id_str); if (cj_room_id && cj_room_id->valuestring) { new_room->_id = strtoul(cj_room_id->valuestring, NULL, 16); @@ -356,7 +356,7 @@ s_ezlopi_room_t *ezlopi_room_add_to_list(cJSON *cj_room) cJSON_AddStringToObject(cj_room, ezlopi__id_str, tmp_str); } - cJSON *cj_room_subtype = cJSON_GetObjectItem(cj_room, ezlopi_subtype_str); + cJSON* cj_room_subtype = cJSON_GetObjectItem(cj_room, ezlopi_subtype_str); if (cj_room_subtype && cj_room_subtype->valuestring) { new_room->subtype = __get_subtype_enum(cj_room_subtype->valuestring); @@ -366,7 +366,7 @@ s_ezlopi_room_t *ezlopi_room_add_to_list(cJSON *cj_room) new_room->subtype = ROOM_SUBTYPE_NONE; } - cJSON *cj_room_name = cJSON_GetObjectItem(cj_room, ezlopi_name_str); + cJSON* cj_room_name = cJSON_GetObjectItem(cj_room, ezlopi_name_str); if (cj_room_name && cj_room_name->valuestring) { snprintf(new_room->name, sizeof(new_room->name), "%s", cj_room_name->valuestring); @@ -379,21 +379,21 @@ s_ezlopi_room_t *ezlopi_room_add_to_list(cJSON *cj_room) void ezlopi_room_init(void) { - char *rooms_str = ezlopi_nvs_read_rooms(); + char* rooms_str = ezlopi_nvs_read_rooms(); if (rooms_str) { - cJSON *cj_rooms = cJSON_Parse(rooms_str); + cJSON* cj_rooms = cJSON_Parse(rooms_str); free(rooms_str); if (cj_rooms) { int idx = 0; - cJSON *cj_room = NULL; - s_ezlopi_room_t *curr_room_node = NULL; + cJSON* cj_room = NULL; + s_ezlopi_room_t* curr_room_node = NULL; while (NULL != (cj_room = cJSON_GetArrayItem(cj_rooms, idx))) { - s_ezlopi_room_t *new_room = ezlopi_room_add_to_list(cj_rooms); + s_ezlopi_room_t* new_room = ezlopi_room_add_to_list(cj_rooms); if (new_room) { new_room->_pos = idx; @@ -417,13 +417,13 @@ void ezlopi_room_init(void) static void __update_cloud_room_deleted(uint32_t room_id) { - cJSON *cj_response = cJSON_CreateObject(); + cJSON* cj_response = cJSON_CreateObject(); { cJSON_AddStringToObject(cj_response, ezlopi_id_str, ezlopi_ui_broadcast_str); cJSON_AddStringToObject(cj_response, ezlopi_msg_subclass_str, ezlopi_hub_room_deleted_str); cJSON_AddStringToObject(cj_response, ezlopi_method_str, "hub.room.all.delete"); - cJSON *cj_result = cJSON_AddObjectToObject(cj_response, ezlopi_result_str); + cJSON* cj_result = cJSON_AddObjectToObject(cj_response, ezlopi_result_str); if (cj_result) { char tmp_str[32]; @@ -431,20 +431,21 @@ static void __update_cloud_room_deleted(uint32_t room_id) cJSON_AddStringToObject(cj_result, ezlopi__id_str, tmp_str); } - char *data_str = cJSON_Print(cj_response); + char* data_str = cJSON_Print(cj_response); cJSON_Delete(cj_response); if (data_str) { cJSON_Minify(data_str); - web_provisioning_send_str_data_to_nma_websocket(data_str, TRACE_TYPE_B); - ezlopi_core_ezlopi_broadcast_execute(data_str); - free(data_str); + ezlopi_service_web_provisioning_send_str_data_to_nma_websocket(data_str, TRACE_TYPE_B); + if (0 == ezlopi_core_ezlopi_broadcast_methods_send_to_queue(data_str)) { + free(data_str); + } } } } -static void __free_nodes(s_ezlopi_room_t *room) +static void __free_nodes(s_ezlopi_room_t* room) { if (room) { @@ -457,8 +458,8 @@ static void __free_nodes(s_ezlopi_room_t *room) static void __sort_by_pos(void) { uint32_t size = 0; - s_ezlopi_room_t *room_ptr_arr[32]; - s_ezlopi_room_t *curr_room = l_room_head; + s_ezlopi_room_t* room_ptr_arr[32]; + s_ezlopi_room_t* curr_room = l_room_head; curr_room = l_room_head; memset(room_ptr_arr, 0, sizeof(room_ptr_arr)); @@ -495,7 +496,7 @@ static void __sort_by_pos(void) // return ret; // } -static e_room_subtype_t __get_subtype_enum(char *subtype_str) +static e_room_subtype_t __get_subtype_enum(char* subtype_str) { e_room_subtype_t ret = ROOM_SUBTYPE_NONE; @@ -525,17 +526,17 @@ static int __free_room_from_list_by_id(uint32_t room_id) if (l_room_head->_id == room_id) { ret = 1; - s_ezlopi_room_t *free_node = l_room_head; + s_ezlopi_room_t* free_node = l_room_head; l_room_head = l_room_head->next; free(free_node); } else { - s_ezlopi_room_t *room_node = l_room_head; + s_ezlopi_room_t* room_node = l_room_head; while (room_node->next) { - s_ezlopi_room_t *free_node = room_node->next; + s_ezlopi_room_t* free_node = room_node->next; TRACE_I("free_node->_id == room_id -> %8x == %8x", free_node->_id, room_id); if (free_node->_id == room_id) @@ -557,12 +558,12 @@ static int __free_room_from_list_by_id(uint32_t room_id) static int __remove_room_from_nvs_by_id(uint32_t a_room_id) { int ret = 0; - char *rooms_str = ezlopi_nvs_read_rooms(); + char* rooms_str = ezlopi_nvs_read_rooms(); if (rooms_str) { TRACE_I("rooms_str: %s", rooms_str); - cJSON *cj_rooms = cJSON_Parse(rooms_str); + cJSON* cj_rooms = cJSON_Parse(rooms_str); free(rooms_str); if (cj_rooms) @@ -570,13 +571,13 @@ static int __remove_room_from_nvs_by_id(uint32_t a_room_id) CJSON_TRACE("cj_rooms", cj_rooms); int idx = 0; - cJSON *cj_room_tmp = NULL; + cJSON* cj_room_tmp = NULL; while (NULL != (cj_room_tmp = cJSON_GetArrayItem(cj_rooms, idx))) { CJSON_TRACE("cj_room_tmp", cj_room_tmp); - cJSON *cj_room_tmp_id = cJSON_GetObjectItem(cj_room_tmp, ezlopi__id_str); + cJSON* cj_room_tmp_id = cJSON_GetObjectItem(cj_room_tmp, ezlopi__id_str); if (cj_room_tmp_id && cj_room_tmp_id->valuestring) { CJSON_TRACE("cj_room_tmp_id", cj_room_tmp_id); @@ -597,7 +598,7 @@ static int __remove_room_from_nvs_by_id(uint32_t a_room_id) if (ret) { CJSON_TRACE("cj_rooms", cj_rooms); - char *updated_rooms = cJSON_Print(cj_rooms); + char* updated_rooms = cJSON_Print(cj_rooms); if (updated_rooms) { diff --git a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_status_changed.c b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_status_changed.c index cbfb3e4da..7ce7e10d3 100644 --- a/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_status_changed.c +++ b/ezlopi-core/ezlopi-core-scenes/ezlopi_core_scenes_status_changed.c @@ -5,17 +5,17 @@ #include "ezlopi_service_webprov.h" -int ezlopi_scenes_status_change_broadcast(l_scenes_list_v2_t *scene_node, const char *status_str) +int ezlopi_scenes_status_change_broadcast(l_scenes_list_v2_t* scene_node, const char* status_str) { int ret = 0; if (scene_node) { - cJSON *cj_response = cJSON_CreateObject(); + cJSON* cj_response = cJSON_CreateObject(); if (cj_response) { cJSON_AddStringToObject(cj_response, ezlopi_id_str, ezlopi_ui_broadcast_str); cJSON_AddStringToObject(cj_response, ezlopi_msg_subclass_str, method_hub_scene_run_progress); - cJSON *cj_result = cJSON_AddObjectToObject(cj_response, ezlopi_result_str); + cJSON* cj_result = cJSON_AddObjectToObject(cj_response, ezlopi_result_str); if (cj_result) { char tmp_str[32]; @@ -23,15 +23,15 @@ int ezlopi_scenes_status_change_broadcast(l_scenes_list_v2_t *scene_node, const cJSON_AddStringToObject(cj_result, ezlopi_scene_id_str, tmp_str); cJSON_AddStringToObject(cj_result, ezlopi_scene_name_str, scene_node->name); cJSON_AddStringToObject(cj_result, ezlopi_status_str, status_str ? status_str : scene_status_failed_str); - cJSON *cj_notifications = cJSON_AddArrayToObject(cj_result, ezlopi_notifications_str); + cJSON* cj_notifications = cJSON_AddArrayToObject(cj_result, ezlopi_notifications_str); if (scene_node->user_notifications && cj_notifications) { cJSON_AddTrueToObject(cj_result, ezlopi_userNotification_str); - l_user_notification_v2_t *user_notification_node = scene_node->user_notifications; + l_user_notification_v2_t* user_notification_node = scene_node->user_notifications; while (user_notification_node) { - cJSON *cj_notf = cJSON_CreateString(user_notification_node->user_id); + cJSON* cj_notf = cJSON_CreateString(user_notification_node->user_id); if (!cJSON_AddItemToArray(cj_notifications, cj_notf)) { cJSON_Delete(cj_notf); @@ -49,15 +49,16 @@ int ezlopi_scenes_status_change_broadcast(l_scenes_list_v2_t *scene_node, const cJSON_AddStringToObject(cj_result, ezlopi_room_name_str, ezlopi__str); } - char *data_to_send = cJSON_Print(cj_response); + char* data_to_send = cJSON_Print(cj_response); cJSON_Delete(cj_response); if (data_to_send) { cJSON_Minify(data_to_send); - ret = web_provisioning_send_str_data_to_nma_websocket(data_to_send, TRACE_TYPE_D); - ezlopi_core_ezlopi_broadcast_execute(data_to_send); - free(data_to_send); + ret = ezlopi_service_web_provisioning_send_str_data_to_nma_websocket(data_to_send, TRACE_TYPE_D); + if (0 == ezlopi_core_ezlopi_broadcast_methods_send_to_queue(data_to_send)) { + free(data_to_send); + } } } } @@ -65,9 +66,9 @@ int ezlopi_scenes_status_change_broadcast(l_scenes_list_v2_t *scene_node, const return ret; } -const char *ezlopi_scenes_status_to_string(e_scene_status_v2_t scene_status) +const char* ezlopi_scenes_status_to_string(e_scene_status_v2_t scene_status) { - const char *ret = "NULL"; + const char* ret = "NULL"; switch (scene_status) { case EZLOPI_SCENE_STATUS_RUN: diff --git a/ezlopi-services/ezlopi-service-ble/ezlopi_service_ble_provisioning.c b/ezlopi-services/ezlopi-service-ble/ezlopi_service_ble_provisioning.c index 4ee360778..41b0b8165 100644 --- a/ezlopi-services/ezlopi-service-ble/ezlopi_service_ble_provisioning.c +++ b/ezlopi-services/ezlopi-service-ble/ezlopi_service_ble_provisioning.c @@ -168,7 +168,6 @@ static void __provisioning_info_write_func(esp_gatt_value_t* value, esp_ble_gatt cJSON* root = cJSON_ParseWithLength((const char*)param->write.value, param->write.len); if (root) { - uint32_t len = CJ_GET_NUMBER(ezlopi_len_str); uint32_t tot_len = CJ_GET_NUMBER(ezlopi_total_len_str); uint32_t sequence = CJ_GET_NUMBER(ezlopi_sequence_str); diff --git a/ezlopi-services/ezlopi-service-broadcast/CMakeLists.txt b/ezlopi-services/ezlopi-service-broadcast/CMakeLists.txt new file mode 100644 index 000000000..67579a839 --- /dev/null +++ b/ezlopi-services/ezlopi-service-broadcast/CMakeLists.txt @@ -0,0 +1,27 @@ + +file(GLOB_RECURSE provisioning_src "*.c*") + +set(EZLOPI_UTIL_COMPONENTS + ezlopi-util-trace +) + +set(SDK_COMPONENTS +) + +set(EZLOPI_CORE_COMPONENTS + ezlopi-core-ezlopi +) + +set(EZLOPI_CLOUD_COMPONENTS + +) + + + +idf_component_register(SRCS "${provisioning_src}" + INCLUDE_DIRS "." + REQUIRES ${SDK_COMPONENTS} + ${EZLOPI_CORE_COMPONENTS} + ${EZLOPI_UTIL_COMPONENTS} + ${EZLOPI_CLOUD_COMPONENTS} + ) diff --git a/ezlopi-services/ezlopi-service-broadcast/ezlopi_service_broadcast.c b/ezlopi-services/ezlopi-service-broadcast/ezlopi_service_broadcast.c new file mode 100644 index 000000000..17406102c --- /dev/null +++ b/ezlopi-services/ezlopi-service-broadcast/ezlopi_service_broadcast.c @@ -0,0 +1,64 @@ +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "freertos/queue.h" + +#include "ezlopi_service_broadcast.h" +#include "ezlopi_core_ezlopi_broadcast.h" + +static QueueHandle_t __broadcast_queue = NULL; + +static void __broadcast_process(void* pv); +static int ezlopi_service_broadcast_send_to_queue(char* data); + + +void ezlopi_service_broadcast_init(void) +{ + __broadcast_queue = xQueueCreate(sizeof(char*), 30); + if (__broadcast_queue) + { + xTaskCreate(__broadcast_process, "broadcast-service", 4 * 1024, NULL, 2, NULL); + ezlopi_core_ezlopi_broadcast_methods_set_queue(ezlopi_service_broadcast_send_to_queue); + } +} + +static void __broadcast_process(void* pv) { + while (1) + { + char* data = NULL; + if (pdTRUE == xQueueReceive(__broadcast_queue, &data, portMAX_DELAY)) + { + if (data) + { + vTaskDelay(1000 / portTICK_PERIOD_MS); + ezlopi_core_ezlopi_broadcast_execute(data); + free(data); + } + } + } +} + +static int ezlopi_service_broadcast_send_to_queue(char* data) +{ + int ret = 0; + if (__broadcast_queue && data) + { + if (xQueueIsQueueFullFromISR(__broadcast_queue)) + { + char* tmp_data = NULL; + if (pdTRUE == xQueueReceive(__broadcast_queue, &tmp_data, 0)) + { + if (tmp_data) + { + free(tmp_data); + } + } + } + + char* tmp_data = data; + if (pdTRUE == xQueueSend(__broadcast_queue, &tmp_data, 1000 / portTICK_PERIOD_MS)) + { + ret = 1; + } + } + return ret; +} \ No newline at end of file diff --git a/ezlopi-services/ezlopi-service-broadcast/ezlopi_service_broadcast.h b/ezlopi-services/ezlopi-service-broadcast/ezlopi_service_broadcast.h new file mode 100644 index 000000000..260cf6026 --- /dev/null +++ b/ezlopi-services/ezlopi-service-broadcast/ezlopi_service_broadcast.h @@ -0,0 +1,9 @@ +#ifndef __EZLOPI_SERVICE_BROADCAST_H__ +#define __EZLOPI_SERVICE_BROADCAST_H__ + +#include + +void ezlopi_service_broadcast_init(void); + + +#endif // __EZLOPI_SERVICE_BROADCAST_H__ diff --git a/ezlopi-services/ezlopi-service-modes/ezlopi_service_modes.c b/ezlopi-services/ezlopi-service-modes/ezlopi_service_modes.c index eee581f12..c7fd2f6e8 100644 --- a/ezlopi-services/ezlopi-service-modes/ezlopi_service_modes.c +++ b/ezlopi-services/ezlopi-service-modes/ezlopi_service_modes.c @@ -83,17 +83,18 @@ static void __modes_service(void* pv) ezlopi_core_modes_store_to_nvs(); - cJSON *cj_update = ezlopi_core_modes_cjson_changed(); + cJSON* cj_update = ezlopi_core_modes_cjson_changed(); if (cj_update) { - char *update_str = cJSON_Print(cj_update); + char* update_str = cJSON_Print(cj_update); cJSON_Delete(cj_update); if (update_str) { - web_provisioning_send_str_data_to_nma_websocket(update_str, TRACE_TYPE_I); - ezlopi_core_ezlopi_broadcast_execute(update_str); - free(update_str); + ezlopi_service_web_provisioning_send_str_data_to_nma_websocket(update_str, TRACE_TYPE_I); + if (0 == ezlopi_core_ezlopi_broadcast_methods_send_to_queue(update_str)) { + free(update_str); + } } } } diff --git a/ezlopi-services/ezlopi-service-ota/ezlopi_service_ota.c b/ezlopi-services/ezlopi-service-ota/ezlopi_service_ota.c index 27db9c472..01df87676 100644 --- a/ezlopi-services/ezlopi-service-ota/ezlopi_service_ota.c +++ b/ezlopi-services/ezlopi-service-ota/ezlopi_service_ota.c @@ -15,13 +15,13 @@ #include "ezlopi_service_webprov.h" #include "ezlopi_core_ezlopi_broadcast.h" -static void ota_service_process(void *pv); +static void ota_service_process(void* pv); void ota_service_init(void) { xTaskCreate(ota_service_process, "ota-service-process", 2 * 2048, NULL, 2, NULL); } -static void ota_service_process(void *pv) +static void ota_service_process(void* pv) { ezlopi_wait_for_wifi_to_connect(portMAX_DELAY); ezlopi_event_group_set_event(EZLOPI_EVENT_OTA); @@ -36,20 +36,22 @@ static void ota_service_process(void *pv) if ((-1 != ret_nma_reg) || (-1 != ret_ota)) { TRACE_D("Sending firmware check request..."); - uint32_t message_counter = web_provisioning_get_message_count(); - cJSON *firmware_info_request = firmware_send_firmware_query_to_nma_server(message_counter); + uint32_t message_counter = ezlopi_service_web_provisioning_get_message_count(); + cJSON* firmware_info_request = firmware_send_firmware_query_to_nma_server(message_counter); if (NULL != firmware_info_request) { - char *data_to_send = cJSON_Print(firmware_info_request); + char* data_to_send = cJSON_Print(firmware_info_request); cJSON_Delete(firmware_info_request); firmware_info_request = NULL; if (data_to_send) { cJSON_Minify(data_to_send); - ret_ota = web_provisioning_send_str_data_to_nma_websocket(data_to_send, TRACE_TYPE_D); - ezlopi_core_ezlopi_broadcast_execute(data_to_send); - free(data_to_send); + ret_ota = ezlopi_service_web_provisioning_send_str_data_to_nma_websocket(data_to_send, TRACE_TYPE_D); + if (0 == ezlopi_core_ezlopi_broadcast_methods_send_to_queue(data_to_send)) + { + free(data_to_send); + } } } } diff --git a/ezlopi-services/ezlopi-service-webprov/ezlopi_service_webprov.c b/ezlopi-services/ezlopi-service-webprov/ezlopi_service_webprov.c index f082031bb..6b8c0f991 100644 --- a/ezlopi-services/ezlopi-service-webprov/ezlopi_service_webprov.c +++ b/ezlopi-services/ezlopi-service-webprov/ezlopi_service_webprov.c @@ -30,12 +30,12 @@ static void __message_upcall(const char* payload, uint32_t len); static void __rpc_method_notfound(cJSON* cj_request, cJSON* cj_response); static void __print_sending_data(char* data_str, e_trace_type_t print_type); -uint32_t web_provisioning_get_message_count(void) +uint32_t ezlopi_service_web_provisioning_get_message_count(void) { return message_counter; } -int web_provisioning_send_str_data_to_nma_websocket(char* str_data, e_trace_type_t print_type) +int ezlopi_service_web_provisioning_send_str_data_to_nma_websocket(char* str_data, e_trace_type_t print_type) { int ret = 0; if (str_data) @@ -64,7 +64,7 @@ int web_provisioning_send_str_data_to_nma_websocket(char* str_data, e_trace_type return ret; } -int web_provisioning_send_to_nma_websocket(cJSON* cjson_data, e_trace_type_t print_type) +int ezlopi_service_web_provisioning_send_to_nma_websocket(cJSON* cjson_data, e_trace_type_t print_type) { int ret = 0; if (ezlopi_websocket_client_is_connected()) @@ -105,7 +105,7 @@ int web_provisioning_send_to_nma_websocket(cJSON* cjson_data, e_trace_type_t pri return ret; } -void web_provisioning_init(void) +void ezlopi_service_web_provisioning_init(void) { xTaskCreate(__config_check, "web-provisioning config check", 4 * 2048, NULL, 5, NULL); xTaskCreate(__fetch_wss_endpoint, "web-provisioning fetch wss endpoint", 3 * 2048, NULL, 5, &ezlopi_update_config_notifier); @@ -394,7 +394,7 @@ static void __config_check(void* pv) vTaskDelete(NULL); } -void web_provisioning_deinit(void) +void ezlopi_service_web_provisioning_deinit(void) { if (_task_handle) { @@ -513,7 +513,7 @@ static void __call_method_and_send_response(cJSON* cj_request, cJSON* cj_method, if (data_to_send) { cJSON_Minify(data_to_send); - web_provisioning_send_str_data_to_nma_websocket(data_to_send, print_type); + ezlopi_service_web_provisioning_send_str_data_to_nma_websocket(data_to_send, print_type); free(data_to_send); } } diff --git a/ezlopi-services/ezlopi-service-webprov/ezlopi_service_webprov.h b/ezlopi-services/ezlopi-service-webprov/ezlopi_service_webprov.h index a599fb026..1e2ac478d 100644 --- a/ezlopi-services/ezlopi-service-webprov/ezlopi_service_webprov.h +++ b/ezlopi-services/ezlopi-service-webprov/ezlopi_service_webprov.h @@ -21,12 +21,11 @@ extern "C" } e_trace_type_t; - void web_provisioning_init(void); - void web_provisioning_deinit(void); - uint32_t web_provisioning_get_message_count(void); - char *parse_device_from_web_payload(void *ws_ctx, char *web_payload); - int web_provisioning_send_to_nma_websocket(cJSON *cjson_data, e_trace_type_t print_type); - int web_provisioning_send_str_data_to_nma_websocket(char *str_data, e_trace_type_t print_type); + void ezlopi_service_web_provisioning_init(void); + void ezlopi_service_web_provisioning_deinit(void); + uint32_t ezlopi_service_web_provisioning_get_message_count(void); + int ezlopi_service_web_provisioning_send_to_nma_websocket(cJSON* cjson_data, e_trace_type_t print_type); + int ezlopi_service_web_provisioning_send_str_data_to_nma_websocket(char* str_data, e_trace_type_t print_type); #ifdef __cplusplus } diff --git a/ezlopi-services/ezlopi-service-ws-server/CMakeLists.txt b/ezlopi-services/ezlopi-service-ws-server/CMakeLists.txt index b1b372d19..e3372d163 100644 --- a/ezlopi-services/ezlopi-service-ws-server/CMakeLists.txt +++ b/ezlopi-services/ezlopi-service-ws-server/CMakeLists.txt @@ -1,4 +1,4 @@ - + file(GLOB_RECURSE provisioning_src "*.c*") set(EZLOPI_UTIL_COMPONENTS diff --git a/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.c b/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.c index 05189b488..14ae56542 100644 --- a/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.c +++ b/ezlopi-services/ezlopi-service-ws-server/ezlopi_service_ws_server.c @@ -68,7 +68,7 @@ static esp_err_t __msg_handler(httpd_req_t* req); static void __ws_api_handler(httpd_req_t* req, const char* payload, uint32_t payload_len); static void __print_sending_data(char* data_str, e_trace_type_t print_type); -static void __call_method_and_send_response(httpd_req_t* req, cJSON* cj_request, cJSON* cj_method, f_method_func_t method_func, e_trace_type_t print_type); +static cJSON* __method_execute(httpd_req_t* req, cJSON* cj_request, cJSON* cj_method, f_method_func_t method_func); e_ws_status_t ezlopi_service_ws_server_status(void) { @@ -177,19 +177,40 @@ static void __ws_api_handler(httpd_req_t* req, const char* payload, uint32_t pay if (method) { - __call_method_and_send_response(req, cj_request, cj_method, method, TRACE_TYPE_D); + cJSON* cj_response = __method_execute(req, cj_request, cj_method, method); + if (cj_response) + { + __respond_cjson(req, cj_response); + cJSON_Delete(cj_response); + } } f_method_func_t updater = ezlopi_core_ezlopi_methods_get_updater_by_id(method_id); if (updater) { - __call_method_and_send_response(req, cj_request, cj_method, updater, TRACE_TYPE_D); + cJSON* cj_response = __method_execute(req, cj_request, cj_method, updater); + if (cj_response) + { + char* data = cJSON_Print(cj_response); + cJSON_Delete(cj_response); + + if (data) { + if (0 == ezlopi_core_ezlopi_broadcast_methods_send_to_queue(data)) { + free(data); + } + } + } } } else { - __call_method_and_send_response(req, cj_request, cj_method, ezlopi_core_ezlopi_methods_rpc_method_notfound, TRACE_TYPE_E); + cJSON* cj_response = __method_execute(req, cj_request, cj_method, ezlopi_core_ezlopi_methods_rpc_method_notfound); + if (cj_response) + { + __respond_cjson(req, cj_response); + cJSON_Delete(cj_response); + } } } } @@ -281,7 +302,6 @@ static esp_err_t __msg_handler(httpd_req_t* req) } else if (HTTPD_WS_TYPE_TEXT == ws_pkt.type) { - httpd_ws_send_frame(req, &ws_pkt); __ws_api_handler(req, (char*)ws_pkt.payload, (uint32_t)ws_pkt.len); } else if (HTTPD_WS_TYPE_CLOSE == ws_pkt.type) @@ -374,8 +394,9 @@ static void __stop_server(void) ezlopi_core_ezlopi_broadcast_remove_method(ezlopi_service_ws_server_broadcast); } -static void __call_method_and_send_response(httpd_req_t* req, cJSON* cj_request, cJSON* cj_method, f_method_func_t method_func, e_trace_type_t print_type) +static cJSON* __method_execute(httpd_req_t* req, cJSON* cj_request, cJSON* cj_method, f_method_func_t method_func) { + cJSON* cj_response = NULL; if (method_func) { if (ezlopi_core_elzlopi_methods_check_method_register(method_func)) @@ -384,7 +405,7 @@ static void __call_method_and_send_response(httpd_req_t* req, cJSON* cj_request, } else { - cJSON* cj_response = cJSON_CreateObject(); + cj_response = cJSON_CreateObject(); if (NULL != cj_response) { cJSON_AddNumberToObject(cj_response, ezlopi_msg_id_str, message_counter); @@ -392,8 +413,6 @@ static void __call_method_and_send_response(httpd_req_t* req, cJSON* cj_request, cJSON_AddNullToObject(cj_response, ezlopi_error_str); method_func(cj_request, cj_response); - - __respond_cjson(req, cj_response); } else { @@ -401,6 +420,8 @@ static void __call_method_and_send_response(httpd_req_t* req, cJSON* cj_request, } } } + + return cj_response; } static int __respond_cjson(httpd_req_t* req, cJSON* cj_response) diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index a0f507eef..b83b39141 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -45,6 +45,7 @@ set(EZLOPI_SERVICES ezlopi-service-gpioisr ezlopi-service-meshbot ezlopi-service-ws-server + ezlopi-service-broadcast ) # Register the components diff --git a/main/ezlopi_main.c b/main/ezlopi_main.c index 3b0f3a32c..57d934aad 100644 --- a/main/ezlopi_main.c +++ b/main/ezlopi_main.c @@ -20,6 +20,7 @@ #include "ezlopi_service_gpioisr.h" #include "ezlopi_service_webprov.h" #include "ezlopi_service_ws_server.h" +#include "ezlopi_service_broadcast.h" #define ENABLE_HEARTBIT_LED 0 @@ -31,15 +32,20 @@ void app_main(void) gpio_isr_service_init(); EZPI_SERVICE_uart_init(); + ezlopi_init(); - ezlopi_ble_service_init(); timer_service_init(); + ezlopi_ble_service_init(); + ezlopi_scenes_meshbot_init(); - web_provisioning_init(); - ota_service_init(); ezlopi_service_modes_init(); + ezlopi_service_ws_server_start(); + ezlopi_service_web_provisioning_init(); + + ota_service_init(); + ezlopi_service_broadcast_init(); xTaskCreate(blinky, "blinky", 2 * 2048, NULL, 1, NULL); } @@ -79,4 +85,4 @@ static void blinky(void* pv) vTaskDelay(1000 / portTICK_PERIOD_MS); } - } +} diff --git a/sdkconfig b/sdkconfig index e2343561a..571ea575c 100644 --- a/sdkconfig +++ b/sdkconfig @@ -3,15 +3,15 @@ # Espressif IoT Development Framework (ESP-IDF) Project Configuration # CONFIG_IDF_CMAKE=y -CONFIG_IDF_TARGET_ARCH_RISCV=y -CONFIG_IDF_TARGET="esp32c3" -CONFIG_IDF_TARGET_ESP32C3=y -CONFIG_IDF_FIRMWARE_CHIP_ID=0x0005 +CONFIG_IDF_TARGET_ARCH_XTENSA=y +CONFIG_IDF_TARGET="esp32s3" +CONFIG_IDF_TARGET_ESP32S3=y +CONFIG_IDF_FIRMWARE_CHIP_ID=0x0009 # # SDK tool configuration # -CONFIG_SDK_TOOLPREFIX="riscv32-esp-elf-" +CONFIG_SDK_TOOLPREFIX="xtensa-esp32s3-elf-" # CONFIG_SDK_TOOLCHAIN_SUPPORTS_TIME_WIDE_64_BITS is not set # end of SDK tool configuration @@ -58,6 +58,7 @@ CONFIG_BOOTLOADER_LOG_LEVEL=0 CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y # end of Serial Flash Configurations +# CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V is not set CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y # CONFIG_BOOTLOADER_FACTORY_RESET is not set # CONFIG_BOOTLOADER_APP_TEST is not set @@ -97,26 +98,28 @@ CONFIG_BOOT_ROM_LOG_ALWAYS_ON=y # CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200 # CONFIG_ESPTOOLPY_NO_STUB is not set +# CONFIG_ESPTOOLPY_OCT_FLASH is not set # CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set # CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set CONFIG_ESPTOOLPY_FLASHMODE_DIO=y # CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y CONFIG_ESPTOOLPY_FLASHMODE="dio" -CONFIG_ESPTOOLPY_FLASHFREQ_80M=y -# CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set -# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set +CONFIG_ESPTOOLPY_S3_STR=y +# CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set +# CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set +CONFIG_ESPTOOLPY_FLASHFREQ_40M=y # CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set -CONFIG_ESPTOOLPY_FLASHFREQ="80m" +CONFIG_ESPTOOLPY_FLASHFREQ="40m" # CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y -# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y # CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE="4MB" +CONFIG_ESPTOOLPY_FLASHSIZE="8MB" CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y CONFIG_ESPTOOLPY_BEFORE_RESET=y # CONFIG_ESPTOOLPY_BEFORE_NORESET is not set @@ -169,7 +172,6 @@ CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y # CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set # CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set # CONFIG_COMPILER_WARN_WRITE_STRINGS is not set -# CONFIG_COMPILER_SAVE_RESTORE_LIBCALLS is not set # CONFIG_COMPILER_DISABLE_GCC8_WARNINGS is not set # CONFIG_COMPILER_DUMP_RTL_FILES is not set # end of Compiler options @@ -205,6 +207,8 @@ CONFIG_BT_CTRL_MODE_EFF=1 CONFIG_BT_CTRL_BLE_MAX_ACT=10 CONFIG_BT_CTRL_BLE_MAX_ACT_EFF=10 CONFIG_BT_CTRL_BLE_STATIC_ACL_TX_BUF_NB=0 +CONFIG_BT_CTRL_PINNED_TO_CORE_0=y +# CONFIG_BT_CTRL_PINNED_TO_CORE_1 is not set CONFIG_BT_CTRL_PINNED_TO_CORE=0 CONFIG_BT_CTRL_HCI_MODE_VHCI=y # CONFIG_BT_CTRL_HCI_MODE_UART_H4 is not set @@ -235,14 +239,14 @@ CONFIG_BT_CTRL_RX_ANTENNA_INDEX_EFF=0 # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N6 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N3 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N0 is not set -CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3=y +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P6 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P9 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P12 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P15 is not set # CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P18 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P21 is not set -CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF=9 +CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P21=y +CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF=15 CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP=y CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM=100 CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 @@ -280,6 +284,8 @@ CONFIG_BT_BLUEDROID_ENABLED=y # Bluedroid Options # CONFIG_BT_BTC_TASK_STACK_SIZE=3072 +CONFIG_BT_BLUEDROID_PINNED_TO_CORE_0=y +# CONFIG_BT_BLUEDROID_PINNED_TO_CORE_1 is not set CONFIG_BT_BLUEDROID_PINNED_TO_CORE=0 CONFIG_BT_BTU_TASK_STACK_SIZE=4096 # CONFIG_BT_BLUEDROID_MEM_DEBUG is not set @@ -479,7 +485,7 @@ CONFIG_BT_LOG_BLUFI_TRACE_LEVEL=2 CONFIG_BT_ACL_CONNECTIONS=4 CONFIG_BT_MULTI_CONNECTION_ENBALE=y -# CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST is not set +CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=y # CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY is not set # CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK is not set CONFIG_BT_SMP_ENABLE=y @@ -488,7 +494,7 @@ CONFIG_BT_SMP_MAX_BONDS=15 CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT=30 CONFIG_BT_MAX_DEVICE_NAME_LEN=32 CONFIG_BT_BLE_RPA_TIMEOUT=900 -CONFIG_BT_BLE_50_FEATURES_SUPPORTED=y +# CONFIG_BT_BLE_50_FEATURES_SUPPORTED is not set CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y # CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL is not set # end of Bluedroid Options @@ -515,7 +521,6 @@ CONFIG_COAP_LOG_DEFAULT_LEVEL=0 # CONFIG_ADC_FORCE_XPD_FSM is not set CONFIG_ADC_DISABLE_DAC=y # CONFIG_ADC_CONTINUOUS_FORCE_USE_ADC2_ON_C3_S3 is not set -# CONFIG_ADC_ONESHOT_FORCE_USE_ADC2_ON_C3 is not set # end of ADC configuration # @@ -543,7 +548,7 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=y # # UART configuration # -# CONFIG_UART_ISR_IN_IRAM is not set +CONFIG_UART_ISR_IN_IRAM=y # end of UART configuration # @@ -574,42 +579,76 @@ CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y # end of ESP-TLS # -# ESP32C3-Specific -# -# CONFIG_ESP32C3_DEFAULT_CPU_FREQ_80 is not set -CONFIG_ESP32C3_DEFAULT_CPU_FREQ_160=y -CONFIG_ESP32C3_DEFAULT_CPU_FREQ_MHZ=160 -# CONFIG_ESP32C3_REV_MIN_0 is not set -# CONFIG_ESP32C3_REV_MIN_1 is not set -# CONFIG_ESP32C3_REV_MIN_2 is not set -CONFIG_ESP32C3_REV_MIN_3=y -# CONFIG_ESP32C3_REV_MIN_4 is not set -# CONFIG_ESP32C3_REV_MIN_101 is not set -CONFIG_ESP32C3_REV_MIN=3 -CONFIG_ESP32C3_REV_MIN_FULL=3 -CONFIG_ESP_REV_MIN_FULL=3 -CONFIG_ESP32C3_REV_MAX_FULL_STR_OPT=y -CONFIG_ESP32C3_REV_MAX_FULL=199 -CONFIG_ESP_REV_MAX_FULL=199 -CONFIG_ESP32C3_DEBUG_OCDAWARE=y -CONFIG_ESP32C3_BROWNOUT_DET=y -CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_7=y -# CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_6 is not set -# CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_5 is not set -# CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_4 is not set -# CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_3 is not set -# CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_2 is not set -CONFIG_ESP32C3_BROWNOUT_DET_LVL=7 -CONFIG_ESP32C3_TIME_SYSCALL_USE_RTC_SYSTIMER=y -# CONFIG_ESP32C3_TIME_SYSCALL_USE_RTC is not set -# CONFIG_ESP32C3_TIME_SYSCALL_USE_SYSTIMER is not set -# CONFIG_ESP32C3_TIME_SYSCALL_USE_NONE is not set -CONFIG_ESP32C3_RTC_CLK_SRC_INT_RC=y -# CONFIG_ESP32C3_RTC_CLK_SRC_EXT_CRYS is not set -# CONFIG_ESP32C3_RTC_CLK_SRC_EXT_OSC is not set -# CONFIG_ESP32C3_RTC_CLK_SRC_INT_8MD256 is not set -CONFIG_ESP32C3_RTC_CLK_CAL_CYCLES=1024 -# end of ESP32C3-Specific +# ESP32S3-Specific +# +CONFIG_ESP32S3_REV_MIN_0=y +# CONFIG_ESP32S3_REV_MIN_1 is not set +# CONFIG_ESP32S3_REV_MIN_2 is not set +CONFIG_ESP32S3_REV_MIN_FULL=0 +CONFIG_ESP_REV_MIN_FULL=0 +CONFIG_ESP32S3_REV_MAX_FULL_STR_OPT=y +CONFIG_ESP32S3_REV_MAX_FULL=99 +CONFIG_ESP_REV_MAX_FULL=99 +# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_80 is not set +# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_160 is not set +CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y +CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=240 + +# +# Cache config +# +CONFIG_ESP32S3_INSTRUCTION_CACHE_16KB=y +# CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB is not set +CONFIG_ESP32S3_INSTRUCTION_CACHE_SIZE=0x4000 +# CONFIG_ESP32S3_INSTRUCTION_CACHE_4WAYS is not set +CONFIG_ESP32S3_INSTRUCTION_CACHE_8WAYS=y +CONFIG_ESP32S3_ICACHE_ASSOCIATED_WAYS=8 +# CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_16B is not set +CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_32B=y +CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_SIZE=32 +# CONFIG_ESP32S3_INSTRUCTION_CACHE_WRAP is not set +# CONFIG_ESP32S3_DATA_CACHE_16KB is not set +CONFIG_ESP32S3_DATA_CACHE_32KB=y +# CONFIG_ESP32S3_DATA_CACHE_64KB is not set +CONFIG_ESP32S3_DATA_CACHE_SIZE=0x8000 +# CONFIG_ESP32S3_DATA_CACHE_4WAYS is not set +CONFIG_ESP32S3_DATA_CACHE_8WAYS=y +CONFIG_ESP32S3_DCACHE_ASSOCIATED_WAYS=8 +# CONFIG_ESP32S3_DATA_CACHE_LINE_16B is not set +CONFIG_ESP32S3_DATA_CACHE_LINE_32B=y +# CONFIG_ESP32S3_DATA_CACHE_LINE_64B is not set +CONFIG_ESP32S3_DATA_CACHE_LINE_SIZE=32 +# CONFIG_ESP32S3_DATA_CACHE_WRAP is not set +# end of Cache config + +# CONFIG_ESP32S3_SPIRAM_SUPPORT is not set +# CONFIG_ESP32S3_TRAX is not set +CONFIG_ESP32S3_TRACEMEM_RESERVE_DRAM=0x0 +# CONFIG_ESP32S3_ULP_COPROC_ENABLED is not set +CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM=0 +CONFIG_ESP32S3_DEBUG_OCDAWARE=y +CONFIG_ESP32S3_BROWNOUT_DET=y +CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_7=y +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_1 is not set +CONFIG_ESP32S3_BROWNOUT_DET_LVL=7 +CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC_FRC1=y +# CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC is not set +# CONFIG_ESP32S3_TIME_SYSCALL_USE_FRC1 is not set +# CONFIG_ESP32S3_TIME_SYSCALL_USE_NONE is not set +CONFIG_ESP32S3_RTC_CLK_SRC_INT_RC=y +# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_ESP32S3_RTC_CLK_SRC_INT_8MD256 is not set +CONFIG_ESP32S3_RTC_CLK_CAL_CYCLES=1024 +CONFIG_ESP32S3_DEEP_SLEEP_WAKEUP_DELAY=2000 +# CONFIG_ESP32S3_RTCDATA_IN_FAST_MEM is not set +# CONFIG_ESP32S3_USE_FIXED_STATIC_RAM_SIZE is not set +# end of ESP32S3-Specific # # ADC-Calibration @@ -688,22 +727,21 @@ CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y -# CONFIG_ESP32C3_UNIVERSAL_MAC_ADDRESSES_TWO is not set -CONFIG_ESP32C3_UNIVERSAL_MAC_ADDRESSES_FOUR=y -CONFIG_ESP32C3_UNIVERSAL_MAC_ADDRESSES=4 +# CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO is not set +CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_FOUR=y +CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES=4 # end of MAC Config # # Sleep Config # CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y +CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y # CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND is not set CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y # end of Sleep Config -CONFIG_ESP_SLEEP_SYSTIMER_STALL_WORKAROUND=y - # # RTC Clock Config # @@ -715,6 +753,8 @@ CONFIG_RTC_CLOCK_BBPLL_POWER_ON_WITH_USB=y # IPC (Inter-Processor Call) # CONFIG_ESP_IPC_TASK_STACK_SIZE=1536 +CONFIG_ESP_IPC_USES_CALLERS_PRIORITY=y +CONFIG_ESP_IPC_ISR_ENABLE=y # end of IPC (Inter-Processor Call) # @@ -729,6 +769,7 @@ CONFIG_ESP_IPC_TASK_STACK_SIZE=1536 # LCD Peripheral Configuration # CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE=32 +# CONFIG_LCD_RGB_ISR_IRAM_SAFE is not set # end of LCD Peripheral Configuration # end of LCD and Touch Panel @@ -761,6 +802,7 @@ CONFIG_ESP_PHY_CALIBRATION_MODE=0 # # CONFIG_PM_ENABLE is not set CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y +CONFIG_PM_POWER_DOWN_TAGMEM_IN_LIGHT_SLEEP=y # end of Power Management # @@ -778,46 +820,45 @@ CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set # CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set # CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set -CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE=y CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK=y CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=y -# CONFIG_ESP_SYSTEM_USE_EH_FRAME is not set # # Memory protection # -CONFIG_ESP_SYSTEM_MEMPROT_DEPCHECK=y -CONFIG_ESP_SYSTEM_MEMPROT_FEATURE=y -CONFIG_ESP_SYSTEM_MEMPROT_FEATURE_LOCK=y -CONFIG_ESP_SYSTEM_MEMPROT_CPU_PREFETCH_PAD_SIZE=16 -CONFIG_ESP_SYSTEM_MEMPROT_MEM_ALIGN_SIZE=512 # end of Memory protection CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 -CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=3072 CONFIG_ESP_MAIN_TASK_STACK_SIZE=3584 CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y +# CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1 is not set # CONFIG_ESP_MAIN_TASK_AFFINITY_NO_AFFINITY is not set CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 CONFIG_ESP_CONSOLE_UART_DEFAULT=y +# CONFIG_ESP_CONSOLE_USB_CDC is not set # CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG is not set # CONFIG_ESP_CONSOLE_UART_CUSTOM is not set # CONFIG_ESP_CONSOLE_NONE is not set # CONFIG_ESP_CONSOLE_SECONDARY_NONE is not set CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y CONFIG_ESP_CONSOLE_UART=y +CONFIG_ESP_CONSOLE_MULTIPLE_UART=y CONFIG_ESP_CONSOLE_UART_NUM=0 CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 CONFIG_ESP_INT_WDT=y CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 +CONFIG_ESP_INT_WDT_CHECK_CPU1=y CONFIG_ESP_TASK_WDT=y # CONFIG_ESP_TASK_WDT_PANIC is not set CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y # CONFIG_ESP_PANIC_HANDLER_IRAM is not set # CONFIG_ESP_DEBUG_STUBS_ENABLE is not set CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y +CONFIG_ESP_SYSTEM_BBPLL_RECALIB=y # end of ESP System Settings # @@ -838,7 +879,7 @@ CONFIG_ESP_TIMER_IMPL_SYSTIMER=y CONFIG_ESP32_WIFI_ENABLED=y CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE=y CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=4 -CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=16 +CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8 # CONFIG_ESP32_WIFI_STATIC_TX_BUFFER is not set CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 @@ -853,6 +894,8 @@ CONFIG_ESP32_WIFI_TX_BA_WIN=6 CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y CONFIG_ESP32_WIFI_RX_BA_WIN=6 CONFIG_ESP32_WIFI_NVS_ENABLED=y +CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y +# CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 CONFIG_ESP32_WIFI_IRAM_OPT=y @@ -928,7 +971,10 @@ CONFIG_FMB_SERIAL_BUF_SIZE=256 CONFIG_FMB_SERIAL_ASCII_BITS_PER_SYMB=8 CONFIG_FMB_SERIAL_ASCII_TIMEOUT_RESPOND_MS=1000 CONFIG_FMB_PORT_TASK_PRIO=10 -CONFIG_FMB_PORT_TASK_AFFINITY=0x7FFFFFFF +# CONFIG_FMB_PORT_TASK_AFFINITY_NO_AFFINITY is not set +CONFIG_FMB_PORT_TASK_AFFINITY_CPU0=y +# CONFIG_FMB_PORT_TASK_AFFINITY_CPU1 is not set +CONFIG_FMB_PORT_TASK_AFFINITY=0x0 CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT=y CONFIG_FMB_CONTROLLER_SLAVE_ID=0x00112233 CONFIG_FMB_CONTROLLER_NOTIFY_TIMEOUT=20 @@ -942,14 +988,13 @@ CONFIG_FMB_EVENT_QUEUE_TIMEOUT=20 # # FreeRTOS # -CONFIG_FREERTOS_UNICORE=y +# CONFIG_FREERTOS_UNICORE is not set CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF CONFIG_FREERTOS_TICK_SUPPORT_SYSTIMER=y CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL1=y # CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL3 is not set CONFIG_FREERTOS_SYSTICK_USES_SYSTIMER=y -CONFIG_FREERTOS_OPTIMIZED_SCHEDULER=y -CONFIG_FREERTOS_HZ=100 +CONFIG_FREERTOS_HZ=1000 CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION=y # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set @@ -1137,6 +1182,7 @@ CONFIG_LWIP_CHECKSUM_CHECK_ICMP=y CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072 CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y # CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 is not set +# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1 is not set CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF # CONFIG_LWIP_PPP_SUPPORT is not set CONFIG_LWIP_IPV6_MEMP_NUM_ND6_QUEUE=3 @@ -1213,6 +1259,7 @@ CONFIG_MBEDTLS_DYNAMIC_FREE_CA_CERT=y # mbedTLS v2.28.x related # # CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is not set +CONFIG_MBEDTLS_ECDH_LEGACY_CONTEXT=y # CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK is not set # CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION is not set # end of mbedTLS v2.28.x related @@ -1228,8 +1275,8 @@ CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200 # end of Certificate Bundle -# CONFIG_MBEDTLS_ECP_RESTARTABLE is not set -# CONFIG_MBEDTLS_CMAC_C is not set +CONFIG_MBEDTLS_ECP_RESTARTABLE=y +CONFIG_MBEDTLS_CMAC_C=y CONFIG_MBEDTLS_HARDWARE_AES=y CONFIG_MBEDTLS_AES_USE_INTERRUPT=y CONFIG_MBEDTLS_HARDWARE_MPI=y @@ -1323,7 +1370,7 @@ CONFIG_MBEDTLS_ECP_NIST_OPTIM=y # CONFIG_MBEDTLS_CHACHA20_C is not set # CONFIG_MBEDTLS_HKDF_C is not set # CONFIG_MBEDTLS_THREADING_C is not set -CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI=y +# CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI is not set # CONFIG_MBEDTLS_SECURITY_RISKS is not set # end of mbedTLS @@ -1335,6 +1382,7 @@ CONFIG_MDNS_TASK_PRIORITY=1 CONFIG_MDNS_TASK_STACK_SIZE=4096 # CONFIG_MDNS_TASK_AFFINITY_NO_AFFINITY is not set CONFIG_MDNS_TASK_AFFINITY_CPU0=y +# CONFIG_MDNS_TASK_AFFINITY_CPU1 is not set CONFIG_MDNS_TASK_AFFINITY=0x0 CONFIG_MDNS_SERVICE_ADD_TIMEOUT_MS=2000 # CONFIG_MDNS_STRICT_MODE is not set @@ -1397,6 +1445,9 @@ CONFIG_OPENSSL_ASSERT_EXIT=y CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5 CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 CONFIG_PTHREAD_STACK_MIN=768 +CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY=y +# CONFIG_PTHREAD_DEFAULT_CORE_0 is not set +# CONFIG_PTHREAD_DEFAULT_CORE_1 is not set CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" # end of PThreads @@ -1412,7 +1463,12 @@ CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" # # Features here require specific hardware (READ DOCS FIRST!) # -# CONFIG_SPI_FLASH_AUTO_SUSPEND is not set +# CONFIG_SPI_FLASH_HPM_ENA is not set +CONFIG_SPI_FLASH_HPM_AUTO=y +# CONFIG_SPI_FLASH_HPM_DIS is not set +CONFIG_SPI_FLASH_HPM_ON=y +CONFIG_SPI_FLASH_HPM_DC_AUTO=y +# CONFIG_SPI_FLASH_HPM_DC_DISABLE is not set # end of Optional and Experimental Features (READ DOCS FIRST) # end of Main Flash configuration @@ -1446,6 +1502,7 @@ CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP=y CONFIG_SPI_FLASH_SUPPORT_TH_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_MXIC_OPI_CHIP=y # end of Auto-detect flash chips CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y @@ -1499,6 +1556,12 @@ CONFIG_WS_BUFFER_SIZE=1024 # end of Websocket # end of TCP Transport +# +# TinyUSB Stack +# +# CONFIG_TINYUSB is not set +# end of TinyUSB Stack + # # Unity unit testing library # @@ -1511,10 +1574,24 @@ CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y # CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set # end of Unity unit testing library +# +# USB-OTG +# +CONFIG_USB_OTG_SUPPORTED=y +CONFIG_USB_HOST_CONTROL_TRANSFER_MAX_SIZE=256 +CONFIG_USB_HOST_HW_BUFFER_BIAS_BALANCED=y +# CONFIG_USB_HOST_HW_BUFFER_BIAS_IN is not set +# CONFIG_USB_HOST_HW_BUFFER_BIAS_PERIODIC_OUT is not set + # # Root Hub configuration # +CONFIG_USB_HOST_DEBOUNCE_DELAY_MS=250 +CONFIG_USB_HOST_RESET_HOLD_MS=30 +CONFIG_USB_HOST_RESET_RECOVERY_MS=30 +CONFIG_USB_HOST_SET_ADDR_RECOVERY_MS=10 # end of Root Hub configuration +# end of USB-OTG # # Virtual file system @@ -1587,7 +1664,7 @@ CONFIG_LUA_ROOT="/lua" # end of Compatibility options # Deprecated options for backward compatibility -CONFIG_TOOLPREFIX="riscv32-esp-elf-" +CONFIG_TOOLPREFIX="xtensa-esp32s3-elf-" CONFIG_LOG_BOOTLOADER_LEVEL_NONE=y # CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set # CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set @@ -1629,6 +1706,8 @@ CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y CONFIG_BLUEDROID_ENABLED=y # CONFIG_NIMBLE_ENABLED is not set CONFIG_BTC_TASK_STACK_SIZE=3072 +CONFIG_BLUEDROID_PINNED_TO_CORE_0=y +# CONFIG_BLUEDROID_PINNED_TO_CORE_1 is not set CONFIG_BLUEDROID_PINNED_TO_CORE=0 CONFIG_BTU_TASK_STACK_SIZE=4096 # CONFIG_BLUEDROID_MEM_DEBUG is not set @@ -1823,10 +1902,8 @@ CONFIG_ESP32S2_PANIC_PRINT_REBOOT=y # CONFIG_ESP32S2_PANIC_SILENT_REBOOT is not set # CONFIG_ESP32S2_PANIC_GDBSTUB is not set CONFIG_ESP32S2_ALLOW_RTC_FAST_MEM_AS_HEAP=y -CONFIG_ESP32H2_MEMPROT_FEATURE=y -CONFIG_ESP32H2_MEMPROT_FEATURE_LOCK=y CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 -CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=3072 CONFIG_MAIN_TASK_STACK_SIZE=3584 CONFIG_CONSOLE_UART_DEFAULT=y # CONFIG_CONSOLE_UART_CUSTOM is not set @@ -1836,10 +1913,12 @@ CONFIG_CONSOLE_UART_NUM=0 CONFIG_CONSOLE_UART_BAUDRATE=115200 CONFIG_INT_WDT=y CONFIG_INT_WDT_TIMEOUT_MS=300 +CONFIG_INT_WDT_CHECK_CPU1=y CONFIG_TASK_WDT=y # CONFIG_TASK_WDT_PANIC is not set CONFIG_TASK_WDT_TIMEOUT_S=5 CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y # CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set CONFIG_TIMER_TASK_STACK_SIZE=3584 CONFIG_SW_COEXIST_ENABLE=y @@ -1884,16 +1963,21 @@ CONFIG_UDP_RECVMBOX_SIZE=6 CONFIG_TCPIP_TASK_STACK_SIZE=3072 CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y # CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set +# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF # CONFIG_PPP_SUPPORT is not set CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 CONFIG_ESP32_PTHREAD_STACK_MIN=768 +CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y # CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set # CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set +# CONFIG_USB_ENABLED is not set CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y CONFIG_SUPPORT_TERMIOS=y CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 diff --git a/sdkconfig.old b/sdkconfig.old index 12ec26fec..5cf73e7c4 100644 --- a/sdkconfig.old +++ b/sdkconfig.old @@ -3,15 +3,15 @@ # Espressif IoT Development Framework (ESP-IDF) Project Configuration # CONFIG_IDF_CMAKE=y -CONFIG_IDF_TARGET_ARCH_RISCV=y -CONFIG_IDF_TARGET="esp32c3" -CONFIG_IDF_TARGET_ESP32C3=y -CONFIG_IDF_FIRMWARE_CHIP_ID=0x0005 +CONFIG_IDF_TARGET_ARCH_XTENSA=y +CONFIG_IDF_TARGET="esp32s3" +CONFIG_IDF_TARGET_ESP32S3=y +CONFIG_IDF_FIRMWARE_CHIP_ID=0x0009 # # SDK tool configuration # -CONFIG_SDK_TOOLPREFIX="riscv32-esp-elf-" +CONFIG_SDK_TOOLPREFIX="xtensa-esp32s3-elf-" # CONFIG_SDK_TOOLCHAIN_SUPPORTS_TIME_WIDE_64_BITS is not set # end of SDK tool configuration @@ -43,13 +43,13 @@ CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE is not set -CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y +# CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set # CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set # CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set -# CONFIG_BOOTLOADER_LOG_LEVEL_INFO is not set +CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y # CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set # CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set -CONFIG_BOOTLOADER_LOG_LEVEL=0 +CONFIG_BOOTLOADER_LOG_LEVEL=3 # # Serial Flash Configurations @@ -97,26 +97,28 @@ CONFIG_BOOT_ROM_LOG_ALWAYS_ON=y # CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200 # CONFIG_ESPTOOLPY_NO_STUB is not set +# CONFIG_ESPTOOLPY_OCT_FLASH is not set # CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set # CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set CONFIG_ESPTOOLPY_FLASHMODE_DIO=y # CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y CONFIG_ESPTOOLPY_FLASHMODE="dio" +CONFIG_ESPTOOLPY_S3_STR=y +# CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set CONFIG_ESPTOOLPY_FLASHFREQ_80M=y # CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set -# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set CONFIG_ESPTOOLPY_FLASHFREQ="80m" # CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y +# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE="4MB" +CONFIG_ESPTOOLPY_FLASHSIZE="2MB" CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y CONFIG_ESPTOOLPY_BEFORE_RESET=y # CONFIG_ESPTOOLPY_BEFORE_NORESET is not set @@ -139,12 +141,12 @@ CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 # # Partition Table # -# CONFIG_PARTITION_TABLE_SINGLE_APP is not set +CONFIG_PARTITION_TABLE_SINGLE_APP=y # CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set # CONFIG_PARTITION_TABLE_TWO_OTA is not set -CONFIG_PARTITION_TABLE_CUSTOM=y -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="ezlopi_partitions_v3_1_4_181_4mb.csv" -CONFIG_PARTITION_TABLE_FILENAME="ezlopi_partitions_v3_1_4_181_4mb.csv" +# CONFIG_PARTITION_TABLE_CUSTOM is not set +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" +CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp.csv" CONFIG_PARTITION_TABLE_OFFSET=0x8000 CONFIG_PARTITION_TABLE_MD5=y # end of Partition Table @@ -169,7 +171,6 @@ CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y # CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set # CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set # CONFIG_COMPILER_WARN_WRITE_STRINGS is not set -# CONFIG_COMPILER_SAVE_RESTORE_LIBCALLS is not set # CONFIG_COMPILER_DISABLE_GCC8_WARNINGS is not set # CONFIG_COMPILER_DUMP_RTL_FILES is not set # end of Compiler options @@ -195,307 +196,9 @@ CONFIG_APPTRACE_LOCK_ENABLE=y # # Bluetooth # -CONFIG_BT_ENABLED=y -CONFIG_BT_SOC_SUPPORT_5_0=y - -# -# Bluetooth controller -# -CONFIG_BT_CTRL_MODE_EFF=1 -CONFIG_BT_CTRL_BLE_MAX_ACT=10 -CONFIG_BT_CTRL_BLE_MAX_ACT_EFF=10 -CONFIG_BT_CTRL_BLE_STATIC_ACL_TX_BUF_NB=0 -CONFIG_BT_CTRL_PINNED_TO_CORE=0 -CONFIG_BT_CTRL_HCI_MODE_VHCI=y -# CONFIG_BT_CTRL_HCI_MODE_UART_H4 is not set -CONFIG_BT_CTRL_HCI_TL=1 -CONFIG_BT_CTRL_ADV_DUP_FILT_MAX=30 -CONFIG_BT_BLE_CCA_MODE_NONE=y -# CONFIG_BT_BLE_CCA_MODE_HW is not set -# CONFIG_BT_BLE_CCA_MODE_SW is not set -CONFIG_BT_BLE_CCA_MODE=0 -CONFIG_BT_CTRL_HW_CCA_VAL=20 -CONFIG_BT_CTRL_HW_CCA_EFF=0 -CONFIG_BT_CTRL_CE_LENGTH_TYPE_ORIG=y -# CONFIG_BT_CTRL_CE_LENGTH_TYPE_CE is not set -# CONFIG_BT_CTRL_CE_LENGTH_TYPE_SD is not set -CONFIG_BT_CTRL_CE_LENGTH_TYPE_EFF=0 -CONFIG_BT_CTRL_TX_ANTENNA_INDEX_0=y -# CONFIG_BT_CTRL_TX_ANTENNA_INDEX_1 is not set -CONFIG_BT_CTRL_TX_ANTENNA_INDEX_EFF=0 -CONFIG_BT_CTRL_RX_ANTENNA_INDEX_0=y -# CONFIG_BT_CTRL_RX_ANTENNA_INDEX_1 is not set -CONFIG_BT_CTRL_RX_ANTENNA_INDEX_EFF=0 -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N24 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N21 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N18 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N15 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N12 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N9 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N6 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N3 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N0 is not set -CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3=y -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P6 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P9 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P12 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P15 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P18 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P21 is not set -CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF=9 -CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP=y -CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM=100 -CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 -CONFIG_BT_CTRL_BLE_SCAN_DUPL=y -CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DEVICE=y -# CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DATA is not set -# CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DATA_DEVICE is not set -CONFIG_BT_CTRL_SCAN_DUPL_TYPE=0 -CONFIG_BT_CTRL_SCAN_DUPL_CACHE_SIZE=100 -CONFIG_BT_CTRL_DUPL_SCAN_CACHE_REFRESH_PERIOD=0 -# CONFIG_BT_CTRL_BLE_MESH_SCAN_DUPL_EN is not set -# CONFIG_BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_EN is not set -CONFIG_BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_DIS=y -CONFIG_BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_EFF=0 - -# -# MODEM SLEEP Options -# -# CONFIG_BT_CTRL_MODEM_SLEEP is not set -# end of MODEM SLEEP Options - -CONFIG_BT_CTRL_SLEEP_MODE_EFF=0 -CONFIG_BT_CTRL_SLEEP_CLOCK_EFF=0 -CONFIG_BT_CTRL_HCI_TL_EFF=1 -# CONFIG_BT_CTRL_AGC_RECORRECT_EN is not set -# CONFIG_BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX is not set -# CONFIG_BT_BLE_ADV_DATA_LENGTH_ZERO_AUX is not set -# end of Bluetooth controller - -CONFIG_BT_BLUEDROID_ENABLED=y -# CONFIG_BT_NIMBLE_ENABLED is not set -# CONFIG_BT_CONTROLLER_ONLY is not set - -# -# Bluedroid Options -# -CONFIG_BT_BTC_TASK_STACK_SIZE=3072 -CONFIG_BT_BLUEDROID_PINNED_TO_CORE=0 -CONFIG_BT_BTU_TASK_STACK_SIZE=4096 -# CONFIG_BT_BLUEDROID_MEM_DEBUG is not set -CONFIG_BT_BLE_ENABLED=y -CONFIG_BT_GATTS_ENABLE=y -# CONFIG_BT_GATTS_PPCP_CHAR_GAP is not set -# CONFIG_BT_BLE_BLUFI_ENABLE is not set -CONFIG_BT_GATT_MAX_SR_PROFILES=8 -CONFIG_BT_GATT_MAX_SR_ATTRIBUTES=100 -# CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MANUAL is not set -CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_AUTO=y -CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE=0 -# CONFIG_BT_GATTS_ROBUST_CACHING_ENABLED is not set -# CONFIG_BT_GATTS_DEVICE_NAME_WRITABLE is not set -# CONFIG_BT_GATTS_APPEARANCE_WRITABLE is not set -CONFIG_BT_GATTC_ENABLE=y -CONFIG_BT_GATTC_MAX_CACHE_CHAR=40 -CONFIG_BT_GATTC_NOTIF_REG_MAX=5 -# CONFIG_BT_GATTC_CACHE_NVS_FLASH is not set -CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=3 -CONFIG_BT_BLE_SMP_ENABLE=y -# CONFIG_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE is not set -# CONFIG_BT_STACK_NO_LOG is not set - -# -# BT DEBUG LOG LEVEL -# -# CONFIG_BT_LOG_HCI_TRACE_LEVEL_NONE is not set -# CONFIG_BT_LOG_HCI_TRACE_LEVEL_ERROR is not set -CONFIG_BT_LOG_HCI_TRACE_LEVEL_WARNING=y -# CONFIG_BT_LOG_HCI_TRACE_LEVEL_API is not set -# CONFIG_BT_LOG_HCI_TRACE_LEVEL_EVENT is not set -# CONFIG_BT_LOG_HCI_TRACE_LEVEL_DEBUG is not set -# CONFIG_BT_LOG_HCI_TRACE_LEVEL_VERBOSE is not set -CONFIG_BT_LOG_HCI_TRACE_LEVEL=2 -# CONFIG_BT_LOG_BTM_TRACE_LEVEL_NONE is not set -# CONFIG_BT_LOG_BTM_TRACE_LEVEL_ERROR is not set -CONFIG_BT_LOG_BTM_TRACE_LEVEL_WARNING=y -# CONFIG_BT_LOG_BTM_TRACE_LEVEL_API is not set -# CONFIG_BT_LOG_BTM_TRACE_LEVEL_EVENT is not set -# CONFIG_BT_LOG_BTM_TRACE_LEVEL_DEBUG is not set -# CONFIG_BT_LOG_BTM_TRACE_LEVEL_VERBOSE is not set -CONFIG_BT_LOG_BTM_TRACE_LEVEL=2 -# CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_NONE is not set -# CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_ERROR is not set -CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_WARNING=y -# CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_API is not set -# CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_EVENT is not set -# CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_DEBUG is not set -# CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_VERBOSE is not set -CONFIG_BT_LOG_L2CAP_TRACE_LEVEL=2 -# CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_NONE is not set -# CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_ERROR is not set -CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_WARNING=y -# CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_API is not set -# CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_EVENT is not set -# CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_DEBUG is not set -# CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_VERBOSE is not set -CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL=2 -# CONFIG_BT_LOG_SDP_TRACE_LEVEL_NONE is not set -# CONFIG_BT_LOG_SDP_TRACE_LEVEL_ERROR is not set -CONFIG_BT_LOG_SDP_TRACE_LEVEL_WARNING=y -# CONFIG_BT_LOG_SDP_TRACE_LEVEL_API is not set -# CONFIG_BT_LOG_SDP_TRACE_LEVEL_EVENT is not set -# CONFIG_BT_LOG_SDP_TRACE_LEVEL_DEBUG is not set -# CONFIG_BT_LOG_SDP_TRACE_LEVEL_VERBOSE is not set -CONFIG_BT_LOG_SDP_TRACE_LEVEL=2 -# CONFIG_BT_LOG_GAP_TRACE_LEVEL_NONE is not set -# CONFIG_BT_LOG_GAP_TRACE_LEVEL_ERROR is not set -CONFIG_BT_LOG_GAP_TRACE_LEVEL_WARNING=y -# CONFIG_BT_LOG_GAP_TRACE_LEVEL_API is not set -# CONFIG_BT_LOG_GAP_TRACE_LEVEL_EVENT is not set -# CONFIG_BT_LOG_GAP_TRACE_LEVEL_DEBUG is not set -# CONFIG_BT_LOG_GAP_TRACE_LEVEL_VERBOSE is not set -CONFIG_BT_LOG_GAP_TRACE_LEVEL=2 -# CONFIG_BT_LOG_BNEP_TRACE_LEVEL_NONE is not set -# CONFIG_BT_LOG_BNEP_TRACE_LEVEL_ERROR is not set -CONFIG_BT_LOG_BNEP_TRACE_LEVEL_WARNING=y -# CONFIG_BT_LOG_BNEP_TRACE_LEVEL_API is not set -# CONFIG_BT_LOG_BNEP_TRACE_LEVEL_EVENT is not set -# CONFIG_BT_LOG_BNEP_TRACE_LEVEL_DEBUG is not set -# CONFIG_BT_LOG_BNEP_TRACE_LEVEL_VERBOSE is not set -CONFIG_BT_LOG_BNEP_TRACE_LEVEL=2 -# CONFIG_BT_LOG_PAN_TRACE_LEVEL_NONE is not set -# CONFIG_BT_LOG_PAN_TRACE_LEVEL_ERROR is not set -CONFIG_BT_LOG_PAN_TRACE_LEVEL_WARNING=y -# CONFIG_BT_LOG_PAN_TRACE_LEVEL_API is not set -# CONFIG_BT_LOG_PAN_TRACE_LEVEL_EVENT is not set -# CONFIG_BT_LOG_PAN_TRACE_LEVEL_DEBUG is not set -# CONFIG_BT_LOG_PAN_TRACE_LEVEL_VERBOSE is not set -CONFIG_BT_LOG_PAN_TRACE_LEVEL=2 -# CONFIG_BT_LOG_A2D_TRACE_LEVEL_NONE is not set -# CONFIG_BT_LOG_A2D_TRACE_LEVEL_ERROR is not set -CONFIG_BT_LOG_A2D_TRACE_LEVEL_WARNING=y -# CONFIG_BT_LOG_A2D_TRACE_LEVEL_API is not set -# CONFIG_BT_LOG_A2D_TRACE_LEVEL_EVENT is not set -# CONFIG_BT_LOG_A2D_TRACE_LEVEL_DEBUG is not set -# CONFIG_BT_LOG_A2D_TRACE_LEVEL_VERBOSE is not set -CONFIG_BT_LOG_A2D_TRACE_LEVEL=2 -# CONFIG_BT_LOG_AVDT_TRACE_LEVEL_NONE is not set -# CONFIG_BT_LOG_AVDT_TRACE_LEVEL_ERROR is not set -CONFIG_BT_LOG_AVDT_TRACE_LEVEL_WARNING=y -# CONFIG_BT_LOG_AVDT_TRACE_LEVEL_API is not set -# CONFIG_BT_LOG_AVDT_TRACE_LEVEL_EVENT is not set -# CONFIG_BT_LOG_AVDT_TRACE_LEVEL_DEBUG is not set -# CONFIG_BT_LOG_AVDT_TRACE_LEVEL_VERBOSE is not set -CONFIG_BT_LOG_AVDT_TRACE_LEVEL=2 -# CONFIG_BT_LOG_AVCT_TRACE_LEVEL_NONE is not set -# CONFIG_BT_LOG_AVCT_TRACE_LEVEL_ERROR is not set -CONFIG_BT_LOG_AVCT_TRACE_LEVEL_WARNING=y -# CONFIG_BT_LOG_AVCT_TRACE_LEVEL_API is not set -# CONFIG_BT_LOG_AVCT_TRACE_LEVEL_EVENT is not set -# CONFIG_BT_LOG_AVCT_TRACE_LEVEL_DEBUG is not set -# CONFIG_BT_LOG_AVCT_TRACE_LEVEL_VERBOSE is not set -CONFIG_BT_LOG_AVCT_TRACE_LEVEL=2 -# CONFIG_BT_LOG_AVRC_TRACE_LEVEL_NONE is not set -# CONFIG_BT_LOG_AVRC_TRACE_LEVEL_ERROR is not set -CONFIG_BT_LOG_AVRC_TRACE_LEVEL_WARNING=y -# CONFIG_BT_LOG_AVRC_TRACE_LEVEL_API is not set -# CONFIG_BT_LOG_AVRC_TRACE_LEVEL_EVENT is not set -# CONFIG_BT_LOG_AVRC_TRACE_LEVEL_DEBUG is not set -# CONFIG_BT_LOG_AVRC_TRACE_LEVEL_VERBOSE is not set -CONFIG_BT_LOG_AVRC_TRACE_LEVEL=2 -# CONFIG_BT_LOG_MCA_TRACE_LEVEL_NONE is not set -# CONFIG_BT_LOG_MCA_TRACE_LEVEL_ERROR is not set -CONFIG_BT_LOG_MCA_TRACE_LEVEL_WARNING=y -# CONFIG_BT_LOG_MCA_TRACE_LEVEL_API is not set -# CONFIG_BT_LOG_MCA_TRACE_LEVEL_EVENT is not set -# CONFIG_BT_LOG_MCA_TRACE_LEVEL_DEBUG is not set -# CONFIG_BT_LOG_MCA_TRACE_LEVEL_VERBOSE is not set -CONFIG_BT_LOG_MCA_TRACE_LEVEL=2 -# CONFIG_BT_LOG_HID_TRACE_LEVEL_NONE is not set -# CONFIG_BT_LOG_HID_TRACE_LEVEL_ERROR is not set -CONFIG_BT_LOG_HID_TRACE_LEVEL_WARNING=y -# CONFIG_BT_LOG_HID_TRACE_LEVEL_API is not set -# CONFIG_BT_LOG_HID_TRACE_LEVEL_EVENT is not set -# CONFIG_BT_LOG_HID_TRACE_LEVEL_DEBUG is not set -# CONFIG_BT_LOG_HID_TRACE_LEVEL_VERBOSE is not set -CONFIG_BT_LOG_HID_TRACE_LEVEL=2 -# CONFIG_BT_LOG_APPL_TRACE_LEVEL_NONE is not set -# CONFIG_BT_LOG_APPL_TRACE_LEVEL_ERROR is not set -CONFIG_BT_LOG_APPL_TRACE_LEVEL_WARNING=y -# CONFIG_BT_LOG_APPL_TRACE_LEVEL_API is not set -# CONFIG_BT_LOG_APPL_TRACE_LEVEL_EVENT is not set -# CONFIG_BT_LOG_APPL_TRACE_LEVEL_DEBUG is not set -# CONFIG_BT_LOG_APPL_TRACE_LEVEL_VERBOSE is not set -CONFIG_BT_LOG_APPL_TRACE_LEVEL=2 -# CONFIG_BT_LOG_GATT_TRACE_LEVEL_NONE is not set -# CONFIG_BT_LOG_GATT_TRACE_LEVEL_ERROR is not set -CONFIG_BT_LOG_GATT_TRACE_LEVEL_WARNING=y -# CONFIG_BT_LOG_GATT_TRACE_LEVEL_API is not set -# CONFIG_BT_LOG_GATT_TRACE_LEVEL_EVENT is not set -# CONFIG_BT_LOG_GATT_TRACE_LEVEL_DEBUG is not set -# CONFIG_BT_LOG_GATT_TRACE_LEVEL_VERBOSE is not set -CONFIG_BT_LOG_GATT_TRACE_LEVEL=2 -# CONFIG_BT_LOG_SMP_TRACE_LEVEL_NONE is not set -# CONFIG_BT_LOG_SMP_TRACE_LEVEL_ERROR is not set -CONFIG_BT_LOG_SMP_TRACE_LEVEL_WARNING=y -# CONFIG_BT_LOG_SMP_TRACE_LEVEL_API is not set -# CONFIG_BT_LOG_SMP_TRACE_LEVEL_EVENT is not set -# CONFIG_BT_LOG_SMP_TRACE_LEVEL_DEBUG is not set -# CONFIG_BT_LOG_SMP_TRACE_LEVEL_VERBOSE is not set -CONFIG_BT_LOG_SMP_TRACE_LEVEL=2 -# CONFIG_BT_LOG_BTIF_TRACE_LEVEL_NONE is not set -# CONFIG_BT_LOG_BTIF_TRACE_LEVEL_ERROR is not set -CONFIG_BT_LOG_BTIF_TRACE_LEVEL_WARNING=y -# CONFIG_BT_LOG_BTIF_TRACE_LEVEL_API is not set -# CONFIG_BT_LOG_BTIF_TRACE_LEVEL_EVENT is not set -# CONFIG_BT_LOG_BTIF_TRACE_LEVEL_DEBUG is not set -# CONFIG_BT_LOG_BTIF_TRACE_LEVEL_VERBOSE is not set -CONFIG_BT_LOG_BTIF_TRACE_LEVEL=2 -# CONFIG_BT_LOG_BTC_TRACE_LEVEL_NONE is not set -# CONFIG_BT_LOG_BTC_TRACE_LEVEL_ERROR is not set -CONFIG_BT_LOG_BTC_TRACE_LEVEL_WARNING=y -# CONFIG_BT_LOG_BTC_TRACE_LEVEL_API is not set -# CONFIG_BT_LOG_BTC_TRACE_LEVEL_EVENT is not set -# CONFIG_BT_LOG_BTC_TRACE_LEVEL_DEBUG is not set -# CONFIG_BT_LOG_BTC_TRACE_LEVEL_VERBOSE is not set -CONFIG_BT_LOG_BTC_TRACE_LEVEL=2 -# CONFIG_BT_LOG_OSI_TRACE_LEVEL_NONE is not set -# CONFIG_BT_LOG_OSI_TRACE_LEVEL_ERROR is not set -CONFIG_BT_LOG_OSI_TRACE_LEVEL_WARNING=y -# CONFIG_BT_LOG_OSI_TRACE_LEVEL_API is not set -# CONFIG_BT_LOG_OSI_TRACE_LEVEL_EVENT is not set -# CONFIG_BT_LOG_OSI_TRACE_LEVEL_DEBUG is not set -# CONFIG_BT_LOG_OSI_TRACE_LEVEL_VERBOSE is not set -CONFIG_BT_LOG_OSI_TRACE_LEVEL=2 -# CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_NONE is not set -# CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_ERROR is not set -CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_WARNING=y -# CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_API is not set -# CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_EVENT is not set -# CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_DEBUG is not set -# CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_VERBOSE is not set -CONFIG_BT_LOG_BLUFI_TRACE_LEVEL=2 -# end of BT DEBUG LOG LEVEL - -CONFIG_BT_ACL_CONNECTIONS=4 -CONFIG_BT_MULTI_CONNECTION_ENBALE=y -# CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST is not set -# CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY is not set -# CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK is not set -CONFIG_BT_SMP_ENABLE=y -CONFIG_BT_SMP_MAX_BONDS=15 -# CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN is not set -CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT=30 -CONFIG_BT_MAX_DEVICE_NAME_LEN=32 -CONFIG_BT_BLE_RPA_TIMEOUT=900 -CONFIG_BT_BLE_50_FEATURES_SUPPORTED=y -CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y -# CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL is not set -# end of Bluedroid Options +# CONFIG_BT_ENABLED is not set # end of Bluetooth -# CONFIG_BLE_MESH is not set - # # CoAP Configuration # @@ -515,7 +218,6 @@ CONFIG_COAP_LOG_DEFAULT_LEVEL=0 # CONFIG_ADC_FORCE_XPD_FSM is not set CONFIG_ADC_DISABLE_DAC=y # CONFIG_ADC_CONTINUOUS_FORCE_USE_ADC2_ON_C3_S3 is not set -# CONFIG_ADC_ONESHOT_FORCE_USE_ADC2_ON_C3 is not set # end of ADC configuration # @@ -574,42 +276,77 @@ CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y # end of ESP-TLS # -# ESP32C3-Specific -# -# CONFIG_ESP32C3_DEFAULT_CPU_FREQ_80 is not set -CONFIG_ESP32C3_DEFAULT_CPU_FREQ_160=y -CONFIG_ESP32C3_DEFAULT_CPU_FREQ_MHZ=160 -# CONFIG_ESP32C3_REV_MIN_0 is not set -# CONFIG_ESP32C3_REV_MIN_1 is not set -# CONFIG_ESP32C3_REV_MIN_2 is not set -CONFIG_ESP32C3_REV_MIN_3=y -# CONFIG_ESP32C3_REV_MIN_4 is not set -# CONFIG_ESP32C3_REV_MIN_101 is not set -CONFIG_ESP32C3_REV_MIN=3 -CONFIG_ESP32C3_REV_MIN_FULL=3 -CONFIG_ESP_REV_MIN_FULL=3 -CONFIG_ESP32C3_REV_MAX_FULL_STR_OPT=y -CONFIG_ESP32C3_REV_MAX_FULL=199 -CONFIG_ESP_REV_MAX_FULL=199 -CONFIG_ESP32C3_DEBUG_OCDAWARE=y -CONFIG_ESP32C3_BROWNOUT_DET=y -CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_7=y -# CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_6 is not set -# CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_5 is not set -# CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_4 is not set -# CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_3 is not set -# CONFIG_ESP32C3_BROWNOUT_DET_LVL_SEL_2 is not set -CONFIG_ESP32C3_BROWNOUT_DET_LVL=7 -CONFIG_ESP32C3_TIME_SYSCALL_USE_RTC_SYSTIMER=y -# CONFIG_ESP32C3_TIME_SYSCALL_USE_RTC is not set -# CONFIG_ESP32C3_TIME_SYSCALL_USE_SYSTIMER is not set -# CONFIG_ESP32C3_TIME_SYSCALL_USE_NONE is not set -CONFIG_ESP32C3_RTC_CLK_SRC_INT_RC=y -# CONFIG_ESP32C3_RTC_CLK_SRC_EXT_CRYS is not set -# CONFIG_ESP32C3_RTC_CLK_SRC_EXT_OSC is not set -# CONFIG_ESP32C3_RTC_CLK_SRC_INT_8MD256 is not set -CONFIG_ESP32C3_RTC_CLK_CAL_CYCLES=1024 -# end of ESP32C3-Specific +# ESP32S3-Specific +# +CONFIG_ESP32S3_REV_MIN_0=y +# CONFIG_ESP32S3_REV_MIN_1 is not set +# CONFIG_ESP32S3_REV_MIN_2 is not set +CONFIG_ESP32S3_REV_MIN_FULL=0 +CONFIG_ESP_REV_MIN_FULL=0 +CONFIG_ESP32S3_REV_MAX_FULL_STR_OPT=y +CONFIG_ESP32S3_REV_MAX_FULL=99 +CONFIG_ESP_REV_MAX_FULL=99 +# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_80 is not set +CONFIG_ESP32S3_DEFAULT_CPU_FREQ_160=y +# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240 is not set +CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=160 + +# +# Cache config +# +CONFIG_ESP32S3_INSTRUCTION_CACHE_16KB=y +# CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB is not set +CONFIG_ESP32S3_INSTRUCTION_CACHE_SIZE=0x4000 +# CONFIG_ESP32S3_INSTRUCTION_CACHE_4WAYS is not set +CONFIG_ESP32S3_INSTRUCTION_CACHE_8WAYS=y +CONFIG_ESP32S3_ICACHE_ASSOCIATED_WAYS=8 +# CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_16B is not set +CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_32B=y +CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_SIZE=32 +# CONFIG_ESP32S3_INSTRUCTION_CACHE_WRAP is not set +# CONFIG_ESP32S3_DATA_CACHE_16KB is not set +CONFIG_ESP32S3_DATA_CACHE_32KB=y +# CONFIG_ESP32S3_DATA_CACHE_64KB is not set +CONFIG_ESP32S3_DATA_CACHE_SIZE=0x8000 +# CONFIG_ESP32S3_DATA_CACHE_4WAYS is not set +CONFIG_ESP32S3_DATA_CACHE_8WAYS=y +CONFIG_ESP32S3_DCACHE_ASSOCIATED_WAYS=8 +# CONFIG_ESP32S3_DATA_CACHE_LINE_16B is not set +CONFIG_ESP32S3_DATA_CACHE_LINE_32B=y +# CONFIG_ESP32S3_DATA_CACHE_LINE_64B is not set +CONFIG_ESP32S3_DATA_CACHE_LINE_SIZE=32 +# CONFIG_ESP32S3_DATA_CACHE_WRAP is not set +# end of Cache config + +# CONFIG_ESP32S3_SPIRAM_SUPPORT is not set +# CONFIG_ESP32S3_TRAX is not set +CONFIG_ESP32S3_TRACEMEM_RESERVE_DRAM=0x0 +# CONFIG_ESP32S3_ULP_COPROC_ENABLED is not set +CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM=0 +CONFIG_ESP32S3_DEBUG_OCDAWARE=y +CONFIG_ESP32S3_BROWNOUT_DET=y +CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_7=y +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_1 is not set +CONFIG_ESP32S3_BROWNOUT_DET_LVL=7 +CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC_FRC1=y +# CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC is not set +# CONFIG_ESP32S3_TIME_SYSCALL_USE_FRC1 is not set +# CONFIG_ESP32S3_TIME_SYSCALL_USE_NONE is not set +CONFIG_ESP32S3_RTC_CLK_SRC_INT_RC=y +# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_ESP32S3_RTC_CLK_SRC_INT_8MD256 is not set +CONFIG_ESP32S3_RTC_CLK_CAL_CYCLES=1024 +CONFIG_ESP32S3_DEEP_SLEEP_WAKEUP_DELAY=2000 +# CONFIG_ESP32S3_NO_BLOBS is not set +# CONFIG_ESP32S3_RTCDATA_IN_FAST_MEM is not set +# CONFIG_ESP32S3_USE_FIXED_STATIC_RAM_SIZE is not set +# end of ESP32S3-Specific # # ADC-Calibration @@ -628,7 +365,7 @@ CONFIG_ESP_ERR_TO_NAME_LOOKUP=y CONFIG_ETH_ENABLED=y CONFIG_ETH_USE_SPI_ETHERNET=y # CONFIG_ETH_SPI_ETHERNET_DM9051 is not set -CONFIG_ETH_SPI_ETHERNET_W5500=y +# CONFIG_ETH_SPI_ETHERNET_W5500 is not set # CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL is not set # CONFIG_ETH_USE_OPENETH is not set # end of Ethernet @@ -688,22 +425,22 @@ CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y -# CONFIG_ESP32C3_UNIVERSAL_MAC_ADDRESSES_TWO is not set -CONFIG_ESP32C3_UNIVERSAL_MAC_ADDRESSES_FOUR=y -CONFIG_ESP32C3_UNIVERSAL_MAC_ADDRESSES=4 +# CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO is not set +CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_FOUR=y +CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES=4 # end of MAC Config # # Sleep Config # -CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y +# CONFIG_ESP_SLEEP_POWER_DOWN_FLASH is not set +CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y -# CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND is not set +CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND=y +CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU=y CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y # end of Sleep Config -CONFIG_ESP_SLEEP_SYSTIMER_STALL_WORKAROUND=y - # # RTC Clock Config # @@ -715,6 +452,8 @@ CONFIG_RTC_CLOCK_BBPLL_POWER_ON_WITH_USB=y # IPC (Inter-Processor Call) # CONFIG_ESP_IPC_TASK_STACK_SIZE=1536 +CONFIG_ESP_IPC_USES_CALLERS_PRIORITY=y +CONFIG_ESP_IPC_ISR_ENABLE=y # end of IPC (Inter-Processor Call) # @@ -729,6 +468,7 @@ CONFIG_ESP_IPC_TASK_STACK_SIZE=1536 # LCD Peripheral Configuration # CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE=32 +# CONFIG_LCD_RGB_ISR_IRAM_SAFE is not set # end of LCD Peripheral Configuration # end of LCD and Touch Panel @@ -761,6 +501,7 @@ CONFIG_ESP_PHY_CALIBRATION_MODE=0 # # CONFIG_PM_ENABLE is not set CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y +CONFIG_PM_POWER_DOWN_TAGMEM_IN_LIGHT_SLEEP=y # end of Power Management # @@ -778,46 +519,45 @@ CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set # CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set # CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set -CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE=y CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK=y CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=y -# CONFIG_ESP_SYSTEM_USE_EH_FRAME is not set # # Memory protection # -CONFIG_ESP_SYSTEM_MEMPROT_DEPCHECK=y -CONFIG_ESP_SYSTEM_MEMPROT_FEATURE=y -CONFIG_ESP_SYSTEM_MEMPROT_FEATURE_LOCK=y -CONFIG_ESP_SYSTEM_MEMPROT_CPU_PREFETCH_PAD_SIZE=16 -CONFIG_ESP_SYSTEM_MEMPROT_MEM_ALIGN_SIZE=512 # end of Memory protection CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 CONFIG_ESP_MAIN_TASK_STACK_SIZE=3584 CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y +# CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1 is not set # CONFIG_ESP_MAIN_TASK_AFFINITY_NO_AFFINITY is not set CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 CONFIG_ESP_CONSOLE_UART_DEFAULT=y +# CONFIG_ESP_CONSOLE_USB_CDC is not set # CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG is not set # CONFIG_ESP_CONSOLE_UART_CUSTOM is not set # CONFIG_ESP_CONSOLE_NONE is not set # CONFIG_ESP_CONSOLE_SECONDARY_NONE is not set CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y CONFIG_ESP_CONSOLE_UART=y +CONFIG_ESP_CONSOLE_MULTIPLE_UART=y CONFIG_ESP_CONSOLE_UART_NUM=0 CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 CONFIG_ESP_INT_WDT=y CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 +CONFIG_ESP_INT_WDT_CHECK_CPU1=y CONFIG_ESP_TASK_WDT=y # CONFIG_ESP_TASK_WDT_PANIC is not set CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y # CONFIG_ESP_PANIC_HANDLER_IRAM is not set # CONFIG_ESP_DEBUG_STUBS_ENABLE is not set CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y +CONFIG_ESP_SYSTEM_BBPLL_RECALIB=y # end of ESP System Settings # @@ -836,13 +576,12 @@ CONFIG_ESP_TIMER_IMPL_SYSTIMER=y # Wi-Fi # CONFIG_ESP32_WIFI_ENABLED=y -CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE=y -CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=4 -CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=16 +CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10 +CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32 # CONFIG_ESP32_WIFI_STATIC_TX_BUFFER is not set CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 -CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=16 +CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=32 CONFIG_ESP_WIFI_STATIC_RX_MGMT_BUFFER=y # CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUFFER is not set CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0 @@ -853,6 +592,8 @@ CONFIG_ESP32_WIFI_TX_BA_WIN=6 CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y CONFIG_ESP32_WIFI_RX_BA_WIN=6 CONFIG_ESP32_WIFI_NVS_ENABLED=y +CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y +# CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 CONFIG_ESP32_WIFI_IRAM_OPT=y @@ -928,7 +669,10 @@ CONFIG_FMB_SERIAL_BUF_SIZE=256 CONFIG_FMB_SERIAL_ASCII_BITS_PER_SYMB=8 CONFIG_FMB_SERIAL_ASCII_TIMEOUT_RESPOND_MS=1000 CONFIG_FMB_PORT_TASK_PRIO=10 -CONFIG_FMB_PORT_TASK_AFFINITY=0x7FFFFFFF +# CONFIG_FMB_PORT_TASK_AFFINITY_NO_AFFINITY is not set +CONFIG_FMB_PORT_TASK_AFFINITY_CPU0=y +# CONFIG_FMB_PORT_TASK_AFFINITY_CPU1 is not set +CONFIG_FMB_PORT_TASK_AFFINITY=0x0 CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT=y CONFIG_FMB_CONTROLLER_SLAVE_ID=0x00112233 CONFIG_FMB_CONTROLLER_NOTIFY_TIMEOUT=20 @@ -942,13 +686,12 @@ CONFIG_FMB_EVENT_QUEUE_TIMEOUT=20 # # FreeRTOS # -CONFIG_FREERTOS_UNICORE=y +# CONFIG_FREERTOS_UNICORE is not set CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF CONFIG_FREERTOS_TICK_SUPPORT_SYSTIMER=y CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL1=y # CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL3 is not set CONFIG_FREERTOS_SYSTICK_USES_SYSTIMER=y -CONFIG_FREERTOS_OPTIMIZED_SCHEDULER=y CONFIG_FREERTOS_HZ=100 CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION=y # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set @@ -1018,20 +761,17 @@ CONFIG_HEAP_TRACING_OFF=y # # Log output # -CONFIG_LOG_DEFAULT_LEVEL_NONE=y +# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set # CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set # CONFIG_LOG_DEFAULT_LEVEL_WARN is not set -# CONFIG_LOG_DEFAULT_LEVEL_INFO is not set +CONFIG_LOG_DEFAULT_LEVEL_INFO=y # CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set # CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set -CONFIG_LOG_DEFAULT_LEVEL=0 +CONFIG_LOG_DEFAULT_LEVEL=3 CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y -# CONFIG_LOG_MAXIMUM_LEVEL_ERROR is not set -# CONFIG_LOG_MAXIMUM_LEVEL_WARN is not set -# CONFIG_LOG_MAXIMUM_LEVEL_INFO is not set # CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set # CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set -CONFIG_LOG_MAXIMUM_LEVEL=0 +CONFIG_LOG_MAXIMUM_LEVEL=3 CONFIG_LOG_COLORS=y CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y # CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set @@ -1047,7 +787,7 @@ CONFIG_LWIP_TCPIP_TASK_PRIO=18 # CONFIG_LWIP_CHECK_THREAD_SAFETY is not set CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y # CONFIG_LWIP_L2_TO_L3_COPY is not set -CONFIG_LWIP_IRAM_OPTIMIZATION=y +# CONFIG_LWIP_IRAM_OPTIMIZATION is not set CONFIG_LWIP_TIMERS_ONDEMAND=y CONFIG_LWIP_MAX_SOCKETS=10 # CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set @@ -1068,7 +808,7 @@ CONFIG_LWIP_ESP_GRATUITOUS_ARP=y CONFIG_LWIP_GARP_TMR_INTERVAL=60 CONFIG_LWIP_ESP_MLDV6_REPORT=y CONFIG_LWIP_MLDV6_TMR_INTERVAL=40 -CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=16 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y # CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y @@ -1105,8 +845,8 @@ CONFIG_LWIP_TCP_MSS=1440 CONFIG_LWIP_TCP_TMR_INTERVAL=250 CONFIG_LWIP_TCP_MSL=60000 CONFIG_LWIP_TCP_FIN_WAIT_TIMEOUT=20000 -CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744 -CONFIG_LWIP_TCP_WND_DEFAULT=5744 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5760 +CONFIG_LWIP_TCP_WND_DEFAULT=5760 CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 CONFIG_LWIP_TCP_QUEUE_OOSEQ=y CONFIG_LWIP_TCP_OOSEQ_TIMEOUT=6 @@ -1137,6 +877,7 @@ CONFIG_LWIP_CHECKSUM_CHECK_ICMP=y CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072 CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y # CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 is not set +# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1 is not set CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF # CONFIG_LWIP_PPP_SUPPORT is not set CONFIG_LWIP_IPV6_MEMP_NUM_ND6_QUEUE=3 @@ -1202,11 +943,8 @@ CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y # CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 -CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=2048 -CONFIG_MBEDTLS_DYNAMIC_BUFFER=y -CONFIG_MBEDTLS_DYNAMIC_FREE_PEER_CERT=y -CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA=y -CONFIG_MBEDTLS_DYNAMIC_FREE_CA_CERT=y +CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096 +# CONFIG_MBEDTLS_DYNAMIC_BUFFER is not set # CONFIG_MBEDTLS_DEBUG is not set # @@ -1215,6 +953,7 @@ CONFIG_MBEDTLS_DYNAMIC_FREE_CA_CERT=y # CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is not set # CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK is not set # CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION is not set +CONFIG_MBEDTLS_SSL_KEEP_PEER_CERTIFICATE=y # end of mbedTLS v2.28.x related # @@ -1323,7 +1062,7 @@ CONFIG_MBEDTLS_ECP_NIST_OPTIM=y # CONFIG_MBEDTLS_CHACHA20_C is not set # CONFIG_MBEDTLS_HKDF_C is not set # CONFIG_MBEDTLS_THREADING_C is not set -CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI=y +# CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI is not set # CONFIG_MBEDTLS_SECURITY_RISKS is not set # end of mbedTLS @@ -1335,6 +1074,7 @@ CONFIG_MDNS_TASK_PRIORITY=1 CONFIG_MDNS_TASK_STACK_SIZE=4096 # CONFIG_MDNS_TASK_AFFINITY_NO_AFFINITY is not set CONFIG_MDNS_TASK_AFFINITY_CPU0=y +# CONFIG_MDNS_TASK_AFFINITY_CPU1 is not set CONFIG_MDNS_TASK_AFFINITY=0x0 CONFIG_MDNS_SERVICE_ADD_TIMEOUT_MS=2000 # CONFIG_MDNS_STRICT_MODE is not set @@ -1397,6 +1137,9 @@ CONFIG_OPENSSL_ASSERT_EXIT=y CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5 CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 CONFIG_PTHREAD_STACK_MIN=768 +CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY=y +# CONFIG_PTHREAD_DEFAULT_CORE_0 is not set +# CONFIG_PTHREAD_DEFAULT_CORE_1 is not set CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" # end of PThreads @@ -1412,7 +1155,12 @@ CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" # # Features here require specific hardware (READ DOCS FIRST!) # -# CONFIG_SPI_FLASH_AUTO_SUSPEND is not set +# CONFIG_SPI_FLASH_HPM_ENA is not set +CONFIG_SPI_FLASH_HPM_AUTO=y +# CONFIG_SPI_FLASH_HPM_DIS is not set +CONFIG_SPI_FLASH_HPM_ON=y +CONFIG_SPI_FLASH_HPM_DC_AUTO=y +# CONFIG_SPI_FLASH_HPM_DC_DISABLE is not set # end of Optional and Experimental Features (READ DOCS FIRST) # end of Main Flash configuration @@ -1446,6 +1194,7 @@ CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP=y CONFIG_SPI_FLASH_SUPPORT_TH_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_MXIC_OPI_CHIP=y # end of Auto-detect flash chips CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y @@ -1499,6 +1248,12 @@ CONFIG_WS_BUFFER_SIZE=1024 # end of Websocket # end of TCP Transport +# +# TinyUSB Stack +# +# CONFIG_TINYUSB is not set +# end of TinyUSB Stack + # # Unity unit testing library # @@ -1511,10 +1266,24 @@ CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y # CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set # end of Unity unit testing library +# +# USB-OTG +# +CONFIG_USB_OTG_SUPPORTED=y +CONFIG_USB_HOST_CONTROL_TRANSFER_MAX_SIZE=256 +CONFIG_USB_HOST_HW_BUFFER_BIAS_BALANCED=y +# CONFIG_USB_HOST_HW_BUFFER_BIAS_IN is not set +# CONFIG_USB_HOST_HW_BUFFER_BIAS_PERIODIC_OUT is not set + # # Root Hub configuration # +CONFIG_USB_HOST_DEBOUNCE_DELAY_MS=250 +CONFIG_USB_HOST_RESET_HOLD_MS=30 +CONFIG_USB_HOST_RESET_RECOVERY_MS=30 +CONFIG_USB_HOST_SET_ADDR_RECOVERY_MS=10 # end of Root Hub configuration +# end of USB-OTG # # Virtual file system @@ -1545,9 +1314,7 @@ CONFIG_WL_SECTOR_SIZE=4096 # CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 -CONFIG_WIFI_PROV_BLE_BONDING=y -CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION=y -# CONFIG_WIFI_PROV_KEEP_BLE_ON_AFTER_PROV is not set +# CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION is not set # end of Wi-Fi Provisioning Manager # @@ -1585,3 +1352,141 @@ CONFIG_LUA_ROOT="/lua" # # CONFIG_LEGACY_INCLUDE_COMMON_HEADERS is not set # end of Compatibility options + +# Deprecated options for backward compatibility +CONFIG_TOOLPREFIX="xtensa-esp32s3-elf-" +# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set +CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y +# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set +CONFIG_LOG_BOOTLOADER_LEVEL=3 +# CONFIG_APP_ROLLBACK_ENABLE is not set +# CONFIG_FLASH_ENCRYPTION_ENABLED is not set +# CONFIG_FLASHMODE_QIO is not set +# CONFIG_FLASHMODE_QOUT is not set +CONFIG_FLASHMODE_DIO=y +# CONFIG_FLASHMODE_DOUT is not set +# CONFIG_MONITOR_BAUD_9600B is not set +# CONFIG_MONITOR_BAUD_57600B is not set +CONFIG_MONITOR_BAUD_115200B=y +# CONFIG_MONITOR_BAUD_230400B is not set +# CONFIG_MONITOR_BAUD_921600B is not set +# CONFIG_MONITOR_BAUD_2MB is not set +# CONFIG_MONITOR_BAUD_OTHER is not set +CONFIG_MONITOR_BAUD_OTHER_VAL=115200 +CONFIG_MONITOR_BAUD=115200 +CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG=y +# CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set +CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y +# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set +# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set +CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2 +# CONFIG_CXX_EXCEPTIONS is not set +CONFIG_STACK_CHECK_NONE=y +# CONFIG_STACK_CHECK_NORM is not set +# CONFIG_STACK_CHECK_STRONG is not set +# CONFIG_STACK_CHECK_ALL is not set +# CONFIG_WARN_WRITE_STRINGS is not set +# CONFIG_DISABLE_GCC8_WARNINGS is not set +# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set +CONFIG_ESP32_APPTRACE_DEST_NONE=y +CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y +CONFIG_ADC2_DISABLE_DAC=y +# CONFIG_EVENT_LOOP_PROFILING is not set +CONFIG_POST_EVENTS_FROM_ISR=y +CONFIG_POST_EVENTS_FROM_IRAM_ISR=y +# CONFIG_ESP_SYSTEM_PD_FLASH is not set +CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND=y +CONFIG_IPC_TASK_STACK_SIZE=1536 +CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y +# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP32_PHY_MAX_TX_POWER=20 +# CONFIG_ESP32_REDUCE_PHY_TX_POWER is not set +CONFIG_ESP_SYSTEM_PM_POWER_DOWN_CPU=y +# CONFIG_ESP32S2_PANIC_PRINT_HALT is not set +CONFIG_ESP32S2_PANIC_PRINT_REBOOT=y +# CONFIG_ESP32S2_PANIC_SILENT_REBOOT is not set +# CONFIG_ESP32S2_PANIC_GDBSTUB is not set +CONFIG_ESP32S2_ALLOW_RTC_FAST_MEM_AS_HEAP=y +CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_MAIN_TASK_STACK_SIZE=3584 +CONFIG_CONSOLE_UART_DEFAULT=y +# CONFIG_CONSOLE_UART_CUSTOM is not set +# CONFIG_ESP_CONSOLE_UART_NONE is not set +CONFIG_CONSOLE_UART=y +CONFIG_CONSOLE_UART_NUM=0 +CONFIG_CONSOLE_UART_BAUDRATE=115200 +CONFIG_INT_WDT=y +CONFIG_INT_WDT_TIMEOUT_MS=300 +CONFIG_INT_WDT_CHECK_CPU1=y +CONFIG_TASK_WDT=y +# CONFIG_TASK_WDT_PANIC is not set +CONFIG_TASK_WDT_TIMEOUT_S=5 +CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y +# CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set +CONFIG_TIMER_TASK_STACK_SIZE=3584 +# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set +# CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set +CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y +CONFIG_MB_MASTER_TIMEOUT_MS_RESPOND=150 +CONFIG_MB_MASTER_DELAY_MS_CONVERT=200 +CONFIG_MB_QUEUE_LENGTH=20 +CONFIG_MB_SERIAL_TASK_STACK_SIZE=4096 +CONFIG_MB_SERIAL_BUF_SIZE=256 +CONFIG_MB_SERIAL_TASK_PRIO=10 +CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT=y +CONFIG_MB_CONTROLLER_SLAVE_ID=0x00112233 +CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT=20 +CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE=20 +CONFIG_MB_CONTROLLER_STACK_SIZE=4096 +CONFIG_MB_EVENT_QUEUE_TIMEOUT=20 +# CONFIG_MB_TIMER_PORT_ENABLED is not set +# CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set +CONFIG_TIMER_TASK_PRIORITY=1 +CONFIG_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_TIMER_QUEUE_LENGTH=10 +# CONFIG_L2_TO_L3_COPY is not set +# CONFIG_USE_ONLY_LWIP_SELECT is not set +CONFIG_ESP_GRATUITOUS_ARP=y +CONFIG_GARP_TMR_INTERVAL=60 +CONFIG_TCPIP_RECVMBOX_SIZE=32 +CONFIG_TCP_MAXRTX=12 +CONFIG_TCP_SYNMAXRTX=12 +CONFIG_TCP_MSS=1440 +CONFIG_TCP_MSL=60000 +CONFIG_TCP_SND_BUF_DEFAULT=5760 +CONFIG_TCP_WND_DEFAULT=5760 +CONFIG_TCP_RECVMBOX_SIZE=6 +CONFIG_TCP_QUEUE_OOSEQ=y +# CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set +CONFIG_TCP_OVERSIZE_MSS=y +# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set +# CONFIG_TCP_OVERSIZE_DISABLE is not set +CONFIG_UDP_RECVMBOX_SIZE=6 +CONFIG_TCPIP_TASK_STACK_SIZE=3072 +CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y +# CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set +# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set +CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF +# CONFIG_PPP_SUPPORT is not set +CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 +CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 +CONFIG_ESP32_PTHREAD_STACK_MIN=768 +CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set +CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" +CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set +# CONFIG_USB_ENABLED is not set +CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y +CONFIG_SUPPORT_TERMIOS=y +CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 +# End of deprecated options From 01dbe5b3a3941b6a939a740fe44882e78156bcea Mon Sep 17 00:00:00 2001 From: Krishna Kumar Sah Date: Wed, 28 Feb 2024 10:25:02 +0545 Subject: [PATCH 25/27] fixed ble-wifi storing issue --- .gitignore | 1 + .../ezlopi_core_ezlopi_cloud_api_macros.h | 2 +- .../ezlopi_core_factory_info.c | 6 +- .../ezlopi-core-wifi/ezlopi_core_wifi.c | 4 - .../ezlopi-service-ble/CMakeLists.txt | 2 +- .../ezlopi_ble_service_security.c | 203 ------------------ .../ezlopi_service_ble_wifi.c | 31 +-- 7 files changed, 24 insertions(+), 225 deletions(-) delete mode 100644 ezlopi-services/ezlopi-service-ble/ezlopi_ble_service_security.c diff --git a/.gitignore b/.gitignore index 0ea47b081..a19c9951c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +firmware/** firmware/v*/** firmware/releaseNote.txt firmware/ezlopi/firmware/** diff --git a/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_cloud_api_macros.h b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_cloud_api_macros.h index e5121a95b..98e93b872 100644 --- a/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_cloud_api_macros.h +++ b/ezlopi-core/ezlopi-core-ezlopi/ezlopi_core_ezlopi_cloud_api_macros.h @@ -1,6 +1,6 @@ // ("name", func, updater_func) CLOUD_METHOD("hub.items.list", items_list_v3, NULL) -CLOUD_METHOD("hub.item.value.set", items_set_value_v3, items_update_v3) +CLOUD_METHOD("hub.item.value.set", items_set_value_v3, NULL) CLOUD_METHOD("hub.devices.list", devices_list_v3, NULL) CLOUD_METHOD("hub.device.name.set", device_name_set, device_updated) diff --git a/ezlopi-core/ezlopi-core-factory-info/ezlopi_core_factory_info.c b/ezlopi-core/ezlopi-core-factory-info/ezlopi_core_factory_info.c index b74acbb85..0c8e72685 100644 --- a/ezlopi-core/ezlopi-core-factory-info/ezlopi_core_factory_info.c +++ b/ezlopi-core/ezlopi-core-factory-info/ezlopi_core_factory_info.c @@ -447,7 +447,7 @@ char* ezlopi_factory_info_v3_get_ssl_shared_key(void) char* ezlopi_factory_info_v3_get_ezlopi_config(void) { - char *ret = ezlopi_factory_info_v3_read_string(ezlopi_factory_info_v3_get_abs_address(EZLOPI_FINFO_REL_OFFSET_EZLOPI_CONFIG_JSON, E_EZLOPI_FACTORY_INFO_CONN_DATA), EZLOPI_FINFO_LEN_EZLOPI_CONFIG_JSON); + char* ret = ezlopi_factory_info_v3_read_string(ezlopi_factory_info_v3_get_abs_address(EZLOPI_FINFO_REL_OFFSET_EZLOPI_CONFIG_JSON, E_EZLOPI_FACTORY_INFO_CONN_DATA), EZLOPI_FINFO_LEN_EZLOPI_CONFIG_JSON); if (false == isprint(ret[0])) { if (ret) @@ -622,6 +622,7 @@ int ezlopi_factory_info_v3_set_wifi(char* ssid, char* password) { snprintf(tmp_buffer + EZLOPI_FINFO_REL_OFFSET_WIFI_SSID, EZLOPI_FINFO_LEN_WIFI_SSID, "%s", ssid); snprintf(tmp_buffer + EZLOPI_FINFO_REL_OFFSET_WIFI_PASS, EZLOPI_FINFO_LEN_WIFI_PASS, "%s", password); + if (ESP_OK == esp_partition_erase_range(partition_ctx_v3, EZLOPI_FINFO_OFFSET_HUB_DATA, EZLOPI_FINFO_READ_LEN_4KB)) { if (ESP_OK == esp_partition_write(partition_ctx_v3, EZLOPI_FINFO_OFFSET_HUB_DATA, tmp_buffer, EZLOPI_FINFO_READ_LEN_4KB)) @@ -629,6 +630,9 @@ int ezlopi_factory_info_v3_set_wifi(char* ssid, char* password) ret = 1; } } + else { + TRACE_E("failed to save wifi"); + } } else { diff --git a/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.c b/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.c index da689bd82..6cd5076e7 100644 --- a/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.c +++ b/ezlopi-core/ezlopi-core-wifi/ezlopi_core_wifi.c @@ -333,10 +333,6 @@ esp_err_t ezlopi_wifi_connect(const char* ssid, const char* pass) strncpy((char*)wifi_config.sta.password, pass, sizeof(wifi_config.sta.password)); wifi_config.sta.threshold.authmode = WIFI_AUTH_WPA2_PSK; - - ezlopi_factory_info_v3_free(ssid); - ezlopi_factory_info_v3_free(pass); - esp_wifi_stop(); esp_err_t _err = esp_wifi_set_mode(WIFI_MODE_STA); // TRACE_W("WiFi Err : %s", esp_err_to_name(_err)); diff --git a/ezlopi-services/ezlopi-service-ble/CMakeLists.txt b/ezlopi-services/ezlopi-service-ble/CMakeLists.txt index 6f8c6734d..fddc09259 100644 --- a/ezlopi-services/ezlopi-service-ble/CMakeLists.txt +++ b/ezlopi-services/ezlopi-service-ble/CMakeLists.txt @@ -9,7 +9,7 @@ set(EZLOPI_CORE_COMPONENTS ) -idf_component_register(SRCS "ezlopi_service_ble_provisioning.c" "ezlopi_ble_service_security.c" "ezlopi_service_ble_security.c" "ezlopi_service_ble_device_info.c" "ezlopi_service_ble.c" "ezlopi_service_ble_dynamic_config.c" "${src_files}" +idf_component_register(SRCS "${src_files}" INCLUDE_DIRS "." REQUIRES ${EZLOPI_CORE_COMPONENTS} ) diff --git a/ezlopi-services/ezlopi-service-ble/ezlopi_ble_service_security.c b/ezlopi-services/ezlopi-service-ble/ezlopi_ble_service_security.c deleted file mode 100644 index adeadcdd8..000000000 --- a/ezlopi-services/ezlopi-service-ble/ezlopi_ble_service_security.c +++ /dev/null @@ -1,203 +0,0 @@ -#include - -#include "lwip/ip_addr.h" -#include "cJSON.h" - -#include "ezlopi_util_trace.h" - -#include "ezlopi_core_nvs.h" -#include "ezlopi_core_wifi.h" -#include "ezlopi_core_reset.h" -#include "ezlopi_core_ble_gap.h" -#include "ezlopi_core_ble_gatt.h" -#include "ezlopi_core_ble_buffer.h" -#include "ezlopi_core_ble_profile.h" -#include "ezlopi_core_factory_info.h" - -#include "ezlopi_cloud_constants.h" - -#include "ezlopi_service_ble.h" - -typedef enum e_ble_security_commands -{ - BLE_CMD_UNDEFINED = 0, // 0 - BLE_CMD_REBOOT, // 1 - BLE_CMD_SOFTRESET, // 2 - BLE_CMD_HARDREST, // 3 - BLE_CMD_FACTORY_RESET, // 4 - BLE_CMD_AUTHENTICATE, // 5 - BLE_CMD_MAX, -} e_ble_security_commands_t; - -#if (1 == EZLOPI_BLE_ENALBE_PASSKEY) -static uint32_t start_tick = 0; -static uint32_t authenticated_flag = 0; -#endif -static s_gatt_service_t *security_service = NULL; - -#if (1 == EZLOPI_BLE_ENALBE_PASSKEY) -s_gatt_char_t *passkey_characterstic = NULL; -static void passkey_write_func(esp_gatt_value_t *value, esp_ble_gatts_cb_param_t *param); -#endif - -static s_gatt_char_t *factory_reset_characterstic = NULL; -static void __process_auth_command(cJSON *root); -// static void __process_soft_reset_command(void); -static void __process_hard_reset_command(void); -// static void __process_factory_reset_command(void); - -static void factory_reset_write_func(esp_gatt_value_t *value, esp_ble_gatts_cb_param_t *param); - -#define CJ_GET_NUMBER(name) cJSON_GetNumberValue(cJSON_GetObjectItem(root, name)) - -void ezlopi_ble_service_security_init(void) -{ - esp_bt_uuid_t uuid; - esp_gatt_perm_t permission; - esp_gatt_char_prop_t properties; - - uuid.len = ESP_UUID_LEN_16; - uuid.uuid.uuid16 = BLE_SECURITY_SERVICE_UUID; - security_service = ezlopi_ble_gatt_create_service(BLE_SECURITY_SERVICE_HANDLE, &uuid); - -#if (1 == EZLOPI_BLE_ENALBE_PASSKEY) - uuid.uuid.uuid16 = BLE_SECURITY_CHAR_PASSKEY_UUID; - uuid.len = ESP_UUID_LEN_16; - permission = ESP_GATT_PERM_WRITE; - properties = ESP_GATT_CHAR_PROP_BIT_WRITE; - passkey_characterstic = ezlopi_ble_gatt_add_characteristic(security_service, &uuid, permission, properties, NULL, passkey_write_func, NULL); -#endif - - uuid.uuid.uuid16 = BLE_SECURITY_FACTORY_RESET_CHAR_UUID; - uuid.len = ESP_UUID_LEN_16; - permission = ESP_GATT_PERM_WRITE; - properties = ESP_GATT_CHAR_PROP_BIT_WRITE; - factory_reset_characterstic = ezlopi_ble_gatt_add_characteristic(security_service, &uuid, permission, properties, NULL, factory_reset_write_func, NULL); -} - -#if (1 == EZLOPI_BLE_ENALBE_PASSKEY) -static void passkey_write_func(esp_gatt_value_t *value, esp_ble_gatts_cb_param_t *param) -{ - if (param->write.len == 4) - { - uint32_t passkey = *((uint32_t *)param->write.value); - if (passkey < 1000000) - { - TRACE_D("New passkey: %d", passkey); - ezlopi_ble_gap_set_passkey(passkey); - ezlopi_nvs_write_ble_passkey(passkey); - ezlopi_ble_gap_dissociate_bonded_devices(); - } - } -} -#endif - -static void factory_reset_write_func(esp_gatt_value_t *value, esp_ble_gatts_cb_param_t *param) -{ - if (param && param->write.len && param->write.value) - { - cJSON *root = cJSON_ParseWithLength((const char *)param->write.value, param->write.len); - if (root) - { - - uint32_t cmd = CJ_GET_NUMBER(ezlopi_cmd_str); - - TRACE_D("cmd: %d", cmd); - - switch (cmd) - { - case BLE_CMD_REBOOT: - { - EZPI_CORE_reboot(); - break; - } - case BLE_CMD_FACTORY_RESET: // factory reset command - { - // __process_factory_reset_command(); - break; - } - case BLE_CMD_HARDREST: - { - __process_hard_reset_command(); - break; - } - case BLE_CMD_AUTHENTICATE: // authentication request for soft-factory-reset - { - __process_auth_command(root); - break; - } - default: - { - TRACE_W("Command not valid -> {cmd: %u}.", cmd); - break; - } - } - - cJSON_free(root); - } - } -} - -static void __process_hard_reset_command(void) -{ - -#if (1 == EZLOPI_BLE_ENALBE_PASSKEY) - uint32_t current_tick = xTaskGetTickCount(); - if ((1 == authenticated_flag) && (current_tick - start_tick) < (30 * 1000 / portTICK_RATE_MS)) // once authenticated, valid for 30 seconds only - { -#endif - int ret = ezlopi_factory_info_v3_factory_reset(); - if (ret) - { - TRACE_S("FLASH RESET WAS DONE SUCCESSFULLY"); - } - - ret = ezlopi_nvs_factory_reset(); - if (ret) - { - TRACE_S("NVS-RESET WAS DONE SUCCESSFULLY"); - } - - TRACE_I("factory reset done, rebooting now ............................................."); - vTaskDelay(2000 / portTICK_RATE_MS); - EZPI_CORE_reboot(); -#if (1 == EZLOPI_BLE_ENALBE_PASSKEY) - } - else - { - authenticated_flag = 0; - TRACE_W("Not authenticated for factory-reset!"); - } -#endif -} - -// static void __process_soft_reset_command(void) -// { -// } - -// static void __process_factory_reset_command(void) -// { -// } - -static void __process_auth_command(cJSON *root) -{ -#if (1 == EZLOPI_BLE_ENALBE_PASSKEY) - uint32_t passkey = CJ_GET_NUMBER("passkey"); - uint32_t original_passkey = 0; - ezlopi_nvs_read_ble_passkey(&original_passkey); - - TRACE_D("Old passkey: %u, current_passkey: %u", original_passkey, passkey); - - if (passkey == original_passkey) - { - authenticated_flag = 1; - TRACE_W("Authenticated!"); - start_tick = xTaskGetTickCount(); - } - else - { - authenticated_flag = 0; - TRACE_W("Not authenticated!"); - } -#endif -} \ No newline at end of file diff --git a/ezlopi-services/ezlopi-service-ble/ezlopi_service_ble_wifi.c b/ezlopi-services/ezlopi-service-ble/ezlopi_service_ble_wifi.c index 84397ec7e..394c17cb7 100644 --- a/ezlopi-services/ezlopi-service-ble/ezlopi_service_ble_wifi.c +++ b/ezlopi-services/ezlopi-service-ble/ezlopi_service_ble_wifi.c @@ -19,14 +19,14 @@ #include "ezlopi_service_ble_ble_auth.h" #include "ezlopi_service_ble.h" -static s_linked_buffer_t *wifi_creds_linked_buffer = NULL; +static s_linked_buffer_t* wifi_creds_linked_buffer = NULL; -static void wifi_creds_write_func(esp_gatt_value_t *value, esp_ble_gatts_cb_param_t *param); -static void wifi_creds_write_exec_func(esp_gatt_value_t *value, esp_ble_gatts_cb_param_t *param); -static void wifi_creds_parse_and_connect(uint8_t *value, uint32_t len); +static void wifi_creds_write_func(esp_gatt_value_t* value, esp_ble_gatts_cb_param_t* param); +static void wifi_creds_write_exec_func(esp_gatt_value_t* value, esp_ble_gatts_cb_param_t* param); +static void wifi_creds_parse_and_connect(uint8_t* value, uint32_t len); // static void wifi_event_notify_upcall(esp_event_base_t event, void *arg); -static s_gatt_service_t *wifi_ble_service; +static s_gatt_service_t* wifi_ble_service; void ezlopi_ble_service_wifi_profile_init(void) { @@ -46,7 +46,7 @@ void ezlopi_ble_service_wifi_profile_init(void) ezlopi_ble_gatt_add_characteristic(wifi_ble_service, &uuid, permission, properties, NULL, wifi_creds_write_func, wifi_creds_write_exec_func); } -static void wifi_creds_write_func(esp_gatt_value_t *value, esp_ble_gatts_cb_param_t *param) +static void wifi_creds_write_func(esp_gatt_value_t* value, esp_ble_gatts_cb_param_t* param) { if (0 == param->write.is_prep) // Data received in single packet { @@ -68,7 +68,7 @@ static void wifi_creds_write_func(esp_gatt_value_t *value, esp_ble_gatts_cb_para } } -static void wifi_creds_write_exec_func(esp_gatt_value_t *value, esp_ble_gatts_cb_param_t *param) +static void wifi_creds_write_exec_func(esp_gatt_value_t* value, esp_ble_gatts_cb_param_t* param) { if (wifi_creds_linked_buffer) { @@ -79,22 +79,23 @@ static void wifi_creds_write_exec_func(esp_gatt_value_t *value, esp_ble_gatts_cb } } -static void wifi_creds_parse_and_connect(uint8_t *value, uint32_t len) +static void wifi_creds_parse_and_connect(uint8_t* value, uint32_t len) { if ((NULL != value) && (len > 0)) { - cJSON *root = cJSON_Parse((const char *)value); + cJSON* root = cJSON_Parse((const char*)value); + if (root) { - cJSON *cj_ssid = cJSON_GetObjectItemCaseSensitive(root, ezlopi_wifi_ssid_str); - cJSON *cj_user_id = cJSON_GetObjectItemCaseSensitive(root, ezlopi_user_id_str); - cJSON *cj_password = cJSON_GetObjectItemCaseSensitive(root, ezlopi_wifi_password_str); + cJSON* cj_ssid = cJSON_GetObjectItemCaseSensitive(root, ezlopi_wifi_ssid_str); + cJSON* cj_user_id = cJSON_GetObjectItemCaseSensitive(root, ezlopi_user_id_str); + cJSON* cj_password = cJSON_GetObjectItemCaseSensitive(root, ezlopi_wifi_password_str); if (cj_user_id && cj_user_id->valuestring && cj_password && cj_password->valuestring && cj_ssid && cj_ssid->valuestring) { - char *ssid = cj_ssid->valuestring; - char *password = cj_password->valuestring; - char *user_id_str = cj_user_id->valuestring; + char* ssid = cj_ssid->valuestring; + char* password = cj_password->valuestring; + char* user_id_str = cj_user_id->valuestring; if (user_id_str && ssid && password) { From 52b6e535c25867579f2969358cc4232076d0e337 Mon Sep 17 00:00:00 2001 From: lomasSE89 Date: Wed, 28 Feb 2024 12:38:40 +0545 Subject: [PATCH 26/27] added RELEASE_NOTES, and fixed CMake Files. --- README.md | 8 +- RELEASE_NOTES.md | 190 ++++ .../ezlopi-core-event-group/CMakeLists.txt | 2 +- .../ezlopi_core_event_group.c | 2 +- ezlopi-core/ezlopi-core-ezlopi/CMakeLists.txt | 3 +- .../ezlopi_core_factory_info.c | 2 +- ezlopi-core/ezlopi-core-scenes/CMakeLists.txt | 4 +- ezlopi-doc/ezlopi_cover.png | Bin 0 -> 138282 bytes ezlopi-doc/ezlopi_logo.png | Bin 0 -> 36261 bytes .../ezlopi_screenshot.png | Bin .../ezlopi_web_flasher.png | Bin .../ezlopi-service-ble/CMakeLists.txt | 3 +- sdkconfig | 448 ++++----- sdkconfig.esp32.4mb | 144 ++- sdkconfig.old | 890 +++++++++++++----- 15 files changed, 1103 insertions(+), 593 deletions(-) create mode 100644 RELEASE_NOTES.md create mode 100644 ezlopi-doc/ezlopi_cover.png create mode 100644 ezlopi-doc/ezlopi_logo.png rename {ezlop-doc => ezlopi-doc}/ezlopi_screenshot.png (100%) rename {ezlop-doc => ezlopi-doc}/ezlopi_web_flasher.png (100%) diff --git a/README.md b/README.md index 44b48e589..ed97f5555 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,11 @@ [![GitHub issues](https://img.shields.io/github/issues/ezloteam/Ezlo_Pi)](https://github.com/ezloteam/Ezlo_Pi/issues) [![GitHub forks](https://img.shields.io/github/forks/ezloteam/Ezlo_Pi)](https://github.com/ezloteam/Ezlo_Pi/network) -# ezlopi + + + + +# EzloPi EzloPi is a collaborative open-source project developed by Ezlo Innovation to enhance the functionalities of devices and platforms powered by the ESP32 chipset. It offers exceptional features that allow seamless configuration and control of ESP-based devices, empowering you to transform your automation concepts into reality. Checkout our [website](https://www.ezlopi.com/) for further guide and examples @@ -20,7 +24,7 @@ Checkout our [website](https://www.ezlopi.com/) for further guide and examples # 1. Getting started EzloPi features a [web-based configurator](https://config.ezlopi.com/) that allows you to easily configure your ESP32 device for various supported features. The web interface provides a user-friendly platform to set up relays, analog inputs, digital inputs, and I2C-based sensors on your ESP32 device with ease. Once configured, you can leverage our cloud and mobile app services to remotely control your device in real-time. -![EzloPi web configurator](ezlop-doc/ezlopi_web_flasher.png) +![EzloPi web configurator](ezlopi-doc/ezlopi_web_flasher.png) # 2. Customizing and building EzloPi firmware in your local setup It is required to have [ESP-IDF](https://github.com/espressif/esp-idf) installed in your machine. diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md new file mode 100644 index 000000000..3725b33ca --- /dev/null +++ b/RELEASE_NOTES.md @@ -0,0 +1,190 @@ + + + + + +# RELEASE NOTES + +## Supported Ezlo Cloud APIs + +1. [Items](https://api.ezlo.com/hub/items_api/index.html) + - [hub.items.list](https://api.ezlo.com/hub/items_api/index.html#hubitemslist) + - [hub.item.value.set (single item)](https://api.ezlo.com/hub/items_api/index.html#hubitemvalueset-single-item) + +2. [Devices](https://api.ezlo.com/hub/devices_api/index.html) + - [hub.devices.list](https://api.ezlo.com/hub/devices_api/index.html#hubdeviceslist) + - [hub.device.name.set](https://api.ezlo.com/hub/devices_api/index.html#hubdevicenameset) + - [hub.device.room.set](https://api.ezlo.com/hub/devices_api/index.html#hubdeviceroomset) + +3. [Device Settings](https://api.ezlo.com/hub/settings_api/index.html) + - [hub.device.settings.list](https://api.ezlo.com/hub/settings_api/index.html#hubdevicesettingslist) + - [hub.device.setting.value.set](https://api.ezlo.com/hub/settings_api/index.html#hubdevicesettingvalueset) + - [hub.device.setting.reset](https://api.ezlo.com/hub/settings_api/index.html#hubdevicesettingreset) + +4. [Room](https://api.ezlo.com/hub/room/index.html) + - [hub.room.list](https://api.ezlo.com/hub/room/index.html#hubroomlist) + - [hub.room.create](https://api.ezlo.com/hub/room/index.html#hubroomcreate) + - [hub.room.name.set](https://api.ezlo.com/hub/room/index.html#hubroomnameset) + - [hub.room.get](https://api.ezlo.com/hub/room/index.html#hubroomget) + - [hub.room.delete](https://api.ezlo.com/hub/room/index.html#hubroomdelete) + +5. [Common commands](https://api.ezlo.com/hub/common/index.html) + - [hub.info.get](https://api.ezlo.com/hub/common/index.html#hubinfoget) + - [hub.reboot](https://api.ezlo.com/hub/common/index.html#hubreboot) + +6. [Network](https://log.ezlo.com/new/hub/network/) + - [hub.network.get](https://log.ezlo.com/new/hub/network/#hubnetworkget) + - [hub.network.wifi.scan.start](https://log.ezlo.com/new/hub/network/#hubnetworkwifiscanstart) + - [hub.network.wifi.scan.stop](https://log.ezlo.com/new/hub/network/#hubnetworkwifiscanstop) + + +7. [House Modes commands](https://api.ezlo.com/hub/house_modes_manager/index.html#house-modes-commands) + - [hub.modes.get](https://api.ezlo.com/hub/house_modes_manager/index.html#hubmodesget) + - [hub.modes.current.get](https://api.ezlo.com/hub/house_modes_manager/index.html#hubmodescurrentget) + - [hub.modes.switch](https://api.ezlo.com/hub/house_modes_manager/index.html#hubmodesswitch) + + +8. [Broadcasts](https://api.ezlo.com/hub/broadcasts/index.html) + - [hub.item.updated](https://api.ezlo.com/hub/broadcasts/index.html#hubitemupdated) + - [hub.room.created](https://api.ezlo.com/hub/broadcasts/index.html#hubroomcreated) + - [hub.room.deleted](https://api.ezlo.com/hub/broadcasts/index.html#hubroomdeleted) + - [hub.room.reordered](https://api.ezlo.com/hub/broadcasts/index.html#hubroomreordered) + - [hub.room.edited](https://api.ezlo.com/hub/broadcasts/index.html#hubroomedited) + - [hub.scene.added](https://api.ezlo.com/hub/broadcasts/index.html#hubsceneadded) + - [hub.scene.deleted](https://api.ezlo.com/hub/broadcasts/index.html#hubscenedeleted) + - [hub.scene.changed](https://api.ezlo.com/hub/broadcasts/index.html#hubscenechanged) + - [hub.scene.run.progress](https://api.ezlo.com/hub/broadcasts/index.html#hubscenerunprogress) + - [hub.network.wifi.scan.progress](https://api.ezlo.com/hub/broadcasts/index.html#hubnetworkwifiscanprogress) + - [hub.device.setting.updated](https://api.ezlo.com/hub/broadcasts/index.html#hubdevicesettingupdated) + +9. [Scenes](https://api.ezlo.com/hub/scenes/local_scenes_api/index.html) + - [hub.scenes.create](https://api.ezlo.com/hub/scenes/local_scenes_api/index.html#hubscenescreate) + - [hub.scenes.get](https://api.ezlo.com/hub/scenes/local_scenes_api/index.html#hubscenesget) + - [hub.scenes.list](https://api.ezlo.com/hub/scenes/local_scenes_api/index.html#hubsceneslist) + - [hub.scenes.edit](https://api.ezlo.com/hub/scenes/local_scenes_api/index.html#hubscenesedit) + - [hub.scenes.delete](https://api.ezlo.com/hub/scenes/local_scenes_api/index.html#hubscenesdelete) + - [hub.scenes.block.data.list](https://api.ezlo.com/hub/scenes/local_scenes_api/index.html#hubscenesblockdatalist) + - [hub.scenes.enabled.set](https://api.ezlo.com/hub/scenes/local_scenes_api/index.html#hubscenesenabledset) + - [hub.scenes.notification.add](https://api.ezlo.com/hub/scenes/local_scenes_api/index.html#hubscenesnotificationadd) + - [hub.scenes.notification.remove](https://api.ezlo.com/hub/scenes/local_scenes_api/index.html#hubscenesnotificationremove) + - [hub.scenes.run](https://api.ezlo.com/hub/scenes/local_scenes_api/index.html#hubscenesrun) + - [hub.scenes.name.set](https://api.ezlo.com/hub/scenes/local_scenes_api/index.html#hubscenesnameset) + - [hub.scenes.expressions.set](https://api.ezlo.com/hub/scenes/local_scenes_api/index.html#hubscenesexpressionsset) + - [hub.scenes.expressions.delete](https://api.ezlo.com/hub/scenes/local_scenes_api/index.html#hubscenesexpressionsdelete) + - [hub.scenes.expressions.list](https://api.ezlo.com/hub/scenes/local_scenes_api/index.html#hubscenesexpressionslist) + + +10. [Scenes : When blocks](https://api.ezlo.com/hub/scenes/when_blocks/index.html) + - [isItemState](https://api.ezlo.com/hub/scenes/when_blocks/index.html#isitemstate) + - [isItemStateChanged](https://api.ezlo.com/hub/scenes/when_blocks/index.html#isitemstatechanged) + - [isInterval](https://api.ezlo.com/hub/scenes/when_blocks/index.html#isinterval) + - [isSunState](https://api.ezlo.com/hub/scenes/when_blocks/index.html#issunstate) + - [isOnce](https://api.ezlo.com/hub/scenes/when_blocks/index.html#isonce) + - [isDateRange](https://api.ezlo.com/hub/scenes/when_blocks/index.html#isdaterange) + - [isDeviceState](https://api.ezlo.com/hub/scenes/when_blocks/index.html#isdevicestate) + - [isSceneState](https://api.ezlo.com/hub/scenes/when_blocks/index.html#isscenestate) + - [isCloudState](https://api.ezlo.com/hub/scenes/when_blocks/index.html#iscloudstate) + - [compareNumbers](https://api.ezlo.com/hub/scenes/when_blocks/index.html#comparenumbers) + - [compareNumberRange](https://api.ezlo.com/hub/scenes/when_blocks/index.html#comparenumberrange) + - [compareStrings](https://api.ezlo.com/hub/scenes/when_blocks/index.html#comparestrings) + - [stringOperation](https://api.ezlo.com/hub/scenes/when_blocks/index.html#stringoperation) + - [inArray](https://api.ezlo.com/hub/scenes/when_blocks/index.html#inarray) + - [compareValues](https://api.ezlo.com/hub/scenes/when_blocks/index.html#comparevalues) + - [hasAtLeastOneDictionaryValue](https://api.ezlo.com/hub/scenes/when_blocks/index.html#hasatleastonedictionaryvalue) + - [isFirmwareUpdateState](https://api.ezlo.com/hub/scenes/when_blocks/index.html#isfirmwareupdatestate) + - [isDictionaryChanged](https://api.ezlo.com/hub/scenes/when_blocks/index.html#isdictionarychanged) + - [and](https://api.ezlo.com/hub/scenes/when_blocks/index.html#and) + - [not](https://api.ezlo.com/hub/scenes/when_blocks/index.html#not) + - [or](https://api.ezlo.com/hub/scenes/when_blocks/index.html#or) + - [xor](https://api.ezlo.com/hub/scenes/when_blocks/index.html#xor) + +11. [Scenes : Action blocks](https://api.ezlo.com/hub/scenes/action_blocks/index.html#action-blocks) + - [setItemValue](https://api.ezlo.com/hub/scenes/action_blocks/index.html#setitemvalue) + - [sendHttpRequest](https://api.ezlo.com/hub/scenes/action_blocks/index.html#sendhttprequest) + - [runCustomScript](https://api.ezlo.com/hub/scenes/action_blocks/index.html#runcustomscript) + - [rebootHub](https://api.ezlo.com/hub/scenes/action_blocks/index.html#reboothub) + - [resetHub](https://api.ezlo.com/hub/scenes/action_blocks/index.html#resethub) + + +## Supported Sensors + + +1. MPU6050 Accelerometer and Gyroscope +2. ADXL345 3-Axis Accelerometer +3. GY-271 Magnetometer +4. LTR303ALS Luminosity sensor +5. RMT SK6812 +6. BMP680 I2C Sensor +7. BMP280 I2C Sensor +8. DHT11 Temperature Humidity Sensor +9. DHT22 Temperature Humidity Sensor +10. Potentiometer +11. Internal Hall Effect Sensor +12. PIR Sensor +13. Parallax 2-Axis Joystick +14. MB1013 Sonar +15. PWM Generic Load +16. Touch Switch TTP223B (Toggle) +17. Ultrasonic Sensor HC SR04 +18. LDR Digital and analog Sensor +19. Water Leak Sensor +20. GY61 3-Axis Accelerometer +21. GXHTC3 - RH and T Sensor +22. DS18B20 Temperature Sensor +23. JSN SR04T Water Level Sensor +24. Soil Moisture Sensor +25. Turbidity Sensor +26. Proximity Sensor +27. Touch switch TPP 223B (Momentary) +28. Servo Motor MG996R +29. SK6812 RGB LEDs +30. TCS230 Sensor +31. FC28 Soil Moisture Sensor +32. Shunt voltmeter +33. UV Intensity Sensor +34. TSL2561 Luminosity Sensor +35. CS712TELC 05B Current Sensor +36. HX711 Load Cell +37. MQ4 Methane Gas Sensor +38. MQ2 LPG Gas Sensor +39. MQ3 Alcohol Sensor +40. MQ8 H2 Gas Sensor +41. MQ135 NH3 Gas Sensor +42. GPS GYGPS6MV2 +43. YFS201 flowmeter +44. Flex Resistor +45. Force Sensitive Resistor +46. KY026 Flame Sensor +47. MQ6 LPG Detector +48. Vibration Sensor +49. Reed Switch +50. MQ7 CO Detector +51. MQ9 LPG Detector +52. Float Switch +53. R307 Fingerprint Module +54. HLK-LD2410B Presence Sensor +55. ENS160 gas sensor +56. ZE08 ch02 gas sensor + +## Supported Controllable Devices +1. PWM Dimmable +2. RGB Dimmable +3. Smart Plug / Relay +4. Servo Mot0r +5. Addressable LEDs + +## Firmware Features +### BLE WiFi Onboarding +BLE (Bluetooth Low Energy) WiFi on-boarding for EzloPi Devices simplifies the process of connecting EzloPi devices to a WiFi network. Using BLE technology, the device can initiate a secure and user-friendly on-boarding process without the need for direct user input on the device. +### BLE Provisioning +BLE provisioning for EzloPi devices enhances user convenience by providing a wireless and user-friendly method for initial setup, eliminating the need for complex manual configurations directly on the device. +### BLE Pin Configurations +BLE Configuration simplifies the process of configuring the GPIOs of a hardware microcontroller employed by EzloPi, enhancing user convenience. +### OTA +This feature allows for convenient and remote firmware upgrades, ensuring that EzloPi devices can receive the latest software improvements and enhancements without the need for manual intervention or physical access. + +## Local Meshbot (Scene) +Scenes provide the possibility to make the relations between devices and make some actions with them. A scene consists of "conditions" and "actions" represented by (when blocks and action blocks respectively. All of them, except action groups, have Json Array representation. + +In the perfect case when and exceptions ("conditions") block must form Abstract Syntax Tree (AST) from the Json and be executable. Currently, it's represented as a list of possible single-argument function. +then and else (action) blocks contain the list of actions. Each functional element actually is the item. As far as you can see there are read only items such as : temperature, pressure, humidity, etc. and there are read-write items : switch, dimmer, light(switch), doorlock, etc... \ No newline at end of file diff --git a/ezlopi-core/ezlopi-core-event-group/CMakeLists.txt b/ezlopi-core/ezlopi-core-event-group/CMakeLists.txt index 29c3a8493..5ec2dd20f 100644 --- a/ezlopi-core/ezlopi-core-event-group/CMakeLists.txt +++ b/ezlopi-core/ezlopi-core-event-group/CMakeLists.txt @@ -2,7 +2,7 @@ file(GLOB_RECURSE config_src "*.c") -idf_component_register(SRCS "${config_src}" +idf_component_register(SRCS "ezlopi_core_event_group.c" "${config_src}" INCLUDE_DIRS "." REQUIRES ezlopi-util-trace ) diff --git a/ezlopi-core/ezlopi-core-event-group/ezlopi_core_event_group.c b/ezlopi-core/ezlopi-core-event-group/ezlopi_core_event_group.c index 166bb27dc..1eb29302d 100644 --- a/ezlopi-core/ezlopi-core-event-group/ezlopi_core_event_group.c +++ b/ezlopi-core/ezlopi-core-event-group/ezlopi_core_event_group.c @@ -45,7 +45,7 @@ int ezlopi_event_group_wait_for_event(e_ezlopi_event_t event, uint32_t wait_time ret = 1; } - TRACE_D("event-bits: %08x, event: %08x", event_bits, event); + // TRACE_D("event-bits: %08x, event: %08x", event_bits, event); } else { diff --git a/ezlopi-core/ezlopi-core-ezlopi/CMakeLists.txt b/ezlopi-core/ezlopi-core-ezlopi/CMakeLists.txt index 154feb50a..4cc02607b 100644 --- a/ezlopi-core/ezlopi-core-ezlopi/CMakeLists.txt +++ b/ezlopi-core/ezlopi-core-ezlopi/CMakeLists.txt @@ -27,8 +27,9 @@ set(EZLOPI_CLOUD_COMPONENTS ezlopi-cloud-coordinates ) -idf_component_register(SRCS "${config_src}" +idf_component_register(SRCS "ezlopi_core_ezlopi.c" "ezlopi_core_ezlopi_broadcast.c" "${config_src}" INCLUDE_DIRS "." REQUIRES ${EZLOPI_CORE_COMPONENTS} ${EZLOPI_CLOUD_COMPONENTS} ) + diff --git a/ezlopi-core/ezlopi-core-factory-info/ezlopi_core_factory_info.c b/ezlopi-core/ezlopi-core-factory-info/ezlopi_core_factory_info.c index 0c8e72685..7f9bd2820 100644 --- a/ezlopi-core/ezlopi-core-factory-info/ezlopi_core_factory_info.c +++ b/ezlopi-core/ezlopi-core-factory-info/ezlopi_core_factory_info.c @@ -119,7 +119,7 @@ const esp_partition_t* ezlopi_factory_info_v3_init(void) partition_ctx_v3 = esp_partition_find_first(EZLOPI_FACTORY_INFO_V3_PARTITION_TYPE, EZLOPI_FACTORY_INFO_V3_SUBTYPE, EZLOPI_FACTORY_INFO_V3_PARTITION_NAME); unsigned long long id = ezlopi_factory_info_v3_get_id(); - TRACE_D("SERIAL-ID [off: 0x%04X, size: 0x%04X]: %llu", ezlopi_factory_info_v3_get_abs_address(EZLOPI_FINFO_REL_OFFSET_DEVICE_ID, E_EZLOPI_FACTORY_INFO_HUB_DATA), EZLOPI_FINFO_LEN_DEVICE_ID, id); + // TRACE_D("SERIAL-ID [off: 0x%04X, size: 0x%04X]: %llu", ezlopi_factory_info_v3_get_abs_address(EZLOPI_FINFO_REL_OFFSET_DEVICE_ID, E_EZLOPI_FACTORY_INFO_HUB_DATA), EZLOPI_FINFO_LEN_DEVICE_ID, id); } return partition_ctx_v3; } diff --git a/ezlopi-core/ezlopi-core-scenes/CMakeLists.txt b/ezlopi-core/ezlopi-core-scenes/CMakeLists.txt index 37367538a..b20700e40 100644 --- a/ezlopi-core/ezlopi-core-scenes/CMakeLists.txt +++ b/ezlopi-core/ezlopi-core-scenes/CMakeLists.txt @@ -2,7 +2,7 @@ file(GLOB_RECURSE config_src "*.c") -idf_component_register(SRCS "${config_src}" +idf_component_register(SRCS "ezlopi_core_scenes_scripts.c" "${config_src}" INCLUDE_DIRS "." REQUIRES core - ) \ No newline at end of file + ) \ No newline at end of file diff --git a/ezlopi-doc/ezlopi_cover.png b/ezlopi-doc/ezlopi_cover.png new file mode 100644 index 0000000000000000000000000000000000000000..7de531f762744f1b08c77e8effc32d517e332479 GIT binary patch literal 138282 zcmXuK19T-#*ESs6oY*;;c)}CgHYT=h+r|VF+qP}nwyg=i+|T>}y;fs&byx4MU7Odg zaCuoVL^xbH5D*YV32|XX5D*Bn@9SHfbR6kjQg^ZO>M zlZd*LvbmF$F^IgdD6x=(vA&b7gMdy4)psNMe~kjpPG+_a|7%sYwY73277)Xmc4hpp zUk_zRyK!zpnaeVtW@toaytsNqUN)~QCbw1mtx4 ze_v^pJs4|~tjagRaf*tnnmBnAwKAq|Os~E^`(t29yrupB5!1@KGf=8o3U+sD32K+O zn@r?qOdYb57_thR-kxVBYt}3hi*;Q;?bxn!@Db409TkGCXZ-st?~K_ zSy=3!nUu;8vhxcU(g!79!F++#?mrT2RCj{1q;nO~Y6fo3B~Kna4(oIZBk1XJvuSCn zxzp03b+jR5^TJ3YsPe)b+;><4YSXG0H8UEHC_w@mzz9((i-l;k93!1pT}TX z3Z=^UWvxt+^EHmp$+%j1RAaGuY<+wZEfwCOpxWdB@#Rn)7bur z|MguD0{(@=xekG3NOZOCeS zZGL$%_LGX+ow_);Fj$>>B*YbPBS1Cd&=Wj{syp$b1` z%Q31nYe8$cEc^dDwE1zt;>KQdK#(viH-8o5X!6aBa77orNt?vQ^Xa66crBTXGL98BgexlUlGj zXc~@_lQR|;w((I$nXOHqaZk%axpG_>CFXVU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-1MsG zOJP@X%-191z0Y$lB{gbb&Pb*|zum^)5ek*3P-9_;=p*{t{1>W~U|jEz6nD7Wg@`dC z+gw9!LV3i+@uMF9iB@*Wu?4vtrBNqV$D*kY=*c5@G!(e_r&3?!(T)#4j9DcfT}{zqk) z*o3Lr)t^oS7b4P1t=J`UB>M0M-f|8J3Mms;&4mL`$(focUClP$Lsc~*<3j+Huz*dlg0)7j=E@4 z{u8L>c!UpAzu$zZ76ANS3n(JYG!athNl7cJC;Bw}rh|w&=d3lPn4Mxs%N zsN@NY7q9jo+YHN;J=Wcn+GtL#IFm%rd9QVb}gcetb2L_{zl-z8gax{+pN58OB4O;q^| zEdV&<8TZN#3;}g2yt}mWYT(D1ZaX5?P=i*2BX{DwslXxqokxDAX-v43Hz}EcFoh{% z1C)XlJFQn5R-8?aTVv2=C4A2GX8xzMak=|o%uH6!7(?E?^Le{{Kr7BuM#*B3I6$70 z#`dbp?W)P0CaBS+kTtoUFea_ZgQ|3IKxa=1N-yV=%+QMsrJ{@@2&efykA+*G3ppw7 z$taN<1c_Kex1DWPW_=_mY&)OdaW7}82)tm(nzStf(MAU`ro<}(9zG%ffdBjN|11D; zYLwd;6T3N3d#sOBpMzzZn(r&$8QY$9fv&U3lPz%1YpJw7oovu41fbp2R9RCD)y;S+ loTX-NlCQ$J{7hH={2%Q-=$ZE literal 0 HcmV?d00001 diff --git a/ezlop-doc/ezlopi_screenshot.png b/ezlopi-doc/ezlopi_screenshot.png similarity index 100% rename from ezlop-doc/ezlopi_screenshot.png rename to ezlopi-doc/ezlopi_screenshot.png diff --git a/ezlop-doc/ezlopi_web_flasher.png b/ezlopi-doc/ezlopi_web_flasher.png similarity index 100% rename from ezlop-doc/ezlopi_web_flasher.png rename to ezlopi-doc/ezlopi_web_flasher.png diff --git a/ezlopi-services/ezlopi-service-ble/CMakeLists.txt b/ezlopi-services/ezlopi-service-ble/CMakeLists.txt index fddc09259..0f2df9c89 100644 --- a/ezlopi-services/ezlopi-service-ble/CMakeLists.txt +++ b/ezlopi-services/ezlopi-service-ble/CMakeLists.txt @@ -9,8 +9,9 @@ set(EZLOPI_CORE_COMPONENTS ) -idf_component_register(SRCS "${src_files}" +idf_component_register(SRCS "ezlopi_service_ble_wifi.c" "${src_files}" INCLUDE_DIRS "." REQUIRES ${EZLOPI_CORE_COMPONENTS} ) + diff --git a/sdkconfig b/sdkconfig index 571ea575c..fd6cbed81 100644 --- a/sdkconfig +++ b/sdkconfig @@ -4,9 +4,9 @@ # CONFIG_IDF_CMAKE=y CONFIG_IDF_TARGET_ARCH_XTENSA=y -CONFIG_IDF_TARGET="esp32s3" -CONFIG_IDF_TARGET_ESP32S3=y -CONFIG_IDF_FIRMWARE_CHIP_ID=0x0009 +CONFIG_IDF_TARGET="esp32" +CONFIG_IDF_TARGET_ESP32=y +CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000 # # SDK tool configuration @@ -38,7 +38,7 @@ CONFIG_APP_RETRIEVE_LEN_ELF_SHA=16 # # Bootloader config # -CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x0 +CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x1000 CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set @@ -50,14 +50,6 @@ CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y # CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set # CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set CONFIG_BOOTLOADER_LOG_LEVEL=0 - -# -# Serial Flash Configurations -# -# CONFIG_BOOTLOADER_FLASH_DC_AWARE is not set -CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y -# end of Serial Flash Configurations - # CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V is not set CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y # CONFIG_BOOTLOADER_FACTORY_RESET is not set @@ -72,43 +64,31 @@ CONFIG_BOOTLOADER_WDT_TIME_MS=9000 # CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 # CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set +CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y # end of Bootloader config # # Security features # -CONFIG_SECURE_BOOT_SUPPORTS_RSA=y -CONFIG_SECURE_TARGET_HAS_SECURE_ROM_DL_MODE=y # CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set # CONFIG_SECURE_BOOT is not set # CONFIG_SECURE_FLASH_ENC_ENABLED is not set # end of Security features -# -# Boot ROM Behavior -# -CONFIG_BOOT_ROM_LOG_ALWAYS_ON=y -# CONFIG_BOOT_ROM_LOG_ALWAYS_OFF is not set -# CONFIG_BOOT_ROM_LOG_ON_GPIO_HIGH is not set -# CONFIG_BOOT_ROM_LOG_ON_GPIO_LOW is not set -# end of Boot ROM Behavior - # # Serial flasher config # CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200 # CONFIG_ESPTOOLPY_NO_STUB is not set -# CONFIG_ESPTOOLPY_OCT_FLASH is not set # CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set # CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set CONFIG_ESPTOOLPY_FLASHMODE_DIO=y # CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y CONFIG_ESPTOOLPY_FLASHMODE="dio" -CONFIG_ESPTOOLPY_S3_STR=y -# CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set CONFIG_ESPTOOLPY_FLASHFREQ_40M=y +# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set CONFIG_ESPTOOLPY_FLASHFREQ="40m" # CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set @@ -198,82 +178,51 @@ CONFIG_APPTRACE_LOCK_ENABLE=y # Bluetooth # CONFIG_BT_ENABLED=y -CONFIG_BT_SOC_SUPPORT_5_0=y # # Bluetooth controller # -CONFIG_BT_CTRL_MODE_EFF=1 -CONFIG_BT_CTRL_BLE_MAX_ACT=10 -CONFIG_BT_CTRL_BLE_MAX_ACT_EFF=10 -CONFIG_BT_CTRL_BLE_STATIC_ACL_TX_BUF_NB=0 -CONFIG_BT_CTRL_PINNED_TO_CORE_0=y -# CONFIG_BT_CTRL_PINNED_TO_CORE_1 is not set -CONFIG_BT_CTRL_PINNED_TO_CORE=0 -CONFIG_BT_CTRL_HCI_MODE_VHCI=y -# CONFIG_BT_CTRL_HCI_MODE_UART_H4 is not set -CONFIG_BT_CTRL_HCI_TL=1 -CONFIG_BT_CTRL_ADV_DUP_FILT_MAX=30 -CONFIG_BT_BLE_CCA_MODE_NONE=y -# CONFIG_BT_BLE_CCA_MODE_HW is not set -# CONFIG_BT_BLE_CCA_MODE_SW is not set -CONFIG_BT_BLE_CCA_MODE=0 -CONFIG_BT_CTRL_HW_CCA_VAL=20 -CONFIG_BT_CTRL_HW_CCA_EFF=0 -CONFIG_BT_CTRL_CE_LENGTH_TYPE_ORIG=y -# CONFIG_BT_CTRL_CE_LENGTH_TYPE_CE is not set -# CONFIG_BT_CTRL_CE_LENGTH_TYPE_SD is not set -CONFIG_BT_CTRL_CE_LENGTH_TYPE_EFF=0 -CONFIG_BT_CTRL_TX_ANTENNA_INDEX_0=y -# CONFIG_BT_CTRL_TX_ANTENNA_INDEX_1 is not set -CONFIG_BT_CTRL_TX_ANTENNA_INDEX_EFF=0 -CONFIG_BT_CTRL_RX_ANTENNA_INDEX_0=y -# CONFIG_BT_CTRL_RX_ANTENNA_INDEX_1 is not set -CONFIG_BT_CTRL_RX_ANTENNA_INDEX_EFF=0 -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N24 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N21 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N18 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N15 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N12 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N9 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N6 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N3 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N0 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P6 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P9 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P12 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P15 is not set -# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P18 is not set -CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P21=y -CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF=15 -CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP=y -CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM=100 -CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 -CONFIG_BT_CTRL_BLE_SCAN_DUPL=y -CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DEVICE=y -# CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DATA is not set -# CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DATA_DEVICE is not set -CONFIG_BT_CTRL_SCAN_DUPL_TYPE=0 -CONFIG_BT_CTRL_SCAN_DUPL_CACHE_SIZE=100 -CONFIG_BT_CTRL_DUPL_SCAN_CACHE_REFRESH_PERIOD=0 -# CONFIG_BT_CTRL_BLE_MESH_SCAN_DUPL_EN is not set -# CONFIG_BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_EN is not set -CONFIG_BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_DIS=y -CONFIG_BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_EFF=0 +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +# CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY is not set +# CONFIG_BTDM_CTRL_MODE_BTDM is not set +CONFIG_BTDM_CTRL_BLE_MAX_CONN=3 +CONFIG_BTDM_CTRL_BR_EDR_SCO_DATA_PATH_EFF=0 +CONFIG_BTDM_CTRL_PCM_ROLE_EFF=0 +CONFIG_BTDM_CTRL_PCM_POLAR_EFF=0 +CONFIG_BTDM_CTRL_BLE_MAX_CONN_EFF=3 +CONFIG_BTDM_CTRL_BR_EDR_MAX_ACL_CONN_EFF=0 +CONFIG_BTDM_CTRL_BR_EDR_MAX_SYNC_CONN_EFF=0 +CONFIG_BTDM_CTRL_PINNED_TO_CORE_0=y +# CONFIG_BTDM_CTRL_PINNED_TO_CORE_1 is not set +CONFIG_BTDM_CTRL_PINNED_TO_CORE=0 +CONFIG_BTDM_CTRL_HCI_MODE_VHCI=y +# CONFIG_BTDM_CTRL_HCI_MODE_UART_H4 is not set # # MODEM SLEEP Options # -# CONFIG_BT_CTRL_MODEM_SLEEP is not set +CONFIG_BTDM_CTRL_MODEM_SLEEP=y +CONFIG_BTDM_CTRL_MODEM_SLEEP_MODE_ORIG=y +# CONFIG_BTDM_CTRL_MODEM_SLEEP_MODE_EVED is not set +CONFIG_BTDM_CTRL_LPCLK_SEL_MAIN_XTAL=y # end of MODEM SLEEP Options -CONFIG_BT_CTRL_SLEEP_MODE_EFF=0 -CONFIG_BT_CTRL_SLEEP_CLOCK_EFF=0 -CONFIG_BT_CTRL_HCI_TL_EFF=1 -# CONFIG_BT_CTRL_AGC_RECORRECT_EN is not set -# CONFIG_BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX is not set -# CONFIG_BT_BLE_ADV_DATA_LENGTH_ZERO_AUX is not set +CONFIG_BTDM_BLE_DEFAULT_SCA_250PPM=y +CONFIG_BTDM_BLE_SLEEP_CLOCK_ACCURACY_INDEX_EFF=1 +CONFIG_BTDM_BLE_SCAN_DUPL=y +CONFIG_BTDM_SCAN_DUPL_TYPE_DEVICE=y +# CONFIG_BTDM_SCAN_DUPL_TYPE_DATA is not set +# CONFIG_BTDM_SCAN_DUPL_TYPE_DATA_DEVICE is not set +CONFIG_BTDM_SCAN_DUPL_TYPE=0 +CONFIG_BTDM_SCAN_DUPL_CACHE_SIZE=100 +CONFIG_BTDM_SCAN_DUPL_CACHE_REFRESH_PERIOD=0 +# CONFIG_BTDM_BLE_MESH_SCAN_DUPL_EN is not set +CONFIG_BTDM_CTRL_FULL_SCAN_SUPPORTED=y +CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP=y +CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM=100 +CONFIG_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 +CONFIG_BTDM_RESERVE_DRAM=0xdb5c +CONFIG_BTDM_CTRL_HLI=y # end of Bluetooth controller CONFIG_BT_BLUEDROID_ENABLED=y @@ -289,6 +238,7 @@ CONFIG_BT_BLUEDROID_PINNED_TO_CORE_0=y CONFIG_BT_BLUEDROID_PINNED_TO_CORE=0 CONFIG_BT_BTU_TASK_STACK_SIZE=4096 # CONFIG_BT_BLUEDROID_MEM_DEBUG is not set +# CONFIG_BT_CLASSIC_ENABLED is not set CONFIG_BT_BLE_ENABLED=y CONFIG_BT_GATTS_ENABLE=y # CONFIG_BT_GATTS_PPCP_CHAR_GAP is not set @@ -303,7 +253,6 @@ CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE=0 # CONFIG_BT_GATTS_APPEARANCE_WRITABLE is not set CONFIG_BT_GATTC_ENABLE=y CONFIG_BT_GATTC_MAX_CACHE_CHAR=40 -CONFIG_BT_GATTC_NOTIF_REG_MAX=5 # CONFIG_BT_GATTC_CACHE_NVS_FLASH is not set CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=3 CONFIG_BT_BLE_SMP_ENABLE=y @@ -489,13 +438,11 @@ CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=y # CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY is not set # CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK is not set CONFIG_BT_SMP_ENABLE=y -CONFIG_BT_SMP_MAX_BONDS=15 # CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN is not set CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT=30 CONFIG_BT_MAX_DEVICE_NAME_LEN=32 +# CONFIG_BT_BLE_RPA_SUPPORTED is not set CONFIG_BT_BLE_RPA_TIMEOUT=900 -# CONFIG_BT_BLE_50_FEATURES_SUPPORTED is not set -CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y # CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL is not set # end of Bluedroid Options # end of Bluetooth @@ -520,7 +467,6 @@ CONFIG_COAP_LOG_DEFAULT_LEVEL=0 # # CONFIG_ADC_FORCE_XPD_FSM is not set CONFIG_ADC_DISABLE_DAC=y -# CONFIG_ADC_CONTINUOUS_FORCE_USE_ADC2_ON_C3_S3 is not set # end of ADC configuration # @@ -542,6 +488,10 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=y # TWAI configuration # # CONFIG_TWAI_ISR_IN_IRAM is not set +# CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC is not set +# CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST is not set +# CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID is not set +# CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT is not set # CONFIG_TWAI_ERRATA_FIX_LISTEN_ONLY_DOM is not set # end of TWAI configuration @@ -551,6 +501,18 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=y CONFIG_UART_ISR_IN_IRAM=y # end of UART configuration +# +# RTCIO configuration +# +# CONFIG_RTCIO_SUPPORT_RTC_GPIO_DESC is not set +# end of RTCIO configuration + +# +# GPIO Configuration +# +# CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL is not set +# end of GPIO Configuration + # # GDMA Configuration # @@ -564,14 +526,17 @@ CONFIG_UART_ISR_IN_IRAM=y # # CONFIG_EFUSE_CUSTOM_TABLE is not set # CONFIG_EFUSE_VIRTUAL is not set -CONFIG_EFUSE_MAX_BLK_LEN=256 +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_NONE is not set +CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4=y +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_REPEAT is not set +CONFIG_EFUSE_MAX_BLK_LEN=192 # end of eFuse Bit Manager # # ESP-TLS # CONFIG_ESP_TLS_USING_MBEDTLS=y -CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y +# CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set # CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set # CONFIG_ESP_TLS_SERVER is not set # CONFIG_ESP_TLS_PSK_VERIFICATION is not set @@ -579,80 +544,68 @@ CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y # end of ESP-TLS # -# ESP32S3-Specific +# ESP32-specific # -CONFIG_ESP32S3_REV_MIN_0=y -# CONFIG_ESP32S3_REV_MIN_1 is not set -# CONFIG_ESP32S3_REV_MIN_2 is not set -CONFIG_ESP32S3_REV_MIN_FULL=0 +CONFIG_ESP32_REV_MIN_0=y +# CONFIG_ESP32_REV_MIN_1 is not set +# CONFIG_ESP32_REV_MIN_1_1 is not set +# CONFIG_ESP32_REV_MIN_2 is not set +# CONFIG_ESP32_REV_MIN_3 is not set +# CONFIG_ESP32_REV_MIN_3_1 is not set +CONFIG_ESP32_REV_MIN=0 +CONFIG_ESP32_REV_MIN_FULL=0 CONFIG_ESP_REV_MIN_FULL=0 -CONFIG_ESP32S3_REV_MAX_FULL_STR_OPT=y -CONFIG_ESP32S3_REV_MAX_FULL=99 -CONFIG_ESP_REV_MAX_FULL=99 -# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_80 is not set -# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_160 is not set -CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y -CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=240 - -# -# Cache config -# -CONFIG_ESP32S3_INSTRUCTION_CACHE_16KB=y -# CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB is not set -CONFIG_ESP32S3_INSTRUCTION_CACHE_SIZE=0x4000 -# CONFIG_ESP32S3_INSTRUCTION_CACHE_4WAYS is not set -CONFIG_ESP32S3_INSTRUCTION_CACHE_8WAYS=y -CONFIG_ESP32S3_ICACHE_ASSOCIATED_WAYS=8 -# CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_16B is not set -CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_32B=y -CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_SIZE=32 -# CONFIG_ESP32S3_INSTRUCTION_CACHE_WRAP is not set -# CONFIG_ESP32S3_DATA_CACHE_16KB is not set -CONFIG_ESP32S3_DATA_CACHE_32KB=y -# CONFIG_ESP32S3_DATA_CACHE_64KB is not set -CONFIG_ESP32S3_DATA_CACHE_SIZE=0x8000 -# CONFIG_ESP32S3_DATA_CACHE_4WAYS is not set -CONFIG_ESP32S3_DATA_CACHE_8WAYS=y -CONFIG_ESP32S3_DCACHE_ASSOCIATED_WAYS=8 -# CONFIG_ESP32S3_DATA_CACHE_LINE_16B is not set -CONFIG_ESP32S3_DATA_CACHE_LINE_32B=y -# CONFIG_ESP32S3_DATA_CACHE_LINE_64B is not set -CONFIG_ESP32S3_DATA_CACHE_LINE_SIZE=32 -# CONFIG_ESP32S3_DATA_CACHE_WRAP is not set -# end of Cache config - -# CONFIG_ESP32S3_SPIRAM_SUPPORT is not set -# CONFIG_ESP32S3_TRAX is not set -CONFIG_ESP32S3_TRACEMEM_RESERVE_DRAM=0x0 -# CONFIG_ESP32S3_ULP_COPROC_ENABLED is not set -CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM=0 -CONFIG_ESP32S3_DEBUG_OCDAWARE=y -CONFIG_ESP32S3_BROWNOUT_DET=y -CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_7=y -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_6 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_5 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_4 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_3 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_2 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_1 is not set -CONFIG_ESP32S3_BROWNOUT_DET_LVL=7 -CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC_FRC1=y -# CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC is not set -# CONFIG_ESP32S3_TIME_SYSCALL_USE_FRC1 is not set -# CONFIG_ESP32S3_TIME_SYSCALL_USE_NONE is not set -CONFIG_ESP32S3_RTC_CLK_SRC_INT_RC=y -# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_CRYS is not set -# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_OSC is not set -# CONFIG_ESP32S3_RTC_CLK_SRC_INT_8MD256 is not set -CONFIG_ESP32S3_RTC_CLK_CAL_CYCLES=1024 -CONFIG_ESP32S3_DEEP_SLEEP_WAKEUP_DELAY=2000 -# CONFIG_ESP32S3_RTCDATA_IN_FAST_MEM is not set -# CONFIG_ESP32S3_USE_FIXED_STATIC_RAM_SIZE is not set -# end of ESP32S3-Specific +CONFIG_ESP32_REV_MAX_FULL_STR_OPT=y +CONFIG_ESP32_REV_MAX_FULL=399 +CONFIG_ESP_REV_MAX_FULL=399 +CONFIG_ESP32_DPORT_WORKAROUND=y +# CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set +CONFIG_ESP32_DEFAULT_CPU_FREQ_160=y +# CONFIG_ESP32_DEFAULT_CPU_FREQ_240 is not set +CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=160 +# CONFIG_ESP32_SPIRAM_SUPPORT is not set +# CONFIG_ESP32_TRAX is not set +CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0x0 +# CONFIG_ESP32_ULP_COPROC_ENABLED is not set +CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0 +CONFIG_ESP32_DEBUG_OCDAWARE=y +CONFIG_ESP32_BROWNOUT_DET=y +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_0=y +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_7 is not set +CONFIG_ESP32_BROWNOUT_DET_LVL=0 +CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1=y +# CONFIG_ESP32_TIME_SYSCALL_USE_RTC is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_FRC1 is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_NONE is not set +CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y +# CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_ESP32_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_ESP32_RTC_CLK_SRC_INT_8MD256 is not set +CONFIG_ESP32_RTC_CLK_CAL_CYCLES=1024 +CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000 +CONFIG_ESP32_XTAL_FREQ_40=y +# CONFIG_ESP32_XTAL_FREQ_26 is not set +# CONFIG_ESP32_XTAL_FREQ_AUTO is not set +CONFIG_ESP32_XTAL_FREQ=40 +# CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE is not set +# CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set +# CONFIG_ESP32_COMPATIBLE_PRE_V3_1_BOOTLOADERS is not set +# CONFIG_ESP32_USE_FIXED_STATIC_RAM_SIZE is not set +CONFIG_ESP32_DPORT_DIS_INTERRUPT_LVL=5 +# end of ESP32-specific # # ADC-Calibration # +CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y +CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y +CONFIG_ADC_CAL_LUT_ENABLE=y # end of ADC-Calibration # @@ -665,6 +618,14 @@ CONFIG_ESP_ERR_TO_NAME_LOOKUP=y # Ethernet # CONFIG_ETH_ENABLED=y +CONFIG_ETH_USE_ESP32_EMAC=y +CONFIG_ETH_PHY_INTERFACE_RMII=y +CONFIG_ETH_RMII_CLK_INPUT=y +# CONFIG_ETH_RMII_CLK_OUTPUT is not set +CONFIG_ETH_RMII_CLK_IN_GPIO=0 +CONFIG_ETH_DMA_BUFFER_SIZE=512 +CONFIG_ETH_DMA_RX_BUFFER_NUM=10 +CONFIG_ETH_DMA_TX_BUFFER_NUM=10 CONFIG_ETH_USE_SPI_ETHERNET=y # CONFIG_ETH_SPI_ETHERNET_DM9051 is not set CONFIG_ETH_SPI_ETHERNET_W5500=y @@ -727,9 +688,10 @@ CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y -# CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO is not set -CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_FOUR=y -CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES=4 +# CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_TWO is not set +CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR=y +CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=4 +# CONFIG_ESP_MAC_IGNORE_MAC_CRC_ERROR is not set # end of MAC Config # @@ -739,13 +701,11 @@ CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y # CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND is not set -CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y # end of Sleep Config # # RTC Clock Config # -CONFIG_RTC_CLOCK_BBPLL_POWER_ON_WITH_USB=y # end of RTC Clock Config # end of Hardware Settings @@ -761,15 +721,10 @@ CONFIG_ESP_IPC_ISR_ENABLE=y # LCD and Touch Panel # -# -# LCD Touch Drivers are maintained in the IDF Component Registry -# - # # LCD Peripheral Configuration # CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE=32 -# CONFIG_LCD_RGB_ISR_IRAM_SAFE is not set # end of LCD Peripheral Configuration # end of LCD and Touch Panel @@ -790,7 +745,6 @@ CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20 CONFIG_ESP_PHY_MAX_TX_POWER=20 # CONFIG_ESP_PHY_REDUCE_TX_POWER is not set -CONFIG_ESP_PHY_ENABLE_USB=y CONFIG_ESP_PHY_RF_CAL_PARTIAL=y # CONFIG_ESP_PHY_RF_CAL_NONE is not set # CONFIG_ESP_PHY_RF_CAL_FULL is not set @@ -801,8 +755,6 @@ CONFIG_ESP_PHY_CALIBRATION_MODE=0 # Power Management # # CONFIG_PM_ENABLE is not set -CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y -CONFIG_PM_POWER_DOWN_TAGMEM_IN_LIGHT_SLEEP=y # end of Power Management # @@ -820,8 +772,6 @@ CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set # CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set # CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set -CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK=y -CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=y # # Memory protection @@ -837,12 +787,8 @@ CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 CONFIG_ESP_CONSOLE_UART_DEFAULT=y -# CONFIG_ESP_CONSOLE_USB_CDC is not set -# CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG is not set # CONFIG_ESP_CONSOLE_UART_CUSTOM is not set # CONFIG_ESP_CONSOLE_NONE is not set -# CONFIG_ESP_CONSOLE_SECONDARY_NONE is not set -CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y CONFIG_ESP_CONSOLE_UART=y CONFIG_ESP_CONSOLE_MULTIPLE_UART=y CONFIG_ESP_CONSOLE_UART_NUM=0 @@ -857,8 +803,7 @@ CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y # CONFIG_ESP_PANIC_HANDLER_IRAM is not set # CONFIG_ESP_DEBUG_STUBS_ENABLE is not set -CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y -CONFIG_ESP_SYSTEM_BBPLL_RECALIB=y +CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5=y # end of ESP System Settings # @@ -870,7 +815,8 @@ CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER=y CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584 CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1 # CONFIG_ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD is not set -CONFIG_ESP_TIMER_IMPL_SYSTIMER=y +# CONFIG_ESP_TIMER_IMPL_FRC2 is not set +CONFIG_ESP_TIMER_IMPL_TG0_LAC=y # end of High resolution timer (esp_timer) # @@ -884,10 +830,6 @@ CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8 CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=16 -CONFIG_ESP_WIFI_STATIC_RX_MGMT_BUFFER=y -# CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUFFER is not set -CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0 -CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF=5 # CONFIG_ESP32_WIFI_CSI_ENABLED is not set CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y CONFIG_ESP32_WIFI_TX_BA_WIN=6 @@ -898,13 +840,11 @@ CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y # CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 -CONFIG_ESP32_WIFI_IRAM_OPT=y -CONFIG_ESP32_WIFI_RX_IRAM_OPT=y +# CONFIG_ESP32_WIFI_IRAM_OPT is not set +# CONFIG_ESP32_WIFI_RX_IRAM_OPT is not set CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y # CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set -# CONFIG_ESP_WIFI_FTM_ENABLE is not set # CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set -# CONFIG_ESP_WIFI_GCMP_SUPPORT is not set # CONFIG_ESP_WIFI_GMAC_SUPPORT is not set CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y # CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set @@ -990,10 +930,10 @@ CONFIG_FMB_EVENT_QUEUE_TIMEOUT=20 # # CONFIG_FREERTOS_UNICORE is not set CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF -CONFIG_FREERTOS_TICK_SUPPORT_SYSTIMER=y -CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL1=y -# CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL3 is not set -CONFIG_FREERTOS_SYSTICK_USES_SYSTIMER=y +CONFIG_FREERTOS_TICK_SUPPORT_CORETIMER=y +CONFIG_FREERTOS_CORETIMER_0=y +# CONFIG_FREERTOS_CORETIMER_1 is not set +CONFIG_FREERTOS_SYSTICK_USES_CCOUNT=y CONFIG_FREERTOS_HZ=1000 CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION=y # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set @@ -1022,6 +962,7 @@ CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y # CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set # CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set CONFIG_FREERTOS_DEBUG_OCDAWARE=y +# CONFIG_FREERTOS_FPU_IN_ISR is not set CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y # CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH is not set # end of FreeRTOS @@ -1087,12 +1028,11 @@ CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y # CONFIG_LWIP_LOCAL_HOSTNAME="espressif" # CONFIG_LWIP_NETIF_API is not set -CONFIG_LWIP_TCPIP_TASK_PRIO=18 # CONFIG_LWIP_TCPIP_CORE_LOCKING is not set # CONFIG_LWIP_CHECK_THREAD_SAFETY is not set CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y # CONFIG_LWIP_L2_TO_L3_COPY is not set -CONFIG_LWIP_IRAM_OPTIMIZATION=y +# CONFIG_LWIP_IRAM_OPTIMIZATION is not set CONFIG_LWIP_TIMERS_ONDEMAND=y CONFIG_LWIP_MAX_SOCKETS=10 # CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set @@ -1101,7 +1041,6 @@ CONFIG_LWIP_SO_REUSE=y CONFIG_LWIP_SO_REUSE_RXTOALL=y # CONFIG_LWIP_SO_RCVBUF is not set # CONFIG_LWIP_NETBUF_RECVINFO is not set -CONFIG_LWIP_IP_DEFAULT_TTL=64 CONFIG_LWIP_IP4_FRAG=y CONFIG_LWIP_IP6_FRAG=y # CONFIG_LWIP_IP4_REASSEMBLY is not set @@ -1154,8 +1093,6 @@ CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744 CONFIG_LWIP_TCP_WND_DEFAULT=5744 CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 CONFIG_LWIP_TCP_QUEUE_OOSEQ=y -CONFIG_LWIP_TCP_OOSEQ_TIMEOUT=6 -CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=4 # CONFIG_LWIP_TCP_SACK_OUT is not set # CONFIG_LWIP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set CONFIG_LWIP_TCP_OVERSIZE_MSS=y @@ -1211,13 +1148,6 @@ CONFIG_LWIP_SNTP_MAX_SERVERS=1 CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 # end of SNTP -# -# DNS -# -CONFIG_LWIP_DNS_MAX_SERVERS=3 -# CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT is not set -# end of DNS - CONFIG_LWIP_ESP_LWIP_ASSERT=y # @@ -1278,7 +1208,6 @@ CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200 CONFIG_MBEDTLS_ECP_RESTARTABLE=y CONFIG_MBEDTLS_CMAC_C=y CONFIG_MBEDTLS_HARDWARE_AES=y -CONFIG_MBEDTLS_AES_USE_INTERRUPT=y CONFIG_MBEDTLS_HARDWARE_MPI=y CONFIG_MBEDTLS_HARDWARE_SHA=y CONFIG_MBEDTLS_ROM_MD5=y @@ -1452,33 +1381,12 @@ CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" # end of PThreads -# -# Main Flash configuration -# - -# -# Optional and Experimental Features (READ DOCS FIRST) -# - -# -# Features here require specific hardware (READ DOCS FIRST!) -# -# CONFIG_SPI_FLASH_HPM_ENA is not set -CONFIG_SPI_FLASH_HPM_AUTO=y -# CONFIG_SPI_FLASH_HPM_DIS is not set -CONFIG_SPI_FLASH_HPM_ON=y -CONFIG_SPI_FLASH_HPM_DC_AUTO=y -# CONFIG_SPI_FLASH_HPM_DC_DISABLE is not set -# end of Optional and Experimental Features (READ DOCS FIRST) -# end of Main Flash configuration - # # SPI Flash driver # # CONFIG_SPI_FLASH_VERIFY_WRITE is not set # CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y -# CONFIG_SPI_FLASH_ROM_IMPL is not set CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y # CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set # CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set @@ -1502,7 +1410,6 @@ CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP=y CONFIG_SPI_FLASH_SUPPORT_TH_CHIP=y -CONFIG_SPI_FLASH_SUPPORT_MXIC_OPI_CHIP=y # end of Auto-detect flash chips CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y @@ -1556,12 +1463,6 @@ CONFIG_WS_BUFFER_SIZE=1024 # end of Websocket # end of TCP Transport -# -# TinyUSB Stack -# -# CONFIG_TINYUSB is not set -# end of TinyUSB Stack - # # Unity unit testing library # @@ -1574,24 +1475,10 @@ CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y # CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set # end of Unity unit testing library -# -# USB-OTG -# -CONFIG_USB_OTG_SUPPORTED=y -CONFIG_USB_HOST_CONTROL_TRANSFER_MAX_SIZE=256 -CONFIG_USB_HOST_HW_BUFFER_BIAS_BALANCED=y -# CONFIG_USB_HOST_HW_BUFFER_BIAS_IN is not set -# CONFIG_USB_HOST_HW_BUFFER_BIAS_PERIODIC_OUT is not set - # # Root Hub configuration # -CONFIG_USB_HOST_DEBOUNCE_DELAY_MS=250 -CONFIG_USB_HOST_RESET_HOLD_MS=30 -CONFIG_USB_HOST_RESET_RECOVERY_MS=30 -CONFIG_USB_HOST_SET_ADDR_RECOVERY_MS=10 # end of Root Hub configuration -# end of USB-OTG # # Virtual file system @@ -1703,6 +1590,28 @@ CONFIG_STACK_CHECK_NONE=y # CONFIG_ESP32_APPTRACE_DEST_TRAX is not set CONFIG_ESP32_APPTRACE_DEST_NONE=y CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y +CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY=y +# CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY is not set +# CONFIG_BTDM_CONTROLLER_MODE_BTDM is not set +CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN=3 +CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN_EFF=3 +CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN_EFF=0 +CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_EFF=0 +CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE=0 +CONFIG_BTDM_CONTROLLER_HCI_MODE_VHCI=y +# CONFIG_BTDM_CONTROLLER_HCI_MODE_UART_H4 is not set +CONFIG_BTDM_CONTROLLER_MODEM_SLEEP=y +CONFIG_BLE_SCAN_DUPLICATE=y +CONFIG_SCAN_DUPLICATE_BY_DEVICE_ADDR=y +# CONFIG_SCAN_DUPLICATE_BY_ADV_DATA is not set +# CONFIG_SCAN_DUPLICATE_BY_ADV_DATA_AND_DEVICE_ADDR is not set +CONFIG_SCAN_DUPLICATE_TYPE=0 +CONFIG_DUPLICATE_SCAN_CACHE_SIZE=100 +# CONFIG_BLE_MESH_SCAN_DUPLICATE_EN is not set +CONFIG_BTDM_CONTROLLER_FULL_SCAN_SUPPORTED=y +CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_SUPPORTED=y +CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_NUM=100 +CONFIG_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 CONFIG_BLUEDROID_ENABLED=y # CONFIG_NIMBLE_ENABLED is not set CONFIG_BTC_TASK_STACK_SIZE=3072 @@ -1711,6 +1620,7 @@ CONFIG_BLUEDROID_PINNED_TO_CORE_0=y CONFIG_BLUEDROID_PINNED_TO_CORE=0 CONFIG_BTU_TASK_STACK_SIZE=4096 # CONFIG_BLUEDROID_MEM_DEBUG is not set +# CONFIG_CLASSIC_BT_ENABLED is not set CONFIG_GATTS_ENABLE=y # CONFIG_GATTS_SEND_SERVICE_CHANGE_MANUAL is not set CONFIG_GATTS_SEND_SERVICE_CHANGE_AUTO=y @@ -1885,9 +1795,32 @@ CONFIG_SMP_ENABLE=y # CONFIG_BLE_ACTIVE_SCAN_REPORT_ADV_SCAN_RSP_INDIVIDUALLY is not set CONFIG_BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT=30 CONFIG_ADC2_DISABLE_DAC=y +# CONFIG_SPIRAM_SUPPORT is not set +CONFIG_TRACEMEM_RESERVE_DRAM=0x0 +# CONFIG_ULP_COPROC_ENABLED is not set +CONFIG_ULP_COPROC_RESERVE_MEM=0 +CONFIG_BROWNOUT_DET=y +CONFIG_BROWNOUT_DET_LVL_SEL_0=y +# CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_7 is not set +CONFIG_BROWNOUT_DET_LVL=0 +CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y +# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256 is not set +# CONFIG_DISABLE_BASIC_ROM_CONSOLE is not set +# CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set # CONFIG_EVENT_LOOP_PROFILING is not set CONFIG_POST_EVENTS_FROM_ISR=y CONFIG_POST_EVENTS_FROM_IRAM_ISR=y +# CONFIG_TWO_UNIVERSAL_MAC_ADDRESS is not set +CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y +CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4 CONFIG_ESP_SYSTEM_PD_FLASH=y CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND=y CONFIG_IPC_TASK_STACK_SIZE=1536 @@ -1896,12 +1829,10 @@ CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 CONFIG_ESP32_PHY_MAX_TX_POWER=20 # CONFIG_ESP32_REDUCE_PHY_TX_POWER is not set -CONFIG_ESP_SYSTEM_PM_POWER_DOWN_CPU=y # CONFIG_ESP32S2_PANIC_PRINT_HALT is not set CONFIG_ESP32S2_PANIC_PRINT_REBOOT=y # CONFIG_ESP32S2_PANIC_SILENT_REBOOT is not set # CONFIG_ESP32S2_PANIC_GDBSTUB is not set -CONFIG_ESP32S2_ALLOW_RTC_FAST_MEM_AS_HEAP=y CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=3072 CONFIG_MAIN_TASK_STACK_SIZE=3584 @@ -1977,7 +1908,6 @@ CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y # CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set # CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set -# CONFIG_USB_ENABLED is not set CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y CONFIG_SUPPORT_TERMIOS=y CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 diff --git a/sdkconfig.esp32.4mb b/sdkconfig.esp32.4mb index 436756b4d..fd6cbed81 100644 --- a/sdkconfig.esp32.4mb +++ b/sdkconfig.esp32.4mb @@ -11,7 +11,7 @@ CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000 # # SDK tool configuration # -CONFIG_SDK_TOOLPREFIX="xtensa-esp32-elf-" +CONFIG_SDK_TOOLPREFIX="xtensa-esp32s3-elf-" # CONFIG_SDK_TOOLCHAIN_SUPPORTS_TIME_WIDE_64_BITS is not set # end of SDK tool configuration @@ -43,21 +43,13 @@ CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE is not set -# CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set +CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y # CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set # CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set -CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y +# CONFIG_BOOTLOADER_LOG_LEVEL_INFO is not set # CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set # CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set -CONFIG_BOOTLOADER_LOG_LEVEL=3 - -# -# Serial Flash Configurations -# -# CONFIG_BOOTLOADER_FLASH_DC_AWARE is not set -CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y -# end of Serial Flash Configurations - +CONFIG_BOOTLOADER_LOG_LEVEL=0 # CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V is not set CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y # CONFIG_BOOTLOADER_FACTORY_RESET is not set @@ -72,6 +64,7 @@ CONFIG_BOOTLOADER_WDT_TIME_MS=9000 # CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 # CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set +CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y # end of Bootloader config # @@ -100,13 +93,13 @@ CONFIG_ESPTOOLPY_FLASHFREQ_40M=y CONFIG_ESPTOOLPY_FLASHFREQ="40m" # CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y -# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y # CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE="4MB" +CONFIG_ESPTOOLPY_FLASHSIZE="8MB" CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y CONFIG_ESPTOOLPY_BEFORE_RESET=y # CONFIG_ESPTOOLPY_BEFORE_NORESET is not set @@ -243,7 +236,7 @@ CONFIG_BT_BTC_TASK_STACK_SIZE=3072 CONFIG_BT_BLUEDROID_PINNED_TO_CORE_0=y # CONFIG_BT_BLUEDROID_PINNED_TO_CORE_1 is not set CONFIG_BT_BLUEDROID_PINNED_TO_CORE=0 -CONFIG_BT_BTU_TASK_STACK_SIZE=4352 +CONFIG_BT_BTU_TASK_STACK_SIZE=4096 # CONFIG_BT_BLUEDROID_MEM_DEBUG is not set # CONFIG_BT_CLASSIC_ENABLED is not set CONFIG_BT_BLE_ENABLED=y @@ -260,7 +253,6 @@ CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE=0 # CONFIG_BT_GATTS_APPEARANCE_WRITABLE is not set CONFIG_BT_GATTC_ENABLE=y CONFIG_BT_GATTC_MAX_CACHE_CHAR=40 -CONFIG_BT_GATTC_NOTIF_REG_MAX=5 # CONFIG_BT_GATTC_CACHE_NVS_FLASH is not set CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=3 CONFIG_BT_BLE_SMP_ENABLE=y @@ -442,11 +434,10 @@ CONFIG_BT_LOG_BLUFI_TRACE_LEVEL=2 CONFIG_BT_ACL_CONNECTIONS=4 CONFIG_BT_MULTI_CONNECTION_ENBALE=y -# CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST is not set +CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=y # CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY is not set # CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK is not set CONFIG_BT_SMP_ENABLE=y -CONFIG_BT_SMP_MAX_BONDS=15 # CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN is not set CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT=30 CONFIG_BT_MAX_DEVICE_NAME_LEN=32 @@ -490,7 +481,7 @@ CONFIG_ADC_DISABLE_DAC=y # CONFIG_SPI_MASTER_IN_IRAM is not set CONFIG_SPI_MASTER_ISR_IN_IRAM=y # CONFIG_SPI_SLAVE_IN_IRAM is not set -# CONFIG_SPI_SLAVE_ISR_IN_IRAM is not set +CONFIG_SPI_SLAVE_ISR_IN_IRAM=y # end of SPI configuration # @@ -507,7 +498,7 @@ CONFIG_SPI_MASTER_ISR_IN_IRAM=y # # UART configuration # -# CONFIG_UART_ISR_IN_IRAM is not set +CONFIG_UART_ISR_IN_IRAM=y # end of UART configuration # @@ -706,12 +697,10 @@ CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=4 # # Sleep Config # -# CONFIG_ESP_SLEEP_POWER_DOWN_FLASH is not set +CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y -# CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND is not set -CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND=y -# CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU is not set -CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y +CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y +# CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND is not set # end of Sleep Config # @@ -732,10 +721,6 @@ CONFIG_ESP_IPC_ISR_ENABLE=y # LCD and Touch Panel # -# -# LCD Touch Drivers are maintained in the IDF Component Registry -# - # # LCD Peripheral Configuration # @@ -794,7 +779,7 @@ CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y # end of Memory protection CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 -CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=3072 CONFIG_ESP_MAIN_TASK_STACK_SIZE=3584 CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y # CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1 is not set @@ -839,16 +824,12 @@ CONFIG_ESP_TIMER_IMPL_TG0_LAC=y # CONFIG_ESP32_WIFI_ENABLED=y CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE=y -CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10 -CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32 +CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=4 +CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8 # CONFIG_ESP32_WIFI_STATIC_TX_BUFFER is not set CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 -CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=32 -CONFIG_ESP_WIFI_STATIC_RX_MGMT_BUFFER=y -# CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUFFER is not set -CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0 -CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF=5 +CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=16 # CONFIG_ESP32_WIFI_CSI_ENABLED is not set CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y CONFIG_ESP32_WIFI_TX_BA_WIN=6 @@ -953,7 +934,7 @@ CONFIG_FREERTOS_TICK_SUPPORT_CORETIMER=y CONFIG_FREERTOS_CORETIMER_0=y # CONFIG_FREERTOS_CORETIMER_1 is not set CONFIG_FREERTOS_SYSTICK_USES_CCOUNT=y -CONFIG_FREERTOS_HZ=100 +CONFIG_FREERTOS_HZ=1000 CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION=y # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set @@ -1023,17 +1004,20 @@ CONFIG_HEAP_TRACING_OFF=y # # Log output # -# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set +CONFIG_LOG_DEFAULT_LEVEL_NONE=y # CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set # CONFIG_LOG_DEFAULT_LEVEL_WARN is not set -CONFIG_LOG_DEFAULT_LEVEL_INFO=y +# CONFIG_LOG_DEFAULT_LEVEL_INFO is not set # CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set # CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set -CONFIG_LOG_DEFAULT_LEVEL=3 +CONFIG_LOG_DEFAULT_LEVEL=0 CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y +# CONFIG_LOG_MAXIMUM_LEVEL_ERROR is not set +# CONFIG_LOG_MAXIMUM_LEVEL_WARN is not set +# CONFIG_LOG_MAXIMUM_LEVEL_INFO is not set # CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set # CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set -CONFIG_LOG_MAXIMUM_LEVEL=3 +CONFIG_LOG_MAXIMUM_LEVEL=0 CONFIG_LOG_COLORS=y CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y # CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set @@ -1044,7 +1028,6 @@ CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y # CONFIG_LWIP_LOCAL_HOSTNAME="espressif" # CONFIG_LWIP_NETIF_API is not set -CONFIG_LWIP_TCPIP_TASK_PRIO=18 # CONFIG_LWIP_TCPIP_CORE_LOCKING is not set # CONFIG_LWIP_CHECK_THREAD_SAFETY is not set CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y @@ -1058,7 +1041,6 @@ CONFIG_LWIP_SO_REUSE=y CONFIG_LWIP_SO_REUSE_RXTOALL=y # CONFIG_LWIP_SO_RCVBUF is not set # CONFIG_LWIP_NETBUF_RECVINFO is not set -CONFIG_LWIP_IP_DEFAULT_TTL=64 CONFIG_LWIP_IP4_FRAG=y CONFIG_LWIP_IP6_FRAG=y # CONFIG_LWIP_IP4_REASSEMBLY is not set @@ -1070,7 +1052,7 @@ CONFIG_LWIP_ESP_GRATUITOUS_ARP=y CONFIG_LWIP_GARP_TMR_INTERVAL=60 CONFIG_LWIP_ESP_MLDV6_REPORT=y CONFIG_LWIP_MLDV6_TMR_INTERVAL=40 -CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=16 CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y # CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y @@ -1107,12 +1089,10 @@ CONFIG_LWIP_TCP_MSS=1440 CONFIG_LWIP_TCP_TMR_INTERVAL=250 CONFIG_LWIP_TCP_MSL=60000 CONFIG_LWIP_TCP_FIN_WAIT_TIMEOUT=20000 -CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5760 -CONFIG_LWIP_TCP_WND_DEFAULT=5760 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744 +CONFIG_LWIP_TCP_WND_DEFAULT=5744 CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 CONFIG_LWIP_TCP_QUEUE_OOSEQ=y -CONFIG_LWIP_TCP_OOSEQ_TIMEOUT=6 -CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=4 # CONFIG_LWIP_TCP_SACK_OUT is not set # CONFIG_LWIP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set CONFIG_LWIP_TCP_OVERSIZE_MSS=y @@ -1168,13 +1148,6 @@ CONFIG_LWIP_SNTP_MAX_SERVERS=1 CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 # end of SNTP -# -# DNS -# -CONFIG_LWIP_DNS_MAX_SERVERS=3 -# CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT is not set -# end of DNS - CONFIG_LWIP_ESP_LWIP_ASSERT=y # @@ -1205,17 +1178,20 @@ CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y # CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 -CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096 -# CONFIG_MBEDTLS_DYNAMIC_BUFFER is not set +CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=2048 +CONFIG_MBEDTLS_DYNAMIC_BUFFER=y +CONFIG_MBEDTLS_DYNAMIC_FREE_PEER_CERT=y +CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA=y +CONFIG_MBEDTLS_DYNAMIC_FREE_CA_CERT=y # CONFIG_MBEDTLS_DEBUG is not set # # mbedTLS v2.28.x related # # CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is not set +CONFIG_MBEDTLS_ECDH_LEGACY_CONTEXT=y # CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK is not set # CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION is not set -CONFIG_MBEDTLS_SSL_KEEP_PEER_CERTIFICATE=y # end of mbedTLS v2.28.x related # @@ -1229,8 +1205,8 @@ CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200 # end of Certificate Bundle -# CONFIG_MBEDTLS_ECP_RESTARTABLE is not set -# CONFIG_MBEDTLS_CMAC_C is not set +CONFIG_MBEDTLS_ECP_RESTARTABLE=y +CONFIG_MBEDTLS_CMAC_C=y CONFIG_MBEDTLS_HARDWARE_AES=y CONFIG_MBEDTLS_HARDWARE_MPI=y CONFIG_MBEDTLS_HARDWARE_SHA=y @@ -1405,20 +1381,6 @@ CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" # end of PThreads -# -# Main Flash configuration -# - -# -# Optional and Experimental Features (READ DOCS FIRST) -# - -# -# Features here require specific hardware (READ DOCS FIRST!) -# -# end of Optional and Experimental Features (READ DOCS FIRST) -# end of Main Flash configuration - # # SPI Flash driver # @@ -1446,8 +1408,8 @@ CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP=y CONFIG_SPI_FLASH_SUPPORT_MXIC_CHIP=y CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y -# CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP is not set -# CONFIG_SPI_FLASH_SUPPORT_TH_CHIP is not set +CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_TH_CHIP=y # end of Auto-detect flash chips CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y @@ -1547,8 +1509,8 @@ CONFIG_WL_SECTOR_SIZE=4096 # CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 -# CONFIG_WIFI_PROV_BLE_BONDING is not set -# CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION is not set +CONFIG_WIFI_PROV_BLE_BONDING=y +CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION=y # CONFIG_WIFI_PROV_KEEP_BLE_ON_AFTER_PROV is not set # end of Wi-Fi Provisioning Manager @@ -1589,14 +1551,14 @@ CONFIG_LUA_ROOT="/lua" # end of Compatibility options # Deprecated options for backward compatibility -CONFIG_TOOLPREFIX="xtensa-esp32-elf-" -# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set +CONFIG_TOOLPREFIX="xtensa-esp32s3-elf-" +CONFIG_LOG_BOOTLOADER_LEVEL_NONE=y # CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set # CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set -CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y +# CONFIG_LOG_BOOTLOADER_LEVEL_INFO is not set # CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set # CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set -CONFIG_LOG_BOOTLOADER_LEVEL=3 +CONFIG_LOG_BOOTLOADER_LEVEL=0 # CONFIG_APP_ROLLBACK_ENABLE is not set # CONFIG_FLASH_ENCRYPTION_ENABLED is not set # CONFIG_FLASHMODE_QIO is not set @@ -1656,7 +1618,7 @@ CONFIG_BTC_TASK_STACK_SIZE=3072 CONFIG_BLUEDROID_PINNED_TO_CORE_0=y # CONFIG_BLUEDROID_PINNED_TO_CORE_1 is not set CONFIG_BLUEDROID_PINNED_TO_CORE=0 -CONFIG_BTU_TASK_STACK_SIZE=4352 +CONFIG_BTU_TASK_STACK_SIZE=4096 # CONFIG_BLUEDROID_MEM_DEBUG is not set # CONFIG_CLASSIC_BT_ENABLED is not set CONFIG_GATTS_ENABLE=y @@ -1859,8 +1821,8 @@ CONFIG_POST_EVENTS_FROM_IRAM_ISR=y # CONFIG_TWO_UNIVERSAL_MAC_ADDRESS is not set CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4 -# CONFIG_ESP_SYSTEM_PD_FLASH is not set -# CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND is not set +CONFIG_ESP_SYSTEM_PD_FLASH=y +CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND=y CONFIG_IPC_TASK_STACK_SIZE=1536 CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y # CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set @@ -1872,7 +1834,7 @@ CONFIG_ESP32S2_PANIC_PRINT_REBOOT=y # CONFIG_ESP32S2_PANIC_SILENT_REBOOT is not set # CONFIG_ESP32S2_PANIC_GDBSTUB is not set CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 -CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=3072 CONFIG_MAIN_TASK_STACK_SIZE=3584 CONFIG_CONSOLE_UART_DEFAULT=y # CONFIG_CONSOLE_UART_CUSTOM is not set @@ -1915,13 +1877,13 @@ CONFIG_TIMER_QUEUE_LENGTH=10 # CONFIG_USE_ONLY_LWIP_SELECT is not set CONFIG_ESP_GRATUITOUS_ARP=y CONFIG_GARP_TMR_INTERVAL=60 -CONFIG_TCPIP_RECVMBOX_SIZE=32 +CONFIG_TCPIP_RECVMBOX_SIZE=16 CONFIG_TCP_MAXRTX=12 CONFIG_TCP_SYNMAXRTX=12 CONFIG_TCP_MSS=1440 CONFIG_TCP_MSL=60000 -CONFIG_TCP_SND_BUF_DEFAULT=5760 -CONFIG_TCP_WND_DEFAULT=5760 +CONFIG_TCP_SND_BUF_DEFAULT=5744 +CONFIG_TCP_WND_DEFAULT=5744 CONFIG_TCP_RECVMBOX_SIZE=6 CONFIG_TCP_QUEUE_OOSEQ=y # CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set diff --git a/sdkconfig.old b/sdkconfig.old index 5cf73e7c4..3a3abed65 100644 --- a/sdkconfig.old +++ b/sdkconfig.old @@ -4,9 +4,9 @@ # CONFIG_IDF_CMAKE=y CONFIG_IDF_TARGET_ARCH_XTENSA=y -CONFIG_IDF_TARGET="esp32s3" -CONFIG_IDF_TARGET_ESP32S3=y -CONFIG_IDF_FIRMWARE_CHIP_ID=0x0009 +CONFIG_IDF_TARGET="esp32" +CONFIG_IDF_TARGET_ESP32=y +CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000 # # SDK tool configuration @@ -38,26 +38,19 @@ CONFIG_APP_RETRIEVE_LEN_ELF_SHA=16 # # Bootloader config # -CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x0 +CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x1000 CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE is not set -# CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set +CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y # CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set # CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set -CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y +# CONFIG_BOOTLOADER_LOG_LEVEL_INFO is not set # CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set # CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set -CONFIG_BOOTLOADER_LOG_LEVEL=3 - -# -# Serial Flash Configurations -# -# CONFIG_BOOTLOADER_FLASH_DC_AWARE is not set -CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y -# end of Serial Flash Configurations - +CONFIG_BOOTLOADER_LOG_LEVEL=0 +# CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V is not set CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y # CONFIG_BOOTLOADER_FACTORY_RESET is not set # CONFIG_BOOTLOADER_APP_TEST is not set @@ -71,54 +64,42 @@ CONFIG_BOOTLOADER_WDT_TIME_MS=9000 # CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 # CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set +CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y # end of Bootloader config # # Security features # -CONFIG_SECURE_BOOT_SUPPORTS_RSA=y -CONFIG_SECURE_TARGET_HAS_SECURE_ROM_DL_MODE=y # CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set # CONFIG_SECURE_BOOT is not set # CONFIG_SECURE_FLASH_ENC_ENABLED is not set # end of Security features -# -# Boot ROM Behavior -# -CONFIG_BOOT_ROM_LOG_ALWAYS_ON=y -# CONFIG_BOOT_ROM_LOG_ALWAYS_OFF is not set -# CONFIG_BOOT_ROM_LOG_ON_GPIO_HIGH is not set -# CONFIG_BOOT_ROM_LOG_ON_GPIO_LOW is not set -# end of Boot ROM Behavior - # # Serial flasher config # CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200 # CONFIG_ESPTOOLPY_NO_STUB is not set -# CONFIG_ESPTOOLPY_OCT_FLASH is not set # CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set # CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set CONFIG_ESPTOOLPY_FLASHMODE_DIO=y # CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y CONFIG_ESPTOOLPY_FLASHMODE="dio" -CONFIG_ESPTOOLPY_S3_STR=y -# CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set -CONFIG_ESPTOOLPY_FLASHFREQ_80M=y -# CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set +# CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set +CONFIG_ESPTOOLPY_FLASHFREQ_40M=y +# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set -CONFIG_ESPTOOLPY_FLASHFREQ="80m" +CONFIG_ESPTOOLPY_FLASHFREQ="40m" # CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y +# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set -# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y # CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set -CONFIG_ESPTOOLPY_FLASHSIZE="2MB" +CONFIG_ESPTOOLPY_FLASHSIZE="8MB" CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y CONFIG_ESPTOOLPY_BEFORE_RESET=y # CONFIG_ESPTOOLPY_BEFORE_NORESET is not set @@ -141,12 +122,12 @@ CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 # # Partition Table # -CONFIG_PARTITION_TABLE_SINGLE_APP=y +# CONFIG_PARTITION_TABLE_SINGLE_APP is not set # CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set # CONFIG_PARTITION_TABLE_TWO_OTA is not set -# CONFIG_PARTITION_TABLE_CUSTOM is not set -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" -CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp.csv" +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="ezlopi_partitions_v3_1_4_181_4mb.csv" +CONFIG_PARTITION_TABLE_FILENAME="ezlopi_partitions_v3_1_4_181_4mb.csv" CONFIG_PARTITION_TABLE_OFFSET=0x8000 CONFIG_PARTITION_TABLE_MD5=y # end of Partition Table @@ -196,9 +177,278 @@ CONFIG_APPTRACE_LOCK_ENABLE=y # # Bluetooth # -# CONFIG_BT_ENABLED is not set +CONFIG_BT_ENABLED=y + +# +# Bluetooth controller +# +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +# CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY is not set +# CONFIG_BTDM_CTRL_MODE_BTDM is not set +CONFIG_BTDM_CTRL_BLE_MAX_CONN=3 +CONFIG_BTDM_CTRL_BR_EDR_SCO_DATA_PATH_EFF=0 +CONFIG_BTDM_CTRL_PCM_ROLE_EFF=0 +CONFIG_BTDM_CTRL_PCM_POLAR_EFF=0 +CONFIG_BTDM_CTRL_BLE_MAX_CONN_EFF=3 +CONFIG_BTDM_CTRL_BR_EDR_MAX_ACL_CONN_EFF=0 +CONFIG_BTDM_CTRL_BR_EDR_MAX_SYNC_CONN_EFF=0 +CONFIG_BTDM_CTRL_PINNED_TO_CORE_0=y +# CONFIG_BTDM_CTRL_PINNED_TO_CORE_1 is not set +CONFIG_BTDM_CTRL_PINNED_TO_CORE=0 +CONFIG_BTDM_CTRL_HCI_MODE_VHCI=y +# CONFIG_BTDM_CTRL_HCI_MODE_UART_H4 is not set + +# +# MODEM SLEEP Options +# +CONFIG_BTDM_CTRL_MODEM_SLEEP=y +CONFIG_BTDM_CTRL_MODEM_SLEEP_MODE_ORIG=y +# CONFIG_BTDM_CTRL_MODEM_SLEEP_MODE_EVED is not set +CONFIG_BTDM_CTRL_LPCLK_SEL_MAIN_XTAL=y +# end of MODEM SLEEP Options + +CONFIG_BTDM_BLE_DEFAULT_SCA_250PPM=y +CONFIG_BTDM_BLE_SLEEP_CLOCK_ACCURACY_INDEX_EFF=1 +CONFIG_BTDM_BLE_SCAN_DUPL=y +CONFIG_BTDM_SCAN_DUPL_TYPE_DEVICE=y +# CONFIG_BTDM_SCAN_DUPL_TYPE_DATA is not set +# CONFIG_BTDM_SCAN_DUPL_TYPE_DATA_DEVICE is not set +CONFIG_BTDM_SCAN_DUPL_TYPE=0 +CONFIG_BTDM_SCAN_DUPL_CACHE_SIZE=100 +CONFIG_BTDM_SCAN_DUPL_CACHE_REFRESH_PERIOD=0 +# CONFIG_BTDM_BLE_MESH_SCAN_DUPL_EN is not set +CONFIG_BTDM_CTRL_FULL_SCAN_SUPPORTED=y +CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP=y +CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM=100 +CONFIG_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 +CONFIG_BTDM_RESERVE_DRAM=0xdb5c +CONFIG_BTDM_CTRL_HLI=y +# end of Bluetooth controller + +CONFIG_BT_BLUEDROID_ENABLED=y +# CONFIG_BT_NIMBLE_ENABLED is not set +# CONFIG_BT_CONTROLLER_ONLY is not set + +# +# Bluedroid Options +# +CONFIG_BT_BTC_TASK_STACK_SIZE=3072 +CONFIG_BT_BLUEDROID_PINNED_TO_CORE_0=y +# CONFIG_BT_BLUEDROID_PINNED_TO_CORE_1 is not set +CONFIG_BT_BLUEDROID_PINNED_TO_CORE=0 +CONFIG_BT_BTU_TASK_STACK_SIZE=4096 +# CONFIG_BT_BLUEDROID_MEM_DEBUG is not set +# CONFIG_BT_CLASSIC_ENABLED is not set +CONFIG_BT_BLE_ENABLED=y +CONFIG_BT_GATTS_ENABLE=y +# CONFIG_BT_GATTS_PPCP_CHAR_GAP is not set +# CONFIG_BT_BLE_BLUFI_ENABLE is not set +CONFIG_BT_GATT_MAX_SR_PROFILES=8 +CONFIG_BT_GATT_MAX_SR_ATTRIBUTES=100 +# CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MANUAL is not set +CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_AUTO=y +CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE=0 +# CONFIG_BT_GATTS_ROBUST_CACHING_ENABLED is not set +# CONFIG_BT_GATTS_DEVICE_NAME_WRITABLE is not set +# CONFIG_BT_GATTS_APPEARANCE_WRITABLE is not set +CONFIG_BT_GATTC_ENABLE=y +CONFIG_BT_GATTC_MAX_CACHE_CHAR=40 +# CONFIG_BT_GATTC_CACHE_NVS_FLASH is not set +CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=3 +CONFIG_BT_BLE_SMP_ENABLE=y +# CONFIG_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE is not set +# CONFIG_BT_STACK_NO_LOG is not set + +# +# BT DEBUG LOG LEVEL +# +# CONFIG_BT_LOG_HCI_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_HCI_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_HCI_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_HCI_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_HCI_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_HCI_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_HCI_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_HCI_TRACE_LEVEL=2 +# CONFIG_BT_LOG_BTM_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_BTM_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_BTM_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_BTM_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_BTM_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_BTM_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_BTM_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_BTM_TRACE_LEVEL=2 +# CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_L2CAP_TRACE_LEVEL=2 +# CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL=2 +# CONFIG_BT_LOG_SDP_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_SDP_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_SDP_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_SDP_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_SDP_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_SDP_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_SDP_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_SDP_TRACE_LEVEL=2 +# CONFIG_BT_LOG_GAP_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_GAP_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_GAP_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_GAP_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_GAP_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_GAP_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_GAP_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_GAP_TRACE_LEVEL=2 +# CONFIG_BT_LOG_BNEP_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_BNEP_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_BNEP_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_BNEP_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_BNEP_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_BNEP_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_BNEP_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_BNEP_TRACE_LEVEL=2 +# CONFIG_BT_LOG_PAN_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_PAN_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_PAN_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_PAN_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_PAN_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_PAN_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_PAN_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_PAN_TRACE_LEVEL=2 +# CONFIG_BT_LOG_A2D_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_A2D_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_A2D_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_A2D_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_A2D_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_A2D_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_A2D_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_A2D_TRACE_LEVEL=2 +# CONFIG_BT_LOG_AVDT_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_AVDT_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_AVDT_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_AVDT_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_AVDT_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_AVDT_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_AVDT_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_AVDT_TRACE_LEVEL=2 +# CONFIG_BT_LOG_AVCT_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_AVCT_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_AVCT_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_AVCT_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_AVCT_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_AVCT_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_AVCT_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_AVCT_TRACE_LEVEL=2 +# CONFIG_BT_LOG_AVRC_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_AVRC_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_AVRC_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_AVRC_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_AVRC_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_AVRC_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_AVRC_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_AVRC_TRACE_LEVEL=2 +# CONFIG_BT_LOG_MCA_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_MCA_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_MCA_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_MCA_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_MCA_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_MCA_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_MCA_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_MCA_TRACE_LEVEL=2 +# CONFIG_BT_LOG_HID_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_HID_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_HID_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_HID_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_HID_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_HID_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_HID_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_HID_TRACE_LEVEL=2 +# CONFIG_BT_LOG_APPL_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_APPL_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_APPL_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_APPL_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_APPL_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_APPL_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_APPL_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_APPL_TRACE_LEVEL=2 +# CONFIG_BT_LOG_GATT_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_GATT_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_GATT_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_GATT_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_GATT_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_GATT_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_GATT_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_GATT_TRACE_LEVEL=2 +# CONFIG_BT_LOG_SMP_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_SMP_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_SMP_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_SMP_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_SMP_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_SMP_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_SMP_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_SMP_TRACE_LEVEL=2 +# CONFIG_BT_LOG_BTIF_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_BTIF_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_BTIF_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_BTIF_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_BTIF_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_BTIF_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_BTIF_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_BTIF_TRACE_LEVEL=2 +# CONFIG_BT_LOG_BTC_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_BTC_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_BTC_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_BTC_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_BTC_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_BTC_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_BTC_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_BTC_TRACE_LEVEL=2 +# CONFIG_BT_LOG_OSI_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_OSI_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_OSI_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_OSI_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_OSI_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_OSI_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_OSI_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_OSI_TRACE_LEVEL=2 +# CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_BLUFI_TRACE_LEVEL=2 +# end of BT DEBUG LOG LEVEL + +CONFIG_BT_ACL_CONNECTIONS=4 +CONFIG_BT_MULTI_CONNECTION_ENBALE=y +CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=y +# CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY is not set +# CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK is not set +CONFIG_BT_SMP_ENABLE=y +# CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN is not set +CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT=30 +CONFIG_BT_MAX_DEVICE_NAME_LEN=32 +# CONFIG_BT_BLE_RPA_SUPPORTED is not set +CONFIG_BT_BLE_RPA_TIMEOUT=900 +# CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL is not set +# end of Bluedroid Options # end of Bluetooth +# CONFIG_BLE_MESH is not set + # # CoAP Configuration # @@ -217,7 +467,6 @@ CONFIG_COAP_LOG_DEFAULT_LEVEL=0 # # CONFIG_ADC_FORCE_XPD_FSM is not set CONFIG_ADC_DISABLE_DAC=y -# CONFIG_ADC_CONTINUOUS_FORCE_USE_ADC2_ON_C3_S3 is not set # end of ADC configuration # @@ -239,15 +488,31 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=y # TWAI configuration # # CONFIG_TWAI_ISR_IN_IRAM is not set +# CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC is not set +# CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST is not set +# CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID is not set +# CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT is not set # CONFIG_TWAI_ERRATA_FIX_LISTEN_ONLY_DOM is not set # end of TWAI configuration # # UART configuration # -# CONFIG_UART_ISR_IN_IRAM is not set +CONFIG_UART_ISR_IN_IRAM=y # end of UART configuration +# +# RTCIO configuration +# +# CONFIG_RTCIO_SUPPORT_RTC_GPIO_DESC is not set +# end of RTCIO configuration + +# +# GPIO Configuration +# +# CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL is not set +# end of GPIO Configuration + # # GDMA Configuration # @@ -261,14 +526,17 @@ CONFIG_SPI_SLAVE_ISR_IN_IRAM=y # # CONFIG_EFUSE_CUSTOM_TABLE is not set # CONFIG_EFUSE_VIRTUAL is not set -CONFIG_EFUSE_MAX_BLK_LEN=256 +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_NONE is not set +CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4=y +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_REPEAT is not set +CONFIG_EFUSE_MAX_BLK_LEN=192 # end of eFuse Bit Manager # # ESP-TLS # CONFIG_ESP_TLS_USING_MBEDTLS=y -CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y +# CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set # CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set # CONFIG_ESP_TLS_SERVER is not set # CONFIG_ESP_TLS_PSK_VERIFICATION is not set @@ -276,81 +544,68 @@ CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y # end of ESP-TLS # -# ESP32S3-Specific +# ESP32-specific # -CONFIG_ESP32S3_REV_MIN_0=y -# CONFIG_ESP32S3_REV_MIN_1 is not set -# CONFIG_ESP32S3_REV_MIN_2 is not set -CONFIG_ESP32S3_REV_MIN_FULL=0 +CONFIG_ESP32_REV_MIN_0=y +# CONFIG_ESP32_REV_MIN_1 is not set +# CONFIG_ESP32_REV_MIN_1_1 is not set +# CONFIG_ESP32_REV_MIN_2 is not set +# CONFIG_ESP32_REV_MIN_3 is not set +# CONFIG_ESP32_REV_MIN_3_1 is not set +CONFIG_ESP32_REV_MIN=0 +CONFIG_ESP32_REV_MIN_FULL=0 CONFIG_ESP_REV_MIN_FULL=0 -CONFIG_ESP32S3_REV_MAX_FULL_STR_OPT=y -CONFIG_ESP32S3_REV_MAX_FULL=99 -CONFIG_ESP_REV_MAX_FULL=99 -# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_80 is not set -CONFIG_ESP32S3_DEFAULT_CPU_FREQ_160=y -# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240 is not set -CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=160 - -# -# Cache config -# -CONFIG_ESP32S3_INSTRUCTION_CACHE_16KB=y -# CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB is not set -CONFIG_ESP32S3_INSTRUCTION_CACHE_SIZE=0x4000 -# CONFIG_ESP32S3_INSTRUCTION_CACHE_4WAYS is not set -CONFIG_ESP32S3_INSTRUCTION_CACHE_8WAYS=y -CONFIG_ESP32S3_ICACHE_ASSOCIATED_WAYS=8 -# CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_16B is not set -CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_32B=y -CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_SIZE=32 -# CONFIG_ESP32S3_INSTRUCTION_CACHE_WRAP is not set -# CONFIG_ESP32S3_DATA_CACHE_16KB is not set -CONFIG_ESP32S3_DATA_CACHE_32KB=y -# CONFIG_ESP32S3_DATA_CACHE_64KB is not set -CONFIG_ESP32S3_DATA_CACHE_SIZE=0x8000 -# CONFIG_ESP32S3_DATA_CACHE_4WAYS is not set -CONFIG_ESP32S3_DATA_CACHE_8WAYS=y -CONFIG_ESP32S3_DCACHE_ASSOCIATED_WAYS=8 -# CONFIG_ESP32S3_DATA_CACHE_LINE_16B is not set -CONFIG_ESP32S3_DATA_CACHE_LINE_32B=y -# CONFIG_ESP32S3_DATA_CACHE_LINE_64B is not set -CONFIG_ESP32S3_DATA_CACHE_LINE_SIZE=32 -# CONFIG_ESP32S3_DATA_CACHE_WRAP is not set -# end of Cache config - -# CONFIG_ESP32S3_SPIRAM_SUPPORT is not set -# CONFIG_ESP32S3_TRAX is not set -CONFIG_ESP32S3_TRACEMEM_RESERVE_DRAM=0x0 -# CONFIG_ESP32S3_ULP_COPROC_ENABLED is not set -CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM=0 -CONFIG_ESP32S3_DEBUG_OCDAWARE=y -CONFIG_ESP32S3_BROWNOUT_DET=y -CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_7=y -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_6 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_5 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_4 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_3 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_2 is not set -# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_1 is not set -CONFIG_ESP32S3_BROWNOUT_DET_LVL=7 -CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC_FRC1=y -# CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC is not set -# CONFIG_ESP32S3_TIME_SYSCALL_USE_FRC1 is not set -# CONFIG_ESP32S3_TIME_SYSCALL_USE_NONE is not set -CONFIG_ESP32S3_RTC_CLK_SRC_INT_RC=y -# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_CRYS is not set -# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_OSC is not set -# CONFIG_ESP32S3_RTC_CLK_SRC_INT_8MD256 is not set -CONFIG_ESP32S3_RTC_CLK_CAL_CYCLES=1024 -CONFIG_ESP32S3_DEEP_SLEEP_WAKEUP_DELAY=2000 -# CONFIG_ESP32S3_NO_BLOBS is not set -# CONFIG_ESP32S3_RTCDATA_IN_FAST_MEM is not set -# CONFIG_ESP32S3_USE_FIXED_STATIC_RAM_SIZE is not set -# end of ESP32S3-Specific +CONFIG_ESP32_REV_MAX_FULL_STR_OPT=y +CONFIG_ESP32_REV_MAX_FULL=399 +CONFIG_ESP_REV_MAX_FULL=399 +CONFIG_ESP32_DPORT_WORKAROUND=y +# CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set +CONFIG_ESP32_DEFAULT_CPU_FREQ_160=y +# CONFIG_ESP32_DEFAULT_CPU_FREQ_240 is not set +CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=160 +# CONFIG_ESP32_SPIRAM_SUPPORT is not set +# CONFIG_ESP32_TRAX is not set +CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0x0 +# CONFIG_ESP32_ULP_COPROC_ENABLED is not set +CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0 +CONFIG_ESP32_DEBUG_OCDAWARE=y +CONFIG_ESP32_BROWNOUT_DET=y +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_0=y +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_7 is not set +CONFIG_ESP32_BROWNOUT_DET_LVL=0 +CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1=y +# CONFIG_ESP32_TIME_SYSCALL_USE_RTC is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_FRC1 is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_NONE is not set +CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y +# CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_ESP32_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_ESP32_RTC_CLK_SRC_INT_8MD256 is not set +CONFIG_ESP32_RTC_CLK_CAL_CYCLES=1024 +CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000 +CONFIG_ESP32_XTAL_FREQ_40=y +# CONFIG_ESP32_XTAL_FREQ_26 is not set +# CONFIG_ESP32_XTAL_FREQ_AUTO is not set +CONFIG_ESP32_XTAL_FREQ=40 +# CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE is not set +# CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set +# CONFIG_ESP32_COMPATIBLE_PRE_V3_1_BOOTLOADERS is not set +# CONFIG_ESP32_USE_FIXED_STATIC_RAM_SIZE is not set +CONFIG_ESP32_DPORT_DIS_INTERRUPT_LVL=5 +# end of ESP32-specific # # ADC-Calibration # +CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y +CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y +CONFIG_ADC_CAL_LUT_ENABLE=y # end of ADC-Calibration # @@ -363,9 +618,17 @@ CONFIG_ESP_ERR_TO_NAME_LOOKUP=y # Ethernet # CONFIG_ETH_ENABLED=y +CONFIG_ETH_USE_ESP32_EMAC=y +CONFIG_ETH_PHY_INTERFACE_RMII=y +CONFIG_ETH_RMII_CLK_INPUT=y +# CONFIG_ETH_RMII_CLK_OUTPUT is not set +CONFIG_ETH_RMII_CLK_IN_GPIO=0 +CONFIG_ETH_DMA_BUFFER_SIZE=512 +CONFIG_ETH_DMA_RX_BUFFER_NUM=10 +CONFIG_ETH_DMA_TX_BUFFER_NUM=10 CONFIG_ETH_USE_SPI_ETHERNET=y # CONFIG_ETH_SPI_ETHERNET_DM9051 is not set -# CONFIG_ETH_SPI_ETHERNET_W5500 is not set +CONFIG_ETH_SPI_ETHERNET_W5500=y # CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL is not set # CONFIG_ETH_USE_OPENETH is not set # end of Ethernet @@ -399,7 +662,7 @@ CONFIG_HTTPD_MAX_URI_LEN=512 CONFIG_HTTPD_ERR_RESP_NO_DELAY=y CONFIG_HTTPD_PURGE_BUF_LEN=32 # CONFIG_HTTPD_LOG_PURGE_DATA is not set -# CONFIG_HTTPD_WS_SUPPORT is not set +CONFIG_HTTPD_WS_SUPPORT=y # end of HTTP Server # @@ -425,26 +688,24 @@ CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y -# CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO is not set -CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_FOUR=y -CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES=4 +# CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_TWO is not set +CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR=y +CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=4 +# CONFIG_ESP_MAC_IGNORE_MAC_CRC_ERROR is not set # end of MAC Config # # Sleep Config # -# CONFIG_ESP_SLEEP_POWER_DOWN_FLASH is not set +CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y -CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND=y -CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU=y -CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y +# CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND is not set # end of Sleep Config # # RTC Clock Config # -CONFIG_RTC_CLOCK_BBPLL_POWER_ON_WITH_USB=y # end of RTC Clock Config # end of Hardware Settings @@ -460,15 +721,10 @@ CONFIG_ESP_IPC_ISR_ENABLE=y # LCD and Touch Panel # -# -# LCD Touch Drivers are maintained in the IDF Component Registry -# - # # LCD Peripheral Configuration # CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE=32 -# CONFIG_LCD_RGB_ISR_IRAM_SAFE is not set # end of LCD Peripheral Configuration # end of LCD and Touch Panel @@ -489,7 +745,6 @@ CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20 CONFIG_ESP_PHY_MAX_TX_POWER=20 # CONFIG_ESP_PHY_REDUCE_TX_POWER is not set -CONFIG_ESP_PHY_ENABLE_USB=y CONFIG_ESP_PHY_RF_CAL_PARTIAL=y # CONFIG_ESP_PHY_RF_CAL_NONE is not set # CONFIG_ESP_PHY_RF_CAL_FULL is not set @@ -500,8 +755,6 @@ CONFIG_ESP_PHY_CALIBRATION_MODE=0 # Power Management # # CONFIG_PM_ENABLE is not set -CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y -CONFIG_PM_POWER_DOWN_TAGMEM_IN_LIGHT_SLEEP=y # end of Power Management # @@ -519,8 +772,6 @@ CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set # CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set # CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set -CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK=y -CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=y # # Memory protection @@ -528,7 +779,7 @@ CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=y # end of Memory protection CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 -CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=3072 CONFIG_ESP_MAIN_TASK_STACK_SIZE=3584 CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y # CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1 is not set @@ -536,12 +787,8 @@ CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 CONFIG_ESP_CONSOLE_UART_DEFAULT=y -# CONFIG_ESP_CONSOLE_USB_CDC is not set -# CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG is not set # CONFIG_ESP_CONSOLE_UART_CUSTOM is not set # CONFIG_ESP_CONSOLE_NONE is not set -# CONFIG_ESP_CONSOLE_SECONDARY_NONE is not set -CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y CONFIG_ESP_CONSOLE_UART=y CONFIG_ESP_CONSOLE_MULTIPLE_UART=y CONFIG_ESP_CONSOLE_UART_NUM=0 @@ -556,8 +803,7 @@ CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y # CONFIG_ESP_PANIC_HANDLER_IRAM is not set # CONFIG_ESP_DEBUG_STUBS_ENABLE is not set -CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y -CONFIG_ESP_SYSTEM_BBPLL_RECALIB=y +CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5=y # end of ESP System Settings # @@ -569,23 +815,21 @@ CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER=y CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584 CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1 # CONFIG_ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD is not set -CONFIG_ESP_TIMER_IMPL_SYSTIMER=y +# CONFIG_ESP_TIMER_IMPL_FRC2 is not set +CONFIG_ESP_TIMER_IMPL_TG0_LAC=y # end of High resolution timer (esp_timer) # # Wi-Fi # CONFIG_ESP32_WIFI_ENABLED=y -CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10 -CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32 +CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE=y +CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=4 +CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8 # CONFIG_ESP32_WIFI_STATIC_TX_BUFFER is not set CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 -CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=32 -CONFIG_ESP_WIFI_STATIC_RX_MGMT_BUFFER=y -# CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUFFER is not set -CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0 -CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF=5 +CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=16 # CONFIG_ESP32_WIFI_CSI_ENABLED is not set CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y CONFIG_ESP32_WIFI_TX_BA_WIN=6 @@ -596,13 +840,11 @@ CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y # CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 -CONFIG_ESP32_WIFI_IRAM_OPT=y +# CONFIG_ESP32_WIFI_IRAM_OPT is not set CONFIG_ESP32_WIFI_RX_IRAM_OPT=y CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y # CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set -# CONFIG_ESP_WIFI_FTM_ENABLE is not set # CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set -# CONFIG_ESP_WIFI_GCMP_SUPPORT is not set # CONFIG_ESP_WIFI_GMAC_SUPPORT is not set CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y # CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set @@ -688,11 +930,11 @@ CONFIG_FMB_EVENT_QUEUE_TIMEOUT=20 # # CONFIG_FREERTOS_UNICORE is not set CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF -CONFIG_FREERTOS_TICK_SUPPORT_SYSTIMER=y -CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL1=y -# CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL3 is not set -CONFIG_FREERTOS_SYSTICK_USES_SYSTIMER=y -CONFIG_FREERTOS_HZ=100 +CONFIG_FREERTOS_TICK_SUPPORT_CORETIMER=y +CONFIG_FREERTOS_CORETIMER_0=y +# CONFIG_FREERTOS_CORETIMER_1 is not set +CONFIG_FREERTOS_SYSTICK_USES_CCOUNT=y +CONFIG_FREERTOS_HZ=1000 CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION=y # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set @@ -720,6 +962,7 @@ CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y # CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set # CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set CONFIG_FREERTOS_DEBUG_OCDAWARE=y +# CONFIG_FREERTOS_FPU_IN_ISR is not set CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y # CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH is not set # end of FreeRTOS @@ -761,17 +1004,20 @@ CONFIG_HEAP_TRACING_OFF=y # # Log output # -# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set +CONFIG_LOG_DEFAULT_LEVEL_NONE=y # CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set # CONFIG_LOG_DEFAULT_LEVEL_WARN is not set -CONFIG_LOG_DEFAULT_LEVEL_INFO=y +# CONFIG_LOG_DEFAULT_LEVEL_INFO is not set # CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set # CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set -CONFIG_LOG_DEFAULT_LEVEL=3 +CONFIG_LOG_DEFAULT_LEVEL=0 CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y +# CONFIG_LOG_MAXIMUM_LEVEL_ERROR is not set +# CONFIG_LOG_MAXIMUM_LEVEL_WARN is not set +# CONFIG_LOG_MAXIMUM_LEVEL_INFO is not set # CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set # CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set -CONFIG_LOG_MAXIMUM_LEVEL=3 +CONFIG_LOG_MAXIMUM_LEVEL=0 CONFIG_LOG_COLORS=y CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y # CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set @@ -782,7 +1028,6 @@ CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y # CONFIG_LWIP_LOCAL_HOSTNAME="espressif" # CONFIG_LWIP_NETIF_API is not set -CONFIG_LWIP_TCPIP_TASK_PRIO=18 # CONFIG_LWIP_TCPIP_CORE_LOCKING is not set # CONFIG_LWIP_CHECK_THREAD_SAFETY is not set CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y @@ -796,7 +1041,6 @@ CONFIG_LWIP_SO_REUSE=y CONFIG_LWIP_SO_REUSE_RXTOALL=y # CONFIG_LWIP_SO_RCVBUF is not set # CONFIG_LWIP_NETBUF_RECVINFO is not set -CONFIG_LWIP_IP_DEFAULT_TTL=64 CONFIG_LWIP_IP4_FRAG=y CONFIG_LWIP_IP6_FRAG=y # CONFIG_LWIP_IP4_REASSEMBLY is not set @@ -808,7 +1052,7 @@ CONFIG_LWIP_ESP_GRATUITOUS_ARP=y CONFIG_LWIP_GARP_TMR_INTERVAL=60 CONFIG_LWIP_ESP_MLDV6_REPORT=y CONFIG_LWIP_MLDV6_TMR_INTERVAL=40 -CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=16 CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y # CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y @@ -845,12 +1089,10 @@ CONFIG_LWIP_TCP_MSS=1440 CONFIG_LWIP_TCP_TMR_INTERVAL=250 CONFIG_LWIP_TCP_MSL=60000 CONFIG_LWIP_TCP_FIN_WAIT_TIMEOUT=20000 -CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5760 -CONFIG_LWIP_TCP_WND_DEFAULT=5760 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744 +CONFIG_LWIP_TCP_WND_DEFAULT=5744 CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 CONFIG_LWIP_TCP_QUEUE_OOSEQ=y -CONFIG_LWIP_TCP_OOSEQ_TIMEOUT=6 -CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=4 # CONFIG_LWIP_TCP_SACK_OUT is not set # CONFIG_LWIP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set CONFIG_LWIP_TCP_OVERSIZE_MSS=y @@ -906,13 +1148,6 @@ CONFIG_LWIP_SNTP_MAX_SERVERS=1 CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 # end of SNTP -# -# DNS -# -CONFIG_LWIP_DNS_MAX_SERVERS=3 -# CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT is not set -# end of DNS - CONFIG_LWIP_ESP_LWIP_ASSERT=y # @@ -943,17 +1178,20 @@ CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y # CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 -CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096 -# CONFIG_MBEDTLS_DYNAMIC_BUFFER is not set +CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=2048 +CONFIG_MBEDTLS_DYNAMIC_BUFFER=y +CONFIG_MBEDTLS_DYNAMIC_FREE_PEER_CERT=y +CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA=y +CONFIG_MBEDTLS_DYNAMIC_FREE_CA_CERT=y # CONFIG_MBEDTLS_DEBUG is not set # # mbedTLS v2.28.x related # # CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is not set +CONFIG_MBEDTLS_ECDH_LEGACY_CONTEXT=y # CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK is not set # CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION is not set -CONFIG_MBEDTLS_SSL_KEEP_PEER_CERTIFICATE=y # end of mbedTLS v2.28.x related # @@ -967,10 +1205,9 @@ CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200 # end of Certificate Bundle -# CONFIG_MBEDTLS_ECP_RESTARTABLE is not set -# CONFIG_MBEDTLS_CMAC_C is not set +CONFIG_MBEDTLS_ECP_RESTARTABLE=y +CONFIG_MBEDTLS_CMAC_C=y CONFIG_MBEDTLS_HARDWARE_AES=y -CONFIG_MBEDTLS_AES_USE_INTERRUPT=y CONFIG_MBEDTLS_HARDWARE_MPI=y CONFIG_MBEDTLS_HARDWARE_SHA=y CONFIG_MBEDTLS_ROM_MD5=y @@ -1144,33 +1381,12 @@ CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" # end of PThreads -# -# Main Flash configuration -# - -# -# Optional and Experimental Features (READ DOCS FIRST) -# - -# -# Features here require specific hardware (READ DOCS FIRST!) -# -# CONFIG_SPI_FLASH_HPM_ENA is not set -CONFIG_SPI_FLASH_HPM_AUTO=y -# CONFIG_SPI_FLASH_HPM_DIS is not set -CONFIG_SPI_FLASH_HPM_ON=y -CONFIG_SPI_FLASH_HPM_DC_AUTO=y -# CONFIG_SPI_FLASH_HPM_DC_DISABLE is not set -# end of Optional and Experimental Features (READ DOCS FIRST) -# end of Main Flash configuration - # # SPI Flash driver # # CONFIG_SPI_FLASH_VERIFY_WRITE is not set # CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y -# CONFIG_SPI_FLASH_ROM_IMPL is not set CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y # CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set # CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set @@ -1194,7 +1410,6 @@ CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP=y CONFIG_SPI_FLASH_SUPPORT_TH_CHIP=y -CONFIG_SPI_FLASH_SUPPORT_MXIC_OPI_CHIP=y # end of Auto-detect flash chips CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y @@ -1248,12 +1463,6 @@ CONFIG_WS_BUFFER_SIZE=1024 # end of Websocket # end of TCP Transport -# -# TinyUSB Stack -# -# CONFIG_TINYUSB is not set -# end of TinyUSB Stack - # # Unity unit testing library # @@ -1266,24 +1475,10 @@ CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y # CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set # end of Unity unit testing library -# -# USB-OTG -# -CONFIG_USB_OTG_SUPPORTED=y -CONFIG_USB_HOST_CONTROL_TRANSFER_MAX_SIZE=256 -CONFIG_USB_HOST_HW_BUFFER_BIAS_BALANCED=y -# CONFIG_USB_HOST_HW_BUFFER_BIAS_IN is not set -# CONFIG_USB_HOST_HW_BUFFER_BIAS_PERIODIC_OUT is not set - # # Root Hub configuration # -CONFIG_USB_HOST_DEBOUNCE_DELAY_MS=250 -CONFIG_USB_HOST_RESET_HOLD_MS=30 -CONFIG_USB_HOST_RESET_RECOVERY_MS=30 -CONFIG_USB_HOST_SET_ADDR_RECOVERY_MS=10 # end of Root Hub configuration -# end of USB-OTG # # Virtual file system @@ -1314,7 +1509,9 @@ CONFIG_WL_SECTOR_SIZE=4096 # CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 -# CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION is not set +CONFIG_WIFI_PROV_BLE_BONDING=y +CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION=y +# CONFIG_WIFI_PROV_KEEP_BLE_ON_AFTER_PROV is not set # end of Wi-Fi Provisioning Manager # @@ -1355,13 +1552,13 @@ CONFIG_LUA_ROOT="/lua" # Deprecated options for backward compatibility CONFIG_TOOLPREFIX="xtensa-esp32s3-elf-" -# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set +CONFIG_LOG_BOOTLOADER_LEVEL_NONE=y # CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set # CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set -CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y +# CONFIG_LOG_BOOTLOADER_LEVEL_INFO is not set # CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set # CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set -CONFIG_LOG_BOOTLOADER_LEVEL=3 +CONFIG_LOG_BOOTLOADER_LEVEL=0 # CONFIG_APP_ROLLBACK_ENABLE is not set # CONFIG_FLASH_ENCRYPTION_ENABLED is not set # CONFIG_FLASHMODE_QIO is not set @@ -1393,11 +1590,238 @@ CONFIG_STACK_CHECK_NONE=y # CONFIG_ESP32_APPTRACE_DEST_TRAX is not set CONFIG_ESP32_APPTRACE_DEST_NONE=y CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y +CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY=y +# CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY is not set +# CONFIG_BTDM_CONTROLLER_MODE_BTDM is not set +CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN=3 +CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN_EFF=3 +CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN_EFF=0 +CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_EFF=0 +CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE=0 +CONFIG_BTDM_CONTROLLER_HCI_MODE_VHCI=y +# CONFIG_BTDM_CONTROLLER_HCI_MODE_UART_H4 is not set +CONFIG_BTDM_CONTROLLER_MODEM_SLEEP=y +CONFIG_BLE_SCAN_DUPLICATE=y +CONFIG_SCAN_DUPLICATE_BY_DEVICE_ADDR=y +# CONFIG_SCAN_DUPLICATE_BY_ADV_DATA is not set +# CONFIG_SCAN_DUPLICATE_BY_ADV_DATA_AND_DEVICE_ADDR is not set +CONFIG_SCAN_DUPLICATE_TYPE=0 +CONFIG_DUPLICATE_SCAN_CACHE_SIZE=100 +# CONFIG_BLE_MESH_SCAN_DUPLICATE_EN is not set +CONFIG_BTDM_CONTROLLER_FULL_SCAN_SUPPORTED=y +CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_SUPPORTED=y +CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_NUM=100 +CONFIG_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 +CONFIG_BLUEDROID_ENABLED=y +# CONFIG_NIMBLE_ENABLED is not set +CONFIG_BTC_TASK_STACK_SIZE=3072 +CONFIG_BLUEDROID_PINNED_TO_CORE_0=y +# CONFIG_BLUEDROID_PINNED_TO_CORE_1 is not set +CONFIG_BLUEDROID_PINNED_TO_CORE=0 +CONFIG_BTU_TASK_STACK_SIZE=4096 +# CONFIG_BLUEDROID_MEM_DEBUG is not set +# CONFIG_CLASSIC_BT_ENABLED is not set +CONFIG_GATTS_ENABLE=y +# CONFIG_GATTS_SEND_SERVICE_CHANGE_MANUAL is not set +CONFIG_GATTS_SEND_SERVICE_CHANGE_AUTO=y +CONFIG_GATTS_SEND_SERVICE_CHANGE_MODE=0 +CONFIG_GATTC_ENABLE=y +# CONFIG_GATTC_CACHE_NVS_FLASH is not set +CONFIG_BLE_SMP_ENABLE=y +# CONFIG_SMP_SLAVE_CON_PARAMS_UPD_ENABLE is not set +# CONFIG_HCI_TRACE_LEVEL_NONE is not set +# CONFIG_HCI_TRACE_LEVEL_ERROR is not set +CONFIG_HCI_TRACE_LEVEL_WARNING=y +# CONFIG_HCI_TRACE_LEVEL_API is not set +# CONFIG_HCI_TRACE_LEVEL_EVENT is not set +# CONFIG_HCI_TRACE_LEVEL_DEBUG is not set +# CONFIG_HCI_TRACE_LEVEL_VERBOSE is not set +CONFIG_HCI_INITIAL_TRACE_LEVEL=2 +# CONFIG_BTM_TRACE_LEVEL_NONE is not set +# CONFIG_BTM_TRACE_LEVEL_ERROR is not set +CONFIG_BTM_TRACE_LEVEL_WARNING=y +# CONFIG_BTM_TRACE_LEVEL_API is not set +# CONFIG_BTM_TRACE_LEVEL_EVENT is not set +# CONFIG_BTM_TRACE_LEVEL_DEBUG is not set +# CONFIG_BTM_TRACE_LEVEL_VERBOSE is not set +CONFIG_BTM_INITIAL_TRACE_LEVEL=2 +# CONFIG_L2CAP_TRACE_LEVEL_NONE is not set +# CONFIG_L2CAP_TRACE_LEVEL_ERROR is not set +CONFIG_L2CAP_TRACE_LEVEL_WARNING=y +# CONFIG_L2CAP_TRACE_LEVEL_API is not set +# CONFIG_L2CAP_TRACE_LEVEL_EVENT is not set +# CONFIG_L2CAP_TRACE_LEVEL_DEBUG is not set +# CONFIG_L2CAP_TRACE_LEVEL_VERBOSE is not set +CONFIG_L2CAP_INITIAL_TRACE_LEVEL=2 +# CONFIG_RFCOMM_TRACE_LEVEL_NONE is not set +# CONFIG_RFCOMM_TRACE_LEVEL_ERROR is not set +CONFIG_RFCOMM_TRACE_LEVEL_WARNING=y +# CONFIG_RFCOMM_TRACE_LEVEL_API is not set +# CONFIG_RFCOMM_TRACE_LEVEL_EVENT is not set +# CONFIG_RFCOMM_TRACE_LEVEL_DEBUG is not set +# CONFIG_RFCOMM_TRACE_LEVEL_VERBOSE is not set +CONFIG_RFCOMM_INITIAL_TRACE_LEVEL=2 +# CONFIG_SDP_TRACE_LEVEL_NONE is not set +# CONFIG_SDP_TRACE_LEVEL_ERROR is not set +CONFIG_SDP_TRACE_LEVEL_WARNING=y +# CONFIG_SDP_TRACE_LEVEL_API is not set +# CONFIG_SDP_TRACE_LEVEL_EVENT is not set +# CONFIG_SDP_TRACE_LEVEL_DEBUG is not set +# CONFIG_SDP_TRACE_LEVEL_VERBOSE is not set +CONFIG_BTH_LOG_SDP_INITIAL_TRACE_LEVEL=2 +# CONFIG_GAP_TRACE_LEVEL_NONE is not set +# CONFIG_GAP_TRACE_LEVEL_ERROR is not set +CONFIG_GAP_TRACE_LEVEL_WARNING=y +# CONFIG_GAP_TRACE_LEVEL_API is not set +# CONFIG_GAP_TRACE_LEVEL_EVENT is not set +# CONFIG_GAP_TRACE_LEVEL_DEBUG is not set +# CONFIG_GAP_TRACE_LEVEL_VERBOSE is not set +CONFIG_GAP_INITIAL_TRACE_LEVEL=2 +CONFIG_BNEP_INITIAL_TRACE_LEVEL=2 +# CONFIG_PAN_TRACE_LEVEL_NONE is not set +# CONFIG_PAN_TRACE_LEVEL_ERROR is not set +CONFIG_PAN_TRACE_LEVEL_WARNING=y +# CONFIG_PAN_TRACE_LEVEL_API is not set +# CONFIG_PAN_TRACE_LEVEL_EVENT is not set +# CONFIG_PAN_TRACE_LEVEL_DEBUG is not set +# CONFIG_PAN_TRACE_LEVEL_VERBOSE is not set +CONFIG_PAN_INITIAL_TRACE_LEVEL=2 +# CONFIG_A2D_TRACE_LEVEL_NONE is not set +# CONFIG_A2D_TRACE_LEVEL_ERROR is not set +CONFIG_A2D_TRACE_LEVEL_WARNING=y +# CONFIG_A2D_TRACE_LEVEL_API is not set +# CONFIG_A2D_TRACE_LEVEL_EVENT is not set +# CONFIG_A2D_TRACE_LEVEL_DEBUG is not set +# CONFIG_A2D_TRACE_LEVEL_VERBOSE is not set +CONFIG_A2D_INITIAL_TRACE_LEVEL=2 +# CONFIG_AVDT_TRACE_LEVEL_NONE is not set +# CONFIG_AVDT_TRACE_LEVEL_ERROR is not set +CONFIG_AVDT_TRACE_LEVEL_WARNING=y +# CONFIG_AVDT_TRACE_LEVEL_API is not set +# CONFIG_AVDT_TRACE_LEVEL_EVENT is not set +# CONFIG_AVDT_TRACE_LEVEL_DEBUG is not set +# CONFIG_AVDT_TRACE_LEVEL_VERBOSE is not set +CONFIG_AVDT_INITIAL_TRACE_LEVEL=2 +# CONFIG_AVCT_TRACE_LEVEL_NONE is not set +# CONFIG_AVCT_TRACE_LEVEL_ERROR is not set +CONFIG_AVCT_TRACE_LEVEL_WARNING=y +# CONFIG_AVCT_TRACE_LEVEL_API is not set +# CONFIG_AVCT_TRACE_LEVEL_EVENT is not set +# CONFIG_AVCT_TRACE_LEVEL_DEBUG is not set +# CONFIG_AVCT_TRACE_LEVEL_VERBOSE is not set +CONFIG_AVCT_INITIAL_TRACE_LEVEL=2 +# CONFIG_AVRC_TRACE_LEVEL_NONE is not set +# CONFIG_AVRC_TRACE_LEVEL_ERROR is not set +CONFIG_AVRC_TRACE_LEVEL_WARNING=y +# CONFIG_AVRC_TRACE_LEVEL_API is not set +# CONFIG_AVRC_TRACE_LEVEL_EVENT is not set +# CONFIG_AVRC_TRACE_LEVEL_DEBUG is not set +# CONFIG_AVRC_TRACE_LEVEL_VERBOSE is not set +CONFIG_AVRC_INITIAL_TRACE_LEVEL=2 +# CONFIG_MCA_TRACE_LEVEL_NONE is not set +# CONFIG_MCA_TRACE_LEVEL_ERROR is not set +CONFIG_MCA_TRACE_LEVEL_WARNING=y +# CONFIG_MCA_TRACE_LEVEL_API is not set +# CONFIG_MCA_TRACE_LEVEL_EVENT is not set +# CONFIG_MCA_TRACE_LEVEL_DEBUG is not set +# CONFIG_MCA_TRACE_LEVEL_VERBOSE is not set +CONFIG_MCA_INITIAL_TRACE_LEVEL=2 +# CONFIG_HID_TRACE_LEVEL_NONE is not set +# CONFIG_HID_TRACE_LEVEL_ERROR is not set +CONFIG_HID_TRACE_LEVEL_WARNING=y +# CONFIG_HID_TRACE_LEVEL_API is not set +# CONFIG_HID_TRACE_LEVEL_EVENT is not set +# CONFIG_HID_TRACE_LEVEL_DEBUG is not set +# CONFIG_HID_TRACE_LEVEL_VERBOSE is not set +CONFIG_HID_INITIAL_TRACE_LEVEL=2 +# CONFIG_APPL_TRACE_LEVEL_NONE is not set +# CONFIG_APPL_TRACE_LEVEL_ERROR is not set +CONFIG_APPL_TRACE_LEVEL_WARNING=y +# CONFIG_APPL_TRACE_LEVEL_API is not set +# CONFIG_APPL_TRACE_LEVEL_EVENT is not set +# CONFIG_APPL_TRACE_LEVEL_DEBUG is not set +# CONFIG_APPL_TRACE_LEVEL_VERBOSE is not set +CONFIG_APPL_INITIAL_TRACE_LEVEL=2 +# CONFIG_GATT_TRACE_LEVEL_NONE is not set +# CONFIG_GATT_TRACE_LEVEL_ERROR is not set +CONFIG_GATT_TRACE_LEVEL_WARNING=y +# CONFIG_GATT_TRACE_LEVEL_API is not set +# CONFIG_GATT_TRACE_LEVEL_EVENT is not set +# CONFIG_GATT_TRACE_LEVEL_DEBUG is not set +# CONFIG_GATT_TRACE_LEVEL_VERBOSE is not set +CONFIG_GATT_INITIAL_TRACE_LEVEL=2 +# CONFIG_SMP_TRACE_LEVEL_NONE is not set +# CONFIG_SMP_TRACE_LEVEL_ERROR is not set +CONFIG_SMP_TRACE_LEVEL_WARNING=y +# CONFIG_SMP_TRACE_LEVEL_API is not set +# CONFIG_SMP_TRACE_LEVEL_EVENT is not set +# CONFIG_SMP_TRACE_LEVEL_DEBUG is not set +# CONFIG_SMP_TRACE_LEVEL_VERBOSE is not set +CONFIG_SMP_INITIAL_TRACE_LEVEL=2 +# CONFIG_BTIF_TRACE_LEVEL_NONE is not set +# CONFIG_BTIF_TRACE_LEVEL_ERROR is not set +CONFIG_BTIF_TRACE_LEVEL_WARNING=y +# CONFIG_BTIF_TRACE_LEVEL_API is not set +# CONFIG_BTIF_TRACE_LEVEL_EVENT is not set +# CONFIG_BTIF_TRACE_LEVEL_DEBUG is not set +# CONFIG_BTIF_TRACE_LEVEL_VERBOSE is not set +CONFIG_BTIF_INITIAL_TRACE_LEVEL=2 +# CONFIG_BTC_TRACE_LEVEL_NONE is not set +# CONFIG_BTC_TRACE_LEVEL_ERROR is not set +CONFIG_BTC_TRACE_LEVEL_WARNING=y +# CONFIG_BTC_TRACE_LEVEL_API is not set +# CONFIG_BTC_TRACE_LEVEL_EVENT is not set +# CONFIG_BTC_TRACE_LEVEL_DEBUG is not set +# CONFIG_BTC_TRACE_LEVEL_VERBOSE is not set +CONFIG_BTC_INITIAL_TRACE_LEVEL=2 +# CONFIG_OSI_TRACE_LEVEL_NONE is not set +# CONFIG_OSI_TRACE_LEVEL_ERROR is not set +CONFIG_OSI_TRACE_LEVEL_WARNING=y +# CONFIG_OSI_TRACE_LEVEL_API is not set +# CONFIG_OSI_TRACE_LEVEL_EVENT is not set +# CONFIG_OSI_TRACE_LEVEL_DEBUG is not set +# CONFIG_OSI_TRACE_LEVEL_VERBOSE is not set +CONFIG_OSI_INITIAL_TRACE_LEVEL=2 +# CONFIG_BLUFI_TRACE_LEVEL_NONE is not set +# CONFIG_BLUFI_TRACE_LEVEL_ERROR is not set +CONFIG_BLUFI_TRACE_LEVEL_WARNING=y +# CONFIG_BLUFI_TRACE_LEVEL_API is not set +# CONFIG_BLUFI_TRACE_LEVEL_EVENT is not set +# CONFIG_BLUFI_TRACE_LEVEL_DEBUG is not set +# CONFIG_BLUFI_TRACE_LEVEL_VERBOSE is not set +CONFIG_BLUFI_INITIAL_TRACE_LEVEL=2 +# CONFIG_BLE_HOST_QUEUE_CONGESTION_CHECK is not set +CONFIG_SMP_ENABLE=y +# CONFIG_BLE_ACTIVE_SCAN_REPORT_ADV_SCAN_RSP_INDIVIDUALLY is not set +CONFIG_BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT=30 CONFIG_ADC2_DISABLE_DAC=y +# CONFIG_SPIRAM_SUPPORT is not set +CONFIG_TRACEMEM_RESERVE_DRAM=0x0 +# CONFIG_ULP_COPROC_ENABLED is not set +CONFIG_ULP_COPROC_RESERVE_MEM=0 +CONFIG_BROWNOUT_DET=y +CONFIG_BROWNOUT_DET_LVL_SEL_0=y +# CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_7 is not set +CONFIG_BROWNOUT_DET_LVL=0 +CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y +# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256 is not set +# CONFIG_DISABLE_BASIC_ROM_CONSOLE is not set +# CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set # CONFIG_EVENT_LOOP_PROFILING is not set CONFIG_POST_EVENTS_FROM_ISR=y CONFIG_POST_EVENTS_FROM_IRAM_ISR=y -# CONFIG_ESP_SYSTEM_PD_FLASH is not set +# CONFIG_TWO_UNIVERSAL_MAC_ADDRESS is not set +CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y +CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4 +CONFIG_ESP_SYSTEM_PD_FLASH=y CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND=y CONFIG_IPC_TASK_STACK_SIZE=1536 CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y @@ -1405,14 +1829,12 @@ CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 CONFIG_ESP32_PHY_MAX_TX_POWER=20 # CONFIG_ESP32_REDUCE_PHY_TX_POWER is not set -CONFIG_ESP_SYSTEM_PM_POWER_DOWN_CPU=y # CONFIG_ESP32S2_PANIC_PRINT_HALT is not set CONFIG_ESP32S2_PANIC_PRINT_REBOOT=y # CONFIG_ESP32S2_PANIC_SILENT_REBOOT is not set # CONFIG_ESP32S2_PANIC_GDBSTUB is not set -CONFIG_ESP32S2_ALLOW_RTC_FAST_MEM_AS_HEAP=y CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 -CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=3072 CONFIG_MAIN_TASK_STACK_SIZE=3584 CONFIG_CONSOLE_UART_DEFAULT=y # CONFIG_CONSOLE_UART_CUSTOM is not set @@ -1430,6 +1852,7 @@ CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y # CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set CONFIG_TIMER_TASK_STACK_SIZE=3584 +CONFIG_SW_COEXIST_ENABLE=y # CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set # CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y @@ -1454,13 +1877,13 @@ CONFIG_TIMER_QUEUE_LENGTH=10 # CONFIG_USE_ONLY_LWIP_SELECT is not set CONFIG_ESP_GRATUITOUS_ARP=y CONFIG_GARP_TMR_INTERVAL=60 -CONFIG_TCPIP_RECVMBOX_SIZE=32 +CONFIG_TCPIP_RECVMBOX_SIZE=16 CONFIG_TCP_MAXRTX=12 CONFIG_TCP_SYNMAXRTX=12 CONFIG_TCP_MSS=1440 CONFIG_TCP_MSL=60000 -CONFIG_TCP_SND_BUF_DEFAULT=5760 -CONFIG_TCP_WND_DEFAULT=5760 +CONFIG_TCP_SND_BUF_DEFAULT=5744 +CONFIG_TCP_WND_DEFAULT=5744 CONFIG_TCP_RECVMBOX_SIZE=6 CONFIG_TCP_QUEUE_OOSEQ=y # CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set @@ -1485,7 +1908,6 @@ CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y # CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set # CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set -# CONFIG_USB_ENABLED is not set CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y CONFIG_SUPPORT_TERMIOS=y CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 From 5bb9ff8c70d79558217c58a3c58107792ce9c0cd Mon Sep 17 00:00:00 2001 From: lomasSE89 Date: Wed, 28 Feb 2024 13:32:18 +0545 Subject: [PATCH 27/27] changed version values. --- .../ezlopi-util-version/ezlopi_util_version.h | 28 ++++++++++--------- release-notes.md | 13 --------- 2 files changed, 15 insertions(+), 26 deletions(-) delete mode 100644 release-notes.md diff --git a/ezlopi-util/ezlopi-util-version/ezlopi_util_version.h b/ezlopi-util/ezlopi-util-version/ezlopi_util_version.h index a7b103823..8319c7f5b 100644 --- a/ezlopi-util/ezlopi-util-version/ezlopi_util_version.h +++ b/ezlopi-util/ezlopi-util-version/ezlopi_util_version.h @@ -1,25 +1,27 @@ -#ifndef _EZLOPI_UTIL_VERSION_H_ -#define _EZLOPI_UTIL_VERSION_H_ +#ifndef __VERSION_H__ +#define __VERSION_H__ + #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif -#define V_TYPE 2 -#define BUILD_DATE 1704990285 + +#define BUILD_DATE 1709103460 #define MAJOR 3 #define MINOR 2 -#define BATCH 4 -#define BUILD 181 -#define VERSION_STR "3.2.4" +#define BATCH 6 +#define BUILD 185 +#define VERSION_STR "3.2.6" #define DEVELOPER "lomas.subedi@ezlo.com" -#define COMPILE_TIME "Thu 11 Jan 2024 10:09:36 PM +0545" -#define CURRENT_BRANCH "dev_v3" -#define COMMIT_HASH "fd190843f60c1e5a93c738b3b0757e58870a01c2" +#define COMPILE_TIME "Wed 28 Feb 2024 12:42:40 PM +0545" +#define CURRENT_BRANCH "development" +#define COMMIT_HASH "52b6e535c25867579f2969358cc4232076d0e337" + #ifdef __cplusplus } #endif -#endif // _EZLOPI_UTIL_VERSION_H_ + +#endif // __VERSION_H__ diff --git a/release-notes.md b/release-notes.md deleted file mode 100644 index 3499ead8a..000000000 --- a/release-notes.md +++ /dev/null @@ -1,13 +0,0 @@ -## New Features : -* feature-1: Description - -## New features: Local meshbots -* Implementation of ROOM API: -* Implementation of device-name-set: [EZPI-211](https://jira.mios.com/browse/EZPI-211) -* Addition of framework for house-modes: [EZPI-280](https://jira.mios.com/browse/EZPI-280) - -## Fixes -* segregated populator-functions from scene to make clean code: -5. Debugging issue with 'hub.scene.edit' in team and fixed -6. Found issue with room-and-device logics and fixed -7. encountered several linking issues and fixed \ No newline at end of file