* @ingroup netconn_udp * Send data over a UDP or RAW netconn (that is already connected). * * @param conn the UDP or RAW netconn over which to send data * @param buf a netbuf containing the data to send * @return ERR_OK if data was sent, any other err_t on error */
| 938 | * @return ERR_OK if data was sent, any other err_t on error |
| 939 | */ |
| 940 | err_t |
| 941 | netconn_send(struct netconn *conn, struct netbuf *buf) |
| 942 | { |
| 943 | API_MSG_VAR_DECLARE(msg); |
| 944 | err_t err; |
| 945 | |
| 946 | LWIP_ERROR("netconn_send: invalid conn", (conn != NULL), return ERR_ARG;); |
| 947 | |
| 948 | LWIP_DEBUGF(API_LIB_DEBUG, ("netconn_send: sending %"U16_F" bytes\n", buf->p->tot_len)); |
| 949 | |
| 950 | API_MSG_VAR_ALLOC(msg); |
| 951 | API_MSG_VAR_REF(msg).conn = conn; |
| 952 | API_MSG_VAR_REF(msg).msg.b = buf; |
| 953 | err = netconn_apimsg(lwip_netconn_do_send, &API_MSG_VAR_REF(msg)); |
| 954 | API_MSG_VAR_FREE(msg); |
| 955 | |
| 956 | return err; |
| 957 | } |
| 958 | |
| 959 | /** |
| 960 | * @ingroup netconn_tcp |