PX4 Firmware
PX4 Autopilot Software http://px4.io
RtpsDev Class Reference
Inheritance diagram for RtpsDev:
Collaboration diagram for RtpsDev:

Public Member Functions

 RtpsDev (ReadBuffer *_read_buffer)
 
virtual ~RtpsDev ()
 
virtual ssize_t read (struct file *filp, char *buffer, size_t buflen)
 
virtual ssize_t write (struct file *filp, const char *buffer, size_t buflen)
 
- Public Member Functions inherited from DevCommon
 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
 
CDevoperator= (const CDev &)=delete
 
 CDev (CDev &&)=delete
 
CDevoperator= (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 Attributes

ReadBuffer_read_buffer
 
- Protected Attributes inherited from DevCommon
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...
 

Static Protected Attributes

static const uint8_t HEADER_SIZE = 9
 
- 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...
 

Additional Inherited Members

- Public Types inherited from DevCommon
enum  Operation { Read, Write }
 
- Protected Types inherited from DevCommon
enum  ParserState : uint8_t { ParserState::Idle = 0, ParserState::GotLength }
 
- Protected Member Functions inherited from DevCommon
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...
 

Detailed Description

Definition at line 410 of file protocol_splitter.cpp.

Constructor & Destructor Documentation

◆ RtpsDev()

RtpsDev::RtpsDev ( ReadBuffer _read_buffer)

Definition at line 425 of file protocol_splitter.cpp.

Referenced by protocol_splitter_main().

Here is the caller graph for this function:

◆ ~RtpsDev()

virtual RtpsDev::~RtpsDev ( )
inlinevirtual

Definition at line 414 of file protocol_splitter.cpp.

References file, Mavlink2Dev::read(), and Mavlink2Dev::write().

Here is the call graph for this function:

Member Function Documentation

◆ read()

ssize_t RtpsDev::read ( struct file filp,
char *  buffer,
size_t  buflen 
)
virtual

Definition at line 431 of file protocol_splitter.cpp.

References DevCommon::_fd, DevCommon::_had_data, _read_buffer, ReadBuffer::buf_size, ReadBuffer::buffer, HEADER_SIZE, cdev::CDev::lock(), ReadBuffer::move(), ReadBuffer::read(), DevCommon::Read, and cdev::CDev::unlock().

Here is the call graph for this function:

◆ write()

ssize_t RtpsDev::write ( struct file filp,
const char *  buffer,
size_t  buflen 
)
virtual

Definition at line 487 of file protocol_splitter.cpp.

References DevCommon::_fd, DevCommon::_packet_len, DevCommon::_parser_state, DevCommon::GotLength, HEADER_SIZE, DevCommon::Idle, DevCommon::ioctl(), cdev::CDev::lock(), cdev::CDev::unlock(), and DevCommon::Write.

Here is the call graph for this function:

Member Data Documentation

◆ _read_buffer

ReadBuffer* RtpsDev::_read_buffer
protected

Definition at line 420 of file protocol_splitter.cpp.

Referenced by read().

◆ HEADER_SIZE

const uint8_t RtpsDev::HEADER_SIZE = 9
staticprotected

Definition at line 422 of file protocol_splitter.cpp.

Referenced by read(), and write().


The documentation for this class was generated from the following file: