30 #define M_SleepSec(x) Sleep(1000 * x);
35 #define STDCALL __declspec(dllexport)
37 #define M_SleepSec(x) usleep(x * 1000000);
38 #include <sys/types.h>
43 # define byte unsigned char
58 std::vector<byte> vectorBytes;
66 std::string strItemDesc;
75 std::string strUnitLabel;
103 int openPort(
const char *portName,
int baudrate);
104 int openPort(
const int fd,
int baudrate);
105 int openPort(
const char *portName);
106 void setPortHandle(HANDLE hdnl);
111 void setDebugCallback(
void (*callbackptr)(
const char*,
void*,obdLib::DebugLevel),
void *);
112 void setCommsCallback(
void (*callbackptr)(
const char*,
void*),
void*);
113 std::string monitorModeReadLine();
116 static byte byteArrayToByte(byte b1, byte b2);
117 std::string getVersion() {
return versionString; }
118 bool sendObdRequest(
const char *req,
int len,std::vector<byte> *reply);
119 bool sendObdRequest(
const char *req,
int length,std::vector<byte> *reply,
int sleep,
int timeout);
120 bool sendObdRequestString(
const char *req,
int len,std::vector<byte> *reply,
int sleeptime);
121 bool sendObdRequestString(
const char *req,
int length,std::vector<byte> *reply,
int sleeptime,
int timeout);
122 bool sendObdRequestString(
const char *req,
int len,std::vector<byte> *reply);
123 bool sendObdRequest(
const char *req,
int len);
124 bool sendObdRequest(
const char *req,
int len,
int timeout);
125 ObdError lastError();
129 void debug(DebugLevel lvl,
const char* msg,...);
130 void commsDebug(
const char *msg);
131 ObdError m_lastError;
132 std::vector<std::vector<int> > *modeByteCount;
133 std::string versionString;
135 byte* readBytes(
int* bytesRead,
int numBytesToRead);
136 void writeBytes(byte *sendBuffer,
int bufferSize,
int *bytesWritten);