kopia lustrzana https://github.com/sh123/esp32_loraprs
Simplify repeated code
rodzic
1300b7c0ce
commit
08f3bcb413
|
@ -421,23 +421,12 @@ bool Service::onSerialRxHasData()
|
|||
|
||||
bool Service::onSerialRx(byte *b)
|
||||
{
|
||||
if (config_.BtEnableBle) {
|
||||
int rxResult = serialBLE_.read();
|
||||
if (rxResult == -1) {
|
||||
return false;
|
||||
}
|
||||
*b = (byte)rxResult;
|
||||
return true;
|
||||
}
|
||||
|
||||
else {
|
||||
int rxResult = serialBt_.read();
|
||||
if (rxResult == -1) {
|
||||
return false;
|
||||
}
|
||||
*b = (byte)rxResult;
|
||||
return true;
|
||||
int rxResult = config_.BtEnableBle ? serialBLE_.read() : serialBt_.read();
|
||||
if (rxResult == -1) {
|
||||
return false;
|
||||
}
|
||||
*b = (byte)rxResult;
|
||||
return true;
|
||||
}
|
||||
|
||||
void Service::onControlCommand(Cmd cmd, byte value)
|
||||
|
|
Ładowanie…
Reference in New Issue