rpmsg ping: fix rpmsg_ping_ept_cb rpmsg send length
The rpmsg ping response length should not include the data length. Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
This commit is contained in:
parent
401a06fb17
commit
e359c661d8
|
@ -42,7 +42,8 @@
|
|||
#define RPMSG_PING_SEND 1
|
||||
#define RPMSG_PING_SEND_CHECK 2
|
||||
#define RPMSG_PING_SEND_NOACK 3
|
||||
#define RPMSG_PING_ACK 4
|
||||
#define RPMSG_PING_SEND_ACK 4
|
||||
#define RPMSG_PING_ACK 5
|
||||
#define RPMSG_PING_CHECK_DATA 0xee
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -93,6 +94,11 @@ static int rpmsg_ping_ept_cb(FAR struct rpmsg_endpoint *ept,
|
|||
msg->cmd = RPMSG_PING_ACK;
|
||||
rpmsg_send(ept, msg, len);
|
||||
}
|
||||
else if (msg->cmd == RPMSG_PING_SEND_ACK)
|
||||
{
|
||||
msg->cmd = RPMSG_PING_ACK;
|
||||
rpmsg_send(ept, msg, sizeof(*msg));
|
||||
}
|
||||
else if (msg->cmd == RPMSG_PING_ACK)
|
||||
{
|
||||
nxsem_post(sem);
|
||||
|
@ -122,7 +128,19 @@ static int rpmsg_ping_once(FAR struct rpmsg_endpoint *ept,
|
|||
{
|
||||
sem_t sem;
|
||||
|
||||
msg->cmd = (ack == 1)? RPMSG_PING_SEND : RPMSG_PING_SEND_CHECK;
|
||||
if (ack == 1)
|
||||
{
|
||||
msg->cmd = RPMSG_PING_SEND;
|
||||
}
|
||||
else if (ack == 2)
|
||||
{
|
||||
msg->cmd = RPMSG_PING_SEND_CHECK;
|
||||
}
|
||||
else
|
||||
{
|
||||
msg->cmd = RPMSG_PING_SEND_ACK;
|
||||
}
|
||||
|
||||
msg->len = len;
|
||||
msg->cookie = (uintptr_t)&sem;
|
||||
|
||||
|
|
Loading…
Reference in New Issue