Line 27... |
Line 27... |
explicit ComPortService(const char *name);
|
explicit ComPortService(const char *name);
|
virtual ~ComPortService();
|
virtual ~ComPortService();
|
|
|
/** IService interface */
|
/** IService interface */
|
virtual void postinitService();
|
virtual void postinitService();
|
|
virtual void predeleteService();
|
|
|
/** ISerial */
|
/** ISerial */
|
virtual int writeData(const char *buf, int sz);
|
virtual int writeData(const char *buf, int sz);
|
virtual void registerRawListener(IFace *listener);
|
virtual void registerRawListener(IFace *listener);
|
virtual void unregisterRawListener(IFace *listener);
|
virtual void unregisterRawListener(IFace *listener);
|
|
virtual void getListOfPorts(AttributeType *list);
|
|
virtual int openPort(const char *port, AttributeType settings);
|
|
virtual void closePort();
|
|
|
/** IRawListener */
|
/** IRawListener (simulation only) */
|
virtual void updateData(const char *buf, int buflen);
|
virtual void updateData(const char *buf, int buflen);
|
|
|
protected:
|
protected:
|
/** IThread interface */
|
/** IThread interface */
|
virtual void busyLoop();
|
virtual void busyLoop();
|
|
|
private:
|
private:
|
void getSerialPortList(AttributeType *list);
|
|
int openSerialPort(const char *port, int baud, void *hdl);
|
|
void closeSerialPort(void *hdl);
|
|
int readSerialPort(void *hdl, char *buf, int bufsz);
|
int readSerialPort(void *hdl, char *buf, int bufsz);
|
int writeSerialPort(void *hdl, char *buf, int bufsz);
|
int writeSerialPort(void *hdl, char *buf, int bufsz);
|
void cleanSerialPort(void *hdl);
|
void cleanSerialPort(void *hdl);
|
|
|
private:
|
private:
|
Line 58... |
Line 59... |
AttributeType comPortSpeed_;
|
AttributeType comPortSpeed_;
|
AttributeType portListeners_;
|
AttributeType portListeners_;
|
|
|
FILE *logfile_;
|
FILE *logfile_;
|
#if defined(_WIN32) || defined(__CYGWIN__)
|
#if defined(_WIN32) || defined(__CYGWIN__)
|
HANDLE hPort_;
|
HANDLE prtHandler_;
|
#else
|
#else
|
int hPort_;
|
int prtHandler_;
|
#endif
|
#endif
|
|
|
bool isSimulation_;
|
bool isSimulation_;
|
bool portOpened_;
|
bool portOpened_;
|
ISerial *iuartSim_;
|
ISerial *iuartSim_;
|