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.
This commit is contained in:
px4dev
2013-08-04 19:48:20 -07:00
parent 567f621754
commit 4b4f33e6a4
4 changed files with 82 additions and 23 deletions
+18 -1
View File
@@ -223,5 +223,22 @@ interrupt(int irq, void *context)
return OK;
}
int
Device::read(unsigned offset, void *data, unsigned count)
{
return -ENODEV;
}
} // namespace device
int
Device::write(unsigned offset, void *data, unsigned count)
{
return -ENODEV;
}
int
Device::ioctl(unsigned operation, unsigned &arg)
{
return -ENODEV;
}
} // namespace device