CAN_DEVCTL_GET_INFO

Get information about the CAN configuration

Synopsis:

#include <sys/can_dcmd.h>

#define CAN_DEVCTL_GET_INFO   __DIOF(_DCMD_MISC, CAN_CMD_CODE + 101,  struct can_devctl_info)

Arguments to devctl():

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

Description:

This command gets information about the CAN configuration.

Input:

None.

Output:

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

typedef struct can_devctl_info
{
    char                description[64];    /* CAN device description */
    uint32_t            msgq_size;          /* Number of message queue objects */
    uint32_t            waitq_size;         /* Number of client wait queue objects */
    CANDEV_MODE         mode;               /* CAN driver mode - I/O or raw frames */
    uint32_t            bit_rate;           /* Bit rate */
    uint16_t            bit_rate_prescaler; /* Bit rate prescaler */
    uint8_t             sync_jump_width;    /* Time quantum Sync Jump Width */
    uint8_t             time_segment_1;     /* Time quantum Time Segment 1 */
    uint8_t             time_segment_2;     /* Time quantum Time Segment 2 */
    uint32_t            num_tx_mboxes;      /* Number of TX Mailboxes */
    uint32_t            num_rx_mboxes;      /* Number of RX Mailboxes */
    uint32_t            loopback_external;  /* External loopback is enabled */
    uint32_t            loopback_internal;  /* Internal loopback is enabled */
    uint32_t            autobus_on;         /* Auto timed bus on after bus off */
    uint32_t            silent;             /* Receiver only, no ack generation */
} CAN_DEVCTL_INFO;

The mode is one of the following:

CANDEV_MODE_IO
All mailboxes are set up to transmit or receive specific message IDs.
CANDEV_MODE_RAW_FRAME
All messages found on the bus are received and put into a single mailbox. Similarly, there is one transmit mailbox; the message ID and type of frame are defined within the message instead of in the mailbox.

See also:

CAN_DEVCTL_GET_STATS

devctl() in the QNX Neutrino C Library Reference

canctl in the Utilities Reference