Get information about the CAN configuration
#include <sys/can_dcmd.h> #define CAN_DEVCTL_GET_INFO __DIOF(_DCMD_MISC, CAN_CMD_CODE + 101, struct can_devctl_info)
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 |
This command gets information about the CAN configuration.
None.
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: