kopia lustrzana https://github.com/sh123/esp32_loraprs
Bug fixing
rodzic
42395ab18c
commit
5bd632a73c
|
@ -544,25 +544,23 @@ void Service::onRigTxEnd()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WiFiClient Service::getClient()
|
bool Service::getClient(WiFiClient &activeClient)
|
||||||
{
|
{
|
||||||
if (config_.KissEnableTcpIp) {
|
if (config_.KissEnableTcpIp) {
|
||||||
WiFiClient client = kissServer_->available();
|
WiFiClient wifiClient = kissServer_->available();
|
||||||
if (client) {
|
if (wifiClient && wifiClient.connected()) {
|
||||||
|
activeClient = wifiClient;
|
||||||
if (client.connected()) {
|
return true;
|
||||||
Serial.println("Connected to client");
|
|
||||||
}
|
|
||||||
return client;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Service::onSerialTx(byte b)
|
void Service::onSerialTx(byte b)
|
||||||
{
|
{
|
||||||
if (WiFiClient client = getClient()) {
|
WiFiClient wifiClient;
|
||||||
client.write(b);
|
if (getClient(wifiClient)) {
|
||||||
|
wifiClient.write(b);
|
||||||
}
|
}
|
||||||
else if (config_.BtEnableBle) {
|
else if (config_.BtEnableBle) {
|
||||||
serialBLE_.write(b);
|
serialBLE_.write(b);
|
||||||
|
@ -574,8 +572,10 @@ void Service::onSerialTx(byte b)
|
||||||
|
|
||||||
bool Service::onSerialRxHasData()
|
bool Service::onSerialRxHasData()
|
||||||
{
|
{
|
||||||
if (WiFiClient client = getClient()) {
|
WiFiClient wifiClient;
|
||||||
return client.available();
|
if (getClient(wifiClient)) {
|
||||||
|
Serial.println("!!!");
|
||||||
|
return wifiClient.available();
|
||||||
}
|
}
|
||||||
else if (config_.BtEnableBle) {
|
else if (config_.BtEnableBle) {
|
||||||
return serialBLE_.available();
|
return serialBLE_.available();
|
||||||
|
@ -589,8 +589,9 @@ bool Service::onSerialRx(byte *b)
|
||||||
{
|
{
|
||||||
int rxResult;
|
int rxResult;
|
||||||
|
|
||||||
if (WiFiClient client = getClient()) {
|
WiFiClient wifiClient;
|
||||||
rxResult = client.read();
|
if (getClient(wifiClient)) {
|
||||||
|
rxResult = wifiClient.read();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rxResult = config_.BtEnableBle
|
rxResult = config_.BtEnableBle
|
||||||
|
|
|
@ -49,7 +49,7 @@ private:
|
||||||
#endif
|
#endif
|
||||||
void onAprsisDataAvailable();
|
void onAprsisDataAvailable();
|
||||||
|
|
||||||
WiFiClient getClient();
|
bool getClient(WiFiClient &activeClient);
|
||||||
|
|
||||||
void sendSignalReportEvent(int rssi, float snr);
|
void sendSignalReportEvent(int rssi, float snr);
|
||||||
void sendPeriodicBeacon();
|
void sendPeriodicBeacon();
|
||||||
|
|
Ładowanie…
Reference in New Issue