This class implements the device communication for a USB device in Linux (see DevComm for general details)
More...
#include <DevCommUsb.h>
|
int | setNewSettings (int baudrate, int databits, const int parity, const int stopbits, bool softwareHandshake, bool hardwareHandshake) |
|
void | resetAttributes () |
|
This class implements the device communication for a USB device in Linux (see DevComm for general details)
void DevCommUsb::closeChannel |
( |
| ) |
|
|
virtual |
This function will be responsible for closing the communication channel.
Implements DevComm.
References fd, and oldtio.
void DevCommUsb::openChannel |
( |
| ) |
|
|
virtual |
bool DevCommUsb::txRx |
( |
const char * |
txPacket, |
|
|
char * |
rxPacket, |
|
|
int |
rxSize |
|
) |
| |
|
virtual |
This function will be responsible for dealing with the "physical" transmission of the data. It will then proceed to listening for the correspondent response. Whoever calls this function is responsible for guaranteeing that the reception buffer is large enough for rxSize+1 (+1 for '\0')
- Parameters
-
txPacket | The data to be transmitted, provided by the DxComm method that invokes the transmission. |
rxPacket | The array to store the response from the deti DX board. The DxComm method invoking the transmission will further handle its data. |
rxSize | The maximum size of data on the response packet corresponding to the invoking method. |
- Returns
- a boolean value indicating if the transmission/reception was performed. True in the normal situation, False in case of timeout on reception or channel error.
- Todo:
- transformar em byte array para verificar checksum
Implements DevComm.
References fd.
const char* DevCommUsb::devname |
|
private |
struct termios DevCommUsb::newtio |
|
private |
struct termios DevCommUsb::oldtio |
|
private |
The documentation for this class was generated from the following files:
- src/detiDxDriver/DevCommUsb.h
- src/detiDxDriver/DevCommUsb.cpp