iCub-main
|
#include <MTComm.h>
Public Member Functions | |
CMTComm () | |
virtual | ~CMTComm () |
clock_t | clockms () |
short | openPort (const int portNumber, const unsigned long baudrate=PBR_115K2, const unsigned long inqueueSize=4096, const unsigned long outqueueSize=1024) |
short | openPort (const char *portName, const unsigned long baudrate=PBR_115K2, const unsigned long inqueueSize=4096, const unsigned long outqueueSize=1024) |
short | openFile (const char *fileName, bool createAlways=false) |
bool | isPortOpen () |
bool | isFileOpen () |
int | readData (unsigned char *msgBuffer, const int nBytesToRead) |
int | writeData (const unsigned char *msgBuffer, const int nBytesToWrite) |
void | flush () |
void | escape (unsigned long function) |
void | setPortQueueSize (const unsigned long inqueueSize=4096, const unsigned long outqueueSize=1024) |
short | setFilePos (long relPos, unsigned long moveMethod=FILEPOS_BEGIN) |
short | getFileSize (unsigned long &fileSize) |
short | close () |
short | readMessage (unsigned char &mid, unsigned char data[], short &dataLen, unsigned char *bid=NULL) |
short | readDataMessage (unsigned char data[], short &dataLen) |
short | readMessageRaw (unsigned char *msgBuffer, short *msgBufferLength) |
short | writeMessage (const unsigned char mid, const unsigned long dataValue=0, const unsigned char dataValueLen=0, const unsigned char bid=BID_MASTER) |
short | writeMessage (const unsigned char mid, const unsigned char data[], const unsigned short &dataLen, const unsigned char bid=BID_MASTER) |
short | waitForMessage (const unsigned char mid, unsigned char data[]=NULL, short *dataLen=NULL, unsigned char *bid=NULL) |
short | reqSetting (const unsigned char mid, unsigned long &value, const unsigned char bid=BID_MASTER) |
short | reqSetting (const unsigned char mid, const unsigned char param, unsigned long &value, const unsigned char bid=BID_MASTER) |
short | reqSetting (const unsigned char mid, float &value, const unsigned char bid=BID_MASTER) |
short | reqSetting (const unsigned char mid, const unsigned char param, float &value, const unsigned char bid=BID_MASTER) |
short | reqSetting (const unsigned char mid, unsigned char data[], short &dataLen, const unsigned char bid=BID_MASTER) |
short | reqSetting (const unsigned char mid, unsigned char dataIn[], short dataInLen, unsigned char dataOut[], short &dataOutLen, const unsigned char bid=BID_MASTER) |
short | reqSetting (const unsigned char mid, const unsigned char param, unsigned char data[], short &dataLen, const unsigned char bid=BID_MASTER) |
short | setSetting (const unsigned char mid, const unsigned long value, const unsigned short valuelen, const unsigned char bid=BID_MASTER) |
short | setSetting (const unsigned char mid, const unsigned char param, const unsigned long value, const unsigned short valuelen, const unsigned char bid=BID_MASTER) |
short | setSetting (const unsigned char mid, const float value, const unsigned char bid=BID_MASTER) |
short | setSetting (const unsigned char mid, const unsigned char param, const float value, const unsigned char bid=BID_MASTER) |
short | setSetting (const unsigned char mid, const unsigned char param, const float value, const bool store, const unsigned char bid=BID_MASTER) |
short | getDeviceMode (unsigned short *numDevices=NULL) |
short | setDeviceMode (unsigned long OutputMode, unsigned long OutputSettings, const unsigned char bid=BID_MASTER) |
short | getMode (unsigned long &OutputMode, unsigned long &OutputSettings, unsigned short &dataLength, const unsigned char bid=BID_MASTER) |
short | setMode (unsigned long OutputMode, unsigned long OutputSettings, const unsigned char bid=BID_MASTER) |
short | getValue (const unsigned long valueSpec, unsigned short &value, const unsigned char data[], const unsigned char bid=BID_MT) |
short | getValue (const unsigned long valueSpec, unsigned short value[], const unsigned char data[], const unsigned char bid=BID_MT) |
short | getValue (const unsigned long valueSpec, float value[], const unsigned char data[], const unsigned char bid=BID_MT) |
short | getLastDeviceError () |
short | getLastRetVal () |
short | setTimeOut (short timeOutMs) |
void | calcChecksum (unsigned char *msgBuffer, const int msgBufferLength) |
bool | checkChecksum (const unsigned char *msgBuffer, const int msgBufferLength) |
Static Public Member Functions | |
static void | swapEndian (const unsigned char input[], unsigned char output[], const short length) |
Protected Attributes | |
int | m_handle |
bool | m_portOpen |
bool | m_fileOpen |
short | m_deviceError |
short | m_retVal |
short | m_timeOut |
clock_t | m_clkEnd |
unsigned long | m_storedOutputMode [MAXDEVICES+1] |
unsigned long | m_storedOutputSettings [MAXDEVICES+1] |
unsigned long | m_storedDataLength [MAXDEVICES+1] |
unsigned char | m_tempBuffer [MAXMSGLEN] |
int | m_nTempBufferLen |
CMTComm::CMTComm | ( | ) |
Definition at line 96 of file MTComm.cpp.
|
virtual |
Definition at line 112 of file MTComm.cpp.
void CMTComm::calcChecksum | ( | unsigned char * | msgBuffer, |
const int | msgBufferLength | ||
) |
Definition at line 2633 of file MTComm.cpp.
bool CMTComm::checkChecksum | ( | const unsigned char * | msgBuffer, |
const int | msgBufferLength | ||
) |
Definition at line 2651 of file MTComm.cpp.
clock_t CMTComm::clockms | ( | ) |
Definition at line 128 of file MTComm.cpp.
short CMTComm::close | ( | void | ) |
Definition at line 702 of file MTComm.cpp.
void CMTComm::escape | ( | unsigned long | function | ) |
Definition at line 610 of file MTComm.cpp.
void CMTComm::flush | ( | ) |
Definition at line 588 of file MTComm.cpp.
short CMTComm::getDeviceMode | ( | unsigned short * | numDevices = NULL | ) |
Definition at line 2021 of file MTComm.cpp.
short CMTComm::getFileSize | ( | unsigned long & | fileSize | ) |
Definition at line 677 of file MTComm.cpp.
short CMTComm::getLastDeviceError | ( | ) |
Definition at line 2556 of file MTComm.cpp.
short CMTComm::getLastRetVal | ( | ) |
Definition at line 2568 of file MTComm.cpp.
short CMTComm::getMode | ( | unsigned long & | OutputMode, |
unsigned long & | OutputSettings, | ||
unsigned short & | dataLength, | ||
const unsigned char | bid = BID_MASTER |
||
) |
Definition at line 2187 of file MTComm.cpp.
short CMTComm::getValue | ( | const unsigned long | valueSpec, |
float | value[], | ||
const unsigned char | data[], | ||
const unsigned char | bid = BID_MT |
||
) |
Definition at line 2439 of file MTComm.cpp.
short CMTComm::getValue | ( | const unsigned long | valueSpec, |
unsigned short & | value, | ||
const unsigned char | data[], | ||
const unsigned char | bid = BID_MT |
||
) |
Definition at line 2300 of file MTComm.cpp.
short CMTComm::getValue | ( | const unsigned long | valueSpec, |
unsigned short | value[], | ||
const unsigned char | data[], | ||
const unsigned char | bid = BID_MT |
||
) |
Definition at line 2371 of file MTComm.cpp.
bool CMTComm::isFileOpen | ( | ) |
Definition at line 481 of file MTComm.cpp.
bool CMTComm::isPortOpen | ( | ) |
Definition at line 471 of file MTComm.cpp.
short CMTComm::openFile | ( | const char * | fileName, |
bool | createAlways = false |
||
) |
Definition at line 434 of file MTComm.cpp.
short CMTComm::openPort | ( | const char * | portName, |
const unsigned long | baudrate = PBR_115K2 , |
||
const unsigned long | inqueueSize = 4096 , |
||
const unsigned long | outqueueSize = 1024 |
||
) |
Definition at line 300 of file MTComm.cpp.
short CMTComm::openPort | ( | const int | portNumber, |
const unsigned long | baudrate = PBR_115K2 , |
||
const unsigned long | inqueueSize = 4096 , |
||
const unsigned long | outqueueSize = 1024 |
||
) |
Definition at line 160 of file MTComm.cpp.
int CMTComm::readData | ( | unsigned char * | msgBuffer, |
const int | nBytesToRead | ||
) |
Definition at line 498 of file MTComm.cpp.
short CMTComm::readDataMessage | ( | unsigned char | data[], |
short & | dataLen | ||
) |
Definition at line 786 of file MTComm.cpp.
short CMTComm::readMessage | ( | unsigned char & | mid, |
unsigned char | data[], | ||
short & | dataLen, | ||
unsigned char * | bid = NULL |
||
) |
Definition at line 745 of file MTComm.cpp.
short CMTComm::readMessageRaw | ( | unsigned char * | msgBuffer, |
short * | msgBufferLength | ||
) |
Definition at line 829 of file MTComm.cpp.
short CMTComm::reqSetting | ( | const unsigned char | mid, |
const unsigned char | param, | ||
float & | value, | ||
const unsigned char | bid = BID_MASTER |
||
) |
Definition at line 1429 of file MTComm.cpp.
short CMTComm::reqSetting | ( | const unsigned char | mid, |
const unsigned char | param, | ||
unsigned char | data[], | ||
short & | dataLen, | ||
const unsigned char | bid = BID_MASTER |
||
) |
Definition at line 1647 of file MTComm.cpp.
short CMTComm::reqSetting | ( | const unsigned char | mid, |
const unsigned char | param, | ||
unsigned long & | value, | ||
const unsigned char | bid = BID_MASTER |
||
) |
Definition at line 1302 of file MTComm.cpp.
short CMTComm::reqSetting | ( | const unsigned char | mid, |
float & | value, | ||
const unsigned char | bid = BID_MASTER |
||
) |
Definition at line 1371 of file MTComm.cpp.
short CMTComm::reqSetting | ( | const unsigned char | mid, |
unsigned char | data[], | ||
short & | dataLen, | ||
const unsigned char | bid = BID_MASTER |
||
) |
Definition at line 1499 of file MTComm.cpp.
short CMTComm::reqSetting | ( | const unsigned char | mid, |
unsigned char | dataIn[], | ||
short | dataInLen, | ||
unsigned char | dataOut[], | ||
short & | dataOutLen, | ||
const unsigned char | bid = BID_MASTER |
||
) |
Definition at line 1567 of file MTComm.cpp.
short CMTComm::reqSetting | ( | const unsigned char | mid, |
unsigned long & | value, | ||
const unsigned char | bid = BID_MASTER |
||
) |
Definition at line 1243 of file MTComm.cpp.
short CMTComm::setDeviceMode | ( | unsigned long | OutputMode, |
unsigned long | OutputSettings, | ||
const unsigned char | bid = BID_MASTER |
||
) |
Definition at line 2130 of file MTComm.cpp.
short CMTComm::setFilePos | ( | long | relPos, |
unsigned long | moveMethod = FILEPOS_BEGIN |
||
) |
Definition at line 648 of file MTComm.cpp.
short CMTComm::setMode | ( | unsigned long | OutputMode, |
unsigned long | OutputSettings, | ||
const unsigned char | bid = BID_MASTER |
||
) |
Definition at line 2211 of file MTComm.cpp.
void CMTComm::setPortQueueSize | ( | const unsigned long | inqueueSize = 4096 , |
const unsigned long | outqueueSize = 1024 |
||
) |
Definition at line 623 of file MTComm.cpp.
short CMTComm::setSetting | ( | const unsigned char | mid, |
const float | value, | ||
const unsigned char | bid = BID_MASTER |
||
) |
Definition at line 1839 of file MTComm.cpp.
short CMTComm::setSetting | ( | const unsigned char | mid, |
const unsigned char | param, | ||
const float | value, | ||
const bool | store, | ||
const unsigned char | bid = BID_MASTER |
||
) |
Definition at line 1956 of file MTComm.cpp.
short CMTComm::setSetting | ( | const unsigned char | mid, |
const unsigned char | param, | ||
const float | value, | ||
const unsigned char | bid = BID_MASTER |
||
) |
Definition at line 1893 of file MTComm.cpp.
short CMTComm::setSetting | ( | const unsigned char | mid, |
const unsigned char | param, | ||
const unsigned long | value, | ||
const unsigned short | valuelen, | ||
const unsigned char | bid = BID_MASTER |
||
) |
Definition at line 1778 of file MTComm.cpp.
short CMTComm::setSetting | ( | const unsigned char | mid, |
const unsigned long | value, | ||
const unsigned short | valuelen, | ||
const unsigned char | bid = BID_MASTER |
||
) |
Definition at line 1720 of file MTComm.cpp.
short CMTComm::setTimeOut | ( | short | timeOutMs | ) |
Definition at line 2581 of file MTComm.cpp.
|
static |
Definition at line 2603 of file MTComm.cpp.
short CMTComm::waitForMessage | ( | const unsigned char | mid, |
unsigned char | data[] = NULL , |
||
short * | dataLen = NULL , |
||
unsigned char * | bid = NULL |
||
) |
Definition at line 1177 of file MTComm.cpp.
int CMTComm::writeData | ( | const unsigned char * | msgBuffer, |
const int | nBytesToWrite | ||
) |
Definition at line 565 of file MTComm.cpp.
short CMTComm::writeMessage | ( | const unsigned char | mid, |
const unsigned char | data[], | ||
const unsigned short & | dataLen, | ||
const unsigned char | bid = BID_MASTER |
||
) |
Definition at line 1089 of file MTComm.cpp.
short CMTComm::writeMessage | ( | const unsigned char | mid, |
const unsigned long | dataValue = 0 , |
||
const unsigned char | dataValueLen = 0 , |
||
const unsigned char | bid = BID_MASTER |
||
) |
Definition at line 1012 of file MTComm.cpp.
|
protected |
|
protected |
|
protected |