Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
can_ioctl.h File Reference
#include <stdint.h>

Go to the source code of this file.

Macros

#define CAN_IOC_MAGIC   ('c')
 Magic number for this driver's ioctl calls.
 
#define NOTIFIABLE_TYPE   13
 ioctl minor type used for the read/write active notifiable integration.
 
#define CAN_IOC_READ_ACTIVE   IOW(CAN_IOC_MAGIC, 1, NOTIFIABLE_TYPE)
 read active ioctl.
 
#define CAN_IOC_WRITE_ACTIVE   IOW(CAN_IOC_MAGIC, 2, NOTIFIABLE_TYPE)
 write active ioctl.
 
#define SIOCGCANSTATE   IOR(CAN_IOC_MAGIC, 3, sizeof(can_state_t))
 Read the CAN state.
 
#define CAN_STATE_ACTIVE   0
 CAN bus active.
 
#define CAN_STATE_BUS_WARNING   1
 CAN bus error warning.
 
#define CAN_STATE_BUS_PASSIVE   2
 CAN bus error passive.
 
#define CAN_STATE_BUS_OFF   3
 CAN bus off.
 
#define CAN_STATE_SCANNING_BAUDRATE   4
 CAN bus scanning baud rate (CANFD)
 
#define CAN_STATE_STOPPED   5
 CAN bus stopped.
 
#define CAN_STATE_SLEEPING   6
 CAN bus sleeping.
 

Typedefs

typedef uint32_t can_state_t
 CAN state type.
 

Detailed Description

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This file implements can specific ioctl() keys.

Author
Stuart W. Baker
Date
2 November 2013

Definition in file esp-idf/can_ioctl.h.

Macro Definition Documentation

◆ CAN_IOC_MAGIC

#define CAN_IOC_MAGIC   ('c')

Magic number for this driver's ioctl calls.

Definition at line 49 of file esp-idf/can_ioctl.h.

◆ CAN_IOC_READ_ACTIVE

#define CAN_IOC_READ_ACTIVE   IOW(CAN_IOC_MAGIC, 1, NOTIFIABLE_TYPE)

read active ioctl.

Argument is a literal pointer to a Notifiable.

Definition at line 55 of file esp-idf/can_ioctl.h.

◆ CAN_IOC_WRITE_ACTIVE

#define CAN_IOC_WRITE_ACTIVE   IOW(CAN_IOC_MAGIC, 2, NOTIFIABLE_TYPE)

write active ioctl.

Argument is a literal pointer to a Notifiable.

Definition at line 58 of file esp-idf/can_ioctl.h.

◆ CAN_STATE_ACTIVE

#define CAN_STATE_ACTIVE   0

CAN bus active.

Definition at line 67 of file esp-idf/can_ioctl.h.

◆ CAN_STATE_BUS_OFF

#define CAN_STATE_BUS_OFF   3

CAN bus off.

Definition at line 76 of file esp-idf/can_ioctl.h.

◆ CAN_STATE_BUS_PASSIVE

#define CAN_STATE_BUS_PASSIVE   2

CAN bus error passive.

Definition at line 73 of file esp-idf/can_ioctl.h.

◆ CAN_STATE_BUS_WARNING

#define CAN_STATE_BUS_WARNING   1

CAN bus error warning.

Definition at line 70 of file esp-idf/can_ioctl.h.

◆ CAN_STATE_SCANNING_BAUDRATE

#define CAN_STATE_SCANNING_BAUDRATE   4

CAN bus scanning baud rate (CANFD)

Definition at line 79 of file esp-idf/can_ioctl.h.

◆ CAN_STATE_SLEEPING

#define CAN_STATE_SLEEPING   6

CAN bus sleeping.

Definition at line 85 of file esp-idf/can_ioctl.h.

◆ CAN_STATE_STOPPED

#define CAN_STATE_STOPPED   5

CAN bus stopped.

Definition at line 82 of file esp-idf/can_ioctl.h.

◆ NOTIFIABLE_TYPE

#define NOTIFIABLE_TYPE   13

ioctl minor type used for the read/write active notifiable integration.

Definition at line 52 of file esp-idf/can_ioctl.h.

◆ SIOCGCANSTATE

#define SIOCGCANSTATE   IOR(CAN_IOC_MAGIC, 3, sizeof(can_state_t))

Read the CAN state.

Definition at line 64 of file esp-idf/can_ioctl.h.

Typedef Documentation

◆ can_state_t

typedef uint32_t can_state_t

CAN state type.

Definition at line 61 of file esp-idf/can_ioctl.h.