Added default constructor for comedi::subdevice, and added missing wrapper
for comedi_cancel().
This commit is contained in:
parent
e8ad2b3498
commit
bdbd1ab792
1 changed files with 14 additions and 0 deletions
|
@ -167,6 +167,8 @@ namespace comedi
|
|||
class subdevice
|
||||
{
|
||||
public:
|
||||
subdevice(): _index(-1)
|
||||
{}
|
||||
subdevice(const device &dev, unsigned subdevice_index):
|
||||
_device(dev), _index(subdevice_index)
|
||||
{
|
||||
|
@ -191,6 +193,18 @@ namespace comedi
|
|||
}
|
||||
return retval;
|
||||
}
|
||||
void cancel()
|
||||
{
|
||||
int retval = comedi_cancel(comedi_handle(), index());
|
||||
if(retval < 0)
|
||||
{
|
||||
std::ostringstream message;
|
||||
message << __PRETTY_FUNCTION__ << ": comedi_cancel() failed, return value=" << retval << " .";
|
||||
std::cerr << message.str() << std::endl;
|
||||
comedi_perror("comedi_cancel");
|
||||
throw std::runtime_error(message.str());
|
||||
}
|
||||
}
|
||||
lsampl_t data_read(unsigned channel, unsigned range, unsigned aref) const
|
||||
{
|
||||
lsampl_t value;
|
||||
|
|
Loading…
Add table
Reference in a new issue