add IAP sample project, mini program manual
see: doc/20.In_Application_Programming_based_EVB_MX_Plus.md
This commit is contained in:
@@ -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[] = {
|
||||
|
@@ -141,7 +141,7 @@ static int sim7600ce_net_open(void)
|
||||
static int sim7600ce_init(void)
|
||||
{
|
||||
printf("Init sim7600ce ...\n" );
|
||||
|
||||
|
||||
if (sim7600ce_echo_close() != 0) {
|
||||
printf("echo close failed\n");
|
||||
return -1;
|
||||
@@ -150,7 +150,7 @@ static int sim7600ce_init(void)
|
||||
printf("apn set FAILED\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
if (sim7600ce_signal_quality_check() != 0) {
|
||||
printf("signal quality check status failed\n");
|
||||
return -1;
|
||||
@@ -174,13 +174,13 @@ static int sim7600ce_init(void)
|
||||
if (sim7600ce_csocksetpn() != 0) {
|
||||
printf("sim7600ce_net_open FAILED\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (sim7600ce_send_mode_set(SAL_SEND_MODE_NORMAL) != 0) {
|
||||
printf("send mode set FAILED\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (sim7600ce_net_open() != 0) {
|
||||
printf("sim7600ce_net_open FAILED\n");
|
||||
return -1;
|
||||
@@ -310,13 +310,12 @@ static int sim7600ce_parse_domain(const char *host_name, char *host_ip, size_t h
|
||||
return 0;
|
||||
}
|
||||
|
||||
__STATIC__ uint8_t incoming_data_buffer[512];
|
||||
|
||||
__STATIC__ void sim7600ce_incoming_data_process(void)
|
||||
{
|
||||
uint8_t data;
|
||||
uint8_t str[2];
|
||||
int channel_id = 0, data_len = 0;
|
||||
int channel_id = 0, data_len = 0, read_len;
|
||||
static uint8_t buffer[128];
|
||||
|
||||
/*
|
||||
+RECEIVE,0,44:1234...
|
||||
@@ -347,15 +346,19 @@ __STATIC__ void sim7600ce_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 sim7600ce_at_event[] = {
|
||||
|
@@ -255,12 +255,11 @@ static int sim800a_parse_domain(const char *host_name, char *host_ip, size_t hos
|
||||
return 0;
|
||||
}
|
||||
|
||||
__STATIC__ uint8_t incoming_data_buffer[512];
|
||||
|
||||
__STATIC__ void sim800a_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...
|
||||
@@ -291,15 +290,19 @@ __STATIC__ void sim800a_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 sim800a_at_event[] = {
|
||||
|
Reference in New Issue
Block a user