anchao commented on code in PR #7616: URL: https://github.com/apache/nuttx/pull/7616#discussion_r1037776697
########## net/can/can_callback.c: ########## @@ -149,6 +133,34 @@ uint16_t can_callback(FAR struct net_driver_s *dev, if ((flags & CAN_NEWDATA) != 0) { +#ifdef CONFIG_NET_TIMESTAMP + /* TIMESTAMP sockopt is activated, + * create timestamp and copy to iob + */ + + if (conn->timestamp) + { + struct timespec ts; + FAR struct timeval *tv = (FAR struct timeval *)&ts; + uint16_t len = sizeof(struct timeval); + + clock_systime_timespec(&ts); + tv->tv_usec = ts.tv_nsec / 1000; + + len = iob_trycopyin(dev->d_iob, + (FAR uint8_t *)tv, len, 0, false); + if (len != sizeof(struct timeval)) Review Comment: Done -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org