aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/device/device.cpp
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2013-08-04 19:48:20 -0700
committerpx4dev <px4@purgatory.org>2013-08-04 19:48:20 -0700
commit4b4f33e6a4fb18047a6ca73d3a4872a900519b5c (patch)
treec8580715886028dcea9e7e3d8ea11e6a677f25fe /src/drivers/device/device.cpp
parent567f621754f1f68ed0aae560e9590805045fa3e0 (diff)
downloadpx4-firmware-4b4f33e6a4fb18047a6ca73d3a4872a900519b5c.tar.gz
px4-firmware-4b4f33e6a4fb18047a6ca73d3a4872a900519b5c.tar.bz2
px4-firmware-4b4f33e6a4fb18047a6ca73d3a4872a900519b5c.zip
Add direct-access methods to the base Device class, so that there's a common way of talking to drivers regardless of which of the specialised classes they derive from.
Make the Device destructor public and virtual, so that arbitrary devices can be deleted. Likewise for classes that derive from it. Make Device::init public so that arbitrary devices can be initialised after being returned by factories.
Diffstat (limited to 'src/drivers/device/device.cpp')
-rw-r--r--src/drivers/device/device.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/drivers/device/device.cpp b/src/drivers/device/device.cpp
index 04a5222c3..c3ee77b1c 100644
--- a/src/drivers/device/device.cpp
+++ b/src/drivers/device/device.cpp
@@ -223,5 +223,22 @@ interrupt(int irq, void *context)
return OK;
}
+int
+Device::read(unsigned offset, void *data, unsigned count)
+{
+ return -ENODEV;
+}
+
+int
+Device::write(unsigned offset, void *data, unsigned count)
+{
+ return -ENODEV;
+}
+
+int
+Device::ioctl(unsigned operation, unsigned &arg)
+{
+ return -ENODEV;
+}
-} // namespace device \ No newline at end of file
+} // namespace device