git-svn-id: svn://db.shs.com.ru/pip@609 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
33
src_main/io/pican.h
Normal file
33
src_main/io/pican.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#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() {}
|
||||
|
||||
protected:
|
||||
bool openDevice();
|
||||
bool closeDevice();
|
||||
int readDevice(void * read_to, int max_size);
|
||||
int writeDevice(const void * data, int max_size);
|
||||
|
||||
void setCANID(int id);
|
||||
int CANID() const;
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user