|
PX4 Firmware
PX4 Autopilot Software http://px4.io
|
Public Types | |
| enum | Operation { Read, Write } |
Public Member Functions | |
| DevCommon (const char *device_path) | |
| virtual | ~DevCommon () |
| virtual int | ioctl (struct file *filp, int cmd, unsigned long arg) |
| virtual int | open (file *filp) |
| virtual int | close (file *filp) |
Public Member Functions inherited from cdev::CDev | |
| CDev (const char *devname) | |
| Constructor. More... | |
| CDev (const CDev &)=delete | |
| CDev & | operator= (const CDev &)=delete |
| CDev (CDev &&)=delete | |
| CDev & | operator= (CDev &&)=delete |
| virtual | ~CDev () |
| virtual int | init () |
| virtual int | open (file_t *filep) |
| Handle an open of the device. More... | |
| virtual int | close (file_t *filep) |
| Handle a close of the device. More... | |
| virtual ssize_t | read (file_t *filep, char *buffer, size_t buflen) |
| Perform a read from the device. More... | |
| virtual ssize_t | write (file_t *filep, const char *buffer, size_t buflen) |
| Perform a write to the device. More... | |
| 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... | |
Protected Types | |
| enum | ParserState : uint8_t { ParserState::Idle = 0, ParserState::GotLength } |
Protected Member Functions | |
| virtual pollevent_t | poll_state (struct file *filp) |
| void | lock (enum Operation op) |
| void | unlock (enum Operation op) |
Protected Member Functions inherited from cdev::CDev | |
| 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. More... | |
| int | unregister_driver_and_memory () |
| First, unregisters the driver. More... | |
Protected Attributes | |
| int | _fd = -1 |
| uint16_t | _packet_len |
| ParserState | _parser_state = ParserState::Idle |
| bool | _had_data = false |
| whether poll() returned available data More... | |
Protected Attributes inherited from cdev::CDev | |
| px4_sem_t | _lock |
| lock to protect access to all class members (also for derived classes) More... | |
Additional Inherited Members | |
Static Protected Attributes inherited from cdev::CDev | |
| static const px4_file_operations_t | fops = {} |
| Pointer to the default cdev file operations table; useful for registering clone devices etc. More... | |
Definition at line 119 of file protocol_splitter.cpp.
| enum DevCommon::Operation |
| Enumerator | |
|---|---|
| Read | |
| Write | |
Definition at line 130 of file protocol_splitter.cpp.
|
strongprotected |
| Enumerator | |
|---|---|
| Idle | |
| GotLength | |
Definition at line 158 of file protocol_splitter.cpp.
| DevCommon::DevCommon | ( | const char * | device_path | ) |
Definition at line 169 of file protocol_splitter.cpp.
|
virtual |
|
virtual |
Definition at line 200 of file protocol_splitter.cpp.
References _fd.
Referenced by ~DevCommon().
|
virtual |
Definition at line 181 of file protocol_splitter.cpp.
References _fd.
Referenced by Mavlink2Dev::write(), and RtpsDev::write().
|
inlineprotected |
Definition at line 137 of file protocol_splitter.cpp.
|
virtual |
Definition at line 193 of file protocol_splitter.cpp.
References _fd.
|
protectedvirtual |
Definition at line 209 of file protocol_splitter.cpp.
References _fd, _had_data, and cdev::CDev::poll().
|
inlineprotected |
Definition at line 149 of file protocol_splitter.cpp.
|
protected |
Definition at line 155 of file protocol_splitter.cpp.
Referenced by close(), ioctl(), open(), poll_state(), Mavlink2Dev::read(), RtpsDev::read(), Mavlink2Dev::write(), RtpsDev::write(), and ~DevCommon().
|
protected |
whether poll() returned available data
Definition at line 164 of file protocol_splitter.cpp.
Referenced by poll_state(), Mavlink2Dev::read(), and RtpsDev::read().
|
protected |
Definition at line 157 of file protocol_splitter.cpp.
Referenced by Mavlink2Dev::write(), and RtpsDev::write().
|
protected |
Definition at line 162 of file protocol_splitter.cpp.
Referenced by Mavlink2Dev::write(), and RtpsDev::write().