|
virtual int | open (cdev::file_t *handlep) |
| Handle an open of the device. More...
|
|
virtual int | close (cdev::file_t *handlep) |
| Handle a close of the device. More...
|
|
virtual ssize_t | write (cdev::file_t *handlep, const char *buffer, size_t buflen) |
| Perform a write to the device. More...
|
|
virtual ssize_t | read (cdev::file_t *handlep, char *buffer, size_t buflen) |
| Perform a read from the device. More...
|
|
| CDev (const char *devname) |
| Constructor. More...
|
|
virtual int | init () |
|
virtual off_t | seek (file_t *filep, off_t offset, int whence) |
| Perform a logical seek operation on the device. More...
|
|
virtual int | ioctl (file_t *filep, int cmd, unsigned long arg) |
| Perform an ioctl operation on the device. More...
|
|
virtual int | poll (file_t *filep, px4_pollfd_struct_t *fds, bool setup) |
| Perform a poll setup/teardown operation. More...
|
|
const char * | get_devname () const |
| Get the device name. More...
|
|
|
virtual pollevent_t | poll_state (file_t *filep) |
| Check the current state of the device for poll events from the perspective of the file. More...
|
|
virtual void | poll_notify (pollevent_t events) |
| Report new poll events. More...
|
|
virtual void | poll_notify_one (px4_pollfd_struct_t *fds, pollevent_t events) |
| Internal implementation of poll_notify. More...
|
|
virtual int | open_first (file_t *filep) |
| Notification of the first open. More...
|
|
virtual int | close_last (file_t *filep) |
| Notification of the last close. More...
|
|
virtual int | register_class_devname (const char *class_devname) |
| Register a class device name, automatically adding device class instance suffix if need be. More...
|
|
virtual int | unregister_class_devname (const char *class_devname, unsigned class_instance) |
| Register a class device name, automatically adding device class instance suffix if need be. More...
|
|
void | lock () |
| Take the driver lock. More...
|
|
void | unlock () |
| Release the driver lock.
|
|
px4_sem_t | _lock |
| lock to protect access to all class members (also for derived classes)
|
|
static const px4_file_operations_t | fops = {} |
| Pointer to the default cdev file operations table; useful for registering clone devices etc.
|
|
§ close()
Handle a close of the device.
This function is called for every close of the device. The default implementation maintains _open_count and returns OK as long as it is not zero.
- Parameters
-
filep | Pointer to the NuttX file structure. |
- Returns
- OK if the close was successful, -errno otherwise.
Reimplemented from cdev::CDev.
§ open()
Handle an open of the device.
This function is called for every open of the device. The default implementation maintains _open_count and always returns OK.
- Parameters
-
filep | Pointer to the NuttX file structure. |
- Returns
- OK if the open is allowed, -errno otherwise.
Reimplemented from cdev::CDev.
§ read()
ssize_t CDevNode::read |
( |
cdev::file_t * |
filep, |
|
|
char * |
buffer, |
|
|
size_t |
buflen |
|
) |
| |
|
virtual |
Perform a read from the device.
The default implementation returns -ENOSYS.
- Parameters
-
filep | Pointer to the NuttX file structure. |
buffer | Pointer to the buffer into which data should be placed. |
buflen | The number of bytes to be read. |
- Returns
- The number of bytes read or -errno otherwise.
Reimplemented from cdev::CDev.
§ write()
ssize_t CDevNode::write |
( |
cdev::file_t * |
filep, |
|
|
const char * |
buffer, |
|
|
size_t |
buflen |
|
) |
| |
|
virtual |
Perform a write to the device.
The default implementation returns -ENOSYS.
- Parameters
-
filep | Pointer to the NuttX file structure. |
buffer | Pointer to the buffer from which data should be read. |
buflen | The number of bytes to be written. |
- Returns
- The number of bytes written or -errno otherwise.
Reimplemented from cdev::CDev.
The documentation for this class was generated from the following file: