add IAP sample project, mini program manual

see:
doc/20.In_Application_Programming_based_EVB_MX_Plus.md
This commit is contained in:
daishengdong
2020-04-15 18:11:13 +08:00
parent 3500ccd27c
commit 5c21ce702f
49 changed files with 8111 additions and 91 deletions

View File

@@ -389,12 +389,11 @@ static int esp8266_init(void)
return 0;
}
__STATIC__ uint8_t incoming_data_buffer[512];
__STATIC__ void esp8266_incoming_data_process(void)
{
uint8_t data;
int channel_id = 0, data_len = 0;
int channel_id = 0, data_len = 0, read_len;
static uint8_t buffer[128];
/*
+IPD,0,44:1234...
@@ -426,15 +425,19 @@ __STATIC__ void esp8266_incoming_data_process(void)
data_len = data_len * 10 + (data - '0');
}
if (data_len > sizeof(incoming_data_buffer)) {
data_len = sizeof(incoming_data_buffer);
}
do {
#define MIN(a, b) ((a) < (b) ? (a) : (b))
read_len = MIN(data_len, sizeof(buffer));
if (tos_at_uart_read(buffer, read_len) != read_len) {
return;
}
if (tos_at_uart_read(incoming_data_buffer, data_len) != data_len) {
return;
}
if (tos_at_channel_write(channel_id, buffer, read_len) <= 0) {
return;
}
tos_at_channel_write(channel_id, incoming_data_buffer, data_len);
data_len -= read_len;
} while (data_len > 0);
}
at_event_t esp8266_at_event[] = {