mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-30 09:40:35 +08:00
uORB move to standalone CDev
- uORB topics should not be Devices with bus, address, device id
This commit is contained in:
@@ -49,9 +49,7 @@
|
||||
#include "uORBCommunicator.hpp"
|
||||
#endif /* ORB_COMMUNICATOR */
|
||||
|
||||
using namespace device;
|
||||
|
||||
uORB::DeviceNode::SubscriberData *uORB::DeviceNode::filp_to_sd(device::file_t *filp)
|
||||
uORB::DeviceNode::SubscriberData *uORB::DeviceNode::filp_to_sd(cdev::file_t *filp)
|
||||
{
|
||||
#ifndef __PX4_NUTTX
|
||||
|
||||
@@ -63,9 +61,8 @@ uORB::DeviceNode::SubscriberData *uORB::DeviceNode::filp_to_sd(device::file_t *f
|
||||
return (SubscriberData *)(FILE_PRIV(filp));
|
||||
}
|
||||
|
||||
uORB::DeviceNode::DeviceNode(const struct orb_metadata *meta, const char *name, const char *path,
|
||||
int priority, unsigned int queue_size) :
|
||||
CDev(name, path),
|
||||
uORB::DeviceNode::DeviceNode(const struct orb_metadata *meta, const char *path, int priority, unsigned int queue_size) :
|
||||
CDev(path),
|
||||
_meta(meta),
|
||||
_priority((uint8_t)priority),
|
||||
_queue_size(queue_size)
|
||||
@@ -80,7 +77,7 @@ uORB::DeviceNode::~DeviceNode()
|
||||
}
|
||||
|
||||
int
|
||||
uORB::DeviceNode::open(device::file_t *filp)
|
||||
uORB::DeviceNode::open(cdev::file_t *filp)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -152,7 +149,7 @@ uORB::DeviceNode::open(device::file_t *filp)
|
||||
}
|
||||
|
||||
int
|
||||
uORB::DeviceNode::close(device::file_t *filp)
|
||||
uORB::DeviceNode::close(cdev::file_t *filp)
|
||||
{
|
||||
/* is this the publisher closing? */
|
||||
if (px4_getpid() == _publisher) {
|
||||
@@ -177,7 +174,7 @@ uORB::DeviceNode::close(device::file_t *filp)
|
||||
}
|
||||
|
||||
ssize_t
|
||||
uORB::DeviceNode::read(device::file_t *filp, char *buffer, size_t buflen)
|
||||
uORB::DeviceNode::read(cdev::file_t *filp, char *buffer, size_t buflen)
|
||||
{
|
||||
SubscriberData *sd = (SubscriberData *)filp_to_sd(filp);
|
||||
|
||||
@@ -233,7 +230,7 @@ uORB::DeviceNode::read(device::file_t *filp, char *buffer, size_t buflen)
|
||||
}
|
||||
|
||||
ssize_t
|
||||
uORB::DeviceNode::write(device::file_t *filp, const char *buffer, size_t buflen)
|
||||
uORB::DeviceNode::write(cdev::file_t *filp, const char *buffer, size_t buflen)
|
||||
{
|
||||
/*
|
||||
* Writes are legal from interrupt context as long as the
|
||||
@@ -301,7 +298,7 @@ uORB::DeviceNode::write(device::file_t *filp, const char *buffer, size_t buflen)
|
||||
}
|
||||
|
||||
int
|
||||
uORB::DeviceNode::ioctl(device::file_t *filp, int cmd, unsigned long arg)
|
||||
uORB::DeviceNode::ioctl(cdev::file_t *filp, int cmd, unsigned long arg)
|
||||
{
|
||||
SubscriberData *sd = filp_to_sd(filp);
|
||||
|
||||
@@ -493,7 +490,7 @@ int16_t uORB::DeviceNode::topic_unadvertised(const orb_metadata *meta, int prior
|
||||
#endif /* ORB_COMMUNICATOR */
|
||||
|
||||
pollevent_t
|
||||
uORB::DeviceNode::poll_state(device::file_t *filp)
|
||||
uORB::DeviceNode::poll_state(cdev::file_t *filp)
|
||||
{
|
||||
SubscriberData *sd = filp_to_sd(filp);
|
||||
|
||||
@@ -510,7 +507,7 @@ uORB::DeviceNode::poll_state(device::file_t *filp)
|
||||
void
|
||||
uORB::DeviceNode::poll_notify_one(px4_pollfd_struct_t *fds, pollevent_t events)
|
||||
{
|
||||
SubscriberData *sd = filp_to_sd((device::file_t *)fds->priv);
|
||||
SubscriberData *sd = filp_to_sd((cdev::file_t *)fds->priv);
|
||||
|
||||
/*
|
||||
* If the topic looks updated to the subscriber, go ahead and notify them.
|
||||
|
||||
Reference in New Issue
Block a user