Skip to content

Commit

Permalink
multicast: Document coap_mcast_set_hops()
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdeep1 committed Aug 16, 2024
1 parent 79e6fcd commit 626d463
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
3 changes: 2 additions & 1 deletion include/coap3/coap_net.h
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,8 @@ COAP_API int coap_join_mcast_group_intf(coap_context_t *ctx, const char *groupna

/**
* Function interface for defining the hop count (ttl) for sending
* multicast traffic
* multicast traffic. The default is 1 so that the ttl expires after
* decrementing if the packet is trying to pass out of the local network.
*
* @param session The current session.
* @param hops The number of hops (ttl) to use before the multicast
Expand Down
15 changes: 14 additions & 1 deletion man/coap_endpoint_client.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ coap_new_client_session,
coap_new_client_session_psk2,
coap_new_client_session_pki,
coap_session_set_mtu,
coap_session_max_pdu_size
coap_session_max_pdu_size,
coap_mcast_set_hops
- Work with CoAP client endpoints

SYNOPSIS
Expand All @@ -38,6 +39,8 @@ _proto_, coap_dtls_pki_t *_setup_data_);*

*size_t coap_session_max_pdu_size(const coap_session_t *_session_);*

*int coap_mcast_set_hops(coap_session_t *_session_, size_t _hops_);*

For specific (D)TLS library support, link with
*-lcoap-@LIBCOAP_API_VERSION@-notls*, *-lcoap-@LIBCOAP_API_VERSION@-gnutls*,
*-lcoap-@LIBCOAP_API_VERSION@-openssl*, *-lcoap-@LIBCOAP_API_VERSION@-mbedtls*,
Expand Down Expand Up @@ -203,6 +206,14 @@ MTU is 1152.
The *coap_session_max_pdu_size*() function is used to get the maximum MTU
size of the data for the client endpoint's _session_.

*Function: coap_mcast_set_hops()*

The *coap_mcast_set_hops*() function is used to set the maximum number
of _hops_ (ttl) that a transmitted multicast packet can pass through before
getting dropped (default is 1, so that the ttl expires after decrementing
if the packet is trying to pass out of the local network) for the specified
_session_.

RETURN VALUES
-------------
*coap_new_client_session*(), *coap_new_client_session_psk2*(),
Expand All @@ -211,6 +222,8 @@ session or NULL if there is a creation failure.

*coap_session_max_pdu_size*() returns the MTU size.

*coap_mcast_set_hops*() returns 1 on success, else 0 on failure.

EXAMPLES
--------
*CoAP Client Non-Encrypted Setup*
Expand Down

0 comments on commit 626d463

Please sign in to comment.