remove old tencentcloud_sdk and abandoned EVB boards

This commit is contained in:
daishengdong
2020-05-07 16:22:17 +08:00
parent b74cf8d598
commit 08e5f7b3ec
441 changed files with 648 additions and 266237 deletions

View File

@@ -192,8 +192,8 @@ static int bc26_init(void)
if (bc26_reset() != 0) {
printf("bc26 reset FAILED\n");
return -1;
}
at_delay_ms(3000);
}
tos_stopwatch_delay_ms(3000);
if (bc26_psm_lock() != 0) {
printf("bc26 psm lock FAILED\n");
@@ -203,7 +203,7 @@ static int bc26_init(void)
if (bc26_open_cfun() != 0) {
printf("bc26 open cfun FAILED\n");
return -1;
}
}
if (bc26_echo_close() != 0) {
printf("echo close FAILED\n");
@@ -238,7 +238,7 @@ static int bc26_init(void)
if (bc26_signal_quality_check() != 0) {
printf("check csq FAILED\n");
return -1;
}
}
printf("Init BC26 done\n");
}
@@ -250,20 +250,20 @@ static int bc26_connect(const char *ip, const char *port, sal_proto_t proto)
char echo_buffer[32],*str;
tos_at_echo_create(&echo, echo_buffer, sizeof(echo_buffer), NULL);
tos_at_cmd_exec(&echo, 2000, "AT+QSOC=1,1,1\r\n");
if (echo.status != AT_ECHO_STATUS_OK) {
return -1;
}
str = strstr(echo.buffer, "+QSOC=");
sscanf(str, "+QSOC=%d", &id);
printf("get socket id is %d\r\n",id);
id = tos_at_channel_alloc_id(id, ip, port);
if (id == -1) {
return -1;
}
sscanf(port, "%d", &send_port);
while (try++ < 10) {
tos_at_cmd_exec(&echo, 1000, "AT+QSOCON=%d,%d,\"%s\"\r\n", id, send_port,ip);
@@ -361,7 +361,7 @@ static int bc26_parse_domain(const char *host_name, char *host_ip, size_t host_i
static int bc26_close(int id)
{
tos_at_cmd_exec(NULL, 1000, "AT+QSODIS=%d",id);
tos_at_cmd_exec(NULL, 1000, "AT+QSOCL=%d",id);
tos_at_channel_free(id);
@@ -443,9 +443,9 @@ __STATIC__ void bc26_incoming_data_process(void)
we cannot use tos_at_cmd_exec(NULL, timeout) to delay, because we are in at framework's parser
task now(current function is a callback called by parser task), delay in tos_at_cmd_exec is
tos_task_delay, this may cause a task switch, data receiving may be interrupted.
so we must tos_at_cmd_exec(NULL, 0), and do the delay by at_delay_ms.
so we must tos_at_cmd_exec(NULL, 0), and do the delay by tos_stopwatch_delay_ms.
*/
at_delay_ms(1000);
tos_stopwatch_delay_ms(1000);
/*
1,xxx.yyy.zzz.www,8000,3,010203,0\r\n
@@ -574,7 +574,7 @@ int bc26_sal_init(hal_uart_port_t uart_port)
return -1;
}
at_delay_ms(1000);
tos_stopwatch_delay_ms(1000);
if (tos_sal_module_register(&nb_iot_module_bc26) != 0) {
return -1;

View File

@@ -357,9 +357,9 @@ __STATIC__ void bc35_28_95_incoming_data_process(void)
we cannot use tos_at_cmd_exec(NULL, timeout) to delay, because we are in at framework's parser
task now(current function is a callback called by parser task), delay in tos_at_cmd_exec is
tos_task_delay, this may cause a task switch, data receiving may be interrupted.
so we must tos_at_cmd_exec(NULL, 0), and do the delay by at_delay_ms.
so we must tos_at_cmd_exec(NULL, 0), and do the delay by tos_stopwatch_delay_ms.
*/
at_delay_ms(1000);
tos_stopwatch_delay_ms(1000);
/*
1,xxx.yyy.zzz.www,8000,3,010203,0\r\n

View File

@@ -239,7 +239,7 @@ static int bc35_28_95_print_NBAND(void) {
static int bc35_28_95_lwm2m_init(void)
{
printf("Init BC35_28_95 ...wait reset!\n" );
at_delay_ms(5000);
tos_stopwatch_delay_ms(5000);
if (bc35_28_95_echo_close() != 0) {
printf("echo close FAILED\n");
return -1;

View File

@@ -65,7 +65,7 @@ static int m5310a_connect(const char *ip, const char *port, sal_proto_t proto)
at_echo_t echo;
char echo_buffer[32];
at_delay_ms(10000);
tos_stopwatch_delay_ms(10000);
tos_at_echo_create(&echo, echo_buffer, sizeof(echo_buffer), NULL);
tos_at_cmd_exec(&echo, 4000, "AT+NSOCR=%s,%d\r\n",
@@ -84,20 +84,20 @@ static int m5310a_connect(const char *ip, const char *port, sal_proto_t proto)
m5310a_wait_ok();
at_delay_ms(3000);
tos_stopwatch_delay_ms(3000);
while (is_connected == 0 && try < 10) {
tos_at_echo_create(&echo, echo_buffer, sizeof(echo_buffer), "CONNECT OK");
tos_at_cmd_exec(&echo, 1000, "AT+NSOCO=%d,%s,%s\r\n", id, ip, port);
for(int j=0; j<5; j++) {
if(echo.status == AT_ECHO_STATUS_OK || echo.status == AT_ECHO_STATUS_EXPECT) {
is_connected = 1;
break;
}
tos_task_delay(tos_millisec2tick(1000));
}
for(int j=0; j<5; j++) {
if(echo.status == AT_ECHO_STATUS_OK || echo.status == AT_ECHO_STATUS_EXPECT) {
is_connected = 1;
break;
}
tos_task_delay(tos_millisec2tick(1000));
}
try++;
try++;
}
if (!is_connected) {
@@ -127,25 +127,25 @@ static int m5310a_send(int id, const void *buf, size_t len)
int left_len = len;
for(int i=0; left_len>0; i++) {
int send_len = left_len > max_send_len ? max_send_len : left_len;
__hex2str((uint8_t *)buf+i*max_send_len, str_buf, send_len);
int send_len = left_len > max_send_len ? max_send_len : left_len;
__hex2str((uint8_t *)buf+i*max_send_len, str_buf, send_len);
char except[8];
snprintf(except, sizeof(except), "%d,%d", id, send_len);
tos_at_echo_create(&echo, NULL, 0, except);
tos_at_cmd_exec(&echo, 1000, "AT+NSOSD=%d,%d,%s\r\n", id, send_len, str_buf);
char except[8];
snprintf(except, sizeof(except), "%d,%d", id, send_len);
tos_at_echo_create(&echo, NULL, 0, except);
tos_at_cmd_exec(&echo, 1000, "AT+NSOSD=%d,%d,%s\r\n", id, send_len, str_buf);
for(int j=0; j<10; j++) {
if (echo.status != AT_ECHO_STATUS_OK && echo.status != AT_ECHO_STATUS_EXPECT) {
break;
}
for(int j = 0; j < 10; j++) {
if (echo.status != AT_ECHO_STATUS_OK && echo.status != AT_ECHO_STATUS_EXPECT) {
break;
}
if(echo.status != AT_ECHO_STATUS_EXPECT) {
at_delay_ms(1000);
}
}
if(echo.status != AT_ECHO_STATUS_EXPECT) {
tos_stopwatch_delay_ms(1000);
}
}
left_len -= send_len;
left_len -= send_len;
}
tos_mmheap_free(str_buf);

View File

@@ -162,7 +162,7 @@ int rhf76_set_repeat(uint8_t num)
char expect[10] = {'\0'};
snprintf(cmd, sizeof(cmd), RHF76_ATCMD_SET_REPT, num);
snprintf(expect, sizeof(expect), "+REPT: %d", num);
tos_at_echo_create(&echo, NULL, 0, expect);
while (try++ < 10) {
@@ -183,7 +183,7 @@ int rhf76_set_data_rate(uint8_t num)
char expect[10] = {'\0'};
snprintf(cmd, sizeof(cmd), RHF76_ATCMD_SET_DATA_RATE, num);
snprintf(expect, sizeof(expect), " DR%d", num);
tos_at_echo_fuzzy_matching_create(&echo, NULL, 0, expect);
while (try++ < 10) {
@@ -203,7 +203,7 @@ int rhf76_set_delay(char *param)
char expect[20] = {'\0'};
snprintf(cmd, sizeof(cmd), RHF76_ATCMD_SET_DELAY, param);
snprintf(expect, sizeof(expect), "+DELAY %s", param);
tos_at_echo_create(&echo, NULL, 0, expect);
while (try++ < 10) {
@@ -286,7 +286,7 @@ int rhf76_join_otaa(const char *deveui, const char *appkey)
return -1;
}
at_delay_ms(2000);
tos_stopwatch_delay_ms(2000);
tos_at_echo_create(&echo, NULL, 0, "+JOIN: Network joined");
while (try++ < 10) {
@@ -328,7 +328,7 @@ int rhf76_join_abp(const char *deveui, const char *devaddr, const char *nwkskey,
return -1;
}
at_delay_ms(2000);
tos_stopwatch_delay_ms(2000);
tos_at_echo_create(&echo, NULL, 0, "+JOIN: Network joined");
while (try++ < 10) {
@@ -344,7 +344,7 @@ static int rhf76_init(void)
{
printf("Init RHF76 LoRa ...\n" );
at_delay_ms(1000);
tos_stopwatch_delay_ms(1000);
if (rhf76_exit_low_power() != 0) {
printf("rhf76 reset FAILED\n");
return -1;
@@ -379,34 +379,34 @@ static int rhf76_init(void)
printf("rhf76 set repeat times for unconfirmed message FAILED\n");
return -1;
}
at_delay_ms(2000);
tos_stopwatch_delay_ms(2000);
printf("Init RHF76 LoRa done\n");
/*----------------------------------------------------*/
/*--- the following code is only used for debuging ---*/
/*----------------------------------------------------*/
/*<-- query/set UART Timeout (~TX timeout) -->*/
// rhf76_at_cmd_exe("AT+UART=TIMEOUT, 300\r\n");
// rhf76_at_cmd_exe("AT+UART=TIMEOUT\r\n");
/*<-- query current band config -->*/
// rhf76_at_cmd_exe("AT+DR=SCHEME\r\n");
// rhf76_at_cmd_exe("AT+LW=CDR\r\n");
/*<-- query current data rate and the corresponding max payload size -->*/
rhf76_set_data_rate(0);
// rhf76_at_cmd_exe("at+dr=0\r\n");
// rhf76_at_cmd_exe("AT+DR\r\n");
// rhf76_at_cmd_exe("AT+LW=LEN\r\n");
/*<-- query RX1\RX2\JRX1\JRX2 delay config -->*/
// rhf76_set_delay("?");
/*<-- query RF config -->*/
// rhf76_at_cmd_exe("AT+MODE=TEST\r\n");
// rhf76_at_cmd_exe("AT+TEST=?\r\n");
return 0;
}
@@ -571,7 +571,7 @@ int rhf76_lora_init(hal_uart_port_t uart_port)
return -1;
}
at_delay_ms(1000);
tos_stopwatch_delay_ms(1000);
if (tos_lora_module_register(&lora_module_rhf76) != 0) {
return -1;