Fit to ESP-IDF V5
This commit is contained in:
+6
-6
@@ -164,8 +164,8 @@ static esp_err_t twai_send_handler(httpd_req_t *req)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Search data item
|
// Search data item
|
||||||
int16_t data_len;
|
int16_t data_len;
|
||||||
char data_value[8];
|
char data_value[8];
|
||||||
state = cJSON_GetObjectItem(root, "data");
|
state = cJSON_GetObjectItem(root, "data");
|
||||||
if (state) {
|
if (state) {
|
||||||
cJSON *data_array = cJSON_GetObjectItem(root,"data");
|
cJSON *data_array = cJSON_GetObjectItem(root,"data");
|
||||||
@@ -267,19 +267,19 @@ esp_err_t start_server(const char *base_path, int port)
|
|||||||
|
|
||||||
/* URI handler for getting system info */
|
/* URI handler for getting system info */
|
||||||
httpd_uri_t system_info_get_uri = {
|
httpd_uri_t system_info_get_uri = {
|
||||||
.uri = "/api/system/info",
|
.uri = "/api/system/info",
|
||||||
.method = HTTP_GET,
|
.method = HTTP_GET,
|
||||||
.handler = system_info_get_handler,
|
.handler = system_info_get_handler,
|
||||||
.user_ctx = rest_context
|
.user_ctx = rest_context
|
||||||
};
|
};
|
||||||
httpd_register_uri_handler(server, &system_info_get_uri);
|
httpd_register_uri_handler(server, &system_info_get_uri);
|
||||||
|
|
||||||
/* URI handler for send twai */
|
/* URI handler for send twai */
|
||||||
httpd_uri_t twai_send_post_uri = {
|
httpd_uri_t twai_send_post_uri = {
|
||||||
.uri = "/api/twai/send",
|
.uri = "/api/twai/send",
|
||||||
.method = HTTP_POST,
|
.method = HTTP_POST,
|
||||||
.handler = twai_send_handler,
|
.handler = twai_send_handler,
|
||||||
.user_ctx = rest_context
|
.user_ctx = rest_context
|
||||||
};
|
};
|
||||||
httpd_register_uri_handler(server, &twai_send_post_uri);
|
httpd_register_uri_handler(server, &twai_send_post_uri);
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
## IDF Component Manager Manifest File
|
||||||
|
dependencies:
|
||||||
|
espressif/mdns:
|
||||||
|
version: "^1.0.3"
|
||||||
|
rules:
|
||||||
|
- if: "idf_version >=5.0"
|
||||||
+1
-1
@@ -65,7 +65,7 @@ static EventGroupHandle_t s_wifi_event_group;
|
|||||||
* - we are connected to the AP with an IP
|
* - we are connected to the AP with an IP
|
||||||
* - we failed to connect after the maximum amount of retries */
|
* - we failed to connect after the maximum amount of retries */
|
||||||
#define WIFI_CONNECTED_BIT BIT0
|
#define WIFI_CONNECTED_BIT BIT0
|
||||||
#define WIFI_FAIL_BIT BIT1
|
#define WIFI_FAIL_BIT BIT1
|
||||||
|
|
||||||
static int s_retry_num = 0;
|
static int s_retry_num = 0;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@
|
|||||||
#define DATA_FRAME 0
|
#define DATA_FRAME 0
|
||||||
#define REMOTE_FRAME 1
|
#define REMOTE_FRAME 1
|
||||||
|
|
||||||
#define CMD_RECEIVE 100
|
#define CMD_RECEIVE 100
|
||||||
#define CMD_SEND 200
|
#define CMD_SEND 200
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user