bug fixes
This commit is contained in:
@@ -49,6 +49,19 @@ void PIProtocol::init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PIProtocol::setDevice(const string & dev_ip, int speed_port) {
|
||||||
|
if (type == PIProtocol::Serial) {
|
||||||
|
serial->setDevice(dev_ip);
|
||||||
|
serial->setSpeed(speed_port);
|
||||||
|
devName = dev_ip;
|
||||||
|
}
|
||||||
|
if (type == PIProtocol::Ethernet) {
|
||||||
|
ether->setReadAddress(dev_ip, speed_port);
|
||||||
|
devName = dev_ip + ":" + itos(speed_port);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void PIProtocol::setExpectedFrequency(float frequency)
|
void PIProtocol::setExpectedFrequency(float frequency)
|
||||||
{
|
{
|
||||||
exp_freq = frequency;
|
exp_freq = frequency;
|
||||||
|
|||||||
@@ -19,9 +19,10 @@ public:
|
|||||||
void stopReceive(); // stop receive
|
void stopReceive(); // stop receive
|
||||||
void startSend(float frequency = 20.f) {sendtimer->start(frequency > 0 ? 1000.f / frequency : 1000);} // start sending
|
void startSend(float frequency = 20.f) {sendtimer->start(frequency > 0 ? 1000.f / frequency : 1000);} // start sending
|
||||||
void stopSend() {sendtimer->stop();} // stop sending
|
void stopSend() {sendtimer->stop();} // stop sending
|
||||||
|
void setDevice(const string & dev_ip, int speed_port);
|
||||||
void setSendData(void * dataPtr, int dataSize) {sendDataPtr = (unsigned char * )dataPtr; sendDataSize = dataSize;}
|
void setSendData(void * dataPtr, int dataSize) {sendDataPtr = (unsigned char * )dataPtr; sendDataSize = dataSize;}
|
||||||
void setReceiveData(void * dataPtr, int dataSize) {this->dataPtr = (unsigned char * )dataPtr; this->dataSize = dataSize;}
|
void setReceiveData(void * dataPtr, int dataSize) {this->dataPtr = (unsigned char * )dataPtr; this->dataSize = dataSize;}
|
||||||
void setSendAddress(string ip, int port) {if (type == PIProtocol::Ethernet) ether->setReadAddress(ip, port);} // for Ethernet
|
void setSendAddress(string ip, int port) {if (type == PIProtocol::Ethernet) ether->setSendAddress(ip, port);} // for Ethernet
|
||||||
void setParameters(Flags<PISerial::Parameters> parameters) {if (type == PIProtocol::Serial) serial->setParameters(parameters);} // for RS
|
void setParameters(Flags<PISerial::Parameters> parameters) {if (type == PIProtocol::Serial) serial->setParameters(parameters);} // for RS
|
||||||
|
|
||||||
void setExpectedFrequency(float frequency); // for start diagnostic connection quality
|
void setExpectedFrequency(float frequency); // for start diagnostic connection quality
|
||||||
|
|||||||
Reference in New Issue
Block a user