fix send bug in air724 driver
This commit is contained in:
@@ -336,6 +336,7 @@ static int air724_recv(int id, void *buf, size_t len)
|
||||
int air724_send(int id, const void *buf, size_t len)
|
||||
{
|
||||
at_echo_t echo;
|
||||
char expect[10] = "";
|
||||
|
||||
if (tos_at_global_lock_pend() != 0)
|
||||
{
|
||||
@@ -360,8 +361,9 @@ int air724_send(int id, const void *buf, size_t len)
|
||||
return -1;
|
||||
}
|
||||
|
||||
tos_at_echo_create(&echo, NULL, 0, "SEND OK");
|
||||
tos_at_raw_data_send(&echo, 1000, (uint8_t *)buf, len);
|
||||
sprintf(expect, "%d, SEND OK", id);
|
||||
tos_at_echo_create(&echo, NULL, 0, expect);
|
||||
tos_at_raw_data_send_until(&echo, 10000, (uint8_t *)buf, len);
|
||||
if (echo.status != AT_ECHO_STATUS_OK && echo.status != AT_ECHO_STATUS_EXPECT)
|
||||
{
|
||||
tos_at_global_lock_post();
|
||||
@@ -538,7 +540,7 @@ __STATIC__ void air724_incoming_data_process(void)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
@@ -591,4 +593,3 @@ int air724_sal_init(hal_uart_port_t uart_port)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user