| 868 | ****************************************************************************/ |
| 869 | |
| 870 | static int rpmsgmtd_read_handler(FAR struct rpmsg_endpoint *ept, |
| 871 | FAR void *data, size_t len, |
| 872 | uint32_t src, FAR void *priv) |
| 873 | { |
| 874 | FAR struct rpmsgmtd_header_s *header = data; |
| 875 | FAR struct rpmsgmtd_cookie_s *cookie = |
| 876 | (FAR struct rpmsgmtd_cookie_s *)(uintptr_t)header->cookie; |
| 877 | FAR struct rpmsgmtd_read_s *rsp = data; |
| 878 | FAR struct iovec *iov = cookie->data; |
| 879 | |
| 880 | cookie->result = header->result; |
| 881 | if (cookie->result > 0) |
| 882 | { |
| 883 | memcpy(iov->iov_base + iov->iov_len, rsp->buf, cookie->result); |
| 884 | iov->iov_len += cookie->result; |
| 885 | } |
| 886 | |
| 887 | if (cookie->result <= 0 || iov->iov_len >= rsp->nbytes) |
| 888 | { |
| 889 | rpmsg_post(ept, &cookie->sem); |
| 890 | } |
| 891 | |
| 892 | return 0; |
| 893 | } |
| 894 | |
| 895 | /**************************************************************************** |
| 896 | * Name: rpmsgmtd_geometry_handler |
nothing calls this directly
no test coverage detected