mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-12 21:18:13 +08:00
能编译
This commit is contained in:
@@ -210,7 +210,7 @@
|
||||
</select>
|
||||
<button class="submit_bt" onclick="AddTimedTask()">Add</button>
|
||||
<span class="status_sp success">OK</span>
|
||||
<button class="submit_bt" onclick="DelTimedTask()">TestDelete</button>
|
||||
<!-- <button class="submit_bt" onclick="DelTimedTask()">TestDelete</button> -->
|
||||
<table id="timed_task_tb">
|
||||
<tr>
|
||||
<th>Index</th>
|
||||
@@ -466,8 +466,19 @@ function SubmitNetwork() {
|
||||
alert("mode error: " + mode);
|
||||
return;
|
||||
}
|
||||
SetIng(1);
|
||||
HttpPost("/wifi/config", function (re) {
|
||||
alert(re);
|
||||
SetOK(1);
|
||||
}, params);
|
||||
}
|
||||
|
||||
function SubmitMqtt() {
|
||||
SetIng(2);
|
||||
var params = mqtt_addr_ipt.value + mqtt_port_ipt;
|
||||
HttpPost("/wifi/config", function (re) {
|
||||
alert(re);
|
||||
SetOK(2);
|
||||
}, params);
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -4,7 +4,7 @@
|
||||
#include "mico.h"
|
||||
#include "micokit_ext.h"
|
||||
|
||||
#define VERSION "v0.11.4"
|
||||
#define VERSION "v1.0.0"
|
||||
|
||||
#define TYPE 1
|
||||
#define TYPE_NAME "zTC1"
|
||||
|
||||
@@ -31,14 +31,8 @@
|
||||
#include "user_mqtt_client.h"
|
||||
#include "c_json/c_json.h"
|
||||
|
||||
//#define MQTT_CLIENT_SSL_ENABLE // ssl
|
||||
|
||||
#define MAX_MQTT_TOPIC_SIZE (256)
|
||||
#define MAX_MQTT_DATA_SIZE (1024)
|
||||
#define MAX_MQTT_SEND_QUEUE_SIZE (10)
|
||||
|
||||
char MQTT_SERVER[64] = "192.168.33.219";
|
||||
int MQTT_SERVER_PORT = 1883;
|
||||
//char MQTT_SERVER[64] = "192.168.33.219";
|
||||
//int MQTT_SERVER_PORT = 1883;
|
||||
|
||||
#ifdef MQTT_CLIENT_SSL_ENABLE
|
||||
char* mqtt_server_ssl_cert_str =
|
||||
@@ -78,10 +72,6 @@ static OSStatus mqtt_msg_publish(Client *c, const char* topic, char qos, char re
|
||||
|
||||
OSStatus user_recv_handler(void *arg);
|
||||
|
||||
OSStatus user_mqtt_send_socket_state(char socket_id);
|
||||
void user_mqtt_hass_auto(char socket_id);
|
||||
void user_mqtt_hass_auto_power(void);
|
||||
|
||||
bool isconnect = false;
|
||||
mico_queue_t mqtt_msg_send_queue = NULL;
|
||||
|
||||
@@ -379,7 +369,7 @@ void mqtt_client_thread(mico_thread_arg_t arg)
|
||||
|
||||
require_noerr_string(err, MQTT_reconnect, "ERROR: MQTT publish data err");
|
||||
|
||||
mqtt_log("MQTT publish data success! send_topic=[%s], msg=[%ld].\r\n", p_send_msg->topic, p_send_msg->datalen);
|
||||
mqtt_log("MQTT publish data success! send_topic=[%s], msg=[%ld].", p_send_msg->topic, p_send_msg->datalen);
|
||||
no_mqtt_msg_exchange = false;
|
||||
free(p_send_msg);
|
||||
p_send_msg = NULL;
|
||||
|
||||
@@ -10,8 +10,13 @@
|
||||
#define MQTT_CMD_TIMEOUT 5000 // 5s
|
||||
#define MQTT_YIELD_TMIE 5000 // 5s
|
||||
|
||||
extern char MQTT_SERVER[64];
|
||||
extern int MQTT_SERVER_PORT;
|
||||
//#define MQTT_CLIENT_SSL_ENABLE // ssl
|
||||
#define MAX_MQTT_TOPIC_SIZE (256)
|
||||
#define MAX_MQTT_DATA_SIZE (1024)
|
||||
#define MAX_MQTT_SEND_QUEUE_SIZE (10)
|
||||
|
||||
#define MQTT_SERVER user_config->mqtt_ip
|
||||
#define MQTT_SERVER_PORT user_config->mqtt_port
|
||||
|
||||
extern OSStatus user_mqtt_init(void);
|
||||
extern OSStatus user_mqtt_send(char *arg);
|
||||
|
||||
Reference in New Issue
Block a user