UartComIF check iter validity
This commit is contained in:
parent
90a1571707
commit
62873c3118
@ -453,9 +453,12 @@ ReturnValue_t UartComIF::flushUartRxBuffer(CookieIF *cookie) {
|
|||||||
}
|
}
|
||||||
deviceFile = uartCookie->getDeviceFile();
|
deviceFile = uartCookie->getDeviceFile();
|
||||||
uartDeviceMapIter = uartDeviceMap.find(deviceFile);
|
uartDeviceMapIter = uartDeviceMap.find(deviceFile);
|
||||||
int fd = uartDeviceMapIter->second.fileDescriptor;
|
if(uartDeviceMapIter != uartDeviceMap.end()) {
|
||||||
tcflush(fd, TCIFLUSH);
|
int fd = uartDeviceMapIter->second.fileDescriptor;
|
||||||
return RETURN_OK;
|
tcflush(fd, TCIFLUSH);
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
return RETURN_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t UartComIF::flushUartTxBuffer(CookieIF *cookie) {
|
ReturnValue_t UartComIF::flushUartTxBuffer(CookieIF *cookie) {
|
||||||
@ -468,9 +471,12 @@ ReturnValue_t UartComIF::flushUartTxBuffer(CookieIF *cookie) {
|
|||||||
}
|
}
|
||||||
deviceFile = uartCookie->getDeviceFile();
|
deviceFile = uartCookie->getDeviceFile();
|
||||||
uartDeviceMapIter = uartDeviceMap.find(deviceFile);
|
uartDeviceMapIter = uartDeviceMap.find(deviceFile);
|
||||||
int fd = uartDeviceMapIter->second.fileDescriptor;
|
if(uartDeviceMapIter != uartDeviceMap.end()) {
|
||||||
tcflush(fd, TCOFLUSH);
|
int fd = uartDeviceMapIter->second.fileDescriptor;
|
||||||
return RETURN_OK;
|
tcflush(fd, TCOFLUSH);
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
return RETURN_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t UartComIF::flushUartTxAndRxBuf(CookieIF *cookie) {
|
ReturnValue_t UartComIF::flushUartTxAndRxBuf(CookieIF *cookie) {
|
||||||
@ -483,9 +489,12 @@ ReturnValue_t UartComIF::flushUartTxAndRxBuf(CookieIF *cookie) {
|
|||||||
}
|
}
|
||||||
deviceFile = uartCookie->getDeviceFile();
|
deviceFile = uartCookie->getDeviceFile();
|
||||||
uartDeviceMapIter = uartDeviceMap.find(deviceFile);
|
uartDeviceMapIter = uartDeviceMap.find(deviceFile);
|
||||||
int fd = uartDeviceMapIter->second.fileDescriptor;
|
if(uartDeviceMapIter != uartDeviceMap.end()) {
|
||||||
tcflush(fd, TCIOFLUSH);
|
int fd = uartDeviceMapIter->second.fileDescriptor;
|
||||||
return RETURN_OK;
|
tcflush(fd, TCIOFLUSH);
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
return RETURN_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UartComIF::setUartMode(struct termios *options, UartCookie &uartCookie) {
|
void UartComIF::setUartMode(struct termios *options, UartCookie &uartCookie) {
|
||||||
|
Loading…
Reference in New Issue
Block a user