kopia lustrzana https://github.com/sh123/esp32_loraprs
Rename txQueue to txKissQueue
rodzic
6788868b59
commit
ca0fd531e0
|
@ -7,7 +7,7 @@ Service::Service()
|
||||||
, kissCmd_(KissCmd::NoCmd)
|
, kissCmd_(KissCmd::NoCmd)
|
||||||
, csmaP_(CfgCsmaPersistence)
|
, csmaP_(CfgCsmaPersistence)
|
||||||
, csmaSlotTime_(CfgCsmaSlotTimeMs)
|
, csmaSlotTime_(CfgCsmaSlotTimeMs)
|
||||||
, txQueue_(new cppQueue(sizeof(unsigned char), CfgLoraTxQueueSize))
|
, kissTxQueue_(new cppQueue(sizeof(unsigned char), CfgLoraTxQueueSize))
|
||||||
, serialBt_()
|
, serialBt_()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -329,22 +329,22 @@ void Service::onLoraDataAvailable(int packetSize)
|
||||||
|
|
||||||
void Service::processTx()
|
void Service::processTx()
|
||||||
{
|
{
|
||||||
while (serialBt_.available() || !txQueue_->isEmpty()) {
|
while (serialBt_.available() || !kissTxQueue_->isEmpty()) {
|
||||||
|
|
||||||
if (serialBt_.available()) {
|
if (serialBt_.available()) {
|
||||||
int rxResult = serialBt_.read();
|
int rxResult = serialBt_.read();
|
||||||
if (rxResult != -1) {
|
if (rxResult != -1) {
|
||||||
byte rxByte = (byte)rxResult;
|
byte rxByte = (byte)rxResult;
|
||||||
if (!txQueue_->push((void *)&rxByte)) {
|
if (!kissTxQueue_->push((void *)&rxByte)) {
|
||||||
Serial.println("TX queue is full");
|
Serial.println("TX queue is full");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!txQueue_->isEmpty()) {
|
if (!kissTxQueue_->isEmpty()) {
|
||||||
byte qRxByte;
|
byte qRxByte;
|
||||||
if (txQueue_->peek((void *)&qRxByte)) {
|
if (kissTxQueue_->peek((void *)&qRxByte)) {
|
||||||
if (kissReceiveByte(qRxByte)) {
|
if (kissReceiveByte(qRxByte)) {
|
||||||
txQueue_->drop();
|
kissTxQueue_->drop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,7 +114,7 @@ private:
|
||||||
long previousBeaconMs_;
|
long previousBeaconMs_;
|
||||||
byte csmaP_;
|
byte csmaP_;
|
||||||
long csmaSlotTime_;
|
long csmaSlotTime_;
|
||||||
std::shared_ptr<cppQueue>txQueue_;
|
std::shared_ptr<cppQueue>kissTxQueue_;
|
||||||
|
|
||||||
// peripherals
|
// peripherals
|
||||||
BluetoothSerial serialBt_;
|
BluetoothSerial serialBt_;
|
||||||
|
|
Ładowanie…
Reference in New Issue