kopia lustrzana https://github.com/martin-ger/esp_mqtt
fixed issue #36
rodzic
b39cbe8b14
commit
6964c0eb50
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
|
@ -1,2 +1,2 @@
|
|||
c36c175bf752ea6e3ad3fec38b296a0b7b6bb146 0x00000.bin
|
||||
32c3b4519d79fc041d2821db41ef99d802bcf45f 0x10000.bin
|
||||
4f6912f3f84f9ab6dfc10f3dcbf1f3aa0c567910 0x00000.bin
|
||||
f0a7a860f4d2881dfc6e8e0d9e7bad136e620b35 0x10000.bin
|
||||
|
|
|
@ -953,14 +953,14 @@ int ICACHE_FLASH_ATTR parse_action(int next_token, bool doit) {
|
|||
lang_debug("setvar $%s\r\n", var_id);
|
||||
|
||||
if (flash_var) {
|
||||
if (var_len > FLASH_SLOT_LEN)
|
||||
var_len = FLASH_SLOT_LEN;
|
||||
if (var_len > FLASH_SLOT_LEN-1)
|
||||
var_len = FLASH_SLOT_LEN-1;
|
||||
|
||||
slot_no--;
|
||||
uint8_t slots[MAX_FLASH_SLOTS*FLASH_SLOT_LEN];
|
||||
blob_load(1, (uint32_t *)slots, sizeof(slots));
|
||||
os_memcpy(&slots[slot_no*FLASH_SLOT_LEN], var_data, var_len);
|
||||
slots[slot_no*FLASH_SLOT_LEN+FLASH_SLOT_LEN-1] = '\0';
|
||||
slots[slot_no*FLASH_SLOT_LEN+var_len] = '\0';
|
||||
blob_save(1, (uint32_t *)slots, sizeof(slots));
|
||||
} else {
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef _USER_CONFIG_
|
||||
#define _USER_CONFIG_
|
||||
|
||||
#define ESP_UBROKER_VERSION "V2.0.1"
|
||||
#define ESP_UBROKER_VERSION "V2.0.2"
|
||||
|
||||
#define WIFI_SSID "ssid"
|
||||
#define WIFI_PASSWORD "password"
|
||||
|
@ -120,7 +120,7 @@
|
|||
|
||||
#define MAX_RETAINED_LEN 0x1000
|
||||
|
||||
typedef enum {SIG_DO_NOTHING=0, SIG_START_SERVER=1, SIG_UART0, SIG_TOPIC_RECEIVED, SIG_SCRIPT_LOADED, SIG_SCRIPT_HTTP_LOADED, SIG_CONSOLE_TX_RAW, SIG_CONSOLE_TX, SIG_SERIAL_TX, SIG_CONSOLE_RX} USER_SIGNALS;
|
||||
typedef enum {SIG_DO_NOTHING=0, SIG_START_SERVER=1, SIG_UART0, SIG_TOPIC_RECEIVED, SIG_SCRIPT_LOADED, SIG_SCRIPT_HTTP_LOADED, SIG_CONSOLE_TX_RAW, SIG_CONSOLE_TX, SIG_CONSOLE_RX} USER_SIGNALS;
|
||||
|
||||
#define LOCAL_ACCESS 0x01
|
||||
#define REMOTE_ACCESS 0x02
|
||||
|
|
|
@ -266,7 +266,7 @@ void ICACHE_FLASH_ATTR console_send_response(struct espconn *pespconn, bool seri
|
|||
ringbuf_memcpy_from(payload, console_tx_buffer, len);
|
||||
if (pespconn != NULL) {
|
||||
if (!client_sent_pending) {
|
||||
espconn_sent(pespconn, payload, len);
|
||||
espconn_send(pespconn, payload, len);
|
||||
client_sent_pending = true;
|
||||
}
|
||||
} else {
|
||||
|
@ -292,8 +292,6 @@ void ICACHE_FLASH_ATTR con_print(uint8_t *str) {
|
|||
|
||||
void ICACHE_FLASH_ATTR serial_out(uint8_t *str) {
|
||||
UART_Send(0, str, os_strlen(str));
|
||||
//ringbuf_memcpy_into(console_tx_buffer, str, os_strlen(str));
|
||||
//system_os_post(user_procTaskPrio, SIG_SERIAL_TX, (ETSParam) NULL);
|
||||
}
|
||||
|
||||
bool ICACHE_FLASH_ATTR delete_retainedtopics() {
|
||||
|
@ -403,7 +401,7 @@ static void ICACHE_FLASH_ATTR tcp_client_connected_cb(void *arg) {
|
|||
ringbuf_reset(console_tx_buffer);
|
||||
|
||||
os_sprintf(payload, "CMD>");
|
||||
espconn_sent(pespconn, payload, os_strlen(payload));
|
||||
espconn_send(pespconn, payload, os_strlen(payload));
|
||||
client_sent_pending = true;
|
||||
console_conn = pespconn;
|
||||
}
|
||||
|
@ -514,12 +512,6 @@ static void ICACHE_FLASH_ATTR user_procTask(os_event_t * events) {
|
|||
}
|
||||
break;
|
||||
|
||||
case SIG_SERIAL_TX:
|
||||
{
|
||||
console_send_response(NULL, true);
|
||||
}
|
||||
break;
|
||||
|
||||
case SIG_CONSOLE_RX:
|
||||
{
|
||||
struct espconn *pespconn = (struct espconn *)events->par;
|
||||
|
|
Ładowanie…
Reference in New Issue