40 #include "../CDev.hpp" 42 #include <px4_platform_common/posix.h> 44 #include <sys/ioctl.h> 46 #ifdef CONFIG_DISABLE_POLL 47 # error This driver is not compatible with CONFIG_DISABLE_POLL 63 static int cdev_poll(
file_t *filp, px4_pollfd_struct_t *fds,
bool setup);
82 #ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS 92 return cdev->
open(filp);
100 return cdev->
close(filp);
108 return cdev->
read(filp, buffer, buflen);
116 return cdev->
write(filp, buffer, buflen);
124 return cdev->
seek(filp, offset, whence);
132 return cdev->
ioctl(filp, cmd, arg);
140 return cdev->
poll(filp, fds, setup);
virtual int open(file_t *filep)
Handle an open of the device.
static int cdev_close(file_t *filp)
static const px4_file_operations_t fops
Pointer to the default cdev file operations table; useful for registering clone devices etc...
virtual ssize_t read(file_t *filep, char *buffer, size_t buflen)
Perform a read from the device.
virtual int close(file_t *filep)
Handle a close of the device.
static void read(bootloader_app_shared_t *pshared)
Generic device / sensor interface.
virtual off_t seek(file_t *filep, off_t offset, int whence)
Perform a logical seek operation on the device.
Abstract class for any character device.
virtual ssize_t write(file_t *filep, const char *buffer, size_t buflen)
Perform a write to the device.
static ssize_t cdev_read(file_t *filp, char *buffer, size_t buflen)
static int cdev_open(file_t *filp)
virtual int ioctl(file_t *filep, int cmd, unsigned long arg)
Perform an ioctl operation on the device.
static int cdev_ioctl(file_t *filp, int cmd, unsigned long arg)
static int cdev_poll(file_t *filp, px4_pollfd_struct_t *fds, bool setup)
static off_t cdev_seek(file_t *filp, off_t offset, int whence)
static ssize_t cdev_write(file_t *filp, const char *buffer, size_t buflen)
virtual int poll(file_t *filep, px4_pollfd_struct_t *fds, bool setup)
Perform a poll setup/teardown operation.