Cynerd commented on code in PR #17283:
URL: https://github.com/apache/nuttx/pull/17283#discussion_r2495076340
##########
drivers/can/can.c:
##########
@@ -964,6 +965,22 @@ static int can_ioctl(FAR struct file *filep, int cmd,
unsigned long arg)
}
break;
+ /* Set read watermark */
+
+ case CANIOC_SET_IWATERMARK:
+ {
+ reader->rxwatermark = *(FAR size_t *)arg;
Review Comment:
There is `init_can_reader` function that is used to initialize this
structure. It gets called from `can_open` and thus initialized to `SIZE_MAX`
every time when reader is created for the can file descriptor.
There is no change in default behavior. The default behavior is the same,
thanks to the default watermark being set to `SIZE_MAX`.
Edit: I think it's worth pointing out that the watermark is specific to
every reader and thus to every unique opening of a can device.
Edit2: Just to not glance over your consideration, if some user might get
fewer frames than expected by default, the size of the buffer for read is in
`size_t` and thus having `SIZE_MAX` be the default for watermark ensures that
the buffer of any possible size is fully utilized.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]