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)
|
int air724_send(int id, const void *buf, size_t len)
|
||||||
{
|
{
|
||||||
at_echo_t echo;
|
at_echo_t echo;
|
||||||
|
char expect[10] = "";
|
||||||
|
|
||||||
if (tos_at_global_lock_pend() != 0)
|
if (tos_at_global_lock_pend() != 0)
|
||||||
{
|
{
|
||||||
@@ -360,8 +361,9 @@ int air724_send(int id, const void *buf, size_t len)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
tos_at_echo_create(&echo, NULL, 0, "SEND OK");
|
sprintf(expect, "%d, SEND OK", id);
|
||||||
tos_at_raw_data_send(&echo, 1000, (uint8_t *)buf, len);
|
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)
|
if (echo.status != AT_ECHO_STATUS_OK && echo.status != AT_ECHO_STATUS_EXPECT)
|
||||||
{
|
{
|
||||||
tos_at_global_lock_post();
|
tos_at_global_lock_post();
|
||||||
@@ -591,4 +593,3 @@ int air724_sal_init(hal_uart_port_t uart_port)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user