MCPcopy Create free account
hub / github.com/apache/nuttx / rpmsgmtd_default_handler

Function rpmsgmtd_default_handler

drivers/mtd/rpmsgmtd.c:786–802  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

784 ****************************************************************************/
785
786static int rpmsgmtd_default_handler(FAR struct rpmsg_endpoint *ept,
787 FAR void *data, size_t len,
788 uint32_t src, FAR void *priv)
789{
790 FAR struct rpmsgmtd_header_s *header = data;
791 FAR struct rpmsgmtd_cookie_s *cookie =
792 (FAR struct rpmsgmtd_cookie_s *)(uintptr_t)header->cookie;
793
794 cookie->result = header->result;
795 if (cookie->result >= 0 && cookie->data)
796 {
797 memcpy(cookie->data, data, len);
798 }
799
800 rpmsg_post(ept, &cookie->sem);
801 return 0;
802}
803
804/****************************************************************************
805 * Name: rpmsgmtd_bread_handler

Callers

nothing calls this directly

Calls 2

rpmsg_postFunction · 0.85
memcpyFunction · 0.50

Tested by

no test coverage detected