mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2026-04-19 06:42:43 +00:00
Fixed RTL-TCP bug
This commit is contained in:
@@ -137,11 +137,17 @@ public:
|
||||
}
|
||||
|
||||
void receiveData(uint8_t* buf, size_t count) {
|
||||
int received = 0;
|
||||
int ret = 0;
|
||||
while (received < count) {
|
||||
#ifdef _WIN32
|
||||
recv(sock, (char*)buf, count, 0);
|
||||
ret = recv(sock, (char*)&buf[received], count - received, 0);
|
||||
#else
|
||||
(void)read(sockfd, buf, count);
|
||||
ret = read(sockfd, &buf[received], count - received);
|
||||
#endif
|
||||
if (ret <= 0) { return; }
|
||||
received += ret;
|
||||
}
|
||||
}
|
||||
|
||||
void setFrequency(double freq) {
|
||||
@@ -168,6 +174,10 @@ public:
|
||||
sendCommand(9, mode);
|
||||
}
|
||||
|
||||
void setOffsetTuning(bool enabled) {
|
||||
sendCommand(10, enabled);
|
||||
}
|
||||
|
||||
void setGainIndex(int index) {
|
||||
sendCommand(13, index);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user