CAN_DEVCTL_SET_TIMESTAMP
QNX SDP8.0Devctl and Ioctl CommandsDeveloper
Set the device timestamp
Synopsis:
#include <sys/can_dcmd.h>
#define CAN_DEVCTL_SET_TIMESTAMP __DIOT(_DCMD_MISC, CAN_CMD_CODE + 7, uint32_t)
Arguments to devctl():
Argument | Value |
---|---|
filedes | A file descriptor that you obtained by opening the device |
dcmd | CAN_DEVCTL_SET_TIMESTAMP |
dev_data_ptr | A pointer to a uint32_t |
n_bytes | sizeof(uint32_t) |
dev_info_ptr | NULL |
Description:
This command sets the timestamp.
Input:
The new timestamp.
Output:
None.
Example:
int ret;
uint32_t val;
if( (fd = open( "/dev/can1/rx0", O_RDWR)) == -1 )
{
printf("open of %s failed \n", devname);
exit(EXIT_FAILURE);
}
/* Get the new value for the timestamp. */
val = strtoul(optarg, NULL, 0);
if(EOK != (ret = devctl(fd, CAN_DEVCTL_SET_TIMESTAMP, &val, sizeof(val), NULL)))
{
fprintf(stderr, "devctl CAN_DEVCTL_SET_TIMESTAMP: %s\n", strerror(ret));
}
See also:
devctl() in the QNX OS C Library Reference
canctl in the Utilities Reference
Page updated: