From 4b4f33e6a4fb18047a6ca73d3a4872a900519b5c Mon Sep 17 00:00:00 2001 From: px4dev Date: Sun, 4 Aug 2013 19:48:20 -0700 Subject: 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. --- src/drivers/device/device.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/drivers/device/device.cpp') 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 -- cgit v1.2.3