Skip to content

Commit 77864f5

Browse files
docs
1 parent 9e258d3 commit 77864f5

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

libudpard/udpard.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ typedef struct udpard_fragment_t
199199
/// resource for the fragments is given explicitly, and the payload is freed using the payload_deleter per fragment.
200200
/// All fragments in the tree will be freed and invalidated.
201201
/// The passed fragment can be any fragment inside the tree (not necessarily the root).
202-
/// If any of the arguments are NULL, the function has no effect. The complexity is linear in the number of fragments.
202+
/// If the fragment argument is NULL, the function has no effect. The complexity is linear in the number of fragments.
203203
void udpard_fragment_free_all(udpard_fragment_t* const frag, const udpard_mem_resource_t fragment_mem_resource);
204204

205205
/// Given any fragment in a transfer, returns the fragment that contains the given payload offset.
@@ -218,7 +218,7 @@ udpard_fragment_t* udpard_fragment_next(udpard_fragment_t* const frag);
218218
/// Given any fragment in a transfer, copies the entire transfer payload into the specified contiguous buffer.
219219
/// If the total size of all fragments combined exceeds the size of the destination buffer,
220220
/// copying will stop early after the buffer is filled, thus truncating the fragmented data short.
221-
/// The function has no effect and returns zero if the destination buffer is NULL.
221+
/// The function has no effect and returns zero if the destination buffer or fragment pointer is NULL.
222222
/// Returns the number of bytes copied into the contiguous destination buffer.
223223
size_t udpard_fragment_gather(const udpard_fragment_t* any_frag,
224224
const size_t destination_size_bytes,
@@ -261,11 +261,11 @@ size_t udpard_fragment_gather(const udpard_fragment_t* any_frag,
261261
/// If the application knows its MTU, it can use block allocation to avoid extrinsic fragmentation.
262262
typedef struct udpard_tx_mem_resources_t
263263
{
264-
/// The fragment handles are allocated per payload fragment; each handle contains a pointer to its fragment.
265-
/// Each instance is of a very small fixed size, so a trivial zero-fragmentation block allocator is enough.
264+
/// The queue bookkeeping structures (udpard_tx_item_t) are allocated per datagram.
265+
/// Each instance is a very small fixed-size object, so a trivial zero-fragmentation block allocator is enough.
266266
udpard_mem_resource_t fragment;
267267

268-
/// The payload fragments are allocated per payload frame; each payload fragment is at most MTU-sized buffer,
268+
/// The UDP datagram payload buffers are allocated per frame; each buffer is at most MTU-sized,
269269
/// so a trivial zero-fragmentation MTU-sized block allocator is enough if MTU is known in advance.
270270
udpard_mem_resource_t payload;
271271
} udpard_tx_mem_resources_t;
@@ -386,7 +386,7 @@ bool udpard_tx_new(udpard_tx_t* const self,
386386
/// is used to pass the destination node's UID instead. Setting it incorrectly will cause the destination node
387387
/// to reject the transfer as misaddressed.
388388
///
389-
/// The transfer_id parameter is be used to populate the transfer_id field of the generated Cyphal/UDP frames.
389+
/// The transfer_id parameter is used to populate the transfer_id field of the generated Cyphal/UDP frames.
390390
/// The caller shall increment the transfer-ID counter after each successful invocation of this function
391391
/// per redundant interface; the same transfer published over redundant interfaces shall have the same transfer-ID.
392392
/// There shall be a separate transfer-ID counter per topic. The initial value shall be chosen randomly
@@ -737,8 +737,9 @@ bool udpard_rx_port_new(udpard_rx_port_t* const self,
737737
/// The function has no effect if any of the arguments are NULL.
738738
void udpard_rx_port_free(udpard_rx_t* const rx, udpard_rx_port_t* const port);
739739

740-
/// The timestamp value indicates the arrival time of the datagram. Often, naive software timestamping is adequate
741-
/// for these purposes, but some applications may require a greater accuracy (e.g., for time synchronization).
740+
/// The timestamp value indicates the arrival time of the datagram and shall be non-negative.
741+
/// Often, naive software timestamping is adequate for these purposes, but some applications may require
742+
/// a greater accuracy (e.g., for time synchronization).
742743
///
743744
/// The function takes ownership of the passed datagram payload buffer. The library will either store it as a
744745
/// fragment of the reassembled transfer payload or free it using the corresponding memory resource

0 commit comments

Comments
 (0)