PIIODevice::bytesAvailible()
fix pistringlist pibinarystream write pibinarystream::binaryStreamSize() PIByteArray pibinarystream read with more size fix pistring pibinarystream read optimization fix bug in PIIOBinaryStream read and write if failed workaround in PIIOString::readDevice PISPI readDevice bug Fixed
This commit is contained in:
@@ -88,6 +88,11 @@ bool PISPI::isParameterSet(PISPI::Parameters parameter) const {
|
||||
}
|
||||
|
||||
|
||||
ssize_t PISPI::bytesAvailible() const {
|
||||
return recv_buf.size();
|
||||
}
|
||||
|
||||
|
||||
bool PISPI::openDevice() {
|
||||
#ifdef PIP_SPI
|
||||
int ret = 0;
|
||||
@@ -126,7 +131,7 @@ bool PISPI::closeDevice() {
|
||||
int PISPI::readDevice(void * read_to, int max_size) {
|
||||
int sz = piMini(recv_buf.size_s(), max_size);
|
||||
memcpy(read_to, recv_buf.data(), sz);
|
||||
recv_buf.resize(recv_buf.size_s() - sz);
|
||||
recv_buf.remove(0, sz);
|
||||
return sz;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user