330330 * coap_opt_add_proxy_uri(&pdu, uri);
331331 * unsigned len = coap_opt_finish(&pdu, COAP_OPT_FINISH_NONE);
332332 *
333- * gcoap_req_send((uint8_t *) pdu->hdr, len, proxy_remote, _resp_handler, NULL);
333+ * gcoap_req_send((uint8_t *) pdu->hdr, len, proxy_remote, _resp_handler, NULL,
334+ * GCOAP_SOCKET_TYPE_UNDEF);
334335 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
335336 *
336337 * See the gcoap example for a sample implementation.
@@ -960,9 +961,6 @@ static inline ssize_t gcoap_request(coap_pkt_t *pdu, uint8_t *buf, size_t len,
960961/**
961962 * @brief Sends a buffer containing a CoAP request to the provided endpoint
962963 *
963- * @deprecated Will be an alias for @ref gcoap_req_send after the 2022.01
964- * release. Will be removed after the 2022.04 release.
965- *
966964 * @param[in] buf Buffer containing the PDU
967965 * @param[in] len Length of the buffer
968966 * @param[in] remote Destination for the packet
@@ -973,39 +971,45 @@ static inline ssize_t gcoap_request(coap_pkt_t *pdu, uint8_t *buf, size_t len,
973971 * available (by value) will be selected. Only single
974972 * types are allowed, not a combination of them.
975973 *
974+ * @note The highest supported (by value) gcoap_socket_type_t will be selected
975+ * as transport type.
976+ *
976977 * @return length of the packet
977978 * @return -ENOTCONN, if DTLS was used and session establishment failed
978979 * @return -EINVAL, if @p tl_type is is not supported
979980 * @return 0 if cannot send
980981 */
981- ssize_t gcoap_req_send_tl (const uint8_t * buf , size_t len ,
982- const sock_udp_ep_t * remote ,
983- gcoap_resp_handler_t resp_handler , void * context ,
984- gcoap_socket_type_t tl_type );
982+ ssize_t gcoap_req_send (const uint8_t * buf , size_t len ,
983+ const sock_udp_ep_t * remote ,
984+ gcoap_resp_handler_t resp_handler , void * context ,
985+ gcoap_socket_type_t tl_type );
985986
986987/**
987988 * @brief Sends a buffer containing a CoAP request to the provided endpoint
988989 *
990+ * @deprecated Will be removed after the 2023.10 release. Use alias @ref gcoap_req_send() instead.
991+ *
989992 * @param[in] buf Buffer containing the PDU
990993 * @param[in] len Length of the buffer
991994 * @param[in] remote Destination for the packet
992995 * @param[in] resp_handler Callback when response received, may be NULL
993996 * @param[in] context User defined context passed to the response handler
994- *
995- * @note The highest supported (by value) gcoap_socket_type_t will be selected
996- * as transport type.
997+ * @param[in] tl_type The transport type to use for send. When
998+ * @ref GCOAP_SOCKET_TYPE_UNDEF is selected, the highest
999+ * available (by value) will be selected. Only single
1000+ * types are allowed, not a combination of them.
9971001 *
9981002 * @return length of the packet
9991003 * @return -ENOTCONN, if DTLS was used and session establishment failed
1004+ * @return -EINVAL, if @p tl_type is is not supported
10001005 * @return 0 if cannot send
10011006 */
1002- static inline ssize_t gcoap_req_send (const uint8_t * buf , size_t len ,
1003- const sock_udp_ep_t * remote ,
1004- gcoap_resp_handler_t resp_handler ,
1005- void * context )
1007+ static inline ssize_t gcoap_req_send_tl (const uint8_t * buf , size_t len ,
1008+ const sock_udp_ep_t * remote ,
1009+ gcoap_resp_handler_t resp_handler , void * context ,
1010+ gcoap_socket_type_t tl_type )
10061011{
1007- return gcoap_req_send_tl (buf , len , remote , resp_handler , context ,
1008- GCOAP_SOCKET_TYPE_UNDEF );
1012+ return gcoap_req_send (buf , len , remote , resp_handler , context , tl_type );
10091013}
10101014
10111015/**
0 commit comments