git-svn-id: svn://db.shs.com.ru/pip@632 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2018-09-27 10:11:21 +00:00
parent 9b92720b61
commit 08592aae9a
50 changed files with 70 additions and 19 deletions

View File

@@ -0,0 +1,32 @@
#ifndef PICAN_H
#define PICAN_H
#include "piiodevice.h"
class PIP_EXPORT PICAN: public PIIODevice
{
PIIODEVICE(PICAN)
public:
explicit PICAN(const PIString & path = PIString(), PIIODevice::DeviceMode mode = PIIODevice::ReadWrite);
~PICAN() {}
void setCANID(int id);
int CANID() const;
protected:
bool openDevice();
bool closeDevice();
int readDevice(void * read_to, int max_size);
int writeDevice(const void * data, int max_size);
PIString fullPathPrefix() const {return PIStringAscii("can");}
PIString constructFullPathDevice() const;
void configureFromFullPathDevice(const PIString & full_path);
DeviceInfoFlags deviceInfoFlags() const {return PIIODevice::Reliable;}
private:
int sock;
int can_id;
};
#endif // PICAN_H