CanSigIoCtl

Description

This function performs a special action on the opened device. The function code defines what the caller want to do.

Prototype

CPU_INT16S CanSigIoCtl(CPU_INT16S  sigId, 
                       CPU_INT16U  func,
                       void       *argp);

Parameter

Meaning

sigId

Unique signal identifier

func

The functioncode

argp

Pointer to argument, specific to the function code

Additional Information

Function Code

Meaning

CANSIG_GET_WIDTH

Get the argument pointer width (CPU_INT08U *) and set the content to the signal width.

CANSIG_GET_STATUS

Get the argument pointer status (CPU_INT08U *) and set the content to the signal status.

CANSIG_GET_TIMESTAMP

Get the argument pointer timestamp (CPU_INT32U *) and set the content to the signal timestamp.

CANSIG_GET_TIME_SINCE_UPDATE

Get the argument pointer timestamp (CPU_INT32U *) and set the content to the difference between actual time and signal timestamp.

CANSIG_DISABLE_TIMESTAMP

Timestamping can be disabled to improve performance. The argument pointer is unused.

CANSIG_ENABLE_TIMESTAMP

Enables timestamping. The argument pointer is unused.

CANSIG_SET_TIMESTAMP

The timestamp of a signal will be set to the content of the argument pointer (CPU_INT32U*).

CANSIG_SET_WRITE_PROTECTION

Sets a write protections for a dedicated signal. When set, CanSigWrite-function will have no effect on that signal. The argument pointer (CPU_INT08U* ) must be set to CANSIG_PROT_RO to enable write protection or 0 to disable write protection.

CANSIG_GET_WRITE_PROTECTION

Get the argument pointer write protection (CPU_INT08U*) and set the content to write protection status (CANSIG_PROT_RO or 0).

The IoCtl-functions concerning timestamp are omitted if CANSIG_STATIC_CONFIG is set to 1.

Return Value

One of the following error codes is returned: CAN_ERR_NONE, CAN_ERR_SIGID, CAN_ERR_NULLPTR, CAN_ERR_NULLSIGCFG or CAN_ERR_IOCTRLFUNC.