CAN_DEVCTL_TX_FRAME_RAW

Transmit a message in raw frame mode

Synopsis:

#include <sys/can_dcmd.h>

#define CAN_DEVCTL_TX_FRAME_RAW   __DIOT(_DCMD_MISC, CAN_CMD_CODE + 11,   struct can_msg)

Arguments to devctl():

Argument Value
filedes A file descriptor that you obtained by opening the device
dcmd CAN_DEVCTL_TX_FRAME_RAW
dev_data_ptr A pointer to a struct can_msg
n_bytes sizeof(struct can_msg)
dev_info_ptr NULL

Description:

This command places a message on the outgoing queue, in raw frame mode.

Input:

A filled-in can_msg structure, which is defined in <sys/can_dcmd.h> as follows:

#define CAN_MSG_DATA_MAX  0x8 /* Max number of data bytes in a CAN message
                                 as defined by CAN spec */

/* Extended CAN Message */
typedef struct can_msg_ext {
    uint32_t        timestamp;         /* CAN message timestamp */
    uint32_t        is_extended_mid;   /* 1=29-bit MID, 0=11-bit MID */
    uint32_t        is_remote_frame;   /* 1=remote frame request, 0=data frame */
} CAN_MSG_EXT;

/* CAN Message */
typedef struct can_msg {
        /* Pre-allocate CAN messages to the max data size */
        uint8_t        dat[CAN_MSG_DATA_MAX];  /* CAN message data */
        uint8_t        len;                    /* Actual CAN message data length */
        uint32_t       mid;                    /* CAN message identifier */
        CAN_MSG_EXT    ext;                    /* Extended CAN message info */
} CAN_MSG;

Output:

None.

Errors:

The devctl() function can return the following, in addition to the error codes listed in its entry in the C Library Reference:

EAGAIN
The transmit queue is currently full.
EINVAL
The file descriptor doesn't correspond to a transmit mailbox.

See also:

CAN_DEVCTL_RX_FRAME_RAW_BLOCK, CAN_DEVCTL_RX_FRAME_RAW_NOBLOCK

devctl() in the QNX Neutrino C Library Reference

canctl in the Utilities Reference