Skip to content

Commit

Permalink
apps: Add use of rpmsg_virtio_get_tx/rx_buffer_size API
Browse files Browse the repository at this point in the history
Print the max size of the RX and TX buffer payloads.
This allows to test the new API in the CI.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
  • Loading branch information
arnopo committed Nov 20, 2023
1 parent d513645 commit 78043fa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions apps/examples/echo/rpmsg-echo.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ int app(struct rpmsg_device *rdev, void *priv)
}

LPRINTF("Successfully created rpmsg endpoint.\r\n");

LPRINTF("RPMsg device TX buffer size: %#x\r\n", rpmsg_virtio_get_tx_buffer_size(rdev));
LPRINTF("RPMsg device RX buffer size: %#x\r\n", rpmsg_virtio_get_rx_buffer_size(rdev));

while(1) {
platform_poll(priv);
/* we got a shutdown request, exit */
Expand Down
4 changes: 3 additions & 1 deletion apps/examples/echo/rpmsg-ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ static void rpmsg_name_service_bind_cb(struct rpmsg_device *rdev,
RPMSG_ADDR_ANY, dest,
rpmsg_endpoint_cb,
rpmsg_service_unbind);

}

/*-----------------------------------------------------------------------------*
Expand Down Expand Up @@ -131,6 +130,9 @@ int app (struct rpmsg_device *rdev, void *priv)
return ret;
}

LPRINTF("RPMsg driver TX buffer size: %#x\r\n", rpmsg_virtio_get_tx_buffer_size(rdev));
LPRINTF("RPMsg driver RX buffer size: %#x\r\n", rpmsg_virtio_get_rx_buffer_size(rdev));

while (!is_rpmsg_ept_ready(&lept))
platform_poll(priv);

Expand Down
4 changes: 3 additions & 1 deletion apps/tests/msg/rpmsg-ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,15 @@ int app (struct rpmsg_device *rdev, void *priv)
ret = rpmsg_create_ept(&lept, rdev, RPMSG_SERVICE_NAME,
RPMSG_ADDR_ANY, RPMSG_ADDR_ANY,
rpmsg_endpoint_cb, rpmsg_service_unbind);

if (ret) {
LPERROR("Failed to create RPMsg endpoint.\r\n");
metal_free_memory(i_payload);
return ret;
}

LPRINTF("RPMsg driver TX buffer size: %#x\r\n", rpmsg_virtio_get_tx_buffer_size(rdev));
LPRINTF("RPMsg driver RX buffer size: %#x\r\n", rpmsg_virtio_get_rx_buffer_size(rdev));

while (!is_rpmsg_ept_ready(&lept))
platform_poll(priv);

Expand Down

0 comments on commit 78043fa

Please sign in to comment.